mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
standardizes default unfasten wrench (#65425)
I'll do more in the future but I'll limit myself to this because I'm tired, bored, and don't want to make so many PRs touching the same things that I have to deal with conflicts each time one is merged. Just as an example, screwdriver's gotta be done as well, does the exact same thing wrenches do, I believe. Standardizes (and touches) each time default_unfasten_wrench is used. Fixes tool logs, since it relies on tool acts to exist, I'm trying to move as many tool acts to its proper proc. Like a spiritual successor to the tool superpack PRs. Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
#define GUILLOTINE_BLADE_MAX_SHARP 10 // This is maxiumum sharpness and will decapitate without failure
|
||||
#define GUILLOTINE_DECAP_MIN_SHARP 7 // Minimum amount of sharpness for decapitation. Any less and it will just do severe brute damage
|
||||
#define GUILLOTINE_ANIMATION_LENGTH 9 // How many deciseconds the animation is
|
||||
#define GUILLOTINE_BLADE_RAISED 1
|
||||
#define GUILLOTINE_BLADE_MOVING 2
|
||||
#define GUILLOTINE_BLADE_DROPPED 3
|
||||
#define GUILLOTINE_BLADE_IDLE 0
|
||||
#define GUILLOTINE_BLADE_RAISED 1
|
||||
#define GUILLOTINE_BLADE_MOVING 2
|
||||
#define GUILLOTINE_BLADE_DROPPED 3
|
||||
#define GUILLOTINE_BLADE_SHARPENING 4
|
||||
#define GUILLOTINE_HEAD_OFFSET 16 // How much we need to move the player to center their head
|
||||
#define GUILLOTINE_LAYER_DIFF 1.2 // How much to increase/decrease a head when it's buckled/unbuckled
|
||||
#define GUILLOTINE_ACTIVATE_DELAY 30 // Delay for executing someone
|
||||
#define GUILLOTINE_WRENCH_DELAY 10
|
||||
#define GUILLOTINE_ACTION_INUSE 5
|
||||
#define GUILLOTINE_ACTION_WRENCH 6
|
||||
#define GUILLOTINE_ACTION_INUSE 5
|
||||
#define GUILLOTINE_ACTION_WRENCH 6
|
||||
|
||||
/// This is maxiumum sharpness and will decapitate without failure
|
||||
#define GUILLOTINE_BLADE_MAX_SHARP 10
|
||||
/// Minimum amount of sharpness for decapitation. Any less and it will just do severe brute damage
|
||||
#define GUILLOTINE_DECAP_MIN_SHARP 7
|
||||
/// How long the guillotine animation lasts
|
||||
#define GUILLOTINE_ANIMATION_LENGTH (0.9 SECONDS)
|
||||
/// How much we need to move the player to center their head
|
||||
#define GUILLOTINE_HEAD_OFFSET 16
|
||||
/// How much to increase/decrease a head when it's buckled/unbuckled
|
||||
#define GUILLOTINE_LAYER_DIFF 1.2
|
||||
/// Delay for executing someone
|
||||
#define GUILLOTINE_ACTIVATE_DELAY (3 SECONDS)
|
||||
#define GUILLOTINE_WRENCH_DELAY (1 SECONDS)
|
||||
|
||||
/obj/structure/guillotine
|
||||
name = "guillotine"
|
||||
@@ -28,7 +36,7 @@
|
||||
var/blade_status = GUILLOTINE_BLADE_RAISED
|
||||
var/blade_sharpness = GUILLOTINE_BLADE_MAX_SHARP // How sharp the blade is
|
||||
var/kill_count = 0
|
||||
var/current_action = 0 // What's currently happening to the guillotine
|
||||
var/current_action = GUILLOTINE_BLADE_IDLE // What's currently happening to the guillotine
|
||||
|
||||
/obj/structure/guillotine/Initialize(mapload)
|
||||
LAZYINITLIST(buckled_mobs)
|
||||
@@ -90,12 +98,12 @@
|
||||
current_action = GUILLOTINE_ACTION_INUSE
|
||||
|
||||
if (do_after(user, GUILLOTINE_ACTIVATE_DELAY, target = src) && blade_status == GUILLOTINE_BLADE_RAISED)
|
||||
current_action = 0
|
||||
current_action = GUILLOTINE_BLADE_IDLE
|
||||
blade_status = GUILLOTINE_BLADE_MOVING
|
||||
icon_state = "guillotine_drop"
|
||||
addtimer(CALLBACK(src, .proc/drop_blade, user), GUILLOTINE_ANIMATION_LENGTH - 2) // Minus two so we play the sound and decap faster
|
||||
else
|
||||
current_action = 0
|
||||
current_action = GUILLOTINE_BLADE_IDLE
|
||||
else
|
||||
var/mob/living/carbon/human/H = buckled_mobs[1]
|
||||
|
||||
@@ -246,33 +254,29 @@
|
||||
if (current_action)
|
||||
return FAILED_UNFASTEN
|
||||
|
||||
current_action = GUILLOTINE_ACTION_WRENCH
|
||||
return ..()
|
||||
|
||||
/obj/structure/guillotine/wrench_act(mob/living/user, obj/item/I)
|
||||
/obj/structure/guillotine/wrench_act(mob/living/user, obj/item/tool)
|
||||
. = ..()
|
||||
if (current_action)
|
||||
return
|
||||
|
||||
current_action = GUILLOTINE_ACTION_WRENCH
|
||||
|
||||
if (do_after(user, GUILLOTINE_WRENCH_DELAY, target = src))
|
||||
current_action = 0
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
if(default_unfasten_wrench(user, tool, time = GUILLOTINE_WRENCH_DELAY))
|
||||
setDir(SOUTH)
|
||||
return TRUE
|
||||
else
|
||||
current_action = 0
|
||||
current_action = GUILLOTINE_BLADE_IDLE
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
current_action = GUILLOTINE_BLADE_IDLE
|
||||
return FALSE
|
||||
|
||||
#undef GUILLOTINE_BLADE_MAX_SHARP
|
||||
#undef GUILLOTINE_DECAP_MIN_SHARP
|
||||
#undef GUILLOTINE_ANIMATION_LENGTH
|
||||
#undef GUILLOTINE_HEAD_OFFSET
|
||||
#undef GUILLOTINE_LAYER_DIFF
|
||||
#undef GUILLOTINE_ACTIVATE_DELAY
|
||||
|
||||
#undef GUILLOTINE_BLADE_IDLE
|
||||
#undef GUILLOTINE_BLADE_RAISED
|
||||
#undef GUILLOTINE_BLADE_MOVING
|
||||
#undef GUILLOTINE_BLADE_DROPPED
|
||||
#undef GUILLOTINE_BLADE_SHARPENING
|
||||
#undef GUILLOTINE_HEAD_OFFSET
|
||||
#undef GUILLOTINE_LAYER_DIFF
|
||||
#undef GUILLOTINE_ACTIVATE_DELAY
|
||||
#undef GUILLOTINE_WRENCH_DELAY
|
||||
#undef GUILLOTINE_ACTION_INUSE
|
||||
#undef GUILLOTINE_ACTION_WRENCH
|
||||
|
||||
Reference in New Issue
Block a user