From 2a62ed1dce4e5f6fa4d27b541612b22a6a7ec3fd Mon Sep 17 00:00:00 2001 From: SamCroswell Date: Sun, 27 Dec 2015 15:59:42 -0500 Subject: [PATCH] Tigercat's Optimizations --- code/modules/ninja/martial_art.dm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/modules/ninja/martial_art.dm b/code/modules/ninja/martial_art.dm index 8c3d0fc4707..796b343864a 100644 --- a/code/modules/ninja/martial_art.dm +++ b/code/modules/ninja/martial_art.dm @@ -2,7 +2,6 @@ *Contains: * Creeping Widow martial art datum * Creeping Widow MMB override datum - * grant_ninja_martial_art proc * Creeping Widow injector */ @@ -22,11 +21,11 @@ if(!used) user.visible_message("You stick the [src]'s needle into your arm and press the button.", \ "[user] sticks the [src]'s needle \his arm and presses the button.") - grant_ninja_martial_art(user) - user << "The nanomachines in the [src] flow through your bloodstream. You have been taugh the ways of the Creeping Widow.
\ - Your stikes on harm intent will deal more damage.
Using middle mouse button on a nearby person while on harm intent will send them flying backwards.
\ - Your grabs will instantly be aggressive while you are using this style.
Using middle mouse button while on harm intent and behind a person will put them in a silencing choke hold.
\ - Using middle mouse button on a nearby person while on disarm intent will wrench their wrist, causing them to drop what they are holding.
" + user << "The nanomachines in the [src] flow through your bloodstream." + + var/datum/martial_art/ninja_martial_art/N = new/datum/martial_art/ninja_martial_art(null) + N.teach(user) + used = 1 icon_state = "injector-used" desc = "A strange autoinjector made of a black metal.
It appears to be used up and empty." @@ -35,12 +34,6 @@ user << "The [src] has been used already!" return 1 -// grant_ninja_martial_art proc - It is imperitive to ALWAYS use this when giving someone the Ninja martial art so that they have the middle mouse override as well. - -/proc/grant_ninja_martial_art(var/mob/living/carbon/human/target) - target.martial_art = new /datum/martial_art/ninja_martial_art() - target.middleClickOverride = new /datum/middleClickOverride/ninja_martial_art() - // Ninja martial art datum /datum/martial_art/ninja_martial_art @@ -49,6 +42,14 @@ var/has_choke_hold = 0 // Are we current choking a bitch? var/has_focus = 1 //Can we user our special moves? +/datum/martial_art/ninja_martial_art/teach(var/mob/living/carbon/human/H,var/make_temporary=0) + ..() + H.middleClickOverride = new /datum/middleClickOverride/ninja_martial_art() + H << "You have been taugh the ways of the Creeping Widow.
\ + Your stikes on harm intent will deal more damage.
Using middle mouse button on a nearby person while on harm intent will send them flying backwards.
\ + Your grabs will instantly be aggressive while you are using this style.
Using middle mouse button while on harm intent and behind a person will put them in a silencing choke hold.
\ + Using middle mouse button on a nearby person while on disarm intent will wrench their wrist, causing them to drop what they are holding.
" + /datum/martial_art/ninja_martial_art/proc/wrist_wrench(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(!D.stat && !D.weakened) if(has_focus) @@ -155,7 +156,7 @@ /datum/middleClickOverride/ninja_martial_art /datum/middleClickOverride/ninja_martial_art/onClick(var/atom/A, var/mob/living/carbon/human/user) - if(!user.martial_art || user.martial_art.name != "Creeping Widow Style") // Checking based on name because I'm fairly certain that checking against a user's specific ninja martial arts datum versus a generic one won't work. + if(!istype(user.martial_art, /datum/martial_art/ninja_martial_art)) user.pointed(A) // If they don't have the required martial art just point at the target. if(!istype(A, /mob/living/carbon/human)) // Special moves only work on humans.