Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xeno turrets now scan surroundings every tick. Buffs hugger turret. Sentient facehugger from hugger turret. #711

Merged
merged 24 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions code/__DEFINES/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ GLOBAL_LIST_INIT(restricted_camera_networks, list( //Those networks can only be
#define NIGHTFALL_IMMUNE 3
#define NO_LIGHT_STATE_CHANGE 4

//Xeno turrets define
#define TURRET_SCAN_RANGE 25
#define TURRET_SCAN_FREQUENCY 10 SECONDS
#define TURRET_HEALTH_REGEN 8

//Unmanned vehicle define
#define OVERLAY_TURRET (1<<0)
#define HAS_HEADLIGHTS (1<<1)
Expand Down
8 changes: 2 additions & 6 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
//Xeno structure flags
#define IGNORE_WEED_REMOVAL (1<<0)
#define HAS_OVERLAY (1<<1)
#define CRITICAL_STRUCTURE (1<<2)
#define DEPART_DESTRUCTION_IMMUNE (1<<3)
#define CRITICAL_STRUCTURE (1<<1)
#define DEPART_DESTRUCTION_IMMUNE (1<<2)

//Weeds defines
#define WEED "weed sac"
#define STICKY_WEED "sticky weed sac"
#define RESTING_WEED "resting weed sac"
#define AUTOMATIC_WEEDING "repeating"

#define XENO_TURRET_ACID_ICONSTATE "acid_turret"
#define XENO_TURRET_STICKY_ICONSTATE "resin_turret"

//Plant defines
#define HEAL_PLANT "life fruit"
#define ARMOR_PLANT "hard fruit"
Expand Down
16 changes: 16 additions & 0 deletions code/__HELPERS/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
if(get_dist(source, nearby_illusion) > distance)
continue
. += nearby_illusion

///Returns a list of vehicles via get_dist and same z level method, very cheap compared to range()
/proc/cheap_get_tanks_near(atom/movable/source, distance)
. = list()
Expand All @@ -81,6 +82,21 @@
continue
. += nearby_tank

///Returns a list of unmanned vehicles via get_dist and same z level method, very cheap compared to range()
/proc/cheap_get_unmanned_vehicles_near(atom/movable/source, distance)
. = list()
var/turf/source_turf = get_turf(source)
if(!source_turf)
return
for(var/obj/vehicle/unmanned/nearby_unmanned_vehicle AS in GLOB.unmanned_vehicles)
if(isnull(nearby_unmanned_vehicle))
continue
if(source_turf.z != nearby_unmanned_vehicle.z)
continue
if(get_dist(source_turf, nearby_unmanned_vehicle) > distance)
continue
. += nearby_unmanned_vehicle

///Returns the nearest target that has the right target flag
/proc/get_nearest_target(atom/source, distance, target_flags, attacker_faction, attacker_hive)
if(!source)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
/obj/structure/xeno/silo/AIMiddleClick(mob/living/silicon/ai/user)
user.ai_ping(src, COOLDOWN_AI_PING_EXTRA_LOW)

/obj/structure/xeno/xeno_turret/AIMiddleClick(mob/living/silicon/ai/user)
/obj/structure/xeno/turret/AIMiddleClick(mob/living/silicon/ai/user)
user.ai_ping(src, COOLDOWN_AI_PING_EXTRA_LOW)

/obj/structure/xeno/evotower/AIMiddleClick(mob/living/silicon/ai/user)
Expand Down
16 changes: 16 additions & 0 deletions code/datums/actions/observer_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@
var/list/area_namecounts = list()
var/name

for(var/obj/structure/xeno/turret/potential_turret AS in GLOB.xeno_resin_turrets_by_hive[XENO_HIVE_NORMAL])
if(dead_owner.z != potential_turret.z)
continue
if(!istype(potential_turret, /obj/structure/xeno/turret/facehugger))
continue
var/area/area = get_area(potential_turret)
if(area in area_names)
area_namecounts[area]++
name = "[potential_turret.name] at [area] ([area_namecounts[area]])"
else
area_names.Add(area)
area_namecounts[area] = 1
name = "[potential_turret.name] at [get_area(potential_turret)]"

spawn_point[name] = potential_turret

for(var/mob/living/carbon/xenomorph/potential_xeno AS in GLOB.alive_xeno_list)
if(dead_owner.z != potential_xeno.z)
continue
Expand Down
2 changes: 1 addition & 1 deletion code/datums/gamemodes/infestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
for(var/i in GLOB.xeno_jelly_pod_turfs)
new /obj/structure/xeno/resin_jelly_pod(i, XENO_HIVE_NORMAL)
for(var/i in GLOB.xeno_turret_turfs)
new /obj/structure/xeno/xeno_turret(i, XENO_HIVE_NORMAL)
new /obj/structure/xeno/turret(i, XENO_HIVE_NORMAL)

/datum/game_mode/infestation/process()
if(round_finished)
Expand Down
33 changes: 17 additions & 16 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

/obj/effect/landmark/xeno_resin_wall/Initialize(mapload)
GLOB.xeno_resin_wall_turfs += loc
..()
. = ..()
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/xeno_silo_spawn
Expand All @@ -192,7 +192,7 @@

/obj/effect/landmark/xeno_tunnel_spawn/Initialize(mapload)
GLOB.xeno_tunnel_spawn_turfs += loc
..()
. = ..()
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/resin_jelly_pod
Expand All @@ -202,17 +202,17 @@

/obj/effect/landmark/resin_jelly_pod/Initialize(mapload)
GLOB.xeno_jelly_pod_turfs += loc
..()
. = ..()
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/xeno_turret
name = "xeno turret landmark"
icon = 'icons/Xeno/acidturret.dmi'
icon_state = XENO_TURRET_ACID_ICONSTATE
icon_state = "acid_turret"

/obj/effect/landmark/xeno_turret/Initialize(mapload)
GLOB.xeno_turret_turfs += loc
..()
. = ..()
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/nuke_spawn
Expand All @@ -229,7 +229,7 @@

/obj/effect/landmark/dropship_start_location/Initialize(mapload)
GLOB.minidropship_start_loc = loc
..()
. = ..()
return INITIALIZE_HINT_QDEL

/obj/effect/landmark/weapon_spawn
Expand Down Expand Up @@ -464,18 +464,19 @@
/obj/effect/landmark/weapon_spawn/tier6_weapon_spawn
name = "Tier meme Weapon Spawn"
icon_state = "weapon6"
weapon_list = list( /obj/item/weapon/gun/pistol/chimp,
/obj/item/weapon/banhammer,
/obj/item/weapon/chainsword,
)
weapon_list = list(
/obj/item/weapon/gun/pistol/chimp,
/obj/item/weapon/banhammer,
/obj/item/weapon/chainsword,
)

/obj/effect/landmark/sensor_tower
name = "Sensor tower"
icon = 'icons/obj/structures/sensor.dmi'
icon_state = "sensor_loyalist"

/obj/effect/landmark/sensor_tower/Initialize(mapload)
..()
. = ..()
GLOB.sensor_towers += loc
return INITIALIZE_HINT_QDEL

Expand Down Expand Up @@ -516,7 +517,7 @@
icon_state = "pinonfar"

/obj/effect/landmark/xenoden_docking_port/Initialize(mapload)
..()
. = ..()
GLOB.xenoden_docking_ports_locs += loc
return INITIALIZE_HINT_QDEL

Expand All @@ -526,7 +527,7 @@
icon_state = "weed_silo"

/obj/effect/landmark/xenoden_core/Initialize(mapload)
..()
. = ..()
GLOB.xenoden_cores_locs += loc
return INITIALIZE_HINT_QDEL

Expand All @@ -536,7 +537,7 @@
icon_state = "sensor"

/obj/effect/landmark/sensor_tower_infestation_ground/Initialize(mapload)
..()
. = ..()
GLOB.sensor_towers_infestation_ground += loc
return INITIALIZE_HINT_QDEL

Expand All @@ -546,7 +547,7 @@
icon_state = "sensor"

/obj/effect/landmark/sensor_tower_infestation_caves/Initialize(mapload)
..()
. = ..()
GLOB.sensor_towers_infestation_caves += loc
return INITIALIZE_HINT_QDEL

Expand All @@ -556,7 +557,7 @@
icon_state = "comm_tower"

/obj/effect/landmark/tower_relay/Initialize(mapload)
..()
. = ..()
GLOB.tower_relay_locs += loc
return INITIALIZE_HINT_QDEL

Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
if(tier != XENO_TIER_MINION && hivenumber == XENO_HIVE_NORMAL)
GLOB.key_to_time_of_xeno_death[ghost.key] = world.time //If you ghost as a xeno that is not a minion, sets respawn timer


/mob/dead/observer/Move(atom/newloc, direct, glide_size_override = 32)
if(updatedir)
setDir(direct)//only update dir if we actually need it, so overlays won't spin on base sprites that don't have directions of their own
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ GLOBAL_LIST_INIT(hugger_images_list, list(
to_chat(owner, span_xenowarning("No weeds here!"))
return FALSE

if(!T.check_alien_construction(owner, silent, /obj/structure/xeno/xeno_turret) || !T.check_disallow_alien_fortification(owner))
if(!T.check_alien_construction(owner, silent, /obj/structure/xeno/turret) || !T.check_disallow_alien_fortification(owner))
return FALSE

for(var/obj/structure/xeno/xeno_turret/turret AS in GLOB.xeno_resin_turrets_by_hive[blocker.hivenumber])
for(var/obj/structure/xeno/turret/turret AS in GLOB.xeno_resin_turrets_by_hive[blocker.hivenumber])
if(get_dist(turret, owner) < 6)
if(!silent)
to_chat(owner, span_xenowarning("Another turret is too close!"))
Expand All @@ -364,7 +364,7 @@ GLOBAL_LIST_INIT(hugger_images_list, list(
return FALSE

var/mob/living/carbon/xenomorph/carrier/caster = owner
var/obj/structure/xeno/xeno_turret/hugger_turret/turret = new (get_turf(owner), caster.hivenumber)
var/obj/structure/xeno/turret/facehugger/turret = new (get_turf(owner), caster.hivenumber)
turret.ammo = GLOB.ammo_list[GLOB.hugger_to_ammo[caster.selected_hugger_type]]
succeed_activate()
add_cooldown()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/charge_crush.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@

if(isobj(crushed))
var/obj/crushed_obj = crushed
if(istype(crushed_obj, /obj/structure/xeno/silo) || istype(crushed_obj, /obj/structure/xeno/xeno_turret))
if(istype(crushed_obj, /obj/structure/xeno/silo) || istype(crushed_obj, /obj/structure/xeno/turret))
return precrush2signal(crushed_obj.post_crush_act(charger, src))
playsound(crushed_obj.loc, "punch", 25, 1)
var/crushed_behavior = crushed_obj.crushed_special_behavior()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
//Observers can become playable facehuggers by clicking on the egg
/obj/alien/egg/hugger/attack_ghost(mob/dead/observer/user)
. = ..()
var/datum/hive_status/hive = GLOB.hive_datums[hivenumber]

if(maturity_stage != stage_ready_to_burst)
return FALSE
if(!hugger_type)
return FALSE

var/datum/hive_status/hive = GLOB.hive_datums[hivenumber]
if(!hive.can_spawn_as_hugger(user))
return FALSE

Expand Down Expand Up @@ -137,7 +137,7 @@
F.balloon_alert(F, span_xenowarning("We can't use this egg"))
return

F.visible_message(span_xenowarning("[F] slides back into [src]."),span_xenonotice("You slides back into [src]."))
F.visible_message(span_xenowarning("[F] slides back into [src]."),span_xenonotice("You slide back into [src]."))
F.ghostize()
F.death(deathmessage = "get inside the egg", silent = TRUE)
qdel(F)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/hive_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
for(var/obj/structure/xeno/silo/resin_silo AS in GLOB.xeno_resin_silos_by_hive[hivenumber])
.["hive_structures"] += list(get_structure_packet(resin_silo))
// Acid, sticky, and hugger turrets.
for(var/obj/structure/xeno/xeno_turret/turret AS in GLOB.xeno_resin_turrets_by_hive[hivenumber])
for(var/obj/structure/xeno/turret/turret AS in GLOB.xeno_resin_turrets_by_hive[hivenumber])
.["hive_structures"] += list(get_structure_packet(turret))
// Psychic relays
for(var/obj/structure/xeno/psychictower/tower AS in GLOB.hive_datums[hivenumber].psychictowers)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ GLOBAL_LIST_INIT(tier_to_primo_upgrade, list(
///How long to build one turret
var/build_time = 10 SECONDS
///What type of turret is built
var/turret_type = /obj/structure/xeno/xeno_turret
var/turret_type = /obj/structure/xeno/turret

/datum/hive_upgrade/defence/turret/can_buy(mob/living/carbon/xenomorph/buyer, silent = TRUE)
. = ..()
Expand All @@ -324,10 +324,10 @@ GLOBAL_LIST_INIT(tier_to_primo_upgrade, list(
to_chat(buyer, span_xenowarning("No weeds here!"))
return FALSE

if(!T.check_alien_construction(buyer, silent, /obj/structure/xeno/xeno_turret) || !T.check_disallow_alien_fortification(buyer))
if(!T.check_alien_construction(buyer, silent, /obj/structure/xeno/turret) || !T.check_disallow_alien_fortification(buyer))
return FALSE

for(var/obj/structure/xeno/xeno_turret/turret AS in GLOB.xeno_resin_turrets_by_hive[blocker.hivenumber])
for(var/obj/structure/xeno/turret/turret AS in GLOB.xeno_resin_turrets_by_hive[blocker.hivenumber])
if(get_dist(turret, buyer) < 6)
if(!silent)
to_chat(buyer, span_xenowarning("Another turret is too close!"))
Expand Down Expand Up @@ -355,7 +355,7 @@ GLOBAL_LIST_INIT(tier_to_primo_upgrade, list(
desc = "Places a sticky spit spitting resin turret under you. Must be at least 6 tiles away from other turrets, not near fog and on a weeded area."
icon = "resinturret"
psypoint_cost = 50
turret_type = /obj/structure/xeno/xeno_turret/sticky
turret_type = /obj/structure/xeno/turret/sticky

/datum/hive_upgrade/xenos
category = "Xenos"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/projectiles/ammo_datums/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,15 +573,15 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh

/datum/ammo/xeno/hugger/on_hit_mob(mob/M, obj/projectile/proj)
var/obj/item/clothing/mask/facehugger/hugger = new hugger_type(get_turf(M), hivenumber)
hugger.go_idle()
hugger.Attach(M)

/datum/ammo/xeno/hugger/on_hit_obj(obj/O, obj/projectile/proj)
var/obj/item/clothing/mask/facehugger/hugger = new hugger_type(get_turf(O), hivenumber)
hugger.go_idle()
hugger.go_active()

/datum/ammo/xeno/hugger/on_hit_turf(turf/T, obj/projectile/P)
var/obj/item/clothing/mask/facehugger/hugger = new hugger_type(T.density ? P.loc : T, hivenumber)
hugger.go_idle()
hugger.go_active()

/datum/ammo/xeno/hugger/do_at_max_range(turf/T, obj/projectile/P)
var/obj/item/clothing/mask/facehugger/hugger = new hugger_type(T.density ? P.loc : T, hivenumber)
Expand Down
Loading
Loading