From 7c5d4f863d10b3d3772ff29cda2a419cf72db600 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sat, 18 Jul 2020 18:10:21 -0700 Subject: [PATCH] click cd breakout --- code/__DEFINES/combat.dm | 1 - code/game/machinery/dna_scanner.dm | 3 +-- code/game/machinery/gulag_teleporter.dm | 3 +-- code/game/machinery/hypnochair.dm | 3 +-- code/game/machinery/suit_storage_unit.dm | 3 +-- code/game/objects/effects/spiders.dm | 3 +-- code/game/objects/items/bodybag.dm | 3 +-- .../game/objects/items/devices/dogborg_sleeper.dm | 3 +-- code/game/objects/items/implants/implantchair.dm | 5 ++--- code/game/objects/items/pet_carrier.dm | 3 +-- .../objects/structures/crates_lockers/closets.dm | 6 ++---- code/game/objects/structures/morgue.dm | 3 +-- .../structures/transit_tubes/transit_tube_pod.dm | 3 +-- .../antagonists/abductor/machinery/experiment.dm | 3 +-- .../machinery/components/unary_devices/cryo.dm | 3 +-- code/modules/mob/clickdelay.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 15 +++------------ code/modules/mob/living/carbon/human/human.dm | 3 +-- code/modules/mob/living/carbon/monkey/combat.dm | 3 +-- code/modules/mob/living/living.dm | 2 +- code/modules/research/nanites/nanite_chamber.dm | 3 +-- code/modules/research/nanites/public_chamber.dm | 3 +-- code/modules/vore/eating/belly_obj.dm | 2 -- 23 files changed, 25 insertions(+), 56 deletions(-) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index dff52f4748..a8c2703bc9 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -108,7 +108,6 @@ #define CLICK_CD_RANGE 4 #define CLICK_CD_RAPID 2 #define CLICK_CD_CLICK_ABILITY 6 -#define CLICK_CD_BREAKOUT 100 #define CLICK_CD_HANDCUFFED 10 #define CLICK_CD_RESIST 20 #define CLICK_CD_GRABBING 10 diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index 4b2ba85d11..fc8513d6cd 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -76,8 +76,7 @@ if(!locked) open_machine() return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/game/machinery/gulag_teleporter.dm b/code/game/machinery/gulag_teleporter.dm index fb41ac986d..0fcfe382d0 100644 --- a/code/game/machinery/gulag_teleporter.dm +++ b/code/game/machinery/gulag_teleporter.dm @@ -101,8 +101,7 @@ The console is located at computer/gulag_teleporter.dm if(!locked) open_machine() return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/game/machinery/hypnochair.dm b/code/game/machinery/hypnochair.dm index 1b57f61b79..ff162b7788 100644 --- a/code/game/machinery/hypnochair.dm +++ b/code/game/machinery/hypnochair.dm @@ -178,8 +178,7 @@ icon_state += "_occupied" /obj/machinery/hypnochair/container_resist(mob/living/user) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(600)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index cf6b2b4bf4..805018efae 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -301,8 +301,7 @@ open_machine() dump_contents() return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the doors of [src]!", \ "You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a thump from [src].") diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 14b3c4e73e..785e20f586 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -252,8 +252,7 @@ /obj/structure/spider/cocoon/container_resist(mob/living/user) var/breakout_time = 600 - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time to_chat(user, "You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)") visible_message("You see something struggling and writhing in \the [src]!") if(do_after(user,(breakout_time), target = src)) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index dbc66b1899..827999d3d1 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -71,8 +71,7 @@ if(user.incapacitated()) to_chat(user, "You can't get out while you're restrained like this!") return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time to_chat(user, "You claw at the fabric of [src], trying to tear it open...") to_chat(loc, "Someone starts trying to break free of [src]!") if(!do_after(user, 200, target = src)) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index 41a12136ef..dac597e137 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -116,8 +116,7 @@ if(!hound) go_out(user) return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time if(user.a_intent == INTENT_HELP) return var/voracious = TRUE diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 3ea27c84bb..9e9596e8d2 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -121,8 +121,7 @@ update_icon() /obj/machinery/implantchair/container_resist(mob/living/user) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") @@ -191,4 +190,4 @@ brainwash(C, 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]'.") - return TRUE \ No newline at end of file + return TRUE diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index 8b322d20cb..f9a5dedab0 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -133,8 +133,7 @@ remove_occupant(user) return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time if(user.mob_size <= MOB_SIZE_SMALL) to_chat(user, "You begin to try escaping the [src] and start fumbling for the lock switch... (This will take some time.)") to_chat(loc, "You see [user] attempting to unlock the [src]!") diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 5da04a6686..9b28e22028 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -506,8 +506,7 @@ if(opened) return if(ismovable(loc)) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time var/atom/movable/AM = loc AM.relay_container_resist(user, src) return @@ -516,8 +515,7 @@ return //okay, so the closet is either welded or locked... resist!!! - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("[src] begins to shake violently!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear banging from [src].") diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 79a7ce0519..6b58b3d600 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -106,8 +106,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an if(!locked) open() return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message(null, \ "You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index 36539ae1e4..d0c9dd93e6 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -69,8 +69,7 @@ empty_pod() return if(!moving) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time to_chat(user, "You start trying to escape from the pod...") if(do_after(user, 600, target = src)) to_chat(user, "You manage to open the pod.") diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm index f92cb987d0..6d5b18d637 100644 --- a/code/modules/antagonists/abductor/machinery/experiment.dm +++ b/code/modules/antagonists/abductor/machinery/experiment.dm @@ -47,8 +47,7 @@ to_chat(user, "[src]'s door won't budge!") /obj/machinery/abductor/experiment/container_resist(mob/living/user) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 1f9e4ccac3..e77d553da9 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -262,8 +262,7 @@ return occupant /obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user) - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the glass of [src]!", \ "You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a thump from [src].") diff --git a/code/modules/mob/clickdelay.dm b/code/modules/mob/clickdelay.dm index 072e1e31b1..fa549460e1 100644 --- a/code/modules/mob/clickdelay.dm +++ b/code/modules/mob/clickdelay.dm @@ -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()]. var/last_resist = 0 /// 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. diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 8472c8bdae..eebbd72815 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -298,8 +298,7 @@ if(handcuffed) var/obj/item/restraints/O = src.get_item_by_slot(SLOT_HANDCUFFED) buckle_cd = O.breakouttime - changeNext_move(min(CLICK_CD_BREAKOUT, buckle_cd)) - last_special = world.time + min(CLICK_CD_BREAKOUT, buckle_cd) + last_resist = world.time visible_message("[src] attempts to unbuckle [p_them()]self!", \ "You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)") if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST)) @@ -327,12 +326,9 @@ "You extinguish yourself.") ExtinguishMob() -/mob/living/carbon/resist_restraints(ignore_delay = FALSE) +/mob/living/carbon/resist_restraints() var/obj/item/I = null var/type = 0 - if(!ignore_delay && (last_special > world.time)) - to_chat(src, "You don't have the energy to resist your restraints that fast!") - return if(handcuffed) I = handcuffed type = 1 @@ -340,12 +336,7 @@ I = legcuffed type = 2 if(I) - if(type == 1) - 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 + last_resist = world.time cuff_resist(I) /mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a2d53f6f0a..a7fbeaabcd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -733,8 +733,7 @@ /mob/living/carbon/human/resist_restraints() if(wear_suit && wear_suit.breakouttime) - changeNext_move(CLICK_CD_BREAKOUT) - last_special = world.time + CLICK_CD_BREAKOUT + last_resist = world.time cuff_resist(wear_suit) else ..() diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 149ec5f0e3..d55521b6a8 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -90,8 +90,7 @@ else if(legcuffed) I = legcuffed if(I) - changeNext_move(CLICK_CD_BREAKOUT) - last_special = world.time + CLICK_CD_BREAKOUT + last_resist = world.time cuff_resist(I) /mob/living/carbon/monkey/proc/should_target(var/mob/living/L) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c7ed6e743d..3ec7283ccb 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -676,7 +676,7 @@ ..(pressure_difference, direction, pressure_resistance_prob_delta) /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. /mob/living/verb/resist() diff --git a/code/modules/research/nanites/nanite_chamber.dm b/code/modules/research/nanites/nanite_chamber.dm index 4a980a0436..9beb02d6c8 100644 --- a/code/modules/research/nanites/nanite_chamber.dm +++ b/code/modules/research/nanites/nanite_chamber.dm @@ -150,8 +150,7 @@ return if(busy) return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/modules/research/nanites/public_chamber.dm b/code/modules/research/nanites/public_chamber.dm index 76392c66e9..8d3bcf8de5 100644 --- a/code/modules/research/nanites/public_chamber.dm +++ b/code/modules/research/nanites/public_chamber.dm @@ -130,8 +130,7 @@ return if(busy) return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT + user.last_resist = world.time user.visible_message("You see [user] kicking against the door of [src]!", \ "You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a metallic creaking from [src].") diff --git a/code/modules/vore/eating/belly_obj.dm b/code/modules/vore/eating/belly_obj.dm index 50cdc32bf6..a367abb098 100644 --- a/code/modules/vore/eating/belly_obj.dm +++ b/code/modules/vore/eating/belly_obj.dm @@ -542,8 +542,6 @@ if (!(R in contents)) 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 to_chat(R,"You attempt to climb out of \the [lowertext(name)]. (This will take around [escapetime/10] seconds.)") to_chat(owner,"Someone is attempting to climb out of your [lowertext(name)]!")