From 692b641f45fafaebf4458f71fb2db60022fedaf9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 7 May 2021 21:53:29 +0200 Subject: [PATCH] [MIRROR] refactors is_flying_animal into simple_flight element (#5523) * refactors is_flying_animal into simple_flight element (#58914) * refactors is_flying_animal into simple_flight element * Update bumbles.dm Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> Co-authored-by: Gandalf --- code/datums/elements/simple_flying.dm | 28 +++++++++++++++++++ code/modules/antagonists/blob/blob_mobs.dm | 2 +- code/modules/antagonists/revenant/revenant.dm | 2 +- .../mob/living/simple_animal/constructs.dm | 2 +- .../simple_animal/friendly/butterfly.dm | 2 +- .../living/simple_animal/guardian/guardian.dm | 3 +- .../mob/living/simple_animal/hostile/bees.dm | 2 +- .../mob/living/simple_animal/hostile/carp.dm | 2 +- .../living/simple_animal/hostile/eyeballs.dm | 2 +- .../hostile/megafauna/colossus.dm | 2 +- .../hostile/megafauna/megafauna.dm | 2 +- .../hostile/mining_mobs/basilisk.dm | 5 +++- .../hostile/mining_mobs/curse_blob.dm | 2 +- .../hostile/mining_mobs/elites/herald.dm | 2 +- .../hostile/mining_mobs/hivelord.dm | 2 +- .../hostile/mining_mobs/ice demon.dm | 5 +++- .../simple_animal/hostile/retaliate/bat.dm | 2 +- .../simple_animal/hostile/retaliate/ghost.dm | 2 +- .../simple_animal/hostile/space_dragon.dm | 2 +- .../living/simple_animal/hostile/syndicate.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 2 +- .../modules/mob/living/simple_animal/shade.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 19 ------------- .../living/simple_animal/friendly/bumbles.dm | 2 +- tgstation.dme | 1 + 25 files changed, 57 insertions(+), 42 deletions(-) create mode 100644 code/datums/elements/simple_flying.dm diff --git a/code/datums/elements/simple_flying.dm b/code/datums/elements/simple_flying.dm new file mode 100644 index 00000000000..41ac92b793c --- /dev/null +++ b/code/datums/elements/simple_flying.dm @@ -0,0 +1,28 @@ +/** + * # simple flying element! + * + * Non bespoke element (1 in existence) that makes animals fly while living and... not while dead! + * Note: works for carbons and above, but please do something better. humans have wings got dangit! + */ +/datum/element/simple_flying + +/datum/element/simple_flying/Attach(datum/target) + . = ..() + if(!isliving(target)) + return ELEMENT_INCOMPATIBLE + var/mob/living/valid_target = target + on_stat_change(valid_target, new_stat = valid_target.stat) //immediately try adding flight if they're conscious + RegisterSignal(target, COMSIG_MOB_STATCHANGE, .proc/on_stat_change) + +/datum/element/simple_flying/Detach(datum/target) + . = ..() + UnregisterSignal(target, COMSIG_MOB_STATCHANGE) + +///signal called by the stat of the target changing +/datum/element/simple_flying/proc/on_stat_change(mob/living/simple_animal/target, new_stat) + SIGNAL_HANDLER + + if(new_stat == CONSCIOUS) + ADD_TRAIT(target, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) + else + REMOVE_TRAIT(target, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) diff --git a/code/modules/antagonists/blob/blob_mobs.dm b/code/modules/antagonists/blob/blob_mobs.dm index e6b46f58209..becedd94172 100644 --- a/code/modules/antagonists/blob/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob_mobs.dm @@ -105,7 +105,6 @@ attack_verb_continuous = "hits" attack_verb_simple = "hit" attack_sound = 'sound/weapons/genhit1.ogg' - is_flying_animal = TRUE del_on_death = TRUE deathmessage = "explodes into a cloud of gas!" gold_core_spawnable = NO_SPAWN //gold slime cores should only spawn the independent subtype @@ -117,6 +116,7 @@ /mob/living/simple_animal/hostile/blob/blobspore/Initialize(mapload, obj/structure/blob/special/linked_node) . = ..() + AddElement(/datum/element/simple_flying) if(istype(linked_node)) factory = linked_node factory.spores += src diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index 50b2a79ba4b..1ecec21ee2b 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -45,7 +45,6 @@ status_flags = 0 wander = FALSE density = FALSE - is_flying_animal = TRUE move_resist = MOVE_FORCE_OVERPOWERING mob_size = MOB_SIZE_TINY pass_flags = PASSTABLE | PASSGRILLE | PASSMOB @@ -72,6 +71,7 @@ /mob/living/simple_animal/revenant/Initialize(mapload) . = ..() + AddElement(/datum/element/simple_flying) flags_1 |= RAD_NO_CONTAMINATE_1 ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) ADD_TRAIT(src, TRAIT_SIXTHSENSE, INNATE_TRAIT) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index b608b9425a4..cc71ec6a55a 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -27,7 +27,6 @@ maxbodytemp = INFINITY healable = 0 faction = list("cult") - is_flying_animal = TRUE pressure_resistance = 100 unique_name = 1 AIStatus = AI_OFF //normal constructs don't have AI @@ -47,6 +46,7 @@ /mob/living/simple_animal/hostile/construct/Initialize() . = ..() + AddElement(/datum/element/simple_flying) ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) var/spellnum = 1 for(var/spell in construct_spells) diff --git a/code/modules/mob/living/simple_animal/friendly/butterfly.dm b/code/modules/mob/living/simple_animal/friendly/butterfly.dm index c12959fdc2d..139429e6dc7 100644 --- a/code/modules/mob/living/simple_animal/friendly/butterfly.dm +++ b/code/modules/mob/living/simple_animal/friendly/butterfly.dm @@ -18,7 +18,6 @@ friendly_verb_continuous = "nudges" friendly_verb_simple = "nudge" density = FALSE - is_flying_animal = TRUE pass_flags = PASSTABLE | PASSGRILLE | PASSMOB mob_size = MOB_SIZE_TINY mob_biotypes = MOB_ORGANIC|MOB_BUG @@ -30,6 +29,7 @@ /mob/living/simple_animal/butterfly/Initialize() . = ..() + AddElement(/datum/element/simple_flying) var/newcolor = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 1989773ba73..920eaef56a1 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -25,7 +25,6 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians speed = 0 combat_mode = TRUE stop_automated_movement = 1 - is_flying_animal = TRUE // Immunity to chasms and landmines, etc. attack_sound = 'sound/weapons/punch1.ogg' atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 @@ -66,7 +65,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians /mob/living/simple_animal/hostile/guardian/Initialize(mapload, theme) GLOB.parasites += src updatetheme(theme) - + AddElement(/datum/element/simple_flying) . = ..() /mob/living/simple_animal/hostile/guardian/med_hud_set_health() diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index d565e0ccd03..7fb1ae8b8bb 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -41,7 +41,6 @@ density = FALSE mob_size = MOB_SIZE_TINY mob_biotypes = MOB_ORGANIC|MOB_BUG - is_flying_animal = TRUE gold_core_spawnable = FRIENDLY_SPAWN search_objects = 1 //have to find those plant trays! can_be_held = TRUE @@ -64,6 +63,7 @@ ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) generate_bee_visuals() + AddElement(/datum/element/simple_flying) AddComponent(/datum/component/swarming) /mob/living/simple_animal/hostile/poison/bees/mob_pickup(mob/living/L) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 988aabe3712..1bcf58e3515 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -40,7 +40,6 @@ minbodytemp = 0 maxbodytemp = 1500 faction = list("carp") - is_flying_animal = TRUE pressure_resistance = 200 gold_core_spawnable = HOSTILE_SPAWN /// If the carp uses random coloring @@ -70,6 +69,7 @@ ) /mob/living/simple_animal/hostile/carp/Initialize(mapload) + AddElement(/datum/element/simple_flying) if(random_color) set_greyscale_config(/datum/greyscale_config/carp) carp_randomify(rarechance) diff --git a/code/modules/mob/living/simple_animal/hostile/eyeballs.dm b/code/modules/mob/living/simple_animal/hostile/eyeballs.dm index 771d5841223..101240042e7 100644 --- a/code/modules/mob/living/simple_animal/hostile/eyeballs.dm +++ b/code/modules/mob/living/simple_animal/hostile/eyeballs.dm @@ -25,7 +25,6 @@ attack_verb_continuous = "blinks at" attack_verb_simple = "blink at" attack_sound = 'sound/weapons/pierce.ogg' - is_flying_animal = TRUE atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = 1500 @@ -37,4 +36,5 @@ /mob/living/simple_animal/hostile/eyeball/Initialize() . = ..() + AddElement(/datum/element/simple_flying) ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) 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 fec42ad38fa..06bd079039f 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -660,7 +660,6 @@ SKYRAT REMOVAL EDIT END*/ friendly_verb_continuous = "taps" friendly_verb_simple = "tap" density = FALSE - is_flying_animal = TRUE pass_flags = PASSTABLE | PASSGRILLE | PASSMOB mob_size = MOB_SIZE_TINY gold_core_spawnable = HOSTILE_SPAWN @@ -683,6 +682,7 @@ SKYRAT REMOVAL EDIT END*/ /mob/living/simple_animal/hostile/lightgeist/Initialize() . = ..() + AddElement(/datum/element/simple_flying) 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] diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 96781bce71e..0a5cb689b62 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -11,7 +11,6 @@ light_range = 3 faction = list("mining", "boss") weather_immunities = list("lava","ash") - is_flying_animal = TRUE robust_searching = TRUE ranged_ignores_vision = TRUE stat_attack = DEAD @@ -57,6 +56,7 @@ /mob/living/simple_animal/hostile/megafauna/Initialize(mapload) . = ..() + AddElement(/datum/element/simple_flying) if(gps_name && true_spawn) AddComponent(/datum/component/gps, gps_name) ADD_TRAIT(src, TRAIT_NO_TELEPORT, MEGAFAUNA_TRAIT) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm index 9568393bd60..006952fd0ec 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/basilisk.dm @@ -112,7 +112,6 @@ attack_sound = 'sound/weapons/bladeslice.ogg' attack_vis_effect = null // doesn't bite unlike the parent type. stat_attack = HARD_CRIT - is_flying_animal = TRUE robust_searching = 1 crusher_loot = /obj/item/crusher_trophy/watcher_wing gold_core_spawnable = NO_SPAWN @@ -122,6 +121,10 @@ search_objects = 1 wanted_objects = list(/obj/item/pen/survival, /obj/item/stack/ore/diamond) +/mob/living/simple_animal/hostile/asteroid/basilisk/watcher/Initialize() + . = ..() + AddElement(/datum/element/simple_flying) + /mob/living/simple_animal/hostile/asteroid/basilisk/watcher/Life(delta_time = SSMOBS_DT, times_fired) . = ..() if(stat == CONSCIOUS) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm index c13e31ea16f..bb96a8c4676 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm @@ -6,7 +6,6 @@ icon_living = "curseblob" icon_aggro = "curseblob" mob_biotypes = MOB_SPIRIT - is_flying_animal = TRUE move_to_delay = 5 vision_range = 20 aggro_vision_range = 20 @@ -31,6 +30,7 @@ /mob/living/simple_animal/hostile/asteroid/curseblob/Initialize(mapload) . = ..() timerid = QDEL_IN(src, 600) + AddElement(/datum/element/simple_flying) playsound(src, 'sound/effects/curse1.ogg', 100, TRUE, -1) /mob/living/simple_animal/hostile/asteroid/curseblob/Destroy() diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm index 59513ced480..b743f9ea41b 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm @@ -201,13 +201,13 @@ icon_aggro = "herald_mirror" deathmessage = "shatters violently!" deathsound = 'sound/effects/glassbr1.ogg' - is_flying_animal = TRUE del_on_death = TRUE is_mirror = TRUE var/mob/living/simple_animal/hostile/asteroid/elite/herald/my_master = null /mob/living/simple_animal/hostile/asteroid/elite/herald/mirror/Initialize() ..() + AddElement(/datum/element/simple_flying) toggle_ai(AI_OFF) /mob/living/simple_animal/hostile/asteroid/elite/herald/mirror/Destroy() diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm index cfd8e153849..b1a081b4954 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm @@ -73,7 +73,6 @@ speed = 3 maxHealth = 1 health = 1 - is_flying_animal = TRUE harm_intent_damage = 5 melee_damage_lower = 2 melee_damage_upper = 2 @@ -92,6 +91,7 @@ /mob/living/simple_animal/hostile/asteroid/hivelordbrood/Initialize() . = ..() addtimer(CALLBACK(src, .proc/death), 100) + AddElement(/datum/element/simple_flying) AddComponent(/datum/component/swarming) //Legion diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/ice demon.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/ice demon.dm index d7e3af186aa..7eaa16b1bce 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/ice demon.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/ice demon.dm @@ -38,12 +38,15 @@ deathmessage = "fades as the energies that tied it to this world dissipate." deathsound = 'sound/magic/demon_dies.ogg' stat_attack = HARD_CRIT - is_flying_animal = TRUE robust_searching = TRUE footstep_type = FOOTSTEP_MOB_CLAW /// Distance the demon will teleport from the target var/teleport_distance = 3 +/mob/living/simple_animal/hostile/asteroid/ice_demon/Initialize() + . = ..() + AddElement(/datum/element/simple_flying) + /obj/projectile/temp/basilisk/ice name = "ice blast" damage = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm index 5138cc7e258..2065e29c4b2 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm @@ -28,7 +28,6 @@ obj_damage = 0 environment_smash = ENVIRONMENT_SMASH_NONE mob_size = MOB_SIZE_TINY - is_flying_animal = TRUE speak_emote = list("squeaks") var/max_co2 = 0 //to be removed once metastation map no longer use those for Sgt Araneus var/min_oxy = 0 @@ -39,6 +38,7 @@ /mob/living/simple_animal/hostile/retaliate/bat/Initialize() . = ..() + AddElement(/datum/element/simple_flying) ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm index 10117905227..df346a51cd8 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm @@ -28,7 +28,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = 1500 - is_flying_animal = TRUE pressure_resistance = 300 gold_core_spawnable = NO_SPAWN //too spooky for science light_system = MOVABLE_LIGHT @@ -44,6 +43,7 @@ /mob/living/simple_animal/hostile/retaliate/ghost/Initialize() . = ..() + AddElement(/datum/element/simple_flying) give_hair() if(random) switch(rand(0,1)) diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index c94b33f7189..0aea20db6eb 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -62,7 +62,6 @@ maxbodytemp = 1500 faction = list("carp") pressure_resistance = 200 - is_flying_animal = TRUE /// Current time since the the last rift was activated. If set to -1, does not increment. var/riftTimer = 0 /// Maximum amount of time which can pass without a rift before Space Dragon despawns. @@ -92,6 +91,7 @@ /mob/living/simple_animal/hostile/space_dragon/Initialize(mapload) . = ..() + AddElement(/datum/element/simple_flying) ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) ADD_TRAIT(src, TRAIT_NO_FLOATING_ANIM, INNATE_TRAIT) rift = new diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 796d94953af..c47e99d8d20 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -309,7 +309,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 mob_size = MOB_SIZE_TINY - is_flying_animal = TRUE limb_destroyer = 1 speak_emote = list("states") bubble_icon = "syndibot" @@ -319,4 +318,5 @@ /mob/living/simple_animal/hostile/viscerator/Initialize() . = ..() + AddElement(/datum/element/simple_flying) AddComponent(/datum/component/swarming) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index b0c9c3aaf11..8233e59e937 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -64,7 +64,6 @@ friendly_verb_continuous = "grooms" friendly_verb_simple = "groom" mob_size = MOB_SIZE_SMALL - is_flying_animal = TRUE gold_core_spawnable = FRIENDLY_SPAWN var/parrot_damage_upper = 10 @@ -129,6 +128,7 @@ /mob/living/simple_animal/parrot/proc/perch_mob_player)) AddElement(/datum/element/strippable, GLOB.strippable_parrot_items) + AddElement(/datum/element/simple_flying) /mob/living/simple_animal/parrot/examine(mob/user) . = ..() diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 35e66f6611e..4333c5bcd5d 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -30,13 +30,13 @@ stop_automated_movement = 1 faction = list("cult") status_flags = CANPUSH - is_flying_animal = TRUE loot = list(/obj/item/ectoplasm) del_on_death = TRUE initial_language_holder = /datum/language_holder/construct /mob/living/simple_animal/shade/Initialize() . = ..() + AddElement(/datum/element/simple_flying) ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 89a362b8704..068b5864aa5 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -136,9 +136,6 @@ var/dextrous = FALSE var/dextrous_hud_type = /datum/hud/dextrous - ///If the creature should have an innate TRAIT_MOVE_FLYING trait added on init that is also toggled off/on on death/revival. - var/is_flying_animal = FALSE - ///The Status of our AI, can be set to AI_ON (On, usual processing), AI_IDLE (Will not process, but will return to AI_ON if an enemy comes near), AI_OFF (Off, Not processing ever), AI_Z_OFF (Temporarily off due to nonpresence of players). var/AIStatus = AI_ON ///once we have become sentient, we can never go back. @@ -190,8 +187,6 @@ AddComponent(/datum/component/personal_crafting) ADD_TRAIT(src, TRAIT_ADVANCEDTOOLUSER, ROUNDSTART_TRAIT) ADD_TRAIT(src, TRAIT_CAN_STRIP, ROUNDSTART_TRAIT) - if(is_flying_animal) - ADD_TRAIT(src, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) if(speak) speak = string_list(speak) @@ -234,16 +229,6 @@ walk(src, 0) return ..() -/mob/living/simple_animal/vv_edit_var(var_name, var_value) - . = ..() - switch(var_name) - if(NAMEOF(src, is_flying_animal)) - if(stat != DEAD) - if(!is_flying_animal) - REMOVE_TRAIT(src, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) - else - ADD_TRAIT(src, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) - /mob/living/simple_animal/attackby(obj/item/O, mob/user, params) if(!is_type_in_list(O, food_type)) return ..() @@ -500,8 +485,6 @@ del_on_death = FALSE qdel(src) else - if(is_flying_animal) - REMOVE_TRAIT(src, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) health = 0 icon_state = icon_dead if(flip_on_death) @@ -541,8 +524,6 @@ return icon_state = icon_living density = initial(density) - if(is_flying_animal) - ADD_TRAIT(src, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT) /mob/living/simple_animal/proc/make_babies() // <3 <3 <3 if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress()) diff --git a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm index 626461a767c..f8177c9befd 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm @@ -16,7 +16,6 @@ friendly_verb_continuous = "bzzs" friendly_verb_simple = "bzz" density = FALSE - is_flying_animal = TRUE mobility_flags = MOBILITY_FLAGS_REST_CAPABLE_DEFAULT pass_flags = PASSTABLE | PASSGRILLE | PASSMOB mob_size = MOB_SIZE_TINY @@ -32,6 +31,7 @@ /mob/living/simple_animal/pet/bumbles/Initialize() . = ..() + AddElement(/datum/element/simple_flying) add_verb(src, /mob/living/proc/toggle_resting) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) diff --git a/tgstation.dme b/tgstation.dme index 89598521f5b..6450b4a0c22 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -722,6 +722,7 @@ #include "code\datums\elements\rad_insulation.dm" #include "code\datums\elements\ridable.dm" #include "code\datums\elements\selfknockback.dm" +#include "code\datums\elements\simple_flying.dm" #include "code\datums\elements\skittish.dm" #include "code\datums\elements\snail_crawl.dm" #include "code\datums\elements\squashable.dm"