mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 11:32:20 +00:00
* Initial work * more * ass * wsedfwedff * asss * test * stuff * fuck * sss a * kms * asdadwedwdfwefwef * start * test * dwwdew * ewefwfef * Redemption machine (#8) * Redemption machine * Removes debug messages * changes * fuckmyshitup * coin mint works with new material shenanigans (#10) * Auto stash before merge of "materials" and "origin/materials" * woops * furnace (#11) * autolathe manufacturing of toolboxes * eggs in a basket * some small changes * matcolors * documentation * more documentation and effects * done * Color man bad (#12) * fixes designs * ass * more fixes * fuck me * firestacks adder * epic fixes * fixes designs * DONE DIDDILY DOO * removes category macro * ch-ch-ch-changes * fixes some stuff * Fixes display of ore values (#9) * Redemption machine * Removes debug messages * Re-adds value display * Replaces the fire stacking component with an element instead (#13) * fixes examine * fixes ligma bugs * double ligma boofus * fix * misses some defines * fixes ORM * Update code/datums/components/material_container.dm Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com> * fixes * Makes glass objects weaker (#14) * Makes glass objects weaker * uses correct proc * fixes shit * honk honk * better * oh shit oh fuck * fixes * fuck ORMs * fixes the biogen * documentation * ass (#15) * component * changes * ass * ass * doc * Auto stash before merge of "materials-plasmacomponent" and "origin/materials-plasmacomponent" * fixes rounding * fixed
86 lines
2.6 KiB
Plaintext
86 lines
2.6 KiB
Plaintext
#define RAD_AMOUNT_LOW 50
|
|
#define RAD_AMOUNT_MEDIUM 200
|
|
#define RAD_AMOUNT_HIGH 500
|
|
#define RAD_AMOUNT_EXTREME 1000
|
|
|
|
/datum/component/radioactive
|
|
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
|
|
|
var/source
|
|
|
|
var/hl3_release_date //the half-life measured in ticks
|
|
var/strength
|
|
var/can_contaminate
|
|
|
|
/datum/component/radioactive/Initialize(_strength=0, _source, _half_life=RAD_HALF_LIFE, _can_contaminate=TRUE)
|
|
strength = _strength
|
|
source = _source
|
|
hl3_release_date = _half_life
|
|
can_contaminate = _can_contaminate
|
|
|
|
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
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
if(strength > RAD_MINIMUM_CONTAMINATION)
|
|
SSradiation.warn(src)
|
|
|
|
START_PROCESSING(SSradiation, src)
|
|
|
|
/datum/component/radioactive/Destroy()
|
|
STOP_PROCESSING(SSradiation, src)
|
|
return ..()
|
|
|
|
/datum/component/radioactive/process()
|
|
if(!prob(50))
|
|
return
|
|
radiation_pulse(parent, strength, RAD_DISTANCE_COEFFICIENT*2, FALSE, can_contaminate)
|
|
|
|
if(!hl3_release_date)
|
|
return
|
|
strength -= strength / hl3_release_date
|
|
if(strength <= RAD_BACKGROUND_RADIATION)
|
|
return PROCESS_KILL
|
|
|
|
/datum/component/radioactive/InheritComponent(datum/component/C, i_am_original, list/arguments)
|
|
if(!i_am_original)
|
|
return
|
|
if(!hl3_release_date) // Permanently radioactive things don't get to grow stronger
|
|
return
|
|
if(C)
|
|
var/datum/component/radioactive/other = C
|
|
strength = max(strength, other.strength)
|
|
else
|
|
strength = max(strength, arguments[1])
|
|
|
|
/datum/component/radioactive/proc/rad_examine(datum/source, mob/user, atom/thing)
|
|
var/atom/master = parent
|
|
var/list/out = list()
|
|
if(get_dist(master, user) <= 1)
|
|
out += "The air around [master] feels warm"
|
|
switch(strength)
|
|
if(RAD_AMOUNT_LOW to RAD_AMOUNT_MEDIUM)
|
|
out += "[out ? " and it " : "[master] "]feels weird to look at."
|
|
if(RAD_AMOUNT_MEDIUM to RAD_AMOUNT_HIGH)
|
|
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())
|
|
|
|
/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
|
|
#undef RAD_AMOUNT_MEDIUM
|
|
#undef RAD_AMOUNT_HIGH
|
|
#undef RAD_AMOUNT_EXTREME |