mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
File restructuring: ohgodihopenothingbroke edition.
All /world/ stuff that I've found is now in code/world.dm instead of being scattered throughout the code in 6-7 files. *****IMPORTANT***** This means that hub.dm is now part of world.dm. Server hosts using the hub will likely have to redo the hub/password variables! Again, that stuff is now located in code/world.dm ******************* The tester list has been removed as it is not in use. /code/defines - Moved atom.dm code into /code/game/atom.dm and atom_movable.dm - Moved hub.dm code into /code/world.dm - Moved the /defines/tanning into objects/item/sheets/leather.dm - Moved /defines/area/ into game/area/ - Moved turf.dm code into the code/game/turfs folder and divided it up into meaningful places A lot of the files in /code/game were placed in new areas since they really didn't have a reason to be there. - algorithm.dm: - - The world stuff is in world.dm. - - countJob() and AutoUpdateTK() were removed entirely (unused). - - AutoUpdateAI() is now in /mob/living/silicon/ai.dm - atom_procs.dm was split into atom.dm and atom_movable.dm - cellautomata.dm - - World stuff was moved into world.dm - - Atom stuff was moved into atom.dm and atom_movable.dm - - Atom verbs were moved into code/game/verbs/atom_verbs.dm - chemistry.dm - - Beaker box code was moved into storage/misc.dm - - The trash can and 'alechemy' paper were removed. (unused) - Landmarks.dm was moved into /objects/effects/landmarks.dm - prisonshuttle.dm, specops_shuttle.dm, syndicate_shuttle.dm and syndicate_specops_shuttle.dm have been moved into game/machinery/computer/ - status.dm and topic.dm code were moved into world.dm - step_triggers.dm are now in objects/effects/step_triggers.dm - throwing.dm was split into appropriate files (carbon mob code, atom_movable.dm, ect) - vote.dm is now in code/datums /code/game/asteroid was split up. - turf.dm was moved into game/turfs/simulated/asteroid.dm - artifacts were split up - - Wish granter is now in game/machinery - - The stealth box is gone (unused) - - The list of 'space suprises' was moved into astroid.dm - asteroid.dm, being the only file left, was moved into /code/game and finally... modules/mob/organs files are now in code/datums/organs git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4659 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
117
code/game/objects/effects/step_triggers.dm
Normal file
117
code/game/objects/effects/step_triggers.dm
Normal file
@@ -0,0 +1,117 @@
|
||||
/* Simple object type, calls a proc when "stepped" on by something */
|
||||
|
||||
/obj/effect/step_trigger
|
||||
var/affect_ghosts = 0
|
||||
var/stopper = 1 // stops throwers
|
||||
invisibility = 101 // nope cant see this shit
|
||||
anchored = 1
|
||||
|
||||
/obj/effect/step_trigger/proc/Trigger(var/atom/movable/A)
|
||||
return 0
|
||||
|
||||
/obj/effect/step_trigger/HasEntered(H as mob|obj)
|
||||
..()
|
||||
if(!H)
|
||||
return
|
||||
if(istype(H, /mob/dead/observer) && !affect_ghosts)
|
||||
return
|
||||
Trigger(H)
|
||||
|
||||
|
||||
|
||||
/* Tosses things in a certain direction */
|
||||
|
||||
/obj/effect/step_trigger/thrower
|
||||
var/direction = SOUTH // the direction of throw
|
||||
var/tiles = 3 // if 0: forever until atom hits a stopper
|
||||
var/immobilize = 1 // if nonzero: prevents mobs from moving while they're being flung
|
||||
var/speed = 1 // delay of movement
|
||||
var/facedir = 0 // if 1: atom faces the direction of movement
|
||||
var/nostop = 0 // if 1: will only be stopped by teleporters
|
||||
var/list/affecting = list()
|
||||
|
||||
Trigger(var/atom/A)
|
||||
if(!A || !istype(A, /atom/movable))
|
||||
return
|
||||
var/atom/movable/AM = A
|
||||
var/curtiles = 0
|
||||
var/stopthrow = 0
|
||||
for(var/obj/effect/step_trigger/thrower/T in orange(2, src))
|
||||
if(AM in T.affecting)
|
||||
return
|
||||
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(immobilize)
|
||||
M.canmove = 0
|
||||
|
||||
affecting.Add(AM)
|
||||
while(AM && !stopthrow)
|
||||
if(tiles)
|
||||
if(curtiles >= tiles)
|
||||
break
|
||||
if(AM.z != src.z)
|
||||
break
|
||||
|
||||
curtiles++
|
||||
|
||||
sleep(speed)
|
||||
|
||||
// Calculate if we should stop the process
|
||||
if(!nostop)
|
||||
for(var/obj/effect/step_trigger/T in get_step(AM, direction))
|
||||
if(T.stopper && T != src)
|
||||
stopthrow = 1
|
||||
else
|
||||
for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, direction))
|
||||
if(T.stopper)
|
||||
stopthrow = 1
|
||||
|
||||
if(AM)
|
||||
var/predir = AM.dir
|
||||
step(AM, direction)
|
||||
if(!facedir)
|
||||
AM.dir = predir
|
||||
|
||||
|
||||
|
||||
affecting.Remove(AM)
|
||||
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(immobilize)
|
||||
M.canmove = 1
|
||||
|
||||
/* Stops things thrown by a thrower, doesn't do anything */
|
||||
|
||||
/obj/effect/step_trigger/stopper
|
||||
|
||||
/* Instant teleporter */
|
||||
|
||||
/obj/effect/step_trigger/teleporter
|
||||
var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!)
|
||||
var/teleport_y = 0
|
||||
var/teleport_z = 0
|
||||
|
||||
Trigger(var/atom/movable/A)
|
||||
if(teleport_x && teleport_y && teleport_z)
|
||||
|
||||
A.x = teleport_x
|
||||
A.y = teleport_y
|
||||
A.z = teleport_z
|
||||
|
||||
/* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */
|
||||
|
||||
/obj/effect/step_trigger/teleporter/random
|
||||
var/teleport_x_offset = 0
|
||||
var/teleport_y_offset = 0
|
||||
var/teleport_z_offset = 0
|
||||
|
||||
Trigger(var/atom/movable/A)
|
||||
if(teleport_x && teleport_y && teleport_z)
|
||||
if(teleport_x_offset && teleport_y_offset && teleport_z_offset)
|
||||
|
||||
A.x = rand(teleport_x, teleport_x_offset)
|
||||
A.y = rand(teleport_y, teleport_y_offset)
|
||||
A.z = rand(teleport_z, teleport_z_offset)
|
||||
|
||||
Reference in New Issue
Block a user