Skip to content

Commit

Permalink
TGS Test Merge (#7025)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Aug 26, 2024
2 parents 2bd89a7 + a2771a8 commit 1a70d31
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 45 deletions.
3 changes: 3 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ GLOBAL_VAR(xeno_queue_candidate_count)
GLOBAL_VAR(obfs_x)
/// A number between -500 and 500.
GLOBAL_VAR(obfs_y)

/// The current amount of giant lizards that are alive.
GLOBAL_VAR_INIT(giant_lizards_alive, 0)
18 changes: 18 additions & 0 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
GLOB.monkey_spawns -= src
return ..()

#define MAXIMUM_LIZARD_AMOUNT 5

/obj/effect/landmark/lizard_spawn
name = "lizard spawn"
icon_state = "lizard_spawn"
Expand All @@ -129,6 +131,22 @@
. = ..()
if(prob(66))
new /mob/living/simple_animal/hostile/retaliate/giant_lizard(loc)
addtimer(CALLBACK(src, PROC_REF(latespawn_lizard)), rand(30 MINUTES, 45 MINUTES))

/obj/effect/landmark/lizard_spawn/proc/latespawn_lizard()
//if there's already a ton of lizards alive, try again later
if(GLOB.giant_lizards_alive > MAXIMUM_LIZARD_AMOUNT)
addtimer(CALLBACK(src, PROC_REF(latespawn_lizard)), 10 MINUTES)
return
//if there's a living mob that can witness the spawn then try again later
for(var/mob/living/living_mob in range(7, src))
if(living_mob.stat != DEAD || living_mob.client)
continue
addtimer(CALLBACK(src, PROC_REF(latespawn_lizard)), 1 MINUTES)
return
new /mob/living/simple_animal/hostile/retaliate/giant_lizard(loc)

#undef MAXIMUM_LIZARD_AMOUNT

/obj/effect/landmark/latewhiskey
name = "Whiskey Outpost Late join"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
return 0

if(!gibbed)
visible_message("<b>\The [src.name]</b> [deathmessage]")
visible_message("<b>[src.name]</b> [deathmessage]")

if(cause_data && !istype(cause_data))
stack_trace("death called with string cause ([cause_data]) instead of datum")
Expand Down
Loading

0 comments on commit 1a70d31

Please sign in to comment.