[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 <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-05-07 21:53:29 +02:00
committed by GitHub
parent a3e011afc1
commit 692b641f45
25 changed files with 57 additions and 42 deletions
@@ -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)
@@ -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)
@@ -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()
@@ -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)
@@ -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)
@@ -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)
@@ -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]
@@ -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)
@@ -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)
@@ -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()
@@ -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()
@@ -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
@@ -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
@@ -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)
@@ -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))
@@ -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
@@ -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)
@@ -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)
. = ..()
@@ -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)
@@ -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())