diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index c61890c6bc..d6822a37c6 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -115,3 +115,6 @@ #define STAMINA_CRIT 140 //crit for stamina damage. forces a rest, and stops movement until stamina goes back to stamina softcrit #define STAMINA_SOFTCRIT_TRADITIONAL 0 //same as STAMINA_SOFTCRIT except for the more traditional health calculations #define STAMINA_CRIT_TRADITIONAL -40 //ditto, but for STAMINA_CRIT +#define MIN_MELEE_STAMCOST 1.25 //Minimum cost for swinging items around. Will be extra useful when stats and skills are introduced. + +#define CRAWLUNDER_DELAY 30 //Delay for crawling under a standing mob diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ad9d76b6f4..5bd526efd5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -139,6 +139,27 @@ to_chat(src, "[L] is restraining [P], you cannot push past.") return 1 + //CIT CHANGES START HERE - makes it so resting stops you from moving through standing folks without a short delay + if(resting && !L.resting) + if(attemptingcrawl) + return TRUE + if(staminaloss >= STAMINA_SOFTCRIT) + to_chat(src, "You're too exhausted to crawl under [L].") + return TRUE + attemptingcrawl = TRUE + var/origtargetloc = L.loc + visible_message("[src] is attempting to crawl under [L].", "You are now attempting to crawl under [L].") + if(do_after(src, CRAWLUNDER_DELAY, target = src)) + if(resting) + var/src_passmob = (pass_flags & PASSMOB) + pass_flags |= PASSMOB + Move(origtargetloc) + if(!src_passmob) + pass_flags &= ~PASSMOB + attemptingcrawl = FALSE + return TRUE + //END OF CIT CHANGES + if(moving_diagonally)//no mob swap during diagonal moves. return 1 diff --git a/modular_citadel/code/_onclick/item_attack.dm b/modular_citadel/code/_onclick/item_attack.dm index b86ddc51be..dcc9f567e2 100644 --- a/modular_citadel/code/_onclick/item_attack.dm +++ b/modular_citadel/code/_onclick/item_attack.dm @@ -20,6 +20,6 @@ /obj/item/proc/getweight() if(total_mass) - return total_mass + return max(total_mass,MIN_MELEE_STAMCOST) else return w_class*1.25 diff --git a/modular_citadel/code/game/objects/items.dm b/modular_citadel/code/game/objects/items.dm index 6f44d4b005..3cd0d12b8b 100644 --- a/modular_citadel/code/game/objects/items.dm +++ b/modular_citadel/code/game/objects/items.dm @@ -1,2 +1,2 @@ /obj/item - var/total_mass + var/total_mass //Total mass in arbitrary pound-like values. If there's no balance reasons for an item to have otherwise, this var should be the item's weight in pounds. diff --git a/modular_citadel/code/game/objects/items/melee/energy.dm b/modular_citadel/code/game/objects/items/melee/energy.dm new file mode 100644 index 0000000000..c37f88eacf --- /dev/null +++ b/modular_citadel/code/game/objects/items/melee/energy.dm @@ -0,0 +1,3 @@ +/obj/item/melee/transforming/energy/sword + total_mass = 0.375 //Survival flashlights typically weigh around 5 ounces. + total_mass_on = 3.4 //The typical medieval sword, on the other hand, weighs roughly 3 pounds. diff --git a/modular_citadel/code/game/objects/items/melee/transforming.dm b/modular_citadel/code/game/objects/items/melee/transforming.dm new file mode 100644 index 0000000000..211118bbce --- /dev/null +++ b/modular_citadel/code/game/objects/items/melee/transforming.dm @@ -0,0 +1,11 @@ +/obj/item/melee/transforming + var/total_mass_on //Total mass in ounces when transformed. Primarily for balance purposes. Don't think about it too hard. + +/obj/item/melee/transforming/getweight() + if(total_mass && total_mass_on) + if(active) + return max(total_mass_on,MIN_MELEE_STAMCOST) + else + return max(total_mass,MIN_MELEE_STAMCOST) + else + return initial(w_class)*1.25 diff --git a/modular_citadel/code/modules/mob/living/carbon/carbon.dm b/modular_citadel/code/modules/mob/living/carbon/carbon.dm index 87a496b48b..51bdb16cd4 100644 --- a/modular_citadel/code/modules/mob/living/carbon/carbon.dm +++ b/modular_citadel/code/modules/mob/living/carbon/carbon.dm @@ -1,6 +1,16 @@ /mob/living/carbon var/combatmode = FALSE //literally lifeweb +/mob/living/carbon/CanPass(atom/movable/mover, turf/target) + . = ..() + if(.) + var/mob/living/mobdude = mover + if(istype(mobdude)) + if(!resting && mobdude.resting) + if(!(mobdude.pass_flags & PASSMOB)) + return FALSE + return . + /mob/living/carbon/proc/toggle_combat_mode() if(recoveringstam) return TRUE diff --git a/modular_citadel/code/modules/mob/living/living.dm b/modular_citadel/code/modules/mob/living/living.dm index 16376a4a58..89bada745b 100644 --- a/modular_citadel/code/modules/mob/living/living.dm +++ b/modular_citadel/code/modules/mob/living/living.dm @@ -6,6 +6,7 @@ var/aimingdownsights = FALSE var/attemptingstandup = FALSE var/intentionalresting = FALSE + var/attemptingcrawl = FALSE /mob/living/movement_delay(ignorewalk = 0) . = ..() diff --git a/tgstation.dme b/tgstation.dme index a1b5c93299..169897937d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2632,7 +2632,9 @@ #include "modular_citadel\code\game\objects\items\devices\radio\encryptionkey.dm" #include "modular_citadel\code\game\objects\items\devices\radio\headset.dm" #include "modular_citadel\code\game\objects\items\devices\radio\shockcollar.dm" +#include "modular_citadel\code\game\objects\items\melee\energy.dm" #include "modular_citadel\code\game\objects\items\melee\eutactic_blades.dm" +#include "modular_citadel\code\game\objects\items\melee\transforming.dm" #include "modular_citadel\code\game\objects\structures\beds_chairs\chair.dm" #include "modular_citadel\code\game\objects\structures\beds_chairs\sofa.dm" #include "modular_citadel\code\game\objects\structures\crates_lockers\closets\fitness.dm"