diff --git a/code/datums/components/caltrop.dm b/code/datums/components/caltrop.dm index 3bd740973a3..fc781b288a9 100644 --- a/code/datums/components/caltrop.dm +++ b/code/datums/components/caltrop.dm @@ -42,7 +42,7 @@ if(!(flags & CALTROP_BYPASS_SHOES) && (H.shoes || feetCover)) return - if((H.flying) || H.buckled) + if(H.flying || H.floating || H.buckled) return var/damage = rand(min_damage, max_damage) diff --git a/code/datums/components/slippery.dm b/code/datums/components/slippery.dm index 88e51209afb..a7b81856468 100644 --- a/code/datums/components/slippery.dm +++ b/code/datums/components/slippery.dm @@ -51,6 +51,6 @@ Additionally calls the parent's `after_slip()` proc on the `victim`. */ /datum/component/slippery/proc/Slip(datum/source, mob/living/carbon/human/victim) - if(istype(victim) && prob(slip_chance) && victim.slip(description, stun, weaken, slip_tiles, walking_is_safe, slip_always, slip_verb)) + if(istype(victim) && !victim.flying && prob(slip_chance) && victim.slip(description, stun, weaken, slip_tiles, walking_is_safe, slip_always, slip_verb)) var/atom/movable/owner = parent owner.after_slip(victim) diff --git a/code/datums/components/squeak.dm b/code/datums/components/squeak.dm index 4c55ad2ad82..f79439f2b3b 100644 --- a/code/datums/components/squeak.dm +++ b/code/datums/components/squeak.dm @@ -67,6 +67,14 @@ var/obj/item/projectile/P = AM if(P.original != parent) return + if(ismob(AM)) + var/mob/M = AM + if(M.flying) + return + if(isliving(AM)) + var/mob/living/L = M + if(L.floating) + return var/atom/current_parent = parent if(isturf(current_parent.loc)) play_squeak() diff --git a/code/datums/weather/weather_types/floor_is_lava.dm b/code/datums/weather/weather_types/floor_is_lava.dm index 9f98a481dbf..0233e0aee71 100644 --- a/code/datums/weather/weather_types/floor_is_lava.dm +++ b/code/datums/weather/weather_types/floor_is_lava.dm @@ -35,6 +35,8 @@ return if(!L.client) //Only sentient people are going along with it! return + if(L.flying) + return L.adjustFireLoss(3) /datum/weather/floor_is_lava/fake diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b679c8db407..7f8c99c5c8c 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -504,6 +504,7 @@ return //don't do an animation if attacking self var/pixel_x_diff = 0 var/pixel_y_diff = 0 + var/direction = get_dir(src, A) if(direction & NORTH) pixel_y_diff = 8 @@ -523,7 +524,8 @@ if(visual_effect_icon) I = image('icons/effects/effects.dmi', A, visual_effect_icon, A.layer + 0.1) else if(used_item) - I = image(used_item.icon, A, used_item.icon_state, A.layer + 0.1) + I = image(icon = used_item, loc = A, layer = A.layer + 0.1) + I.plane = GAME_PLANE // Scale the icon. I.transform *= 0.75 diff --git a/code/game/gamemodes/blob/blobs/blob_mobs.dm b/code/game/gamemodes/blob/blobs/blob_mobs.dm index 38da76a348b..946c70b8099 100644 --- a/code/game/gamemodes/blob/blobs/blob_mobs.dm +++ b/code/game/gamemodes/blob/blobs/blob_mobs.dm @@ -48,6 +48,7 @@ environment_smash = ENVIRONMENT_SMASH_STRUCTURES attacktext = "hits" attack_sound = 'sound/weapons/genhit1.ogg' + flying = TRUE speak_emote = list("pulses") var/obj/structure/blob/factory/factory = null var/list/human_overlays = list() diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 5f9256e18b4..276e2c49643 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -14,7 +14,7 @@ a_intent = INTENT_HARM can_change_intents = 0 stop_automated_movement = 1 - floating = 1 + flying = TRUE attack_sound = 'sound/weapons/punch1.ogg' minbodytemp = 0 maxbodytemp = INFINITY diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index f86f018757e..cd515b2f3d4 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -33,7 +33,7 @@ status_flags = 0 wander = 0 density = 0 - flying = 1 + flying = TRUE move_resist = INFINITY mob_size = MOB_SIZE_TINY pass_flags = PASSTABLE | PASSGRILLE | PASSMOB diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm index 52c2aea5ddb..735d0bfbca4 100644 --- a/code/game/objects/items/weapons/shards.dm +++ b/code/game/objects/items/weapons/shards.dm @@ -83,7 +83,7 @@ /obj/item/shard/Crossed(mob/living/L, oldloc) if(istype(L) && has_gravity(loc)) - if(L.incorporeal_move || L.flying) + if(L.incorporeal_move || L.flying || L.floating) return playsound(loc, 'sound/effects/glass_step.ogg', 50, TRUE) return ..() diff --git a/code/game/turfs/simulated/floor/chasm.dm b/code/game/turfs/simulated/floor/chasm.dm index d8ed888bc27..26921ba9ffd 100644 --- a/code/game/turfs/simulated/floor/chasm.dm +++ b/code/game/turfs/simulated/floor/chasm.dm @@ -97,8 +97,8 @@ return FALSE //Flies right over the chasm if(isliving(AM)) - var/mob/M = AM - if(M.flying) + var/mob/living/M = AM + if(M.flying || M.floating) return FALSE if(ishuman(AM)) var/mob/living/carbon/human/H = AM diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d1541dcc4fa..f5a30b294dd 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -155,7 +155,6 @@ var/mob/O = M if(!O.lastarea) O.lastarea = get_area(O.loc) -// O.update_gravity(O.mob_has_gravity(src)) var/loopsanity = 100 for(var/atom/A in range(1)) diff --git a/code/modules/mining/lavaland/loot/colossus_loot.dm b/code/modules/mining/lavaland/loot/colossus_loot.dm index 0bde4d95464..e99e7132f03 100644 --- a/code/modules/mining/lavaland/loot/colossus_loot.dm +++ b/code/modules/mining/lavaland/loot/colossus_loot.dm @@ -349,7 +349,7 @@ harm_intent_damage = 1 friendly = "mends" density = 0 - flying = 1 + flying = TRUE obj_damage = 0 pass_flags = PASSTABLE | PASSGRILLE | PASSMOB ventcrawler = 2 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 3aef7135679..e13d1a2c278 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -541,6 +541,8 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven take_organ_damage(10) if(iscarbon(hit_atom) && hit_atom != src) var/mob/living/carbon/victim = hit_atom + if(victim.flying) + return if(hurt) victim.take_organ_damage(10) take_organ_damage(10) diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index cb607bae294..c3d0ca679d4 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -29,7 +29,7 @@ if(changed) animate(src, transform = ntransform, time = 2, pixel_y = final_pixel_y, dir = final_dir, easing = EASE_IN|EASE_OUT) handle_transform_change() - floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life(). + floating = FALSE // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life(). /mob/living/carbon/proc/handle_transform_change() return diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 6d020ccdad1..ae525e409f7 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -2,9 +2,8 @@ set waitfor = FALSE set invisibility = 0 - if(flying) //TODO: Better floating - animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING) - animate(pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING) + if(flying && !floating) //TODO: Better floating + float(on = TRUE) if(client || registered_z) // This is a temporary error tracker to make sure we've caught everything var/turf/T = get_turf(src) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9f768ffc76d..39fc238f59f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -746,16 +746,14 @@ /mob/living/proc/float(on) if(throwing) return - var/fixed = 0 - if(anchored || (buckled && buckled.anchored)) - fixed = 1 - if(on && !floating && !fixed) + if(on && !floating) animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) - floating = 1 - else if(((!on || fixed) && floating)) - var/final_pixel_y = get_standard_pixel_y_offset(lying) - animate(src, pixel_y = final_pixel_y, time = 10) - floating = 0 + sleep(10) + animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1) + floating = TRUE + else if(!on && floating) + animate(src, pixel_y = initial(pixel_y), time = 10) + floating = FALSE /mob/living/proc/can_use_vents() return "You can't fit into that vent." @@ -830,15 +828,17 @@ if(!used_item) used_item = get_active_hand() ..() - floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. + floating = FALSE // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. /mob/living/proc/do_jitter_animation(jitteriness, loop_amount = 6) - var/amplitude = min(4, (jitteriness/100) + 1) + var/amplitude = min(4, (jitteriness / 100) + 1) var/pixel_x_diff = rand(-amplitude, amplitude) - var/pixel_y_diff = rand(-amplitude/3, amplitude/3) + var/pixel_y_diff = rand(-amplitude / 3, amplitude / 3) + var/final_pixel_x = get_standard_pixel_x_offset(lying) + var/final_pixel_y = get_standard_pixel_y_offset(lying) animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = loop_amount) - animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y) , time = 2) - floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. + animate(pixel_x = final_pixel_x , pixel_y = final_pixel_y , time = 2) + floating = FALSE // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. /mob/living/proc/get_temperature(datum/gas_mixture/environment) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index e230f7a2b99..782c74b3201 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -28,7 +28,7 @@ var/on_fire = 0 //The "Are we on fire?" var var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20 - var/floating = 0 + var/floating = FALSE var/mob_size = MOB_SIZE_HUMAN var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature.. var/digestion_ratio = 1 //controls how quickly reagents metabolize; largely governered by species attributes. diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index f150005116e..4c2c2332924 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -17,7 +17,7 @@ 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 faction = list("cult") - flying = 1 + flying = TRUE pressure_resistance = 100 universal_speak = 1 AIStatus = AI_OFF //normal constructs don't have AI diff --git a/code/modules/mob/living/simple_animal/friendly/butterfly.dm b/code/modules/mob/living/simple_animal/friendly/butterfly.dm index 9aaffc6ef8f..ebf068ff130 100644 --- a/code/modules/mob/living/simple_animal/friendly/butterfly.dm +++ b/code/modules/mob/living/simple_animal/friendly/butterfly.dm @@ -15,6 +15,7 @@ harm_intent_damage = 1 friendly = "nudges" density = 0 + flying = TRUE pass_flags = PASSTABLE | PASSGRILLE | PASSMOB ventcrawler = 2 mob_size = MOB_SIZE_TINY diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index be04fc217e9..b47b0eb1f23 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -16,6 +16,7 @@ maxHealth = 20 health = 20 mob_size = MOB_SIZE_TINY + flying = TRUE harm_intent_damage = 8 melee_damage_lower = 10 melee_damage_upper = 10 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 b8c72d7cf84..2f97001d3ae 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -241,6 +241,14 @@ Difficulty: Very Hard AT.pixel_y += random_y return ..() +/mob/living/simple_animal/hostile/megafauna/colossus/float(on) //we don't want this guy to float, messes up his animations + if(throwing) + return + if(on && !floating) + floating = TRUE + else if(!on && floating) + floating = FALSE + /obj/item/projectile/colossus name ="death bolt" icon_state= "chronobolt" diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm index a3e32e9d35e..5d946662854 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/undead.dm @@ -46,6 +46,7 @@ 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 + flying = TRUE pressure_resistance = 300 gold_core_spawnable = NO_SPAWN //too spooky for science faction = list("undead") // did I mention ghost diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 6f40dfe2a3f..2da5f6b4060 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -362,7 +362,7 @@ 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 - flying = 1 + flying = TRUE gold_core_spawnable = HOSTILE_SPAWN del_on_death = 1 deathmessage = "is smashed into pieces!" diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 41786017ea2..56c81aaebc4 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -86,6 +86,7 @@ //Parrots are kleptomaniacs. This variable ... stores the item a parrot is holding. var/obj/item/held_item = null + flying = TRUE gold_core_spawnable = FRIENDLY_SPAWN diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 663838d3a45..1e3c723b278 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -24,6 +24,7 @@ status_flags = 0 faction = list("cult") status_flags = CANPUSH + flying = TRUE loot = list(/obj/item/reagent_containers/food/snacks/ectoplasm) del_on_death = 1 deathmessage = "lets out a contented sigh as their form unwinds." diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 7cd2b4414f7..ce266ba5b8f 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -141,18 +141,6 @@ if(updating && val_change) update_canmove() -/mob/living/proc/StartFlying() - var/val_change = !flying - flying = TRUE - if(val_change) - update_animations() - -/mob/living/proc/StopFlying() - var/val_change = !!flying - flying = FALSE - if(val_change) - update_animations() - // SCALAR STATUS EFFECTS diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 471ddc42557..613df6e99ec 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -186,7 +186,7 @@ if(newdir) direct = newdir n = get_step(mob, direct) - + . = mob.SelfMove(n, direct, delay) mob.setDir(direct) @@ -388,8 +388,9 @@ step(pulling, get_dir(pulling.loc, A)) return -/mob/proc/update_gravity() +/mob/proc/update_gravity(has_gravity) return + /client/proc/check_has_body_select() return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /obj/screen/zone_sel) diff --git a/code/modules/mob/update_status.dm b/code/modules/mob/update_status.dm index 1708bcfb7a2..b603fc5974e 100644 --- a/code/modules/mob/update_status.dm +++ b/code/modules/mob/update_status.dm @@ -55,12 +55,6 @@ // Procs that update other things about the mob -// Does various animations - Jitter, Flying, Spinning -/mob/proc/update_animations() - if(flying) - animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING) - animate(pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING) - /mob/proc/update_stat() return diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 0a31d882488..0963bdeda7d 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -627,7 +627,7 @@ /obj/item/light/Crossed(mob/living/L) if(istype(L) && has_gravity(loc)) - if(L.incorporeal_move || L.flying) + if(L.incorporeal_move || L.flying || L.floating) return playsound(loc, 'sound/effects/glass_step.ogg', 50, TRUE) if(status == LIGHT_BURNED || status == LIGHT_OK) diff --git a/code/modules/surgery/organs/helpers.dm b/code/modules/surgery/organs/helpers.dm index ca2698f2ad4..4102319a3fe 100644 --- a/code/modules/surgery/organs/helpers.dm +++ b/code/modules/surgery/organs/helpers.dm @@ -104,7 +104,7 @@ /mob/living/carbon/human/get_leg_ignore() - if(flying == 1) + if(flying || floating) return TRUE var/obj/item/tank/jetpack/J