mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 15:36:56 +01:00
Radiation Update Port
This commit is contained in:
@@ -18,14 +18,13 @@
|
||||
hl3_release_date = _half_life
|
||||
can_contaminate = _can_contaminate
|
||||
|
||||
if(istype(parent, /atom))
|
||||
if(istype(parent, /atom))
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/rad_examine)
|
||||
if(istype(parent, /obj/item))
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/rad_attack)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK_OBJ, .proc/rad_attack)
|
||||
else
|
||||
CRASH("Something that wasn't an atom was given /datum/component/radioactive")
|
||||
return
|
||||
|
||||
if(strength > RAD_MINIMUM_CONTAMINATION)
|
||||
SSradiation.warn(src)
|
||||
@@ -55,13 +54,14 @@
|
||||
if(strength <= RAD_BACKGROUND_RADIATION)
|
||||
return PROCESS_KILL
|
||||
|
||||
|
||||
/datum/component/radioactive/proc/glow_loop(atom/movable/master)
|
||||
var/filter = master.get_filter("rad_glow")
|
||||
if(filter)
|
||||
animate(filter, alpha = 110, time = 15, loop = -1)
|
||||
animate(alpha = 40, time = 25)
|
||||
|
||||
/datum/component/radioactive/InheritComponent(datum/component/C, i_am_original, list/arguments)
|
||||
/datum/component/radioactive/InheritComponent(datum/component/C, i_am_original, _strength, _source, _half_life, _can_contaminate)
|
||||
if(!i_am_original)
|
||||
return
|
||||
if(!hl3_release_date) // Permanently radioactive things don't get to grow stronger
|
||||
@@ -70,9 +70,9 @@
|
||||
var/datum/component/radioactive/other = C
|
||||
strength = max(strength, other.strength)
|
||||
else
|
||||
strength = max(strength, arguments[1])
|
||||
strength = max(strength, _strength)
|
||||
|
||||
/datum/component/radioactive/proc/rad_examine(datum/source, mob/user, atom/thing)
|
||||
/datum/component/radioactive/proc/rad_examine(datum/source, mob/user, list/examine_list)
|
||||
var/atom/master = parent
|
||||
var/list/out = list()
|
||||
if(get_dist(master, user) <= 1)
|
||||
@@ -84,13 +84,16 @@
|
||||
out += "[out ? " and it " : "[master] "]seems to be glowing a bit."
|
||||
if(RAD_AMOUNT_HIGH to INFINITY) //At this level the object can contaminate other objects
|
||||
out += "[out ? " and it " : "[master] "]hurts to look at."
|
||||
else
|
||||
out += "."
|
||||
to_chat(user, out.Join())
|
||||
if(!LAZYLEN(out))
|
||||
return
|
||||
out += "."
|
||||
examine_list += out.Join()
|
||||
|
||||
/datum/component/radioactive/proc/rad_attack(datum/source, atom/movable/target, mob/living/user)
|
||||
radiation_pulse(parent, strength/20)
|
||||
target.rad_act(strength/2)
|
||||
if(!hl3_release_date)
|
||||
return
|
||||
strength -= strength / hl3_release_date
|
||||
|
||||
#undef RAD_AMOUNT_LOW
|
||||
|
||||
Reference in New Issue
Block a user