From 24ac869ffce2bb50cea0c1cd4ae308b03c17fbb9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 26 May 2023 11:11:08 +0100 Subject: [PATCH] [MIRROR] Turns lightgeists into a basic mob [MDB IGNORE] (#21429) * Turns lightgeists into a basic mob (#75626) ## About The Pull Request https://www.youtube.com/watch?v=bcUuqKrnvVY <- me getting rid of every simple animal one thing at a time Turns lightgeists into a basic mob. There are a few key advantages into its implementation that was previously impossible in the simple animal framework, which is entirely possible now. ## Why It's Good For The Game Lightgeists can actually have a bit of AI now, as a treat. They didn't have it prior because I assume if they attacked anything, they would end up healing it, and we didn't really have an option in the simple animal AI to say "do not attack"... This really fixes that so they can wander around a bit and look cute if some admin decides to spawn them in (but the only way to get them outright is to use the anomalous crystal, which auto-assigns a player). You don't see the AI if a player ghosts out of the lightgeist because the lightgeist will delete itself on ghost (previous behavior). It also gets rid of some janky AttackingTarget() override that was completely un-needed post-#73202. ## Changelog Nothing really player facing. * Turns lightgeists into a basic mob --------- Co-authored-by: san7890 --- .../LavaRuins/lavaland_surface_gaia.dmm | 6 +-- code/modules/events/scrubber_clog.dm | 6 +-- .../space_fauna}/lightgeist.dm | 48 ++++++++++--------- .../hostile/megafauna/colossus.dm | 8 ++-- .../unit_tests/simple_animal_freeze.dm | 1 - tgstation.dme | 2 +- .../75626_simple_to_basic_lightgeists.txt | 1 + 7 files changed, 37 insertions(+), 35 deletions(-) rename code/modules/mob/living/{simple_animal/hostile => basic/space_fauna}/lightgeist.dm (63%) create mode 100644 tools/UpdatePaths/Scripts/75626_simple_to_basic_lightgeists.txt diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_gaia.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_gaia.dmm index 60d7cd03bfe..b34c93c8210 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_gaia.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_gaia.dmm @@ -52,8 +52,7 @@ /turf/open/misc/grass/lavaland, /area/ruin/unpowered/gaia) "p" = ( -/mob/living/simple_animal/hostile/lightgeist{ - AIStatus = 1; +/mob/living/basic/lightgeist{ light_color = "#42ECFF" }, /turf/open/misc/grass/lavaland, @@ -89,8 +88,7 @@ /area/ruin/unpowered/gaia) "B" = ( /obj/structure/flora/grass/jungle/a/style_random, -/mob/living/simple_animal/hostile/lightgeist{ - AIStatus = 1; +/mob/living/basic/lightgeist{ light_color = "#42ECFF" }, /turf/open/misc/grass/lavaland, diff --git a/code/modules/events/scrubber_clog.dm b/code/modules/events/scrubber_clog.dm index ae7a9092744..fb0f88a2e5c 100644 --- a/code/modules/events/scrubber_clog.dm +++ b/code/modules/events/scrubber_clog.dm @@ -210,10 +210,10 @@ /datum/round_event/scrubber_clog/strange/get_mob() var/static/list/mob_list = list( - /mob/living/simple_animal/hostile/retaliate/goose, //Janitors HATE geese. + /mob/living/basic/lightgeist, /mob/living/simple_animal/hostile/bear, - /mob/living/simple_animal/pet/gondola, /mob/living/simple_animal/hostile/mushroom, - /mob/living/simple_animal/hostile/lightgeist, + /mob/living/simple_animal/hostile/retaliate/goose, //Janitors HATE geese. + /mob/living/simple_animal/pet/gondola, ) return pick(mob_list) diff --git a/code/modules/mob/living/simple_animal/hostile/lightgeist.dm b/code/modules/mob/living/basic/space_fauna/lightgeist.dm similarity index 63% rename from code/modules/mob/living/simple_animal/hostile/lightgeist.dm rename to code/modules/mob/living/basic/space_fauna/lightgeist.dm index a3cd15b4bcb..5cb9bb2b39b 100644 --- a/code/modules/mob/living/simple_animal/hostile/lightgeist.dm +++ b/code/modules/mob/living/basic/space_fauna/lightgeist.dm @@ -1,14 +1,15 @@ /** - * A small critter meant to heal other living mobs and unable to interact with almost everything else. - * The procs related to its unarmed attacks can be found in _onclick/other_mobs.dm (attack_lightgeist) + * ## Lightgeists + * + * Small critters meant to heal other living mobs and unable to interact with almost everything else. + * */ -/mob/living/simple_animal/hostile/lightgeist +/mob/living/basic/lightgeist name = "lightgeist" desc = "This small floating creature is a completely unknown form of life... being near it fills you with a sense of tranquility." icon_state = "lightgeist" icon_living = "lightgeist" icon_dead = "butterfly_dead" - turns_per_move = 1 response_help_continuous = "waves away" response_help_simple = "wave away" response_disarm_continuous = "brushes aside" @@ -18,12 +19,12 @@ speak_emote = list("oscillates") maxHealth = 2 health = 2 - harm_intent_damage = 5 melee_damage_lower = 5 melee_damage_upper = 5 friendly_verb_continuous = "taps" friendly_verb_simple = "tap" density = FALSE + basic_mob_flags = DEL_ON_DEATH pass_flags = PASSTABLE | PASSGRILLE | PASSMOB mob_size = MOB_SIZE_TINY gold_core_spawnable = HOSTILE_SPAWN @@ -35,17 +36,24 @@ damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) light_range = 4 faction = list(FACTION_NEUTRAL) - del_on_death = TRUE unsuitable_atmos_damage = 0 - minbodytemp = 0 - maxbodytemp = 1500 + minimum_survivable_temperature = 0 + maximum_survivable_temperature = 1500 obj_damage = 0 environment_smash = ENVIRONMENT_SMASH_NONE - AIStatus = AI_OFF - stop_automated_movement = TRUE -/mob/living/simple_animal/hostile/lightgeist/Initialize(mapload) + ai_controller = /datum/ai_controller/basic_controller/lightgeist + +/mob/living/basic/lightgeist/Initialize(mapload) . = ..() + ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) + + remove_verb(src, /mob/living/verb/pulled) + remove_verb(src, /mob/verb/me_verb) + + var/datum/atom_hud/medical_sensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] + medical_sensor.show_to(src) + AddElement(/datum/element/simple_flying) AddComponent(\ /datum/component/healing_touch,\ @@ -57,19 +65,15 @@ complete_text = "%TARGET%'s wounds mend together.",\ ) - remove_verb(src, /mob/living/verb/pulled) - remove_verb(src, /mob/verb/me_verb) - var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - medsensor.show_to(src) - ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) - -/mob/living/simple_animal/hostile/lightgeist/ghost() +/mob/living/basic/lightgeist/ghost() . = ..() if(.) death() -/mob/living/simple_animal/hostile/lightgeist/AttackingTarget() - if(istype(target, /obj/structure/ladder)) //special case where lightgeists can use ladders properly. - var/obj/structure/ladder/laddy = target - laddy.use(src) +/// This is a bit neutered since these aren't intended to exist outside of player control, but it's a bit weird to just have these guys be completely stationary. +/// No attacking or anything like that, though. Just something so they seem alive. +/datum/ai_controller/basic_controller/lightgeist + ai_traits = STOP_MOVING_WHEN_PULLED + ai_movement = /datum/ai_movement/basic_avoidance + idle_behavior = /datum/idle_behavior/idle_random_walk/less_walking diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 9caaf03df62..fc18230a039 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -526,10 +526,10 @@ if(.) return if(ready_to_deploy) - var/be_helper = tgui_alert(usr,"Become a Lightgeist? (Warning, You can no longer be revived!)",,list("Yes","No")) - if(be_helper == "Yes" && !QDELETED(src) && isobserver(user)) - var/mob/living/simple_animal/hostile/lightgeist/W = new /mob/living/simple_animal/hostile/lightgeist(get_turf(loc)) - W.key = user.key + var/be_helper = tgui_alert(usr, "Become a Lightgeist? (Warning, You can no longer be revived!)", "Lightgeist Deployment", list("Yes", "No")) + if((be_helper == "Yes") && !QDELETED(src) && isobserver(user)) + var/mob/living/basic/lightgeist/deployable = new(get_turf(loc)) + deployable.key = user.key /obj/machinery/anomalous_crystal/helpers/Topic(href, href_list) diff --git a/code/modules/unit_tests/simple_animal_freeze.dm b/code/modules/unit_tests/simple_animal_freeze.dm index 7d7df334e43..a97f22c4b98 100644 --- a/code/modules/unit_tests/simple_animal_freeze.dm +++ b/code/modules/unit_tests/simple_animal_freeze.dm @@ -185,7 +185,6 @@ /mob/living/simple_animal/hostile/jungle/mega_arachnid, /mob/living/simple_animal/hostile/jungle/mook, /mob/living/simple_animal/hostile/jungle/seedling, - /mob/living/simple_animal/hostile/lightgeist, /mob/living/simple_animal/hostile/megafauna, /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner, /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/doom, diff --git a/tgstation.dme b/tgstation.dme index c1b8b593067..53dca83993b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4033,6 +4033,7 @@ #include "code\modules\mob\living\basic\space_fauna\garden_gnome.dm" #include "code\modules\mob\living\basic\space_fauna\ghost.dm" #include "code\modules\mob\living\basic\space_fauna\killer_tomato.dm" +#include "code\modules\mob\living\basic\space_fauna\lightgeist.dm" #include "code\modules\mob\living\basic\space_fauna\carp\carp.dm" #include "code\modules\mob\living\basic\space_fauna\carp\carp_abilities.dm" #include "code\modules\mob\living\basic\space_fauna\carp\carp_ai_actions.dm" @@ -4281,7 +4282,6 @@ #include "code\modules\mob\living\simple_animal\hostile\hivebot.dm" #include "code\modules\mob\living\simple_animal\hostile\hostile.dm" #include "code\modules\mob\living\simple_animal\hostile\illusion.dm" -#include "code\modules\mob\living\simple_animal\hostile\lightgeist.dm" #include "code\modules\mob\living\simple_animal\hostile\mimic.dm" #include "code\modules\mob\living\simple_animal\hostile\morph.dm" #include "code\modules\mob\living\simple_animal\hostile\mushroom.dm" diff --git a/tools/UpdatePaths/Scripts/75626_simple_to_basic_lightgeists.txt b/tools/UpdatePaths/Scripts/75626_simple_to_basic_lightgeists.txt new file mode 100644 index 00000000000..66a3f90e018 --- /dev/null +++ b/tools/UpdatePaths/Scripts/75626_simple_to_basic_lightgeists.txt @@ -0,0 +1 @@ +/mob/living/simple_animal/hostile/lightgeist : /mob/living/basic/lightgeist{@OLD;AIStatus=@SKIP}