diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index 5abaae459da..d9c6d31e374 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -33,6 +33,7 @@ var/allow_Metadata = 0 // Metadata is supported. var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. var/Ticklag = 0.9 + var/Tickcomp = 0 var/list/mode_names = list() var/list/modes = list() // allowed modes @@ -301,6 +302,9 @@ if("ticklag") Ticklag = text2num(value) + if("tickcomp") + Tickcomp = 1 + else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/modules/admin/verbs/ticklag.dm b/code/modules/admin/verbs/ticklag.dm index 22b7e998ccf..c5896b5bee0 100644 --- a/code/modules/admin/verbs/ticklag.dm +++ b/code/modules/admin/verbs/ticklag.dm @@ -16,7 +16,16 @@ message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0) world.tick_lag = newtick feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No")) + if("Yes") + config.Tickcomp = 1 + else + config.Tickcomp = 0 + return + + src << "\red Error: ticklag(): Invalid world.ticklag value. No changes made." return diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index b4f169fb0b4..214cd66d73a 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -19,7 +19,8 @@ /mob/living/carbon/human/Process_Spaceslipping(var/prob_slip = 5) //If knocked out we might just hit it and stop. This makes it possible to get dead bodies and such. - if(stat) prob_slip += 50 + if(stat) + prob_slip = 0 // Changing this to zero to make it line up with the comment, and also, make more sense. //Do we have magboots or such on if so no slip if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index d577209da5e..b0374ba7bc8 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -330,10 +330,17 @@ return null update_canmove() - if(paralysis || stunned || weakened || resting || buckled || (changeling && changeling.changeling_fakedeath)) + if(sleeping || paralysis || stunned || weakened || resting || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0 + else + lying = 0 canmove = 1 + /* for(var/obj/effect/stop/S in geaslist) + if(S.victim == src) + geaslist -= S + del(S) +*/ handle_breath(datum/gas_mixture/breath) if(nodamage) @@ -714,17 +721,6 @@ if(getOxyLoss() > 50) Paralyse(3) - if(sleeping) - adjustHalLoss(-5) - if(paralysis <= 0) - Paralyse(2) - if (prob(10) && health && !hal_crit) spawn(0) emote("snore") - sleeping-- - - if(resting) - if(weakened <= 0) - Weaken(2) - if(health < config.health_threshold_dead || brain_op_stage == 4.0) death() else if(health < config.health_threshold_crit) @@ -740,7 +736,7 @@ if (silent) silent-- - if (paralysis || stunned || weakened || (changeling && changeling.changeling_fakedeath)) //Stunned etc. + if (resting || sleeping || paralysis || stunned || weakened || (changeling && changeling.changeling_fakedeath)) //Stunned etc. if (stunned > 0) AdjustStunned(-1) stat = 0 @@ -749,12 +745,26 @@ lying = 1 stat = 0 if (paralysis > 0) - if(sleeping > 0) - handle_dreams() AdjustParalysis(-1) blinded = 1 lying = 1 stat = 1 + + if (sleeping > 0) + handle_dreams() + adjustHalLoss(-5) + blinded = 1 + lying = 1 + stat = 1 + if (prob(10) && health && !hal_crit) + spawn(0) + emote("snore") + sleeping-- + + if(resting) + lying = 1 + stat = 0 + var/h = hand hand = 0 drop_item() @@ -1111,7 +1121,17 @@ if(!M.nodamage) M.adjustBruteLoss(5) nutrition += 10 - +/* One day. + if(nutrition <= 100) + if (prob (1)) + src << "\red Your stomach rumbles." + if(nutrition <= 50) + if (prob (25)) + bruteloss++ + if (prob (5)) + src << "You feel very weak." + weakened += rand(2, 3) +*/ handle_changeling() if (mind) if (mind.special_role == "Changeling" && changeling) @@ -1122,14 +1142,7 @@ /* // Commented out so hunger system won't be such shock // Damage and effect from not eating - if(nutrition <= 50) - if (prob (0.1)) - src << "\red Your stomach rumbles." - if (prob (10)) - bruteloss++ - if (prob (5)) - src << "You feel very weak." - weakened += rand(2, 3) + */ /* snippets diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ac918668f50..c4d0a6ac81b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -990,53 +990,124 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check return 0 +/mob/proc/createGeas() +/* + var/obj/effect/stop/S + for(var/obj/effect/stop/temp in loc) + if(temp.victim == src) + S = temp + + if(!S) + S = new /obj/effect/stop + S.victim = src + S.loc = src.loc + geaslist += S +*/ + return + /mob/proc/Stun(amount) if(canstun) stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun + if(stunned) + createGeas() else if(istype(src, /mob/living/carbon/alien)) // add some movement delay var/mob/living/carbon/alien/Alien = src - Alien.move_delay_add = min(Alien.move_delay_add + round(amount / 5), 10) // a maximum delay of 10 + Alien.move_delay_add = min(Alien.move_delay_add + round(amount / 2), 10) // a maximum delay of 10 return /mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" if(canstun) stunned = max(amount,0) + if(stunned) + createGeas() return /mob/proc/AdjustStunned(amount) if(canstun) stunned = max(stunned + amount,0) + if(stunned) + createGeas() return /mob/proc/Weaken(amount) if(canweaken) weakened = max(max(weakened,amount),0) + if(weakened) + createGeas() return /mob/proc/SetWeakened(amount) if(canweaken) weakened = max(amount,0) + if(weakened) + createGeas() return /mob/proc/AdjustWeakened(amount) if(canweaken) weakened = max(weakened + amount,0) + if(weakened) + createGeas() return /mob/proc/Paralyse(amount) paralysis = max(max(paralysis,amount),0) + if(paralysis) + createGeas() return /mob/proc/SetParalysis(amount) paralysis = max(amount,0) return + if(paralysis) + createGeas() /mob/proc/AdjustParalysis(amount) paralysis = max(paralysis + amount,0) + if(paralysis) + createGeas() return +/mob/proc/Sleeping(amount) + sleeping = max(max(sleeping,amount),0) + if(sleeping) + createGeas() + return + +/mob/proc/SetSleeping(amount) + sleeping = max(amount,0) + return + if(sleeping) + createGeas() + + +/mob/proc/AdjustSleeping(amount) + sleeping = max(sleeping + amount,0) + if(sleeping) + createGeas() + return + +/mob/proc/Resting(amount) + resting = max(max(resting,amount),0) + if(resting) + createGeas() + return + +/mob/proc/SetResting(amount) + resting = max(amount,0) + return + if(resting) + createGeas() + +/mob/proc/AdjustResting(amount) + resting = max(resting + amount,0) + if(resting) + createGeas() + return + + // ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching /mob/proc/getBruteLoss() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 8e687f04ae7..445b18ae845 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -271,4 +271,6 @@ the mob is also allowed to move without any sort of restriction. For instance, i var/digitalcamo = 0 // Can they be tracked by the AI? - var/datum/preferences/storedpreferences = null \ No newline at end of file + var/datum/preferences/storedpreferences = null + + var/geaslist = list() \ No newline at end of file diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index e5c59ccde4e..59a04af143e 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -186,6 +186,7 @@ return 0 move_delay = world.time//set move delay + switch(mob.m_intent) if("run") if(mob.drowsyness > 0) @@ -199,6 +200,14 @@ move_delay += 7 move_delay += mob.movement_delay() + if(config.Tickcomp) + move_delay -= 1.3 + var/tickcomp = ((1/(world.tick_lag))*1.3) + move_delay = move_delay + tickcomp + + + + //We are now going to move moving = 1 //Something with pulling things @@ -334,7 +343,8 @@ ///Return 1 for movement 0 for none /mob/proc/Process_Spacemove(var/check_drift = 0) //First check to see if we can do things - if(restrained()) return 0 + if(restrained()) + return 0 /* if(istype(src,/mob/living/carbon)) @@ -380,7 +390,10 @@ break //Nothing to push off of so end here - if(!dense_object) return 0 + if(!dense_object) + return 0 + + //Check to see if we slipped if(prob(Process_Spaceslipping(5))) @@ -396,7 +409,8 @@ /mob/proc/Process_Spaceslipping(var/prob_slip = 5) //Setup slipage //If knocked out we might just hit it and stop. This makes it possible to get dead bodies and such. - if(stat) prob_slip += 50 + if(stat) + prob_slip = 0 // Changing this to zero to make it line up with the comment. prob_slip = round(prob_slip) return(prob_slip) diff --git a/config/config.txt b/config/config.txt index 6f1a9c1c45c..6a76e8ddc15 100644 --- a/config/config.txt +++ b/config/config.txt @@ -151,7 +151,10 @@ FEATURE_OBJECT_SPELL_SYSTEM ##Remove the # mark if you are going to use the SVN irc bot to relay adminhelps #USEIRCBOT -##Defines the ticklag for the world. 0.9 is the normal one, 0.6 is smoother. +##Defines the ticklag for the world. 0.9 is the normal one, 0.5 is smoother. TICKLAG 0.9 +## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks. Recommended if tickrate is lowered. +TICKCOMP 0 +