Adds a new special object (stop) that can be used when you need someone to stop moving right away, even before the next life(). Used in door crushing to prevent people from inertiaing through. Checks for /obj/special/stop in loc every move. Compared to the number of other checks, I don't expect this to be an undo burden, but can be commented out in case of OH SHIT LAG under heavy load.

Moves /area/entered to its own file.  
Adds a new area var called has_gravity.  Determines if floor tiles count for movement control (planning on adding more, currently can only be badmined)
Adds a new mob var called lastarea that is updated with the area you're in every time /area/entered is called. 

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2917 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
VivianFoxfoot@gmail.com
2012-01-06 06:24:55 +00:00
parent 2ea375091e
commit 8730d375cf
16 changed files with 216 additions and 48 deletions
@@ -34,6 +34,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/requires_power = 1
var/always_unpowered = 0 //this gets overriden to 1 for space in area/New()
var/power_equip = 1
var/power_light = 1
var/power_environ = 1
@@ -42,6 +43,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/used_light = 0
var/used_environ = 0
var/has_gravity = 1
var/no_air = null
var/area/master // master area used for power calcluations
@@ -291,6 +293,7 @@ proc/process_ghost_teleport_locs()
requires_power = 0
luminosity = 1
sd_lighting = 0
has_gravity = 1
// === end remove
@@ -1306,6 +1309,8 @@ var/list/the_station_areas = list (
)
/area/beach
name = "Keelin's private beach"
icon_state = "null"
+81
View File
@@ -0,0 +1,81 @@
/area/Entered(A)
var/sound = null
var/musVolume = 25
sound = 'ambigen1.ogg'
if (ismob(A))
if (istype(A, /mob/dead/observer)) return
if (!A:ckey)
return
if(istype(A,/mob/living))
if(!A:lastarea)
A:lastarea = get_area(A:loc)
//world << "Entered new area [get_area(A:loc)]"
var/area/newarea = get_area(A:loc)
var/area/oldarea = A:lastarea
if((oldarea.has_gravity == 0) && (newarea.has_gravity == 1) && (A:m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together.
thunk(A)
A:lastarea = newarea
//if (A:ear_deaf) return
if (A && A:client && !A:client:ambience_playing && !A:client:no_ambi) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas next to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
A:client:ambience_playing = 1
A << sound('shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
switch(src.name)
if ("Chapel") sound = pick('ambicha1.ogg','ambicha2.ogg','ambicha3.ogg','ambicha4.ogg')
if ("Morgue") sound = pick('ambimo1.ogg','ambimo2.ogg','title2.ogg')
if ("Space") sound = pick('ambispace.ogg','title2.ogg',)
if ("Engine Control") sound = pick('ambisin1.ogg','ambisin2.ogg','ambisin3.ogg','ambisin4.ogg')
if ("Atmospherics") sound = pick('ambiatm1.ogg')
if ("AI Sat Ext") sound = pick('ambiruntime.ogg','ambimalf.ogg')
if ("AI Satellite") sound = pick('ambimalf.ogg')
if ("AI Satellite Teleporter Room") sound = pick('ambiruntime.ogg','ambimalf.ogg')
if ("Bar") sound = pick('null.ogg')
if ("AI Upload Foyer") sound = pick('ambimalf.ogg', 'null.ogg')
if ("AI Upload Chamber") sound = pick('ambimalf.ogg','null.ogg')
if ("Mine")
sound = pick('ambimine.ogg')
musVolume = 25
else
sound = pick('ambiruntime.ogg','ambigen1.ogg','ambigen3.ogg','ambigen4.ogg','ambigen5.ogg','ambigen6.ogg','ambigen7.ogg','ambigen8.ogg','ambigen9.ogg','ambigen10.ogg','ambigen11.ogg','ambigen12.ogg','ambigen14.ogg')
if (prob(35))
if(A && A:client && !A:client:played)
A << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1)
A:client:played = 1
spawn(600)
if(A && A:client)
A:client:played = 0
/area/proc/thunk(mob)
if(istype(src,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to.
if((istype(mob:shoes, /obj/item/clothing/shoes/magboots) && (mob:shoes.flags & NOSLIP)))
return
if((istype(src,/mob/living/carbon/human/)) && (mob:m_intent == "run")) // Only clumbsy humans can fall on their asses.
mob:AdjustStunned(5)
mob:AdjustWeakened(5)
else if (istype(src,/mob/living/carbon/human/))
mob:AdjustStunned(2)
mob:AdjustWeakened(2)
mob << "Gravity!"
/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
A.has_gravity = gravitystate
if(gravitystate)
for(var/mob/living/M in A)
thunk(A)
+7
View File
@@ -1206,3 +1206,10 @@
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
user.drop_item()
src.throw_at(target, throw_range, throw_speed)
/obj/special/stop
var/victim = null
icon_state = "empty"
name = "Geas"
desc = "You can't resist."
// name = ""