forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syndicate and craftable garrotte #1051
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
137b177
initial
npukoJl 1b3e19c
Update modular_bandastation/objects/code/items/weapons/melee/garrote.dm
npukoJl 48c4d43
Update modular_bandastation/objects/code/items/weapons/melee/garrote.dm
npukoJl ef5348b
a bit prettier
npukoJl a5559ac
Merge branch 'garrotte' of https://github.com/npukoJl/Bandastation in…
npukoJl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
modular_bandastation/objects/code/items/weapons/melee/garrote.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
/obj/item/melee/garrote | ||
name = "fiber wire" | ||
desc = "A length of razor-thin wire with an elegant wooden handle on either end.<br>You suspect you'd have to be behind the target to use this weapon effectively." | ||
w_class = WEIGHT_CLASS_TINY | ||
icon = 'modular_bandastation/objects/icons/obj/weapons/misc.dmi' | ||
icon_state = "garrot_wrap" | ||
var/mob/living/carbon/human/strangling | ||
var/improvised = FALSE | ||
COOLDOWN_DECLARE(garrote_cooldown) | ||
|
||
/obj/item/melee/garrote/Initialize(mapload) | ||
. = ..() | ||
AddComponent(/datum/component/two_handed) | ||
|
||
/obj/item/melee/garrote/Destroy() | ||
strangling = null | ||
return ..() | ||
|
||
/obj/item/melee/garrote/update_icon_state() | ||
if(strangling) // If we're strangling someone we want our icon to stay wielded | ||
icon_state = "garrot_[improvised ? "I_" : ""]unwrap" | ||
else | ||
icon_state = "garrot_[improvised ? "I_" : ""][HAS_TRAIT(src, TRAIT_WIELDED) ? "un" : ""]wrap" | ||
. = ..() | ||
|
||
/// Made via tablecrafting | ||
/obj/item/melee/garrote/improvised | ||
name = "garrote" | ||
desc = "A length of cable with a shoddily-carved wooden handle tied to either end.<br>You suspect you'd have to be behind the target to use this weapon effectively." | ||
icon_state = "garrot_I_wrap" | ||
improvised = TRUE | ||
|
||
/obj/item/melee/garrote/improvised/Initialize(mapload) | ||
. = ..() | ||
AddComponent(/datum/component/two_handed, wield_callback = CALLBACK(src, PROC_REF(wield))) | ||
|
||
|
||
/obj/item/melee/garrote/proc/wield(obj/item/source, mob/living/carbon/user) | ||
if(!strangling) | ||
return | ||
user.visible_message( | ||
span_notice("[user] removes [src] from [strangling]'s neck."), | ||
span_warning("You remove [src] from [strangling]'s neck.") | ||
) | ||
|
||
strangling = null | ||
update_icon(UPDATE_ICON_STATE) | ||
STOP_PROCESSING(SSobj, src) | ||
|
||
|
||
|
||
/obj/item/melee/garrote/attack(mob/living/carbon/human/target, mob/living/carbon/user) | ||
if(!COOLDOWN_FINISHED(src, garrote_cooldown)) // Cooldown | ||
return | ||
if(!ishuman(user)) // spap_hand is a proc of /mob/living, user is simply /mob | ||
return | ||
if(!HAS_TRAIT(src, TRAIT_WIELDED)) | ||
to_chat(user, span_warning("You must use both hands to garrote [target]!")) | ||
return | ||
if(!ishuman(target)) | ||
to_chat(user, span_warning("You don't think that garroting [target] would be very effective...")) | ||
return | ||
if(!check_behind(user, target) && !HAS_TRAIT(target, TRAIT_INCAPACITATED)) | ||
to_chat(user, span_warning("You cannot use [src] on [target] from that angle!")) | ||
return | ||
if(improvised && ((target.head && (target.head.flags_cover & HEADCOVERSMOUTH)) || (target.wear_mask && (target.wear_mask.flags_cover & MASKCOVERSMOUTH)))) // Improvised garrotes are blocked by mouth-covering items. | ||
to_chat(user, span_warning("[target]'s neck is blocked by something [target.p_theyre()] wearing!")) | ||
if(strangling && strangling != target) | ||
to_chat(user, span_warning("You cannot use [src] on two people at once!")) | ||
return | ||
if(user.grab_state == GRAB_KILL) | ||
return | ||
|
||
if(user.grab_state < 1) | ||
target.grabbedby(user, TRUE) | ||
if(improvised) | ||
user.setGrabState(GRAB_AGGRESSIVE) | ||
else | ||
user.setGrabState(GRAB_NECK) | ||
else | ||
if(user.grab_state != GRAB_KILL) | ||
user.setGrabState(user.grab_state + 1) | ||
if(!strangling) | ||
playsound(loc, 'sound/items/weapons/cablecuff.ogg', 15, TRUE, -10, ignore_walls = FALSE) | ||
|
||
if(improvised) // Improvised garrotes start you off with a passive grab, but will lock you in place. A quick stun to drop items but not to make it unescapable | ||
target.Stun(1 SECONDS) | ||
//target.Immobilize(2 SECONDS) | ||
else | ||
target.adjust_silence(2 SECONDS) | ||
target.dir = user.dir | ||
COOLDOWN_START(src, garrote_cooldown, 6 SECONDS) | ||
START_PROCESSING(SSobj, src) | ||
strangling = target | ||
update_icon(UPDATE_ICON_STATE) | ||
|
||
target.visible_message( | ||
span_danger("[user] comes from behind and begins garroting [target] with [src]!"), \ | ||
span_userdanger("[user] begins garroting you with [src]![improvised ? "" : " You are unable to speak!"]"), \ | ||
"You hear struggling and wire strain against flesh!" | ||
) | ||
return | ||
|
||
/obj/item/melee/garrote/process() | ||
if(!strangling) | ||
// Our mark got gibbed or similar | ||
update_icon(UPDATE_ICON_STATE) | ||
STOP_PROCESSING(SSobj, src) | ||
return | ||
|
||
|
||
if(!ishuman(loc)) | ||
strangling = null | ||
update_icon(UPDATE_ICON_STATE) | ||
STOP_PROCESSING(SSobj, src) | ||
return | ||
|
||
var/mob/living/carbon/human/user = loc | ||
strangling.dir = user.dir | ||
|
||
if(user.grab_state < 1 || !HAS_TRAIT(src, TRAIT_WIELDED)) | ||
user.visible_message( | ||
span_warning("[user] loses [user.p_their()] grip on [strangling]'s neck."), \ | ||
span_warning("You lose your grip on [strangling]'s neck.") | ||
) | ||
|
||
strangling = null | ||
update_icon(UPDATE_ICON_STATE) | ||
STOP_PROCESSING(SSobj, src) | ||
|
||
return | ||
|
||
if(user.grab_state < GRAB_NECK) // Only possible with improvised garrotes, essentially this will stun people as if they were aggressively grabbed. Allows for resisting out if you're quick, but not running away. | ||
strangling.Immobilize(3 SECONDS) | ||
|
||
if(improvised) | ||
strangling.adjust_stutter(6 SECONDS) | ||
strangling.apply_damage(2, OXY, "head") | ||
return | ||
|
||
|
||
strangling.adjust_silence(6 SECONDS) // Non-improvised effects | ||
if(user.grab_state == GRAB_KILL) | ||
//strangling.PreventOxyHeal(6 SECONDS) | ||
strangling.losebreath += 6 | ||
strangling.apply_damage(4, OXY, "head") | ||
strangling.apply_damage(4, BRUTE, "head") |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
убери эту переменную