Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tank IFF, Minigun tweaks, code cleanup & new hitsound #6688

Merged
merged 13 commits into from
Aug 23, 2024
7 changes: 1 addition & 6 deletions code/datums/ammo/bullet/special_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,10 @@
RegisterSignal(SSdcs, COMSIG_GLOB_MODE_PRESETUP, PROC_REF(setup_hvh_damage))

/datum/ammo/bullet/minigun/proc/setup_hvh_damage()
SIGNAL_HANDLER
if(MODE_HAS_FLAG(MODE_FACTION_CLASH))
damage = 15

/datum/ammo/bullet/minigun/tank
accuracy = -HIT_ACCURACY_TIER_1
accuracy_var_low = PROJECTILE_VARIANCE_TIER_8
accuracy_var_high = PROJECTILE_VARIANCE_TIER_8
accurate_range = 12

/datum/ammo/bullet/m60
name = "M60 bullet"
headshot_state = HEADSHOT_OVERLAY_MEDIUM
Expand Down
30 changes: 30 additions & 0 deletions code/datums/ammo/bullet/tank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
//======
*/

//Autocannon Ammo//

/datum/ammo/bullet/tank/flak
name = "flak autocannon bullet"
icon_state = "autocannon"
sound_hit = 'sound/weapons/sting_boom_small1.ogg'
damage_falloff = 0
flags_ammo_behavior = AMMO_BALLISTIC
accurate_range_min = 4
Expand Down Expand Up @@ -72,3 +75,30 @@
for(var/mob/living/carbon/L in T)
if(L.stat == CONSCIOUS && L.mob_size <= MOB_SIZE_XENO)
shake_camera(L, 1, 1)

//Minigun Ammo//

/datum/ammo/bullet/tank/minigun
name = "minigun bullet"
headshot_state = HEADSHOT_OVERLAY_MEDIUM
icon_state = "bullet_large"

accuracy = -HIT_ACCURACY_TIER_1
accuracy_var_low = PROJECTILE_VARIANCE_TIER_8
accuracy_var_high = PROJECTILE_VARIANCE_TIER_8
accurate_range = 12
damage = 40
penetration = ARMOR_PENETRATION_TIER_6
damage_armor_punch = 1

/datum/ammo/bullet/tank/minigun/New()
..()
if(SSticker.mode && MODE_HAS_FLAG(MODE_FACTION_CLASH))
damage = 15
else if(SSticker.current_state < GAME_STATE_PLAYING)
RegisterSignal(SSdcs, COMSIG_GLOB_MODE_PRESETUP, PROC_REF(setup_hvh_damage))

/datum/ammo/bullet/tank/minigun/proc/setup_hvh_damage()
TheManWithNoHands marked this conversation as resolved.
Show resolved Hide resolved
SIGNAL_HANDLER
if(MODE_HAS_FLAG(MODE_FACTION_CLASH))
damage = 15
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
caliber = "7.62x51mm" //Correlates to miniguns
icon_state = "painless"
w_class = SIZE_LARGE //Primary weapon ammo should probably all be the same w_class
default_ammo = /datum/ammo/bullet/minigun/tank
default_ammo = /datum/ammo/bullet/tank/minigun
max_rounds = 500
gun_type = /obj/item/hardpoint/primary/minigun
14 changes: 10 additions & 4 deletions code/modules/vehicles/hardpoints/primary/minigun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"8" = list(-77, 0)
)

scatter = 7
scatter = 18
gun_firemode = GUN_FIREMODE_AUTOMATIC
gun_firemode_list = list(
GUN_FIREMODE_AUTOMATIC,
)
fire_delay = 0.8 SECONDS //base fire rate, modified by stage_delay_mult
fire_delay = 0.7 SECONDS //base fire rate, modified by stage_delay_mult

activation_sounds = list('sound/weapons/gun_minigun.ogg')
/// Active firing time to reach max spin_stage.
var/spinup_time = 8 SECONDS
var/spinup_time = 10 SECONDS
/// Grace period before losing spin_stage.
var/spindown_grace_time = 2 SECONDS
COOLDOWN_DECLARE(spindown_grace_cooldown)
Expand All @@ -52,7 +52,7 @@

/obj/item/hardpoint/primary/minigun/set_fire_delay(value)
fire_delay = value
SEND_SIGNAL(src, COMSIG_GUN_AUTOFIREDELAY_MODIFIED, fire_delay * stage_delay_mult)
SEND_SIGNAL(src, COMSIG_GUN_AUTOFIREDELAY_MODIFIED, fire_delay * stage_delay_mult, scatter * stage_delay_mult)

/obj/item/hardpoint/primary/minigun/set_fire_cooldown()
calculate_stage_delay_mult() //needs to check grace_cooldown before refreshed
Expand All @@ -79,5 +79,11 @@
var/new_stage_rate = stage_rate[floor(spin_stage)]

if(old_stage_rate != new_stage_rate)
scatter = initial(scatter) * (1/new_stage_rate)
stage_delay_mult = 1 / new_stage_rate
SEND_SIGNAL(src, COMSIG_GUN_AUTOFIREDELAY_MODIFIED, fire_delay * stage_delay_mult)

/obj/item/hardpoint/primary/minigun/set_bullet_traits()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff)
))
Binary file modified icons/obj/items/weapons/projectiles.dmi
Binary file not shown.
Binary file added sound/weapons/sting_boom_small1.ogg
Binary file not shown.
Loading