From 35c0740f225dd077430dd7b37c4f76d546f8aad7 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Thu, 9 Aug 2012 19:26:52 +0000 Subject: [PATCH] -Added a plasma_rate and heal_rate variable for Aliens. This will make it easier to tweak balance changes. -Made all aliens use this when determining how much to recharge/heal. -Deleted handle_enviroments which overshadow the base alien one. -Made maxHealth actually do something. Every alien caste had their own updatehealth which did not use maxHealth, which was very stupid. -Fixed an issue where a player could accidentally pick a breed of alien when typing. Larva will now have to use the evolve verb in order to evolve. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4353 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/mob/living/carbon/alien.dm | 4 ++- .../mob/living/carbon/alien_humanoid.dm | 5 +++ code/game/gamemodes/events.dm | 8 +++-- .../carbon/alien/humanoid/caste/hunter.dm | 19 ++--------- .../carbon/alien/humanoid/caste/sentinel.dm | 19 ----------- .../living/carbon/alien/humanoid/humanoid.dm | 6 ++-- .../mob/living/carbon/alien/humanoid/life.dm | 10 +++--- .../mob/living/carbon/alien/humanoid/queen.dm | 32 +------------------ .../mob/living/carbon/alien/larva/larva.dm | 9 ------ .../mob/living/carbon/alien/larva/life.dm | 27 ++-------------- .../mob/living/carbon/alien/larva/powers.dm | 31 +++++++++++++++++- 11 files changed, 57 insertions(+), 113 deletions(-) diff --git a/code/defines/mob/living/carbon/alien.dm b/code/defines/mob/living/carbon/alien.dm index 4f3496eaa34..2cb0453c1d2 100644 --- a/code/defines/mob/living/carbon/alien.dm +++ b/code/defines/mob/living/carbon/alien.dm @@ -16,4 +16,6 @@ var/move_delay_add = 0 // movement delay to add - status_flags = CANPARALYSE \ No newline at end of file + status_flags = CANPARALYSE + var/heal_rate = 5 + var/plasma_rate = 5 \ No newline at end of file diff --git a/code/defines/mob/living/carbon/alien_humanoid.dm b/code/defines/mob/living/carbon/alien_humanoid.dm index 2dee5fb2ac6..2b62b4bb9e4 100644 --- a/code/defines/mob/living/carbon/alien_humanoid.dm +++ b/code/defines/mob/living/carbon/alien_humanoid.dm @@ -19,6 +19,7 @@ storedPlasma = 100 max_plasma = 150 icon_state = "alienh_s" + plasma_rate = 5 /mob/living/carbon/alien/humanoid/sentinel name = "alien sentinel" @@ -28,6 +29,7 @@ storedPlasma = 100 max_plasma = 250 icon_state = "aliens_s" + plasma_rate = 10 /mob/living/carbon/alien/humanoid/drone name = "alien drone" @@ -35,6 +37,7 @@ maxHealth = 100 health = 100 icon_state = "aliend_s" + plasma_rate = 15 /mob/living/carbon/alien/humanoid/queen name = "alien queen" @@ -43,6 +46,8 @@ health = 250 icon_state = "alienq_s" nopush = 1 + heal_rate = 15 + plasma_rate = 20 /mob/living/carbon/alien/humanoid/rpbody update_icon = 0 diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index a4afcccfc9e..e40634abad4 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -240,8 +240,9 @@ //world << sound('aliens.ogg') var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) - if(temp_vent.loc.z == 1 && !temp_vent.welded) - vents += temp_vent + if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology + vents += temp_vent var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn for(var/mob/dead/observer/G in player_list) @@ -252,6 +253,7 @@ if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one while((spawncount >= 1) && vents.len && candidates.len) + var/obj/vent = pick(vents) var/candidate = pick(candidates) @@ -262,7 +264,7 @@ vents -= vent spawncount-- - spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes. + spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes. command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") world << sound('aliens.ogg') diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index acbb16d7b08..774679369d6 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -9,15 +9,6 @@ /mob/living/carbon/alien/humanoid/hunter - updatehealth() - 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!! - health = 150 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - handle_regular_hud_updates() @@ -44,15 +35,9 @@ 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) + adjustToxLoss(-heal_rate) //Hunter verbs diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 97ed7cca799..e4eba18dea9 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -10,15 +10,6 @@ /mob/living/carbon/alien/humanoid/sentinel - updatehealth() - 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!! - health = 125 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - handle_regular_hud_updates() @@ -41,13 +32,3 @@ healths.icon_state = "health5" else healths.icon_state = "health6" - - handle_environment() - - //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 >= 125) - adjustToxLoss(10) - else - adjustBruteLoss(-10) - adjustFireLoss(-10) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index a36d3fbc660..f3a7a1ccedb 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -529,11 +529,11 @@ In all, this is a lot like the monkey code. /N /mob/living/carbon/alien/humanoid/updatehealth() if(nodamage) - health = 100 - stat = 0 + health = maxHealth + stat = CONSCIOUS else //oxyloss is only used for suicide //toxloss isn't used for aliens, its actually used as alien powers!! - health = 100 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() + health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 8b18a1a6ade..652f018f4b9 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -261,13 +261,13 @@ //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 >= 100) - adjustToxLoss(15) + if(health >= maxHealth) + adjustToxLoss(plasma_rate) else - adjustBruteLoss(-5) - adjustFireLoss(-5) - adjustOxyLoss(-5) + adjustBruteLoss(-heal_rate) + adjustFireLoss(-heal_rate) + adjustOxyLoss(-heal_rate) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 3deb7dd878b..e41e746083c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -18,16 +18,6 @@ /mob/living/carbon/alien/humanoid/queen - updatehealth() - if (src.nodamage) - src.health = 250 - src.stat = 0 - else - //oxyloss is only used for suicide - //toxloss isn't used for aliens, its actually used as alien powers!! - src.health = 250 - src.getOxyLoss() - src.getFireLoss() - src.getBruteLoss() - - handle_regular_hud_updates() ..() //-Yvarov @@ -50,16 +40,6 @@ else src.healths.icon_state = "health6" - handle_environment() - - //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 >= 250) - adjustToxLoss(20) - else - adjustBruteLoss(-5) - adjustFireLoss(-5) - //Queen verbs /mob/living/carbon/alien/humanoid/queen/verb/lay_egg() @@ -77,14 +57,4 @@ for(var/mob/O in viewers(src, null)) O.show_message(text("\green [src] has laid an egg!"), 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() + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index ca9d4cd02e4..3a62cccad44 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -458,15 +458,6 @@ onclose(user, "mob[name]") return -/mob/living/carbon/alien/larva/updatehealth() - if(nodamage) - health = 25 - stat = 0 - else - //oxyloss is only used for suicide - //toxloss isn't used for aliens, its actually used as alien powers!! - health = 25 - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - /* Commented out because it's duplicated in life.dm /mob/living/carbon/alien/larva/proc/grow() // Larvae can grow into full fledged Xenos if they survive long enough -- TLE if(icon_state == "larva_l" && !canmove) // This is a shit death check. It is made of shit and death. Fix later. diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 48822de7404..88792445709 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -63,30 +63,9 @@ /mob/living/carbon/alien/larva proc/handle_mutations_and_radiation() - if(amount_grown == 200) //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 Hunters 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." - src << "\green Sentinels are tasked with protecting the hive and are deadly up close and at a range. They are not as physically imposing nor fast as the hunters." - src << "\green Drones are the working class, offering the largest plasma storage and generation. They are the only caste which may evolve again, turning into the dreaded alien queen." - var/alien_caste = alert(src, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone") - - var/mob/living/carbon/alien/humanoid/new_xeno - switch(alien_caste) - if("Hunter") - new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc) - if("Sentinel") - new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc) - if("Drone") - new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc) - new_xeno.UI = UI - if(mind) mind.transfer_to(new_xeno) - del(src) - return - else - //grow!! but not if metroid or dead - if(health>-100) - amount_grown++ + //grow!! but not if metroid or dead + if(health>-100 && amount_grown < 200) + amount_grown++ if (radiation) if (radiation > 100) diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index 15c02bfb393..2c6d2149147 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -15,4 +15,33 @@ src << text("\green You have stopped hiding.") for(var/mob/O in oviewers(src, null)) if ((O.client && !( O.blinded ))) - O << text("[] slowly peaks up from the ground...", src) \ No newline at end of file + O << text("[] slowly peaks up from the ground...", src) + +/mob/living/carbon/alien/larva/verb/evolve() + set name = "Evolve" + set desc = "Evolve into a fully grown Alien." + set category = "Alien" + + if(amount_grown >= 200) //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 Hunters 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." + src << "\green Sentinels are tasked with protecting the hive and are deadly up close and at a range. They are not as physically imposing nor fast as the hunters." + src << "\green Drones are the working class, offering the largest plasma storage and generation. They are the only caste which may evolve again, turning into the dreaded alien queen." + var/alien_caste = alert(src, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone") + + var/mob/living/carbon/alien/humanoid/new_xeno + switch(alien_caste) + if("Hunter") + new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc) + if("Sentinel") + new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc) + if("Drone") + new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc) + new_xeno.UI = UI + if(mind) mind.transfer_to(new_xeno) + del(src) + return + else + src << "\red You are not fully grown." + return