Skip to content

Commit

Permalink
punch_act (PMC-Unga-Marines#499)
Browse files Browse the repository at this point in the history
Signed-off-by: Helg2 <[email protected]>
  • Loading branch information
Helg2 authored Oct 13, 2024
1 parent f5e970d commit 20cc3df
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 111 deletions.
9 changes: 9 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,12 @@ GLOBAL_LIST_INIT(human_body_parts, list(BODY_ZONE_HEAD,

///Filter name for illusion impacts
#define ILLUSION_HIT_FILTER "illusion_hit_filter"

#define WARRIOR_PUNCH_SLOWDOWN 3
#define WARRIOR_PUNCH_STAGGER 3
#define WARRIOR_PUNCH_EMPOWER_MULTIPLIER 1.8
#define WARRIOR_PUNCH_GRAPPLED_DAMAGE_MULTIPLIER 1.8
#define WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER 1.5
#define WARRIOR_PUNCH_GRAPPLED_PARALYZE 0.5 SECONDS
#define WARRIOR_PUNCH_KNOCKBACK_DISTANCE 1
#define WARRIOR_PUNCH_KNOCKBACK_SPEED 1
4 changes: 4 additions & 0 deletions code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -978,3 +978,7 @@ directive is properly returned.
///By default, if this happens then movement stops. But not necessarily.
/atom/proc/post_crush_act(mob/living/carbon/xenomorph/charger, datum/action/ability/xeno_action/ready_charge/charge_datum)
return PRECRUSH_STOPPED

/// Handles anything that should happen when the Warrior's punch hits any atom.
/atom/proc/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, push = TRUE)
return TRUE
16 changes: 16 additions & 0 deletions code/game/objects/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,19 @@
. = ..()
if(CHECK_BITFIELD(S.smoke_traits, SMOKE_XENO_ACID))
take_damage(10 * S.strength, BURN, ACID)

/obj/machinery/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
if(!(resistance_flags & UNACIDABLE) || resistance_flags & XENO_DAMAGEABLE) // If it's acidable or we can't acid it but it has the xeno damagable flag, we can damage it
attack_generic(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)
if(!(machine_stat & PANEL_OPEN))
machine_stat |= PANEL_OPEN
if(wires)
var/allcut = wires.is_all_cut()
if(!allcut)
wires.cut_all()
update_appearance()
return TRUE
8 changes: 8 additions & 0 deletions code/game/objects/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@
user.see_in_dark = 2
return TRUE

/obj/machinery/camera/punch_act(...)
. = ..()
var/datum/effect_system/spark_spread/sparks = new
sparks.set_up(2, 0, src)
sparks.attach(src)
sparks.start()
deactivate()

/obj/machinery/camera/autoname
light_range = 1
light_power = 0.2
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/machinery/computer/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,7 @@
xeno_attacker.do_attack_animation(src, ATTACK_EFFECT_DISARM2) //SFX
playsound(loc, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 25, 1) //SFX
Shake(duration = 0.5 SECONDS)

/obj/machinery/computer/punch_act(...)
set_disabled() // Currently only computers use this; falcon punch away its density.
return ..()
5 changes: 5 additions & 0 deletions code/game/objects/machinery/vending/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,11 @@
span_xenowarning("We slam [src] into the ground!"))
return PRECRUSH_PLOWED

/obj/machinery/vending/punch_act(...)
. = ..()
if(tipped_level < 2)
tip_over()

#undef CAT_NORMAL
#undef CAT_HIDDEN
#undef CAT_COIN
Expand Down
8 changes: 8 additions & 0 deletions code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,11 @@
. = ..()
if(CHECK_BITFIELD(S.smoke_traits, SMOKE_XENO_ACID))
take_damage(10 * S.strength, BURN, ACID)

/obj/structure/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
. = ..()
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
attack_alien(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,6 @@
// ***************************************
// *********** Punch
// ***************************************
#define WARRIOR_PUNCH_SLOWDOWN 3
#define WARRIOR_PUNCH_STAGGER 3
#define WARRIOR_PUNCH_EMPOWER_MULTIPLIER 1.8 // RU TGMC EDIT
#define WARRIOR_PUNCH_GRAPPLED_DAMAGE_MULTIPLIER 1.8
#define WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER 1.5
#define WARRIOR_PUNCH_GRAPPLED_PARALYZE 0.5 SECONDS
#define WARRIOR_PUNCH_KNOCKBACK_DISTANCE 1 // in tiles
#define WARRIOR_PUNCH_KNOCKBACK_SPEED 1

/datum/action/ability/activable/xeno/warrior/punch
name = "Punch"
Expand Down Expand Up @@ -543,108 +535,6 @@
return FALSE
return TRUE

/// Handles anything that should happen when the Warrior's punch hits any atom.
/atom/proc/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, push = TRUE)
return TRUE

/obj/machinery/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
if(!(resistance_flags & UNACIDABLE) || resistance_flags & XENO_DAMAGEABLE) // If it's acidable or we can't acid it but it has the xeno damagable flag, we can damage it
attack_generic(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)
if(!(machine_stat & PANEL_OPEN))
machine_stat |= PANEL_OPEN
if(wires)
var/allcut = wires.is_all_cut()
if(!allcut)
wires.cut_all()
//update_appearance()
return TRUE

/obj/machinery/computer/punch_act(...)
set_disabled() // Currently only computers use this; falcon punch away its density.
return ..()

/obj/machinery/light/punch_act(mob/living/carbon/xenomorph/xeno, ...)
. = ..()
attack_alien(xeno)

/obj/machinery/camera/punch_act(...)
. = ..()
var/datum/effect_system/spark_spread/sparks = new
sparks.set_up(2, 0, src)
sparks.attach(src)
sparks.start()
deactivate()

/obj/machinery/power/apc/punch_act(...)
. = ..()
beenhit += 4 // Break it open instantly.
//update_appearance()

/obj/machinery/vending/punch_act(...)
. = ..()
if(tipped_level < 2)
tip_over()

/obj/structure/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
. = ..()
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
attack_alien(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)

/obj/vehicle/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
. = ..()
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
attack_generic(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)
return TRUE

/mob/living/punch_act(mob/living/carbon/xenomorph/warrior/xeno, punch_damage, push = TRUE)
. = ..()
var/slowdown_stacks = WARRIOR_PUNCH_SLOWDOWN
var/stagger_stacks = WARRIOR_PUNCH_STAGGER
var/visual_effect = /obj/effect/temp_visual/warrior/punch/weak
var/sound_effect = 'sound/weapons/punch1.ogg'
if(pulledby == xeno)
xeno.stop_pulling()
punch_damage *= WARRIOR_PUNCH_GRAPPLED_DAMAGE_MULTIPLIER
slowdown_stacks *= WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER
stagger_stacks *= WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER
visual_effect = /obj/effect/temp_visual/warrior/punch/strong
sound_effect = 'sound/weapons/punch2.ogg'
Paralyze(WARRIOR_PUNCH_GRAPPLED_PARALYZE)
Shake(duration = 0.5 SECONDS)
var/datum/limb/target_limb
if(!iscarbon(src))
var/mob/living/carbon/carbon_target = src
target_limb = carbon_target.get_limb(xeno.zone_selected)
if(!target_limb || (target_limb.limb_status & LIMB_DESTROYED))
target_limb = carbon_target.get_limb(BODY_ZONE_CHEST)
xeno.face_atom(src)
xeno.do_attack_animation(src)
new visual_effect(get_turf(src))
playsound(src, sound_effect, 50, 1)
shake_camera(src, 1, 1)
add_slowdown(slowdown_stacks)
adjust_stagger(stagger_stacks SECONDS)
adjust_blurriness(slowdown_stacks)
apply_damage(punch_damage, BRUTE, target_limb ? target_limb : 0, MELEE)
apply_damage(punch_damage, STAMINA, updating_health = TRUE)
var/turf_behind = get_step(src, REVERSE_DIR(get_dir(src, xeno)))
if(!push)
return
if(LinkBlocked(get_turf(src), turf_behind))
do_attack_animation(turf_behind)
return
knockback(xeno, WARRIOR_PUNCH_KNOCKBACK_DISTANCE, WARRIOR_PUNCH_KNOCKBACK_SPEED)

/obj/effect/temp_visual/warrior/punch
icon = 'icons/effects/effects.dmi'
icon_state = "weak_punch"
Expand All @@ -662,7 +552,6 @@
pixel_x = -16
pixel_y = -16


// ***************************************
// *********** Flurry
// ***************************************
Expand Down
39 changes: 39 additions & 0 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,42 @@

/mob/living/proc/emote_gored()
return

/mob/living/punch_act(mob/living/carbon/xenomorph/warrior/xeno, punch_damage, push = TRUE)
. = ..()
var/slowdown_stacks = WARRIOR_PUNCH_SLOWDOWN
var/stagger_stacks = WARRIOR_PUNCH_STAGGER
var/visual_effect = /obj/effect/temp_visual/warrior/punch/weak
var/sound_effect = 'sound/weapons/punch1.ogg'
if(pulledby == xeno)
xeno.stop_pulling()
punch_damage *= WARRIOR_PUNCH_GRAPPLED_DAMAGE_MULTIPLIER
slowdown_stacks *= WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER
stagger_stacks *= WARRIOR_PUNCH_GRAPPLED_DEBUFF_MULTIPLIER
visual_effect = /obj/effect/temp_visual/warrior/punch/strong
sound_effect = 'sound/weapons/punch2.ogg'
Paralyze(WARRIOR_PUNCH_GRAPPLED_PARALYZE)
Shake(duration = 0.5 SECONDS)
var/datum/limb/target_limb
if(!iscarbon(src))
var/mob/living/carbon/carbon_target = src
target_limb = carbon_target.get_limb(xeno.zone_selected)
if(!target_limb || (target_limb.limb_status & LIMB_DESTROYED))
target_limb = carbon_target.get_limb(BODY_ZONE_CHEST)
xeno.face_atom(src)
xeno.do_attack_animation(src)
new visual_effect(get_turf(src))
playsound(src, sound_effect, 50, 1)
shake_camera(src, 1, 1)
add_slowdown(slowdown_stacks)
adjust_stagger(stagger_stacks SECONDS)
adjust_blurriness(slowdown_stacks)
apply_damage(punch_damage, BRUTE, target_limb ? target_limb : 0, MELEE)
apply_damage(punch_damage, STAMINA, updating_health = TRUE)
var/turf_behind = get_step(src, REVERSE_DIR(get_dir(src, xeno)))
if(!push)
return
if(LinkBlocked(get_turf(src), turf_behind))
do_attack_animation(turf_behind)
return
knockback(xeno, WARRIOR_PUNCH_KNOCKBACK_DISTANCE, WARRIOR_PUNCH_KNOCKBACK_SPEED)
4 changes: 4 additions & 0 deletions code/modules/power/apc/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@
update()
update_icon()

/obj/machinery/power/apc/punch_act(...)
. = ..()
beenhit += 4 // Break it open instantly.
update_appearance()

//------Various APCs ------//

Expand Down
4 changes: 4 additions & 0 deletions code/modules/power/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@
cell_explosion(loc, 70, 30)
qdel(src)

/obj/machinery/light/punch_act(mob/living/carbon/xenomorph/xeno, ...)
. = ..()
attack_alien(xeno)

/obj/machinery/light/mainship
base_state = "tube"

Expand Down
9 changes: 9 additions & 0 deletions code/modules/vehicles/__vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,12 @@
return PRECRUSH_STOPPED
charge_datum.speed_down(2) //Lose two turfs worth of speed.
return NONE

/obj/vehicle/punch_act(mob/living/carbon/xenomorph/xeno, punch_damage, ...)
. = ..()
xeno.do_attack_animation(src, ATTACK_EFFECT_YELLOWPUNCH)
xeno.do_attack_animation(src, ATTACK_EFFECT_DISARM2)
attack_generic(xeno, punch_damage * 4, BRUTE, effects = FALSE)
playsound(src, pick('sound/effects/bang.ogg','sound/effects/metal_crash.ogg','sound/effects/meteorimpact.ogg'), 50, 1)
Shake(duration = 0.5 SECONDS)
return TRUE

0 comments on commit 20cc3df

Please sign in to comment.