click cd breakout

This commit is contained in:
silicons
2020-07-18 18:10:21 -07:00
parent 3d65be4ee9
commit 7c5d4f863d
23 changed files with 25 additions and 56 deletions

View File

@@ -108,7 +108,6 @@
#define CLICK_CD_RANGE 4 #define CLICK_CD_RANGE 4
#define CLICK_CD_RAPID 2 #define CLICK_CD_RAPID 2
#define CLICK_CD_CLICK_ABILITY 6 #define CLICK_CD_CLICK_ABILITY 6
#define CLICK_CD_BREAKOUT 100
#define CLICK_CD_HANDCUFFED 10 #define CLICK_CD_HANDCUFFED 10
#define CLICK_CD_RESIST 20 #define CLICK_CD_RESIST 20
#define CLICK_CD_GRABBING 10 #define CLICK_CD_GRABBING 10

View File

@@ -76,8 +76,7 @@
if(!locked) if(!locked)
open_machine() open_machine()
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>") "<span class='italics'>You hear a metallic creaking from [src].</span>")

View File

@@ -101,8 +101,7 @@ The console is located at computer/gulag_teleporter.dm
if(!locked) if(!locked)
open_machine() open_machine()
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>") "<span class='italics'>You hear a metallic creaking from [src].</span>")

View File

@@ -178,8 +178,7 @@
icon_state += "_occupied" icon_state += "_occupied"
/obj/machinery/hypnochair/container_resist(mob/living/user) /obj/machinery/hypnochair/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(600)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(600)].)</span>", \
"<span class='hear'>You hear a metallic creaking from [src].</span>") "<span class='hear'>You hear a metallic creaking from [src].</span>")

View File

@@ -301,8 +301,7 @@
open_machine() open_machine()
dump_contents() dump_contents()
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
"<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a thump from [src].</span>") "<span class='italics'>You hear a thump from [src].</span>")

View File

@@ -252,8 +252,7 @@
/obj/structure/spider/cocoon/container_resist(mob/living/user) /obj/structure/spider/cocoon/container_resist(mob/living/user)
var/breakout_time = 600 var/breakout_time = 600
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)</span>") to_chat(user, "<span class='notice'>You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)</span>")
visible_message("You see something struggling and writhing in \the [src]!") visible_message("You see something struggling and writhing in \the [src]!")
if(do_after(user,(breakout_time), target = src)) if(do_after(user,(breakout_time), target = src))

View File

@@ -71,8 +71,7 @@
if(user.incapacitated()) if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't get out while you're restrained like this!</span>") to_chat(user, "<span class='warning'>You can't get out while you're restrained like this!</span>")
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You claw at the fabric of [src], trying to tear it open...</span>") to_chat(user, "<span class='notice'>You claw at the fabric of [src], trying to tear it open...</span>")
to_chat(loc, "<span class='warning'>Someone starts trying to break free of [src]!</span>") to_chat(loc, "<span class='warning'>Someone starts trying to break free of [src]!</span>")
if(!do_after(user, 200, target = src)) if(!do_after(user, 200, target = src))

View File

@@ -116,8 +116,7 @@
if(!hound) if(!hound)
go_out(user) go_out(user)
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
if(user.a_intent == INTENT_HELP) if(user.a_intent == INTENT_HELP)
return return
var/voracious = TRUE var/voracious = TRUE

View File

@@ -121,8 +121,7 @@
update_icon() update_icon()
/obj/machinery/implantchair/container_resist(mob/living/user) /obj/machinery/implantchair/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>") "<span class='italics'>You hear a metallic creaking from [src].</span>")
@@ -191,4 +190,4 @@
brainwash(C, objective) brainwash(C, objective)
message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.")
log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.") log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.")
return TRUE return TRUE

View File

@@ -133,8 +133,7 @@
remove_occupant(user) remove_occupant(user)
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
if(user.mob_size <= MOB_SIZE_SMALL) if(user.mob_size <= MOB_SIZE_SMALL)
to_chat(user, "<span class='notice'>You begin to try escaping the [src] and start fumbling for the lock switch... (This will take some time.)</span>") to_chat(user, "<span class='notice'>You begin to try escaping the [src] and start fumbling for the lock switch... (This will take some time.)</span>")
to_chat(loc, "<span class='warning'>You see [user] attempting to unlock the [src]!</span>") to_chat(loc, "<span class='warning'>You see [user] attempting to unlock the [src]!</span>")

View File

@@ -506,8 +506,7 @@
if(opened) if(opened)
return return
if(ismovable(loc)) if(ismovable(loc))
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
var/atom/movable/AM = loc var/atom/movable/AM = loc
AM.relay_container_resist(user, src) AM.relay_container_resist(user, src)
return return
@@ -516,8 +515,7 @@
return return
//okay, so the closet is either welded or locked... resist!!! //okay, so the closet is either welded or locked... resist!!!
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \ user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear banging from [src].</span>") "<span class='italics'>You hear banging from [src].</span>")

View File

@@ -106,8 +106,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
if(!locked) if(!locked)
open() open()
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message(null, \ user.visible_message(null, \
"<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>") "<span class='italics'>You hear a metallic creaking from [src].</span>")

View File

@@ -69,8 +69,7 @@
empty_pod() empty_pod()
return return
if(!moving) if(!moving)
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You start trying to escape from the pod...</span>") to_chat(user, "<span class='notice'>You start trying to escape from the pod...</span>")
if(do_after(user, 600, target = src)) if(do_after(user, 600, target = src))
to_chat(user, "<span class='notice'>You manage to open the pod.</span>") to_chat(user, "<span class='notice'>You manage to open the pod.</span>")

View File

@@ -47,8 +47,7 @@
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>") to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
/obj/machinery/abductor/experiment/container_resist(mob/living/user) /obj/machinery/abductor/experiment/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>") "<span class='italics'>You hear a metallic creaking from [src].</span>")

View File

@@ -262,8 +262,7 @@
return occupant return occupant
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user) /obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a thump from [src].</span>") "<span class='italics'>You hear a thump from [src].</span>")

View File

@@ -27,7 +27,7 @@
/// Special clickdelay variable for resisting. Last time we did a special action like resisting. This should be directly set. This should only be checked using [CheckResistCooldown()]. /// Special clickdelay variable for resisting. Last time we did a special action like resisting. This should be directly set. This should only be checked using [CheckResistCooldown()].
var/last_resist = 0 var/last_resist = 0
/// How long we should wait before allowing another resist. This should only be manually modified using multipliers. /// How long we should wait before allowing another resist. This should only be manually modified using multipliers.
var/resist_cooldown = CLICK_CD_BREAKOUT var/resist_cooldown = CLICK_CD_RESIST
/** /**
* Applies a delay to next_action before we can do our next action. * Applies a delay to next_action before we can do our next action.

View File

@@ -298,8 +298,7 @@
if(handcuffed) if(handcuffed)
var/obj/item/restraints/O = src.get_item_by_slot(SLOT_HANDCUFFED) var/obj/item/restraints/O = src.get_item_by_slot(SLOT_HANDCUFFED)
buckle_cd = O.breakouttime buckle_cd = O.breakouttime
changeNext_move(min(CLICK_CD_BREAKOUT, buckle_cd)) last_resist = world.time
last_special = world.time + min(CLICK_CD_BREAKOUT, buckle_cd)
visible_message("<span class='warning'>[src] attempts to unbuckle [p_them()]self!</span>", \ visible_message("<span class='warning'>[src] attempts to unbuckle [p_them()]self!</span>", \
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)</span>") "<span class='notice'>You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)</span>")
if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST)) if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
@@ -327,12 +326,9 @@
"<span class='notice'>You extinguish yourself.</span>") "<span class='notice'>You extinguish yourself.</span>")
ExtinguishMob() ExtinguishMob()
/mob/living/carbon/resist_restraints(ignore_delay = FALSE) /mob/living/carbon/resist_restraints()
var/obj/item/I = null var/obj/item/I = null
var/type = 0 var/type = 0
if(!ignore_delay && (last_special > world.time))
to_chat(src, "<span class='warning'>You don't have the energy to resist your restraints that fast!</span>")
return
if(handcuffed) if(handcuffed)
I = handcuffed I = handcuffed
type = 1 type = 1
@@ -340,12 +336,7 @@
I = legcuffed I = legcuffed
type = 2 type = 2
if(I) if(I)
if(type == 1) last_resist = world.time
changeNext_move(min(CLICK_CD_BREAKOUT, I.breakouttime))
last_special = world.time + CLICK_CD_BREAKOUT
if(type == 2)
changeNext_move(min(CLICK_CD_RANGE, I.breakouttime))
last_special = world.time + CLICK_CD_RANGE
cuff_resist(I) cuff_resist(I)
/mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0) /mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0)

View File

@@ -733,8 +733,7 @@
/mob/living/carbon/human/resist_restraints() /mob/living/carbon/human/resist_restraints()
if(wear_suit && wear_suit.breakouttime) if(wear_suit && wear_suit.breakouttime)
changeNext_move(CLICK_CD_BREAKOUT) last_resist = world.time
last_special = world.time + CLICK_CD_BREAKOUT
cuff_resist(wear_suit) cuff_resist(wear_suit)
else else
..() ..()

View File

@@ -90,8 +90,7 @@
else if(legcuffed) else if(legcuffed)
I = legcuffed I = legcuffed
if(I) if(I)
changeNext_move(CLICK_CD_BREAKOUT) last_resist = world.time
last_special = world.time + CLICK_CD_BREAKOUT
cuff_resist(I) cuff_resist(I)
/mob/living/carbon/monkey/proc/should_target(var/mob/living/L) /mob/living/carbon/monkey/proc/should_target(var/mob/living/L)

View File

@@ -676,7 +676,7 @@
..(pressure_difference, direction, pressure_resistance_prob_delta) ..(pressure_difference, direction, pressure_resistance_prob_delta)
/mob/living/can_resist() /mob/living/can_resist()
return !((next_move > world.time) || !CHECK_MOBILITY(src, MOBILITY_RESIST)) return !(CheckResistCooldown() || !CHECK_MOBILITY(src, MOBILITY_RESIST))
/// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true. /// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true.
/mob/living/verb/resist() /mob/living/verb/resist()

View File

@@ -150,8 +150,7 @@
return return
if(busy) if(busy)
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='hear'>You hear a metallic creaking from [src].</span>") "<span class='hear'>You hear a metallic creaking from [src].</span>")

View File

@@ -130,8 +130,7 @@
return return
if(busy) if(busy)
return return
user.changeNext_move(CLICK_CD_BREAKOUT) user.last_resist = world.time
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \ user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \ "<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='hear'>You hear a metallic creaking from [src].</span>") "<span class='hear'>You hear a metallic creaking from [src].</span>")

View File

@@ -542,8 +542,6 @@
if (!(R in contents)) if (!(R in contents))
return // User is not in this belly return // User is not in this belly
R.changeNext_move(CLICK_CD_BREAKOUT*0.5)
if(owner.stat) //If owner is stat (dead, KO) we can actually escape if(owner.stat) //If owner is stat (dead, KO) we can actually escape
to_chat(R,"<span class='warning'>You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)</span>") to_chat(R,"<span class='warning'>You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)</span>")
to_chat(owner,"<span class='warning'>Someone is attempting to climb out of your [lowertext(name)]!</span>") to_chat(owner,"<span class='warning'>Someone is attempting to climb out of your [lowertext(name)]!</span>")