Skip to content

Commit

Permalink
Merge pull request #3261 from RinPin/tackle
Browse files Browse the repository at this point in the history
Jumping / Tackle Update + Claws fix
  • Loading branch information
Tk420634 authored Oct 3, 2023
2 parents a64ec1e + cc734d1 commit 1cab2e7
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 6 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@
#define TRAIT_FREESPRINT "free_sprinting"
#define TRAIT_XRAY_VISION "xray_vision"
#define TRAIT_THERMAL_VISION "thermal_vision"
#define TRAIT_TACKLER "tackler"
#define TRAIT_TACKLERADV "Advanced Tackler"
#define TRAIT_TACKLERAPEX "Apex Tackler"
#define TRAIT_NO_TELEPORT "no-teleport" //you just can't
#define TRAIT_NO_INTERNALS "no-internals"
#define TRAIT_NO_ALCOHOL "alcohol_intolerance"
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_TASED_RESISTANCE" = TRAIT_TASED_RESISTANCE,
"TRAIT_TESLA_SHOCKIMMUNE" = TRAIT_TESLA_SHOCKIMMUNE,
"TRAIT_THERMAL_VISION" = TRAIT_THERMAL_VISION,
"TRAIT_TACKLER" = TRAIT_TACKLER,
"TRAIT_TACKLERADV" = TRAIT_TACKLERADV,
"TRAIT_TACKLERAPEX" = TRAIT_TACKLERAPEX,
"TRAIT_TOXINIMMUNE" = TRAIT_TOXINIMMUNE,
"TRAIT_TOXINLOVER" = TRAIT_TOXINLOVER,
"TRAIT_UNARMED_WEAPON" = TRAIT_UNARMED_WEAPON,
Expand Down
88 changes: 88 additions & 0 deletions code/datums/traits/good.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,94 @@ GLOBAL_LIST_INIT(weapons_of_texarkana, list(
lose_text = span_danger("You feel clumsy again.")
medical_record_text = "Patient scored highly on cardio tests."


/datum/quirk/tackler
name = "Leaper"
desc = "You are able to leap short distances, and on occasion tackle others, albeit somewhat clumsly."
value = 14
category = "Movement Quirks"
mechanics = "You are able to jump short distances with throw enabled and an empty hand, hitting people will tackle them, leaning towards poor results for you"
conflicts = list(
/datum/quirk/clumsy,
/datum/quirk/overweight,
/datum/quirk/tacklerapex,
/datum/quirk/tackleradv
)
mob_trait = TRAIT_TACKLER
gain_text = span_notice("Your legs feel stronger.")
lose_text = span_danger("Your legs feel weaker.")
medical_record_text = "Patient's dexterity belies a good capacity for long distance jumping."

/datum/quirk/tackler/add()
var/mob/living/carbon/human/H = quirk_holder
H.AddComponent(/datum/component/tackler, \
stamina_cost = 30, \
base_knockdown = 1.75 SECONDS, \
range = 5, \
speed = 1, \
skill_mod = -1, \
min_distance = 0 \
)



/datum/quirk/tackleradv
name = "Advanced Leaper"
desc = "You are able to leap long distances with ease"
value = 22
category = "Movement Quirks"
mechanics = "You are able to jump long distances with throw enabled and an empty hand, though you can no longer tackle effectively"
conflicts = list(
/datum/quirk/clumsy,
/datum/quirk/overweight,
/datum/quirk/tacklerapex,
/datum/quirk/tackler
)
mob_trait = TRAIT_TACKLERADV
gain_text = span_notice("Your legs feel much stronger.")
lose_text = span_danger("Your legs feel weaker.")
medical_record_text = "Patient's dexterity belies a strong capacity for long distance jumping."

/datum/quirk/tackleradv/add()
var/mob/living/carbon/human/H = quirk_holder
H.AddComponent(/datum/component/tackler, \
stamina_cost = 25, \
base_knockdown = 0 SECONDS, \
range = 7, \
speed = 2, \
skill_mod = -2, \
min_distance = 0 \
)


/datum/quirk/tacklerapex
name = "Apex Leap"
desc = "You are able to leap medium distances with ease, as well as being able to tackle people down, most of the time"
value = 32
category = "Movement Quirks"
mechanics = "You are able to jump medium distances with throw enabled and an empty hand, and effectively tackle others"
conflicts = list(
/datum/quirk/clumsy,
/datum/quirk/overweight,
/datum/quirk/tackler,
/datum/quirk/tackleradv
)
mob_trait = TRAIT_TACKLERAPEX
gain_text = span_notice("Your legs feel much stronger.")
lose_text = span_danger("Your legs feel weaker.")
medical_record_text = "Patient's dexterity belies a strong capacity for long distance jumping."

/datum/quirk/tacklerapex/add()
var/mob/living/carbon/human/H = quirk_holder
H.AddComponent(/datum/component/tackler, \
stamina_cost = 35, \
base_knockdown = 1 SECONDS, \
range = 5, \
speed = 1, \
skill_mod = 3, \
min_distance = 0 \
)

/datum/quirk/friendly
name = "Friendly"
desc = "You give the best hugs. When you're in the right mood your squeezes can cheer up those around you. Unless they don't, but that's okay. :)"
Expand Down
28 changes: 23 additions & 5 deletions code/game/objects/hand_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
var/can_adjust_unarmed = TRUE
var/unarmed_adjusted = TRUE

/obj/item/hand_item/clawer/equipped(mob/user, slot)
/obj/item/hand_item/biter/equipped(mob/user, slot)
. = ..()
var/mob/living/carbon/human/H = user
if(unarmed_adjusted)
Expand Down Expand Up @@ -345,8 +345,28 @@
if(HAS_TRAIT(user, TRAIT_STEELFIST))
H.dna.species.punchdamagehigh = 16
H.dna.species.punchdamagelow = 10
H.dna.species.attack_sound = 'sound/weapons/slice.ogg'
H.dna.species.attack_verb = "slash"
H.dna.species.attack_sound = 'sound/weapons/punch1.ogg'
H.dna.species.attack_verb = "punch"

/obj/item/hand_item/clawer/examine(mob/user)
. = ..()
if(can_adjust_unarmed == TRUE)
if(unarmed_adjusted == TRUE)
. += span_notice("Alt-click on [src] to wear it on a different hand. You must take it off first, then put it on again.")
else
. += span_notice("Alt-click on [src] to wear it on a different hand. You must take it off first, then put it on again.")

/obj/item/hand_item/clawer/AltClick(mob/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ishuman(user)))
return
if(can_adjust_unarmed == TRUE)
toggle_unarmed_adjust()

/obj/item/hand_item/clawer/proc/toggle_unarmed_adjust()
unarmed_adjusted = !unarmed_adjusted
to_chat(usr, span_notice("[src] is ready to be worn on another hand."))


/obj/item/hand_item/clawer/creature
force = 30
Expand Down Expand Up @@ -563,5 +583,3 @@
// return LICK_CANCEL
// user.visible_message(span_alert("[user] was interrupted!"))
// return LICK_CANCEL


2 changes: 1 addition & 1 deletion code/modules/mob/emote.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//The code execution of the emote datum is located at code/datums/emotes.dm
e//The code execution of the emote datum is located at code/datums/emotes.dm
/mob/proc/emote(act, m_type = null, message = null, intentional = FALSE, only_overhead, forced)
var/input_text = lowertext(act)
var/param = message
Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/carbon/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,24 @@
else
qdel(claw)

//Tackler//


/datum/emote/living/carbon/tackle
key = "tackle"
key_third_person = "tackle"
restraint_check = TRUE

/datum/emote/living/carbon/tackle/run_emote(mob/user)
. = ..()
if(user.get_active_held_item())
to_chat(user, span_warning("Your hands are too full to tackle!"))
return
var/obj/item/hand_item/tackler
if(user.put_in_active_hand(tackler))
to_chat(user, span_notice("You get ready to tackle!"))
else
qdel(tackler)

//Shover//
/datum/emote/living/carbon/shover
Expand Down

0 comments on commit 1cab2e7

Please sign in to comment.