On forum: 06/19/2012
Message edited by:
Constant anti-rad effect?|
I'm looking to make an item, when it's present in the inventory, gives a constant anti-rad effect (it's not an artifact, just an "invisible" item that reduces radiation per second
I've been looking through various scripts (mainly dmx_medicines.script from DMX) and found a likely looking function but I'm unsure how to make it reduce radiation by the amount I'd like:
local last_rad_health = 1
if db.actor:object("remove_radr") then
local sub = db.actor.radiation - last_rad_health
if sub>0 then db.actor.radiation = -sub*0.95 end
last_rad_health = db.actor.radiation
This is pretty much a snippet of what I have at the moment, using the update callback so it should be constantly working, but it doesn't seem to be reducing radiation at all.
Anyone have any ideas?