From 1a918ed8db8e283efbfe93bd14d9120522930e67 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Tue, 31 May 2022 19:22:30 -0400 Subject: [PATCH 1/4] animation refresh - huge unatomized bundle of fixes and tweaks to numerous animations in the game --- code/__HELPERS/matrices/transform_matrix.dm | 2 +- code/__HELPERS/unsorted.dm | 17 +++---- code/_onclick/hud/alert.dm | 2 +- code/_onclick/hud/radial.dm | 2 +- code/_onclick/item_attack.dm | 2 + code/datums/chatmessage.dm | 5 +- code/datums/components/bouncy.dm | 2 +- code/datums/components/storage/storage.dm | 9 ++-- code/game/atoms_movable.dm | 8 +-- code/game/objects/items/pneumaticCannon.dm | 4 ++ code/modules/mob/dead/observer/observer.dm | 6 ++- .../carbon/alien/humanoid/update_icons.dm | 2 +- .../living/carbon/alien/larva/update_icons.dm | 2 +- code/modules/mob/living/living.dm | 51 ++++++++++--------- code/modules/mob/living/silicon/silicon.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- code/modules/mob/living/update_icons.dm | 8 ++- code/modules/mob/mob_helpers.dm | 16 ++++-- code/modules/projectiles/guns/ballistic.dm | 1 + .../projectiles/guns/ballistic/revolver.dm | 2 + .../projectiles/guns/ballistic/shotgun.dm | 1 + code/modules/projectiles/guns/energy.dm | 1 + .../guns/energy/kinetic_accelerator.dm | 1 + .../projectiles/guns/misc/syringe_gun.dm | 1 + .../code/game/objects/cit_screenshake.dm | 51 ------------------- tgstation.dme | 1 - 26 files changed, 88 insertions(+), 113 deletions(-) delete mode 100644 modular_citadel/code/game/objects/cit_screenshake.dm diff --git a/code/__HELPERS/matrices/transform_matrix.dm b/code/__HELPERS/matrices/transform_matrix.dm index 251ef8151f..8f8a67535e 100644 --- a/code/__HELPERS/matrices/transform_matrix.dm +++ b/code/__HELPERS/matrices/transform_matrix.dm @@ -19,7 +19,7 @@ speed /= segments if(parallel) - animate(src, transform = matrices[1], time = speed, loops , flags = ANIMATION_PARALLEL) + animate(src, transform = matrices[1], time = speed, loops, flags = ANIMATION_PARALLEL) else animate(src, transform = matrices[1], time = speed, loops) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index b415b4720f..428784e953 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1176,25 +1176,22 @@ GLOBAL_REAL_VAR(list/stack_trace_storage) var/initialpixely = pixel_y var/shiftx = rand(-pixelshiftx,pixelshiftx) var/shifty = rand(-pixelshifty,pixelshifty) - animate(src, pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2, loop = duration) - pixel_x = initialpixelx - pixel_y = initialpixely + animate(src, pixel_x = shiftx, pixel_y = shifty, time = 0.2, loop = duration, flags = ANIMATION_RELATIVE) + animate(pixel_x = initialpixelx, pixel_y = initialpixely, time = 0.2) -/atom/proc/do_jiggle(targetangle = 45, timer = 20) +/atom/proc/do_jiggle(targetangle = 25, timer = 20) var/matrix/OM = matrix(transform) var/matrix/M = matrix(transform) - var/halftime = timer * 0.5 M.Turn(pick(-targetangle, targetangle)) - animate(src, transform = M, time = halftime, easing = ELASTIC_EASING) - animate(src, transform = OM, time = halftime, easing = ELASTIC_EASING) + animate(src, transform = M, time = timer * 0.1, easing = BACK_EASING | EASE_IN) + animate(transform = OM, time = timer * 0.4, easing = ELASTIC_EASING) /atom/proc/do_squish(squishx = 1.2, squishy = 0.6, timer = 20) var/matrix/OM = matrix(transform) var/matrix/M = matrix(transform) - var/halftime = timer * 0.5 M.Scale(squishx, squishy) - animate(src, transform = M, time = halftime, easing = BOUNCE_EASING) - animate(src, transform = OM, time = halftime, easing = BOUNCE_EASING) + animate(src, transform = M, time = timer * 0.5, easing = ELASTIC_EASING) + animate(transform = OM, time = timer * 0.5, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL) /proc/weightclass2text(var/w_class) switch(w_class) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 53ad775954..5029d51452 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -60,7 +60,7 @@ if(client && hud_used) hud_used.reorganize_alerts() thealert.transform = matrix(32, 6, MATRIX_TRANSLATE) - animate(thealert, transform = matrix(), time = 2.5, easing = CUBIC_EASING) + animate(thealert, transform = matrix(), time = 2.5, easing = BACK_EASING) if(thealert.timeout) addtimer(CALLBACK(src, .proc/alert_timeout, thealert, category), thealert.timeout) diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index 0070362f8b..935379b721 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -178,7 +178,7 @@ GLOBAL_LIST_EMPTY(radial_menus) starting.Scale(0.1,0.1) E.transform = starting var/matrix/TM = matrix() - animate(E,pixel_x = px,pixel_y = py, transform = TM, time = timing) + animate(E,pixel_x = px,pixel_y = py, transform = TM, time = timing, easing = SINE_EASING | EASE_OUT) else E.pixel_y = py E.pixel_x = px diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 8f3a7ef02c..23486cac29 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -126,6 +126,8 @@ return DISCARD_LAST_ACTION user.do_attack_animation(O) O.attacked_by(src, user) + if(force >= 20) + shake_camera(user, ((force - 15) * 0.01 + 1), ((force - 15) * 0.01)) /atom/movable/proc/attacked_by() return diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index a3a9ed5898..f9e0697b1c 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -164,6 +164,7 @@ message.maptext_height = mheight message.maptext_x = (CHAT_MESSAGE_WIDTH - owner.bound_width) * -0.5 message.maptext = MAPTEXT(complete_text) + message.pixel_x = -owner.pixel_x //Dogborgs and other wide boys have a pixel offset. This accounts for that // View the message LAZYADDASSOC(owned_by.seen_messages, message_loc, src) @@ -174,10 +175,10 @@ scheduled_destruction = world.time + (lifespan - CHAT_MESSAGE_EOL_FADE) enter_subsystem() - var/mob/living/silicon/robot/R = target + /*var/mob/living/silicon/robot/R = target if(iscyborg(R)) if((R.module.dogborg == TRUE || R.dogborg == TRUE) && isturf(R.loc)) //I hate whoever that thought that putting two types of dogborg that don't even sync up properly was good - message.pixel_x = 16 + message.pixel_x = 16*/ /** * Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion diff --git a/code/datums/components/bouncy.dm b/code/datums/components/bouncy.dm index fed603410e..3c4e228b59 100644 --- a/code/datums/components/bouncy.dm +++ b/code/datums/components/bouncy.dm @@ -32,7 +32,7 @@ var/atom/movable/A = parent switch(rand(1, 3)) if(1) - A.do_jiggle(45 + rand(-10, 10) * bouncy_mod, 14) + A.do_jiggle(25 + rand(-5, 5) * bouncy_mod, 14) if(2) var/min_b = 0.6/bouncy_mod var/max_b = 1.2 * bouncy_mod diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 00a58a75f8..c0101140d6 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -431,25 +431,26 @@ if(M.incapacitated() || !M.canUseStorage()) return var/atom/A = parent - A.add_fingerprint(M) // this must come before the screen objects only block, dunno why it wasn't before if(over_object == M) user_show_to_mob(M, trigger_on_found = TRUE) if(isrevenant(M)) INVOKE_ASYNC(GLOBAL_PROC, .proc/RevenantThrow, over_object, M, source) return + if(check_locked(null, M) || !M.CanReach(A) || (!M.CanReach(over_object) && !istype(over_object, /atom/movable/screen))) + return + playsound(A, "rustle", 50, TRUE, -5) + A.do_jiggle() + A.add_fingerprint(M) if(!istype(over_object, /atom/movable/screen)) INVOKE_ASYNC(src, .proc/dump_content_at, over_object, M) return if(A.loc != M) return - playsound(A, "rustle", 50, TRUE, -5) - A.do_jiggle() if(istype(over_object, /atom/movable/screen/inventory/hand)) var/atom/movable/screen/inventory/hand/H = over_object M.putItemFromInventoryInHandIfPossible(A, H.held_index) return - A.add_fingerprint(M) /datum/component/storage/proc/user_show_to_mob(mob/M, force = FALSE, trigger_on_found = FALSE) var/atom/A = parent diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 56c668a24b..7cad67bd84 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -604,11 +604,11 @@ if(throwing && !throw_override) return if(on && !(movement_type & FLOATING)) - animate(src, pixel_y = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) - animate(pixel_y = -2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) + animate(src, pixel_z = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_z = -4, time = 10, loop = -1, flags = ANIMATION_RELATIVE) setMovetype(movement_type | FLOATING) else if (!on && (movement_type & FLOATING)) - animate(src, pixel_y = initial(pixel_y), time = 10) + animate(src, pixel_z = initial(pixel_y), time = 10) setMovetype(movement_type & ~FLOATING) floating_need_update = FALSE // assume it's done @@ -774,4 +774,4 @@ M.Turn(pick(-30, 30)) animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, transform = M, easing = CUBIC_EASING) sleep(1) - animate(I, alpha = 0, transform = matrix(), time = 1) + animate(I, alpha = 0, transform = matrix(), time = 1, flags = ANIMATION_PARALLEL) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index 595b24d214..2b0b8da670 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -205,6 +205,10 @@ if(!throw_item(target, I, user)) break + if(user) + shake_camera(user, (pressureSetting * 0.75 + 1), (pressureSetting * 0.75)) + + /obj/item/pneumatic_cannon/proc/throw_item(turf/target, obj/item/I, mob/user) if(!istype(I)) return FALSE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4b228e1eb3..4b56be9ecd 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -121,7 +121,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) remove_verb(src, /mob/dead/observer/verb/boo) remove_verb(src, /mob/dead/observer/verb/possess) - animate(src, pixel_y = 2, time = 10, loop = -1) + animate(src, pixel_z = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_z = -4, time = 10, loop = -1, flags = ANIMATION_RELATIVE) add_to_dead_mob_list() @@ -535,7 +536,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp . = ..() //restart our floating animation after orbit is done. pixel_y = 0 - animate(src, pixel_y = 2, time = 10, loop = -1) + animate(src, pixel_z = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_z = -4, time = 10, loop = -1, flags = ANIMATION_RELATIVE) /mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak set category = "Ghost" diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 9563959ebc..ff4a7d2bba 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -51,7 +51,7 @@ // update_icons() //Handled in update_transform(), leaving this here as a reminder update_transform() -/mob/living/carbon/alien/humanoid/update_transform() //The old method of updating lying/standing was update_icons(). Aliens still expect that. +/mob/living/carbon/alien/humanoid/update_transform(do_animate) //The old method of updating lying/standing was update_icons(). Aliens still expect that. if(lying > 0) lying = 90 //Anything else looks silly ..() diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm index e6e7e657e8..85416261c7 100644 --- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm @@ -21,7 +21,7 @@ else icon_state = "larva[state]" -/mob/living/carbon/alien/larva/update_transform() //All this is handled in update_icons() +/mob/living/carbon/alien/larva/update_transform(do_animate) //All this is handled in update_icons() ..() return update_icons() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 6f394c1135..27fe47d917 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -354,29 +354,33 @@ offset = GRAB_PIXEL_SHIFT_NECK if(GRAB_KILL) offset = GRAB_PIXEL_SHIFT_NECK - M.setDir(get_dir(M, src)) - switch(M.dir) - if(NORTH) - animate(M, pixel_x = 0, pixel_y = offset, 3) - if(SOUTH) - animate(M, pixel_x = 0, pixel_y = -offset, 3) - if(EAST) - if(M.lying == 270) //update the dragged dude's direction if we've turned - M.lying = 90 - M.update_transform() //force a transformation update, otherwise it'll take a few ticks for update_mobility() to do so - M.lying_prev = M.lying - animate(M, pixel_x = offset, pixel_y = 0, 3) - if(WEST) - if(M.lying == 90) - M.lying = 270 - M.update_transform() - M.lying_prev = M.lying - animate(M, pixel_x = -offset, pixel_y = 0, 3) + var/target_dir = get_dir(M, src) + M.setDir(target_dir) + var/target_x + var/target_y + if(target_dir & NORTH) + target_y += offset + if(target_dir & SOUTH) + target_y -= offset + if(target_dir & EAST) + target_x += offset + if(target_dir & WEST) + target_x -= offset + if(target_x || target_y) + if(0 < target_x && M.lying == 270) + M.lying = 90 + M.update_transform(FALSE) //force a transformation update, otherwise it'll take a few ticks for update_mobility() to do so + M.lying_prev = M.lying + if(0 > target_x && M.lying == 90) + M.lying = 270 + M.update_transform(FALSE) + M.lying_prev = M.lying + animate(M, pixel_x = target_x, pixel_y = target_y, time = 3, flags = ANIMATION_PARALLEL) /mob/living/proc/reset_pull_offsets(mob/living/M, override) if(!override && M.buckled) return - animate(M, pixel_x = 0, pixel_y = 0, 1) + animate(M, pixel_x = 0, pixel_y = 0, time = 3, flags = ANIMATION_PARALLEL) //mob verbs are a lot faster than object verbs //for more info on why this is not atom/pull, see examinate() in mob.dm @@ -885,12 +889,11 @@ if(anchored || (buckled && buckled.anchored)) fixed = 1 if(on && !(movement_type & FLOATING) && !fixed) - animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) - sleep(10) - animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1) + animate(src, pixel_z = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_z = -4, time = 10, loop = -1, flags = ANIMATION_RELATIVE) setMovetype(movement_type | FLOATING) else if(((!on || fixed) && (movement_type & FLOATING))) - animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 10) + animate(src, pixel_z = get_standard_pixel_y_offset(lying), time = 10) setMovetype(movement_type & ~FLOATING) // The src mob is trying to strip an item from someone @@ -989,7 +992,7 @@ 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 = 6) + animate(src, pixel_x = pixel_x_diff, pixel_y = pixel_y_diff , time = 2, loop = 6, flags = ANIMATION_PARALLEL | ANIMATION_RELATIVE) animate(pixel_x = final_pixel_x , pixel_y = final_pixel_y , time = 2) floating_need_update = TRUE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b97536b7a4..7ad8a9c4f0 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -413,7 +413,7 @@ src << browse(dat, "window=airoster") onclose(src, "airoster") -/mob/living/silicon/update_transform() +/mob/living/silicon/update_transform(do_animate) var/matrix/ntransform = matrix(transform) //aka transform.Copy() var/changed = 0 if(resize != RESIZE_DEFAULT_SIZE) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9cc82f6a1a..695eec6cb2 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -482,7 +482,7 @@ update_action_buttons_icon() return mobility_flags -/mob/living/simple_animal/update_transform() +/mob/living/simple_animal/update_transform(do_animate) var/matrix/ntransform = matrix(transform) //aka transform.Copy() var/changed = 0 diff --git a/code/modules/mob/living/update_icons.dm b/code/modules/mob/living/update_icons.dm index f8d5d7e0ba..9705be3ad0 100644 --- a/code/modules/mob/living/update_icons.dm +++ b/code/modules/mob/living/update_icons.dm @@ -1,5 +1,5 @@ //IMPORTANT: Multiple animate() calls do not stack well, so try to do them all at once if you can. -/mob/living/update_transform() +/mob/living/update_transform(do_animate = TRUE) var/matrix/ntransform = matrix(transform) //aka transform.Copy() var/final_pixel_y = pixel_y var/changed = 0 @@ -21,5 +21,9 @@ resize = RESIZE_DEFAULT_SIZE if(changed) - animate(src, transform = ntransform, time = 2, pixel_y = final_pixel_y, easing = EASE_IN|EASE_OUT) + if(do_animate) + animate(src, transform = ntransform, time = 2, pixel_y = final_pixel_y, easing = EASE_IN|EASE_OUT, flags = ANIMATION_PARALLEL) + else + transform = ntransform + pixel_y = final_pixel_y floating_need_update = TRUE diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 561425c710..8595839831 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -229,17 +229,23 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return copytext_char(sanitize(.),1,MAX_MESSAGE_LEN) /proc/shake_camera(mob/M, duration, strength=1) - if(!M || !M.client || duration < 1) + set waitfor = FALSE + if(!M || !M.client || duration <= 0) return var/client/C = M.client + if (C.prefs.screenshake==0) + return var/oldx = C.pixel_x var/oldy = C.pixel_y - var/max = strength*world.icon_size - var/min = -(strength*world.icon_size) + var/clientscreenshake = (C.prefs.screenshake * 0.01) + var/max = (strength*clientscreenshake) * world.icon_size + var/min = -((strength*clientscreenshake) * world.icon_size) + var/roundedduration = -round(-duration) // round() with only one arg will always round down. so uh. this is Something all right - for(var/i in 0 to duration-1) + for(var/i in 0 to roundedduration-1) + duration-- if (i == 0) - animate(C, pixel_x=rand(min,max), pixel_y=rand(min,max), time=1) + animate(C, pixel_x=(rand(min,max)*duration), pixel_y=(rand(min,max)*duration), time=1) else animate(pixel_x=rand(min,max), pixel_y=rand(min,max), time=1) animate(pixel_x=oldx, pixel_y=oldy, time=1) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 836ed3b804..3f2f4d3e65 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -3,6 +3,7 @@ name = "projectile gun" icon_state = "pistol" w_class = WEIGHT_CLASS_NORMAL + recoil = 0.25 var/spawnwithmagazine = TRUE var/mag_type = /obj/item/ammo_box/magazine/m10mm //Removes the need for max_ammo and caliber info var/obj/item/ammo_box/magazine/magazine diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index afb30631e0..fe42fc2d99 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -5,6 +5,7 @@ mag_type = /obj/item/ammo_box/magazine/internal/cylinder fire_sound = "sound/weapons/revolvershot.ogg" casing_ejector = FALSE + recoil = 0.5 /obj/item/gun/ballistic/revolver/Initialize(mapload) . = ..() @@ -285,6 +286,7 @@ item_state = "shotgun" w_class = WEIGHT_CLASS_BULKY weapon_weight = WEAPON_MEDIUM + recoil = 1 force = 10 flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BACK diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index f7d57b43a0..b52620e7e0 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -5,6 +5,7 @@ item_state = "shotgun" fire_sound = "sound/weapons/gunshotshotgunshot.ogg" w_class = WEIGHT_CLASS_BULKY + recoil = 1 force = 10 flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BACK diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index dd759f9e3c..03dfc46713 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -16,6 +16,7 @@ name = "energy gun" desc = "A basic energy-based gun." icon = 'icons/obj/guns/energy.dmi' + recoil = 0.1 var/obj/item/stock_parts/cell/cell //What type of power cell this uses var/cell_type = /obj/item/stock_parts/cell diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index a785e4e0e8..5fd158c028 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -8,6 +8,7 @@ item_flags = NONE obj_flags = UNIQUE_RENAME weapon_weight = WEAPON_LIGHT + recoil = 0.5 can_flashlight = 1 flight_x_offset = 15 flight_y_offset = 9 diff --git a/code/modules/projectiles/guns/misc/syringe_gun.dm b/code/modules/projectiles/guns/misc/syringe_gun.dm index 07066023b3..8de7633a79 100644 --- a/code/modules/projectiles/guns/misc/syringe_gun.dm +++ b/code/modules/projectiles/guns/misc/syringe_gun.dm @@ -4,6 +4,7 @@ icon_state = "syringegun" item_state = "syringegun" w_class = WEIGHT_CLASS_NORMAL + recoil = 0.1 throw_speed = 3 throw_range = 7 force = 4 diff --git a/modular_citadel/code/game/objects/cit_screenshake.dm b/modular_citadel/code/game/objects/cit_screenshake.dm deleted file mode 100644 index 222de37f82..0000000000 --- a/modular_citadel/code/game/objects/cit_screenshake.dm +++ /dev/null @@ -1,51 +0,0 @@ -//we vlambeer now - -/obj/proc/shake_camera(mob/M, duration, strength=1)//byond's wonky with this shit - set waitfor = FALSE - if(!M || !M.client || duration <= 0) - return - var/client/C = M.client - if (C.prefs.screenshake==0) - return - var/oldx = C.pixel_x - var/oldy = C.pixel_y - var/clientscreenshake = (C.prefs.screenshake * 0.01) - var/max = (strength*clientscreenshake) * world.icon_size - var/min = -((strength*clientscreenshake) * world.icon_size) - - for(var/i in 0 to duration-1) - if (i == 0) - animate(C, pixel_x=rand(min,max), pixel_y=rand(min,max), time=1) - else - animate(pixel_x=rand(min,max), pixel_y=rand(min,max), time=1) - animate(pixel_x=oldx, pixel_y=oldy, time=1) - -/obj/item/gun/energy - recoil = 0.1 - -/obj/item/gun/energy/kinetic_accelerator - recoil = 0.5 - -/obj/item/gun/ballistic - recoil = 0.25 - -/obj/item/gun/ballistic/shotgun - recoil = 1 - -/obj/item/gun/ballistic/revolver - recoil = 0.5 - -/obj/item/gun/ballistic/revolver/doublebarrel - recoil = 1 - -/obj/item/gun/syringe - recoil = 0.1 - -/obj/item/pneumatic_cannon/fire_items(turf/target, mob/user) - . = ..() - shake_camera(user, (pressureSetting * 0.75 + 1), (pressureSetting * 0.75)) - -/obj/item/attack_obj(obj/O, mob/living/user) - . = ..() - if(force >= 20) - shake_camera(user, ((force - 15) * 0.01 + 1), ((force - 15) * 0.01)) diff --git a/tgstation.dme b/tgstation.dme index e33a3644d6..e888ab99f4 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3764,7 +3764,6 @@ #include "interface\skin.dmf" #include "modular_citadel\code\datums\components\souldeath.dm" #include "modular_citadel\code\datums\status_effects\chems.dm" -#include "modular_citadel\code\game\objects\cit_screenshake.dm" #include "modular_citadel\code\game\objects\effects\temporary_visuals\souldeath.dm" #include "modular_citadel\code\modules\admin\holder2.dm" #include "modular_citadel\code\modules\admin\secrets.dm" From a6a6733b465dacf7782e4bc4ff4849cfa50dd25c Mon Sep 17 00:00:00 2001 From: deathride58 Date: Tue, 31 May 2022 19:32:39 -0400 Subject: [PATCH 2/4] how did this get left out --- code/game/atoms.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 242f3123e1..9e6af39f1d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1295,7 +1295,7 @@ filters += filter(arglist(arguments)) UNSETEMPTY(filter_data) -/atom/proc/transition_filter(name, time, list/new_params, easing, loop) +/atom/proc/transition_filter(name, time, list/new_params, easing, loop, parallel = TRUE) var/filter = get_filter(name) if(!filter) return @@ -1306,7 +1306,7 @@ for(var/thing in new_params) params[thing] = new_params[thing] - animate(filter, new_params, time = time, easing = easing, loop = loop) + animate(filter, new_params, time = time, easing = easing, loop = loop, flags = (parallel ? ANIMATION_PARALLEL : 0)) for(var/param in params) filter_data[name][param] = params[param] From 09bdf4310a134d517da7f43073ffbfc2967ae0f8 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Tue, 31 May 2022 19:40:38 -0400 Subject: [PATCH 3/4] extra cleanup --- code/datums/chatmessage.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index f9e0697b1c..e4648233de 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -175,10 +175,6 @@ scheduled_destruction = world.time + (lifespan - CHAT_MESSAGE_EOL_FADE) enter_subsystem() - /*var/mob/living/silicon/robot/R = target - if(iscyborg(R)) - if((R.module.dogborg == TRUE || R.dogborg == TRUE) && isturf(R.loc)) //I hate whoever that thought that putting two types of dogborg that don't even sync up properly was good - message.pixel_x = 16*/ /** * Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion From dac4e9b974abb31f07b92b708f44239f1038ca41 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Sun, 5 Jun 2022 18:01:15 -0400 Subject: [PATCH 4/4] fixes ghost pixel z not resetting on orbit stop --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4b56be9ecd..94917e4de0 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -535,7 +535,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/stop_orbit(datum/component/orbiter/orbits) . = ..() //restart our floating animation after orbit is done. - pixel_y = 0 + pixel_z = 0 animate(src, pixel_z = 2, time = 10, loop = -1, flags = ANIMATION_RELATIVE) animate(pixel_z = -4, time = 10, loop = -1, flags = ANIMATION_RELATIVE)