mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
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:
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
..()
|
||||
|
||||
@@ -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!"))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user