Files
Bubberstation/code/modules/events/immovable_rod.dm
carnie 6a98fc89d0 >datum/event and datum/event_control were renamed to datum/round_event and datum/round_event_control. This is because datum/event was already used by a different/more-general event queue system (used primarily on mechas)
Removed overriding of event values via feeding in an associative list into datum/round_event/New(). Instead you can do basic initializations (i.e. feed it constants) by doing new /datum/round_event{variablename=5;}(). This method is handled well by the compiler (it's the same method the maps use), so it will detect unrecognized variablenames etc.
More complex initializations for post setup() stuff can be done by accessing variables directly Event.variablename = whatever;
round_events now have a processing variable, which effectively pauses them.
2013-04-08 07:42:46 +01:00

98 lines
2.2 KiB
Plaintext

/*
Immovable rod random event.
The rod will spawn at some location outside the station, and travel in a straight line to the opposite side of the station
Everything solid in the way will be ex_act()'d
In my current plan for it, 'solid' will be defined as anything with density == 1
--NEOFite
*/
/datum/round_event_control/immovable_rod
name = "Immovable Rod"
typepath = /datum/round_event/immovable_rod
max_occurrences = 5
/datum/round_event/immovable_rod
announceWhen = 5
/datum/round_event/immovable_rod/announce()
command_alert("What the fuck was that?!", "General Alert")
/datum/round_event/immovable_rod/start()
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
var/startside = pick(cardinal)
switch(startside)
if(NORTH)
starty = 187
startx = rand(41, 199)
endy = 38
endx = rand(41, 199)
if(EAST)
starty = rand(38, 187)
startx = 199
endy = rand(38, 187)
endx = 41
if(SOUTH)
starty = 38
startx = rand(41, 199)
endy = 187
endx = rand(41, 199)
else
starty = rand(38, 187)
startx = 41
endy = rand(38, 187)
endx = 199
//rod time!
new /obj/effect/immovablerod(locate(startx, starty, 1), locate(endx, endy, 1))
/obj/effect/immovablerod
name = "Immovable Rod"
desc = "What the fuck is that?"
icon = 'icons/obj/objects.dmi'
icon_state = "immrod"
throwforce = 100
density = 1
anchored = 1
var/z_original = 0
var/destination
New(atom/start, atom/end)
loc = start
z_original = z
destination = end
if(end && end.z==z_original)
walk_towards(src, destination, 1)
Move()
if(z != z_original || loc == destination)
spawn(0) del(src)
return ..()
Bump(atom/clong)
if (istype(clong, /turf) && !istype(clong, /turf/unsimulated))
if(clong.density)
clong.ex_act(2)
for (var/mob/O in hearers(src, null))
O.show_message("CLANG", 2)
else if (istype(clong, /obj))
if(clong.density)
clong.ex_act(2)
for (var/mob/O in hearers(src, null))
O.show_message("CLANG", 2)
else if (istype(clong, /mob))
if(clong.density || prob(10))
clong.meteorhit(src)
else
del(src)
if(clong && prob(25))
src.loc = clong.loc