From 9e38a049f76160b6ca752ff17eefee9e415c0ac7 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Wed, 8 Feb 2017 11:45:50 -0500 Subject: [PATCH 1/9] REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE --- code/modules/mob/living/status_procs.dm | 4 ++++ code/modules/mob/mob_helpers.dm | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 402f94e837e..7dc2d1b8d58 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -103,6 +103,7 @@ // Booleans var/resting = FALSE + var/rest_CD = 0 /* STATUS EFFECTS @@ -140,12 +141,15 @@ /mob/living/proc/StartResting(updating = 1) var/val_change = !resting resting = TRUE + rest_CD = world.time + 20//this is for tracking it for the verb + to_chat(src, "You are now resting.") if(updating && val_change) update_canmove() /mob/living/proc/StopResting(updating = 1) var/val_change = !!resting resting = FALSE + to_chat(src, "You are now getting up.") if(updating && val_change) update_canmove() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 95fce0b9399..dc33990dcca 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -361,9 +361,10 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - resting = !resting - update_canmove() - to_chat(src, "You are now [resting ? "resting" : "getting up"].") + if(!resting) + StartResting() + else if(resting && !(rest_CD > world.time)) + StopResting() /proc/is_blind(A) if(iscarbon(A)) From 01a660298e7ce4a893cb7bc899348d2a421df26e Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Wed, 8 Feb 2017 12:17:36 -0500 Subject: [PATCH 2/9] CD edits --- code/modules/mob/living/status_procs.dm | 2 +- code/modules/mob/mob_helpers.dm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 7dc2d1b8d58..08eff7eada0 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -141,7 +141,7 @@ /mob/living/proc/StartResting(updating = 1) var/val_change = !resting resting = TRUE - rest_CD = world.time + 20//this is for tracking it for the verb + to_chat(src, "You are now resting.") if(updating && val_change) update_canmove() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index dc33990dcca..75f64c753e8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -361,9 +361,11 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - if(!resting) + if(!resting && (world.time > rest_CD)) + rest_CD = world.time + 20 StartResting() - else if(resting && !(rest_CD > world.time)) + else if(resting && (world.time > rest_CD)) + rest_CD = world.time + 20 StopResting() /proc/is_blind(A) From c203a222760b0aca7c8ad6ec5be392216e5c798e Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Wed, 22 Feb 2017 00:43:53 -0500 Subject: [PATCH 3/9] pushing runtimeing code for fox to look at --- code/modules/mob/living/carbon/update_icons.dm | 2 -- code/modules/mob/living/status_procs.dm | 1 - code/modules/mob/living/update_status.dm | 4 ++++ code/modules/mob/mob_helpers.dm | 6 ++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 05224c28dde..cd3e937a8d7 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -19,8 +19,6 @@ if(dir & (EAST|WEST)) //Facing east or west final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass - lying_prev = lying //so we don't try to animate until there's been another change. - if(resize != RESIZE_DEFAULT_SIZE) changed++ ntransform.Scale(resize) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 08eff7eada0..a0b25312e00 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -103,7 +103,6 @@ // Booleans var/resting = FALSE - var/rest_CD = 0 /* STATUS EFFECTS diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index 59b7077e79e..b7a0e9e3e18 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -91,6 +91,10 @@ update_transform() if(!delay_action_updates) update_action_buttons_icon() + if(!lying && lying_prev) + if(client) + client.move_delay = world.time + movement_delay() + lying_prev = lying return canmove /mob/living/proc/update_stamina() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 75f64c753e8..4a8a7b5b2f3 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -361,11 +361,9 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - if(!resting && (world.time > rest_CD)) - rest_CD = world.time + 20 + if(!resting) StartResting() - else if(resting && (world.time > rest_CD)) - rest_CD = world.time + 20 + else if(resting) StopResting() /proc/is_blind(A) From dcc74e5f10b0903551093cb9ca343d839fcc95db Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Wed, 22 Feb 2017 08:37:27 -0500 Subject: [PATCH 4/9] urgh --- code/modules/mob/living/carbon/update_icons.dm | 2 ++ code/modules/mob/living/status_procs.dm | 4 ++-- code/modules/mob/living/update_status.dm | 2 +- code/modules/mob/mob_helpers.dm | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index cd3e937a8d7..875df43a0f0 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -19,6 +19,8 @@ if(dir & (EAST|WEST)) //Facing east or west final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass + lying_prev = lying //so we don't try to animate until there's been another change. + if(resize != RESIZE_DEFAULT_SIZE) changed++ ntransform.Scale(resize) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index a0b25312e00..f53fbd4160b 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -103,6 +103,7 @@ // Booleans var/resting = FALSE + var/rest_CD = 0 /* STATUS EFFECTS @@ -141,14 +142,13 @@ var/val_change = !resting resting = TRUE - to_chat(src, "You are now resting.") if(updating && val_change) update_canmove() /mob/living/proc/StopResting(updating = 1) var/val_change = !!resting resting = FALSE - to_chat(src, "You are now getting up.") + if(updating && val_change) update_canmove() diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index b7a0e9e3e18..7eb054176c4 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -93,7 +93,7 @@ update_action_buttons_icon() if(!lying && lying_prev) if(client) - client.move_delay = world.time + movement_delay() + client.move_delay = max(world.time + movement_delay(), world.time + 20) lying_prev = lying return canmove diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4a8a7b5b2f3..ee7fa503e11 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -361,9 +361,11 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - if(!resting) + if(!resting && (world.time > rest_CD)) + to_chat(src, "You are now resting.") StartResting() - else if(resting) + else if(resting && (world.time > rest_CD)) + to_chat(src, "You are now getting up.") StopResting() /proc/is_blind(A) From 38edcdeb3bf32469c3afcb8a296383a1c77bd4bd Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 23 Feb 2017 00:05:51 -0500 Subject: [PATCH 5/9] forgot this... --- code/modules/mob/mob_helpers.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index ee7fa503e11..664d54138d4 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -362,9 +362,11 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set category = "IC" if(!resting && (world.time > rest_CD)) + rest_CD = world.time + 20 to_chat(src, "You are now resting.") StartResting() else if(resting && (world.time > rest_CD)) + rest_CD = world.time + 20 to_chat(src, "You are now getting up.") StopResting() From 7a4f8d4696c063f46ff380def657005bfe3b3251 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 23 Feb 2017 08:39:01 -0500 Subject: [PATCH 6/9] tabbing --- code/modules/mob/living/carbon/update_icons.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 875df43a0f0..05224c28dde 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -19,7 +19,7 @@ if(dir & (EAST|WEST)) //Facing east or west final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass - lying_prev = lying //so we don't try to animate until there's been another change. + lying_prev = lying //so we don't try to animate until there's been another change. if(resize != RESIZE_DEFAULT_SIZE) changed++ From 50a70ab9c6d8909f37d1d638334d197ed8c4427c Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sat, 25 Feb 2017 02:01:26 -0500 Subject: [PATCH 7/9] The CrazyLemons method --- code/modules/mob/living/status_procs.dm | 1 - code/modules/mob/living/update_status.dm | 4 ---- code/modules/mob/mob_helpers.dm | 11 +++++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index f53fbd4160b..e95381d19cf 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -103,7 +103,6 @@ // Booleans var/resting = FALSE - var/rest_CD = 0 /* STATUS EFFECTS diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index 7eb054176c4..59b7077e79e 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -91,10 +91,6 @@ update_transform() if(!delay_action_updates) update_action_buttons_icon() - if(!lying && lying_prev) - if(client) - client.move_delay = max(world.time + movement_delay(), world.time + 20) - lying_prev = lying return canmove /mob/living/proc/update_stamina() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 664d54138d4..745a1b34afc 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -361,12 +361,15 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) set name = "Rest" set category = "IC" - if(!resting && (world.time > rest_CD)) - rest_CD = world.time + 20 + if(world.time < client.move_delay) + return + + client.move_delay += 20 + + if(!resting) to_chat(src, "You are now resting.") StartResting() - else if(resting && (world.time > rest_CD)) - rest_CD = world.time + 20 + else if(resting) to_chat(src, "You are now getting up.") StopResting() From 3a89c685bf7b6f994117dd2d6d2a07994c5da19f Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sat, 25 Feb 2017 02:04:00 -0500 Subject: [PATCH 8/9] Tweak per suggestion. --- code/modules/mob/mob_helpers.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 745a1b34afc..79d45e94261 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -364,9 +364,8 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) if(world.time < client.move_delay) return - client.move_delay += 20 - if(!resting) + client.move_delay += 20 to_chat(src, "You are now resting.") StartResting() else if(resting) From 414f83bb987bfa97a3f63f9598cde8089940a1a1 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sat, 25 Feb 2017 23:45:15 -0500 Subject: [PATCH 9/9] Krasues Tweaks --- code/modules/mob/mob_helpers.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 79d45e94261..b83f213a066 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -365,7 +365,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) return if(!resting) - client.move_delay += 20 + client.move_delay = world.time + 20 to_chat(src, "You are now resting.") StartResting() else if(resting)