/datum/radiation_wave var/source var/turf/master_turf //The center of the wave var/steps=0 //How far we've moved var/intensity //How strong it was originaly var/remaining_contam //How much contaminated material it still has var/range_modifier //Higher than 1 makes it drop off faster, 0.5 makes it drop off half etc var/move_dir //The direction of movement var/list/__dirs //The directions to the side of the wave, stored for easy looping var/can_contaminate /datum/radiation_wave/New(atom/_source, dir, _intensity=0, _range_modifier=RAD_DISTANCE_COEFFICIENT, _can_contaminate=TRUE) source = _source master_turf = get_turf(_source) move_dir = dir __dirs = list() __dirs+=turn(dir, 90) __dirs+=turn(dir, -90) intensity = _intensity remaining_contam = intensity range_modifier = _range_modifier can_contaminate = _can_contaminate START_PROCESSING(SSradiation, src) /datum/radiation_wave/Destroy() . = QDEL_HINT_IWILLGC STOP_PROCESSING(SSradiation, src) ..() /datum/radiation_wave/process() master_turf = get_step(master_turf, move_dir) if(!master_turf) qdel(src) return steps++ var/list/atoms = get_rad_atoms() var/strength if(steps>1) strength = INVERSE_SQUARE(intensity, max(range_modifier*steps, 1), 1) else strength = intensity if(strength= RAD_MINIMUM_CONTAMINATION var/list/contam_atoms = list() for(var/k in 1 to atoms.len) var/atom/thing = atoms[k] if(!thing) continue thing.rad_act(strength) // This list should only be for types which don't get contaminated but you want to look in their contents // If you don't want to look in their contents and you don't want to rad_act them: // modify the ignored_things list in __HELPERS/radiation.dm instead var/static/list/blacklisted = typecacheof(list( /turf, /mob, /obj/structure/cable, /obj/machinery/atmospherics, /obj/item/ammo_casing, /obj/singularity )) if(!can_contaminate || blacklisted[thing.type]) continue if(CHECK_BITFIELD(thing.rad_flags, RAD_NO_CONTAMINATE) || SEND_SIGNAL(thing, COMSIG_ATOM_RAD_CONTAMINATING, strength) & COMPONENT_BLOCK_CONTAMINATION) continue contam_atoms += thing var/did_contam = 0 if(can_contam && contam_atoms.len) var/rad_strength = ((strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT)/contam_atoms.len for(var/A in contam_atoms) var/atom/thing = A thing.AddComponent(/datum/component/radioactive, rad_strength, source) did_contam = 1 return did_contam