diff --git a/code/defines/area/Space Station 13 areas.dm b/code/defines/area/Space Station 13 areas.dm index 50906021288..642c22d770b 100644 --- a/code/defines/area/Space Station 13 areas.dm +++ b/code/defines/area/Space Station 13 areas.dm @@ -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" diff --git a/code/defines/area/area.dm b/code/defines/area/area.dm new file mode 100644 index 00000000000..32abd000043 --- /dev/null +++ b/code/defines/area/area.dm @@ -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) + + diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 1a713a92706..89ffb22063c 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -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 = "" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 2b541c16587..ce9bb226371 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -27,6 +27,7 @@ power_light = 0 power_equip = 0 power_environ = 0 + has_gravity = 0 if(!requires_power) power_light = 0//rastaf0 @@ -39,6 +40,9 @@ area_lights_luminosity = rand(6,9) //sd_SetLuminosity(0) // *DAL* + if(is_type_in_list(src, the_station_areas)) + has_gravity = 1 + /*spawn(5) for(var/turf/T in src) // count the number of turfs (for lighting calc) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index f11fa5f00f7..83a51bea6eb 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1060,6 +1060,12 @@ About the new airlock wires panel: M.adjustBruteLoss(DOOR_CRUSH_DAMAGE) M.SetStunned(5) M.SetWeakened(5) + var/obj/special/stop/S + S = new /obj/special/stop + S.victim = M + S.loc = src.loc + spawn(20) + del(S) M.emote("scream") var/turf/location = src.loc if(istype(location, /turf/simulated)) @@ -1087,4 +1093,4 @@ About the new airlock wires panel: src.locked = 0 src.open() src.locked = 1 - return \ No newline at end of file + return diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 00f4be60074..e17849799b3 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -147,10 +147,16 @@ if(W.loc == my_target) break sleep(2) - if(istype(usr.loc, /turf/space)|| (user.flags & NOGRAV)) + var/area/a = get_area(usr.loc) + if((istype(src.loc, /turf/space)) || (a.has_gravity == 0)) user.inertia_dir = get_dir(target, user) step(user, user.inertia_dir) + /* + if(istype(usr.loc, /turf/space)|| (user.flags & NOGRAV)) + user.inertia_dir = get_dir(target, user) + step(user, user.inertia_dir) + */ else return ..() return diff --git a/code/game/sound.dm b/code/game/sound.dm index 9a67475901a..8f62c5886dc 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -70,44 +70,3 @@ client/verb/Toggle_Soundscape() return -/area/Entered(A) - var/sound = null - var/musVolume = 25 - sound = 'ambigen1.ogg' - - if (ismob(A)) - - if (istype(A, /mob/dead/observer)) return - if (!A:client) return - //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 diff --git a/code/game/throwing.dm b/code/game/throwing.dm index 12e7696f912..a781481cc2f 100644 --- a/code/game/throwing.dm +++ b/code/game/throwing.dm @@ -65,9 +65,20 @@ src.visible_message("\red [src] has thrown [item].") + var/area/a = get_area(src.loc) + if((istype(src.loc, /turf/space)) || (a.has_gravity == 0)) + src.inertia_dir = get_dir(target, src) + step(src, inertia_dir) + + +/* if(istype(src.loc, /turf/space) || (src.flags & NOGRAV)) //they're in space, move em one space in the opposite direction src.inertia_dir = get_dir(target, src) step(src, inertia_dir) +*/ + + + item.throw_at(target, item.throw_range, item.throw_speed) @@ -150,9 +161,13 @@ dy = SOUTH var/dist_travelled = 0 var/dist_since_sleep = 0 + var/area/a = get_area(src.loc) if(dist_x > dist_y) var/error = dist_x/2 - dist_y - while(((((src.x < target.x && dx == EAST) || (src.x > target.x && dx == WEST)) && dist_travelled < range) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf)) + + + + while(((((src.x < target.x && dx == EAST) || (src.x > target.x && dx == WEST)) && dist_travelled < range) || (a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf)) // only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up if(error < 0) var/atom/step = get_step(src, dy) @@ -178,9 +193,11 @@ if(dist_since_sleep >= speed) dist_since_sleep = 0 sleep(1) + + a = get_area(src.loc) else var/error = dist_y/2 - dist_x - while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf)) + while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf)) // only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up if(error < 0) var/atom/step = get_step(src, dx) @@ -207,6 +224,8 @@ dist_since_sleep = 0 sleep(1) + a = get_area(src.loc) + //done throwing, either because it hit something or it finished moving src.throwing = 0 if(isobj(src)) src:throw_impact(get_turf(src)) diff --git a/code/game/turf.dm b/code/game/turf.dm index 9e412cccf23..795d316aee2 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -82,8 +82,18 @@ /turf/Entered(atom/movable/M as mob|obj) var/loopsanity = 10 if(ismob(M)) + + var/area/a = get_area(M.loc) + if(a.has_gravity == 0) + inertial_drift(M) + + /* if(M.flags & NOGRAV) inertial_drift(M) + */ + + + else if(!istype(src, /turf/space)) M:inertia_dir = 0 ..() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 5da2ffcbdc6..967677fb0b3 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -169,6 +169,8 @@ verbs += /client/proc/Blobize//I need to remember to move/remove this later verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the enw clickproc is being tested) verbs += /client/proc/cmd_switch_radio // BEEP BOOP FARTE -- Doohl + verbs += /client/proc/toggle_gravity_on + verbs += /client/proc/toggle_gravity_off if (holder.level >= 4)//Badmin******************************************************************** verbs += /obj/admins/proc/adrev //toggle admin revives @@ -395,6 +397,8 @@ verbs -= /client/proc/toggle_hear_radio verbs -= /client/proc/tension_report verbs -= /client/proc/player_panel_new + verbs -= /client/proc/toggle_gravity_on + verbs -= /client/proc/toggle_gravity_off return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9860d8f4c99..f5333a2e552 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -846,4 +846,36 @@ Traitors and the like can also be revived with the previous role mostly intact. ticker.random_players = 1 +/client/proc/toggle_gravity_on() + set category = "Debug" + set name = "Toggle station gravity on" + set desc = "Toggles all gravity to active on the station." + + if (!(ticker && ticker.mode)) + usr << "Please wait until the game starts! Not sure how it will work otherwise." + return + + + for(var/area/A in world) + A.has_gravity = 1 + + command_alert("CentComm is now beaming gravitons to your station. We appoligize for any inconvience.") + +/client/proc/toggle_gravity_off() + set category = "Debug" + set name = "Toggle station gravity off" + set desc = "Toggles all gravity to inactive on the station." + + if (!(ticker && ticker.mode)) + usr << "Please wait until the game starts! Not sure how it will work otherwise." + return + + + for(var/area/A in world) + A.has_gravity = 0 + + command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.") + + + diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index fddbec0aeb7..b8d6bc87254 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -249,4 +249,7 @@ the mob is also allowed to move without any sort of restriction. For instance, i // var/obj/effect/organstructure/organStructure = null //for dem organs var/canstun = 1 // determines if this mob can be stunned by things - var/canweaken = 1 // determines if this mob can be weakened/knocked down by things \ No newline at end of file + var/canweaken = 1 // determines if this mob can be weakened/knocked down by things + + + var/area/lastarea = null \ No newline at end of file diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index c7a21436b65..b0de1b92b6c 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -133,6 +133,7 @@ /client/Move(n, direct) + if(mob.control_object) Move_object(direct) if(isobserver(mob)) return mob.Move(n,direct) @@ -143,6 +144,11 @@ if(!mob) return + if(locate(/obj/special/stop/, mob.loc)) + for(var/obj/special/stop/S in mob.loc) + if(S.victim == mob) + return + if(mob.stat==2) return if(isAI(mob)) return AIMove(n,direct,mob) @@ -157,9 +163,14 @@ if(!mob.canmove) return - if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV)) + //if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV)) + // if(!mob.Process_Spacemove(0)) return 0 + + var/area/a = get_area(mob.loc) + if((istype(mob.loc, /turf/space)) || (a.has_gravity == 0)) if(!mob.Process_Spacemove(0)) return 0 + if(isobj(mob.loc) || ismob(mob.loc))//Inside an object, tell it we moved var/atom/O = mob.loc return O.relaymove(mob, direct) @@ -325,8 +336,25 @@ for(var/turf/turf in oview(1,src)) if(istype(turf,/turf/space)) continue + + + var/area/a = get_area(turf) + + if(istype(src,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to. + if((istype(turf,/turf/simulated/floor)) && (a.has_gravity == 0) && !(istype(src:shoes, /obj/item/clothing/shoes/magboots) && (src:shoes:flags & NOSLIP))) + continue + + + else + if((istype(turf,/turf/simulated/floor)) && (a.has_gravity == 0)) // No one else gets a chance. + continue + + /* if(istype(turf,/turf/simulated/floor) && (src.flags & NOGRAV)) continue + */ + + dense_object++ break diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 957235ecbf0..382dbe4cc68 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -26,6 +26,7 @@ var/starting_loc = pick(newplayer_start) if(!starting_loc) starting_loc = locate(1,1,1) loc = starting_loc + sight |= SEE_TURFS var/list/watch_locations = list() @@ -247,6 +248,7 @@ job_master.AssignRole(character, rank, 1) job_master.EquipRank(character, rank, 1) character.loc = pick(latejoin) + character.lastarea = get_area(loc) AnnounceArrival(character, rank) if(character.mind.assigned_role != "Cyborg") @@ -347,6 +349,7 @@ proc/create_character() spawning = 1 var/mob/living/carbon/human/new_character = new(loc) + new_character.lastarea = get_area(loc) close_spawn_windows() diff --git a/code/setup.dm b/code/setup.dm index b12e461cbaa..9fb30cd42b8 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -137,7 +137,6 @@ #define NOJAUNT 1 //Cant seem to find a mob bitflags area other than the powers one -#define NOGRAV 1 // bitflags for clothing parts diff --git a/tgstation.dme b/tgstation.dme index 77eafcfb6e0..7f6340f6b34 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -162,6 +162,7 @@ #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" +#define FILE_DIR "maps/backup" #define FILE_DIR "sound" #define FILE_DIR "sound/ambience" #define FILE_DIR "sound/announcer" @@ -269,6 +270,7 @@ #include "code\defines\obj.dm" #include "code\defines\turf.dm" #include "code\defines\world.dm" +#include "code\defines\area\area.dm" #include "code\defines\area\Space Station 13 areas.dm" #include "code\defines\mob\dead\observer.dm" #include "code\defines\mob\living\living.dm"