Removing more referencing of variables replacing with procs. So make updating the system easier.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2802 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rockdtben
2011-12-24 20:15:30 +00:00
parent ecffb0d985
commit d189f96896
10 changed files with 42 additions and 149 deletions

View File

@@ -102,72 +102,11 @@
/obj/organ/torso /obj/organ/torso
name = "torso" name = "torso"
var/maxHealth = 50 //right now, the mob's (only humans for now) health depends only on it. Will be fixed later var/maxHealth = 50 //right now, the mob's (only humans for now) health depends only on it. Will be fixed later
var/ear_damage = null//Carbon
var/cloneloss = 0//Carbon
var/nodamage = 0
// flags = NOREACT //uncomment this out later
var/viruses = list() // replaces var/datum/disease/virus
var/list/resistances = list()
var/datum/disease/virus = null
var/emote_allowed = 1
var/sdisabilities = 0//Carbon
var/disabilities = 0//Carbon
var/monkeyizing = null//Carbon
var/lying = 0.0
var/resting = 0.0//Carbon
var/sleeping = 0.0//Carbon
var/oxyloss = 0.0//Living
var/toxloss = 0.0//Living
var/fireloss = 0.0//Living
var/bruteloss = 0.0//Living
var/timeofdeath = 0.0//Living
var/rejuv = null
var/antitoxs = null
var/plasma = null
var/cpr_time = 1.0//Carbon
var/health = 100//Living
var/bodytemperature = 310.055 //98.7 F
var/bhunger = 0//Carbon
var/nutrition = 400.0//Carbon
var/overeatduration = 0 // How long this guy is overeating //Carbon
var/paralysis = 0.0
var/stunned = 0.0
var/weakened = 0.0
var/losebreath = 0.0//Carbon
var/obj/item/weapon/storage/s_active = null//Carbon
var/inertia_dir = 0
var/datum/dna/dna = null//Carbon
var/radiation = 0.0//Carbon
var/mutations = 0//Carbon
//telekinesis = 1
//firemut = 2
//xray = 4
//hulk = 8
//clumsy = 16
//obese = 32
//husk = 64
/*For ninjas and others. This variable is checked when a mob moves and I guess it was supposed to allow the mob to move
through dense areas, such as walls. Setting density to 0 does the same thing. The difference here is that
the mob is also allowed to move without any sort of restriction. For instance, in space or out of holder objects.*/
//0 is off, 1 is normal, 2 is for ninjas.
var/incorporeal_move = 0
//The last mob/living/carbon to push/drag/grab this mob (mostly used by Metroids friend recognition)
var/mob/living/carbon/LAssailant = null
/obj/organ/torso/human /obj/organ/torso/human
name = "human torso" name = "human torso"
species = "human" species = "human"
maxHealth = 100 maxHealth = 100
var/underwear = 1//Human
var/obj/item/weapon/back = null//Human/Monkey
var/obj/item/weapon/tank/internal = null//Human/Monkey
var/alien_egg_flag = 0//Have you been infected?
var/last_special = 0
New() New()
..() ..()
@@ -195,14 +134,6 @@ the mob is also allowed to move without any sort of restriction. For instance, i
var/minDamage = 5 //punching damage var/minDamage = 5 //punching damage
var/maxDamage = 5 var/maxDamage = 5
var/atom/movable/pulling = null
var/hand = null
var/obj/item/weapon/handcuffs/handcuffed = null//Living
var/obj/item/l_hand = null//Living
var/obj/item/r_hand = null//Living
var/in_throw_mode = 0
// var/strangleDelay = 1 //The code is a bit too complicated for that right now
/obj/organ/limb/arms/alien /obj/organ/limb/arms/alien
name = "alien arms" name = "alien arms"
species = "alien" species = "alien"
@@ -219,15 +150,6 @@ the mob is also allowed to move without any sort of restriction. For instance, i
/obj/organ/limb/legs /obj/organ/limb/legs
name = "legs" name = "legs"
var/moveRunDelay = 1 //not sure about how that works
var/moveWalkDelay = 7
//var/knockdownResist = 0
var/next_move = null
var/prev_move = null
var/canmove = 1.0
var/obj/structure/stool/buckled = null//Living
var/footstep = 1
/obj/organ/limb/legs/human /obj/organ/limb/legs/human
name = "human legs" name = "human legs"
species = "human" species = "human"
@@ -240,46 +162,9 @@ the mob is also allowed to move without any sort of restriction. For instance, i
/obj/organ/head /obj/organ/head
name = "head" name = "head"
var/stuttering = null//Carbon
var/druggy = 0//Carbon
var/confused = 0//Carbon
var/drowsyness = 0.0//Carbon
var/dizziness = 0//Carbon
var/is_dizzy = 0
var/is_jittery = 0
var/jitteriness = 0//Carbon
var/r_epil = 0
var/r_ch_cou = 0
var/r_Tourette = 0//Carbon
var/miming = null //checks if the guy is a mime//Human
var/silent = null //Can't talk. Value goes down every life proc.//Human
var/voice_name = "unidentifiable voice"
var/voice_message = null // When you are not understood by others (replaced with just screeches, hisses, chimpers etc.)
var/say_message = null // When you are understood by others. Currently only used by aliens and monkeys in their say_quote procs
var/coughedtime = null
var/job = null//Living
var/const/blindness = 1//Carbon
var/const/deafness = 2//Carbon
var/const/muteness = 4//Carbon
var/brainloss = 0//Carbon
var/robot_talk_understand = 0
var/alien_talk_understand = 0
var/universal_speak = 0 // Set to 1 to enable the mob to speak to everyone -- TLE
var/ear_deaf = null//Carbon
var/eye_blind = null//Carbon
var/eye_blurry = null//Carbon
var/eye_stat = null//Living, potentially Carbon
var/blinded = null
var/shakecamera = 0
//Wizard mode, but can be used in other modes thanks to the brand new "Give Spell" badmin button
var/obj/proc_holder/spell/list/spell_list = list()
/obj/organ/head/human /obj/organ/head/human
name = "human head" name = "human head"
species = "human" species = "human"
var/obj/item/clothing/mask/wear_mask = null//Carbon
/obj/organ/head/alien /obj/organ/head/alien
name = "alien head" name = "alien head"

View File

@@ -11,18 +11,26 @@
//MOB overhaul //MOB overhaul
//Not in use yet //Not in use yet
// var/obj/organstructure/organStructure = null var/obj/organstructure/organStructure = null
//Vars that have been relocated. //Vars that have been relocated to organStructure
//Vars that have been relocated to organStructure ++END
// var/uses_hud = 0
//Vars that should only be accessed via procs
var/bruteloss = 0.0//Living var/bruteloss = 0.0//Living
var/oxyloss = 0.0//Living var/oxyloss = 0.0//Living
var/toxloss = 0.0//Living var/toxloss = 0.0//Living
var/fireloss = 0.0//Living var/fireloss = 0.0//Living
var/cloneloss = 0//Carbon var/cloneloss = 0//Carbon
var/brainloss = 0//Carbon var/brainloss = 0//Carbon
//Vars that should only be accessed via procs ++END
// var/uses_hud = 0
var/obj/screen/flash = null var/obj/screen/flash = null
var/obj/screen/blind = null var/obj/screen/blind = null
var/obj/screen/hands = null var/obj/screen/hands = null

View File

@@ -121,7 +121,7 @@
ear_damage += 15 ear_damage += 15
ear_deaf += 60 ear_deaf += 60
bruteloss += b_loss adjustBruteLoss(b_loss)
adjustFireLoss(f_loss) adjustFireLoss(f_loss)
updatehealth() updatehealth()
@@ -224,7 +224,7 @@
if ((M.client && !( M.blinded ))) if ((M.client && !( M.blinded )))
M.show_message(text("\red [] has been hit by []", src, O), 1) M.show_message(text("\red [] has been hit by []", src, O), 1)
if (health > 0) if (health > 0)
bruteloss += (istype(O, /obj/effect/meteor/small) ? 10 : 25) adjustFireLoss((istype(O, /obj/effect/meteor/small) ? 10 : 25))
adjustFireLoss(30) adjustFireLoss(30)
updatehealth() updatehealth()
@@ -464,7 +464,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1) O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1)
bruteloss += rand(1, 3) adjustBruteLoss(rand(1, 3))
updatehealth() updatehealth()
return return
@@ -493,7 +493,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1) O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
bruteloss += rand(1, 3) adjustBruteLoss(rand(1, 3))
updatehealth() updatehealth()
return return
@@ -518,7 +518,7 @@
else else
damage = rand(5, 35) damage = rand(5, 35)
bruteloss += damage adjustBruteLoss(damage)
if(M.powerlevel > 0) if(M.powerlevel > 0)
var/stunprob = 10 var/stunprob = 10
@@ -649,7 +649,7 @@
for(var/mob/O in viewers(M, null)) for(var/mob/O in viewers(M, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2) O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
playsound(loc, 'punchmiss.ogg', 25, 1, -1) playsound(loc, 'punchmiss.ogg', 25, 1, -1)
@@ -714,7 +714,7 @@ In all, this is a lot like the monkey code. /N
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1) O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
M << "\green <B>[name] is too injured for that.</B>" M << "\green <B>[name] is too injured for that.</B>"

View File

@@ -579,5 +579,5 @@
continue continue
if(air_master.current_cycle%3==1) if(air_master.current_cycle%3==1)
if(!M.nodamage) if(!M.nodamage)
M.bruteloss += 5 M.adjustBruteLoss(5)
src.nutrition += 10 src.nutrition += 10

View File

@@ -71,7 +71,7 @@
if(health >= 250) if(health >= 250)
adjustToxLoss(20) adjustToxLoss(20)
else else
bruteloss -= 5 adjustBruteLoss(-5)
adjustFireLoss(-5) adjustFireLoss(-5)
handle_regular_status_updates() handle_regular_status_updates()

View File

@@ -109,7 +109,7 @@
ear_damage += 15 ear_damage += 15
ear_deaf += 60 ear_deaf += 60
bruteloss += b_loss adjustBruteLoss(b_loss)
adjustFireLoss(f_loss) adjustFireLoss(f_loss)
updatehealth() updatehealth()
@@ -150,7 +150,7 @@
if ((M.client && !( M.blinded ))) if ((M.client && !( M.blinded )))
M.show_message(text("\red [] has been hit by []", src, O), 1) M.show_message(text("\red [] has been hit by []", src, O), 1)
if (health > 0) if (health > 0)
bruteloss += (istype(O, /obj/effect/meteor/small) ? 10 : 25) adjustBruteLoss((istype(O, /obj/effect/meteor/small) ? 10 : 25))
adjustFireLoss(30) adjustFireLoss(30)
updatehealth() updatehealth()
@@ -278,7 +278,7 @@
O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1) O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1)
var/damage = rand(1, 3) var/damage = rand(1, 3)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
@@ -308,7 +308,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1) O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
bruteloss += rand(1, 3) adjustBruteLoss(rand(1, 3))
updatehealth() updatehealth()
return return
@@ -333,7 +333,7 @@
else else
damage = rand(5, 35) damage = rand(5, 35)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
@@ -431,7 +431,7 @@
for(var/mob/O in viewers(M, null)) for(var/mob/O in viewers(M, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2) O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
playsound(loc, 'punchmiss.ogg', 25, 1, -1) playsound(loc, 'punchmiss.ogg', 25, 1, -1)
@@ -470,7 +470,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1) O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
M << "\green <B>[name] is too injured for that.</B>" M << "\green <B>[name] is too injured for that.</B>"

View File

@@ -274,7 +274,7 @@
if(health >= 25) if(health >= 25)
adjustToxLoss(5) adjustToxLoss(5)
else else
bruteloss -= 5 adjustBruteLoss(-5)
adjustFireLoss(-5) adjustFireLoss(-5)
return return
@@ -508,5 +508,5 @@
continue continue
if(air_master.current_cycle%3==1) if(air_master.current_cycle%3==1)
if(!M.nodamage) if(!M.nodamage)
M.bruteloss += 5 M.adjustBruteLoss(5)
nutrition += 10 nutrition += 10

View File

@@ -1034,7 +1034,7 @@
continue continue
if(air_master.current_cycle%3==1) if(air_master.current_cycle%3==1)
if(!M.nodamage) if(!M.nodamage)
M.bruteloss += 5 M.adjustBruteLoss(5)
nutrition += 10 nutrition += 10
handle_changeling() handle_changeling()

View File

@@ -414,11 +414,11 @@
if(src.stat != DEAD) src.stat = UNCONSCIOUS if(src.stat != DEAD) src.stat = UNCONSCIOUS
if(prob(30)) if(prob(30))
if(getOxyLoss()>0) oxyloss = max(getOxyLoss()-1, 0) adjustOxyLoss(-1)
if(getToxLoss()>0) adjustToxLoss(-1) adjustToxLoss(-1)
if(getFireLoss()>0) adjustFireLoss(-1) adjustFireLoss(-1)
if(cloneloss>0) cloneloss = max(cloneloss-1,0) adjustCloneLoss(-1)
if(getBruteLoss()>0) bruteloss = max(getBruteLoss()-1,0) adjustBruteLoss(-1)
if (src.stat == DEAD) if (src.stat == DEAD)

View File

@@ -174,7 +174,7 @@
if(3.0) if(3.0)
b_loss += 30 b_loss += 30
bruteloss += b_loss adjustBruteLoss(b_loss)
adjustFireLoss(f_loss) adjustFireLoss(f_loss)
updatehealth() updatehealth()
@@ -214,7 +214,7 @@
if ((M.client && !( M.blinded ))) if ((M.client && !( M.blinded )))
M.show_message(text("\red [] has been hit by []", src, O), 1) M.show_message(text("\red [] has been hit by []", src, O), 1)
if (health > 0) if (health > 0)
bruteloss += (istype(O, /obj/effect/meteor/small) ? 10 : 25) adjustBruteLoss((istype(O, /obj/effect/meteor/small) ? 10 : 25))
adjustFireLoss(30) adjustFireLoss(30)
updatehealth() updatehealth()
@@ -341,7 +341,7 @@
else else
damage = rand(1, 3) damage = rand(1, 3)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
@@ -373,7 +373,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1) O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
bruteloss += rand(1, 3) adjustBruteLoss(rand(1, 3))
updatehealth() updatehealth()
return return
@@ -515,7 +515,7 @@
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1) O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
playsound(loc, 'punchmiss.ogg', 25, 1, -1) playsound(loc, 'punchmiss.ogg', 25, 1, -1)
@@ -556,7 +556,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has wounded [name]!</B>", M), 1) O.show_message(text("\red <B>[] has wounded [name]!</B>", M), 1)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
else else
playsound(loc, 'slashmiss.ogg', 25, 1, -1) playsound(loc, 'slashmiss.ogg', 25, 1, -1)
@@ -619,7 +619,7 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1) O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
bruteloss += damage adjustBruteLoss(damage)
updatehealth() updatehealth()
return return