Skip to content

Commit

Permalink
Tank IFF, Minigun tweaks, code cleanup & new hitsound (#6688)
Browse files Browse the repository at this point in the history
# About the pull request

* Adds IFF to the Minigun
* Changes used projectile icon for Minigun
* Adds scatter decrease to Minigun with windup
* increases firing speed of the minigun
* increases rev up time of the minigun
* Puts Minigun bullet code into the tank ammo file, for organisation.
* Adds hitsound for Autocannon Flakbullets
* Adds new projectile icon for Autocannon
* Fixes code for UPP minigun ammo

# Explain why it's good for the game

The Minigun for the Tank is lacking IFF for no good reason. Its a left
over from old code and isnt adjusted for its current state.
This should make the Minigun less ass to use, and also make the Minigun
a better choice overall.
The autocannon keeps FF, to have to role of a more high risk/high damage
weapon. Its semi automatic, so it can affort not getting IFF.

The Minigun also gets thigther spread as it spins up. It starts at a
higher spread in turn.
The full time to achive full spin has also been increased by 2 seconds,
and the overall firingspeed has been very very sligthly increased.
This overall should make the minigun a very good support weapon. Baiscly
the SGs bigger cousin, just that the gun is actually fun. I hope. to
eleate it being the SGs bigger cousin, the gun now no longer has smaller
projectile sprites then the SG. Autocannon also gets new sprites fitting
for its 20mm rounds.
These changes should elevate the minigun to become a more stable pick
and less of a noob trap.

The new hitsound is sampeld straigth from pixabay or our repo. So no
legal troubles there.

Thanks to cuberound that helped with the minigun scatter code

# Testing Photographs and Procedure

<details>
<summary>Screenshots & Videos</summary>

![grafik](https://github.com/user-attachments/assets/ebca5e74-6a3e-4e35-a288-613e550d094b)


</details>


# Changelog
:cl: TheManWithNoHands
balance: IFF, scatter based on minigun rev up, rev up time increase,
firing delay decrease
code: Places minigun aMmo in the Tank ammo File
soundadd: adds a hit sound for 20mm flak
/:cl:

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
TheManWithNoHands and harryob committed Aug 23, 2024
1 parent 97c21f9 commit ba5c7ca
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 11 deletions.
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()
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.

0 comments on commit ba5c7ca

Please sign in to comment.