Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 69a7eb2

Browse files
Probably fixes afterburner doing more damage than intended (#22467)
* probably fixes it * Update other_weapons.dm
1 parent f86a340 commit 69a7eb2

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

code/datums/actions/action.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
qdel(src)
8080

8181
/// Grants the action to the passed mob, making it the owner
82-
/datum/action/proc/Grant(mob/grant_to)
82+
/datum/action/proc/Grant(mob/grant_to, ...)
8383
if(isnull(grant_to))
8484
Remove(owner)
8585
return

code/game/mecha/equipment/mecha_equipment.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
// Grant any actions to the pilot
243243
/obj/item/mecha_parts/mecha_equipment/proc/grant_actions(mob/pilot)
244244
for(var/datum/action/action as anything in equip_actions)
245-
action.Grant(pilot)
245+
action.Grant(pilot, chassis, src)
246246

247247
// Remove the actions!!!!
248248
/obj/item/mecha_parts/mecha_equipment/proc/remove_actions(mob/pilot)

code/game/mecha/equipment/weapons/other_weapons.dm

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
selectable = FALSE // your mech IS the weapon
66
var/minimum_damage = 10
77
var/structure_damage_mult = 4
8+
var/list/hit_list = list()
89
equip_actions = list(/datum/action/cooldown/mecha_afterburner)
910

1011
/obj/item/mecha_parts/mecha_equipment/afterburner/can_attach(obj/mecha/new_mecha)
1112
if(!(new_mecha.melee_allowed || istype(new_mecha, /obj/mecha/working/clarke))) // clarke because it's fucking COOL
1213
return FALSE
14+
if(locate(type) in new_mecha.equipment)
15+
return FALSE // no stacking multiple afterburners to get around the cooldown
1316
return ..()
1417

1518
/obj/item/mecha_parts/mecha_equipment/afterburner/attach(obj/mecha/new_mecha)
@@ -52,11 +55,16 @@
5255
hit_something = TRUE
5356
else if(isliving(hit_atom))
5457
var/mob/living/stomped = hit_atom
58+
if(stomped in hit_list)
59+
continue
5560
if(!stomped.check_shields(chassis, kinetic_damage * structure_damage_mult, "[chassis]", MELEE_ATTACK, 50)) // i mean, you can TRY to block it
5661
stomped.apply_damage(kinetic_damage * (isanimal(stomped) ? 4 : 1), BRUTE, BODY_ZONE_CHEST) // bonus damage to simple mobs
5762
stomped.Knockdown(0.5 SECONDS) // just long enough for the mech to pass over
63+
to_chat(stomped, span_userdanger("[chassis] crashes into you at full speed!"))
5864
if(stomped.mobility_flags & MOBILITY_STAND) // still standing? knock them back!
5965
stomped.throw_at(get_step(stomped, get_dir(chassis, stomped)), 1, 5, chassis.occupant, TRUE)
66+
else
67+
hit_list += stomped
6068
hit_something = TRUE
6169

6270
if(hit_something)
@@ -77,17 +85,21 @@
7785
button_icon_state = "mech_afterburner"
7886
/// The exosuit linked to this action.
7987
var/obj/mecha/chassis
88+
var/obj/item/mecha_parts/mecha_equipment/afterburner/rocket
8089
/// Whether the linked exosuit has received bonus armor from charging.
8190
var/bonus_lavaland_armor = FALSE
8291

83-
/datum/action/cooldown/mecha_afterburner/Grant(mob/living/L, obj/mecha/M)
84-
if(M)
85-
chassis = M
92+
/datum/action/cooldown/mecha_afterburner/Grant(mob/living/new_owner, obj/mecha/new_mecha, obj/item/mecha_parts/mecha_equipment/new_equip)
93+
if(new_mecha)
94+
chassis = new_mecha
95+
if(new_equip)
96+
rocket = new_equip
8697
return ..()
8798

8899
/datum/action/cooldown/mecha_afterburner/Activate()
89100
if(chassis.completely_disabled)
90101
return
102+
chassis.pass_flags |= PASSMOB // for not getting stopped by anything that can't be knocked down
91103
chassis.movement_type |= FLYING // for doing sick jumps over chasms
92104
chassis.completely_disabled = TRUE
93105
chassis.AddComponent(/datum/component/after_image, 0.7 SECONDS, 0.5, FALSE)
@@ -119,3 +131,6 @@
119131
bonus_lavaland_armor = FALSE
120132
chassis.completely_disabled = FALSE
121133
chassis.movement_type &= ~FLYING
134+
chassis.pass_flags &= ~PASSMOB
135+
qdel(rocket.hit_list)
136+
rocket.hit_list = list()

0 commit comments

Comments
 (0)