mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Removed one line ifs and elses. (#11389)
This commit is contained in:
@@ -87,7 +87,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
alpha = invisibility ? 128 : 255
|
||||
if (!update_icon_ready)
|
||||
update_icon_ready = 1
|
||||
else underlays.Cut()
|
||||
else
|
||||
underlays.Cut()
|
||||
var/list/missing_nodes = list()
|
||||
for(var/direction in cardinal)
|
||||
if(direction & initialize_directions)
|
||||
@@ -110,7 +111,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
nodecon.color = default_colour
|
||||
else if(connected_node.default_colour && connected_node.default_colour != "#B4B4B4")
|
||||
nodecon.color = connected_node.default_colour
|
||||
else nodecon.color = "#B4B4B4"
|
||||
else
|
||||
nodecon.color = "#B4B4B4"
|
||||
underlays += nodecon
|
||||
if (!adjacent_procd && connected_node.update_icon_ready && !(istype(connected_node,/obj/machinery/atmospherics/pipe/simple)))
|
||||
connected_node.update_icon(1)
|
||||
@@ -118,7 +120,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/image/nodeex = node_ex["[missing_dir]"]
|
||||
if(!color)
|
||||
nodeex.color = default_colour ? default_colour : "#B4B4B4"
|
||||
else nodeex.color = null
|
||||
else
|
||||
nodeex.color = null
|
||||
underlays += nodeex
|
||||
|
||||
|
||||
@@ -167,7 +170,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
else
|
||||
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([node_id]): [node_type]")
|
||||
return
|
||||
if(!found) continue
|
||||
if(!found)
|
||||
continue
|
||||
var/node_var="node[node_id]"
|
||||
if(!(node_var in vars))
|
||||
testing("[node_var] not in vars.")
|
||||
@@ -180,7 +184,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
// Re-enabled for debugging.
|
||||
/obj/machinery/atmospherics/process()
|
||||
|
||||
if(timestopped) return 0 //under effects of time magick
|
||||
if(timestopped)
|
||||
return 0 //under effects of time magick
|
||||
. = build_network()
|
||||
//testing("[src] called parent process to build_network()")
|
||||
|
||||
@@ -243,7 +248,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(istype(W, /obj/item/weapon/wrench/socket) && istype(src, /obj/machinery/atmospherics/pipe))
|
||||
to_chat(user, "<span class='warning'>You begin to open the pressure release valve on the pipe...</span>")
|
||||
if(do_after(user, src, 50))
|
||||
if(!loc) return
|
||||
if(!loc)
|
||||
return
|
||||
playsound(get_turf(src), 'sound/machines/hiss.ogg', 50, 1)
|
||||
user.visible_message("[user] vents \the [src].",
|
||||
"You have vented \the [src].",
|
||||
|
||||
@@ -87,7 +87,8 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/initialize()
|
||||
if(node1 && node2) return
|
||||
if(node1 && node2)
|
||||
return
|
||||
|
||||
node1 = findConnecting(turn(dir, 180))
|
||||
node2 = findConnecting(dir)
|
||||
|
||||
@@ -138,7 +138,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
investigation_log(I_ATMOS,"was turned [on ? "on" : "off"] by [key_name(usr)]")
|
||||
|
||||
@@ -150,7 +150,8 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
investigation_log(I_ATMOS,"was turned [on ? "on" : "off"] by [key_name(usr)].")
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
/obj/machinery/atmospherics/binary/valve/proc/open()
|
||||
|
||||
|
||||
if(open) return 0
|
||||
if(open)
|
||||
return 0
|
||||
|
||||
open = 1
|
||||
update_icon()
|
||||
|
||||
@@ -142,7 +142,8 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
investigation_log(I_ATMOS,"was turned [on ? "on" : "off"] by [key_name(usr)]")
|
||||
|
||||
@@ -62,7 +62,8 @@ obj/machinery/atmospherics/trinary/mixer/process()
|
||||
var/air2_moles = air2.total_moles()
|
||||
|
||||
if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2))
|
||||
if(!transfer_moles1 || !transfer_moles2) return
|
||||
if(!transfer_moles1 || !transfer_moles2)
|
||||
return
|
||||
var/ratio = min(air1_moles/transfer_moles1, air2_moles/transfer_moles2)
|
||||
|
||||
transfer_moles1 *= ratio
|
||||
@@ -121,7 +122,8 @@ obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
|
||||
return
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
|
||||
@@ -70,7 +70,8 @@
|
||||
/obj/machinery/atmospherics/trinary/tvalve/proc/go_to_side()
|
||||
|
||||
|
||||
if(state) return 0
|
||||
if(state)
|
||||
return 0
|
||||
|
||||
state = 1
|
||||
update_icon()
|
||||
|
||||
@@ -107,7 +107,8 @@ obj/machinery/atmospherics/trinary/Destroy()
|
||||
..()
|
||||
|
||||
obj/machinery/atmospherics/trinary/initialize()
|
||||
if(node1 && node2 && node3) return
|
||||
if(node1 && node2 && node3)
|
||||
return
|
||||
|
||||
//mirrored pipes face the same way and have their nodes in the same place
|
||||
//The 1 and 3 nodes are reversed, however.
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity()
|
||||
var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature
|
||||
|
||||
if(!combined_heat_capacity) combined_heat_capacity = 1
|
||||
if(!combined_heat_capacity)
|
||||
combined_heat_capacity = 1
|
||||
var/final_temperature = combined_energy / combined_heat_capacity
|
||||
|
||||
external_removed.temperature = final_temperature
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/initialize()
|
||||
if(node) return
|
||||
if(node)
|
||||
return
|
||||
var/node_connect = dir
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
return// Turning off the vent is a PITA. - N3X
|
||||
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
if(!loc)
|
||||
return
|
||||
|
||||
//air_contents.mingle_with_turf(loc)
|
||||
|
||||
|
||||
@@ -99,7 +99,8 @@
|
||||
return
|
||||
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
if(!loc)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
@@ -313,7 +314,8 @@
|
||||
if (WT.remove_fuel(0,user))
|
||||
to_chat(user, "<span class='notice'>Now welding the vent.</span>")
|
||||
if(do_after(user, src, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
|
||||
|
||||
@@ -142,7 +142,8 @@
|
||||
if(!on)
|
||||
return
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
if(!loc)
|
||||
return
|
||||
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
@@ -311,7 +312,8 @@
|
||||
if (WT.remove_fuel(1,user))
|
||||
to_chat(user, "<span class='notice'>Now welding the scrubber.</span>")
|
||||
if(do_after(user, src, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("[user] welds the scrubber shut.", "You weld the vent scrubber.", "You hear welding.")
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
return 1
|
||||
|
||||
/datum/pipe_network/proc/merge(datum/pipe_network/giver)
|
||||
if(giver==src) return 0
|
||||
if(giver==src)
|
||||
return 0
|
||||
|
||||
normal_members |= giver.normal_members
|
||||
|
||||
@@ -87,7 +88,8 @@
|
||||
|
||||
for(var/obj/machinery/atmospherics/normal_member in normal_members)
|
||||
var/result = normal_member.return_network_air(src)
|
||||
if(result) gases += result
|
||||
if(result)
|
||||
gases += result
|
||||
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
gases += line_member.air
|
||||
|
||||
@@ -273,7 +273,8 @@
|
||||
else
|
||||
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([node_id]): [node_type]")
|
||||
return
|
||||
if(!found) continue
|
||||
if(!found)
|
||||
continue
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent/burstpipe/BP = new burst_type(T, setdir=direction)
|
||||
BP.color=src.color
|
||||
|
||||
@@ -78,7 +78,8 @@ atom/movable/Move() //Hackish
|
||||
proc/set_up() //Update the overlays to make the openspace turf show what's down a level
|
||||
if(!overlay_references)
|
||||
overlay_references = list()
|
||||
if(!floorbelow) return
|
||||
if(!floorbelow)
|
||||
return
|
||||
overlays += floorbelow
|
||||
for(var/obj/o in floorbelow)
|
||||
var/image/o_img = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
|
||||
@@ -59,9 +59,12 @@
|
||||
continue
|
||||
|
||||
switch (I)
|
||||
if(1) slow += T
|
||||
if(2) normal += T
|
||||
if(3) fast += T
|
||||
if(1)
|
||||
slow += T
|
||||
if(2)
|
||||
normal += T
|
||||
if(3)
|
||||
fast += T
|
||||
|
||||
if(transfer > 0)
|
||||
if(up)
|
||||
@@ -149,7 +152,8 @@ atom/movable/Move() //Hackish
|
||||
var/image/o_img = list()
|
||||
for(var/obj/o in below)
|
||||
// ingore objects that have any form of invisibility
|
||||
if(o.invisibility) continue
|
||||
if(o.invisibility)
|
||||
continue
|
||||
new_list = 2
|
||||
var/image/temp2 = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
temp2.color = rgb(127,127,127)
|
||||
@@ -164,9 +168,11 @@ atom/movable/Move() //Hackish
|
||||
var/image/m_img = list()
|
||||
for(var/mob/m in below)
|
||||
// ingore mobs that have any form of invisibility
|
||||
if(m.invisibility) continue
|
||||
if(m.invisibility)
|
||||
continue
|
||||
// only add this tile to fastprocessing if there is a living mob, not a dead one
|
||||
if(istype(m, /mob/living)) new_list = 3
|
||||
if(istype(m, /mob/living))
|
||||
new_list = 3
|
||||
var/image/temp2 = image(m, dir=m.dir, layer = TURF_LAYER+0.05*m.layer)
|
||||
temp2.color = rgb(127,127,127)
|
||||
temp2.plane = TURF_PLANE
|
||||
@@ -194,11 +200,13 @@ atom/movable/Move() //Hackish
|
||||
var/turf/nT = get_step(mT,f)
|
||||
if(istype(nT, /turf/space) || istype(nT, /turf/simulated/floor/open))
|
||||
eligeable = 1*/
|
||||
if(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)) eligeable = 1
|
||||
if(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open))
|
||||
eligeable = 1
|
||||
if(eligeable == 1)
|
||||
if(!(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)))
|
||||
var/image/t_img = list()
|
||||
if(new_list < 1) new_list = 1
|
||||
if(new_list < 1)
|
||||
new_list = 1
|
||||
|
||||
above.overlays -= above.z_overlays
|
||||
var/image/temp = image(above, dir=above.dir, layer = 5 + 0.04)
|
||||
@@ -215,8 +223,10 @@ atom/movable/Move() //Hackish
|
||||
var/image/o_img = list()
|
||||
for(var/obj/o in above)
|
||||
// ingore objects that have any form of invisibility
|
||||
if(o.invisibility) continue
|
||||
if(new_list < 2) new_list = 2
|
||||
if(o.invisibility)
|
||||
continue
|
||||
if(new_list < 2)
|
||||
new_list = 2
|
||||
var/image/temp2 = image(o, dir=o.dir, layer = 5+0.05*o.layer)
|
||||
temp2.alpha = 100
|
||||
temp2.overlays += o.overlays
|
||||
@@ -229,9 +239,11 @@ atom/movable/Move() //Hackish
|
||||
var/image/m_img = list()
|
||||
for(var/mob/m in above)
|
||||
// ingore mobs that have any form of invisibility
|
||||
if(m.invisibility) continue
|
||||
if(m.invisibility)
|
||||
continue
|
||||
// only add this tile to fastprocessing if there is a living mob, not a dead one
|
||||
if(istype(m, /mob/living) && new_list < 3) new_list = 3
|
||||
if(istype(m, /mob/living) && new_list < 3)
|
||||
new_list = 3
|
||||
var/image/temp2 = image(m, dir=m.dir, layer = 5+0.05*m.layer)
|
||||
temp2.alpha = 100
|
||||
temp2.overlays += m.overlays
|
||||
|
||||
@@ -97,7 +97,8 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
return -1
|
||||
|
||||
/obj/machinery/power/rust_core/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["str"])
|
||||
var/dif = text2num(href_list["str"])
|
||||
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
||||
|
||||
@@ -111,7 +111,8 @@
|
||||
to_chat(user, "You start welding the port frame...")
|
||||
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, src, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
if(!src || !WT.remove_fuel(3, user))
|
||||
return
|
||||
new /obj/item/mounted/frame/rust_fuel_assembly_port(loc)
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[src] has been cut away from the wall by [user.name].</span>",\
|
||||
|
||||
@@ -59,7 +59,8 @@ var/const/max_assembly_amount = 300
|
||||
//var/coverlocked
|
||||
|
||||
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=fuelcomp")
|
||||
usr.machine = null
|
||||
|
||||
@@ -138,7 +138,8 @@
|
||||
to_chat(user, "You start welding the compressor frame...")
|
||||
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, src, 50))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
if(!src || !WT.remove_fuel(3, user))
|
||||
return
|
||||
new /obj/item/mounted/frame/rust_fuel_assembly_port(loc)
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[src] has been cut away from the wall by [user.name].</span>",\
|
||||
|
||||
@@ -119,7 +119,8 @@
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if( href_list["scan"] )
|
||||
connected_injectors = list()
|
||||
|
||||
@@ -130,7 +130,8 @@
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if( href_list["modify_tag"] )
|
||||
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
||||
|
||||
@@ -131,7 +131,8 @@
|
||||
time_since_fail = 0
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
if(!isAI(usr) && usr.z != z) return 1
|
||||
if(!isAI(usr) && usr.z != z)
|
||||
return 1
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
|
||||
@@ -97,7 +97,8 @@
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/shield_gen/attack_ghost(mob/user)
|
||||
if(isAdminGhost(user)) src.attack_hand(user)
|
||||
if(isAdminGhost(user))
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/shield_gen/interact(mob/user)
|
||||
@@ -183,8 +184,10 @@
|
||||
average_field_strength = 0
|
||||
|
||||
/obj/machinery/shield_gen/Topic(href, href_list[])
|
||||
if(!isAI(usr) && usr.z != z) return 1
|
||||
if(..()) return 1
|
||||
if(!isAI(usr) && usr.z != z)
|
||||
return 1
|
||||
if(..())
|
||||
return 1
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_generator")
|
||||
usr.unset_machine()
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/lasercon/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=laser_control")
|
||||
usr.machine = null
|
||||
|
||||
@@ -150,7 +150,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/zero_point_emitter/Topic(href, href_list)
|
||||
if(..()) return 1
|
||||
if(..())
|
||||
return 1
|
||||
if( href_list["input"] )
|
||||
var/i = text2num(href_list["input"])
|
||||
var/d = i
|
||||
|
||||
@@ -200,7 +200,8 @@
|
||||
flick("popup", src.cover)
|
||||
src.cover.icon_state = "openTurretCover"
|
||||
spawn(10)
|
||||
if (popping==1) popping = 0
|
||||
if (popping==1)
|
||||
popping = 0
|
||||
|
||||
/obj/machinery/meteor_battery/proc/popDown()
|
||||
if ((!isPopping()) || src.popping==1)
|
||||
@@ -216,7 +217,8 @@
|
||||
/obj/machinery/meteor_battery/bullet_act(var/obj/item/projectile/Proj)
|
||||
src.health -= Proj.damage
|
||||
..()
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
if(prob(45) && Proj.damage > 0)
|
||||
src.spark_system.start()
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
return
|
||||
else
|
||||
var/str = copytext(reject_bad_text(input(user,"Enter the properly capitalized name for demotion","Set name","") as text|null),1,MAX_NAME_LEN)
|
||||
if (!Adjacent(user) || user.stat) return
|
||||
if (!Adjacent(user) || user.stat)
|
||||
return
|
||||
if(!str)
|
||||
alert("Invalid name.")
|
||||
target_name = null
|
||||
|
||||
@@ -139,7 +139,8 @@ var/global/list/atmos_controllers = list()
|
||||
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/is_in_filter(var/typepath)
|
||||
if(!filter) return 1 // YEP. TOTALLY.
|
||||
if(!filter)
|
||||
return 1 // YEP. TOTALLY.
|
||||
return typepath in filter
|
||||
|
||||
//a bunch of this is copied from atmos alarms
|
||||
@@ -147,7 +148,8 @@ var/global/list/atmos_controllers = list()
|
||||
if(..())
|
||||
return 0
|
||||
if(href_list["close"])
|
||||
if(usr.machine == src) usr.unset_machine()
|
||||
if(usr.machine == src)
|
||||
usr.unset_machine()
|
||||
return 1
|
||||
if(href_list["reset"])
|
||||
current = null
|
||||
|
||||
@@ -78,12 +78,14 @@
|
||||
var/dir
|
||||
if (start.x == end.x)
|
||||
var/d = end.y-start.y
|
||||
if(d) d = d/abs(d)
|
||||
if(d)
|
||||
d = d/abs(d)
|
||||
end = get_turf(locate(end.x,end.y+d,end.z))
|
||||
dir = "v"
|
||||
else
|
||||
var/d = end.x-start.x
|
||||
if(d) d = d/abs(d)
|
||||
if(d)
|
||||
d = d/abs(d)
|
||||
end = get_turf(locate(end.x+d,end.y,end.z))
|
||||
dir = "h"
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
return W
|
||||
|
||||
/obj/item/weapon/autopsy_scanner/proc/add_data(var/datum/organ/external/O)
|
||||
if(!O.autopsy_data.len && !O.trace_chemicals.len) return
|
||||
if(!O.autopsy_data.len && !O.trace_chemicals.len)
|
||||
return
|
||||
|
||||
for(var/V in O.autopsy_data)
|
||||
var/datum/autopsy_data/W = O.autopsy_data[V]
|
||||
@@ -103,8 +104,10 @@
|
||||
|
||||
var/wname = W.pretend_weapon
|
||||
|
||||
if(wname in weapon_chances) weapon_chances[wname] += W.damage
|
||||
else weapon_chances[wname] = max(W.damage, 1)
|
||||
if(wname in weapon_chances)
|
||||
weapon_chances[wname] += W.damage
|
||||
else
|
||||
weapon_chances[wname] = max(W.damage, 1)
|
||||
total_score+=W.damage
|
||||
|
||||
|
||||
@@ -128,7 +131,8 @@
|
||||
if(30 to 1000)
|
||||
damage_desc = "<font color='red'>severe</font>"
|
||||
|
||||
if(!total_score) total_score = D.organs_scanned.len
|
||||
if(!total_score)
|
||||
total_score = D.organs_scanned.len
|
||||
|
||||
scan_data += "<b>Weapon #[n]</b><br>"
|
||||
if(damaging_weapon)
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
if(H.cl == M.client)
|
||||
holder = H
|
||||
break
|
||||
if(holder) holder.buildmode.copycat = null
|
||||
if(holder)
|
||||
holder.buildmode.copycat = null
|
||||
if(M.client.buildmode_objs && M.client.buildmode_objs.len)
|
||||
for(var/BM in M.client.buildmode_objs)
|
||||
returnToPool(BM)
|
||||
@@ -199,7 +200,8 @@ obj/effect/bmode/buildholder/New()
|
||||
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
|
||||
return 1
|
||||
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
|
||||
if(!thetype) return 1
|
||||
if(!thetype)
|
||||
return 1
|
||||
switch(thetype)
|
||||
if("text")
|
||||
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
|
||||
@@ -233,10 +235,12 @@ obj/effect/bmode/buildholder/New()
|
||||
if(H.cl == src)
|
||||
holder = H
|
||||
break
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
var/turf/start = get_turf(src_location)
|
||||
var/turf/end = get_turf(over_location)
|
||||
if(!start || !end) return
|
||||
if(!start || !end)
|
||||
return
|
||||
switch(buildmode)
|
||||
if(1 to 2)
|
||||
var/list/fillturfs = block(start,end)
|
||||
@@ -246,12 +250,14 @@ obj/effect/bmode/buildholder/New()
|
||||
if(alert("Are you completely sure about filling [fillturfs.len] tiles?","Panic!!!!","Yes","No") != "Yes")
|
||||
return
|
||||
var/areaAction = alert("FILL tiles or DELETE them? areaAction will destroy EVERYTHING IN THE SELECTED AREA", "Create or destroy, your chance to be a GOD","FILL","DELETE") == "DELETE"
|
||||
if(areaAction) areaAction = (alert("Selective(TYPE) Delete or MASS Delete?", "Scorched Earth or selective destruction?", "Selective", "MASS") == "Selective" ? 2 : 1)
|
||||
if(areaAction)
|
||||
areaAction = (alert("Selective(TYPE) Delete or MASS Delete?", "Scorched Earth or selective destruction?", "Selective", "MASS") == "Selective" ? 2 : 1)
|
||||
else
|
||||
areaAction = (alert("Mass FILL or Selective(Type => Type) FILL?", "Do they really need [fillturfs.len] of closets?", "Selective", "Mass") == "Selective" ? 3 : 0)
|
||||
|
||||
var/whatfill = (buildmode == 1 ? input("What are we filling with?", "So many choices") as null|anything in list(/turf/simulated/floor,/turf/simulated/wall,/turf/simulated/wall/r_wall,/obj/machinery/door/airlock, /obj/structure/window/reinforced) : holder.buildmode.objholder)
|
||||
if(!whatfill) return
|
||||
if(!whatfill)
|
||||
return
|
||||
var/msglog = "<span class='danger'>[key_name_admin(usr)] just buildmode"
|
||||
var/strict = 1
|
||||
var/chosen
|
||||
@@ -260,12 +266,14 @@ obj/effect/bmode/buildholder/New()
|
||||
msglog += " <big>DELETED EVERYTHING</big> in [fillturfs.len] tile\s "
|
||||
if(SELECTIVE_DELETE)
|
||||
chosen = easyTypeSelector()
|
||||
if(!chosen) return
|
||||
if(!chosen)
|
||||
return
|
||||
strict = alert("Delete all children of [chosen]?", "Children being all types and subtypes of [chosen]", "Yes", "No") == "No"
|
||||
msglog += " <big>DELETED [!strict ? "ALL TYPES OF " :""][chosen]</big> in [fillturfs.len] tile\s "
|
||||
if(SELECTIVE_FILL)
|
||||
chosen = easyTypeSelector()
|
||||
if(!chosen) return
|
||||
if(!chosen)
|
||||
return
|
||||
strict = alert("Change all children of [chosen]?", "Children being all types and subtypes of [chosen]", "Yes", "No") == "No"
|
||||
msglog += " Changed all [chosen] in [fillturfs.len] tile\s to [whatfill] "
|
||||
else
|
||||
@@ -283,27 +291,33 @@ obj/effect/bmode/buildholder/New()
|
||||
deletions++
|
||||
else
|
||||
for(var/atom/thing in T.contents)
|
||||
if(thing==usr) continue
|
||||
if(thing==usr)
|
||||
continue
|
||||
if(areaAction == MASS_DELETE || (strict && thing.type == chosen) || istype(thing,chosen))
|
||||
qdel(thing)
|
||||
deletions++
|
||||
tcheck(80,1)
|
||||
if(areaAction == MASS_DELETE) T.ChangeTurf(get_base_turf(T.z))
|
||||
if(areaAction == MASS_DELETE)
|
||||
T.ChangeTurf(get_base_turf(T.z))
|
||||
else
|
||||
if(turf_op)
|
||||
if(areaAction == SELECTIVE_FILL)
|
||||
if(strict)
|
||||
if(T.type != chosen) continue
|
||||
if(T.type != chosen)
|
||||
continue
|
||||
else
|
||||
if(!istype(T, chosen)) continue
|
||||
if(!istype(T, chosen))
|
||||
continue
|
||||
T.ChangeTurf(whatfill)
|
||||
else
|
||||
if(areaAction == SELECTIVE_FILL)
|
||||
for(var/atom/thing in T.contents)
|
||||
if(strict)
|
||||
if(thing.type != chosen) continue
|
||||
if(thing.type != chosen)
|
||||
continue
|
||||
else
|
||||
if(!istype(thing, chosen)) continue
|
||||
if(!istype(thing, chosen))
|
||||
continue
|
||||
var/atom/A = new whatfill(T)
|
||||
A.dir = thing.dir
|
||||
qdel(thing)
|
||||
@@ -335,7 +349,8 @@ obj/effect/bmode/buildholder/New()
|
||||
msglog += " <big>EDITED EVERYTHING</big> in [fillturfs.len] tile\s "
|
||||
if(SELECTIVE_DELETE)
|
||||
chosen = easyTypeSelector()
|
||||
if(!chosen) return
|
||||
if(!chosen)
|
||||
return
|
||||
strict = alert("Edit all children of [chosen]?", "Children being all types and subtypes of [chosen]", "Yes", "No") == "No"
|
||||
msglog += " <big>EDITED [!strict ? "ALL TYPES OF " :""][chosen]</big> in [fillturfs.len] tile\s "
|
||||
else
|
||||
@@ -350,7 +365,8 @@ obj/effect/bmode/buildholder/New()
|
||||
setvar(holder.buildmode.varholder, holder.buildmode.valueholder, T, reset)
|
||||
else
|
||||
for(var/atom/thing in T.contents)
|
||||
if(thing==usr) continue
|
||||
if(thing==usr)
|
||||
continue
|
||||
if(areaAction == MASS_DELETE || (strict && thing.type == chosen) || istype(thing,chosen))
|
||||
setvar(holder.buildmode.varholder, holder.buildmode.valueholder, thing, reset)
|
||||
edits++
|
||||
@@ -368,7 +384,8 @@ obj/effect/bmode/buildholder/New()
|
||||
if(H.cl == user.client)
|
||||
holder = H
|
||||
break
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
var/list/pa = params2list(params)
|
||||
var/turf/RT = get_turf(object)
|
||||
switch(buildmode)
|
||||
@@ -456,7 +473,8 @@ obj/effect/bmode/buildholder/New()
|
||||
to_chat(usr, "<span class='notice'>Cleared filling corners.</span>")
|
||||
return
|
||||
var/areaAction = alert("FILL tiles or DELETE them? areaAction will destroy EVERYTHING IN THE SELECTED AREA", "Create or destroy, your chance to be a GOD","FILL","DELETE") == "DELETE"
|
||||
if(areaAction) areaAction = (alert("Selective(TYPE) Delete or MASS Delete?", "Scorched Earth or selective destruction?", "Selective", "MASS") == "Selective" ? 2 : 1)
|
||||
if(areaAction)
|
||||
areaAction = (alert("Selective(TYPE) Delete or MASS Delete?", "Scorched Earth or selective destruction?", "Selective", "MASS") == "Selective" ? 2 : 1)
|
||||
else
|
||||
areaAction = (alert("Mass FILL or Selective(Type => Type) FILL?", "Do they really need [fillturfs.len] of closets?", "Selective", "Mass") == "Selective" ? 3 : 0)
|
||||
var/msglog = "<span class='danger'>[key_name_admin(usr)] just buildmode"
|
||||
@@ -467,12 +485,14 @@ obj/effect/bmode/buildholder/New()
|
||||
msglog += " <big>DELETED EVERYTHING</big> in [fillturfs.len] tile\s "
|
||||
if(SELECTIVE_DELETE)
|
||||
chosen = easyTypeSelector()
|
||||
if(!chosen) return
|
||||
if(!chosen)
|
||||
return
|
||||
strict = alert("Delete all children of [chosen]?", "Children being all types and subtypes of [chosen]", "Yes", "No") == "No"
|
||||
msglog += " <big>DELETED [!strict ? "ALL TYPES OF " :""][chosen]</big> in [fillturfs.len] tile\s "
|
||||
if(SELECTIVE_FILL)
|
||||
chosen = easyTypeSelector()
|
||||
if(!chosen) return
|
||||
if(!chosen)
|
||||
return
|
||||
strict = alert("Change all children of [chosen]?", "Children being all types and subtypes of [chosen]", "Yes", "No") == "No"
|
||||
msglog += " Changed all [chosen] in [fillturfs.len] tile\s to [holder.buildmode.objholder] "
|
||||
else
|
||||
@@ -490,27 +510,33 @@ obj/effect/bmode/buildholder/New()
|
||||
deletions++
|
||||
else
|
||||
for(var/atom/thing in T.contents)
|
||||
if(thing==usr) continue
|
||||
if(thing==usr)
|
||||
continue
|
||||
if(areaAction == MASS_DELETE || (strict && thing.type == chosen) || istype(thing,chosen))
|
||||
qdel(thing)
|
||||
deletions++
|
||||
tcheck(80,1)
|
||||
if(areaAction == MASS_DELETE) T.ChangeTurf(get_base_turf(T.z))
|
||||
if(areaAction == MASS_DELETE)
|
||||
T.ChangeTurf(get_base_turf(T.z))
|
||||
else
|
||||
if(turf_op)
|
||||
if(areaAction == SELECTIVE_FILL)
|
||||
if(strict)
|
||||
if(T.type != chosen) continue
|
||||
if(T.type != chosen)
|
||||
continue
|
||||
else
|
||||
if(!istype(T, chosen)) continue
|
||||
if(!istype(T, chosen))
|
||||
continue
|
||||
T.ChangeTurf(holder.buildmode.objholder)
|
||||
else
|
||||
if(areaAction == SELECTIVE_FILL)
|
||||
for(var/atom/thing in T.contents)
|
||||
if(strict)
|
||||
if(thing.type != chosen) continue
|
||||
if(thing.type != chosen)
|
||||
continue
|
||||
else
|
||||
if(!istype(thing, chosen)) continue
|
||||
if(!istype(thing, chosen))
|
||||
continue
|
||||
var/atom/A = new holder.buildmode.objholder(T)
|
||||
A.dir = thing.dir
|
||||
qdel(thing)
|
||||
@@ -585,7 +611,8 @@ obj/effect/bmode/buildholder/New()
|
||||
log_admin("[key_name(usr)] made a [holder.buildmode.objholder] at [formatJumpTo(RT)]")
|
||||
else if(pa.Find("right"))
|
||||
log_admin("[key_name(usr)] deleted a [object] at [formatJumpTo(RT)]")
|
||||
if(isobj(object)) del(object)
|
||||
if(isobj(object))
|
||||
del(object)
|
||||
else if(pa.Find("middle"))
|
||||
if(istype(object,/mob) && !check_rights(R_DEBUG,0))
|
||||
to_chat(usr, "<span class='notice'>You don't have sufficient rights to clone [object.type]</span>")
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
|
||||
/datum/effect/system/expl_particles/proc/set_up(n = 10, loca)
|
||||
number = n
|
||||
if(istype(loca, /turf/)) location = loca
|
||||
else location = get_turf(loca)
|
||||
if(istype(loca, /turf/))
|
||||
location = loca
|
||||
else
|
||||
location = get_turf(loca)
|
||||
|
||||
/datum/effect/system/expl_particles/proc/start()
|
||||
var/i = 0
|
||||
@@ -56,8 +58,10 @@
|
||||
var/turf/location
|
||||
|
||||
/datum/effect/system/explosion/proc/set_up(loca)
|
||||
if(istype(loca, /turf/)) location = loca
|
||||
else location = get_turf(loca)
|
||||
if(istype(loca, /turf/))
|
||||
location = loca
|
||||
else
|
||||
location = get_turf(loca)
|
||||
|
||||
/datum/effect/system/explosion/proc/start()
|
||||
new/obj/effect/explosion( location )
|
||||
@@ -95,8 +99,10 @@
|
||||
var/pixel_y = 0
|
||||
|
||||
/datum/effect/system/small_explosion/proc/set_up(loca,var/ex_iconstate = "explosion_small", var/pX = 0, var/pY = 0)
|
||||
if(istype(loca, /turf/)) location = loca
|
||||
else location = get_turf(loca)
|
||||
if(istype(loca, /turf/))
|
||||
location = loca
|
||||
else
|
||||
location = get_turf(loca)
|
||||
ex_icon = ex_iconstate
|
||||
pixel_x = pX
|
||||
pixel_y = pY
|
||||
|
||||
@@ -47,7 +47,8 @@ var/list/alldepartments = list("Central Command")
|
||||
/obj/machinery/faxmachine/RefreshParts()
|
||||
var/scancount = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in component_parts)
|
||||
if(istype(SP, /obj/item/weapon/stock_parts/scanning_module)) scancount += SP.rating-1
|
||||
if(istype(SP, /obj/item/weapon/stock_parts/scanning_module))
|
||||
scancount += SP.rating-1
|
||||
cooldown_time = initial(cooldown_time) - 300*scancount
|
||||
|
||||
/obj/machinery/faxmachine/attack_ghost(mob/user as mob)
|
||||
|
||||
@@ -52,12 +52,14 @@ mob/var/tmp/last_airflow_stun = 0
|
||||
mob/proc/airflow_stun()
|
||||
if(stat == 2 || (flags & INVULNERABLE))
|
||||
return 0
|
||||
if(last_airflow_stun > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_stun_cooldown)) return 0
|
||||
if(last_airflow_stun > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_stun_cooldown))
|
||||
return 0
|
||||
if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN))
|
||||
to_chat(src, "<span class='notice'>You stay upright as the air rushes past you.</span>")
|
||||
return 0
|
||||
|
||||
if(weakened <= 0) to_chat(src, "<span class='warning'>The sudden rush of air knocks you over!</span>")
|
||||
if(weakened <= 0)
|
||||
to_chat(src, "<span class='warning'>The sudden rush of air knocks you over!</span>")
|
||||
SetWeakened(5)
|
||||
last_airflow_stun = world.time
|
||||
return
|
||||
@@ -69,15 +71,19 @@ mob/living/carbon/metroid/airflow_stun()
|
||||
return
|
||||
|
||||
mob/living/carbon/human/airflow_stun()
|
||||
if(last_airflow_stun > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_stun_cooldown)) return 0
|
||||
if(locked_to || (flags & INVULNERABLE)) return 0
|
||||
if(last_airflow_stun > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_stun_cooldown))
|
||||
return 0
|
||||
if(locked_to || (flags & INVULNERABLE))
|
||||
return 0
|
||||
if(shoes)
|
||||
if(CheckSlip() < 1) return 0
|
||||
if(CheckSlip() < 1)
|
||||
return 0
|
||||
if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN))
|
||||
to_chat(src, "<span class='notice'>You stay upright as the air rushes past you.</span>")
|
||||
return 0
|
||||
|
||||
if(weakened <= 0) to_chat(src, "<span class='warning'>The sudden rush of air knocks you over!</span>")
|
||||
if(weakened <= 0)
|
||||
to_chat(src, "<span class='warning'>The sudden rush of air knocks you over!</span>")
|
||||
SetWeakened(rand(1,5))
|
||||
last_airflow_stun = world.time
|
||||
return
|
||||
@@ -109,11 +115,14 @@ obj/item/check_airflow_movable(n)
|
||||
. = ..()
|
||||
switch(w_class)
|
||||
if(2)
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return 0
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
|
||||
return 0
|
||||
if(3)
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_light_pressure)) return 0
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_light_pressure))
|
||||
return 0
|
||||
if(4,5)
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_medium_pressure)) return 0
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_medium_pressure))
|
||||
return 0
|
||||
|
||||
/*
|
||||
//The main airflow code. Called by zone updates.
|
||||
@@ -124,7 +133,8 @@ proc/Airflow(zone/A, zone/B)
|
||||
var/n = B.air.return_pressure() - A.air.return_pressure()
|
||||
|
||||
//Don't go any further if n is lower than the lowest value needed for airflow.
|
||||
if(abs(n) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
|
||||
if(abs(n) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
|
||||
return
|
||||
|
||||
//These turfs are the midway point between A and B, and will be the destination point for thrown objects.
|
||||
var/list/connection/connections_A = A.connections
|
||||
@@ -153,11 +163,13 @@ proc/Airflow(zone/A, zone/B)
|
||||
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
|
||||
for(var/atom/movable/M in air_sucked)
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay))
|
||||
continue
|
||||
|
||||
//Check for knocking people over
|
||||
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
|
||||
if(M:status_flags & GODMODE) continue
|
||||
if(M:status_flags & GODMODE)
|
||||
continue
|
||||
M:airflow_stun()
|
||||
|
||||
if(M.check_airflow_movable(n))
|
||||
@@ -165,8 +177,10 @@ proc/Airflow(zone/A, zone/B)
|
||||
//Check for things that are in range of the midpoint turfs.
|
||||
var/list/close_turfs = list()
|
||||
for(var/turf/U in connected_turfs)
|
||||
if(M in range(U)) close_turfs += U
|
||||
if(!close_turfs.len) continue
|
||||
if(M in range(U))
|
||||
close_turfs += U
|
||||
if(!close_turfs.len)
|
||||
continue
|
||||
|
||||
//If they're already being tossed, don't do it again.
|
||||
if(!M.airflow_speed)
|
||||
@@ -178,18 +192,22 @@ proc/Airflow(zone/A, zone/B)
|
||||
//Do it again for the stuff in the other zone, making it fly away.
|
||||
for(var/atom/movable/M in air_repelled)
|
||||
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay))
|
||||
continue
|
||||
|
||||
if(ismob(M) && abs(n) > zas_settings.Get(/datum/ZAS_Setting/airflow_medium_pressure))
|
||||
if(M:status_flags & GODMODE) continue
|
||||
if(M:status_flags & GODMODE)
|
||||
continue
|
||||
M:airflow_stun()
|
||||
|
||||
if(M.check_airflow_movable(abs(n)))
|
||||
|
||||
var/list/close_turfs = list()
|
||||
for(var/turf/U in connected_turfs)
|
||||
if(M in range(U)) close_turfs += U
|
||||
if(!close_turfs.len) continue
|
||||
if(M in range(U))
|
||||
close_turfs += U
|
||||
if(!close_turfs.len)
|
||||
continue
|
||||
|
||||
//If they're already being tossed, don't do it again.
|
||||
if(!M.airflow_speed)
|
||||
@@ -205,26 +223,31 @@ proc/AirflowSpace(zone/A)
|
||||
var/n = A.air.return_pressure()
|
||||
//Here, n is determined by only the pressure in the room.
|
||||
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
|
||||
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
|
||||
return
|
||||
|
||||
var/list/connected_turfs = A.unsimulated_tiles //The midpoints are now all the space connections.
|
||||
var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space.
|
||||
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
|
||||
for(var/atom/movable/M in pplz)
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
|
||||
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay))
|
||||
continue
|
||||
|
||||
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
|
||||
var/mob/O = M
|
||||
if(O.status_flags & GODMODE) continue
|
||||
if(O.status_flags & GODMODE)
|
||||
continue
|
||||
O.airflow_stun()
|
||||
|
||||
if(M.check_airflow_movable(n))
|
||||
|
||||
var/list/close_turfs = list()
|
||||
for(var/turf/U in connected_turfs)
|
||||
if(M in range(U)) close_turfs += U
|
||||
if(!close_turfs.len) continue
|
||||
if(M in range(U))
|
||||
close_turfs += U
|
||||
if(!close_turfs.len)
|
||||
continue
|
||||
|
||||
//If they're already being tossed, don't do it again.
|
||||
if(!M.airflow_speed)
|
||||
@@ -377,7 +400,8 @@ atom/movable/proc/airflow_hit(atom/A)
|
||||
airflow_dest = null
|
||||
|
||||
mob/airflow_hit(atom/A)
|
||||
if(size == SIZE_TINY) return //Slamming into a mouse/roach doesn't make much sense
|
||||
if(size == SIZE_TINY)
|
||||
return //Slamming into a mouse/roach doesn't make much sense
|
||||
|
||||
if(!sound_override)
|
||||
for(var/mob/M in hearers(src))
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
return (!density || !height || air_group)
|
||||
|
||||
/turf/proc/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
if(!target) return 0
|
||||
if(!target)
|
||||
return 0
|
||||
|
||||
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
||||
return !density
|
||||
@@ -46,13 +47,16 @@
|
||||
#ifdef ZLEVELS
|
||||
if(other.z != src.z)
|
||||
if(other.z < src.z)
|
||||
if(!istype(src, /turf/simulated/floor/open)) return BLOCKED
|
||||
if(!istype(src, /turf/simulated/floor/open))
|
||||
return BLOCKED
|
||||
else
|
||||
if(!istype(other, /turf/simulated/floor/open)) return BLOCKED
|
||||
if(!istype(other, /turf/simulated/floor/open))
|
||||
return BLOCKED
|
||||
#endif
|
||||
|
||||
var/result = 0
|
||||
for(var/atom/movable/M in contents)
|
||||
result |= M.c_airblock(other)
|
||||
if(result == BLOCKED) return BLOCKED
|
||||
if(result == BLOCKED)
|
||||
return BLOCKED
|
||||
return result
|
||||
@@ -100,7 +100,8 @@ Class Procs:
|
||||
|
||||
//Check for knocking people over
|
||||
if(ismob(M) && differential > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
|
||||
if(M:status_flags & GODMODE) continue
|
||||
if(M:status_flags & GODMODE)
|
||||
continue
|
||||
M:airflow_stun()
|
||||
|
||||
if(M.check_airflow_movable(differential))
|
||||
@@ -148,11 +149,13 @@ Class Procs:
|
||||
/connection_edge/zone/add_connection(connection/c)
|
||||
. = ..()
|
||||
connecting_turfs.Add(c.A)
|
||||
if(c.direct()) direct++
|
||||
if(c.direct())
|
||||
direct++
|
||||
|
||||
/connection_edge/zone/remove_connection(connection/c)
|
||||
connecting_turfs.Remove(c.A)
|
||||
if(c.direct()) direct--
|
||||
if(c.direct())
|
||||
direct--
|
||||
. = ..()
|
||||
|
||||
/connection_edge/zone/contains_zone(zone/Z)
|
||||
@@ -183,7 +186,8 @@ Class Procs:
|
||||
// to_chat(world, "equalized.")
|
||||
|
||||
var/differential = A.air.return_pressure() - B.air.return_pressure()
|
||||
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
|
||||
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
|
||||
return
|
||||
|
||||
var/list/attracted
|
||||
var/list/repelled
|
||||
@@ -201,8 +205,10 @@ Class Procs:
|
||||
|
||||
//Helper proc to get connections for a zone.
|
||||
/connection_edge/zone/proc/get_connected_zone(zone/from)
|
||||
if(A == from) return B
|
||||
else return A
|
||||
if(A == from)
|
||||
return B
|
||||
else
|
||||
return A
|
||||
|
||||
/connection_edge/unsimulated/var/turf/B
|
||||
/connection_edge/unsimulated/var/datum/gas_mixture/air
|
||||
@@ -242,7 +248,8 @@ Class Procs:
|
||||
air_master.mark_zone_update(A)
|
||||
|
||||
var/differential = A.air.return_pressure() - air.return_pressure()
|
||||
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
|
||||
if(abs(differential) < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
|
||||
return
|
||||
|
||||
var/list/attracted = A.movables()
|
||||
flow(attracted, abs(differential), differential < 0)
|
||||
@@ -325,8 +332,10 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
|
||||
A.update_values()
|
||||
B.update_values()
|
||||
|
||||
if(A.compare(B)) return 1
|
||||
else return 0
|
||||
if(A.compare(B))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
|
||||
//A modified version of ShareRatio for spacing gas at the same rate as if it were going into a large airless room.
|
||||
@@ -432,7 +441,8 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
|
||||
|
||||
A.update_values()
|
||||
|
||||
if(dbg_output) to_chat(world, "Result: [abs(old_pressure - A.return_pressure())] kPa")
|
||||
if(dbg_output)
|
||||
to_chat(world, "Result: [abs(old_pressure - A.return_pressure())] kPa")
|
||||
|
||||
return abs(old_pressure - A.return_pressure())
|
||||
|
||||
|
||||
@@ -45,57 +45,87 @@ Class Procs:
|
||||
/connection_manager/proc/get(d)
|
||||
switch(d)
|
||||
if(NORTH)
|
||||
if(check(N)) return N
|
||||
else return null
|
||||
if(check(N))
|
||||
return N
|
||||
else
|
||||
return null
|
||||
if(SOUTH)
|
||||
if(check(S)) return S
|
||||
else return null
|
||||
if(check(S))
|
||||
return S
|
||||
else
|
||||
return null
|
||||
if(EAST)
|
||||
if(check(E)) return E
|
||||
else return null
|
||||
if(check(E))
|
||||
return E
|
||||
else
|
||||
return null
|
||||
if(WEST)
|
||||
if(check(W)) return W
|
||||
else return null
|
||||
if(check(W))
|
||||
return W
|
||||
else
|
||||
return null
|
||||
|
||||
#ifdef ZLEVELS
|
||||
if(UP)
|
||||
if(check(U)) return U
|
||||
else return null
|
||||
if(check(U))
|
||||
return U
|
||||
else
|
||||
return null
|
||||
if(DOWN)
|
||||
if(check(D)) return D
|
||||
else return null
|
||||
if(check(D))
|
||||
return D
|
||||
else
|
||||
return null
|
||||
#endif
|
||||
|
||||
/connection_manager/proc/place(connection/c, d)
|
||||
switch(d)
|
||||
if(NORTH) N = c
|
||||
if(SOUTH) S = c
|
||||
if(EAST) E = c
|
||||
if(WEST) W = c
|
||||
if(NORTH)
|
||||
N = c
|
||||
if(SOUTH)
|
||||
S = c
|
||||
if(EAST)
|
||||
E = c
|
||||
if(WEST)
|
||||
W = c
|
||||
|
||||
#ifdef ZLEVELS
|
||||
if(UP) U = c
|
||||
if(DOWN) D = c
|
||||
if(UP)
|
||||
U = c
|
||||
if(DOWN)
|
||||
D = c
|
||||
#endif
|
||||
|
||||
/connection_manager/proc/update_all()
|
||||
if(check(N)) N.update()
|
||||
if(check(S)) S.update()
|
||||
if(check(E)) E.update()
|
||||
if(check(W)) W.update()
|
||||
if(check(N))
|
||||
N.update()
|
||||
if(check(S))
|
||||
S.update()
|
||||
if(check(E))
|
||||
E.update()
|
||||
if(check(W))
|
||||
W.update()
|
||||
#ifdef ZLEVELS
|
||||
if(check(U)) U.update()
|
||||
if(check(D)) D.update()
|
||||
if(check(U))
|
||||
U.update()
|
||||
if(check(D))
|
||||
D.update()
|
||||
#endif
|
||||
|
||||
/connection_manager/proc/erase_all()
|
||||
if(check(N)) N.erase()
|
||||
if(check(S)) S.erase()
|
||||
if(check(E)) E.erase()
|
||||
if(check(W)) W.erase()
|
||||
if(check(N))
|
||||
N.erase()
|
||||
if(check(S))
|
||||
S.erase()
|
||||
if(check(E))
|
||||
E.erase()
|
||||
if(check(W))
|
||||
W.erase()
|
||||
#ifdef ZLEVELS
|
||||
if(check(U)) U.erase()
|
||||
if(check(D)) D.erase()
|
||||
if(check(U))
|
||||
U.erase()
|
||||
if(check(D))
|
||||
D.erase()
|
||||
#endif
|
||||
|
||||
/connection_manager/proc/check(connection/c)
|
||||
|
||||
@@ -105,7 +105,8 @@ Class Procs:
|
||||
|
||||
for(var/turf/simulated/S in turfs)
|
||||
simulated_turf_count++
|
||||
if(!(simulated_turf_count % 50000)) sleep(world.tick_lag)
|
||||
if(!(simulated_turf_count % 50000))
|
||||
sleep(world.tick_lag)
|
||||
S.update_air_properties()
|
||||
|
||||
to_chat(world, {"<font color='red'><b>Geometry initialized in [round(0.1*(world.timeofday-start_time),0.1)] seconds.</b>
|
||||
@@ -213,7 +214,8 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
ASSERT(isturf(B))
|
||||
#endif
|
||||
var/ablock = A.c_airblock(B)
|
||||
if(ablock == BLOCKED) return BLOCKED
|
||||
if(ablock == BLOCKED)
|
||||
return BLOCKED
|
||||
return ablock | B.c_airblock(A)
|
||||
|
||||
/datum/controller/air_system/proc/has_valid_zone(turf/simulated/T)
|
||||
@@ -248,7 +250,8 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
#endif
|
||||
|
||||
var/block = air_master.air_blocked(A,B)
|
||||
if(block & AIR_BLOCKED) return
|
||||
if(block & AIR_BLOCKED)
|
||||
return
|
||||
|
||||
var/direct = !(block & ZONE_BLOCKED)
|
||||
var/space = (!istype(B))
|
||||
@@ -262,13 +265,18 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
a_to_b = get_dir(A,B)
|
||||
b_to_a = get_dir(B,A)
|
||||
|
||||
if(!A.connections) A.connections = new
|
||||
if(!B.connections) B.connections = new
|
||||
if(!A.connections)
|
||||
A.connections = new
|
||||
if(!B.connections)
|
||||
B.connections = new
|
||||
|
||||
if(A.connections.get(a_to_b)) return
|
||||
if(B.connections.get(b_to_a)) return
|
||||
if(A.connections.get(a_to_b))
|
||||
return
|
||||
if(B.connections.get(b_to_a))
|
||||
return
|
||||
if(!space)
|
||||
if(A.zone == B.zone) return
|
||||
if(A.zone == B.zone)
|
||||
return
|
||||
|
||||
|
||||
var/connection/c = new /connection(A,B)
|
||||
@@ -276,13 +284,15 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
A.connections.place(c, a_to_b)
|
||||
B.connections.place(c, b_to_a)
|
||||
|
||||
if(direct) c.mark_direct()
|
||||
if(direct)
|
||||
c.mark_direct()
|
||||
|
||||
/datum/controller/air_system/proc/mark_for_update(turf/T)
|
||||
#ifdef ZASDBG
|
||||
ASSERT(isturf(T))
|
||||
#endif
|
||||
if(T.needs_air_update) return
|
||||
if(T.needs_air_update)
|
||||
return
|
||||
tiles_to_update |= T
|
||||
#ifdef ZASDBG
|
||||
T.overlays += mark
|
||||
@@ -293,7 +303,8 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
#ifdef ZASDBG
|
||||
ASSERT(istype(Z))
|
||||
#endif
|
||||
if(Z.needs_update) return
|
||||
if(Z.needs_update)
|
||||
return
|
||||
zones_to_update.Add(Z)
|
||||
Z.needs_update = 1
|
||||
|
||||
@@ -305,23 +316,30 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
|
||||
if(istype(B))
|
||||
for(var/connection_edge/zone/edge in A.edges)
|
||||
if(edge.contains_zone(B)) return edge
|
||||
if(edge.contains_zone(B))
|
||||
return edge
|
||||
var/connection_edge/edge = new/connection_edge/zone(A,B)
|
||||
edges.Add(edge)
|
||||
return edge
|
||||
else
|
||||
for(var/connection_edge/unsimulated/edge in A.edges)
|
||||
if(has_same_air(edge.B,B)) return edge
|
||||
if(has_same_air(edge.B,B))
|
||||
return edge
|
||||
var/connection_edge/edge = new/connection_edge/unsimulated(A,B)
|
||||
edges.Add(edge)
|
||||
return edge
|
||||
|
||||
/datum/controller/air_system/proc/has_same_air(turf/A, turf/B)
|
||||
if(A.oxygen != B.oxygen) return 0
|
||||
if(A.nitrogen != B.nitrogen) return 0
|
||||
if(A.toxins != B.toxins) return 0
|
||||
if(A.carbon_dioxide != B.carbon_dioxide) return 0
|
||||
if(A.temperature != B.temperature) return 0
|
||||
if(A.oxygen != B.oxygen)
|
||||
return 0
|
||||
if(A.nitrogen != B.nitrogen)
|
||||
return 0
|
||||
if(A.toxins != B.toxins)
|
||||
return 0
|
||||
if(A.carbon_dioxide != B.carbon_dioxide)
|
||||
return 0
|
||||
if(A.temperature != B.temperature)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/controller/air_system/proc/remove_edge(connection/c)
|
||||
|
||||
@@ -11,10 +11,12 @@ var/image/mark = image('icons/Testing/Zone.dmi', icon_state = "mark")
|
||||
|
||||
/turf/var/tmp/dbg_img
|
||||
/turf/proc/dbg(image/img, d = 0)
|
||||
if(d > 0) img.dir = d
|
||||
if(d > 0)
|
||||
img.dir = d
|
||||
overlays -= dbg_img
|
||||
overlays += img
|
||||
dbg_img = img
|
||||
|
||||
proc/soft_assert(thing,fail)
|
||||
if(!thing) message_admins(fail)
|
||||
if(!thing)
|
||||
message_admins(fail)
|
||||
@@ -109,8 +109,10 @@ Attach to transfer valve and open. BOOM.
|
||||
if(!ignite_temp || src.autoignition_temperature<ignite_temp)
|
||||
fuel_found += src.getFireFuel()
|
||||
for(var/atom/A in src)
|
||||
if(!A) continue
|
||||
if(ignite_temp && A.autoignition_temperature>ignite_temp) continue
|
||||
if(!A)
|
||||
continue
|
||||
if(ignite_temp && A.autoignition_temperature>ignite_temp)
|
||||
continue
|
||||
fuel_found += A.getFireFuel()
|
||||
return fuel_found
|
||||
|
||||
@@ -142,7 +144,8 @@ Attach to transfer valve and open. BOOM.
|
||||
|
||||
|
||||
/obj/fire/process()
|
||||
if(timestopped) return 0
|
||||
if(timestopped)
|
||||
return 0
|
||||
. = 1
|
||||
|
||||
// Get location and check if it is in a proper ZAS zone.
|
||||
@@ -210,8 +213,10 @@ Attach to transfer valve and open. BOOM.
|
||||
if(istype(enemy_tile))
|
||||
var/datum/gas_mixture/acs = enemy_tile.return_air()
|
||||
|
||||
if(!acs) continue
|
||||
if(!acs.check_recombustability(enemy_tile)) continue
|
||||
if(!acs)
|
||||
continue
|
||||
if(!acs.check_recombustability(enemy_tile))
|
||||
continue
|
||||
//If extinguisher mist passed over the turf it's trying to spread to, don't spread and
|
||||
//reduce firelevel.
|
||||
var/obj/effect/effect/foam/fire/W = locate() in enemy_tile
|
||||
@@ -277,7 +282,8 @@ datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
|
||||
var/can_use_turf=(T && istype(T))
|
||||
if(can_use_turf)
|
||||
for(var/atom/A in T)
|
||||
if(!A) continue
|
||||
if(!A)
|
||||
continue
|
||||
total_fuel += A.getFireFuel()
|
||||
|
||||
if (0 == total_fuel) // Fix zburn /0 runtime
|
||||
@@ -355,7 +361,8 @@ datum/gas_mixture/proc/zburn(var/turf/T, force_burn)
|
||||
// We have to check all objects in order to extinguish object fires.
|
||||
var/still_burning=0
|
||||
for(var/atom/A in T)
|
||||
if(!A) continue
|
||||
if(!A)
|
||||
continue
|
||||
if(!oxygen/* || A.autoignition_temperature > temperature*/)
|
||||
A.extinguish()
|
||||
continue
|
||||
@@ -388,7 +395,8 @@ datum/gas_mixture/proc/check_combustability(var/turf/T, var/objects)
|
||||
|
||||
if(objects && istype(T))
|
||||
for(var/atom/A in T)
|
||||
if(!A || !oxygen || A.autoignition_temperature > temperature) continue
|
||||
if(!A || !oxygen || A.autoignition_temperature > temperature)
|
||||
continue
|
||||
if(QUANTIZE(A.getFireFuel() * zas_settings.Get(/datum/ZAS_Setting/fire_consumption_rate)) >= A.volatility)
|
||||
return 1
|
||||
|
||||
@@ -447,7 +455,8 @@ datum/gas_mixture/proc/calculate_firelevel(var/turf/T)
|
||||
//Get heat transfer coefficients for clothing.
|
||||
|
||||
for(var/obj/item/clothing/C in src)
|
||||
if(is_holding_item(C)) continue
|
||||
if(is_holding_item(C))
|
||||
continue
|
||||
|
||||
if( C.max_heat_protection_temperature >= last_temperature )
|
||||
if(!is_slot_hidden(C.body_parts_covered,FULL_HEAD))
|
||||
|
||||
@@ -157,8 +157,10 @@ proc/ZConnect(turf/simulated/A,turf/simulated/B)
|
||||
return
|
||||
|
||||
//Make some preliminary checks to see if the connection is valid.
|
||||
if(!A.zone || !B.zone) return
|
||||
if(A.zone == B.zone) return
|
||||
if(!A.zone || !B.zone)
|
||||
return
|
||||
if(A.zone == B.zone)
|
||||
return
|
||||
|
||||
if(A.CanPass(null,B,0,1))
|
||||
return ZMerge(A.zone,B.zone)
|
||||
|
||||
@@ -258,7 +258,8 @@ var/global/ZAS_Settings/zas_settings = new
|
||||
|
||||
/ZAS_Settings/proc/Load()
|
||||
for(var/t in file2list("config/ZAS.txt"))
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
|
||||
@@ -32,7 +32,8 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
suit_contamination()
|
||||
|
||||
if(!pl_head_protected())
|
||||
if(prob(1)) suit_contamination() //Plasma can sometimes get through such an open suit.
|
||||
if(prob(1))
|
||||
suit_contamination() //Plasma can sometimes get through such an open suit.
|
||||
|
||||
//Cannot wash backpacks currently.
|
||||
// if(istype(back,/obj/item/weapon/storage/backpack))
|
||||
@@ -47,7 +48,8 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
return
|
||||
|
||||
//Contamination
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/CLOTH_CONTAMINATION)) contaminate()
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/CLOTH_CONTAMINATION))
|
||||
contaminate()
|
||||
|
||||
//Anything else requires them to not be dead.
|
||||
if(stat >= 2)
|
||||
@@ -59,7 +61,8 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/SKIN_BURNS))
|
||||
if(!pl_head_protected() || !pl_suit_protected())
|
||||
burn_skin(0.75)
|
||||
if(prob(20)) to_chat(src, "<span class='warning'>Your skin burns!</span>")
|
||||
if(prob(20))
|
||||
to_chat(src, "<span class='warning'>Your skin burns!</span>")
|
||||
updatehealth()
|
||||
|
||||
//Burn eyes if exposed.
|
||||
@@ -82,7 +85,8 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
return
|
||||
var/datum/organ/internal/eyes/E = internal_organs_by_name["eyes"]
|
||||
if(E)
|
||||
if(prob(20)) to_chat(src, "<span class='warning'>Your eyes burn!</span>")
|
||||
if(prob(20))
|
||||
to_chat(src, "<span class='warning'>Your eyes burn!</span>")
|
||||
E.damage += 2.5
|
||||
eye_blurry = min(eye_blurry+1.5,50)
|
||||
if (prob(max(0,E.damage - 15) + 1) && !eye_blind)
|
||||
@@ -103,16 +107,21 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||
//Checks if the suit is adequately sealed.
|
||||
if(wear_suit)
|
||||
if(zas_settings.Get(/datum/ZAS_Setting/PLASMAGUARD_ONLY))
|
||||
if(wear_suit.flags & PLASMAGUARD) return 1
|
||||
if(wear_suit.flags & PLASMAGUARD)
|
||||
return 1
|
||||
else
|
||||
if(is_slot_hidden(wear_suit.body_parts_covered,HIDEJUMPSUIT)) return 1
|
||||
if(is_slot_hidden(wear_suit.body_parts_covered,HIDEJUMPSUIT))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/suit_contamination()
|
||||
//Runs over the things that can be contaminated and does so.
|
||||
if(w_uniform) w_uniform.contaminate()
|
||||
if(shoes) shoes.contaminate()
|
||||
if(gloves) gloves.contaminate()
|
||||
if(w_uniform)
|
||||
w_uniform.contaminate()
|
||||
if(shoes)
|
||||
shoes.contaminate()
|
||||
if(gloves)
|
||||
gloves.contaminate()
|
||||
|
||||
/*
|
||||
/turf/Entered(atom/movable/Obj, atom/OldLoc)
|
||||
|
||||
@@ -148,7 +148,8 @@
|
||||
#endif
|
||||
|
||||
//Postpone this tile rather than exit, since a connection can still be made.
|
||||
if(!postponed) postponed = list()
|
||||
if(!postponed)
|
||||
postponed = list()
|
||||
postponed.Add(sim)
|
||||
|
||||
else
|
||||
@@ -178,7 +179,8 @@
|
||||
else
|
||||
|
||||
//Postponing connections to tiles until a zone is assured.
|
||||
if(!postponed) postponed = list()
|
||||
if(!postponed)
|
||||
postponed = list()
|
||||
postponed.Add(unsim)
|
||||
|
||||
if(!air_master.has_valid_zone(src)) //Still no zone, make a new one.
|
||||
@@ -197,7 +199,8 @@
|
||||
air_master.connect(src, T)
|
||||
|
||||
/turf/proc/post_update_air_properties()
|
||||
if(connections) connections.update_all()
|
||||
if(connections)
|
||||
connections.update_all()
|
||||
|
||||
/turf/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
|
||||
return 0
|
||||
@@ -262,7 +265,8 @@
|
||||
air.volume = CELL_VOLUME
|
||||
|
||||
/turf/simulated/proc/c_copy_air()
|
||||
if(!air) air = new/datum/gas_mixture
|
||||
if(!air)
|
||||
air = new/datum/gas_mixture
|
||||
air.copy_from(zone.air)
|
||||
air.group_multiplier = 1
|
||||
|
||||
|
||||
@@ -103,18 +103,23 @@ vs_control
|
||||
//var/which = input(user,"Choose a setting:") in L
|
||||
var/dat = ""
|
||||
for(var/ch in L)
|
||||
if(findtextEx(ch,"_RANDOM") || findtextEx(ch,"_DESC") || findtextEx(ch,"_METHOD") || findtextEx(ch,"_NAME")) continue
|
||||
if(findtextEx(ch,"_RANDOM") || findtextEx(ch,"_DESC") || findtextEx(ch,"_METHOD") || findtextEx(ch,"_NAME"))
|
||||
continue
|
||||
var/vw
|
||||
var/vw_desc = "No Description."
|
||||
var/vw_name = ch
|
||||
if(ch in plc.settings)
|
||||
vw = plc.vars[ch]
|
||||
if("[ch]_DESC" in plc.vars) vw_desc = plc.vars["[ch]_DESC"]
|
||||
if("[ch]_NAME" in plc.vars) vw_name = plc.vars["[ch]_NAME"]
|
||||
if("[ch]_DESC" in plc.vars)
|
||||
vw_desc = plc.vars["[ch]_DESC"]
|
||||
if("[ch]_NAME" in plc.vars)
|
||||
vw_name = plc.vars["[ch]_NAME"]
|
||||
else
|
||||
vw = vars[ch]
|
||||
if("[ch]_DESC" in vars) vw_desc = vars["[ch]_DESC"]
|
||||
if("[ch]_NAME" in vars) vw_name = vars["[ch]_NAME"]
|
||||
if("[ch]_DESC" in vars)
|
||||
vw_desc = vars["[ch]_DESC"]
|
||||
if("[ch]_NAME" in vars)
|
||||
vw_name = vars["[ch]_NAME"]
|
||||
dat += "<b>[vw_name] = [vw]</b> <A href='?src=\ref[src];changevar=[ch]'>\[Change\]</A><br>"
|
||||
dat += "<i>[vw_desc]</i><br><br>"
|
||||
user << browse(dat,"window=settings")
|
||||
|
||||
@@ -95,8 +95,10 @@
|
||||
overlays += wet_overlay
|
||||
|
||||
spawn(800)
|
||||
if (!istype(src)) return
|
||||
if(wet >= 2) return
|
||||
if (!istype(src))
|
||||
return
|
||||
if(wet >= 2)
|
||||
return
|
||||
wet = 0
|
||||
if(wet_overlay)
|
||||
overlays -= wet_overlay
|
||||
@@ -154,7 +156,8 @@
|
||||
air=T.return_air()
|
||||
|
||||
/turf/simulated/assume_air(datum/gas_mixture/giver)
|
||||
if(!giver) return 0
|
||||
if(!giver)
|
||||
return 0
|
||||
if(zone && zone.air && !iscatwalk(src))
|
||||
zone.air.merge(giver)
|
||||
return 1
|
||||
@@ -335,7 +338,8 @@
|
||||
//Another turf as an argument checks for windoors between here and there.
|
||||
for(var/obj/machinery/door/D in src)
|
||||
if(isnum(O) && O)
|
||||
if(!D.density) continue
|
||||
if(!D.density)
|
||||
continue
|
||||
if(istype(D,/obj/machinery/door/window))
|
||||
if(!istype(O))
|
||||
continue
|
||||
|
||||
@@ -350,8 +350,10 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
|
||||
A.update_values()
|
||||
B.update_values()
|
||||
|
||||
if(A.compare(B)) return 1
|
||||
else return 0
|
||||
if(A.compare(B))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles, dbg_output)
|
||||
//A modified version of ShareRatio for spacing gas at the same rate as if it were going into a large airless room.
|
||||
|
||||
@@ -105,7 +105,8 @@ Class Procs:
|
||||
#endif
|
||||
|
||||
/zone/proc/rebuild()
|
||||
if(invalid) return //Short circuit for explosions where rebuild is called many times over.
|
||||
if(invalid)
|
||||
return //Short circuit for explosions where rebuild is called many times over.
|
||||
c_invalidate()
|
||||
for(var/turf/simulated/T in contents)
|
||||
//T.dbg(invalid_zone)
|
||||
@@ -134,12 +135,14 @@ Class Procs:
|
||||
to_chat(M, "Simulated: [contents.len] ([air.group_multiplier])")
|
||||
// to_chat(M, "Unsimulated: [unsimulated_contents.len]")
|
||||
// to_chat(M, "Edges: [edges.len]")
|
||||
if(invalid) to_chat(M, "Invalid!")
|
||||
if(invalid)
|
||||
to_chat(M, "Invalid!")
|
||||
var/zone_edges = 0
|
||||
var/space_edges = 0
|
||||
var/space_coefficient = 0
|
||||
for(var/connection_edge/E in edges)
|
||||
if(E.type == /connection_edge/zone) zone_edges++
|
||||
if(E.type == /connection_edge/zone)
|
||||
zone_edges++
|
||||
else
|
||||
space_edges++
|
||||
space_coefficient += E.coefficient
|
||||
|
||||
@@ -773,7 +773,8 @@ What are the archived variables for?
|
||||
|
||||
if(sharer.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in sharer.trace_gases)
|
||||
if(trace_gas.type in trace_types_considered) continue
|
||||
if(trace_gas.type in trace_types_considered)
|
||||
continue
|
||||
else
|
||||
var/datum/gas/corresponding
|
||||
var/delta = 0
|
||||
@@ -1059,7 +1060,8 @@ What are the archived variables for?
|
||||
//Called by: Airgroups trying to rebuild
|
||||
//Inputs: Gas mix to compare
|
||||
//Outputs: 1 if can rebuild, 0 if not.
|
||||
if(!sample) return 0
|
||||
if(!sample)
|
||||
return 0
|
||||
|
||||
if((abs(oxygen-sample.oxygen) > MINIMUM_AIR_TO_SUSPEND) && \
|
||||
((oxygen < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen) || (oxygen > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*sample.oxygen)))
|
||||
|
||||
@@ -18,9 +18,11 @@
|
||||
//Get our potential maps
|
||||
//testing("starting in [root]")
|
||||
for(var/potential in flist(root))
|
||||
if(copytext(potential,-1,0 != "/")) continue // Not a directory, ignore it.
|
||||
if(copytext(potential,-1,0 != "/"))
|
||||
continue // Not a directory, ignore it.
|
||||
//testing("Inside [root + potential]")
|
||||
if(!recursion_limit) break
|
||||
if(!recursion_limit)
|
||||
break
|
||||
//our current working directory
|
||||
var/path = root + potential
|
||||
//The DMB that has the map we want.
|
||||
@@ -34,9 +36,12 @@
|
||||
if(copytext(binaries,-15,0 == "playercount.txt"))
|
||||
var/list/lines = file2list(path+binaries)
|
||||
for(var/line in lines)
|
||||
if(findtext(line,"max")) max = text2num(copytext(line,5,0))
|
||||
else if(findtext(line,"min")) min = text2num(copytext(line,5,0))
|
||||
else warning("Our file had excessive lines, skipping.")
|
||||
if(findtext(line,"max"))
|
||||
max = text2num(copytext(line,5,0))
|
||||
else if(findtext(line,"min"))
|
||||
min = text2num(copytext(line,5,0))
|
||||
else
|
||||
warning("Our file had excessive lines, skipping.")
|
||||
if(!isnull(min) && !isnull(max))
|
||||
if((min != -1) && clients.len < min)
|
||||
skipping = 1
|
||||
|
||||
@@ -118,7 +118,8 @@
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/turf/T in range(radius, centerturf))
|
||||
if(!T) continue
|
||||
if(!T)
|
||||
continue
|
||||
var/dx = T.x - centerturf.x
|
||||
var/dy = T.y - centerturf.y
|
||||
if(dx*dx + dy*dy <= rsq)
|
||||
@@ -330,7 +331,8 @@ var/list/DummyCache = list()
|
||||
. += G.client
|
||||
|
||||
/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
|
||||
if(!isobj(O)) O = new /obj/screen/text()
|
||||
if(!isobj(O))
|
||||
O = new /obj/screen/text()
|
||||
O.maptext = maptext
|
||||
O.maptext_height = maptext_height
|
||||
O.maptext_width = maptext_width
|
||||
@@ -338,8 +340,10 @@ var/list/DummyCache = list()
|
||||
return O
|
||||
|
||||
/proc/Show2Group4Delay(obj/O, list/group, delay=0)
|
||||
if(!isobj(O)) return
|
||||
if(!group) group = clients
|
||||
if(!isobj(O))
|
||||
return
|
||||
if(!group)
|
||||
group = clients
|
||||
for(var/client/C in group)
|
||||
C.screen += O
|
||||
if(delay)
|
||||
|
||||
@@ -2,7 +2,8 @@ proc
|
||||
getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N
|
||||
var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A.
|
||||
for(var/I in A.overlays)//For every image in overlays. var/image/I will not work, don't try it.
|
||||
if(I:layer>A.layer) continue//If layer is greater than what we need, skip it.
|
||||
if(I:layer>A.layer)
|
||||
continue//If layer is greater than what we need, skip it.
|
||||
var/icon/image_overlay = new(I:icon,I:icon_state)//Blend only works with icon objects.
|
||||
//Also, icons cannot directly set icon_state. Slower than changing variables but whatever.
|
||||
alpha_mask.Blend(image_overlay,ICON_OR)//OR so they are lumped together in a nice overlay.
|
||||
@@ -18,10 +19,14 @@ proc
|
||||
for(var/i=0,i<5,i++)//And now we add it as overlays. It's faster than creating an icon and then merging it.
|
||||
var/image/I = image("icon" = opacity_icon, "icon_state" = A.icon_state, "layer" = layer+0.8)//So it's above other stuff but below weapons and the like.
|
||||
switch(i)//Now to determine offset so the result is somewhat blurred.
|
||||
if(1) I.pixel_x--
|
||||
if(2) I.pixel_x++
|
||||
if(3) I.pixel_y--
|
||||
if(4) I.pixel_y++
|
||||
if(1)
|
||||
I.pixel_x--
|
||||
if(2)
|
||||
I.pixel_x++
|
||||
if(3)
|
||||
I.pixel_y--
|
||||
if(4)
|
||||
I.pixel_y++
|
||||
overlays += I//And finally add the overlay.
|
||||
|
||||
/proc/getHologramIcon(icon/A, safety=1)//If safety is on, a new icon is not created.
|
||||
@@ -80,8 +85,10 @@ proc
|
||||
return composite
|
||||
|
||||
proc/adjust_brightness(var/color, var/value)
|
||||
if (!color) return "#FFFFFF"
|
||||
if (!value) return color
|
||||
if (!color)
|
||||
return "#FFFFFF"
|
||||
if (!value)
|
||||
return color
|
||||
|
||||
var/list/RGB = ReadRGB(color)
|
||||
RGB[1] = Clamp(RGB[1]+value,0,255)
|
||||
|
||||
@@ -137,7 +137,8 @@ proc/arctan(x)
|
||||
* http://i.imgur.com/8Pu0x7M.png
|
||||
*/
|
||||
/proc/unmix(x, a, b, min = 0, max = 1)
|
||||
if(a==b) return 1
|
||||
if(a==b)
|
||||
return 1
|
||||
return Clamp( (b - x)/(b - a), min, max )
|
||||
|
||||
/proc/Mean(...)
|
||||
@@ -168,10 +169,12 @@ proc/arctan(x)
|
||||
. = list()
|
||||
var/d = b*b - 4 * a * c
|
||||
var/bottom = 2 * a
|
||||
if(d < 0) return
|
||||
if(d < 0)
|
||||
return
|
||||
var/root = sqrt(d)
|
||||
. += (-b + root) / bottom
|
||||
if(!d) return
|
||||
if(!d)
|
||||
return
|
||||
. += (-b - root) / bottom
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,14 +19,22 @@ proc/random_hair_style(gender, species = "Human")
|
||||
|
||||
/proc/GetOppositeDir(var/dir)
|
||||
switch(dir)
|
||||
if(NORTH) return SOUTH
|
||||
if(SOUTH) return NORTH
|
||||
if(EAST) return WEST
|
||||
if(WEST) return EAST
|
||||
if(SOUTHWEST) return NORTHEAST
|
||||
if(NORTHWEST) return SOUTHEAST
|
||||
if(NORTHEAST) return SOUTHWEST
|
||||
if(SOUTHEAST) return NORTHWEST
|
||||
if(NORTH)
|
||||
return SOUTH
|
||||
if(SOUTH)
|
||||
return NORTH
|
||||
if(EAST)
|
||||
return WEST
|
||||
if(WEST)
|
||||
return EAST
|
||||
if(SOUTHWEST)
|
||||
return NORTHEAST
|
||||
if(NORTHWEST)
|
||||
return SOUTHEAST
|
||||
if(NORTHEAST)
|
||||
return SOUTHWEST
|
||||
if(SOUTHEAST)
|
||||
return NORTHWEST
|
||||
return 0
|
||||
|
||||
proc/random_facial_hair_style(gender, species = "Human")
|
||||
@@ -62,49 +70,79 @@ proc/random_name(gender, speciesName = "Human")
|
||||
proc/random_skin_tone(species = "Human")
|
||||
if(species == "Human")
|
||||
switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino"))
|
||||
if("caucasian") . = -10
|
||||
if("afroamerican") . = -115
|
||||
if("african") . = -165
|
||||
if("latino") . = -55
|
||||
if("albino") . = 34
|
||||
else . = rand(-185,34)
|
||||
if("caucasian")
|
||||
. = -10
|
||||
if("afroamerican")
|
||||
. = -115
|
||||
if("african")
|
||||
. = -165
|
||||
if("latino")
|
||||
. = -55
|
||||
if("albino")
|
||||
. = 34
|
||||
else
|
||||
. = rand(-185,34)
|
||||
return min(max( .+rand(-25, 25), -185),34)
|
||||
else if(species == "Vox")
|
||||
. = rand(1,3)
|
||||
return .
|
||||
else return 0
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/skintone2racedescription(tone, species = "Human")
|
||||
if(species == "Human")
|
||||
switch (tone)
|
||||
if(30 to INFINITY) return "albino"
|
||||
if(20 to 30) return "pale"
|
||||
if(5 to 15) return "light skinned"
|
||||
if(-10 to 5) return "white"
|
||||
if(-25 to -10) return "tan"
|
||||
if(-45 to -25) return "darker skinned"
|
||||
if(-65 to -45) return "brown"
|
||||
if(-INFINITY to -65) return "black"
|
||||
else return "unknown"
|
||||
if(30 to INFINITY)
|
||||
return "albino"
|
||||
if(20 to 30)
|
||||
return "pale"
|
||||
if(5 to 15)
|
||||
return "light skinned"
|
||||
if(-10 to 5)
|
||||
return "white"
|
||||
if(-25 to -10)
|
||||
return "tan"
|
||||
if(-45 to -25)
|
||||
return "darker skinned"
|
||||
if(-65 to -45)
|
||||
return "brown"
|
||||
if(-INFINITY to -65)
|
||||
return "black"
|
||||
else
|
||||
return "unknown"
|
||||
else if(species == "Vox")
|
||||
switch(tone)
|
||||
if(2) return "brown"
|
||||
if(3) return "gray"
|
||||
else return "green"
|
||||
else return "unknown"
|
||||
if(2)
|
||||
return "brown"
|
||||
if(3)
|
||||
return "gray"
|
||||
else
|
||||
return "green"
|
||||
else
|
||||
return "unknown"
|
||||
|
||||
proc/age2agedescription(age)
|
||||
switch(age)
|
||||
if(0 to 1) return "infant"
|
||||
if(1 to 3) return "toddler"
|
||||
if(3 to 13) return "child"
|
||||
if(13 to 19) return "teenager"
|
||||
if(19 to 30) return "young adult"
|
||||
if(30 to 45) return "adult"
|
||||
if(45 to 60) return "middle-aged"
|
||||
if(60 to 70) return "aging"
|
||||
if(70 to INFINITY) return "elderly"
|
||||
else return "unknown"
|
||||
if(0 to 1)
|
||||
return "infant"
|
||||
if(1 to 3)
|
||||
return "toddler"
|
||||
if(3 to 13)
|
||||
return "child"
|
||||
if(13 to 19)
|
||||
return "teenager"
|
||||
if(19 to 30)
|
||||
return "young adult"
|
||||
if(30 to 45)
|
||||
return "adult"
|
||||
if(45 to 60)
|
||||
return "middle-aged"
|
||||
if(60 to 70)
|
||||
return "aging"
|
||||
if(70 to INFINITY)
|
||||
return "elderly"
|
||||
else
|
||||
return "unknown"
|
||||
|
||||
proc/RoundHealth(health)
|
||||
switch(health)
|
||||
|
||||
@@ -12,35 +12,50 @@
|
||||
return default
|
||||
|
||||
/proc/sanitize_inlist(value, list/List, default)
|
||||
if(value in List) return value
|
||||
if(default) return default
|
||||
if(List && List.len)return List[1]
|
||||
if(value in List)
|
||||
return value
|
||||
if(default)
|
||||
return default
|
||||
if(List && List.len)
|
||||
return List[1]
|
||||
|
||||
|
||||
|
||||
//more specialised stuff
|
||||
/proc/sanitize_gender(gender,neuter=0,plural=0, default="male")
|
||||
switch(gender)
|
||||
if(MALE, FEMALE)return gender
|
||||
if(MALE, FEMALE)
|
||||
return gender
|
||||
if(NEUTER)
|
||||
if(neuter) return gender
|
||||
else return default
|
||||
if(neuter)
|
||||
return gender
|
||||
else
|
||||
return default
|
||||
if(PLURAL)
|
||||
if(plural) return gender
|
||||
else return default
|
||||
if(plural)
|
||||
return gender
|
||||
else
|
||||
return default
|
||||
return default
|
||||
|
||||
/proc/sanitize_hexcolor(color, default="#000000")
|
||||
if(!istext(color)) return default
|
||||
if(!istext(color))
|
||||
return default
|
||||
var/len = length(color)
|
||||
if(len != 7 && len !=4) return default
|
||||
if(text2ascii(color,1) != 35) return default //35 is the ascii code for "#"
|
||||
if(len != 7 && len !=4)
|
||||
return default
|
||||
if(text2ascii(color,1) != 35)
|
||||
return default //35 is the ascii code for "#"
|
||||
. = "#"
|
||||
for(var/i=2,i<=len,i++)
|
||||
var/ascii = text2ascii(color,i)
|
||||
switch(ascii)
|
||||
if(48 to 57) . += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102) . += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70) . += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
else return default
|
||||
if(48 to 57)
|
||||
. += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102)
|
||||
. += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70)
|
||||
. += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
else
|
||||
return default
|
||||
return .
|
||||
|
||||
@@ -149,47 +149,57 @@
|
||||
|
||||
// a .. z
|
||||
if(97 to 122) //Lowercase Letters
|
||||
if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else t_out += ascii2text(ascii_char)
|
||||
if(last_char_group<2)
|
||||
t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// 0 .. 9
|
||||
if(48 to 57) //Numbers
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 3
|
||||
|
||||
// ' - .
|
||||
if(39,45,46) //Common name punctuation
|
||||
if(!last_char_group) continue
|
||||
if(!last_char_group)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
// ~ | @ : # $ % & * +
|
||||
if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI)
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
//Space
|
||||
if(32)
|
||||
if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string
|
||||
if(last_char_group <= 1)
|
||||
continue //suppress double-spaces and spaces at start of string
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 1
|
||||
else
|
||||
return
|
||||
|
||||
if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
if(number_of_alphanumeric < 2)
|
||||
return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
if(last_char_group == 1)
|
||||
t_out = copytext(t_out,1,length(t_out)) //removes the last character (in this case a space)
|
||||
|
||||
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai","plating")) //prevents these common metagamey names
|
||||
if(cmptext(t_out,bad_name)) return //(not case sensitive)
|
||||
if(cmptext(t_out,bad_name))
|
||||
return //(not case sensitive)
|
||||
|
||||
return t_out
|
||||
|
||||
@@ -367,8 +377,10 @@ proc/checkhtml(var/t)
|
||||
|
||||
var/global/list/watt_suffixes = list("W", "KW", "MW", "GW", "TW", "PW", "EW", "ZW", "YW")
|
||||
/proc/format_watts(var/number)
|
||||
if(number<0) return "-[format_watts(number)]"
|
||||
if(number==0) return "0 W"
|
||||
if(number<0)
|
||||
return "-[format_watts(number)]"
|
||||
if(number==0)
|
||||
return "0 W"
|
||||
|
||||
var/i=1
|
||||
while (round(number/1000) >= 1)
|
||||
|
||||
@@ -60,9 +60,12 @@
|
||||
var/ph
|
||||
var/pm
|
||||
var/ps
|
||||
if(hh < 10) ph = "0"
|
||||
if(mm < 10) pm = "0"
|
||||
if(ss < 10) ps = "0"
|
||||
if(hh < 10)
|
||||
ph = "0"
|
||||
if(mm < 10)
|
||||
pm = "0"
|
||||
if(ss < 10)
|
||||
ps = "0"
|
||||
return"[ph][hh]:[pm][mm]:[ps][ss]"
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/client/var/timed_alert/timed_alert
|
||||
|
||||
/client/proc/timed_alert(time = 300,target,message,title,button1,button2,button3)
|
||||
if(timed_alert) return ""
|
||||
if(timed_alert)
|
||||
return ""
|
||||
|
||||
timed_alert = new(target,message,title,button1,button2,button3)
|
||||
sleep(time)
|
||||
|
||||
@@ -53,7 +53,8 @@ proc/tg_jointext(list/list, glue = ",")
|
||||
//Case Sensitive!
|
||||
/proc/splittextEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
if(delim_len < 1)
|
||||
return list(text)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
@@ -116,41 +117,65 @@ proc/tg_jointext(list/list, glue = ",")
|
||||
//Converts an angle (degrees) into an ss13 direction
|
||||
/proc/angle2dir(var/degree)
|
||||
degree = ((degree+22.5)%365)
|
||||
if(degree < 45) return NORTH
|
||||
if(degree < 90) return NORTHEAST
|
||||
if(degree < 135) return EAST
|
||||
if(degree < 180) return SOUTHEAST
|
||||
if(degree < 225) return SOUTH
|
||||
if(degree < 270) return SOUTHWEST
|
||||
if(degree < 315) return WEST
|
||||
if(degree < 45)
|
||||
return NORTH
|
||||
if(degree < 90)
|
||||
return NORTHEAST
|
||||
if(degree < 135)
|
||||
return EAST
|
||||
if(degree < 180)
|
||||
return SOUTHEAST
|
||||
if(degree < 225)
|
||||
return SOUTH
|
||||
if(degree < 270)
|
||||
return SOUTHWEST
|
||||
if(degree < 315)
|
||||
return WEST
|
||||
return NORTH|WEST
|
||||
|
||||
//returns the north-zero clockwise angle in degrees, given a direction
|
||||
|
||||
/proc/dir2angle(var/D)
|
||||
switch(D)
|
||||
if(NORTH) return 0
|
||||
if(SOUTH) return 180
|
||||
if(EAST) return 90
|
||||
if(WEST) return 270
|
||||
if(NORTHEAST) return 45
|
||||
if(SOUTHEAST) return 135
|
||||
if(NORTHWEST) return 315
|
||||
if(SOUTHWEST) return 225
|
||||
else return null
|
||||
if(NORTH)
|
||||
return 0
|
||||
if(SOUTH)
|
||||
return 180
|
||||
if(EAST)
|
||||
return 90
|
||||
if(WEST)
|
||||
return 270
|
||||
if(NORTHEAST)
|
||||
return 45
|
||||
if(SOUTHEAST)
|
||||
return 135
|
||||
if(NORTHWEST)
|
||||
return 315
|
||||
if(SOUTHWEST)
|
||||
return 225
|
||||
else
|
||||
return null
|
||||
|
||||
//returns the east-zero counter-clockwise angle in degrees, given a direction
|
||||
|
||||
/proc/dir2angle_t(const/D)
|
||||
switch(D)
|
||||
if(EAST) return 0
|
||||
if(NORTHEAST) return 45
|
||||
if(NORTH) return 90
|
||||
if(NORTHWEST) return 135
|
||||
if(WEST) return 180
|
||||
if(SOUTHWEST) return 225
|
||||
if(SOUTH) return 270
|
||||
if(SOUTHEAST) return 315
|
||||
if(EAST)
|
||||
return 0
|
||||
if(NORTHEAST)
|
||||
return 45
|
||||
if(NORTH)
|
||||
return 90
|
||||
if(NORTHWEST)
|
||||
return 135
|
||||
if(WEST)
|
||||
return 180
|
||||
if(SOUTHWEST)
|
||||
return 225
|
||||
if(SOUTH)
|
||||
return 270
|
||||
if(SOUTHEAST)
|
||||
return 315
|
||||
|
||||
//Returns the angle in english
|
||||
/proc/angle2text(var/degree)
|
||||
@@ -159,36 +184,59 @@ proc/tg_jointext(list/list, glue = ",")
|
||||
//Converts a blend_mode constant to one acceptable to icon.Blend()
|
||||
/proc/blendMode2iconMode(blend_mode)
|
||||
switch(blend_mode)
|
||||
if(BLEND_MULTIPLY) return ICON_MULTIPLY
|
||||
if(BLEND_ADD) return ICON_ADD
|
||||
if(BLEND_SUBTRACT) return ICON_SUBTRACT
|
||||
else return ICON_OVERLAY
|
||||
if(BLEND_MULTIPLY)
|
||||
return ICON_MULTIPLY
|
||||
if(BLEND_ADD)
|
||||
return ICON_ADD
|
||||
if(BLEND_SUBTRACT)
|
||||
return ICON_SUBTRACT
|
||||
else
|
||||
return ICON_OVERLAY
|
||||
|
||||
//Converts a rights bitfield into a string
|
||||
/proc/rights2text(rights,seperator="")
|
||||
if(rights & R_BUILDMODE) . += "[seperator]+BUILDMODE"
|
||||
if(rights & R_ADMIN) . += "[seperator]+ADMIN"
|
||||
if(rights & R_BAN) . += "[seperator]+BAN"
|
||||
if(rights & R_FUN) . += "[seperator]+FUN"
|
||||
if(rights & R_SERVER) . += "[seperator]+SERVER"
|
||||
if(rights & R_DEBUG) . += "[seperator]+DEBUG"
|
||||
if(rights & R_POSSESS) . += "[seperator]+POSSESS"
|
||||
if(rights & R_PERMISSIONS) . += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_POLLING) . += "[seperator]+POLLING"
|
||||
if(rights & R_STEALTH) . += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE) . += "[seperator]+REJUVINATE"
|
||||
if(rights & R_VAREDIT) . += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
|
||||
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
|
||||
if(rights & R_MOD) . += "[seperator]+MODERATOR"
|
||||
if(rights & R_ADMINBUS) . += "[seperator]+ADMINBUS"
|
||||
if(rights & R_BUILDMODE)
|
||||
. += "[seperator]+BUILDMODE"
|
||||
if(rights & R_ADMIN)
|
||||
. += "[seperator]+ADMIN"
|
||||
if(rights & R_BAN)
|
||||
. += "[seperator]+BAN"
|
||||
if(rights & R_FUN)
|
||||
. += "[seperator]+FUN"
|
||||
if(rights & R_SERVER)
|
||||
. += "[seperator]+SERVER"
|
||||
if(rights & R_DEBUG)
|
||||
. += "[seperator]+DEBUG"
|
||||
if(rights & R_POSSESS)
|
||||
. += "[seperator]+POSSESS"
|
||||
if(rights & R_PERMISSIONS)
|
||||
. += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_POLLING)
|
||||
. += "[seperator]+POLLING"
|
||||
if(rights & R_STEALTH)
|
||||
. += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE)
|
||||
. += "[seperator]+REJUVINATE"
|
||||
if(rights & R_VAREDIT)
|
||||
. += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS)
|
||||
. += "[seperator]+SOUND"
|
||||
if(rights & R_SPAWN)
|
||||
. += "[seperator]+SPAWN"
|
||||
if(rights & R_MOD)
|
||||
. += "[seperator]+MODERATOR"
|
||||
if(rights & R_ADMINBUS)
|
||||
. += "[seperator]+ADMINBUS"
|
||||
return .
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
switch(ui_style)
|
||||
if("old") return 'icons/mob/screen1_old.dmi'
|
||||
if("Orange") return 'icons/mob/screen1_Orange.dmi'
|
||||
else return 'icons/mob/screen1_Midnight.dmi'
|
||||
if("old")
|
||||
return 'icons/mob/screen1_old.dmi'
|
||||
if("Orange")
|
||||
return 'icons/mob/screen1_Orange.dmi'
|
||||
else
|
||||
return 'icons/mob/screen1_Midnight.dmi'
|
||||
|
||||
/proc/num2septext(var/theNum, var/sigFig = 7,var/sep=",") // default sigFig (1,000,000)
|
||||
var/finalNum = num2text(theNum, sigFig)
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
CRASH(msg)
|
||||
|
||||
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
|
||||
if(!start || !end) return 0
|
||||
if(!start || !end)
|
||||
return 0
|
||||
var/dy
|
||||
var/dx
|
||||
dy=(WORLD_ICON_SIZE*end.y+end.pixel_y)-(WORLD_ICON_SIZE*start.y+start.pixel_y)
|
||||
@@ -98,19 +99,27 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
//Now to find a box from center location and make that our destination.
|
||||
for(var/turf/T in block(locate(center.x+b1xerror,center.y+b1yerror,location.z), locate(center.x+b2xerror,center.y+b2yerror,location.z) ))
|
||||
if(density&&T.density) continue//If density was specified.
|
||||
if(T.x>world.maxx || T.x<1) continue//Don't want them to teleport off the map.
|
||||
if(T.y>world.maxy || T.y<1) continue
|
||||
if(density&&T.density)
|
||||
continue//If density was specified.
|
||||
if(T.x>world.maxx || T.x<1)
|
||||
continue//Don't want them to teleport off the map.
|
||||
if(T.y>world.maxy || T.y<1)
|
||||
continue
|
||||
destination_list += T
|
||||
if(destination_list.len)
|
||||
destination = pick(destination_list)
|
||||
else return
|
||||
else
|
||||
return
|
||||
|
||||
else//Same deal here.
|
||||
if(density&&destination.density) return
|
||||
if(destination.x>world.maxx || destination.x<1) return
|
||||
if(destination.y>world.maxy || destination.y<1) return
|
||||
else return
|
||||
if(density&&destination.density)
|
||||
return
|
||||
if(destination.x>world.maxx || destination.x<1)
|
||||
return
|
||||
if(destination.y>world.maxy || destination.y<1)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
return destination
|
||||
|
||||
@@ -345,8 +354,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/select_active_ai(var/mob/user)
|
||||
var/list/ais = active_ais()
|
||||
if(ais.len)
|
||||
if(user) . = input(usr,"AI signals detected:", "AI selection") in ais
|
||||
else . = pick(ais)
|
||||
if(user)
|
||||
. = input(usr,"AI signals detected:", "AI selection") in ais
|
||||
else
|
||||
. = pick(ais)
|
||||
return .
|
||||
|
||||
/proc/get_sorted_mobs()
|
||||
@@ -480,7 +491,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
var/client/C
|
||||
var/key
|
||||
|
||||
if(!whom) return "*null*"
|
||||
if(!whom)
|
||||
return "*null*"
|
||||
if(istype(whom, /client))
|
||||
C = whom
|
||||
M = C.mob
|
||||
@@ -507,8 +519,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
. += key
|
||||
|
||||
if(include_link)
|
||||
if(C) . += "</a>"
|
||||
else . += " (DC)"
|
||||
if(C)
|
||||
. += "</a>"
|
||||
else
|
||||
. += " (DC)"
|
||||
else
|
||||
. += "*no key*"
|
||||
|
||||
@@ -542,7 +556,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
// Otherwise, the user mob's machine var will be reset directly.
|
||||
//
|
||||
/proc/onclose(mob/user, windowid, var/atom/ref=null)
|
||||
if(!user.client) return
|
||||
if(!user.client)
|
||||
return
|
||||
var/param = "null"
|
||||
if(ref)
|
||||
param = "\ref[ref]"
|
||||
@@ -647,10 +662,13 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
var/steps = 0
|
||||
|
||||
while(current != target_turf)
|
||||
if(steps > length) return 0
|
||||
if(current.opacity) return 0
|
||||
if(steps > length)
|
||||
return 0
|
||||
if(current.opacity)
|
||||
return 0
|
||||
for(var/atom/A in current)
|
||||
if(A.opacity) return 0
|
||||
if(A.opacity)
|
||||
return 0
|
||||
current = get_step_towards(current, target_turf)
|
||||
steps++
|
||||
|
||||
@@ -658,7 +676,8 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
|
||||
/proc/is_blocked_turf(var/turf/T)
|
||||
var/cant_pass = 0
|
||||
if(T.density) cant_pass = 1
|
||||
if(T.density)
|
||||
cant_pass = 1
|
||||
for(var/atom/A in T)
|
||||
if(A.density)//&&A.anchored
|
||||
cant_pass = 1
|
||||
@@ -687,13 +706,17 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
turf_last2 = get_step(turf_last2,dir_alt2)
|
||||
breakpoint++
|
||||
|
||||
if(!free_tile) return get_step(ref, base_dir)
|
||||
else return get_step_towards(ref,free_tile)
|
||||
if(!free_tile)
|
||||
return get_step(ref, base_dir)
|
||||
else
|
||||
return get_step_towards(ref,free_tile)
|
||||
|
||||
else return get_step(ref, base_dir)
|
||||
else
|
||||
return get_step(ref, base_dir)
|
||||
|
||||
/proc/do_mob(var/mob/user , var/mob/target, var/delay = 30, var/numticks = 10) //This is quite an ugly solution but i refuse to use the old request system.
|
||||
if(!user || !target) return 0
|
||||
if(!user || !target)
|
||||
return 0
|
||||
var/user_loc = user.loc
|
||||
var/target_loc = target.loc
|
||||
var/holding = user.get_active_hand()
|
||||
@@ -719,18 +742,24 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
if(progbar)
|
||||
progbar.icon_state = "prog_bar_stopped"
|
||||
spawn(2)
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 0
|
||||
if ( user.loc != user_loc || target.loc != target_loc || user.get_active_hand() != holding || user.isStunned())
|
||||
if(progbar)
|
||||
progbar.icon_state = "prog_bar_stopped"
|
||||
spawn(2)
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 0
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 1
|
||||
|
||||
/proc/do_after(var/mob/user as mob, var/atom/target, var/delay as num, var/numticks = 10, var/needhand = TRUE)
|
||||
@@ -774,25 +803,33 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
if(progbar)
|
||||
progbar.icon_state = "prog_bar_stopped"
|
||||
spawn(2)
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 0
|
||||
if(needhand && !(user.get_active_hand() == holding)) //Sometimes you don't want the user to have to keep their active hand
|
||||
if(progbar)
|
||||
progbar.icon_state = "prog_bar_stopped"
|
||||
spawn(2)
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 0
|
||||
if(user && user.client) user.client.images -= progbar
|
||||
if(progbar) progbar.loc = null
|
||||
if(user && user.client)
|
||||
user.client.images -= progbar
|
||||
if(progbar)
|
||||
progbar.loc = null
|
||||
return 1
|
||||
|
||||
//Takes: Anything that could possibly have variables and a varname to check.
|
||||
//Returns: 1 if found, 0 if not.
|
||||
/proc/hasvar(var/datum/A, var/varname)
|
||||
if(A.vars.Find(lowertext(varname))) return 1
|
||||
else return 0
|
||||
if(A.vars.Find(lowertext(varname)))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Returns sortedAreas list if populated
|
||||
//else populates the list first before returning it
|
||||
@@ -809,22 +846,27 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all areas of that type in the world.
|
||||
/proc/get_areas(var/areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/theareas = new/list()
|
||||
for(var/area/N in areas)
|
||||
if(istype(N, areatype)) theareas += N
|
||||
if(istype(N, areatype))
|
||||
theareas += N
|
||||
return theareas
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all turfs in areas of that type of that type in the world.
|
||||
/proc/get_area_turfs(var/areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
@@ -841,8 +883,10 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world.
|
||||
/proc/get_area_all_atoms(var/areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
@@ -904,7 +948,8 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
|
||||
// Movement based on lower left corner. Tiles that do not fit
|
||||
// into the new area will not be moved.
|
||||
|
||||
if(!A || !src) return 0
|
||||
if(!A || !src)
|
||||
return 0
|
||||
|
||||
var/list/turfs_src = get_area_turfs(src.type)
|
||||
var/list/turfs_trg = get_area_turfs(A.type)
|
||||
@@ -912,14 +957,18 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
|
||||
var/src_min_x = 0
|
||||
var/src_min_y = 0
|
||||
for (var/turf/T in turfs_src)
|
||||
if(T.x < src_min_x || !src_min_x) src_min_x = T.x
|
||||
if(T.y < src_min_y || !src_min_y) src_min_y = T.y
|
||||
if(T.x < src_min_x || !src_min_x)
|
||||
src_min_x = T.x
|
||||
if(T.y < src_min_y || !src_min_y)
|
||||
src_min_y = T.y
|
||||
|
||||
var/trg_min_x = 0
|
||||
var/trg_min_y = 0
|
||||
for (var/turf/T in turfs_trg)
|
||||
if(T.x < trg_min_x || !trg_min_x) trg_min_x = T.x
|
||||
if(T.y < trg_min_y || !trg_min_y) trg_min_y = T.y
|
||||
if(T.x < trg_min_x || !trg_min_x)
|
||||
trg_min_x = T.x
|
||||
if(T.y < trg_min_y || !trg_min_y)
|
||||
trg_min_y = T.y
|
||||
|
||||
var/list/refined_src = new/list()
|
||||
for(var/turf/T in turfs_src)
|
||||
@@ -1248,23 +1297,30 @@ proc/rotate_icon(file, state, step = 1, aa = FALSE)
|
||||
var icon{result = icon(base); temp}
|
||||
|
||||
for(var/angle in 0 to 360 step step)
|
||||
if(angle == 0 ) continue
|
||||
if(angle == 360) continue
|
||||
if(angle == 0 )
|
||||
continue
|
||||
if(angle == 360)
|
||||
continue
|
||||
temp = icon(base)
|
||||
if(aa) temp.Scale(w2, h2)
|
||||
if(aa)
|
||||
temp.Scale(w2, h2)
|
||||
temp.Turn(angle)
|
||||
if(aa) temp.Scale(w, h)
|
||||
if(aa)
|
||||
temp.Scale(w, h)
|
||||
result.Insert(temp, "[angle]")
|
||||
|
||||
return result
|
||||
|
||||
/proc/has_edge(obj/O as obj)
|
||||
if (!O) return 0
|
||||
if(O.edge) return 1
|
||||
if (!O)
|
||||
return 0
|
||||
if(O.edge)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/get_distant_turf(var/turf/T,var/direction,var/distance)
|
||||
if(!T || !direction || !distance) return
|
||||
if(!T || !direction || !distance)
|
||||
return
|
||||
|
||||
var/dest_x = T.x
|
||||
var/dest_y = T.y
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
// Non diagonal case
|
||||
if(T0.x == x || T0.y == y)
|
||||
// Window snowflake code
|
||||
if(neighbor.flags & ON_BORDER && neighbor.dir == get_dir(T0, src)) return 1
|
||||
if(neighbor.flags & ON_BORDER && neighbor.dir == get_dir(T0, src))
|
||||
return 1
|
||||
// Check for border blockages
|
||||
if(T0.ClickCross(get_dir(T0,src), border_only = 1) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target))
|
||||
return 1
|
||||
@@ -74,8 +75,10 @@
|
||||
* In the case of a multiple-tile object, all valid locations are checked for adjacency.
|
||||
*/
|
||||
/atom/movable/Adjacent(var/atom/neighbor)
|
||||
if(neighbor == loc) return 1
|
||||
if(!isturf(loc)) return 0
|
||||
if(neighbor == loc)
|
||||
return 1
|
||||
if(!isturf(loc))
|
||||
return 0
|
||||
if(locs.len > 1)
|
||||
for(var/turf/T in locs)
|
||||
if(T.Adjacent(neighbor, src))
|
||||
@@ -88,7 +91,8 @@
|
||||
|
||||
// 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(neighbor == loc)
|
||||
return 1
|
||||
if(istype(loc,/obj/item))
|
||||
if(recurse > 0)
|
||||
return loc.Adjacent(neighbor,recurse - 1)
|
||||
@@ -121,7 +125,8 @@
|
||||
*/
|
||||
/turf/proc/ClickCross(var/target_dir, var/border_only, var/atom/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.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
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
build_click(src, client.buildmode, params, A)
|
||||
return
|
||||
|
||||
if(control_disabled || stat) return
|
||||
if(control_disabled || stat)
|
||||
return
|
||||
|
||||
if(ismob(A))
|
||||
ai_actual_track(A)
|
||||
|
||||
@@ -34,8 +34,10 @@
|
||||
#define MAX_ITEM_DEPTH 3 //how far we can recurse before we can't get an item
|
||||
|
||||
/mob/proc/ClickOn( var/atom/A, var/params )
|
||||
if(!click_delayer) click_delayer = new
|
||||
if(timestopped) return 0 //under effects of time magick
|
||||
if(!click_delayer)
|
||||
click_delayer = new
|
||||
if(timestopped)
|
||||
return 0 //under effects of time magick
|
||||
|
||||
if(click_delayer.blocked())
|
||||
return
|
||||
@@ -164,7 +166,8 @@
|
||||
animals lunging, etc.
|
||||
*/
|
||||
/mob/proc/RangedAttack(var/atom/A, var/params)
|
||||
if(!mutations || !mutations.len) return
|
||||
if(!mutations || !mutations.len)
|
||||
return
|
||||
if((M_LASER in mutations) && a_intent == I_HURT)
|
||||
LaserEyes(A) // moved into a proc below
|
||||
else if(M_TK in mutations)
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
almost anything into a trash can.
|
||||
*/
|
||||
/atom/MouseDrop(atom/over)
|
||||
if(!usr || !over) return
|
||||
if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows
|
||||
if(!usr || !over)
|
||||
return
|
||||
if(!Adjacent(usr) || !over.Adjacent(usr))
|
||||
return // should stop you from dragging through windows
|
||||
|
||||
spawn(0)
|
||||
over.MouseDrop_T(src,usr)
|
||||
|
||||
@@ -60,23 +60,39 @@ var/global/obj/screen/clicker/catcher = new()
|
||||
if(ishuman(mymob))
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
if(inventory_shown && hud_shown)
|
||||
if(H.shoes) H.shoes.screen_loc = ui_shoes
|
||||
if(H.gloves) H.gloves.screen_loc = ui_gloves
|
||||
if(H.ears) H.ears.screen_loc = ui_ears
|
||||
if(H.glasses) H.glasses.screen_loc = ui_glasses
|
||||
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
|
||||
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
|
||||
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
|
||||
if(H.head) H.head.screen_loc = ui_head
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = ui_shoes
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = ui_gloves
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = ui_ears
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = ui_glasses
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = ui_iclothing
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = ui_oclothing
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = ui_mask
|
||||
if(H.head)
|
||||
H.head.screen_loc = ui_head
|
||||
else
|
||||
if(H.shoes) H.shoes.screen_loc = null
|
||||
if(H.gloves) H.gloves.screen_loc = null
|
||||
if(H.ears) H.ears.screen_loc = null
|
||||
if(H.glasses) H.glasses.screen_loc = null
|
||||
if(H.w_uniform) H.w_uniform.screen_loc = null
|
||||
if(H.wear_suit) H.wear_suit.screen_loc = null
|
||||
if(H.wear_mask) H.wear_mask.screen_loc = null
|
||||
if(H.head) H.head.screen_loc = null
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = null
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = null
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = null
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = null
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = null
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = null
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = null
|
||||
if(H.head)
|
||||
H.head.screen_loc = null
|
||||
|
||||
|
||||
/datum/hud/proc/persistant_inventory_update()
|
||||
@@ -86,19 +102,31 @@ var/global/obj/screen/clicker/catcher = new()
|
||||
if(ishuman(mymob))
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
if(hud_shown)
|
||||
if(H.s_store) H.s_store.screen_loc = ui_sstore1
|
||||
if(H.wear_id) H.wear_id.screen_loc = ui_id
|
||||
if(H.belt) H.belt.screen_loc = ui_belt
|
||||
if(H.back) H.back.screen_loc = ui_back
|
||||
if(H.l_store) H.l_store.screen_loc = ui_storage1
|
||||
if(H.r_store) H.r_store.screen_loc = ui_storage2
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = ui_sstore1
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = ui_id
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = ui_belt
|
||||
if(H.back)
|
||||
H.back.screen_loc = ui_back
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = ui_storage1
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = ui_storage2
|
||||
else
|
||||
if(H.s_store) H.s_store.screen_loc = null
|
||||
if(H.wear_id) H.wear_id.screen_loc = null
|
||||
if(H.belt) H.belt.screen_loc = null
|
||||
if(H.back) H.back.screen_loc = null
|
||||
if(H.l_store) H.l_store.screen_loc = null
|
||||
if(H.r_store) H.r_store.screen_loc = null
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = null
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = null
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = null
|
||||
if(H.back)
|
||||
H.back.screen_loc = null
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = null
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = null
|
||||
|
||||
/datum/hud/proc/init_hand_icons(var/new_icon, var/new_color, var/new_alpha)
|
||||
for(var/i = 1 to mymob.held_items.len) //Hands
|
||||
@@ -215,7 +243,8 @@ var/global/obj/screen/clicker/catcher = new()
|
||||
|
||||
if(hud_used && client)
|
||||
if(ishuman(src))
|
||||
if(!src.client) return
|
||||
if(!src.client)
|
||||
return
|
||||
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
@@ -259,7 +288,8 @@ var/global/obj/screen/clicker/catcher = new()
|
||||
to_chat(usr, "<span class='warning'>This mob type does not use a HUD.</span>")
|
||||
|
||||
/datum/hud/proc/toggle_show_schematics_display(var/list/override = null,clear = 0, var/obj/item/device/rcd/R)
|
||||
if(!isliving(mymob)) return
|
||||
if(!isliving(mymob))
|
||||
return
|
||||
|
||||
var/mob/living/L = mymob
|
||||
|
||||
@@ -267,7 +297,8 @@ var/global/obj/screen/clicker/catcher = new()
|
||||
update_schematics_display(override, clear, R)
|
||||
|
||||
/datum/hud/proc/update_schematics_display(var/list/override = null, clear,var/obj/item/device/rcd/R)
|
||||
if(!isliving(mymob)) return
|
||||
if(!isliving(mymob))
|
||||
return
|
||||
|
||||
var/mob/living/L = mymob
|
||||
|
||||
|
||||
@@ -435,8 +435,10 @@
|
||||
|
||||
/mob/living/carbon/human/update_action_buttons()
|
||||
var/num = 1
|
||||
if(!hud_used) return
|
||||
if(!client) return
|
||||
if(!hud_used)
|
||||
return
|
||||
if(!client)
|
||||
return
|
||||
var/list/used = list()
|
||||
|
||||
if(hud_used.hud_shown != 1) //Hud toggled to minimal
|
||||
|
||||
@@ -224,7 +224,8 @@ var/list/parallax_on_clients = list()
|
||||
parallax_initialized = 1
|
||||
|
||||
/obj/screen/parallax/proc/calibrate_parallax(var/i)
|
||||
if(!i) return
|
||||
if(!i)
|
||||
return
|
||||
|
||||
/* Placement of screen objects
|
||||
1 2 3
|
||||
|
||||
@@ -169,7 +169,8 @@
|
||||
return
|
||||
|
||||
/datum/hud/proc/toggle_show_robot_modules()
|
||||
if(!isrobot(mymob)) return
|
||||
if(!isrobot(mymob))
|
||||
return
|
||||
|
||||
var/mob/living/silicon/robot/r = mymob
|
||||
|
||||
@@ -177,7 +178,8 @@
|
||||
update_robot_modules_display()
|
||||
|
||||
/datum/hud/proc/update_robot_modules_display()
|
||||
if(!isrobot(mymob) || !mymob.client) return
|
||||
if(!isrobot(mymob) || !mymob.client)
|
||||
return
|
||||
|
||||
var/mob/living/silicon/robot/r = mymob
|
||||
|
||||
|
||||
@@ -278,7 +278,8 @@
|
||||
return locate(X, Y, origin.z)
|
||||
|
||||
/obj/screen/Click(location, control, params)
|
||||
if(!usr) return 1
|
||||
if(!usr)
|
||||
return 1
|
||||
|
||||
switch(name)
|
||||
if("toggle")
|
||||
|
||||
@@ -79,7 +79,8 @@
|
||||
S.handle_icon_updates = 1
|
||||
|
||||
/obj/screen/movable/spell_master/proc/add_spell(var/spell/spell)
|
||||
if(!spell) return
|
||||
if(!spell)
|
||||
return
|
||||
|
||||
if(spell.connected_button) //we have one already, for some reason
|
||||
if(spell.connected_button in spell_objects)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
|
||||
if(!usr) return
|
||||
if(!usr)
|
||||
return
|
||||
|
||||
// ------- TIME SINCE LAST CLICK -------
|
||||
if (world.time <= usr:lastDblClick+1)
|
||||
@@ -23,16 +24,24 @@
|
||||
|
||||
if(dy || dx)
|
||||
if(abs(dx) < abs(dy))
|
||||
if(dy > 0) usr.dir = NORTH
|
||||
else usr.dir = SOUTH
|
||||
if(dy > 0)
|
||||
usr.dir = NORTH
|
||||
else
|
||||
usr.dir = SOUTH
|
||||
else
|
||||
if(dx > 0) usr.dir = EAST
|
||||
else usr.dir = WEST
|
||||
if(dx > 0)
|
||||
usr.dir = EAST
|
||||
else
|
||||
usr.dir = WEST
|
||||
else
|
||||
if(pixel_y > 16) usr.dir = NORTH
|
||||
else if(pixel_y < -16) usr.dir = SOUTH
|
||||
else if(pixel_x > 16) usr.dir = EAST
|
||||
else if(pixel_x < -16) usr.dir = WEST
|
||||
if(pixel_y > 16)
|
||||
usr.dir = NORTH
|
||||
else if(pixel_y < -16)
|
||||
usr.dir = SOUTH
|
||||
else if(pixel_x > 16)
|
||||
usr.dir = EAST
|
||||
else if(pixel_x < -16)
|
||||
usr.dir = WEST
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +55,8 @@
|
||||
// ------- CYBORG -------
|
||||
else if (istype(usr, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/bot = usr
|
||||
if (bot.lockcharge) return
|
||||
if (bot.lockcharge)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -55,7 +65,8 @@
|
||||
if(params)
|
||||
var/parameters = params2list(params)
|
||||
|
||||
if(parameters["shift"]){
|
||||
if(parameters["shift"])
|
||||
{
|
||||
if(!isAI(usr))
|
||||
ShiftClick(usr)
|
||||
else
|
||||
@@ -65,7 +76,8 @@
|
||||
|
||||
// ------- ALT-CLICK -------
|
||||
|
||||
if(parameters["alt"]){
|
||||
if(parameters["alt"])
|
||||
{
|
||||
if(!isAI(usr))
|
||||
AltClick(usr)
|
||||
else
|
||||
@@ -75,7 +87,8 @@
|
||||
|
||||
// ------- CTRL-CLICK -------
|
||||
|
||||
if(parameters["ctrl"]){
|
||||
if(parameters["ctrl"])
|
||||
{
|
||||
if(!isAI(usr))
|
||||
CtrlClick(usr)
|
||||
else
|
||||
@@ -85,7 +98,8 @@
|
||||
|
||||
// ------- MIDDLE-CLICK -------
|
||||
|
||||
if(parameters["middle"]){
|
||||
if(parameters["middle"])
|
||||
{
|
||||
if(!isAI(usr))
|
||||
MiddleClick(usr)
|
||||
return
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/RangedAttack(var/atom/A)
|
||||
if(!gloves && !mutations.len) return
|
||||
if(!gloves && !mutations.len)
|
||||
return
|
||||
if(gloves)
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
if(istype(G) && G.Touch(A, src, 0)) // for magic gloves
|
||||
@@ -127,7 +128,8 @@
|
||||
things considerably
|
||||
*/
|
||||
/mob/living/carbon/monkey/RestrainedClickOn(var/atom/A)
|
||||
if(a_intent != I_HURT || !ismob(A)) return
|
||||
if(a_intent != I_HURT || !ismob(A))
|
||||
return
|
||||
delayNextAttack(10)
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
@@ -138,7 +140,8 @@
|
||||
ML.apply_damage(rand(1,3), BRUTE, dam_zone, armor)
|
||||
for(var/mob/O in viewers(ML, null))
|
||||
O.show_message("<span class='danger'>[name] has bit [ML]!</span>", 1)
|
||||
if(armor >= 2) return
|
||||
if(armor >= 2)
|
||||
return
|
||||
if(ismonkey(ML))
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(istype(D, /datum/disease/jungle_fever))
|
||||
|
||||
@@ -204,7 +204,8 @@ var/const/tk_maxrange = 15
|
||||
return 0
|
||||
for(var/i = 1 to distance)
|
||||
ref = get_step_to(ref, target, 0)
|
||||
if(ref != target) return 0
|
||||
if(ref != target)
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ datum/updateQueueWorker/proc/init(var/list/objects, var/procName, var/list/argum
|
||||
|
||||
datum/updateQueueWorker/proc/doWork()
|
||||
// If there's nothing left to execute or we were killed, mark finished and return.
|
||||
if (!objects || !objects.len) return finished()
|
||||
if (!objects || !objects.len)
|
||||
return finished()
|
||||
|
||||
lastStart = world.timeofday // Absolute number of ticks since the world started up
|
||||
|
||||
@@ -38,7 +39,8 @@ datum/updateQueueWorker/proc/doWork()
|
||||
|
||||
// If there's nothing left to execute
|
||||
// or we were killed while running the above code, mark finished and return.
|
||||
if (!objects || !objects.len) return finished()
|
||||
if (!objects || !objects.len)
|
||||
return finished()
|
||||
|
||||
if (world.cpu > cpuThreshold)
|
||||
// We don't want to force a tick into overtime!
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
|
||||
/datum/processSchedulerView/Topic(href, href_list)
|
||||
if(!check_rights(R_DEBUG)) return
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
if (!href_list["action"])
|
||||
return
|
||||
|
||||
@@ -11,14 +11,16 @@ var/global/list/fast_machines = list()
|
||||
//#ifdef PROFILE_MACHINES
|
||||
//machine_profiling.len = 0
|
||||
//#endif
|
||||
if(!fast_machines || !fast_machines.len) return
|
||||
if(!fast_machines || !fast_machines.len)
|
||||
return
|
||||
for(var/i = 1 to fast_machines.len)
|
||||
if(i > fast_machines.len)
|
||||
break
|
||||
var/obj/machinery/M = fast_machines[i]
|
||||
|
||||
if(istype(M) && !M.gcDestroyed)
|
||||
if(M.timestopped) continue
|
||||
if(M.timestopped)
|
||||
continue
|
||||
#ifdef PROFILE_MACHINES
|
||||
var/time_start = world.timeofday
|
||||
#endif
|
||||
@@ -51,4 +53,5 @@ var/global/list/fast_machines = list()
|
||||
if(!fast_machines.Remove(M))
|
||||
fast_machines.Cut(i, i + 1)
|
||||
|
||||
if(!(i % 20)) scheck()
|
||||
if(!(i % 20))
|
||||
scheck()
|
||||
|
||||
@@ -19,14 +19,17 @@ var/global/list/html_machines = new/list() //for checking when we should update
|
||||
key += "("
|
||||
var/first = 1
|
||||
for (var/a in item.args)
|
||||
if (!first) key += ","
|
||||
if (!first)
|
||||
key += ","
|
||||
key += "[a]"
|
||||
first = 0
|
||||
key += ")"
|
||||
|
||||
if (!(key in L))
|
||||
if (item.args) call(item.ref, item.procname)(arglist(item.args))
|
||||
else call(item.ref, item.procname)()
|
||||
if (item.args)
|
||||
call(item.ref, item.procname)(arglist(item.args))
|
||||
else
|
||||
call(item.ref, item.procname)()
|
||||
|
||||
L.Add(key)
|
||||
|
||||
|
||||
@@ -10,13 +10,15 @@ var/global/list/machines = list()
|
||||
//#ifdef PROFILE_MACHINES
|
||||
//machine_profiling.len = 0
|
||||
//#endif
|
||||
if(!machines || !machines.len) return
|
||||
if(!machines || !machines.len)
|
||||
return
|
||||
for(var/i = 1 to machines.len)
|
||||
if(i > machines.len)
|
||||
break
|
||||
var/obj/machinery/M = machines[i]
|
||||
if(istype(M) && !M.gcDestroyed)
|
||||
if(M.timestopped) continue
|
||||
if(M.timestopped)
|
||||
continue
|
||||
#ifdef PROFILE_MACHINES
|
||||
var/time_start = world.timeofday
|
||||
#endif
|
||||
@@ -45,4 +47,5 @@ var/global/list/machines = list()
|
||||
M.inMachineList = 0
|
||||
if(!machines.Remove(M))
|
||||
machines.Cut(i,i+1)
|
||||
if(!(i%20)) scheck()
|
||||
if(!(i%20))
|
||||
scheck()
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
if (mob_list)
|
||||
for(var/atom/m in mob_list)
|
||||
if(m)
|
||||
if(m.timestopped) continue
|
||||
if(m.timestopped)
|
||||
continue
|
||||
m:Life()
|
||||
scheck()
|
||||
continue
|
||||
|
||||
@@ -16,7 +16,8 @@ var/global/list/processing_objects = list()
|
||||
if(processing_objects)
|
||||
for(var/atom/o in processing_objects)
|
||||
if(o)
|
||||
if(o.timestopped) continue
|
||||
if(o.timestopped)
|
||||
continue
|
||||
o:process()
|
||||
scheck()
|
||||
continue
|
||||
|
||||
@@ -30,7 +30,8 @@ var/global/list/cable_list = list() //Index for all cables, so that powernets do
|
||||
break
|
||||
if(istype(power_machines[i], /obj/machinery))
|
||||
var/obj/machinery/M = power_machines[i]
|
||||
if(M.timestopped) continue
|
||||
if(M.timestopped)
|
||||
continue
|
||||
if(!M.gcDestroyed)
|
||||
#ifdef PROFILE_MACHINES
|
||||
var/time_start = world.timeofday
|
||||
|
||||
@@ -206,7 +206,8 @@
|
||||
var/list/Lines = file2list(filename)
|
||||
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
@@ -628,7 +629,8 @@
|
||||
/datum/configuration/proc/loadsql(filename) // -- TLE
|
||||
var/list/Lines = file2list(filename)
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
@@ -674,7 +676,8 @@
|
||||
/datum/configuration/proc/loadforumsql(filename) // -- TLE
|
||||
var/list/Lines = file2list(filename)
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
|
||||
@@ -44,7 +44,8 @@ var/soft_dels = 0
|
||||
var/remainingCollectionPerTick = GC_COLLECTIONS_PER_TICK
|
||||
var/remainingForceDelPerTick = GC_FORCE_DEL_PER_TICK
|
||||
var/collectionTimeScope = world.timeofday - GC_COLLECTION_TIMEOUT
|
||||
if(narsie_cometh) return //don't even fucking bother, its over.
|
||||
if(narsie_cometh)
|
||||
return //don't even fucking bother, its over.
|
||||
while(queue.len && --remainingCollectionPerTick >= 0)
|
||||
var/refID = queue[1]
|
||||
var/destroyedAtTime = queue[refID]
|
||||
@@ -183,7 +184,8 @@ var/soft_dels = 0
|
||||
things += thing
|
||||
testing("Collected list of things in search for references to a [type]. ([things.len] Thing\s)")
|
||||
for(var/datum/thing in things)
|
||||
if(!usr.client.running_find_references) return
|
||||
if(!usr.client.running_find_references)
|
||||
return
|
||||
for(var/varname in thing.vars)
|
||||
var/variable = thing.vars[varname]
|
||||
if(variable == src)
|
||||
|
||||
@@ -62,8 +62,10 @@ datum/controller/game_controller/New()
|
||||
// to_chat(world, "<span class='danger'>Job setup complete in </span>")
|
||||
log_startup_progress("Job setup complete in [stop_watch(watch)]s.")
|
||||
|
||||
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
|
||||
if(!syndicate_code_phrase)
|
||||
syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response)
|
||||
syndicate_code_response = generate_code_phrase()
|
||||
/*if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle()*/
|
||||
/*
|
||||
if(global.garbageCollector)
|
||||
@@ -489,7 +491,8 @@ datum/controller/game_controller/recover() //Mostly a placeholder for now.
|
||||
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
|
||||
for(var/varname in master_controller.vars)
|
||||
switch(varname)
|
||||
if("tag","type","parent_type","vars") continue
|
||||
if("tag","type","parent_type","vars")
|
||||
continue
|
||||
else
|
||||
var/varval = master_controller.vars[varname]
|
||||
if(istype(varval,/datum))
|
||||
|
||||
@@ -38,7 +38,8 @@ datum/shuttle_controller
|
||||
// otherwise if outgoing, switch to incoming
|
||||
|
||||
datum/shuttle_controller/proc/incall(coeff = 1)
|
||||
if(shutdown) return
|
||||
if(shutdown)
|
||||
return
|
||||
if((!universe.OnShuttleCall(null) || deny_shuttle) && alert == 1) //crew transfer shuttle does not gets recalled by gamemode
|
||||
return
|
||||
if(endtime)
|
||||
@@ -56,7 +57,8 @@ datum/shuttle_controller/proc/incall(coeff = 1)
|
||||
A.readyalert()
|
||||
|
||||
datum/shuttle_controller/proc/shuttlealert(var/X)
|
||||
if(shutdown) return
|
||||
if(shutdown)
|
||||
return
|
||||
alert = X
|
||||
|
||||
|
||||
@@ -67,8 +69,10 @@ datum/shuttle_controller/proc/force_shutdown()
|
||||
|
||||
|
||||
datum/shuttle_controller/proc/recall()
|
||||
if(shutdown) return
|
||||
if(!can_recall) return
|
||||
if(shutdown)
|
||||
return
|
||||
if(!can_recall)
|
||||
return
|
||||
if(direction == 1)
|
||||
var/timeleft = timeleft()
|
||||
if(alert == 0)
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
set name = "Restart Controller"
|
||||
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
|
||||
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
usr = null
|
||||
src = null
|
||||
switch(controller)
|
||||
|
||||
@@ -9,7 +9,8 @@ var/global/mommi_base_law_type = /datum/ai_laws/keeper // Asimov is OP as fuck o
|
||||
//Add, comment out, or adjust weights to modify law selection
|
||||
//So long as the weights come to a sum of 100 total, they will be equal parts of 100%
|
||||
/proc/getLawset(var/mob/M)
|
||||
if(!base_law_type) base_law_type = pick(
|
||||
if(!base_law_type)
|
||||
base_law_type = pick(
|
||||
40;/datum/ai_laws/asimov,
|
||||
20;/datum/ai_laws/corporate,
|
||||
20;/datum/ai_laws/nanotrasen,
|
||||
|
||||
@@ -141,7 +141,8 @@
|
||||
return replacetext(replacetext(text,"\proper ",""),"\improper ","")
|
||||
|
||||
/proc/onclosed(mob/user, windowid, var/atom/ref=null)
|
||||
if(!user.client) return
|
||||
if(!user.client)
|
||||
return
|
||||
var/param = "null"
|
||||
if(ref)
|
||||
param = "\ref[ref]"
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
|
||||
for(var/datum/job/J in all_jobs)
|
||||
var/list/alttitles = get_alternate_titles(J.title)
|
||||
if(!J) continue
|
||||
if(!J)
|
||||
continue
|
||||
if(assignment in alttitles)
|
||||
real_title = J.title
|
||||
break
|
||||
@@ -141,7 +142,8 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
|
||||
preview_icon.Blend(temp, ICON_OVERLAY)
|
||||
|
||||
for(var/datum/organ/external/E in H.organs)
|
||||
if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue
|
||||
if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED)
|
||||
continue
|
||||
var/o_icobase=icobase
|
||||
if(E.status & ORGAN_PEG)
|
||||
o_icobase='icons/mob/human_races/o_peg.dmi'
|
||||
|
||||
@@ -61,7 +61,8 @@
|
||||
var filter_text = document.getElementById('filter');
|
||||
var filter = filter_text.value.toLowerCase();
|
||||
|
||||
if(event.keyCode == 13){ //Enter / return
|
||||
if(event.keyCode == 13)
|
||||
{ //Enter / return
|
||||
var vars_ol = document.getElementById('vars');
|
||||
var lis = vars_ol.getElementsByTagName("li");
|
||||
for ( var i = 0; i < lis.length; ++i )
|
||||
@@ -71,7 +72,8 @@
|
||||
if ( li.style.backgroundColor == "#ffee88" )
|
||||
{
|
||||
alist = lis\[i\].getElementsByTagName("a")
|
||||
if(alist.length > 0){
|
||||
if(alist.length > 0)
|
||||
{
|
||||
location.href=alist\[0\].href;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +82,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
if(event.keyCode == 38){ //Up arrow
|
||||
if(event.keyCode == 38)
|
||||
{ //Up arrow
|
||||
var vars_ol = document.getElementById('vars');
|
||||
var lis = vars_ol.getElementsByTagName("li");
|
||||
for ( var i = 0; i < lis.length; ++i )
|
||||
@@ -89,7 +92,8 @@
|
||||
var li = lis\[i\];
|
||||
if ( li.style.backgroundColor == "#ffee88" )
|
||||
{
|
||||
if( (i-1) >= 0){
|
||||
if( (i-1) >= 0)
|
||||
{
|
||||
var li_new = lis\[i-1\];
|
||||
li.style.backgroundColor = "white";
|
||||
li_new.style.backgroundColor = "#ffee88";
|
||||
@@ -101,7 +105,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
if(event.keyCode == 40){ //Down arrow
|
||||
if(event.keyCode == 40)
|
||||
{ //Down arrow
|
||||
var vars_ol = document.getElementById('vars');
|
||||
var lis = vars_ol.getElementsByTagName("li");
|
||||
for ( var i = 0; i < lis.length; ++i )
|
||||
@@ -110,7 +115,8 @@
|
||||
var li = lis\[i\];
|
||||
if ( li.style.backgroundColor == "#ffee88" )
|
||||
{
|
||||
if( (i+1) < lis.length){
|
||||
if( (i+1) < lis.length)
|
||||
{
|
||||
var li_new = lis\[i+1\];
|
||||
li.style.backgroundColor = "white";
|
||||
li_new.style.backgroundColor = "#ffee88";
|
||||
@@ -123,12 +129,14 @@
|
||||
}
|
||||
|
||||
//This part here resets everything to how it was at the start so the filter is applied to the complete list. Screw efficiency, it's client-side anyway and it only looks through 200 or so variables at maximum anyway (mobs).
|
||||
if(complete_list != null && complete_list != ""){
|
||||
if(complete_list != null && complete_list != "")
|
||||
{
|
||||
var vars_ol1 = document.getElementById("vars");
|
||||
vars_ol1.innerHTML = complete_list
|
||||
}
|
||||
|
||||
if(filter.value == ""){
|
||||
if(filter.value == "")
|
||||
{
|
||||
return;
|
||||
}else{
|
||||
var vars_ol = document.getElementById('vars');
|
||||
@@ -150,7 +158,8 @@
|
||||
for ( var j = 0; j < lis_new.length; ++j )
|
||||
{
|
||||
var li1 = lis\[j\];
|
||||
if (j == 0){
|
||||
if (j == 0)
|
||||
{
|
||||
li1.style.backgroundColor = "#ffee88";
|
||||
}else{
|
||||
li1.style.backgroundColor = "white";
|
||||
@@ -169,7 +178,8 @@
|
||||
|
||||
function loadPage(list) {
|
||||
|
||||
if(list.options\[list.selectedIndex\].value == ""){
|
||||
if(list.options\[list.selectedIndex\].value == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -752,7 +762,8 @@ body
|
||||
animate(A, alpha = 255, time = stealthy_level)
|
||||
|
||||
else if(href_list["teleport_to"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/user = usr
|
||||
if(!istype(user))
|
||||
@@ -794,8 +805,10 @@ body
|
||||
return
|
||||
|
||||
switch(href_list["rotatedir"])
|
||||
if("right") A.dir = turn(A.dir, -45)
|
||||
if("left") A.dir = turn(A.dir, 45)
|
||||
if("right")
|
||||
A.dir = turn(A.dir, -45)
|
||||
if("left")
|
||||
A.dir = turn(A.dir, 45)
|
||||
href_list["datumrefresh"] = href_list["rotatedatum"]
|
||||
|
||||
else if(href_list["makemonkey"])
|
||||
@@ -922,7 +935,8 @@ body
|
||||
to_chat(usr, "Failed! Something went wrong.")
|
||||
|
||||
else if(href_list["addlanguage"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/H = locate(href_list["addlanguage"])
|
||||
if(!istype(H))
|
||||
@@ -944,7 +958,8 @@ body
|
||||
to_chat(usr, "Mob already knows that language.")
|
||||
|
||||
else if(href_list["remlanguage"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/H = locate(href_list["remlanguage"])
|
||||
if(!istype(H))
|
||||
@@ -970,7 +985,8 @@ body
|
||||
to_chat(usr, "Mob doesn't know that language.")
|
||||
|
||||
else if(href_list["regenerateicons"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["regenerateicons"])
|
||||
if(!ismob(M))
|
||||
@@ -979,10 +995,12 @@ body
|
||||
M.regenerate_icons()
|
||||
|
||||
else if(href_list["adjustDamage"] && href_list["mobToDamage"])
|
||||
if(!check_rights(R_DEBUG|R_ADMIN|R_FUN)) return
|
||||
if(!check_rights(R_DEBUG|R_ADMIN|R_FUN))
|
||||
return
|
||||
|
||||
var/mob/living/L = locate(href_list["mobToDamage"])
|
||||
if(!istype(L)) return
|
||||
if(!istype(L))
|
||||
return
|
||||
|
||||
var/Text = href_list["adjustDamage"]
|
||||
|
||||
@@ -993,12 +1011,18 @@ body
|
||||
return
|
||||
|
||||
switch(Text)
|
||||
if("brute") L.adjustBruteLoss(amount)
|
||||
if("fire") L.adjustFireLoss(amount)
|
||||
if("toxin") L.adjustToxLoss(amount)
|
||||
if("oxygen")L.adjustOxyLoss(amount)
|
||||
if("brain") L.adjustBrainLoss(amount)
|
||||
if("clone") L.adjustCloneLoss(amount)
|
||||
if("brute")
|
||||
L.adjustBruteLoss(amount)
|
||||
if("fire")
|
||||
L.adjustFireLoss(amount)
|
||||
if("toxin")
|
||||
L.adjustToxLoss(amount)
|
||||
if("oxygen")
|
||||
L.adjustOxyLoss(amount)
|
||||
if("brain")
|
||||
L.adjustBrainLoss(amount)
|
||||
if("clone")
|
||||
L.adjustCloneLoss(amount)
|
||||
else
|
||||
to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]")
|
||||
return
|
||||
|
||||
@@ -78,7 +78,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
return
|
||||
|
||||
/datum/disease/proc/has_cure()//check if affected_mob has required reagents.
|
||||
if((!cure_id && !cure_list) || !curable) return 0
|
||||
if((!cure_id && !cure_list) || !curable)
|
||||
return 0
|
||||
var/result = 1
|
||||
if(!cure_list || cure_list == cure_id) //if no cure_list or cure list is the same as cure_id, just check _id
|
||||
if(istype(cure_id, /list)) //if cure_id is a list, check inside of it
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
//Our own special process so that dead hosts still chestburst
|
||||
/datum/disease/alien_embryo/process()
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
return
|
||||
if(holder == affected_mob)
|
||||
stage_act()
|
||||
if(affected_mob)
|
||||
@@ -75,7 +76,8 @@
|
||||
affected_mob.adjustToxLoss(10)
|
||||
affected_mob.updatehealth()
|
||||
if(prob(50))
|
||||
if(gibbed != 0) return 0
|
||||
if(gibbed != 0)
|
||||
return 0
|
||||
var/list/candidates = get_alien_candidates()
|
||||
var/picked = null
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
if(!M.anchored && (M.is_conductor()))
|
||||
step_towards(M,affected_mob)
|
||||
for(var/mob/living/silicon/S in orange(2,affected_mob))
|
||||
if(istype(S, /mob/living/silicon/ai)) continue
|
||||
if(istype(S, /mob/living/silicon/ai))
|
||||
continue
|
||||
step_towards(S,affected_mob)
|
||||
/*
|
||||
if(M.x > affected_mob.x)
|
||||
@@ -47,7 +48,8 @@
|
||||
for(i=0,i<iter,i++)
|
||||
step_towards(M,affected_mob)
|
||||
for(var/mob/living/silicon/S in orange(4,affected_mob))
|
||||
if(istype(S, /mob/living/silicon/ai)) continue
|
||||
if(istype(S, /mob/living/silicon/ai))
|
||||
continue
|
||||
var/i
|
||||
var/iter = rand(1,2)
|
||||
for(i=0,i<iter,i++)
|
||||
@@ -75,7 +77,8 @@
|
||||
for(i=0,i<iter,i++)
|
||||
step_towards(M,affected_mob)
|
||||
for(var/mob/living/silicon/S in orange(6,affected_mob))
|
||||
if(istype(S, /mob/living/silicon/ai)) continue
|
||||
if(istype(S, /mob/living/silicon/ai))
|
||||
continue
|
||||
var/i
|
||||
var/iter = rand(1,3)
|
||||
for(i=0,i<iter,i++)
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
affected_mob.adjustToxLoss(10)
|
||||
affected_mob.updatehealth()
|
||||
if(prob(40)) //So everyone can feel like robot Seth Brundle
|
||||
if(src.gibbed != 0) return 0
|
||||
if(src.gibbed != 0)
|
||||
return 0
|
||||
gibs(affected_mob)
|
||||
gibbed = 1
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
|
||||
@@ -92,7 +92,8 @@ STI KALY - blind
|
||||
/datum/disease/wizarditis/proc/teleport()
|
||||
var/list/theareas = new/list()
|
||||
for(var/area/AR in orange(80, affected_mob))
|
||||
if(theareas.Find(AR) || isspace(AR)) continue
|
||||
if(theareas.Find(AR) || isspace(AR))
|
||||
continue
|
||||
theareas += AR
|
||||
|
||||
if(!theareas)
|
||||
@@ -102,8 +103,10 @@ STI KALY - blind
|
||||
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
if(T.z != affected_mob.z) continue
|
||||
if(T.name == "space") continue
|
||||
if(T.z != affected_mob.z)
|
||||
continue
|
||||
if(T.name == "space")
|
||||
continue
|
||||
if(!T.density)
|
||||
var/clear = 1
|
||||
for(var/obj/O in T)
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
affected_mob.adjustToxLoss(10)
|
||||
affected_mob.updatehealth()
|
||||
if(prob(40))
|
||||
if(gibbed != 0) return 0
|
||||
if(gibbed != 0)
|
||||
return 0
|
||||
gibs(affected_mob)
|
||||
gibbed = 1
|
||||
affected_mob:Alienize()
|
||||
|
||||
@@ -41,8 +41,10 @@
|
||||
stored_in_organ = LIMB_HEAD //Cutting a LIMB_HEAD off will transfer teeth to the head object
|
||||
|
||||
/datum/butchering_product/teeth/desc_modifier(mob/parent, mob/user)
|
||||
if(amount == initial_amount) return
|
||||
if(!isliving(parent)) return
|
||||
if(amount == initial_amount)
|
||||
return
|
||||
if(!isliving(parent))
|
||||
return
|
||||
|
||||
var/mob/living/L = parent
|
||||
|
||||
@@ -57,8 +59,10 @@
|
||||
return //If his mouth is covered, we can't see his teeth
|
||||
|
||||
var/pronoun = "Its"
|
||||
if(L.gender == MALE) pronoun = "His"
|
||||
if(L.gender == FEMALE) pronoun = "Her"
|
||||
if(L.gender == MALE)
|
||||
pronoun = "His"
|
||||
if(L.gender == FEMALE)
|
||||
pronoun = "Her"
|
||||
|
||||
if(amount == 0)
|
||||
return "[pronoun] teeth are gone. "
|
||||
@@ -70,7 +74,8 @@
|
||||
|
||||
#define ALL_TEETH -1
|
||||
/datum/butchering_product/teeth/spawn_result(location, mob/parent, drop_amount = ALL_TEETH)
|
||||
if(amount <= 0) return
|
||||
if(amount <= 0)
|
||||
return
|
||||
|
||||
var/obj/item/stack/teeth/T = new(location)
|
||||
T.update_name(parent) //Change name of the teeth - from the default "teeth" to "corgi teeth", for example
|
||||
@@ -113,8 +118,10 @@
|
||||
/datum/butchering_product/skin/desc_modifier(mob/parent)
|
||||
if(!amount)
|
||||
var/pronoun = "It"
|
||||
if(parent.gender == MALE) pronoun = "He"
|
||||
if(parent.gender == FEMALE) pronoun = "She"
|
||||
if(parent.gender == MALE)
|
||||
pronoun = "He"
|
||||
if(parent.gender == FEMALE)
|
||||
pronoun = "She"
|
||||
return "[pronoun] has been skinned. "
|
||||
|
||||
/datum/butchering_product/skin/cat
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user