Skip to content

Commit

Permalink
Fixes giant lizard code breaking when disarmed, and adds some minor f…
Browse files Browse the repository at this point in the history
…eatures to the mob (cmss13-devs#7025)

# About the pull request

stops the code from breaking when getting disarmed
they'll no longer move a tile before resting
fixes factions being constantly added by feeding them even if they were
an ally beforehand (also stops the message spam)
fixes (sloppily) a weird bug where the mob would start moving even
though its sprite shows it as incapacitated.
fixes (hopefully) a bug where they would never lose their target_mob
when they get stuck in alert stance somehow, which would lead them to
becoming inert rocks.
fixes preds taming lizards not working (their faction_group was set to
NETURAL, so their actual faction was never added as an ally)
what did i learn? NEVER TRUST BYOND'S INBUILT PATHFINDING PROCS TO WORK 

also adds code for breaking structures, both for the lizard AI and a
player-controller one. touches up some minor things, like retreating.
they will now switch targets if they get damaged and their original one
is far away
they can now vault over window frames and tables
the range for losing targets is now increased which lets skirmishes last
longer and better (hopefully?).
lizards will now respawn once after a random amount of time if the
current number of alive lizards is small
they'll now eat anything that has meat protein in it 
damage against xenos is increased by a 1/3rd more or less
adds tongue flickering
adds wound overlays

# Explain why it's good for the game

firstly, bug is bad.
secondly the other changes are something i've noticed to be needed while
observing a few rounds:

1. structure destruction is a good touch since they had no way of
breaking things before.
2. considering it's a mob similar to a runner, and is fast and nimble, i
don't see any reason why it wouldn't be able to vault over tables and
window frames. it helps it fight in urban areas.
3. retreat times are lowered because if they get stuck retreating, the
long length of the retreat would end in their death due to no valid
escapes.
4. target switching stops the mob from ignoring an entire group of
enemies just to attack someone who sneezed on it and is far away
5. lizards respawning will help keep the outer areas a bit more
dangerous even later in the round, and it allows for marines to interact
with them even if they got kidnapped/killed by survivors or xenos early
into the round
6. checking for meat protein is better than only comparing it to some
list. the list is still there due to some MRE snacks not having protein
and resin fruit not having any at all
7. even though xenos might be the perfect lifeform, i'd like it if these
guys proved more of a threat than just a slight annoyance to xenos.
right now the only threat they pose is if two of them swarm a runner.
8. tongue flickering is a neat little addition, and it replaces a boring
text emote
9. wound overlays are a very good way of roughly displaying the HP of
the mob instead of being forced to either guess or examine it midcombat

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl: VileBeggar, SubjectD9341
add: Giant lizards are now capable of breaking structures and their
combat capabilities are slightly enhanced. Several other tweaks and
minor additions have been made, such as wound overlays and tongue
flickering.
add: After a random amount of time, a 2nd wave of lizards might pop up
in the jungles if their numbers are too low.
fix: Giant lizards no longer become paralyzed after getting disarmed,
nor will they randomly become paralyzed due to weird combat logic.
/:cl:

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
VileBeggar and hry-gh authored Oct 9, 2024
1 parent 5164b49 commit fa21a05
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 53 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ DEFINE_BITFIELD(whitelist_status, list(
#define FACTION_LIST_MARINE_WY list(FACTION_MARINE, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY)
#define FACTION_LIST_MARINE_UPP list(FACTION_MARINE, FACTION_UPP)
#define FACTION_LIST_MARINE_TWE list(FACTION_MARINE, FACTION_TWE)
#define FACTION_LIST_YAUTJA list(FACTION_YAUTJA)

// Xenomorphs
#define FACTION_PREDALIEN "Predalien"
Expand Down
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)
1 change: 1 addition & 0 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Additional game mode variables.
player.mind_initialize() //Will work on ghosts too, but won't add them to active minds.
player.mind.setup_human_stats()
player.faction = FACTION_YAUTJA
player.faction_group = FACTION_LIST_YAUTJA
players += player.mind
return players

Expand Down
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 4

/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(35 MINUTES, 50 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)), rand(15 MINUTES, 25 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: 2 additions & 0 deletions code/modules/gear_presets/yautja.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
languages = list(LANGUAGE_YAUTJA)
rank = "Predator"
faction = FACTION_YAUTJA
faction_group = FACTION_LIST_YAUTJA
uses_special_name = TRUE
skills = /datum/skills/yautja/warrior

Expand All @@ -23,6 +24,7 @@
/datum/equipment_preset/yautja/load_id(mob/living/carbon/human/new_human)
new_human.job = rank
new_human.faction = faction
new_human.faction_group = faction_group

/datum/equipment_preset/yautja/load_vanity(mob/living/carbon/human/new_human)
return //No vanity items for Yautja!
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 fa21a05

Please sign in to comment.