From 0ae0d1cfd144fd64b2c79f2b5e729c48872b518a Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Wed, 6 Mar 2019 10:59:54 +0100 Subject: [PATCH] Slight rewrite of grub code Now tracks its own powerdraw. Also adding some previously hardcoded values onto the mob to be able to be dynamicly modified as well as redefined for subspecies --- .../mob/living/simple_animal/vore/solargrub.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/simple_animal/vore/solargrub.dm b/code/modules/mob/living/simple_animal/vore/solargrub.dm index 6e34a1c2d1..3e93603b1e 100644 --- a/code/modules/mob/living/simple_animal/vore/solargrub.dm +++ b/code/modules/mob/living/simple_animal/vore/solargrub.dm @@ -17,7 +17,9 @@ List of things solar grubs should be able to do: icon_state = "solargrub" icon_living = "solargrub" icon_dead = "solargrub-dead" - + + var/charge = null //CHOMPEDIT The amount of power we sucked off, in K as in THOUSANDS. + faction = "grubs" maxHealth = 50 //grubs can take a lot of harm health = 50 @@ -54,6 +56,10 @@ List of things solar grubs should be able to do: var/obj/structure/cable/attached // the attached cable var/emp_chance = 20 // Beware synths + //VARS that were previously in LIFE but why tho, im porting all comments the original coder did too. + var/apc_drain_rate = 750 //Going to see if grubs are better as a minimal bother. previous value : 4000 + var/powerdraw = 100000 // previous value 150000 + /mob/living/simple_animal/retaliate/solargrub/PunchTarget() if(target_mob&& prob(emp_chance)) target_mob.emp_act(4) //The weakest strength of EMP @@ -77,8 +83,8 @@ List of things solar grubs should be able to do: sparks.start() anchored = 1 PN = attached.powernet - PN.draw_power(100000) // previous value 150000 - var/apc_drain_rate = 750 //Going to see if grubs are better as a minimal bother. previous value : 4000 + PN.draw_power(powerdraw) + charge = charge + powerdraw/1000 //This adds raw powerdraw to charge(Charge is in Ks as in 1 = 1000) for(var/obj/machinery/power/terminal/T in PN.nodes) if(istype(T.master, /obj/machinery/power/apc)) var/obj/machinery/power/apc/A = T.master