Fixes mech bump smash using sword attack (#16831)

* 2 out of 14

need to go to bed

* ok fine turdis be like that
This commit is contained in:
Mqiib
2022-12-02 09:14:43 -05:00
committed by GitHub
parent bbc3a9888d
commit 16df09cc53
14 changed files with 17 additions and 17 deletions

View File

@@ -826,7 +826,7 @@
dir = newdir
///Handle melee attack by a mech
/atom/proc/mech_melee_attack(obj/mecha/M)
/atom/proc/mech_melee_attack(obj/mecha/M, equip_allowed = TRUE)
return
/**

View File

@@ -582,7 +582,7 @@
return
if(equipment_disabled)
return
target.mech_melee_attack(src)
target.mech_melee_attack(src, TRUE)
melee_can_hit = FALSE
spawn(melee_cooldown)
melee_can_hit = TRUE
@@ -734,7 +734,7 @@
if(bumpsmash && occupant) //Need a pilot to push the PUNCH button.
if(!equipment_disabled)
if(nextsmash < world.time)
obstacle.mech_melee_attack(src)
obstacle.mech_melee_attack(src, FALSE) //Non-equipment melee attack
nextsmash = world.time + smashcooldown
if(!obstacle || obstacle.CanPass(src,newloc))
step(src,dir)

View File

@@ -317,7 +317,7 @@
target.reagents.add_reagent(/datum/reagent/toxin, force/2.5)
/obj/mecha/mech_melee_attack(obj/mecha/M)
/obj/mecha/mech_melee_attack(obj/mecha/M, equip_allowed)
if(!has_charge(melee_energy_drain))
return 0
use_power(melee_energy_drain)

View File

@@ -16,7 +16,7 @@
/obj/effect/acid_act()
return
/obj/effect/mech_melee_attack(obj/mecha/M)
/obj/effect/mech_melee_attack(obj/mecha/M, equip_allowed)
return 0
/obj/effect/blob_act(obj/structure/blob/B)

View File

@@ -714,7 +714,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
return ..()
return 0
/obj/item/mech_melee_attack(obj/mecha/M)
/obj/item/mech_melee_attack(obj/mecha/M, equip_allowed)
return 0
/obj/item/deconstruct(disassembled = TRUE)

View File

@@ -146,7 +146,7 @@
return
attack_generic(user, rand(10, 15), BRUTE, MELEE, 1)
/obj/mech_melee_attack(obj/mecha/M)
/obj/mech_melee_attack(obj/mecha/M, equip_allowed)
M.do_attack_animation(src)
var/play_soundeffect = 0
var/mech_damtype = M.damtype

View File

@@ -247,7 +247,7 @@
/obj/structure/window/proc/check_state_and_anchored(checked_state, checked_anchored)
return check_state(checked_state) && check_anchored(checked_anchored)
/obj/structure/window/mech_melee_attack(obj/mecha/M)
/obj/structure/window/mech_melee_attack(obj/mecha/M, equip_allowed)
if(!can_be_reached())
return
..()

View File

@@ -108,7 +108,7 @@
user.adjustFireLoss(5)
playsound(src, 'sound/machines/fryer/deep_fryer_emerge.ogg', 50, TRUE)
/turf/closed/wall/clockwork/mech_melee_attack(obj/mecha/M)
/turf/closed/wall/clockwork/mech_melee_attack(obj/mecha/M, equip_allowed)
..()
if(heated)
to_chat(M.occupant, span_userdanger("The wall's intense heat completely reflects your [M.name]'s attack!"))

View File

@@ -120,7 +120,7 @@
else
add_dent(WALL_DENT_HIT)
/turf/closed/wall/mech_melee_attack(obj/mecha/M)
/turf/closed/wall/mech_melee_attack(obj/mecha/M, equip_allowed)
M.do_attack_animation(src)
switch(M.damtype)
if(BRUTE)

View File

@@ -72,7 +72,7 @@
return FALSE
return ..()
/obj/structure/destructible/clockwork/mech_melee_attack(obj/mecha/M)
/obj/structure/destructible/clockwork/mech_melee_attack(obj/mecha/M, equip_allowed)
if(M.occupant && is_servant_of_ratvar(M.occupant) && immune_to_servant_attacks)
return FALSE
return ..()

View File

@@ -441,7 +441,7 @@
SSticker.mode.cult_loss_bloodstones()
..()
/obj/structure/destructible/cult/bloodstone/mech_melee_attack(obj/mecha/M)
/obj/structure/destructible/cult/bloodstone/mech_melee_attack(obj/mecha/M, equip_allowed) //Remind me to redo this jank-ass calculation
M.force = round(M.force/6, 1) //damage is reduced since mechs deal triple damage to objects, this sets gygaxes to 15 (5*3) damage and durands to 21 (7*3) damage
. = ..()
M.force = initial(M.force)

View File

@@ -378,8 +378,8 @@
var/armor_block = run_armor_check(affecting, MELEE)
apply_damage(damage, BRUTE, affecting, armor_block, wound_bonus=wound_mod)
/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
if(M.selected?.melee_override)
/mob/living/carbon/human/mech_melee_attack(obj/mecha/M, equip_allowed)
if(M.selected?.melee_override && equip_allowed)
M.selected.action(src)
else if(M.occupant.a_intent == INTENT_HARM)
M.do_attack_animation(src)

View File

@@ -99,8 +99,8 @@
..()
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.selected?.melee_override)
/mob/living/mech_melee_attack(obj/mecha/M, equip_allowed)
if(M.selected?.melee_override && equip_allowed)
M.selected.action(src)
else if(M.occupant.a_intent == INTENT_HARM)
last_damage = "grand blunt trauma"

View File

@@ -183,7 +183,7 @@
if(mecha.melee_can_hit)
mecha_face_target(target)
target.mech_melee_attack(mecha)
target.mech_melee_attack(mecha, TRUE)
else
if(ismecha(target))
var/obj/mecha/M = target