Skip to content

Commit

Permalink
Merge pull request #8 from She-Is-Trying-To-Form-Her-First-Thought/it…
Browse files Browse the repository at this point in the history
…em_animations

Makes items randomly rotate when dropped and thrown, and also makes guns recoil in sprite when shot
  • Loading branch information
Paxilmaniac authored Nov 19, 2024
2 parents 00ca411 + 625e268 commit d3ab7c5
Show file tree
Hide file tree
Showing 30 changed files with 445 additions and 19 deletions.
8 changes: 2 additions & 6 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,8 @@
/// Cooldown for the visible message sent from gun flipping.
COOLDOWN_DECLARE(flip_cooldown)

light_system = OVERLAY_LIGHT // DOPPLETHAL ADDITION
light_range = 0 // DOPPLETHAL ADDITION
light_color = COLOR_WHITE // DOPPLETHAL ADDITION

var/obj/effect/muzzle_flash/muzzle_flash // DOPPLETHAL ADDITION
var/muzzle_flash_lum = 2 // DOPPLETHAL ADDITION
var/muzzleflash_iconstate // DOPPLETHAL ADDITION
var/muzzle_flash_color = COLOR_VERY_SOFT_YELLOW // DOPPLETHAL ADDITION
var/muzzle_effects = TRUE // DOPPLETHAL ADDITION

/obj/item/gun/Initialize(mapload)
Expand Down Expand Up @@ -453,6 +447,7 @@
return FALSE
process_chamber()
update_appearance()
firing_animation(user, TRUE) // DOPPLETHAL EDIT
return TRUE

///returns true if the gun successfully fires
Expand Down Expand Up @@ -506,6 +501,7 @@
return
process_chamber()
update_appearance()
firing_animation(user, FALSE)
semicd = TRUE
addtimer(CALLBACK(src, PROC_REF(reset_semicd)), modified_delay)

Expand Down
60 changes: 60 additions & 0 deletions modular_lethal_doppler/item_visuals/code/random_rotation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/obj/item
/// Used for unturning when picked up by a mob
var/our_angle = 0

/// Randomly rotates and pixel shifts stuff when dropped or thrown or whatever
/obj/item/proc/do_messy(pixel_variation = 8, angle_variation = 360, duration = 0)
if(item_flags & NO_PIXEL_RANDOM_DROP)
return
animate(src, pixel_x = (base_pixel_x+rand(-pixel_variation,pixel_variation)), duration)
animate(src, pixel_y = (base_pixel_y+rand(-pixel_variation,pixel_variation)), duration)
if(our_angle)
animate(src, transform = transform.Turn(-our_angle), duration)
our_angle = 0
our_angle = rand(0,angle_variation)
transform = transform.Turn(our_angle)

/// Unrotates and pixel shifts things
/obj/item/proc/undo_messy(duration = 0)
animate(src, pixel_x = base_pixel_x, duration)
animate(src, pixel_y = base_pixel_y, duration)
if(our_angle)
animate(src, transform = transform.Turn(-our_angle), duration)
our_angle = 0

/// Messes things up when thrown
/obj/item/on_thrown(mob/living/carbon/user, atom/target)
if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP))
return
user.dropItemToGround(src, silent = TRUE)
if(throwforce && (HAS_TRAIT(user, TRAIT_PACIFISM)) || HAS_TRAIT(user, TRAIT_NO_THROWING))
to_chat(user, span_notice("You set [src] down gently on the ground."))
return
undo_messy()
do_messy(duration = 4)
return src

/// Extra messes things up when thrown
/obj/item/after_throw(datum/callback/callback)
. = ..()
undo_messy()
do_messy(duration = 2)

/// Messes things up when they fall zlevels
/obj/item/onZImpact(turf/turf_fallen, levels)
. = ..()
undo_messy()
do_messy(duration = 4)

/// Fixes how things look when you pick them up
/mob/put_in_hand(obj/item/item_picked, hand_index, forced = FALSE, ignore_anim = TRUE, visuals_only = FALSE)
. = ..()
if(. && item_picked)
item_picked.undo_messy(duration = 0)

/// Messes up items when you drop them to the floor
/mob/dropItemToGround(obj/item/item_dropped, force, silent, invdrop)
. = ..()
if(. && item_dropped)
if(!(item_dropped.item_flags & NO_PIXEL_RANDOM_DROP))
item_dropped.do_messy(duration = 2)
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/bobr_kurwa.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
recoil = 0.5
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
gunshot_animation_information = list(
"pixel_x" = 15, \
"pixel_y" = 3, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -15, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/revolver/shotgun_revolver/give_manufacturer_examine()
AddElement(/datum/element/manufacturer_examine, COMPANY_SZOT)
Expand Down
13 changes: 13 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/bogseo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
recoil = 1.5
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
gunshot_animation_information = list(
"pixel_x" = 18, \
"pixel_y" = 1, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
"recoil_speed" = 0.5, \
"return_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/xhihao_smg/Initialize(mapload)
. = ..()
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/cawil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
recoil = 0.5
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_heavygun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_heavygun.wav'
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 0, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/sol_rifle/Initialize(mapload)
. = ..()
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/eland.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
recoil = 0.25
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
gunshot_animation_information = list(
"pixel_x" = 13, \
"pixel_y" = 2, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -15, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/revolver/sol/give_manufacturer_examine()
AddElement(/datum/element/manufacturer_examine, COMPANY_TRAPPISTE)
Expand Down
12 changes: 11 additions & 1 deletion modular_lethal_doppler/paxilweapons_real/code/guns/fukiya.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@
weapon_weight = WEAPON_HEAVY
pb_knockback = 2
recoil = 2
muzzle_flash_lum = 3
muzzleflash_iconstate = "muzzle_flash_medium"
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 1, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/marsian_super_rifle/add_bayonet_point()
return
Expand Down
12 changes: 12 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/gwiazda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
projectile_wound_bonus = 10 // +55 of the base projectile, burn baby burn
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
gunshot_animation_information = list(
"pixel_x" = 15, \
"pixel_y" = 3, \
"inactive_wben_suppressed" = TRUE, \
"icon_state" = "plasmashot" \
)
recoil_animation_information = list(
"recoil_angle_upper" = -15, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/pistol/plasma_marksman/give_manufacturer_examine()
AddElement(/datum/element/manufacturer_examine, COMPANY_SZOT)
Expand Down
14 changes: 14 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/karim.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
'sound/items/weapons/gun/smartgun/smartgun_shoot_2.ogg',
'sound/items/weapons/gun/smartgun/smartgun_shoot_3.ogg',
)
gunshot_animation_information = list(
"pixel_x" = 18, \
"pixel_y" = 0, \
"inactive_wben_suppressed" = TRUE, \
"icon_state" = "pulseshot" \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
"recoil_speed" = 0.5, \
"return_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/karim/Initialize(mapload)
. = ..()
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/kiboko.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
actions_types = list()
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_heavygun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_heavygun.wav'
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 1, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)
/// The currently stored range to detonate shells at
var/target_range = 14
/// The maximum range we can set grenades to detonate at, just to be safe
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/lanca.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
projectile_wound_bonus = -20
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
gunshot_animation_information = list(
"pixel_x" = 34, \
"pixel_y" = 0, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/lanca/Initialize(mapload)
. = ..()
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/mavu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
recoil = 0.25
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_lightgun.wav'
gunshot_animation_information = list(
"pixel_x" = 15, \
"pixel_y" = 3, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -15, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/pistol/sol/give_manufacturer_examine()
AddElement(/datum/element/manufacturer_examine, COMPANY_TRAPPISTE)
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/miecz.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
recoil = 0.25
pickup_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
drop_sound = 'modular_lethal_doppler/paxilweapons_real/sound/pickup_sounds/drop_mediumgun.wav'
gunshot_animation_information = list(
"pixel_x" = 28, \
"pixel_y" = 0, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/miecz/Initialize(mapload)
. = ..()
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/nomi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
projectile_wound_bonus = -20
projectile_damage_multiplier = 0.75
recoil = 0.5
gunshot_animation_information = list(
"pixel_x" = 34, \
"pixel_y" = 3, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/nomi_shotgun/add_bayonet_point()
return
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/osako.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
slot_flags = ITEM_SLOT_BACK
can_suppress = FALSE
can_unsuppress = FALSE
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 2, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/rifle/osako/add_bayonet_point()
return
Expand Down
13 changes: 13 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/qarad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
spread = 10
projectile_wound_bonus = -10
suppressor_x_offset = 9
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 0, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
"recoil_speed" = 0.5, \
"return_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/sol_rifle/machinegun/give_autofire()
AddComponent(/datum/component/automatic_fire, fire_delay)
Expand Down
11 changes: 11 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/ramu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
slot_flags = ITEM_SLOT_BACK
recoil = 2
accepted_magazine_type = /obj/item/ammo_box/magazine/internal/s6gauge
gunshot_animation_information = list(
"pixel_x" = 35, \
"pixel_y" = 3, \
"inactive_wben_suppressed" = TRUE, \
)
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -30, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/shotgun/ramu/add_bayonet_point()
return
Expand Down
6 changes: 6 additions & 0 deletions modular_lethal_doppler/paxilweapons_real/code/guns/ransu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
spread = 0
projectile_damage_multiplier = 1
recoil = 0.5
recoil_animation_information = list(
"recoil_angle_upper" = -10, \
"recoil_angle_lower" = -20, \
"recoil_burst_speed" = 0.5, \
"return_burst_speed" = 0.5, \
)

/obj/item/gun/ballistic/automatic/suppressed_rifle/marksman/Initialize(mapload)
. = ..()
Expand Down
Loading

0 comments on commit d3ab7c5

Please sign in to comment.