Skip to content

Commit

Permalink
Shoves and martials
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCastmer committed Feb 2, 2024
1 parent 4108cc1 commit c9735ef
Show file tree
Hide file tree
Showing 9 changed files with 441 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
#define DEFAULT_MESSAGE_RANGE 7

//Shove knockdown lengths (deciseconds)
#define SHOVE_KNOCKDOWN_HUMAN 10
#define SHOVE_KNOCKDOWN_HUMAN 20 //dripstation edit
#define SHOVE_CHAIN_PARALYZE 30
//Shove slowdown
#define SHOVE_SLOWDOWN_LENGTH 30
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/{dripstation_defines}/melee.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define MARTIALART_VELVETFU "velvetfu"
#define MARTIALART_TRAINED "trained"
3 changes: 2 additions & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@
pushed_mob.pass_flags &= ~PASSTABLE
if(pushed_mob.loc != loc) //Something prevented the tabling
return
pushed_mob.Paralyze(40)
//pushed_mob.Paralyze(40)
pushed_mob.visible_message(span_danger("[user] pushes [pushed_mob] onto [src]."), \
span_userdanger("[user] pushes [pushed_mob] onto [src]."))
log_combat(user, pushed_mob, "tabled", null, "onto [src]")
if(!ishuman(pushed_mob))
return
var/mob/living/carbon/human/H = pushed_mob
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table)
H.Knockdown(SHOVE_KNOCKDOWN_HUMAN)

/obj/structure/table/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/rsf)) // Stops RSF from placing itself instead of glasses
Expand Down
15 changes: 11 additions & 4 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1714,10 +1714,17 @@ GLOBAL_LIST_EMPTY(features_by_species)
break
if(!bothstanding || directional_blocked)
var/obj/item/I = target.get_active_held_item()
if(target.dropItemToGround(I))
user.visible_message(span_danger("[user.name] shoves [target.name], disarming them!"),
span_danger("You shove [target.name], disarming them!"), null, COMBAT_MESSAGE_RANGE)
log_combat(user, target, "shoved", "disarming them")
if(target.dropItemToGround(I)) //dripstation edit start
user.visible_message(span_danger("[user.name] shoves [target.name], disarming [target.p_them()]!"),
span_userdanger("You're knocked down from a shove by [name]!"), null, COMBAT_MESSAGE_RANGE)
to_chat(src, span_danger("You shove [target.name], disarming [target.p_them()]!"))
log_combat(src, target, "shoved", "disarming them")
else
user.visible_message(span_danger("[user.name] shoves [target.name], knocking [target.p_them()] down!"),
span_userdanger("You're knocked down from a shove by [name]!"), null, COMBAT_MESSAGE_RANGE)
to_chat(src, span_danger("You shove [target.name], knocking [target.p_them()] down!"))
log_combat(src, target, "shoved", "knocking them down")
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN) //dripstation edit end
else if(bothstanding)
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
if(!target_collateral_human.is_shove_knockdown_blocked())
Expand Down
83 changes: 83 additions & 0 deletions modular_dripstation/code/datums/martial/trained.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
///restrain combo string
#define LOW_RESTRAIN_COMBO "GG"

/datum/martial_art/trained
name = "Trained"
id = MARTIALART_TRAINED
//help_verb = /mob/living/carbon/human/proc/CQC_help
block_chance = 50 //Don't get into melee with someone trained for melee and prepared for your attacks
nonlethal = TRUE //all attacks deal solely stamina damage or knock out before dealing lethal amounts of damage
var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep()

/datum/martial_art/trained/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(!(can_use(A) || can_use(D)))
return FALSE
if(findtext(streak,LOW_RESTRAIN_COMBO))
streak = ""
LowRestrain(A,D)
return TRUE
return FALSE

/datum/martial_art/trained/proc/LowRestrain(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(restraining)
return
if(!can_use(A))
return FALSE
if(!D.stat)
log_combat(A, D, "restrained (CQC)")
D.visible_message(span_warning("[A] locks [D] into a restraining position!"), \
span_userdanger("[A] locks you into a restraining position!"))
D.Stun(1 SECONDS)
if(!(A.pulling == D))
D.grabbedby(A, 1)
if(A.grab_state < GRAB_AGGRESSIVE)
A.grab_state = GRAB_AGGRESSIVE
restraining = TRUE
return TRUE

///CQC grab, stuns for 1.5 seconds on use
/datum/martial_art/trained/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(A.a_intent == INTENT_GRAB && A!=D && (can_use(A) && can_use(D))) // A!=D prevents grabbing yourself
add_to_streak("G",D)
if(check_streak(A,D)) //if a combo is made no grab upgrade is done
return TRUE
if(D.grabbedby(A))
D.drop_all_held_items()
if(A.grab_state < 1)
restraining = FALSE
return TRUE
else
return FALSE

///CQC-like counter: attacker's weapon is placed in the defender's offhand and they are knocked down
/datum/martial_art/trained/handle_counter(mob/living/carbon/human/user, mob/living/carbon/human/attacker) //I am going to fucking gut whoever did the old counter system also whoever made martial arts
if(!can_use(user))
return
user.do_attack_animation(attacker, ATTACK_EFFECT_DISARM)
attacker.visible_message(span_warning("[user] grabs [attacker]'s arm as they attack and throws them to the ground!"), \
span_userdanger("[user] grabs your arm as you attack and throws you to the ground!"))
playsound(get_turf(attacker), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
var/obj/item/I = attacker.get_active_held_item()
if(I && attacker.temporarilyRemoveItemFromInventory(I))
var/hand = user.get_inactive_hand_index()
if(!user.put_in_hand(I, hand))
I.forceMove(get_turf(attacker))
attacker.Knockdown(60)
user.adjustStaminaLoss(10) //Can't block forever. Really, if this becomes a problem you're already screwed.

/datum/action/leg_sweep
name = "Leg Sweep - Trips the victim, knocking them down for a brief moment."
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "legsweep"

/datum/action/leg_sweep/Trigger()
if(owner.incapacitated())
to_chat(owner, span_warning("You can't use [name] while you're incapacitated."))
return
var/mob/living/carbon/human/H = owner
if (H.mind.martial_art.streak == "leg_sweep")
owner.visible_message(span_danger("[owner] assumes a neutral stance."), "<b><i>Your next attack is cleared.</i></b>")
H.mind.martial_art.streak = ""
else
owner.visible_message(span_danger("[owner] assumes the Leg Sweep stance!"), "<b><i>Your next attack will be a Leg Sweep.</i></b>")
H.mind.martial_art.streak = "leg_sweep"
Loading

0 comments on commit c9735ef

Please sign in to comment.