-Added an "attack_larva" proc. It can be used for when you want larva to interact with things.

-Made the required 200 amount a variable, called max_grown.
-Larva can now bite simple animals to get some grown amount.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4597 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-09-01 14:14:27 +00:00
parent 3ec363768c
commit 0decd596f6
5 changed files with 38 additions and 4 deletions
+15
View File
@@ -67,6 +67,9 @@
src.attack_paw(user)
return
/atom/proc/attack_larva(mob/user as mob)
return
// for metroids
/atom/proc/attack_metroid(mob/user as mob)
return
@@ -654,6 +657,16 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
if ( (W) && !alien.restrained() )
W.afterattack(src, alien)
else if(islarva(usr))
var/mob/living/carbon/alien/larva/alien = usr
if(alien.stat)
return
var/in_range = in_range(src, alien) || src.loc == alien
if (in_range)
if ( !alien.restrained() )
attack_larva(alien)
else if(ismetroid(usr))
var/mob/living/carbon/metroid/metroid = usr
@@ -980,6 +993,8 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/metroid))
@@ -8,6 +8,7 @@
health = 25
var/amount_grown = 0
var/max_grown = 200
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/larva/New()
@@ -64,7 +65,7 @@
stat(null, "Move Mode: [m_intent]")
if (client.statpanel == "Status")
stat(null, "Progress: [amount_grown]/200")
stat(null, "Progress: [amount_grown]/[max_grown]")
stat(null, "Plasma Stored: [getPlasma()]")
@@ -64,7 +64,7 @@
proc/handle_mutations_and_radiation()
//grow!! but not if metroid or dead
if(health>-100 && amount_grown < 200)
if(health>-100 && amount_grown < max_grown)
amount_grown++
if (radiation)
@@ -235,7 +235,7 @@
mutations.Add(FAT)
else
if(nutrition > 500)
if(prob(5 + round((nutrition - 200) / 2)))
if(prob(5 + round((nutrition - max_grown) / 2)))
src << "\red You suddenly feel blubbery!"
mutations.Add(FAT)
@@ -22,7 +22,7 @@
set desc = "Evolve into a fully grown Alien."
set category = "Alien"
if(amount_grown >= 200) //TODO ~Carn
if(amount_grown >= max_grown) //TODO ~Carn
src << "\green You are growing into a beautiful alien! It is time to choose a caste."
src << "\green There are three to choose from:"
src << "\green <B>Hunters</B> are strong and agile, able to hunt away from the hive and rapidly move through ventilation shafts. Hunters generate plasma slowly and have low reserves."
@@ -282,7 +282,9 @@
return
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
switch(M.a_intent)
if ("help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
@@ -320,6 +322,22 @@
return
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
switch(L.a_intent)
if("help")
visible_message("\blue [L] rubs it's head against [src]")
else
var/damage = rand(5, 10)
visible_message("\red <B>[L] bites [src]!</B>")
if(stat != DEAD)
src.health -= damage
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/stack/medical))
if(stat != DEAD)