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
@@ -6,7 +6,7 @@
var/obj/item/clothing/head/head = null //
var/obj/item/weapon/r_store = null
var/obj/item/weapon/l_store = null
var/alien_invis = 0
// var/alien_invis = 0
var/caste = ""
update_icon = 1
+4
View File
@@ -939,6 +939,10 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
@@ -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
+6
View File
@@ -46,12 +46,18 @@ Stuff which is in development and not yet visible to players or just code relate
should be listed in the changelog upon commit tho. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<div class="commit sansserif">
<h2 class="date">Thursday, June 28th</h2>
<h3 class="author">Nodrak updated:</h3>
<ul class="changes bgimages16">
<li class="wip">I'm currently working on cleaning up and moving around a large portion of the mob code. These changes do not directly affect players; HOWEVER, bugs, oversights or simple mistakes may cause problems for players. While I have tested as much as I can, there may be some lingering bugs I have missed. <p> This part of the mob code cleanup mainly focuses on damage variables and procs. So if you suspect something related to taking, dealing or examining damage is not working as intended please fill out an issue report <a href="http://code.google.com/p/tgstation13/issues/list">here</a> and be as detailed as possible. This includes what you were doing, steps to reproduce the problem, who you were doing it to, what you were using ect... Thank you.</li>
</ul>
<h3 class="author">Carn updated:</h3>
<ul class="changes bgimages16">
<li class="rscadd">Alien hunters will now cloak when using the 'stalk' movement intent. Whilst cloaked they will use up their plasma reserves. They can however cloak as long as they like. Using the Lay-down verb will allow them to remain cloaked without depleting their plasma reserves, hence allowing them to lay ambushes for unsuspecting prey. Should a hunter attack anybody, or get knocked down in any way, they will become visible. Hopefully this allows for more strategic/stealthy gameplay from aliens. On the other hand, I may have totally screwed the balance so feedback/other-ideas are welcome.</li>
<li class="rscdel">Removed the invisibility verb from the alien hunter caste. </li>
</ul>
</div>
<div class="commit sansserif">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 46 KiB