Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tgstation/-tg-station
Browse files Browse the repository at this point in the history
Resolved Conflicts:
	code/controllers/shuttle_controller.dm
	code/game/gamemodes/nuclear/nuclear.dm
	code/game/gamemodes/revolution/revolution.dm
	code/game/jobs/access.dm
	code/game/jobs/job/captain.dm
	code/game/machinery/computer/communications.dm
	html/changelog.html
	ministation.dme
  • Loading branch information
Giacom committed Sep 29, 2013
2 parents 5e19ba2 + c219c9e commit 951c60e
Show file tree
Hide file tree
Showing 374 changed files with 25,141 additions and 7,092 deletions.
12 changes: 12 additions & 0 deletions code/ATMOSPHERICS/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,15 @@
initial_loc.air_vent_names -= id_tag
..()
return

/*
Alt-click to ventcrawl - Monkeys, aliens, and slimes
This is a little buggy but somehow that just seems to plague ventcrawl.
I am sorry, I don't know why.
*/
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML)
if(!istype(ML))
return
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl)
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
ML.handle_ventcrawl(src)
81 changes: 30 additions & 51 deletions code/ATMOSPHERICS/pipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -484,31 +484,7 @@ obj/machinery/atmospherics/pipe

attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/device/analyzer) && get_dist(user, src) <= 1)
for (var/mob/O in viewers(user, null))
O << "\red [user] has used the analyzer on \icon[icon]"

var/pressure = parent.air.return_pressure()
var/total_moles = parent.air.total_moles()

user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)
var/o2_concentration = parent.air.oxygen/total_moles
var/n2_concentration = parent.air.nitrogen/total_moles
var/co2_concentration = parent.air.carbon_dioxide/total_moles
var/plasma_concentration = parent.air.toxins/total_moles

var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)

user << "\blue Pressure: [round(pressure,0.1)] kPa"
user << "\blue Nitrogen: [round(n2_concentration*100)]%"
user << "\blue Oxygen: [round(o2_concentration*100)]%"
user << "\blue CO2: [round(co2_concentration*100)]%"
user << "\blue Plasma: [round(plasma_concentration*100)]%"
if(unknown_concentration>0.01)
user << "\red Unknown: [round(unknown_concentration*100)]%"
user << "\blue Temperature: [round(parent.air.temperature-T0C)]&deg;C"
else
user << "\blue Tank is empty!"
atmosanalyzer_scan(parent.air, user)

vent
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
Expand Down Expand Up @@ -831,30 +807,33 @@ obj/machinery/atmospherics/pipe
obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
return ..()
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
return ..()
if (!istype(W, /obj/item/weapon/wrench))
else if (istype(src, /obj/machinery/atmospherics/pipe/vent))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
del(meter)
del(src)
else if (istype(W, /obj/item/weapon/wrench))
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to unfasten \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
del(meter)
del(src)
else if (istype(W, /obj/item/device/analyzer) && get_dist(user, src) <= 1)
atmosanalyzer_scan(parent.air, user)
else
return ..()
14 changes: 8 additions & 6 deletions code/WorkInProgress/buildmode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
dir = NORTHWEST
if(NORTHWEST)
dir = NORTH
return
return 1

/obj/effect/bmode/buildhelp
icon = 'icons/misc/buildmode.dmi'
Expand Down Expand Up @@ -95,14 +95,15 @@
usr << "\blue Left Mouse Button on turf/obj/mob = Throw"
usr << "\blue Right Mouse Button on turf/obj/mob = Select"
usr << "\blue ***********************************************************"
return
return 1

/obj/effect/bmode/buildquit
icon_state = "buildquit"
screen_loc = "NORTH,WEST+3"

Click()
togglebuildmode(master.cl.mob)
return 1

/obj/effect/bmode/buildholder
density = 0
Expand Down Expand Up @@ -142,7 +143,7 @@
else if(pa.Find("right"))
switch(master.cl.buildmode)
if(1)
return
return 1
if(2)
objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
var/P = text2path(objholder)
Expand All @@ -157,9 +158,9 @@

master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
return
return 1
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
if(!thetype) return
if(!thetype) return 1
switch(thetype)
if("text")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
Expand All @@ -171,9 +172,10 @@
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
if("turf-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
return 1


/proc/build_click(var/mob/user, buildmode, location, control, params, var/obj/object)
/proc/build_click(var/mob/user, buildmode, params, var/obj/object)
var/obj/effect/bmode/buildholder/holder = null
for(var/obj/effect/bmode/buildholder/H)
if(H.cl == user.client)
Expand Down
6 changes: 3 additions & 3 deletions code/__DEFINES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.

#define TABLEPASS 2 // can pass by a table or rack
#define TABLEPASS 2 // can pass by a table or rack ~ apparently actually unused, uses pass_flags instead

#define MASKINTERNALS 8 // mask allows internals
//#define SUITSPACE 8 // suit protects against space

#define USEDELAY 16 // 1 second extra delay on use (Can be used once every 2s)
#define NODELAY 32768 // 1 second attackby delay skipped (Can be used once every 0.2s). Most objects have a 1s attackby delay, which doesn't require a flag.
#define USEDELAY 16 // For adding extra delay to heavy items, not currently used
#define NOSHIELD 32 // weapon not affected by shield
#define CONDUCT 64 // conducts electricity (metal etc.)
#define FPRINT 256 // takes a fingerprint
#define ON_BORDER 512 // item has priority to check when entering or leaving
#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()

#define GLASSESCOVERSEYES 1024
#define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags
Expand Down
6 changes: 6 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ proc/isInSight(var/atom/A, var/atom/B)
else
return get_step(start, EAST)

/proc/try_move_adjacent(atom/movable/AM)
var/turf/T = get_turf(AM)
for(var/direction in cardinal)
if(AM.Move(get_step(T, direction)))
break

/proc/get_mob_by_key(var/key)
for(var/mob/M in mob_list)
if(M.ckey == lowertext(key))
Expand Down
3 changes: 2 additions & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var/global/list/underwear_m = list() //stores only underwear name
var/global/list/underwear_f = list() //stores only underwear name
//Backpacks
var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel")

//Female Uniforms
var/global/list/female_uniform_icons = list()
//////////////////////////
/////Initial Building/////
//////////////////////////
Expand Down
27 changes: 27 additions & 0 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1220,3 +1220,30 @@ var/list/WALLITEMS = list(

/proc/format_text(text)
return replacetext(replacetext(text,"\proper ",""),"\improper ","")

/obj/proc/atmosanalyzer_scan(var/datum/gas_mixture/air_contents, mob/user, var/obj/target = src)
var/obj/icon = target
user.visible_message("\red [user] has used the analyzer on \icon[icon] [target].</span>")
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()

user << "\blue Results of analysis of \icon[icon] [target]."
if(total_moles>0)
var/o2_concentration = air_contents.oxygen/total_moles
var/n2_concentration = air_contents.nitrogen/total_moles
var/co2_concentration = air_contents.carbon_dioxide/total_moles
var/plasma_concentration = air_contents.toxins/total_moles

var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)

user << "\blue Pressure: [round(pressure,0.1)] kPa"
user << "\blue Nitrogen: [round(n2_concentration*100)]%"
user << "\blue Oxygen: [round(o2_concentration*100)]%"
user << "\blue CO2: [round(co2_concentration*100)]%"
user << "\blue Plasma: [round(plasma_concentration*100)]%"
if(unknown_concentration>0.01)
user << "\red Unknown: [round(unknown_concentration*100)]%"
user << "\blue Temperature: [round(air_contents.temperature-T0C)]&deg;C"
else
user << "\blue [target] is empty!"
return
124 changes: 124 additions & 0 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
Adjacency proc for determining touch range
This is mostly to determine if a user can enter a square for the purposes of touching something.
Examples include reaching a square diagonally or reaching something on the other side of a glass window.
This is calculated by looking for border items, or in the case of clicking diagonally from yourself, dense items.
This proc will NOT notice if you are trying to attack a window on the other side of a dense object in its turf. There is a window helper for that.
Note that in all cases the neighbor is handled simply; this is usually the user's mob, in which case it is up to you
to check that the mob is not inside of something
*/
/atom/proc/Adjacent(var/atom/neighbor) // basic inheritance, unused
return 0

// Not a sane use of the function and (for now) indicative of an error elsewhere
/area/Adjacent(var/atom/neighbor)
CRASH("Call to /area/Adjacent(), unimplemented proc")


/*
Adjacency (to turf):
* If you are in the same turf, always true
* If you are vertically/horizontally adjacent, ensure there are no border objects
* If you are diagonally adjacent, ensure you can pass through at least one of the mutually adjacent square.
* Passing through in this case ignores anything with the throwpass flag, such as tables, racks, and morgue trays.
*/
/turf/Adjacent(var/atom/neighbor, var/atom/target = null)
var/turf/T0 = get_turf(neighbor)
if(T0 == src)
return 1
if(get_dist(src,T0) > 1)
return 0

if(T0.x == x || T0.y == y)
// Check for border blockages
return T0.ClickCross(get_dir(T0,src), border_only = 1) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target)

// Not orthagonal
var/in_dir = get_dir(neighbor,src) // eg. northwest (1+8)
var/d1 = in_dir&(in_dir-1) // eg west (1+8)&(8) = 8
var/d2 = in_dir - d1 // eg north (1+8) - 8 = 1

for(var/d in list(d1,d2))
if(!T0.ClickCross(d, border_only = 1))
continue // could not leave T0 in that direction

var/turf/T1 = get_step(T0,d)
if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) & get_dir(T1,src), border_only = 0))
continue // couldn't enter or couldn't leave T1

if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target))
continue // could not enter src

return 1 // we don't care about our own density
return 0

/*
Adjacency (to anything else):
* Must be on a turf
* In the case of a multiple-tile object, all valid locations are checked for adjacency.
Note: Multiple-tile objects are created when the bound_width and bound_height are creater than the tile size.
This is not used in stock /tg/station currently.
*/
/atom/movable/Adjacent(var/atom/neighbor)
if(neighbor == loc) return 1
if(!isturf(loc)) return 0
for(var/turf/T in locs)
if(isnull(T)) continue
if(T.Adjacent(neighbor,src)) return 1
return 0

// This is necessary for storage items not on your person.
/obj/item/Adjacent(var/atom/neighbor, var/recurse = 1)
if(neighbor == loc) return 1
if(istype(loc,/obj/item))
if(recurse > 0)
return loc.Adjacent(neighbor,recurse - 1)
return 0
return ..()
/*
Special case: This allows you to reach a door when it is visally on top of,
but technically behind, a fire door
You could try to rewrite this to be faster, but I'm not sure anything would be.
This can be safely removed if border firedoors are ever moved to be on top of doors
so they can be interacted with without opening the door.
*/
/obj/machinery/door/Adjacent(var/atom/neighbor)
var/obj/machinery/door/firedoor/border_only/BOD = locate() in loc
if(BOD)
BOD.throwpass = 1 // allow click to pass
. = ..()
BOD.throwpass = 0
return .
return ..()


/*
This checks if you there is uninterrupted airspace between that turf and this one.
This is defined as any dense ON_BORDER object, or any dense object without throwpass.
The border_only flag allows you to not objects (for source and destination squares)
*/
/turf/proc/ClickCross(var/target_dir, var/border_only, var/target_atom = null)
for(var/obj/O in src)
if( !O.density || O == target_atom || O.throwpass) continue // throwpass is used for anything you can click through

if( O.flags&ON_BORDER) // windows have throwpass but are on border, check them first
if( O.dir & target_dir || O.dir&(O.dir-1) ) // full tile windows are just diagonals mechanically
return 0

else if( !border_only ) // dense, not on border, cannot pass over
return 0
return 1
/*
Aside: throwpass does not do what I thought it did originally, and is only used for checking whether or not
a thrown object should stop after already successfully entering a square. Currently the throw code involved
only seems to affect hitting mobs, because the checks performed against objects are already performed when
entering or leaving the square. Since throwpass isn't used on mobs, but only on objects, it is effectively
useless. Throwpass may later need to be removed and replaced with a passcheck (bitfield on movable atom passflags).
Since I don't want to complicate the click code rework by messing with unrelated systems it won't be changed here.
*/
Loading

0 comments on commit 951c60e

Please sign in to comment.