Standardised the handle_regular_status_updates() procs for alien hunter, queen and sentinel. They were just copypasta so I fixed the updatehealth() procs and removed the unneeded code.

Removed the invisibility verb for hunters. They now cloak when using stalk intent instead. :3 rawr

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3935 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-06-28 17:37:42 +00:00
parent 80b15df54b
commit 3941c9b86c
11 changed files with 79 additions and 321 deletions
@@ -2,144 +2,61 @@
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
if(src.name == "alien hunter")
src.name = text("alien hunter ([rand(1, 1000)])")
src.real_name = src.name
src.verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
if(name == "alien hunter")
name = text("alien hunter ([rand(1, 1000)])")
real_name = name
verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
/mob/living/carbon/alien/humanoid/hunter
updatehealth()
if (src.nodamage == 0)
if(nodamage)
health = 150
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 150 - src.getOxyLoss() - src.getFireLoss() - src.getBruteLoss()
else
src.health = 150
src.stat = 0
health = 150 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
handle_regular_hud_updates()
..() //-Yvarov
if (src.healths)
if (src.stat != 2)
if (healths)
if (stat != 2)
switch(health)
if(150 to INFINITY)
src.healths.icon_state = "health0"
healths.icon_state = "health0"
if(100 to 150)
src.healths.icon_state = "health1"
healths.icon_state = "health1"
if(50 to 100)
src.healths.icon_state = "health2"
healths.icon_state = "health2"
if(25 to 50)
src.healths.icon_state = "health3"
healths.icon_state = "health3"
if(0 to 25)
src.healths.icon_state = "health4"
healths.icon_state = "health4"
else
src.healths.icon_state = "health5"
healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
healths.icon_state = "health6"
handle_environment()
if(m_intent == "run" || resting)
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= 150)
adjustToxLoss(5)
else
adjustBruteLoss(-5)
adjustFireLoss(-5)
else
adjustToxLoss(-5)
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= 150)
adjustToxLoss(5)
else
adjustBruteLoss(-5)
adjustFireLoss(-5)
handle_regular_status_updates()
health = 150 - (getOxyLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(getOxyLoss() > 50) Paralyse(3)
if(src.sleeping)
Paralyse(3)
//if (prob(10) && health) spawn(0) emote("snore") Invalid Emote
src.sleeping--
if(src.resting)
Weaken(5)
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
death()
else if(src.health < config.health_threshold_crit)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!src.rejuv) src.oxyloss++
if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(1)
if(src.stat != 2) src.stat = 1
Paralyse(5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
if (src.weakened > 0)
AdjustWeakened(-1)
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
//Hunter verbs
/*
/mob/living/carbon/alien/humanoid/hunter/verb/invis()
set name = "Invisibility (50)"
set desc = "Makes you invisible for 15 seconds"
@@ -161,7 +78,7 @@
update_icons()
src << "\green You are no longer invisible."
return
*/
/mob/living/carbon/alien/humanoid/hunter/verb/regurgitate()
set name = "Regurgitate"
set desc = "Empties the contents of your stomach"
@@ -2,43 +2,44 @@
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
if(src.name == "alien sentinel")
src.name = text("alien sentinel ([rand(1, 1000)])")
src.real_name = src.name
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
if(name == "alien sentinel")
name = text("alien sentinel ([rand(1, 1000)])")
real_name = name
verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
/mob/living/carbon/alien/humanoid/sentinel
updatehealth()
if (src.nodamage == 0)
if(nodamage)
health = 125
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 125 - src.getOxyLoss() - src.getFireLoss() - src.getBruteLoss()
else
src.health = 125
src.stat = 0
health = 125 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
handle_regular_hud_updates()
..() //-Yvarov
if (src.healths)
if (src.stat != 2)
if (healths)
if (stat != 2)
switch(health)
if(125 to INFINITY)
src.healths.icon_state = "health0"
healths.icon_state = "health0"
if(100 to 125)
src.healths.icon_state = "health1"
healths.icon_state = "health1"
if(75 to 100)
src.healths.icon_state = "health2"
healths.icon_state = "health2"
if(25 to 75)
src.healths.icon_state = "health3"
healths.icon_state = "health3"
if(0 to 25)
src.healths.icon_state = "health4"
healths.icon_state = "health4"
else
src.healths.icon_state = "health5"
healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
healths.icon_state = "health6"
handle_environment()
@@ -46,99 +47,10 @@
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= 125)
adjustToxLoss(10)
else
adjustBruteLoss(-10)
adjustFireLoss(-10)
handle_regular_status_updates()
health = 150 - (getOxyLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(getOxyLoss() > 50) Paralyse(3)
if(src.sleeping)
Paralyse(3)
//if (prob(10) && health) spawn(0) emote("snore") Invalid Emote
src.sleeping--
if(src.resting)
Weaken(5)
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
death()
else if(src.health < config.health_threshold_crit)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!src.rejuv) src.oxyloss++
if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(1)
if(src.stat != 2) src.stat = 1
Paralyse(5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
if (src.weakened > 0)
AdjustWeakened(-1)
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
//Sentinel verbs
/mob/living/carbon/alien/humanoid/sentinel/verb/spit(mob/target as mob in oview())
@@ -166,7 +78,7 @@
if(!istype(T, /turf))
return
if (U == T)
usr.bullet_act(src, src.get_organ_target())
usr.bullet_act(src, get_organ_target())
return
if(!istype(U, /turf))
return
@@ -539,6 +539,6 @@ In all, this is a lot like the monkey code. /N
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = 100 - getOxyLoss() - getFireLoss() - getBruteLoss()
health = 100 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
@@ -54,89 +54,6 @@
adjustBruteLoss(-5)
adjustFireLoss(-5)
handle_regular_status_updates()
health = 250 - (getOxyLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(getOxyLoss() > 50) Paralyse(3)
if(src.sleeping)
Paralyse(3)
//if (prob(10) && health) spawn(0) emote("snore") Invalid Emote
src.sleeping--
if(src.resting)
Weaken(5)
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
death()
else if(src.health < config.health_threshold_crit)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
//if(!src.rejuv) src.oxyloss++
if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(1)
if(src.stat != 2) src.stat = 1
Paralyse(5)
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
if (src.weakened > 0)
AdjustWeakened(-1)
src.lying = 1
src.stat = 0
if (src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
drop_item()
src.hand = h
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.lying = 1
src.blinded = 1
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.eye_blind)
src.eye_blind--
src.blinded = 1
if (src.ear_deaf > 0) src.ear_deaf--
if (src.ear_damage < 25)
src.ear_damage -= 0.05
src.ear_damage = max(src.ear_damage, 0)
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
//Queen verbs
/mob/living/carbon/alien/humanoid/queen/verb/lay_egg()
@@ -155,3 +72,13 @@
O.show_message(text("\green <B>[src] has laid an egg!</B>"), 1)
new /obj/effect/alien/egg(loc)
return
/mob/living/carbon/alien/humanoid/queen/updatehealth()
if(nodamage)
health = 250
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = 250 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
@@ -20,13 +20,8 @@
for(var/image/I in overlays_lying)
overlays += I
else
if(alien_invis)
icon_state = "alienh_cloak" //this is such a crude solution. I'm sorry.
//indstead of all that fancy icon processing, it just replaces our base icon
//Aliens can't wear much anyway :P ~Carn
else
if(m_intent == "run") icon_state = "alien[caste]_running"
else icon_state = "alien[caste]_s"
if(m_intent == "run") icon_state = "alien[caste]_running"
else icon_state = "alien[caste]_s"
for(var/image/I in overlays_standing)
overlays += I
@@ -17,14 +17,11 @@
..()
if (stat != 2) //still breathing
if (stat != DEAD) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
spawn(0) breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
@@ -352,7 +349,7 @@
ear_deaf = max(ear_deaf, 1)
else if(ear_deaf) //deafness, heals slowly over time
ear_deaf = max(ear_deaf-1, 0)
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
else if(ear_damage < 25) //ear damage heals slowly under this threshold.
ear_damage = max(ear_damage-0.05, 0)
//Other
@@ -10,7 +10,7 @@
total_brute += O.brute_dam
total_burn += O.burn_dam
health = 100 - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
//TODO: fix this husking crap
//TODO: fix husking
if( ((100 - total_burn) < config.health_threshold_dead) && stat == DEAD) //100 only being used as the magic human max health number, feel free to change it if you add a var for it -- Urist
ChangeToHusk()
return