Files
Polaris/code/modules/events/radiation_storm.dm
Neerti 12abb2d6f2 Ports a large chunk of the map datum system that europa/bay uses.
Links many map-specific details such as the station name, z-level information, and allowed jobs from global vars to map datum vars, which should help us maintain multiple maps at once in the future, which will be needed for the future Southern Cross.
Note that a config change will be needed to change GENERATE_ASTEROID to GENERATE_MAP, otherwise no changes should be required to continue normal map usage.
To change to a different map, it's suggested to tick the file that ticks all the other needed files, which for the Northern Star is called northern_star.dm.
2017-02-27 07:36:41 -05:00

59 lines
2.0 KiB
Plaintext

/datum/event/radiation_storm
var/const/enterBelt = 30
var/const/radIntervall = 5 // Enough time between enter/leave belt for 10 hits, as per original implementation
var/const/leaveBelt = 80
var/const/revokeAccess = 135
startWhen = 2
announceWhen = 1
endWhen = revokeAccess
var/postStartTicks = 0
/datum/event/radiation_storm/announce()
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
/datum/event/radiation_storm/start()
make_maint_all_access()
/datum/event/radiation_storm/tick()
if(activeFor == enterBelt)
command_announcement.Announce("The station has entered the radiation belt. Please remain in a sheltered area until we have passed the radiation belt.", "Anomaly Alert")
radiate()
if(activeFor >= enterBelt && activeFor <= leaveBelt)
postStartTicks++
if(postStartTicks == radIntervall)
postStartTicks = 0
radiate()
else if(activeFor == leaveBelt)
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
/datum/event/radiation_storm/proc/radiate()
for(var/mob/living/carbon/C in living_mob_list)
var/area/A = get_area(C)
if(!A)
continue
if(!(A.z in using_map.station_levels))
continue
if(A.flags & RAD_SHIELDED)
continue
if(istype(C,/mob/living/carbon/human))
var/mob/living/carbon/human/H = C
H.apply_effect((rand(15,35)),IRRADIATE,0)
if(prob(5))
H.apply_effect((rand(40,70)),IRRADIATE,0)
if (prob(75))
randmutb(H) // Applies bad mutation
domutcheck(H,null,MUTCHK_FORCED)
else
randmutg(H) // Applies good mutation
domutcheck(H,null,MUTCHK_FORCED)
/datum/event/radiation_storm/end()
revoke_maint_all_access()
/datum/event/radiation_storm/syndicate/radiate()
return