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
This commit is contained in:
Sharkmare
2019-03-06 10:59:54 +01:00
committed by GitHub
parent 0bbea24075
commit 0ae0d1cfd1
@@ -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