Fixes conflicts, conflicts.

This commit is contained in:
Mieszko Jędrzejczak
2016-07-10 12:45:36 +02:00
957 changed files with 9560 additions and 8815 deletions
+3
View File
@@ -58,6 +58,9 @@ actual development.
be a new proc that they both can use.
- No magic numbers/strings. If you have a number or text that is important and used in
your code, make a `#DEFINE` statement with a name that clearly indicates it's use.
- `if(condition)` must be used over `if (condition)` or any other variation.
- The same applies for `while` and `for` loops, they must have no space between the
keyword and condition brackets. `while(condition)`, `for(condition)`
- If you want to output a message to a player's chat
(this includes text sent to `world`), use `to_chat(mob/client/world, "message")`.
Do not use `mob/client/world << "message"`.
+4 -4
View File
@@ -156,7 +156,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(can_unwrench && istype(W, /obj/item/weapon/wrench))
var/turf/T = get_turf(src)
if (level == 1 && isturf(T) && T.intact)
if(level == 1 && isturf(T) && T.intact)
to_chat(user, "<span class='danger'>You must remove the plating first.</span>")
return 1
var/datum/gas_mixture/int_air = return_air()
@@ -168,11 +168,11 @@ Pipelines + Other Objects -> Pipe network
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (internal_pressure > 2*ONE_ATMOSPHERE)
if(internal_pressure > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
unsafe_wrenching = TRUE //Oh dear oh dear
if (do_after(user, 40, target = src) && isnull(gcDestroyed))
if(do_after(user, 40, target = src) && isnull(gcDestroyed))
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You have unfastened \the [src].</span>", \
@@ -293,7 +293,7 @@ Pipelines + Other Objects -> Pipe network
add_underlay_adapter(T, , node_dir, "")
add_underlay_adapter(T, node, node_dir, "-supply")
add_underlay_adapter(T, , node_dir, "-scrubbers")
else if (node.icon_connect_type == "-scrubbers")
else if(node.icon_connect_type == "-scrubbers")
add_underlay_adapter(T, , node_dir, "")
add_underlay_adapter(T, , node_dir, "-supply")
add_underlay_adapter(T, node, node_dir, "-scrubbers")
@@ -49,7 +49,7 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
if(c)
target.connected_to = c
connected_to = c
node1 = target
@@ -58,7 +58,7 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
if(c)
target.connected_to = c
connected_to = c
node2 = target
@@ -35,7 +35,7 @@
/obj/machinery/atmospherics/binary/dp_vent_pump/New()
..()
if (!id_tag)
if(!id_tag)
assign_uid()
id_tag = num2text(uid)
icon = null
@@ -93,11 +93,11 @@
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
return
else
if (node1)
if(node1)
add_underlay(T, node1, turn(dir, -180), node1.icon_connect_type)
else
add_underlay(T, node1, turn(dir, -180))
if (node2)
if(node2)
add_underlay(T, node2, dir, node2.icon_connect_type)
else
add_underlay(T, node2, dir)
@@ -155,9 +155,9 @@
return
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
if (!istype(W, /obj/item/weapon/wrench))
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if (on)
if(on)
to_chat(user, "<span class='alert'>You cannot unwrench this [src], turn it off first.</span>")
return 1
return ..()
@@ -182,9 +182,9 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
if (!istype(W, /obj/item/weapon/wrench))
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
if(!(stat & NOPOWER) && on)
to_chat(user, "<span class='alert'>You cannot unwrench this [src], turn it off first.</span>")
return 1
return ..()
@@ -52,7 +52,7 @@
add_fingerprint(usr)
update_icon(1)
sleep(10)
if (open)
if(open)
close()
return
open()
@@ -173,9 +173,9 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
if (!istype(W, /obj/item/weapon/wrench))
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if (!(stat & NOPOWER) && on)
if(!(stat & NOPOWER) && on)
to_chat(user, "<span class='alert'>You cannot unwrench this [src], turn it off first.</span>")
return 1
return ..()
@@ -117,7 +117,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
if (!ui)
if(!ui)
ui = new(user, src, ui_key, "omni_filter.tmpl", "Omni Filter Control", 330, 330)
ui.set_initial_data(data)
ui.open()
@@ -141,7 +141,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
if (!ui)
if(!ui)
ui = new(user, src, ui_key, "omni_mixer.tmpl", "Omni Mixer Control", 360, 330)
ui.set_initial_data(data)
ui.open()
@@ -103,7 +103,7 @@
for(var/datum/omni_port/P in ports)
int_pressure += P.air.return_pressure()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
if((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='danger'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
@@ -191,7 +191,7 @@ Filter types:
onclose(user, "atmo_filter")
return
if (src.temp)
if(src.temp)
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];temp=1'>Clear Screen</A>", src.temp, src)
//else
// src.on != src.on
@@ -207,7 +207,7 @@ Filter types:
src.add_fingerprint(usr)
if(href_list["filterset"])
src.filter_type = text2num(href_list["filterset"])
if (href_list["temp"])
if(href_list["temp"])
src.temp = null
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
@@ -218,7 +218,7 @@ Filter types:
src.updateUsrDialog()
/*
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
if((M.client && M.machine == src))
src.attack_hand(M)
*/
return
@@ -172,7 +172,7 @@
interact(user)
return 1
if(istype(W, /obj/item/weapon/wrench))
if (!(stat & NOPOWER) && on)
if(!(stat & NOPOWER) && on)
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn if off first.</span>")
return 1
return ..()
@@ -28,10 +28,10 @@
var/transfer_moles = 0.25 * environment.total_moles()
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
if (!external_removed)
if(!external_removed)
return radiate()
if (external_removed.total_moles() < 10)
if(external_removed.total_moles() < 10)
return radiate()
//Get same info from connected gas
@@ -39,7 +39,7 @@
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
if (!internal_removed)
if(!internal_removed)
environment.merge(external_removed)
return 1
@@ -63,7 +63,7 @@
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
if (!internal_removed)
if(!internal_removed)
return 1
var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY
@@ -27,7 +27,7 @@
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
if(c)
target.connected_to = c
src.connected_to = c
node = target
@@ -63,7 +63,7 @@
icon = null
initial_loc = get_area(loc)
area_uid = initial_loc.uid
if (!id_tag)
if(!id_tag)
assign_uid()
id_tag = num2text(uid)
..()
@@ -121,7 +121,7 @@
/obj/machinery/atmospherics/unary/vent_pump/process()
if(!..() || (stat & (NOPOWER|BROKEN)))
return 0
if (!node)
if(!node)
on = 0
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
if(!on)
@@ -164,7 +164,7 @@
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
if (isnull(removed)) //in space
if(isnull(removed)) //in space
return
air_contents.merge(removed)
@@ -252,7 +252,7 @@
on = !on
if(signal.data["checks"] != null)
if (signal.data["checks"] == "default")
if(signal.data["checks"] == "default")
pressure_checks = pressure_checks_default
else
pressure_checks = text2num(signal.data["checks"])
@@ -264,7 +264,7 @@
pump_direction = text2num(signal.data["direction"])
if(signal.data["set_internal_pressure"] != null)
if (signal.data["set_internal_pressure"] == "default")
if(signal.data["set_internal_pressure"] == "default")
internal_pressure_bound = internal_pressure_bound_default
else
internal_pressure_bound = between(
@@ -274,7 +274,7 @@
)
if(signal.data["set_external_pressure"] != null)
if (signal.data["set_external_pressure"] == "default")
if(signal.data["set_external_pressure"] == "default")
external_pressure_bound = external_pressure_bound_default
else
external_pressure_bound = between(
@@ -320,7 +320,7 @@
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
if(WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>Now welding the vent.</span>")
if(do_after(user, 20, target = src))
if(!src || !WT.isOn()) return
@@ -343,12 +343,12 @@
if(!welded)
if(open)
to_chat(user, "<span class='notice'> Now closing the vent.</span>")
if (do_after(user, 20, target = src))
if(do_after(user, 20, target = src))
open = 0
user.visible_message("[user] screwdrivers the vent shut.", "You screwdriver the vent shut.", "You hear a screwdriver.")
else
to_chat(user, "<span class='notice'> Now opening the vent.</span>")
if (do_after(user, 20, target = src))
if(do_after(user, 20, target = src))
open = 1
user.visible_message("[user] screwdrivers the vent shut.", "You screwdriver the vent shut.", "You hear a screwdriver.")
return
@@ -365,8 +365,8 @@
if(istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
return 1
if (istype(W, /obj/item/weapon/wrench))
if (!(stat & NOPOWER) && on)
if(istype(W, /obj/item/weapon/wrench))
if(!(stat & NOPOWER) && on)
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn it off first.</span>")
return 1
@@ -44,7 +44,7 @@
icon = null
initial_loc = get_area(loc)
area_uid = initial_loc.uid
if (!id_tag)
if(!id_tag)
assign_uid()
id_tag = num2text(uid)
..()
@@ -63,26 +63,26 @@
/obj/machinery/atmospherics/unary/vent_scrubber/auto_use_power()
if(!powered(power_channel))
return 0
if (!on || welded)
if(!on || welded)
return 0
if(stat & (NOPOWER|BROKEN))
return 0
var/amount = idle_power_usage
if (scrubbing)
if (scrub_CO2)
if(scrubbing)
if(scrub_CO2)
amount += idle_power_usage
if (scrub_Toxins)
if(scrub_Toxins)
amount += idle_power_usage
if (scrub_N2)
if(scrub_N2)
amount += idle_power_usage
if (scrub_N2O)
if(scrub_N2O)
amount += idle_power_usage
else
amount = active_power_usage
if (widenet)
if(widenet)
amount += amount*(adjacent_turfs.len*(adjacent_turfs.len/2))
use_power(amount, power_channel)
return 1
@@ -178,13 +178,13 @@
if(!..())
return 0
if (widenet)
if(widenet)
check_turfs()
if(stat & (NOPOWER|BROKEN))
return
if (!node)
if(!node)
on = 0
if(welded)
@@ -194,8 +194,8 @@
return 0
scrub(loc)
if (widenet)
for (var/turf/simulated/tile in adjacent_turfs)
if(widenet)
for(var/turf/simulated/tile in adjacent_turfs)
scrub(tile)
//we populate a list of turfs with nonatmos-blocked cardinal turfs AND
@@ -203,11 +203,11 @@
/obj/machinery/atmospherics/unary/vent_scrubber/proc/check_turfs()
adjacent_turfs.Cut()
var/turf/T = loc
if (istype(T))
if(istype(T))
adjacent_turfs = T.GetAtmosAdjacentTurfs(alldir=1)
/obj/machinery/atmospherics/unary/vent_scrubber/proc/scrub(var/turf/simulated/tile)
if (!tile || !istype(tile))
if(!tile || !istype(tile))
return 0
var/datum/gas_mixture/environment = tile.return_air()
@@ -218,7 +218,7 @@
//Take a gas sample
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
if (isnull(removed)) //in space
if(isnull(removed)) //in space
return
//Filter it
@@ -253,7 +253,7 @@
tile.air_update_turf()
else //Just siphoning all air
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
if(air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
return
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
@@ -372,7 +372,7 @@
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0,user))
if(WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>Now welding the scrubber.</span>")
if(do_after(user, 20, target = src))
if(!src || !WT.isOn()) return
@@ -394,8 +394,8 @@
if(istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
return 1
if (istype(W, /obj/item/weapon/wrench))
if (!(stat & NOPOWER) && on)
if(istype(W, /obj/item/weapon/wrench))
if(!(stat & NOPOWER) && on)
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn it off first.</span>")
return 1
+1 -1
View File
@@ -67,7 +67,7 @@
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
if(c)
target.connected_to = c
src.connected_to = c
node = target
+2 -2
View File
@@ -124,8 +124,8 @@
if(!node1 && !node2 && !node3)
var/turf/T = get_turf(src)
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)
+2 -2
View File
@@ -97,8 +97,8 @@
if(!node1 && !node2 && !node3 && !node4)
var/turf/T = get_turf(src)
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)
@@ -144,8 +144,8 @@
if(!node1 && !node2)
var/turf/T = get_turf(src)
new /obj/item/pipe(loc, make_from=src)
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)
@@ -96,17 +96,17 @@
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/New()
.. ()
switch (dir)
if (SOUTH)
switch(dir)
if(SOUTH)
initialize_directions = NORTH
initialize_directions_he = SOUTH
if (NORTH)
if(NORTH)
initialize_directions = SOUTH
initialize_directions_he = NORTH
if (EAST)
if(EAST)
initialize_directions = WEST
initialize_directions_he = EAST
if (WEST)
if(WEST)
initialize_directions = EAST
initialize_directions_he = WEST
@@ -37,14 +37,14 @@
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
underlays.Cut()
if (node1)
if(node1)
universal_underlays(node1)
if(node2)
universal_underlays(node2)
else
var/node2_dir = turn(get_dir(src,node1),-180)
universal_underlays(,node2_dir)
else if (node2)
else if(node2)
universal_underlays(node2)
var/node1_dir = turn(get_dir(src,node2),-180)
universal_underlays(,node1_dir)
@@ -48,14 +48,14 @@
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
underlays.Cut()
if (node1)
if(node1)
universal_underlays(node1)
if(node2)
universal_underlays(node2)
else
var/node1_dir = get_dir(node1,src)
universal_underlays(,node1_dir)
else if (node2)
else if(node2)
universal_underlays(node2)
else
universal_underlays(,dir)
+1 -1
View File
@@ -165,7 +165,7 @@
var/turf/simulated/T = loc
if(T.to_be_destroyed)
var/chance_of_deletion
if (T.heat_capacity) //beware of division by zero
if(T.heat_capacity) //beware of division by zero
chance_of_deletion = T.max_fire_temperature_sustained / T.heat_capacity * 8 //there is no problem with prob(23456), min() was redundant --rastaf0
else
chance_of_deletion = 100
+8 -8
View File
@@ -83,35 +83,35 @@ turf/CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
//alldir includes adjacent diagonal tiles that can share
// air with both of the related adjacent cardinal tiles
/turf/proc/GetAtmosAdjacentTurfs(alldir = 0)
if (!istype(src, /turf/simulated))
if(!istype(src, /turf/simulated))
return list()
var/adjacent_turfs = list()
var/turf/simulated/curloc = src
for (var/direction in cardinal)
for(var/direction in cardinal)
if(!(curloc.atmos_adjacent_turfs & direction))
continue
var/turf/simulated/S = get_step(curloc, direction)
if (istype(S))
if(istype(S))
adjacent_turfs += S
if (!alldir)
if(!alldir)
return adjacent_turfs
for (var/direction in diagonals)
for(var/direction in diagonals)
var/matchingDirections = 0
var/turf/simulated/S = get_step(curloc, direction)
for (var/checkDirection in cardinal)
for(var/checkDirection in cardinal)
if(!(S.atmos_adjacent_turfs & checkDirection))
continue
var/turf/simulated/checkTurf = get_step(S, checkDirection)
if (checkTurf in adjacent_turfs)
if(checkTurf in adjacent_turfs)
matchingDirections++
if (matchingDirections >= 2)
if(matchingDirections >= 2)
adjacent_turfs += S
break
+3 -3
View File
@@ -246,14 +246,14 @@
overlays -= icemaster
var/new_overlay_type = tile_graphic()
if (new_overlay_type == atmos_overlay_type)
if(new_overlay_type == atmos_overlay_type)
return
var/atmos_overlay = get_atmos_overlay_by_name(atmos_overlay_type)
if (atmos_overlay)
if(atmos_overlay)
overlays -= atmos_overlay
atmos_overlay = get_atmos_overlay_by_name(new_overlay_type)
if (atmos_overlay)
if(atmos_overlay)
overlays += atmos_overlay
atmos_overlay_type = new_overlay_type
+7
View File
@@ -54,6 +54,13 @@
#define AI_IDLE 2
#define AI_OFF 3
//Attack types for checking shields/hit reactions
#define MELEE_ATTACK 1
#define UNARMED_ATTACK 2
#define PROJECTILE_ATTACK 3
#define THROWN_PROJECTILE_ATTACK 4
//Gun Stuff
#define SAWN_INTACT 0
#define SAWN_OFF 1
+3 -4
View File
@@ -4,10 +4,9 @@
#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message with the default handler
#define AIRTIGHT 8 // mask allows internals
#define HANDSLOW 16 // If an item has this flag, it will slow you to carry it
#define NOSHIELD 32 // weapon not affected by shield
#define CONDUCT 64 // conducts electricity (metal etc.)
#define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way
#define ON_BORDER 256 // item has priority to check when entering or leaving
#define CONDUCT 32 // conducts electricity (metal etc.)
#define ABSTRACT 64 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way
#define ON_BORDER 128 // item has priority to check when entering or leaving
#define GLASSESCOVERSEYES 1024
#define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags
+5
View File
@@ -124,3 +124,8 @@
#define NUTRITION_LEVEL_HUNGRY 250
#define NUTRITION_LEVEL_STARVING 150
//Used for calculations for negative effects of having genetics powers
#define DEFAULT_GENE_STABILITY 100
#define GENE_INSTABILITY_MINOR 5
#define GENE_INSTABILITY_MODERATE 10
#define GENE_INSTABILITY_MAJOR 15
+1 -1
View File
@@ -2,4 +2,4 @@
#define TICK_LIMIT_TO_RUN 85
#define TICK_CHECK ( world.tick_usage > TICK_LIMIT_RUNNING ? stoplag() : 0 )
#define CHECK_TICK if (world.tick_usage > TICK_LIMIT_RUNNING) stoplag()
#define CHECK_TICK if(world.tick_usage > TICK_LIMIT_RUNNING) stoplag()
+1 -1
View File
@@ -64,7 +64,7 @@
return
var/matrix/M = matrix()
var/do_loops = 15
while (do_loops > 0)
while(do_loops > 0)
do_loops--
animate(A, transform = M, pixel_z = A.pixel_z + 12, alpha = A.alpha - 17, time = 1, loop = 1, easing = LINEAR_EASING)
M.Scale(1.2,1.2)
+7 -7
View File
@@ -16,18 +16,18 @@
* -2, parameter A is not a string
*/
/proc/strpos(const/A, const/B)
if (istext(A) == 0 || length(A) < 1)
if(istext(A) == 0 || length(A) < 1)
return -2
if (istext(B) == 0 || length(B) > 1)
if(istext(B) == 0 || length(B) > 1)
return -1
var/i = findtext(A, B)
if (0 == i)
if(0 == i)
return 0
while (i)
while(i)
. = i
i = findtext(A, B, i + 1)
@@ -35,8 +35,8 @@
var/prototype = Object.type
Object = null
for (var/type in params2list(types))
if (ispath(prototype, text2path(type)))
for(var/type in params2list(types))
if(ispath(prototype, text2path(type)))
return 1
return 0
@@ -45,7 +45,7 @@
/obj/machinery/proc/getArea()
var/area/A = loc.loc
if (A != myArea)
if(A != myArea)
myArea = A
. = myArea
+2 -2
View File
@@ -10,7 +10,7 @@
/proc/get_area_master(const/O)
var/area/A = get_area(O)
if (isarea(A))
if(isarea(A))
return A
/proc/get_area(atom/A)
@@ -440,7 +440,7 @@ proc/pollCandidates(var/Question, var/be_special_type, var/antag_age_check = 0,
var/roletext = be_special_type ? get_roletext(be_special_type) : null
var/list/mob/dead/observer/candidates = list()
var/time_passed = world.time
if (!Question)
if(!Question)
Question = "Would you like to be a special role?"
for(var/mob/dead/observer/G in player_list)
+2 -2
View File
@@ -29,7 +29,7 @@
init_datum_subtypes(/datum/nations, all_nations, null, "default_name")
init_datum_subtypes(/datum/language, all_languages, null, "name")
for (var/language_name in all_languages)
for(var/language_name in all_languages)
var/datum/language/L = all_languages[language_name]
if(!(L.flags & NONGLOBAL))
language_keys[":[lowertext(L.key)]"] = L
@@ -52,7 +52,7 @@
/* // Uncomment to debug chemical reaction list.
/client/verb/debug_chemical_list()
for (var/reaction in chemical_reactions_list)
for(var/reaction in chemical_reactions_list)
. += "chemical_reactions_list\[\"[reaction]\"\] = \"[chemical_reactions_list[reaction]]\"\n"
if(islist(chemical_reactions_list[reaction]))
var/list/L = chemical_reactions_list[reaction]
+5 -5
View File
@@ -747,7 +747,7 @@ The _flatIcons list is a cache for generated icon files.
add = icon(I:icon, I:icon_state, I:dir)
// This checks for a silent failure mode of the icon routine. If the requested dir
// doesn't exist in this icon state it returns a 32x32 icon with 0 alpha.
if (I:dir != SOUTH && add.Width() == 32 && add.Height() == 32)
if(I:dir != SOUTH && add.Width() == 32 && add.Height() == 32)
// Check every pixel for blank (computationally expensive, but the process is limited
// by the amount of film on the station, only happens when we hit something that's
// turned, and bails at the very first pixel it sees.
@@ -760,7 +760,7 @@ The _flatIcons list is a cache for generated icon files.
if(!blankpixel)
break
// If we ALWAYS returned a null (which happens when GetPixel encounters something with alpha 0)
if (blankpixel)
if(blankpixel)
// Pull the default direction.
add = icon(I:icon, I:icon_state)
else // 'I' is an appearance object.
@@ -830,8 +830,8 @@ The _flatIcons list is a cache for generated icon files.
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)
@@ -844,7 +844,7 @@ proc/sort_atoms_by_layer(var/list/atoms)
var/list/result = atoms.Copy()
var/gap = result.len
var/swapped = 1
while (gap > 1 || swapped)
while(gap > 1 || swapped)
swapped = 0
if(gap > 1)
gap = round(gap / 1.3) // 1.3 is the emperic comb sort coefficient
+25 -25
View File
@@ -12,17 +12,17 @@
//Returns a list in plain english as a string
/proc/english_list(var/list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
var/total = input.len
if (!total)
if(!total)
return "[nothing_text]"
else if (total == 1)
else if(total == 1)
return "[input[1]]"
else if (total == 2)
else if(total == 2)
return "[input[1]][and_text][input[2]]"
else
var/output = ""
var/index = 1
while (index < total)
if (index == total - 1)
while(index < total)
if(index == total - 1)
comma_text = final_comma_text
output += "[input[index]][comma_text]"
@@ -107,22 +107,22 @@
/proc/pickweight(list/L)
var/total = 0
var/item
for (item in L)
if (!L[item])
for(item in L)
if(!L[item])
L[item] = 1
total += L[item]
total = rand(1, total)
for (item in L)
for(item in L)
total -=L [item]
if (total <= 0)
if(total <= 0)
return item
return null
//Pick a random element from the list and remove it from the list.
/proc/pick_n_take(list/listfrom)
if (listfrom.len > 0)
if(listfrom.len > 0)
var/picked = pick(listfrom)
listfrom -= picked
return picked
@@ -130,7 +130,7 @@
//Returns the top(last) element from the list and removes it from the list (typical stack function)
/proc/pop(list/listfrom)
if (listfrom.len > 0)
if(listfrom.len > 0)
var/picked = listfrom[listfrom.len]
listfrom.len--
return picked
@@ -459,22 +459,22 @@ proc/dd_sortedObjectList(list/incoming)
var/list/list_bottom
var/current_sort_object
for (current_sort_object in incoming)
for(current_sort_object in incoming)
low_index = 1
high_index = sorted_list.len
while (low_index <= high_index)
while(low_index <= high_index)
// Figure out the midpoint, rounding up for fractions. (BYOND rounds down, so add 1 if necessary.)
midway_calc = (low_index + high_index) / 2
current_index = round(midway_calc)
if (midway_calc > current_index)
if(midway_calc > current_index)
current_index++
current_item = sorted_list[current_index]
current_item_value = current_item:dd_SortValue()
current_sort_object_value = current_sort_object:dd_SortValue()
if (current_sort_object_value < current_item_value)
if(current_sort_object_value < current_item_value)
high_index = current_index - 1
else if (current_sort_object_value > current_item_value)
else if(current_sort_object_value > current_item_value)
low_index = current_index + 1
else
// current_sort_object == current_item
@@ -485,7 +485,7 @@ proc/dd_sortedObjectList(list/incoming)
insert_index = low_index
// Special case adding to end of list.
if (insert_index > sorted_list.len)
if(insert_index > sorted_list.len)
sorted_list += current_sort_object
continue
@@ -515,28 +515,28 @@ proc/dd_sortedObjectList(list/incoming)
var/sort_result
var/current_sort_text
for (current_sort_text in incoming)
for(current_sort_text in incoming)
low_index = 1
high_index = sorted_text.len
while (low_index <= high_index)
while(low_index <= high_index)
// Figure out the midpoint, rounding up for fractions. (BYOND rounds down, so add 1 if necessary.)
midway_calc = (low_index + high_index) / 2
current_index = round(midway_calc)
if (midway_calc > current_index)
if(midway_calc > current_index)
current_index++
current_item = sorted_text[current_index]
if (case_sensitive)
if(case_sensitive)
sort_result = sorttextEx(current_sort_text, current_item)
else
sort_result = sorttext(current_sort_text, current_item)
switch(sort_result)
if (1)
if(1)
high_index = current_index - 1 // current_sort_text < current_item
if (-1)
if(-1)
low_index = current_index + 1 // current_sort_text > current_item
if (0)
if(0)
low_index = current_index // current_sort_text == current_item
break
@@ -544,7 +544,7 @@ proc/dd_sortedObjectList(list/incoming)
insert_index = low_index
// Special case adding to end of list.
if (insert_index > sorted_text.len)
if(insert_index > sorted_text.len)
sorted_text += current_sort_text
continue
+13 -13
View File
@@ -21,12 +21,12 @@
/proc/log_admin(text)
admin_log.Add(text)
if (config.log_admin)
if(config.log_admin)
diary << "\[[time_stamp()]]ADMIN: [text]"
/proc/log_debug(text)
if (config.log_debug)
if(config.log_debug)
diary << "\[[time_stamp()]]DEBUG: [text]"
for(var/client/C in admins)
@@ -35,47 +35,47 @@
/proc/log_game(text)
if (config.log_game)
if(config.log_game)
diary << "\[[time_stamp()]]GAME: [text]"
/proc/log_vote(text)
if (config.log_vote)
if(config.log_vote)
diary << "\[[time_stamp()]]VOTE: [text]"
/proc/log_access(text)
if (config.log_access)
if(config.log_access)
diary << "\[[time_stamp()]]ACCESS: [text]"
/proc/log_say(text)
if (config.log_say)
if(config.log_say)
diary << "\[[time_stamp()]]SAY: [text]"
/proc/log_ooc(text)
if (config.log_ooc)
if(config.log_ooc)
diary << "\[[time_stamp()]]OOC: [text]"
/proc/log_whisper(text)
if (config.log_whisper)
if(config.log_whisper)
diary << "\[[time_stamp()]]WHISPER: [text]"
/proc/log_emote(text)
if (config.log_emote)
if(config.log_emote)
diary << "\[[time_stamp()]]EMOTE: [text]"
/proc/log_attack(text)
if (config.log_attack)
if(config.log_attack)
diary << "\[[time_stamp()]]ATTACK: [text]" //Seperate attack logs? Why?
/proc/log_adminsay(text)
if (config.log_adminchat)
if(config.log_adminchat)
diary << "\[[time_stamp()]]ADMINSAY: [text]"
/proc/log_adminwarn(text)
if (config.log_adminwarn)
if(config.log_adminwarn)
diary << "\[[time_stamp()]]ADMINWARN: [text]"
/proc/log_pda(text)
if (config.log_pda)
if(config.log_pda)
diary << "\[[time_stamp()]]PDA: [text][log_end]"
/proc/log_misc(text)
+9 -9
View File
@@ -116,7 +116,7 @@ proc/random_skin_tone(species = "Human")
proc/skintone2racedescription(tone, species = "Human")
if(species == "Human")
switch (tone)
switch(tone)
if(30 to INFINITY) return "albino"
if(20 to 30) return "pale"
if(5 to 15) return "light skinned"
@@ -190,15 +190,15 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
var/holding = user.get_active_hand()
var/datum/progressbar/progbar
if (progress)
if(progress)
progbar = new(user, time, target)
var/endtime = world.time+time
var/starttime = world.time
. = 1
while (world.time < endtime)
while(world.time < endtime)
sleep(1)
if (progress)
if(progress)
progbar.update(world.time - starttime)
if(!user || !target)
. = 0
@@ -213,7 +213,7 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
if((!drifting && user.loc != user_loc) || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying )
. = 0
break
if (progress)
if(progress)
qdel(progbar)
/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1)
@@ -236,15 +236,15 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
holdingnull = 0 //Users hand started holding something, check to see if it's still holding that
var/datum/progressbar/progbar
if (progress)
if(progress)
progbar = new(user, delay, target)
var/endtime = world.time + delay
var/starttime = world.time
. = 1
while (world.time < endtime)
while(world.time < endtime)
sleep(1)
if (progress)
if(progress)
progbar.update(world.time - starttime)
if(drifting && !user.inertia_dir)
@@ -269,5 +269,5 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
if(user.get_active_hand() != holding)
. = 0
break
if (progress)
if(progress)
qdel(progbar)
+11 -11
View File
@@ -1,13 +1,13 @@
var/church_name = null
/proc/church_name()
if (church_name)
if(church_name)
return church_name
var/name = ""
name += pick("Holy", "United", "First", "Second", "Last")
if (prob(20))
if(prob(20))
name += " Space"
name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
@@ -17,7 +17,7 @@ var/church_name = null
var/command_name = null
/proc/command_name()
if (command_name)
if(command_name)
return command_name
var/name = "Central Command"
@@ -33,7 +33,7 @@ var/command_name = null
var/religion_name = null
/proc/religion_name()
if (religion_name)
if(religion_name)
return religion_name
var/name = ""
@@ -47,12 +47,12 @@ var/religion_name = null
return "Nyx"
/proc/station_name()
if (station_name)
if(station_name)
return station_name
var/name = ""
if (config && config.server_name)
if(config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = station_name
@@ -65,7 +65,7 @@ var/religion_name = null
var/new_station_name = ""
//Rare: Pre-Prefix
if (prob(10))
if(prob(10))
name = pick("Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", "Automated", "Experimental", "Augmented")
new_station_name = name + " "
name = ""
@@ -107,7 +107,7 @@ var/religion_name = null
station_name = name
if (config && config.server_name)
if(config && config.server_name)
world.name = "[config.server_name]: [name]"
else
world.name = name
@@ -116,7 +116,7 @@ var/religion_name = null
var/syndicate_name = null
/proc/syndicate_name()
if (syndicate_name)
if(syndicate_name)
return syndicate_name
var/name = ""
@@ -125,11 +125,11 @@ var/syndicate_name = null
name += pick("Clandestine", "Prima", "Blue", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Bonk", "Gene", "Gib")
// Suffix
if (prob(80))
if(prob(80))
name += " "
// Full
if (prob(60))
if(prob(60))
name += pick("Syndicate", "Consortium", "Collective", "Corporation", "Group", "Holdings", "Biotech", "Industries", "Systems", "Products", "Chemicals", "Enterprises", "Family", "Creations", "International", "Intergalactic", "Interplanetary", "Foundation", "Positronics", "Hive")
// Broken
else
+1 -1
View File
@@ -62,6 +62,6 @@
// Calls the above proc on each entry of a list to ensure its entries are clean
/proc/sql_sanitize_text_list(var/list/l)
var/list/new_list = l.Copy()
for (var/text in new_list)
for(var/text in new_list)
sql_sanitize_text(text)
return new_list
+9 -9
View File
@@ -154,15 +154,15 @@
proc/checkhtml(var/t)
t = sanitize_simple(t, list("&#"="."))
var/p = findtext(t,"<",1)
while (p) //going through all the tags
while(p) //going through all the tags
var/start = p++
var/tag = copytext(t,p, p+1)
if (tag != "/")
while (reject_bad_text(copytext(t, p, p+1), 1))
if(tag != "/")
while(reject_bad_text(copytext(t, p, p+1), 1))
tag = copytext(t,start, p)
p++
tag = copytext(t,start+1, p)
if (!(tag in paper_tag_whitelist)) //if it's unkown tag, disarming it
if(!(tag in paper_tag_whitelist)) //if it's unkown tag, disarming it
t = copytext(t,1,start-1) + "&lt;" + copytext(t,start+1)
p = findtext(t,"<",p)
return t
@@ -218,7 +218,7 @@ proc/checkhtml(var/t)
//Adds 'u' number of zeros ahead of the text 't'
/proc/add_zero(t, u)
while (length(t) < u)
while(length(t) < u)
t = "0[t]"
return t
@@ -236,15 +236,15 @@ proc/checkhtml(var/t)
//Returns a string with reserved characters and spaces before the first letter removed
/proc/trim_left(text)
for (var/i = 1 to length(text))
if (text2ascii(text, i) > 32)
for(var/i = 1 to length(text))
if(text2ascii(text, i) > 32)
return copytext(text, i)
return ""
//Returns a string with reserved characters and spaces after the last letter removed
/proc/trim_right(text)
for (var/i = length(text), i > 0, i--)
if (text2ascii(text, i) > 32)
for(var/i = length(text), i > 0, i--)
if(text2ascii(text, i) > 32)
return copytext(text, 1, i + 1)
return ""
+4 -4
View File
@@ -10,9 +10,9 @@
var/ref_result
ref_result = ref_alert.timed_alert(src, question, title, time, choice1, choice2, choice3)
if (!ref_result) ref_result = default
if(!ref_result) ref_result = default
if (ref_alert) del(ref_alert)
if(ref_alert) del(ref_alert)
return ref_result
@@ -20,13 +20,13 @@
/mob/proc/timed_alert(question as text, title as text, default as text, time as num, \
choice1 as text, choice2 as text, choice3 as text)
if (client) return client.timed_alert(question, title, default, time, choice1, choice2, choice3)
if(client) return client.timed_alert(question, title, default, time, choice1, choice2, choice3)
return
/timed_alert/proc/timed_alert(client/ref_client, question, title, time, choice1, choice2, choice3)
if (!ref_client) return
if(!ref_client) return
spawn (time) del(src) // When src is deleted, the proc ends immediately. The alert itself closes.
var/ref_answer
+1 -1
View File
@@ -10,7 +10,7 @@
//Returns an integer given a hex input
/proc/hex2num(hex)
if (!( istext(hex) ))
if(!( istext(hex) ))
return
var/num = 0
+47 -47
View File
@@ -26,11 +26,11 @@
//Inverts the colour of an HTML string
/proc/invertHTML(HTMLstring)
if (!( istext(HTMLstring) ))
if(!( istext(HTMLstring) ))
CRASH("Given non-text argument!")
return
else
if (length(HTMLstring) != 7)
if(length(HTMLstring) != 7)
CRASH("Given non-HTML argument!")
return
var/textr = copytext(HTMLstring, 2, 4)
@@ -42,11 +42,11 @@
textr = num2hex(255 - r)
textg = num2hex(255 - g)
textb = num2hex(255 - b)
if (length(textr) < 2)
if(length(textr) < 2)
textr = text("0[]", textr)
if (length(textg) < 2)
if(length(textg) < 2)
textr = text("0[]", textg)
if (length(textb) < 2)
if(length(textb) < 2)
textr = text("0[]", textb)
return text("#[][][]", textr, textg, textb)
return
@@ -218,14 +218,14 @@ Turf and target are seperate in case you want to teleport some distance from a t
//Returns whether or not a player is a guest using their ckey as an input
/proc/IsGuestKey(key)
if (findtext(key, "Guest-", 1, 7) != 1) //was findtextEx
if(findtext(key, "Guest-", 1, 7) != 1) //was findtextEx
return 0
var/i, ch, len = length(key)
for (i = 7, i <= len, ++i)
for(i = 7, i <= len, ++i)
ch = text2ascii(key, i)
if (ch < 48 || ch > 57)
if(ch < 48 || ch > 57)
return 0
return 1
@@ -234,7 +234,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
f = round(f)
f = max(low, f)
f = min(high, f)
if ((f % 2) == 0) //Ensure the last digit is an odd number
if((f % 2) == 0) //Ensure the last digit is an odd number
f += 1
return f
@@ -277,13 +277,13 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/freeborg()
var/select = null
var/list/borgs = list()
for (var/mob/living/silicon/robot/A in player_list)
if (A.stat == 2 || A.connected_ai || A.scrambledcodes || istype(A,/mob/living/silicon/robot/drone))
for(var/mob/living/silicon/robot/A in player_list)
if(A.stat == 2 || A.connected_ai || A.scrambledcodes || istype(A,/mob/living/silicon/robot/drone))
continue
var/name = "[A.real_name] ([A.modtype] [A.braintype])"
borgs[name] = A
if (borgs.len)
if(borgs.len)
select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs
return borgs[select]
@@ -352,15 +352,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
var/list/namecounts = list()
for(var/mob/M in mobs)
var/name = M.name
if (name in names)
if(name in names)
namecounts[name]++
name = "[name] ([namecounts[name]])"
else
names.Add(name)
namecounts[name] = 1
if (M.real_name && M.real_name != M.name)
if(M.real_name && M.real_name != M.name)
name += " \[[M.real_name]\]"
if (M.stat == 2)
if(M.stat == 2)
if(istype(M, /mob/dead/observer/))
name += " \[ghost\]"
else
@@ -679,13 +679,13 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
var/src_min_x = 0
var/src_min_y = 0
for (var/turf/T in turfs_src)
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
var/trg_min_x = 0
var/trg_min_y = 0
for (var/turf/T in turfs_trg)
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
@@ -709,9 +709,9 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
var/list/toupdate = new/list()
moving:
for (var/turf/T in refined_src)
for(var/turf/T in refined_src)
var/datum/coords/C_src = refined_src[T]
for (var/turf/B in refined_trg)
for(var/turf/B in refined_trg)
var/datum/coords/C_trg = refined_trg[B]
if(C_src.x_pos == C_trg.x_pos && C_src.y_pos == C_trg.y_pos)
@@ -845,13 +845,13 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
var/src_min_x = 0
var/src_min_y = 0
for (var/turf/T in turfs_src)
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
var/trg_min_x = 0
var/trg_min_y = 0
for (var/turf/T in turfs_trg)
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
@@ -877,9 +877,9 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
moving:
for (var/turf/T in refined_src)
for(var/turf/T in refined_src)
var/datum/coords/C_src = refined_src[T]
for (var/turf/B in refined_trg)
for(var/turf/B in refined_trg)
var/datum/coords/C_trg = refined_trg[B]
if(C_src.x_pos == C_trg.x_pos && C_src.y_pos == C_trg.y_pos)
@@ -990,24 +990,24 @@ proc/oview_or_orange(distance = world.view , center = usr , type)
proc/get_mob_with_client_list()
var/list/mobs = list()
for(var/mob/M in mob_list)
if (M.client)
if(M.client)
mobs += M
return mobs
/proc/parse_zone(zone)
if(zone == "r_hand") return "right hand"
else if (zone == "l_hand") return "left hand"
else if (zone == "l_arm") return "left arm"
else if (zone == "r_arm") return "right arm"
else if (zone == "l_leg") return "left leg"
else if (zone == "r_leg") return "right leg"
else if (zone == "l_foot") return "left foot"
else if (zone == "r_foot") return "right foot"
else if (zone == "l_hand") return "left hand"
else if (zone == "r_hand") return "right hand"
else if (zone == "l_foot") return "left foot"
else if (zone == "r_foot") return "right foot"
else if(zone == "l_hand") return "left hand"
else if(zone == "l_arm") return "left arm"
else if(zone == "r_arm") return "right arm"
else if(zone == "l_leg") return "left leg"
else if(zone == "r_leg") return "right leg"
else if(zone == "l_foot") return "left foot"
else if(zone == "r_foot") return "right foot"
else if(zone == "l_hand") return "left hand"
else if(zone == "r_hand") return "right hand"
else if(zone == "l_foot") return "left foot"
else if(zone == "r_foot") return "right foot"
else return zone
//Finds the distance between two atoms, in pixels
@@ -1139,15 +1139,15 @@ var/global/list/common_tools = list(
//Whether or not the given item counts as sharp in terms of dealing damage
/proc/is_sharp(obj/O as obj)
if (!O) return 0
if (O.sharp) return 1
if (O.edge) return 1
if(!O) return 0
if(O.sharp) return 1
if(O.edge) return 1
return 0
//Whether or not the given item counts as cutting with an edge in terms of removing limbs
/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
//Returns 1 if the given item is capable of popping things like balloons, inflatable barriers, or cutting police tape.
@@ -1521,7 +1521,7 @@ var/mob/dview/dview_mob = new
lastloc = loc
sleep(0.6)
if (orbiting == A) //make sure we haven't started orbiting something else.
if(orbiting == A) //make sure we haven't started orbiting something else.
orbiting = null
SpinAnimation(0,0)
@@ -1672,7 +1672,7 @@ var/mob/dview/dview_mob = new
/proc/pick_closest_path(value)
var/list/matches = get_fancy_list_of_types()
if (!isnull(value) && value!="")
if(!isnull(value) && value!="")
matches = filter_fancy_list(matches, value)
if(matches.len==0)
@@ -1706,13 +1706,13 @@ var/list/TYPES_SHORTCUTS = list(
var/global/list/g_fancy_list_of_types = null
/proc/get_fancy_list_of_types()
if (isnull(g_fancy_list_of_types)) //init
if(isnull(g_fancy_list_of_types)) //init
var/list/temp = sortList(subtypesof(/atom) - typesof(/area) - /atom/movable)
g_fancy_list_of_types = new(temp.len)
for(var/type in temp)
var/typename = "[type]"
for (var/tn in TYPES_SHORTCUTS)
if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
for(var/tn in TYPES_SHORTCUTS)
if(copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
break
g_fancy_list_of_types[typename] = type
@@ -1730,10 +1730,10 @@ var/global/list/g_fancy_list_of_types = null
/proc/stoplag()
. = 1
sleep(world.tick_lag)
if (world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, still not enough tick, sleep for more.
if(world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, still not enough tick, sleep for more.
. += 2
sleep(world.tick_lag*2)
if (world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, STILL not enough tick, sleep for more.
if(world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, STILL not enough tick, sleep for more.
. += 4
sleep(world.tick_lag*4)
//you might be thinking of adding more steps to this, or making it use a loop and a counter var
+8 -8
View File
@@ -29,26 +29,26 @@
var/global/list/hooks = list()
/proc/SetupHooks()
for (var/hook_path in typesof(/hook))
for(var/hook_path in typesof(/hook))
var/hook/hook = new hook_path
hooks[hook.name] = hook
// log_to_dd("Found hook: " + hook.name)
for (var/hook_path in typesof(/hook_handler))
for(var/hook_path in typesof(/hook_handler))
var/hook_handler/hook_handler = new hook_path
for (var/name in hooks)
if (hascall(hook_handler, "On" + name))
for(var/name in hooks)
if(hascall(hook_handler, "On" + name))
var/hook/hook = hooks[name]
hook.handlers += hook_handler
// log_to_dd("Found hook handler for: " + name)
for (var/hook/hook in hooks)
for(var/hook/hook in hooks)
hook.Setup()
/proc/CallHook(var/name as text, var/list/args)
var/hook/hook = hooks[name]
if (!hook)
if(!hook)
//log_to_dd("WARNING: Hook with name " + name + " does not exist")
return
if (hook.Called(args))
if(hook.Called(args))
return
for (var/hook_handler/hook_handler in hook.handlers)
for(var/hook_handler/hook_handler in hook.handlers)
call(hook_handler, "On" + hook.name)(args)
+7 -7
View File
@@ -143,7 +143,7 @@
for(var/i=1, i<tankcheck.len+1, ++i)
if(istype(tankcheck[i], /obj/item/weapon/tank))
var/obj/item/weapon/tank/t = tankcheck[i]
/* if (!isnull(t.manipulated_by) && t.manipulated_by != C.real_name && findtext(t.desc,breathes))
/* if(!isnull(t.manipulated_by) && t.manipulated_by != C.real_name && findtext(t.desc,breathes))
contents.Add(t.air_contents.total_moles) Someone messed with the tank and put unknown gasses
continue in it, so we're going to believe the tank is what it says it is*/
switch(breathes)
@@ -155,21 +155,21 @@
else
contents.Add(0)
if ("oxygen")
if("oxygen")
if(t.air_contents.oxygen && !t.air_contents.toxins)
contents.Add(t.air_contents.oxygen)
else
contents.Add(0)
// No races breath this, but never know about downstream servers.
if ("carbon dioxide")
if("carbon dioxide")
if(t.air_contents.carbon_dioxide && !t.air_contents.toxins)
contents.Add(t.air_contents.carbon_dioxide)
else
contents.Add(0)
// ACK ACK ACK Plasmen
if ("plasma")
if("plasma")
if(t.air_contents.toxins)
contents.Add(t.air_contents.toxins)
else
@@ -272,7 +272,7 @@
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(master)
var/obj/item/I = usr.get_active_hand()
@@ -372,7 +372,7 @@
return 1
if(usr.incapacitated())
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
@@ -411,7 +411,7 @@
return 1
if(usr.incapacitated())
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(ismob(usr))
+6 -6
View File
@@ -33,11 +33,11 @@
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
if(!istype(M)) // not sure if this is the right thing...
return 0
var/messagesource = M
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if(can_operate(M)) //Checks if mob is lying down on table for surgery
if(istype(src,/obj/item/robot_parts))//popup ovveride for direct attach
if(!attempt_initiate_surgery(src, M, user,1))
return 0
@@ -54,9 +54,9 @@
else
return 1
if (istype(M,/mob/living/carbon/brain))
if(istype(M,/mob/living/carbon/brain))
messagesource = M:container
if (hitsound && force > 0)
if(hitsound && force > 0)
playsound(loc, hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
@@ -177,9 +177,9 @@
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
if(prob(33)) // Added blood for whacking non-humans too
var/turf/simulated/location = M.loc
if (istype(location, /turf/simulated))
if(istype(location, /turf/simulated))
location.add_blood_floor(M)
if("fire")
M.take_organ_damage(0, power)
+39 -39
View File
@@ -2,7 +2,7 @@
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
if(world.time <= usr:lastDblClick+1)
return
else
usr:lastDblClick = world.time
@@ -38,15 +38,15 @@
// ------- AI -------
else if (istype(usr, /mob/living/silicon/ai))
else if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
if(ai.control_disabled)
return
// ------- CYBORG -------
else if (istype(usr, /mob/living/silicon/robot))
else if(istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
if(bot.lockcharge) return
..()
@@ -106,7 +106,7 @@
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
if(W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand(0) //update in-hand overlays
@@ -115,14 +115,14 @@
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
if (((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
if(((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
return
// ------- CLICKING STUFF IN CONTAINERS -------
if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if (istype(usr, /mob/living/silicon/ai))
if((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled || ai.malfhacking)
if(ai.control_disabled || ai.malfhacking)
return
else
return
@@ -141,11 +141,11 @@
// to_chat(world, "according to dblclick(), t5 is [t5]")
// ------- ACTUALLY DETERMINING STUFF -------
if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
if(((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if (usr.next_move < world.time)
if(usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
@@ -154,14 +154,14 @@
// ------- DELAY CHECK PASSED -------
if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
if((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if ( (direct - 1) & direct)
if( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
@@ -259,39 +259,39 @@
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if (!( ok ))
if(!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
if(!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT REASTRAINED -------
if (W)
if(W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
var/ignoreAA = 0 //Ignore afterattack(). Surgery uses this.
if (t5)
if(t5)
ignoreAA = src.attackby(W, usr, params)
if (W && !ignoreAA)
if(W && !ignoreAA)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if (istype(usr, /mob/living/carbon/human))
if(istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if (istype(usr, /mob/living/carbon/monkey))
if(istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
else if(istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
else if(istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
else if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
@@ -299,51 +299,51 @@
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if (istype(usr, /mob/living/carbon/human))
if(istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
else if(istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
else if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if (istype(src, /obj/screen))
if(istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if (usr.next_move < world.time)
if(usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if (!( usr.restrained() ))
if(!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if ((W && !( istype(src, /obj/screen) )))
if((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr, params)
if (W)
if(W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
if(istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
else if(istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
if(istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
else if(istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
@@ -171,7 +171,7 @@
main.restartProcess(src.name)
/datum/controller/process/proc/kill()
if (!killed)
if(!killed)
var/msg = "[name] process was killed at tick #[ticks]."
log_debug(msg)
message_admins(msg)
@@ -186,22 +186,22 @@
// Do not call this directly - use SHECK or SCHECK_EVERY
/datum/controller/process/proc/sleepCheck(var/tickId = 0)
calls_since_last_scheck = 0
if (killed)
if(killed)
// The kill proc is the only place where killed is set.
// The kill proc should have deleted this datum, and all sleeping procs that are
// owned by it.
CRASH("A killed process is still running somehow...")
if (hung)
if(hung)
// This will only really help if the doWork proc ends up in an infinite loop.
handleHung()
CRASH("Process [name] hung and was restarted.")
if (main.getCurrentTickElapsedTime() > main.timeAllowance)
if(main.getCurrentTickElapsedTime() > main.timeAllowance)
sleep(world.tick_lag)
cpu_defer_count++
last_slept = 0
else
if (TimeOfTick > last_slept + sleep_interval)
if(TimeOfTick > last_slept + sleep_interval)
// If we haven't slept in sleep_interval deciseconds, sleep to allow other work to proceed.
sleep(0)
last_slept = TimeOfTick
@@ -213,14 +213,14 @@
var/elapsedTime = getElapsedTime()
if (hung)
if(hung)
handleHung()
return
else if (elapsedTime > hang_restart_time)
else if(elapsedTime > hang_restart_time)
hung()
else if (elapsedTime > hang_alert_time)
else if(elapsedTime > hang_alert_time)
setStatus(PROCESS_STATUS_PROBABLY_HUNG)
else if (elapsedTime > hang_warning_time)
else if(elapsedTime > hang_warning_time)
setStatus(PROCESS_STATUS_MAYBE_HUNG)
@@ -66,7 +66,7 @@ var/global/datum/controller/processScheduler/processScheduler
* this treatment.
*/
/datum/controller/processScheduler/proc/deferSetupFor(var/processPath)
if (!(processPath in deferredSetupList))
if(!(processPath in deferredSetupList))
deferredSetupList += processPath
/datum/controller/processScheduler/proc/setup()
@@ -77,11 +77,11 @@ var/global/datum/controller/processScheduler/processScheduler
var/process
// Add all the processes we can find, except for the ticker
for (process in subtypesof(/datum/controller/process))
if (!(process in deferredSetupList))
for(process in subtypesof(/datum/controller/process))
if(!(process in deferredSetupList))
addProcess(new process(src))
for (process in deferredSetupList)
for(process in deferredSetupList)
addProcess(new process(src))
/datum/controller/processScheduler/proc/start()
@@ -114,7 +114,7 @@ var/global/datum/controller/processScheduler/processScheduler
for(var/datum/controller/process/p in running)
p.update()
if (isnull(p)) // Process was killed
if(isnull(p)) // Process was killed
continue
var/status = p.getStatus()
@@ -132,11 +132,11 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/queueProcesses()
for(var/datum/controller/process/p in processes)
// Don't double-queue, don't queue running processes
if (p.disabled || p.running || p.queued || !p.idle)
if(p.disabled || p.running || p.queued || !p.idle)
continue
// If the process should be running by now, go ahead and queue it
if (world.time >= last_queued[p] + p.schedule_interval)
if(world.time >= last_queued[p] + p.schedule_interval)
setQueuedProcessState(p)
/datum/controller/processScheduler/proc/runQueuedProcesses()
@@ -217,34 +217,34 @@ var/global/datum/controller/processScheduler/processScheduler
recordEnd(process)
/datum/controller/processScheduler/proc/setIdleProcessState(var/datum/controller/process/process)
if (process in running)
if(process in running)
running -= process
if (process in queued)
if(process in queued)
queued -= process
if (!(process in idle))
if(!(process in idle))
idle += process
/datum/controller/processScheduler/proc/setQueuedProcessState(var/datum/controller/process/process)
if (process in running)
if(process in running)
running -= process
if (process in idle)
if(process in idle)
idle -= process
if (!(process in queued))
if(!(process in queued))
queued += process
// The other state transitions are handled internally by the process.
process.queued()
/datum/controller/processScheduler/proc/setRunningProcessState(var/datum/controller/process/process)
if (process in queued)
if(process in queued)
queued -= process
if (process in idle)
if(process in idle)
idle -= process
if (!(process in running))
if(!(process in running))
running += process
/datum/controller/processScheduler/proc/recordStart(var/datum/controller/process/process, var/time = null)
if (isnull(time))
if(isnull(time))
time = TimeOfGame
last_queued[process] = world.time
last_start[process] = time
@@ -253,7 +253,7 @@ var/global/datum/controller/processScheduler/processScheduler
last_start[process] = time
/datum/controller/processScheduler/proc/recordEnd(var/datum/controller/process/process, var/time = null)
if (isnull(time))
if(isnull(time))
time = TimeOfGame
var/lastRunTime = time - last_start[process]
@@ -273,7 +273,7 @@ var/global/datum/controller/processScheduler/processScheduler
highest_run_time[process] = time
var/list/lastTwenty = last_twenty_run_times[process]
if (lastTwenty.len == 20)
if(lastTwenty.len == 20)
lastTwenty.Cut(1, 2)
lastTwenty.len++
lastTwenty[lastTwenty.len] = time
@@ -304,7 +304,7 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/getStatusData()
var/list/data = new
for (var/datum/controller/process/p in processes)
for(var/datum/controller/process/p in processes)
data.len++
data[data.len] = p.getContextData()
@@ -314,14 +314,14 @@ var/global/datum/controller/processScheduler/processScheduler
return processes.len
/datum/controller/processScheduler/proc/hasProcess(var/processName as text)
if (nameToProcessMap[processName])
if(nameToProcessMap[processName])
return 1
/datum/controller/processScheduler/proc/killProcess(var/processName as text)
restartProcess(processName)
/datum/controller/processScheduler/proc/restartProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/oldInstance = nameToProcessMap[processName]
var/datum/controller/process/newInstance = new oldInstance.type(src)
newInstance._copyStateFrom(oldInstance)
@@ -329,24 +329,24 @@ var/global/datum/controller/processScheduler/processScheduler
oldInstance.kill()
/datum/controller/processScheduler/proc/enableProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/process = nameToProcessMap[processName]
process.enable()
/datum/controller/processScheduler/proc/disableProcess(var/processName as text)
if (hasProcess(processName))
if(hasProcess(processName))
var/datum/controller/process/process = nameToProcessMap[processName]
process.disable()
/datum/controller/processScheduler/proc/getCurrentTickElapsedTime()
if (world.time > currentTick)
if(world.time > currentTick)
updateCurrentTickData()
return 0
else
return TimeOfTick
/datum/controller/processScheduler/proc/updateCurrentTickData()
if (world.time > currentTick)
if(world.time > currentTick)
// New tick!
currentTick = world.time
updateTimeAllowance()
+12 -12
View File
@@ -153,7 +153,7 @@ var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, MED_FREQ, SEC_FREQ, SCI
/proc/frequency_span_class(var/frequency)
// Antags!
if (frequency in ANTAG_FREQS)
if(frequency in ANTAG_FREQS)
return "syndradio"
// centcomm channels (deathsquid and ert)
if(frequency in CENT_FREQS)
@@ -167,7 +167,7 @@ var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, MED_FREQ, SEC_FREQ, SCI
// department radio formatting (poorly optimized, ugh)
if(frequency == SEC_FREQ)
return "secradio"
if (frequency == ENG_FREQ)
if(frequency == ENG_FREQ)
return "engradio"
if(frequency == SCI_FREQ)
return "sciradio"
@@ -265,17 +265,17 @@ var/global/datum/controller/radio/radio_controller
if(!start_point)
qdel(signal)
return 0
if (filter)
if(filter)
send_to_filter(source, signal, filter, start_point, range)
send_to_filter(source, signal, RADIO_DEFAULT, start_point, range)
else
//Broadcast the signal to everyone!
for (var/next_filter in devices)
for(var/next_filter in devices)
send_to_filter(source, signal, next_filter, start_point, range)
//Sends a signal to all machines belonging to a given filter. Should be called by post_signal()
/datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, var/filter, var/turf/start_point = null, var/range = null)
if (range && !start_point)
if(range && !start_point)
return
for(var/obj/device in devices[filter])
@@ -291,11 +291,11 @@ var/global/datum/controller/radio/radio_controller
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
/datum/radio_frequency/proc/add_listener(obj/device as obj, var/filter as text|null)
if (!filter)
if(!filter)
filter = RADIO_DEFAULT
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
var/list/obj/devices_line = devices[filter]
if (!devices_line)
if(!devices_line)
devices_line = new
devices[filter] = devices_line
devices_line+=device
@@ -305,12 +305,12 @@ var/global/datum/controller/radio/radio_controller
//log_admin("DEBUG: devices(filter_str).len=[l]")
/datum/radio_frequency/proc/remove_listener(obj/device)
for (var/devices_filter in devices)
for(var/devices_filter in devices)
var/list/devices_line = devices[devices_filter]
devices_line-=device
while (null in devices_line)
while(null in devices_line)
devices_line -= null
if (devices_line.len==0)
if(devices_line.len==0)
devices -= devices_filter
qdel(devices_line)
@@ -335,11 +335,11 @@ var/global/datum/controller/radio/radio_controller
frequency = model.frequency
/datum/signal/proc/debug_print()
if (source)
if(source)
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
else
. = "signal = {source = '[source]' ()\n"
for (var/i in data)
for(var/i in data)
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
if(islist(data[i]))
var/list/L = data[i]
+80 -80
View File
@@ -181,18 +181,18 @@
/datum/configuration/New()
var/list/L = subtypesof(/datum/game_mode)
for (var/T in L)
for(var/T in L)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
var/datum/game_mode/M = new T()
if (M.config_tag)
if(M.config_tag)
if(!(M.config_tag in modes)) // ensure each mode is added only once
diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
src.modes += M.config_tag
src.mode_names[M.config_tag] = M.name
src.probabilities[M.config_tag] = M.probability
if (M.votable)
if(M.votable)
src.votable_modes += M.config_tag
qdel(M)
src.votable_modes += "secret"
@@ -204,188 +204,188 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
if(!name)
continue
if(type == "config")
switch (name)
if ("resource_urls")
switch(name)
if("resource_urls")
config.resource_urls = splittext(value, " ")
if ("admin_legacy_system")
if("admin_legacy_system")
config.admin_legacy_system = 1
if ("ban_legacy_system")
if("ban_legacy_system")
config.ban_legacy_system = 1
if ("use_age_restriction_for_jobs")
if("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
if("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
if ("jobs_have_minimal_access")
if("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
if ("log_ooc")
if("log_ooc")
config.log_ooc = 1
if ("log_access")
if("log_access")
config.log_access = 1
if ("log_say")
if("log_say")
config.log_say = 1
if ("log_admin")
if("log_admin")
config.log_admin = 1
if ("log_debug")
if("log_debug")
config.log_debug = text2num(value)
if ("log_game")
if("log_game")
config.log_game = 1
if ("log_vote")
if("log_vote")
config.log_vote = 1
if ("log_whisper")
if("log_whisper")
config.log_whisper = 1
if ("log_attack")
if("log_attack")
config.log_attack = 1
if ("log_emote")
if("log_emote")
config.log_emote = 1
if ("log_adminchat")
if("log_adminchat")
config.log_adminchat = 1
if ("log_adminwarn")
if("log_adminwarn")
config.log_adminwarn = 1
if ("log_pda")
if("log_pda")
config.log_pda = 1
if ("log_world_output")
if("log_world_output")
config.log_world_output = 1
if ("log_hrefs")
if("log_hrefs")
config.log_hrefs = 1
if ("log_runtime")
if("log_runtime")
config.log_runtime = 1
if ("mentors")
if("mentors")
config.mods_are_mentors = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
if ("allow_vote_restart")
if("allow_vote_restart")
config.allow_vote_restart = 1
if ("allow_vote_mode")
if("allow_vote_mode")
config.allow_vote_mode = 1
if("no_dead_vote")
config.vote_no_dead = 1
if ("default_no_vote")
if("default_no_vote")
config.vote_no_default = 1
if ("vote_delay")
if("vote_delay")
config.vote_delay = text2num(value)
if ("vote_period")
if("vote_period")
config.vote_period = text2num(value)
if ("allow_ai")
if("allow_ai")
config.allow_ai = 1
// if ("authentication")
// if("authentication")
// config.enable_authentication = 1
if ("norespawn")
if("norespawn")
config.respawn = 0
if ("servername")
if("servername")
config.server_name = value
if ("serversuffix")
if("serversuffix")
config.server_suffix = 1
if ("nudge_script_path")
if("nudge_script_path")
config.nudge_script_path = value
if ("hostedby")
if("hostedby")
config.hostedby = value
if ("server")
if("server")
config.server = value
if ("banappeals")
if("banappeals")
config.banappeals = value
if ("wikiurl")
if("wikiurl")
config.wikiurl = value
if ("forumurl")
if("forumurl")
config.forumurl = value
if ("rulesurl")
if("rulesurl")
config.rulesurl = value
if ("donationsurl")
if("donationsurl")
config.donationsurl = value
if ("repositoryurl")
if("repositoryurl")
config.repositoryurl = value
if ("guest_jobban")
if("guest_jobban")
config.guest_jobban = 1
if ("guest_ban")
if("guest_ban")
guests_allowed = 0
if ("usewhitelist")
if("usewhitelist")
config.usewhitelist = 1
if ("feature_object_spell_system")
if("feature_object_spell_system")
config.feature_object_spell_system = 1
if ("allow_metadata")
if("allow_metadata")
config.allow_Metadata = 1
if ("traitor_scaling")
if("traitor_scaling")
config.traitor_scaling = 1
if("protect_roles_from_antagonist")
config.protect_roles_from_antagonist = 1
if ("probability")
if("probability")
var/prob_pos = findtext(value, " ")
var/prob_name = null
var/prob_value = null
if (prob_pos)
if(prob_pos)
prob_name = lowertext(copytext(value, 1, prob_pos))
prob_value = copytext(value, prob_pos + 1)
if (prob_name in config.modes)
if(prob_name in config.modes)
config.probabilities[prob_name] = text2num(prob_value)
else
diary << "Unknown game mode probability configuration definition: [prob_name]."
@@ -611,11 +611,11 @@
config.reactionary_explosions = 1
if("bombcap")
var/BombCap = text2num(value)
if (!BombCap)
if(!BombCap)
continue
if (BombCap < 4)
if(BombCap < 4)
BombCap = 4
if (BombCap > 128)
if(BombCap > 128)
BombCap = 128
MAX_EX_DEVESTATION_RANGE = round(BombCap/4)
@@ -634,36 +634,36 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
if(!name)
continue
switch (name)
switch(name)
if("sql_enabled")
config.sql_enabled = 1
if ("address")
if("address")
sqladdress = value
if ("port")
if("port")
sqlport = value
if ("feedback_database")
if("feedback_database")
sqlfdbkdb = value
if ("feedback_login")
if("feedback_login")
sqlfdbklogin = value
if ("feedback_password")
if("feedback_password")
sqlfdbkpass = value
if("feedback_tableprefix")
sqlfdbktableprefix = value
@@ -676,9 +676,9 @@
if(!t) continue
t = trim(t)
if (length(t) == 0)
if(length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
else if(copytext(t, 1, 2) == "#")
continue
config.overflow_whitelist += t
@@ -686,25 +686,25 @@
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
for (var/T in subtypesof(/datum/game_mode))
for(var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
if (M.config_tag && M.config_tag == mode_name)
if(M.config_tag && M.config_tag == mode_name)
return M
qdel(M)
return new /datum/game_mode/extended()
/datum/configuration/proc/get_runnable_modes()
var/list/datum/game_mode/runnable_modes = new
for (var/T in subtypesof(/datum/game_mode))
for(var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
// to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]")
if (!(M.config_tag in modes))
if(!(M.config_tag in modes))
qdel(M)
continue
if (probabilities[M.config_tag]<=0)
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if (M.can_start())
if(M.can_start())
runnable_modes[M] = probabilities[M.config_tag]
// to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]")
return runnable_modes
+2 -2
View File
@@ -18,8 +18,8 @@ var/global/datum/controller/failsafe/failsafe
. = ..()
// There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one).
if (failsafe != src)
if (istype(failsafe))
if(failsafe != src)
if(istype(failsafe))
recover()
qdel(failsafe)
+1 -1
View File
@@ -28,7 +28,7 @@
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
if ("failsafe")
if("failsafe")
debug_variables(failsafe)
feedback_add_details("admin_verb", "dfailsafe")
if("Ticker")
+1 -1
View File
@@ -200,7 +200,7 @@ datum/controller/vote
return 0
choices.Add(config.votable_modes)
if("crew_transfer")
if (check_rights(R_ADMIN|R_MOD))
if(check_rights(R_ADMIN|R_MOD))
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
+5 -5
View File
@@ -83,17 +83,17 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(full_sync || supplied_laws.len)
S.laws.clear_supplied_laws()
for (var/datum/ai_law/law in ion_laws)
for(var/datum/ai_law/law in ion_laws)
S.laws.add_ion_law(law.law)
for (var/datum/ai_law/law in inherent_laws)
for(var/datum/ai_law/law in inherent_laws)
S.laws.add_inherent_law(law.law)
for (var/datum/ai_law/law in supplied_laws)
for(var/datum/ai_law/law in supplied_laws)
if(law)
S.laws.add_supplied_law(law.index, law.law)
/mob/living/silicon/proc/sync_zeroth(var/datum/ai_law/zeroth_law, var/datum/ai_law/zeroth_law_borg)
if (!is_special_character(src) || mind.original != src)
if(!is_special_character(src) || mind.original != src)
if(zeroth_law_borg)
laws.set_zeroth_law(zeroth_law_borg.law)
else if(zeroth_law)
@@ -159,7 +159,7 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(supplied_laws.len >= number && supplied_laws[number])
delete_law(supplied_laws[number])
while (src.supplied_laws.len < number)
while(src.supplied_laws.len < number)
src.supplied_laws += ""
if(state_supplied.len < supplied_laws.len)
state_supplied += 1
+10 -10
View File
@@ -20,13 +20,13 @@
user = nuser
window_id = nwindow_id
if (ntitle)
if(ntitle)
title = format_text(ntitle)
if (nwidth)
if(nwidth)
width = nwidth
if (nheight)
if(nheight)
height = nheight
if (nref)
if(nref)
ref = nref
add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs
@@ -60,18 +60,18 @@
/datum/browser/proc/get_header()
var/key
var/filename
for (key in stylesheets)
for(key in stylesheets)
filename = "[ckey(key)].css"
user << browse_rsc(stylesheets[key], filename)
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'>"
for (key in scripts)
for(key in scripts)
filename = "[ckey(key)].js"
user << browse_rsc(scripts[key], filename)
head_content += "<script type='text/javascript' src='[filename]'></script>"
var/title_attributes = "class='uiTitle'"
if (title_image)
if(title_image)
title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'"
return {"<!DOCTYPE html>
@@ -103,10 +103,10 @@
/datum/browser/proc/open(var/use_onclose = 1)
var/window_size = ""
if (width && height)
if(width && height)
window_size = "size=[width]x[height];"
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
if (use_onclose)
if(use_onclose)
onclose(user, window_id, ref)
/datum/browser/proc/close()
@@ -118,7 +118,7 @@
/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1)
/*
var/icon/I
if (dir >= 0)
if(dir >= 0)
I = new /icon(icon, icon_state, dir)
else
I = new /icon(icon, icon_state)
+1 -1
View File
@@ -11,7 +11,7 @@ var/global/datum/repository/apc/apc_repository = new()
if(world.time < cache_entry.timestamp)
return cache_entry.data
if (powermonitor && !isnull(powermonitor.powernet))
if(powermonitor && !isnull(powermonitor.powernet))
var/list/L = list()
for(var/obj/machinery/power/terminal/term in powermonitor.powernet.nodes)
if(istype(term.master, /obj/machinery/power/apc))
+1 -1
View File
@@ -62,6 +62,6 @@ var/global/datum/repository/crew/crew_repository = new()
for(var/mob/living/carbon/human/H in mob_list)
if(istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/C = H.w_uniform
if (C.has_sensor)
if(C.has_sensor)
tracked |= C
return tracked
+5 -3
View File
@@ -17,7 +17,7 @@
var/real_title = assignment
for(var/datum/data/record/t in data_core.general)
if (t)
if(t)
if(t.fields["name"] == name)
foundrecord = t
break
@@ -66,6 +66,8 @@
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["photo"] = get_id_photo(H)
G.fields["photo-south"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]'"
G.fields["photo-west"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]'"
if(H.gen_record && !jobban_isbanned(H, "Records"))
G.fields["notes"] = H.gen_record
else
@@ -129,7 +131,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
var/g = "m"
if (H.gender == FEMALE)
if(H.gender == FEMALE)
g = "f"
var/icon/icobase = H.species.icobase
@@ -151,7 +153,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
// Skin tone
if(H.species.bodyflags & HAS_SKIN_TONE)
if (H.s_tone >= 0)
if(H.s_tone >= 0)
preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
+24 -24
View File
@@ -20,7 +20,7 @@
title = "[A.name] (\ref[A]) = [A.type]"
#ifdef VARSICON
if (A.icon)
if(A.icon)
body += debug_variable("icon", new/icon(A.icon, A.icon_state, A.dir), 0)
#endif
@@ -43,11 +43,11 @@
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 )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
alist = lis\[i\].getElementsByTagName("a")
if(alist.length > 0){
@@ -62,11 +62,11 @@
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 )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
if( (i-1) >= 0){
var li_new = lis\[i-1\];
@@ -83,11 +83,11 @@
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 )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.style.backgroundColor == "#ffee88" )
if( li.style.backgroundColor == "#ffee88" )
{
if( (i+1) < lis.length){
var li_new = lis\[i+1\];
@@ -113,11 +113,11 @@
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
for ( var i = 0; i < lis.length; ++i )
for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
if ( li.innerText.toLowerCase().indexOf(filter) == -1 )
if( li.innerText.toLowerCase().indexOf(filter) == -1 )
{
vars_ol.removeChild(li);
i--;
@@ -126,10 +126,10 @@
}
}
var lis_new = vars_ol.getElementsByTagName("li");
for ( var j = 0; j < lis_new.length; ++j )
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";
@@ -293,18 +293,18 @@
body += "<ol id='vars'>"
var/list/names = list()
for (var/V in D.vars)
for(var/V in D.vars)
names += V
names = sortList(names)
for (var/V in names)
for(var/V in names)
body += debug_variable(V, D.vars[V], 0, D)
body += "</ol>"
var/html = "<html><head>"
if (title)
if(title)
html += "<title>[title]</title>"
html += {"<style>
body
@@ -342,13 +342,13 @@ body
else
html += "<li>"
if (isnull(value))
if(isnull(value))
html += "[name] = <span class='value'>null</span>"
else if (istext(value))
else if(istext(value))
html += "[name] = <span class='value'>\"[value]\"</span>"
else if (isicon(value))
else if(isicon(value))
#ifdef VARSICON
var/icon/I = new/icon(value)
var/rnd = rand(1,10000)
@@ -359,7 +359,7 @@ body
html += "[name] = /icon (<span class='value'>[value]</span>)"
#endif
/* else if (istype(value, /image))
/* else if(istype(value, /image))
#ifdef VARSICON
var/rnd = rand(1, 10000)
var/image/I = value
@@ -370,22 +370,22 @@ body
html += "[name] = /image (<span class='value'>[value]</span>)"
#endif
*/
else if (isfile(value))
else if(isfile(value))
html += "[name] = <span class='value'>'[value]'</span>"
else if (istype(value, /datum))
else if(istype(value, /datum))
var/datum/D = value
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = [D.type]"
else if (istype(value, /client))
else if(istype(value, /client))
var/client/C = value
html += "<a href='?_src_=vars;Vars=\ref[value]'>[name] \ref[value]</a> = [C] [C.type]"
//
else if (istype(value, /list))
else if(istype(value, /list))
var/list/L = value
html += "[name] = /list ([L.len])"
if (L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500))
if(L.len > 0 && !(name == "underlays" || name == "overlays" || name == "vars" || L.len > 500))
// not sure if this is completely right...
if(0) //(L.vars.len > 0)
html += "<ol>"
@@ -393,7 +393,7 @@ body
else
html += "<ul>"
var/index = 1
for (var/entry in L)
for(var/entry in L)
if(istext(entry))
html += debug_variable(entry, L[entry], level + 1)
//html += debug_variable("[index]", L[index], level + 1)
@@ -30,7 +30,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(4, 5)
if (M.reagents.get_reagent_amount("salbutamol") < 20)
if(M.reagents.get_reagent_amount("salbutamol") < 20)
M.reagents.add_reagent("salbutamol", 20)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
@@ -30,7 +30,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(5)
if (M.reagents.get_reagent_amount("ephedrine") < 10)
if(M.reagents.get_reagent_amount("ephedrine") < 10)
M.reagents.add_reagent("ephedrine", 10)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
@@ -79,7 +79,7 @@ Bonus
var/mob/living/M = A.affected_mob
switch(A.stage)
if(4, 5)
if (M.reagents.get_reagent_amount("oculine") < 20)
if(M.reagents.get_reagent_amount("oculine") < 20)
M.reagents.add_reagent("oculine", 20)
else
if(prob(SYMPTOM_ACTIVATION_PROB * 5))
+4 -4
View File
@@ -30,14 +30,14 @@
if(2)
if(prob(5))
affected_mob.emote(pick("twitch_s", "scream"))
if (prob(5))
if(prob(5))
var/speak = pick("AAARRGGHHH!!!!", "GRR!!!", "FUCK!! FUUUUUUCK!!!", "FUCKING SHITCOCK!!", "WROOAAAGHHH!!")
affected_mob.say(speak)
if (prob(15))
if(prob(15))
affected_mob.visible_message("<span class='danger'>[affected_mob] twitches violently!</span>")
affected_mob.drop_l_hand()
affected_mob.drop_r_hand()
if (prob(33))
if(prob(33))
if(affected_mob.incapacitated())
affected_mob.visible_message("<span class='danger'>[affected_mob] spasms and twitches!</span>")
return
@@ -46,7 +46,7 @@
if(M == affected_mob)
continue
var/damage = rand(1, 5)
if (prob(80))
if(prob(80))
playsound(affected_mob.loc, "punch", 25, 1, -1)
affected_mob.visible_message("<span class='danger'>[affected_mob] hits [M] with their thrashing!</span>")
M.adjustBruteLoss(damage)
+1 -1
View File
@@ -62,7 +62,7 @@
return
/datum/disease/dnaspread/Destroy()
if (original_dna && transformed && affected_mob)
if(original_dna && transformed && affected_mob)
original_dna.transfer_identity(affected_mob, transfer_SE = 1)
affected_mob.real_name = affected_mob.dna.real_name
affected_mob.updateappearance(mutcolor_update=1)
+1 -1
View File
@@ -20,7 +20,7 @@
if(prob(50))
affected_mob.Jitter(25)
if(2)
if (prob(50))
if(prob(50))
affected_mob.visible_message("<span class='danger'>[affected_mob] laughs uncontrollably!</span>")
affected_mob.Stun(10)
affected_mob.Weaken(10)
+10 -10
View File
@@ -34,11 +34,11 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(8))
if(prob(8))
to_chat(affected_mob, "<span class='danger'>Your head hurts.</span>")
if (prob(9))
if(prob(9))
to_chat(affected_mob, "You feel a tingling sensation in your chest.")
if (prob(9))
if(prob(9))
to_chat(affected_mob, "<span class='danger'>You feel angry.</span>")
if(2)
if(restcure)
@@ -46,14 +46,14 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(8))
if(prob(8))
to_chat(affected_mob, "<span class='danger'>Your skin feels loose.</span>")
if (prob(10))
if(prob(10))
to_chat(affected_mob, "You feel very strange.")
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head!</span>")
affected_mob.Paralyse(2)
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>Your stomach churns.</span>")
if(3)
if(restcure)
@@ -61,10 +61,10 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(10))
if(prob(10))
to_chat(affected_mob, "<span class='danger'>Your entire body vibrates.</span>")
if (prob(35))
if(prob(35))
if(prob(50))
scramble(1, affected_mob, rand(15, 45))
else
@@ -76,7 +76,7 @@
to_chat(affected_mob, "<span class='notice'>You feel better.</span>")
cure()
return
if (prob(60))
if(prob(60))
if(prob(50))
scramble(1, affected_mob, rand(15, 45))
else
+11 -11
View File
@@ -21,16 +21,16 @@
..()
switch(stage)
if(1)
if (prob(stage_prob) && stage1)
if(prob(stage_prob) && stage1)
to_chat(affected_mob, pick(stage1))
if(2)
if (prob(stage_prob) && stage2)
if(prob(stage_prob) && stage2)
to_chat(affected_mob, pick(stage2))
if(3)
if (prob(stage_prob*2) && stage3)
if(prob(stage_prob*2) && stage3)
to_chat(affected_mob, pick(stage3))
if(4)
if (prob(stage_prob*2) && stage4)
if(prob(stage_prob*2) && stage4)
to_chat(affected_mob, pick(stage4))
if(5)
do_disease_transformation(affected_mob)
@@ -134,13 +134,13 @@
..()
switch(stage)
if(3)
if (prob(8))
if(prob(8))
affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"))
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."))
@@ -165,11 +165,11 @@
..()
switch(stage)
if(3)
if (prob(4))
if(prob(4))
to_chat(affected_mob, "<span class='danger'>You feel a stabbing pain in your head.</span>")
affected_mob.Paralyse(2)
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"))
@@ -221,10 +221,10 @@
..()
switch(stage)
if(3)
if (prob(8))
if(prob(8))
affected_mob.say(pick("YAP", "Woof!"))
if(4)
if (prob(20))
if(prob(20))
affected_mob.say(pick("Bark!", "AUUUUUU"))
/datum/disease/transformation/morph
@@ -45,7 +45,7 @@
proc/custom_action(step, used_atom, user)
if(istype(used_atom, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
if(W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
+138 -138
View File
@@ -147,7 +147,7 @@
)
var/text = ""
var/mob/living/carbon/human/H = current
if (istype(current, /mob/living/carbon/human))
if(istype(current, /mob/living/carbon/human))
/** Impanted**/
if(isloyal(H))
text = "Mindshield Implant:<a href='?src=\ref[src];implant=remove'>Remove</a>|<b>Implanted</b></br>"
@@ -156,18 +156,18 @@
sections["implant"] = text
/** REVOLUTION ***/
text = "revolution"
if (ticker.mode.config_tag=="revolution")
if(ticker.mode.config_tag=="revolution")
text += uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text += "<b>LOYAL EMPLOYEE</b>|headrev|rev"
else if (src in ticker.mode.head_revolutionaries)
else if(src in ticker.mode.head_revolutionaries)
text = "<a href='?src=\ref[src];revolution=clear'>employee</a>|<b>HEADREV</b>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
text += "<br>Flash: <a href='?src=\ref[src];revolution=flash'>give</a>"
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (flash)
if(flash)
if(!flash.broken)
text += "|<a href='?src=\ref[src];revolution=takeflash'>take</a>."
else
@@ -176,9 +176,9 @@
text += "."
text += " <a href='?src=\ref[src];revolution=reequip'>Reequip</a> (gives traitor uplink)."
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];revolution=autoobjectives'>Set to kill all heads</a>."
else if (src in ticker.mode.revolutionaries)
else if(src in ticker.mode.revolutionaries)
text += "<a href='?src=\ref[src];revolution=clear'>employee</a>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<b>REV</b>"
else
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
@@ -192,16 +192,16 @@
/** CULT ***/
text = "cult"
if (ticker.mode.config_tag=="cult")
if(ticker.mode.config_tag=="cult")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text += "<B>LOYAL EMPLOYEE</B>|cultist"
else if (src in ticker.mode.cult)
else if(src in ticker.mode.cult)
text += "<a href='?src=\ref[src];cult=clear'>employee</a>|<b>CULTIST</b>"
text += "<br>Give <a href='?src=\ref[src];cult=tome'>tome</a>|<a href='?src=\ref[src];cult=equip'>equip</a>."
/*
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! Set to sacrifice and <a href='?src=\ref[src];cult=escape'>escape</a> or <a href='?src=\ref[src];cult=summon'>summon</a>."
*/
else
@@ -217,13 +217,13 @@
/** WIZARD ***/
text = "wizard"
if (ticker.mode.config_tag=="wizard")
if(ticker.mode.config_tag=="wizard")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.wizards)
if(src in ticker.mode.wizards)
text += "<b>YES</b>|<a href='?src=\ref[src];wizard=clear'>no</a>"
text += "<br><a href='?src=\ref[src];wizard=lair'>To lair</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];wizard=dressup'>dress up</a>, <a href='?src=\ref[src];wizard=name'>let choose name</a>."
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];wizard=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a>|<b>NO</b>"
@@ -237,12 +237,12 @@
/** CHANGELING ***/
text = "changeling"
if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan")
if(ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.changelings)
if(src in ticker.mode.changelings)
text += "<b>YES</b>|<a href='?src=\ref[src];changeling=clear'>no</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];changeling=autoobjectives'>Randomize!</a>"
if( changeling && changeling.absorbed_dna.len && (current.real_name != changeling.absorbed_dna[1]) )
text += "<br><a href='?src=\ref[src];changeling=initialdna'>Transform to initial appearance.</a>"
@@ -258,12 +258,12 @@
/** VAMPIRE ***/
text = "vampire"
if (ticker.mode.config_tag=="vampire" || ticker.mode.config_tag=="traitorvamp")
if(ticker.mode.config_tag=="vampire" || ticker.mode.config_tag=="traitorvamp")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.vampires)
if(src in ticker.mode.vampires)
text += "<b>YES</b>|<a href='?src=\ref[src];vampire=clear'>no</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];vampire=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];vampire=vampire'>yes</a>|<b>NO</b>"
@@ -282,18 +282,18 @@
/** NUCLEAR ***/
text = "nuclear"
if (ticker.mode.config_tag=="nuclear")
if(ticker.mode.config_tag=="nuclear")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (src in ticker.mode.syndicates)
if(src in ticker.mode.syndicates)
text += "<b>OPERATIVE</b>|<a href='?src=\ref[src];nuclear=clear'>nanotrasen</a>"
text += "<br><a href='?src=\ref[src];nuclear=lair'>To shuttle</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];nuclear=dressup'>dress up</a>."
var/code
for (var/obj/machinery/nuclearbomb/bombue in machines)
if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
for(var/obj/machinery/nuclearbomb/bombue in machines)
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
code = bombue.r_code
break
if (code)
if(code)
text += " Code is [code]. <a href='?src=\ref[src];nuclear=tellcode'>tell the code.</a>"
else
text += "<a href='?src=\ref[src];nuclear=nuclear'>operative</a>|<b>NANOTRASEN</b>"
@@ -307,15 +307,15 @@
/** TRAITOR ***/
text = "traitor"
if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan" || ticker.mode.config_tag=="traitorvamp")
if(ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan" || ticker.mode.config_tag=="traitorvamp")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (isloyal(H))
if(isloyal(H))
text +="traitor|<b>LOYAL EMPLOYEE</b>"
else
if (src in ticker.mode.traitors)
if(src in ticker.mode.traitors)
text += "<b>TRAITOR</b>|<a href='?src=\ref[src];traitor=clear'>EMPLOYEE</a>"
if (objectives.len==0)
if(objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];traitor=autoobjectives'>Randomize</a>!"
else
text += "<a href='?src=\ref[src];traitor=traitor'>traitor</a>|<b>EMPLOYEE</b>"
@@ -368,53 +368,53 @@
/** SILICON ***/
if (istype(current, /mob/living/silicon))
if(istype(current, /mob/living/silicon))
text = "silicon"
if (ticker.mode.config_tag=="malfunction")
if(ticker.mode.config_tag=="malfunction")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if (istype(current, /mob/living/silicon/ai))
if (src in ticker.mode.malf_ai)
if(istype(current, /mob/living/silicon/ai))
if(src in ticker.mode.malf_ai)
text += "<b>MALF</b>|<a href='?src=\ref[src];silicon=unmalf'>not malf</a>"
else
text += "<a href='?src=\ref[src];silicon=malf'>malf</a>|<b>NOT MALF</b>"
var/mob/living/silicon/robot/robot = current
if (istype(robot) && robot.emagged)
if(istype(robot) && robot.emagged)
text += "<br>Cyborg: Is emagged! <a href='?src=\ref[src];silicon=unemag'>Unemag!</a><br>0th law: [robot.laws.zeroth_law]"
var/mob/living/silicon/ai/ai = current
if (istype(ai) && ai.connected_robots.len)
if(istype(ai) && ai.connected_robots.len)
var/n_e_robots = 0
for (var/mob/living/silicon/robot/R in ai.connected_robots)
if (R.emagged)
for(var/mob/living/silicon/robot/R in ai.connected_robots)
if(R.emagged)
n_e_robots++
text += "<br>[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. <a href='?src=\ref[src];silicon=unemagcyborgs'>Unemag</a>"
sections["malfunction"] = text
if (ticker.mode.config_tag == "traitorchan")
if (sections["traitor"])
if(ticker.mode.config_tag == "traitorchan")
if(sections["traitor"])
out += sections["traitor"]+"<br>"
if (sections["changeling"])
if(sections["changeling"])
out += sections["changeling"]+"<br>"
sections -= "traitor"
sections -= "changeling"
if (ticker.mode.config_tag == "traitorvamp")
if (sections["traitor"])
if(ticker.mode.config_tag == "traitorvamp")
if(sections["traitor"])
out += sections["traitor"]+"<br>"
if (sections["vampire"])
if(sections["vampire"])
out += sections["vampire"]+"<br>"
sections -= "traitor"
sections -= "vampire"
else
if (sections[ticker.mode.config_tag])
if(sections[ticker.mode.config_tag])
out += sections[ticker.mode.config_tag]+"<br>"
sections -= ticker.mode.config_tag
for (var/i in sections)
if (sections[i])
for(var/i in sections)
if(sections[i])
out += sections[i]+"<br>"
if (((src in ticker.mode.head_revolutionaries) || \
if(((src in ticker.mode.head_revolutionaries) || \
(src in ticker.mode.traitors) || \
(src in ticker.mode.syndicates)) && \
istype(current,/mob/living/carbon/human) )
@@ -422,11 +422,11 @@
text = "Uplink: <a href='?src=\ref[src];common=uplink'>give</a>"
var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
if(suplink)
crystals = suplink.uses
if (suplink)
if(suplink)
text += "|<a href='?src=\ref[src];common=takeuplink'>take</a>"
if (usr.client.holder.rights & (R_SERVER|R_EVENT))
if(usr.client.holder.rights & (R_SERVER|R_EVENT))
text += ", <a href='?src=\ref[src];common=crystals'>[crystals]</a> crystals"
else
text += ", [crystals] crystals"
@@ -439,7 +439,7 @@
out += memory
out += "<br><a href='?src=\ref[src];memory_edit=1'>Edit memory</a><br>"
out += "Objectives:<br>"
if (objectives.len == 0)
if(objectives.len == 0)
out += "EMPTY<br>"
else
var/obj_count = 1
@@ -455,28 +455,28 @@
/datum/mind/Topic(href, href_list)
if(!check_rights(R_ADMIN)) return
if (href_list["role_edit"])
if(href_list["role_edit"])
var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist
if (!new_role) return
if(!new_role) return
assigned_role = new_role
log_admin("[key_name(usr)] has changed [key_name(current)]'s assigned role to [assigned_role]")
message_admins("[key_name_admin(usr)] has changed [key_name_admin(current)]'s assigned role to [assigned_role]")
else if (href_list["memory_edit"])
else if(href_list["memory_edit"])
var/new_memo = copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN)
if (isnull(new_memo)) return
if(isnull(new_memo)) return
memory = new_memo
log_admin("[key_name(usr)] has edited [key_name(current)]'s memory")
message_admins("[key_name_admin(usr)] has edited [key_name_admin(current)]'s memory")
else if (href_list["obj_edit"] || href_list["obj_add"])
else if(href_list["obj_edit"] || href_list["obj_add"])
var/datum/objective/objective
var/objective_pos
var/def_value
if (href_list["obj_edit"])
if(href_list["obj_edit"])
objective = locate(href_list["obj_edit"])
if (!objective) return
if(!objective) return
objective_pos = objectives.Find(objective)
//Text strings are easy to manipulate. Revised for simplicity.
@@ -486,12 +486,12 @@
def_value = "custom"
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "identity theft", "custom")
if (!new_obj_type) return
if(!new_obj_type) return
var/datum/objective/new_objective = null
switch (new_obj_type)
if ("assassinate","protect","debrain", "brig", "maroon")
switch(new_obj_type)
if("assassinate","protect","debrain", "brig", "maroon")
//To determine what to name the objective in explanation text.
var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter.
var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text.
@@ -499,19 +499,19 @@
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in ticker.minds)
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
if((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
var/mob/def_target = null
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain)
if (objective&&(objective.type in objective_list) && objective:target)
if(objective&&(objective.type in objective_list) && objective:target)
def_target = objective:target.current
var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
if (!new_target) return
if(!new_target) return
var/objective_path = text2path("/datum/objective/[new_obj_type]")
if (new_target == "Free objective")
if(new_target == "Free objective")
new_objective = new objective_path
new_objective.owner = src
new_objective:target = null
@@ -523,7 +523,7 @@
//Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops.
new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]."
if ("destroy")
if("destroy")
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
@@ -534,38 +534,38 @@
else
to_chat(usr, "No active AIs with minds")
if ("prevent")
if("prevent")
new_objective = new /datum/objective/block
new_objective.owner = src
if ("hijack")
if("hijack")
new_objective = new /datum/objective/hijack
new_objective.owner = src
if ("escape")
if("escape")
new_objective = new /datum/objective/escape
new_objective.owner = src
if ("survive")
if("survive")
new_objective = new /datum/objective/survive
new_objective.owner = src
if ("die")
if("die")
new_objective = new /datum/objective/die
new_objective.owner = src
if ("nuclear")
if("nuclear")
new_objective = new /datum/objective/nuclear
new_objective.owner = src
if ("steal")
if (!istype(objective, /datum/objective/steal))
if("steal")
if(!istype(objective, /datum/objective/steal))
new_objective = new /datum/objective/steal
new_objective.owner = src
else
new_objective = objective
var/datum/objective/steal/steal = new_objective
if (!steal.select_target())
if(!steal.select_target())
return
if("download","capture","absorb", "blood")
@@ -574,7 +574,7 @@
def_num = objective.target_amount
var/target_number = input("Input target number:", "Objective", def_num) as num|null
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
if(isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
return
switch(new_obj_type)
@@ -596,11 +596,11 @@
if("identity theft")
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in ticker.minds)
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
if((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
var/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
if (!new_target)
if(!new_target)
return
var/datum/mind/targ = new_target
if(!istype(targ))
@@ -610,16 +610,16 @@
new_objective.owner = src
new_objective.target = new_target
new_objective.explanation_text = "Escape on the shuttle or an escape pod with the identity of [targ.current.real_name], the [targ.assigned_role] while wearing their identification card."
if ("custom")
if("custom")
var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN))
if (!expl) return
if(!expl) return
new_objective = new /datum/objective
new_objective.owner = src
new_objective.explanation_text = expl
if (!new_objective) return
if(!new_objective) return
if (objective)
if(objective)
objectives -= objective
objectives.Insert(objective_pos, new_objective)
else
@@ -628,7 +628,7 @@
log_admin("[key_name(usr)] has updated [key_name(current)]'s objectives: [new_objective]")
message_admins("[key_name_admin(usr)] has updated [key_name_admin(current)]'s objectives: [new_objective]")
else if (href_list["obj_delete"])
else if(href_list["obj_delete"])
var/datum/objective/objective = locate(href_list["obj_delete"])
if(!istype(objective)) return
objectives -= objective
@@ -679,12 +679,12 @@
ticker.mode.update_cult_icons_removed(src)
special_role = null
var/datum/game_mode/cult/cult = ticker.mode
if (istype(cult))
if(istype(cult))
cult.memorize_cult_objectives(src)
to_chat(current, "\red <FONT size = 3><B>The nanobots in the mindshield implant remove all thoughts about being in a cult. Have a productive day!</B></FONT>")
memory = ""
else if (href_list["revolution"])
else if(href_list["revolution"])
switch(href_list["revolution"])
if("clear")
@@ -725,11 +725,11 @@
to_chat(current, "\blue You are a member of the revolutionaries' leadership now!")
else
return
if (ticker.mode.head_revolutionaries.len>0)
if(ticker.mode.head_revolutionaries.len>0)
// copy targets
var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries
if (valid_head)
for (var/datum/objective/mutiny/O in valid_head.objectives)
if(valid_head)
for(var/datum/objective/mutiny/O in valid_head.objectives)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = src
rev_obj.target = O.target
@@ -749,7 +749,7 @@
message_admins("[key_name_admin(usr)] has automatically forged revolutionary objectives for [key_name_admin(current)]")
if("flash")
if (!ticker.mode.equip_revolutionary(current))
if(!ticker.mode.equip_revolutionary(current))
to_chat(usr, "\red Spawning flash failed!")
log_admin("[key_name(usr)] has given [key_name(current)] a flash")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a flash")
@@ -757,7 +757,7 @@
if("takeflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (!flash)
if(!flash)
to_chat(usr, "\red Deleting flash failed!")
qdel(flash)
log_admin("[key_name(usr)] has taken [key_name(current)]'s flash")
@@ -766,7 +766,7 @@
if("repairflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
if (!flash)
if(!flash)
to_chat(usr, "\red Repairing flash failed!")
else
flash.broken = 0
@@ -781,13 +781,13 @@
var/fail = 0
fail |= !ticker.mode.equip_traitor(current, 1)
fail |= !ticker.mode.equip_revolutionary(current)
if (fail)
if(fail)
to_chat(usr, "\red Reequipping revolutionary goes wrong!")
return
log_admin("[key_name(usr)] has equipped [key_name(current)] as a revolutionary")
message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a revolutionary")
else if (href_list["cult"])
else if(href_list["cult"])
switch(href_list["cult"])
if("clear")
if(src in ticker.mode.cult)
@@ -805,7 +805,7 @@
message_admins("[key_name_admin(usr)] has culted [key_name_admin(current)]")
if("tome")
var/mob/living/carbon/human/H = current
if (istype(H))
if(istype(H))
var/obj/item/weapon/tome/T = new(H)
var/list/slots = list (
@@ -816,7 +816,7 @@
"right hand" = slot_r_hand,
)
var/where = H.equip_in_one_of_slots(T, slots)
if (!where)
if(!where)
to_chat(usr, "\red Spawning tome failed!")
qdel(T)
else
@@ -825,12 +825,12 @@
message_admins("[key_name_admin(usr)] has spawned a tome for [key_name_admin(current)]")
if("equip")
if (!ticker.mode.equip_cultist(current))
if(!ticker.mode.equip_cultist(current))
to_chat(usr, "\red Spawning equipment failed!")
log_admin("[key_name(usr)] has equipped [key_name(current)] as a cultist")
message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a cultist")
else if (href_list["wizard"])
else if(href_list["wizard"])
switch(href_list["wizard"])
if("clear")
@@ -872,7 +872,7 @@
message_admins("[key_name_admin(usr)] has automatically forged wizard objectives for [key_name_admin(current)]")
else if (href_list["changeling"])
else if(href_list["changeling"])
switch(href_list["changeling"])
if("clear")
if(src in ticker.mode.changelings)
@@ -911,7 +911,7 @@
log_admin("[key_name(usr)] has reset [key_name(current)]'s DNA")
message_admins("[key_name_admin(usr)] has reset [key_name_admin(current)]'s DNA")
else if (href_list["vampire"])
else if(href_list["vampire"])
switch(href_list["vampire"])
if("clear")
if(src in ticker.mode.vampires)
@@ -945,7 +945,7 @@
message_admins("[key_name_admin(usr)] has automatically forged objectives for [key_name_admin(current)]")
else if (href_list["nuclear"])
else if(href_list["nuclear"])
var/mob/living/carbon/human/H = current
switch(href_list["nuclear"])
@@ -954,7 +954,7 @@
ticker.mode.syndicates -= src
ticker.mode.update_synd_icons_removed(src)
special_role = null
for (var/datum/objective/nuclear/O in objectives)
for(var/datum/objective/nuclear/O in objectives)
objectives-=O
to_chat(current, "\red <FONT size = 3><B>You have been brainwashed! You are no longer a syndicate operative!</B></FONT>")
log_admin("[key_name(usr)] has de-nuke op'd [key_name(current)]")
@@ -963,7 +963,7 @@
if(!(src in ticker.mode.syndicates))
ticker.mode.syndicates += src
ticker.mode.update_synd_icons_added(src)
if (ticker.mode.syndicates.len==1)
if(ticker.mode.syndicates.len==1)
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
@@ -990,7 +990,7 @@
qdel(H.wear_suit)
qdel(H.w_uniform)
if (!ticker.mode.equip_syndicate(current))
if(!ticker.mode.equip_syndicate(current))
to_chat(usr, "\red Equipping a syndicate failed!")
return
log_admin("[key_name(usr)] has equipped [key_name(current)] as a nuclear operative")
@@ -998,11 +998,11 @@
if("tellcode")
var/code
for (var/obj/machinery/nuclearbomb/bombue in machines)
if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
for(var/obj/machinery/nuclearbomb/bombue in machines)
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
code = bombue.r_code
break
if (code)
if(code)
store_memory("<B>Syndicate Nuclear Bomb Code</B>: [code]", 0, 0)
to_chat(current, "The nuclear authorization code is: <B>[code]</B>")
log_admin("[key_name(usr)] has given [key_name(current)] the nuclear authorization code")
@@ -1010,7 +1010,7 @@
else
to_chat(usr, "\red No valid nuke found!")
else if (href_list["traitor"])
else if(href_list["traitor"])
switch(href_list["traitor"])
if("clear")
if(src in ticker.mode.traitors)
@@ -1113,7 +1113,7 @@
else
temp.equip_scientist(current)
else if (href_list["silicon"])
else if(href_list["silicon"])
switch(href_list["silicon"])
if("unmalf")
if(src in ticker.mode.malf_ai)
@@ -1144,9 +1144,9 @@
if("unemag")
var/mob/living/silicon/robot/R = current
if (istype(R))
if(istype(R))
R.emagged = 0
if (R.activated(R.module.emag))
if(R.activated(R.module.emag))
R.module_active = null
if(R.module_state_1 == R.module.emag)
R.module_state_1 = null
@@ -1161,12 +1161,12 @@
message_admins("[key_name_admin(usr)] has un-emagged [key_name_admin(current)]")
if("unemagcyborgs")
if (istype(current, /mob/living/silicon/ai))
if(istype(current, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = current
for (var/mob/living/silicon/robot/R in ai.connected_robots)
for(var/mob/living/silicon/robot/R in ai.connected_robots)
R.emagged = 0
if (R.module)
if (R.activated(R.module.emag))
if(R.module)
if(R.activated(R.module.emag))
R.module_active = null
if(R.module_state_1 == R.module.emag)
R.module_state_1 = null
@@ -1180,7 +1180,7 @@
log_admin("[key_name(usr)] has unemagged [key_name(ai)]'s cyborgs")
message_admins("[key_name_admin(usr)] has unemagged [key_name_admin(ai)]'s cyborgs")
else if (href_list["common"])
else if(href_list["common"])
switch(href_list["common"])
if("undress")
if(ishuman(current))
@@ -1199,25 +1199,25 @@
log_admin("[key_name(usr)] has taken [key_name(current)]'s uplink")
message_admins("[key_name_admin(usr)] has taken [key_name_admin(current)]'s uplink")
if("crystals")
if (usr.client.holder.rights & (R_SERVER|R_EVENT))
if(usr.client.holder.rights & (R_SERVER|R_EVENT))
var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink()
var/crystals
if (suplink)
if(suplink)
crystals = suplink.uses
crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num
if (!isnull(crystals))
if (suplink)
if(!isnull(crystals))
if(suplink)
suplink.uses = crystals
log_admin("[key_name(usr)] has set [key_name(current)]'s telecrystals to [crystals]")
message_admins("[key_name_admin(usr)] has set [key_name_admin(current)]'s telecrystals to [crystals]")
if("uplink")
if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors)))
if(!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors)))
to_chat(usr, "\red Equipping a syndicate failed!")
return
log_admin("[key_name(usr)] has given [key_name(current)] an uplink")
message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] an uplink")
else if (href_list["obj_announce"])
else if(href_list["obj_announce"])
var/obj_count = 1
to_chat(current, "\blue Your current objectives:")
for(var/datum/objective/objective in objectives)
@@ -1233,16 +1233,16 @@
// remove traitor uplinks
var/list/L = current.get_contents()
for (var/t in L)
if (istype(t, /obj/item/device/pda))
if (t:uplink) qdel(t:uplink)
for(var/t in L)
if(istype(t, /obj/item/device/pda))
if(t:uplink) qdel(t:uplink)
t:uplink = null
else if (istype(t, /obj/item/device/radio))
if (t:traitorradio) qdel(t:traitorradio)
else if(istype(t, /obj/item/device/radio))
if(t:traitorradio) qdel(t:traitorradio)
t:traitorradio = null
t:traitor_frequency = 0.0
else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink))
if (t:origradio)
else if(istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink))
if(t:origradio)
var/obj/item/device/radio/R = t:origradio
R.loc = current.loc
R.traitorradio = null
@@ -1261,8 +1261,8 @@
/datum/mind/proc/find_syndicate_uplink()
var/list/L = current.get_contents()
for (var/obj/item/I in L)
if (I.hidden_uplink)
for(var/obj/item/I in L)
if(I.hidden_uplink)
return I.hidden_uplink
return null
@@ -1297,7 +1297,7 @@
if(!(src in ticker.mode.syndicates))
ticker.mode.syndicates += src
ticker.mode.update_synd_icons_added(src)
if (ticker.mode.syndicates.len==1)
if(ticker.mode.syndicates.len==1)
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
@@ -1362,7 +1362,7 @@
to_chat(current, "<font color=\"purple\"><b><i>You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.</b></i></font>")
to_chat(current, "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>")
var/datum/game_mode/cult/cult = ticker.mode
if (istype(cult))
if(istype(cult))
cult.memorize_cult_objectives(src)
else
var/explanation = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it."
@@ -1372,7 +1372,7 @@
current.memory += "The convert rune is join blood self<BR>"
var/mob/living/carbon/human/H = current
if (istype(H))
if(istype(H))
var/obj/item/weapon/tome/T = new(H)
var/list/slots = list (
@@ -1383,19 +1383,19 @@
"right hand" = slot_r_hand,
)
var/where = H.equip_in_one_of_slots(T, slots)
if (!where)
if(!where)
else
to_chat(H, "A tome, a message from your new master, appears in your [where].")
if (!ticker.mode.equip_cultist(current))
if(!ticker.mode.equip_cultist(current))
to_chat(H, "Spawning an amulet from your Master failed.")
/datum/mind/proc/make_Rev()
if (ticker.mode.head_revolutionaries.len>0)
if(ticker.mode.head_revolutionaries.len>0)
// copy targets
var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries
if (valid_head)
for (var/datum/objective/mutiny/O in valid_head.objectives)
if(valid_head)
for(var/datum/objective/mutiny/O in valid_head.objectives)
var/datum/objective/mutiny/rev_obj = new
rev_obj.owner = src
rev_obj.target = O.target
+8 -8
View File
@@ -7,9 +7,9 @@
/datum/progressbar/New(mob/User, goal_number, atom/target)
. = ..()
if (!istype(target))
if(!istype(target))
EXCEPTION("Invalid target given")
if (goal_number)
if(goal_number)
goal = goal_number
bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0")
bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
@@ -20,23 +20,23 @@
/datum/progressbar/proc/update(progress)
// to_chat(world, "Update [progress] - [goal] - [(progress / goal)] - [((progress / goal) * 100)] - [round(((progress / goal) * 100), 5)]")
if (!user || !user.client)
if(!user || !user.client)
shown = 0
return
if (user.client != client)
if (client)
if(user.client != client)
if(client)
client.images -= bar
if (user.client)
if(user.client)
user.client.images += bar
progress = Clamp(progress, 0, goal)
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
if(!shown)
user.client.images += bar
shown = 1
/datum/progressbar/Destroy()
if (client)
if(client)
client.images -= bar
qdel(bar)
. = ..()
+18 -18
View File
@@ -44,14 +44,14 @@
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
. = 1
for (var/r_r in reagents)
for(var/r_r in reagents)
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
if (aval_r_amnt>reagents[r_r])
if(!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
if(aval_r_amnt>reagents[r_r])
. = -1
else
return 0
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
return -1
return .
@@ -76,7 +76,7 @@
/datum/recipe/proc/check_items(var/obj/container as obj)
. = 1
if (items && items.len)
if(items && items.len)
var/list/checklist = list()
checklist = items.Copy() // You should really trust Copy
for(var/obj/O in container)
@@ -85,20 +85,20 @@
var/found = 0
for(var/i = 1; i < checklist.len+1; i++)
var/item_type = checklist[i]
if (istype(O,item_type))
if(istype(O,item_type))
checklist.Cut(i, i+1)
found = 1
break
if (!found)
if(!found)
. = 0
if (checklist.len)
if(checklist.len)
. = -1
return .
//general version
/datum/recipe/proc/make(var/obj/container as obj)
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
for(var/obj/O in (container.contents-result_obj))
O.reagents.trans_to(result_obj, O.reagents.total_volume)
qdel(O)
container.reagents.clear_reagents()
@@ -108,8 +108,8 @@
// food-related
/datum/recipe/proc/make_food(var/obj/container as obj)
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
if (O.reagents)
for(var/obj/O in (container.contents-result_obj))
if(O.reagents)
O.reagents.del_reagent("nutriment")
O.reagents.update_total()
O.reagents.trans_to(result_obj, O.reagents.total_volume)
@@ -119,22 +119,22 @@
return result_obj
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
if (!exact)
if(!exact)
exact = -1
var/list/datum/recipe/possible_recipes = new
for (var/datum/recipe/recipe in avaiable_recipes)
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact && recipe.check_fruit(obj)==exact)
for(var/datum/recipe/recipe in avaiable_recipes)
if(recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact && recipe.check_fruit(obj)==exact)
possible_recipes+=recipe
if (possible_recipes.len==0)
if(possible_recipes.len==0)
return null
else if (possible_recipes.len==1)
else if(possible_recipes.len==1)
return possible_recipes[1]
else //okay, let's select the most complicated recipe
var/highest_count = 0
. = possible_recipes[1]
for (var/datum/recipe/recipe in possible_recipes)
for(var/datum/recipe/recipe in possible_recipes)
var/count = ((recipe.items)?(recipe.items.len):0) + ((recipe.reagents)?(recipe.reagents.len):0) + ((recipe.fruit)?(recipe.fruit.len):0)
if (count >= highest_count)
if(count >= highest_count)
highest_count = count
. = recipe
return .
+1 -1
View File
@@ -60,7 +60,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.spell_list))
to_chat(user, "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>")
return 0
if (istype(user, /mob/living/carbon/human))
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/caster = user
if(caster.remoteview_target)
caster.remoteview_target = null
+88
View File
@@ -0,0 +1,88 @@
/obj/effect/proc_holder/spell/targeted/touch/cluwne
name = "Curse of the Cluwne"
desc = "Turns the target into a fat and cursed monstrosity of a clown."
hand_path = /obj/item/weapon/melee/touch_attack/cluwne
school = "transmutation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "clown"
/mob/living/carbon/human/proc/makeCluwne()
to_chat(src, "<span class='danger'>You feel funny.</span>")
adjustBrainLoss(80)
nutrition = 9000
overeatduration = 9000
confused = 30
if(mind)
mind.assigned_role = "Cluwne"
var/obj/item/organ/internal/honktumor/cursed/tumor = new
tumor.insert(src)
mutations.Add(NERVOUS)
dna.SetSEState(NERVOUSBLOCK, 1, 1)
genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED)
animate_clownspell(src)
unEquip(w_uniform, 1)
unEquip(shoes, 1)
unEquip(gloves, 1)
if(!istype(wear_mask, /obj/item/clothing/mask/cursedclown)) //Infinite loops otherwise
unEquip(wear_mask, 1)
equip_to_slot_if_possible(new /obj/item/clothing/under/cursedclown, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/gloves/cursedclown, slot_gloves, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/mask/cursedclown, slot_wear_mask, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/cursedclown, slot_shoes, 1, 1, 1)
real_name = "cluwne"
/mob/living/carbon/human/proc/makeAntiCluwne()
to_chat(src, "<span class='danger'>You don't feel very funny.</span>")
adjustBrainLoss(-120)
nutrition = NUTRITION_LEVEL_STARVING
overeatduration = 0
confused = 0
jitteriness = 0
if(mind)
mind.assigned_role = "Lawyer"
var/obj/item/organ/internal/honktumor/cursed/tumor = get_int_organ(/obj/item/organ/internal/honktumor/cursed)
if(tumor)
tumor.remove(src, clean_remove = 1)
qdel(tumor)
else
mutations.Remove(CLUMSY)
mutations.Remove(COMICBLOCK)
dna.SetSEState(CLUMSYBLOCK,0)
dna.SetSEState(COMICBLOCK,0)
genemutcheck(src, CLUMSYBLOCK, null, MUTCHK_FORCED)
genemutcheck(src, COMICBLOCK, null, MUTCHK_FORCED)
mutations.Remove(NERVOUS)
dna.SetSEState(NERVOUSBLOCK, 0)
genemutcheck(src, NERVOUSBLOCK, null, MUTCHK_FORCED)
animate_clownspell(src)
var/obj/item/clothing/under/U = w_uniform
unEquip(w_uniform, 1)
if(U)
qdel(U)
var/obj/item/clothing/shoes/S = shoes
unEquip(shoes, 1)
if(S)
qdel(S)
if(istype(wear_mask, /obj/item/clothing/mask/cursedclown))
unEquip(wear_mask, 1)
if(istype(gloves, /obj/item/clothing/gloves/cursedclown))
var/obj/item/clothing/gloves/G = gloves
unEquip(gloves, 1)
qdel(G)
equip_to_slot_if_possible(new /obj/item/clothing/under/lawyer/black, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/black, slot_shoes, 1, 1, 1)
+1 -1
View File
@@ -106,7 +106,7 @@
return ..()
/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
if (!src.canmove) return
if(!src.canmove) return
var/turf/newLoc = get_step(src,direction)
if(!(newLoc.flags & NOJAUNT))
loc = newLoc
+2 -2
View File
@@ -34,14 +34,14 @@
if(amt_dam_brute > 0)
if(amt_dam_fire >= 0)
target.take_overall_damage(amt_dam_brute,amt_dam_fire)
else if (amt_dam_fire < 0)
else if(amt_dam_fire < 0)
target.take_overall_damage(amt_dam_brute,0)
target.heal_overall_damage(0,amt_dam_fire)
else if(amt_dam_brute < 0)
if(amt_dam_fire > 0)
target.take_overall_damage(0,amt_dam_fire)
target.heal_overall_damage(amt_dam_brute,0)
else if (amt_dam_fire <= 0)
else if(amt_dam_fire <= 0)
target.heal_overall_damage(amt_dam_brute,amt_dam_fire)
target.adjustToxLoss(amt_dam_tox)
target.oxyloss += amt_dam_oxy
+5 -5
View File
@@ -1,5 +1,5 @@
/obj/effect/proc_holder/spell/targeted/touch/
var/hand_path = "/obj/item/weapon/melee/touch_attack"
/obj/effect/proc_holder/spell/targeted/touch
var/hand_path = /obj/item/weapon/melee/touch_attack
var/obj/item/weapon/melee/touch_attack/attached_hand = null
invocation_type = "none" //you scream on connecting, not summoning
include_user = 1
@@ -47,7 +47,7 @@
/obj/effect/proc_holder/spell/targeted/touch/disintegrate
name = "Disintegrate"
desc = "This spell charges your hand with vile energy that can be used to violently explode victims."
hand_path = "/obj/item/weapon/melee/touch_attack/disintegrate"
hand_path = /obj/item/weapon/melee/touch_attack/disintegrate
school = "evocation"
charge_max = 600
@@ -59,11 +59,11 @@
/obj/effect/proc_holder/spell/targeted/touch/flesh_to_stone
name = "Flesh to Stone"
desc = "This spell charges your hand with the power to turn victims into inert statues for a long period of time."
hand_path = "/obj/item/weapon/melee/touch_attack/fleshtostone"
hand_path = /obj/item/weapon/melee/touch_attack/fleshtostone
school = "transmutation"
charge_max = 600
clothes_req = 1
cooldown_min = 200 //100 deciseconds reduction per rank
action_icon_state = "statue"
action_icon_state = "statue"
+3 -3
View File
@@ -80,14 +80,14 @@ var/list/uplink_items = list()
if(!istype(U))
return 0
if (user.stat || user.restrained())
if(user.stat || user.restrained())
return 0
if (!(istype(user, /mob/living/carbon/human)))
if(!(istype(user, /mob/living/carbon/human)))
return 0
// If the uplink's holder is in the user's contents
if ((U.loc in user.contents || (in_range(U.loc, user) && istype(U.loc.loc, /turf))))
if((U.loc in user.contents || (in_range(U.loc, user) && istype(U.loc.loc, /turf))))
user.set_machine(U)
if(cost > U.uses)
return 0
+1 -1
View File
@@ -100,7 +100,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.electrify(0)
return // Don't update the dialog.
if (AIRLOCK_WIRE_SAFETY)
if(AIRLOCK_WIRE_SAFETY)
A.safe = mended
if(AIRLOCK_WIRE_SPEED)
+8 -8
View File
@@ -35,8 +35,8 @@ var/const/AALARM_WIRE_AALARM = 16
A.update_icon()
// to_chat(world, "Power wire cut")
if (AALARM_WIRE_AI_CONTROL)
if (A.aidisabled == !mended)
if(AALARM_WIRE_AI_CONTROL)
if(A.aidisabled == !mended)
A.aidisabled = mended
// to_chat(world, "AI Control Wire Cut")
@@ -47,7 +47,7 @@ var/const/AALARM_WIRE_AALARM = 16
// to_chat(world, "Syphon Wire Cut")
if(AALARM_WIRE_AALARM)
if (A.alarm_area.atmosalert(2, A))
if(A.alarm_area.atmosalert(2, A))
A.post_alert(2)
A.update_icon()
@@ -58,7 +58,7 @@ var/const/AALARM_WIRE_AALARM = 16
A.locked = !A.locked
// to_chat(world, "Idscan wire pulsed")
if (AALARM_WIRE_POWER)
if(AALARM_WIRE_POWER)
// to_chat(world, "Power wire pulsed")
if(A.shorted == 0)
A.shorted = 1
@@ -70,13 +70,13 @@ var/const/AALARM_WIRE_AALARM = 16
A.update_icon()
if (AALARM_WIRE_AI_CONTROL)
if(AALARM_WIRE_AI_CONTROL)
// to_chat(world, "AI Control wire pulsed")
if (A.aidisabled == 0)
if(A.aidisabled == 0)
A.aidisabled = 1
A.updateDialog()
spawn(100)
if (A.aidisabled == 1)
if(A.aidisabled == 1)
A.aidisabled = 0
if(AALARM_WIRE_SYPHON)
@@ -89,6 +89,6 @@ var/const/AALARM_WIRE_AALARM = 16
if(AALARM_WIRE_AALARM)
// to_chat(world, "Aalarm wire pulsed")
if (A.alarm_area.atmosalert(0, A))
if(A.alarm_area.atmosalert(0, A))
A.post_alert(0)
A.update_icon()
+5 -5
View File
@@ -33,7 +33,7 @@ var/const/APC_WIRE_AI_CONTROL = 8
A.locked = 1
A.updateDialog()
if (APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(A.shorted == 0)
A.shorted = 1
@@ -42,8 +42,8 @@ var/const/APC_WIRE_AI_CONTROL = 8
A.shorted = 0
A.updateDialog()
if (APC_WIRE_AI_CONTROL)
if (A.aidisabled == 0)
if(APC_WIRE_AI_CONTROL)
if(A.aidisabled == 0)
A.aidisabled = 1
spawn(10)
@@ -70,9 +70,9 @@ var/const/APC_WIRE_AI_CONTROL = 8
if(APC_WIRE_AI_CONTROL)
if(!mended)
if (A.aidisabled == 0)
if(A.aidisabled == 0)
A.aidisabled = 1
else
if (A.aidisabled == 1)
if(A.aidisabled == 1)
A.aidisabled = 0
A.updateDialog()
+2 -2
View File
@@ -41,7 +41,7 @@ var/const/NUCLEARBOMB_WIRE_SAFETY = 4
set_security_level(N.previous_level)
N.visible_message("\blue The [N] quiets down.")
if(!N.lighthack)
if (N.icon_state == "nuclearbomb2")
if(N.icon_state == "nuclearbomb2")
N.icon_state = "nuclearbomb1"
else
N.visible_message("\blue The [N] emits a quiet whirling noise!")
@@ -56,7 +56,7 @@ var/const/NUCLEARBOMB_WIRE_SAFETY = 4
N.explode()
if(NUCLEARBOMB_WIRE_TIMING)
if(!N.lighthack)
if (N.icon_state == "nuclearbomb2")
if(N.icon_state == "nuclearbomb2")
N.icon_state = "nuclearbomb1"
N.timing = 0
bomb_set = 0
+8 -8
View File
@@ -34,25 +34,25 @@ var/const/BORG_WIRE_LAWCHECK = 16 // Not used on MoMMIs
switch(index)
if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
if(!mended)
if (R.lawupdate == 1)
if(R.lawupdate == 1)
to_chat(R, "LawSync protocol engaged.")
R.show_laws()
else
if (R.lawupdate == 0 && !R.emagged)
if(R.lawupdate == 0 && !R.emagged)
R.lawupdate = 1
if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(!mended)
if (R.connected_ai)
if(R.connected_ai)
R.connected_ai = null
if (BORG_WIRE_CAMERA)
if(BORG_WIRE_CAMERA)
if(!isnull(R.camera) && !R.scrambledcodes)
R.camera.status = mended
R.camera.toggle_cam(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh
if (R.lawupdate)
if(R.lawupdate)
R.lawsync()
if(BORG_WIRE_LOCKED_DOWN)
@@ -63,12 +63,12 @@ var/const/BORG_WIRE_LAWCHECK = 16 // Not used on MoMMIs
var/mob/living/silicon/robot/R = holder
switch(index)
if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
if(!R.emagged)
R.connected_ai = select_active_ai()
R.notify_ai(1)
if (BORG_WIRE_CAMERA)
if(BORG_WIRE_CAMERA)
if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes)
R.camera.toggle_cam(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera.
R.visible_message("[R]'s camera lense focuses loudly.")
+6 -6
View File
@@ -20,7 +20,7 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
var/obj/machinery/syndicatebomb/P = holder
switch(index)
if(WIRE_BOOM)
if (P.active)
if(P.active)
P.loc.visible_message("<span class='danger'>[bicon(holder)] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_UNBOLT)
@@ -32,11 +32,11 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
if(WIRE_PROCEED)
playsound(P.loc, 'sound/machines/buzz-sigh.ogg', 30, 1)
P.loc.visible_message("<span class='danger'>[bicon(holder)] The bomb buzzes ominously!</span>")
if (P.timer >= 61) //Long fuse bombs can suddenly become more dangerous if you tinker with them
if(P.timer >= 61) //Long fuse bombs can suddenly become more dangerous if you tinker with them
P.timer = 60
if (P.timer >= 21)
if(P.timer >= 21)
P.timer -= 10
else if (P.timer >= 11) //both to prevent negative timers and to have a little mercy
else if(P.timer >= 11) //both to prevent negative timers and to have a little mercy
P.timer = 10
if(WIRE_ACTIVATE)
if(!P.active && !P.defused)
@@ -61,7 +61,7 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
if(mended)
P.defused = 0 //cutting and mending all the wires of an inactive bomb will thus cure any sabotage
if(WIRE_UNBOLT)
if (!mended && P.anchored)
if(!mended && P.anchored)
playsound(P.loc, 'sound/effects/stealthoff.ogg', 30, 1)
P.loc.visible_message("<span class='notice'>[bicon(holder)] The bolts lift out of the ground!</span>")
P.anchored = 0
@@ -70,7 +70,7 @@ var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if
P.loc.visible_message("<span class='danger'>[bicon(holder)] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_ACTIVATE)
if (!mended && P.active)
if(!mended && P.active)
P.loc.visible_message("<span class='notice'>[bicon(holder)] The timer stops! The bomb has been defused!</span>")
P.icon_state = "[initial(P.icon_state)]-inactive[P.open_panel ? "-wires" : ""]"
P.active = 0
+3 -3
View File
@@ -65,7 +65,7 @@ datum/announcement/proc/Message(message as text, message_title as text)
if(!istype(M,/mob/new_player) && !isdeaf(M))
to_chat(M, "<h2 class='alert'>[title]</h2>")
to_chat(M, "<span class='alert'>[message]</span>")
if (announcer)
if(announcer)
to_chat(M, "<span class='alert'> -[html_encode(announcer)]</span>")
/datum/announcement/minor/Message(message as text, message_title as text)
@@ -82,7 +82,7 @@ datum/announcement/priority/Message(message as text, message_title as text)
datum/announcement/priority/command/Message(message as text, message_title as text)
var/command
command += "<h1 class='alert'>[command_name()] Update</h1>"
if (message_title)
if(message_title)
command += "<br><h2 class='alert'>[message_title]</h2>"
command += "<br><span class='alert'>[message]</span><br>"
@@ -94,7 +94,7 @@ datum/announcement/priority/command/Message(message as text, message_title as te
datum/announcement/priority/enemy/Message(message as text, message_title as text, from as text)
var/command
command += "<h1 class='alert'>[from]</h1>"
if (message_title)
if(message_title)
command += "<br><h2 class='alert'>[message_title]</h2>"
command += "<br><span class='alert'>[message]</span><br>"
+1 -1
View File
@@ -33,7 +33,7 @@
/proc/get_message_server()
if(message_servers)
for (var/obj/machinery/message_server/MS in message_servers)
for(var/obj/machinery/message_server/MS in message_servers)
if(MS.active)
return MS
return null
+5 -7
View File
@@ -30,7 +30,7 @@
if(!M.viewing_alternate_appearances)
M.viewing_alternate_appearances = list()
viewers |= M
M.viewing_alternate_appearances[key] = src
M.viewing_alternate_appearances += src
if(M.client)
M.client.images |= img
@@ -48,9 +48,7 @@
if(M.client)
M.client.images -= img
if(M.viewing_alternate_appearances && M.viewing_alternate_appearances.len)
M.viewing_alternate_appearances -= key
if(!M.viewing_alternate_appearances.len)
M.viewing_alternate_appearances = null
M.viewing_alternate_appearances -= src
viewers -= M
@@ -61,8 +59,6 @@
hide()
if(owner && owner.alternate_appearances)
owner.alternate_appearances -= key
if(!owner.alternate_appearances.len)
owner.alternate_appearances = null
/datum/alternate_appearance/Destroy()
@@ -74,7 +70,7 @@
/atom
var/list/alternate_appearances //the alternate appearances we own
var/list/viewing_alternate_appearances //the alternate appearances we're viewing, stored here to reestablish them after Logout()s
//these lists are built/destroyed as necessary, so atoms aren't all lugging around lists full of datums
//these lists are built as necessary, so atoms aren't all lugging around empty lists
/*
Builds an alternate_appearance datum for the supplied args, optionally displaying it straight away
@@ -102,6 +98,8 @@
AA.key = key
AA.owner = src
if(alternate_appearances[key])
qdel(alternate_appearances[key])
alternate_appearances[key] = AA
if(displayTo && displayTo.len)
display_alt_appearance(key, displayTo)
+1 -1
View File
@@ -66,7 +66,7 @@ var/list/teleportlocs = list()
if(AR.no_teleportlocs) continue
if(teleportlocs.Find(AR.name)) continue
var/turf/picked = safepick(get_area_turfs(AR.type))
if (picked && (picked.z == ZLEVEL_STATION))
if(picked && (picked.z == ZLEVEL_STATION))
teleportlocs += AR.name
teleportlocs[AR.name] = AR
+3 -3
View File
@@ -7,7 +7,7 @@
..()
// locate and store the motioncamera
spawn (20) // spawn on a delay to let turfs/objs load
for (var/obj/machinery/camera/M in src)
for(var/obj/machinery/camera/M in src)
if(M.isMotion())
motioncamera = M
M.area_motion = src
@@ -16,11 +16,11 @@
/area/ai_monitored/Entered(atom/movable/O)
..()
if (ismob(O) && motioncamera)
if(ismob(O) && motioncamera)
motioncamera.newTarget(O)
/area/ai_monitored/Exited(atom/movable/O)
if (ismob(O) && motioncamera)
if(ismob(O) && motioncamera)
motioncamera.lostTarget(O)
+15 -15
View File
@@ -40,31 +40,31 @@
/area/proc/get_cameras()
var/list/cameras = list()
for (var/obj/machinery/camera/C in src)
for(var/obj/machinery/camera/C in src)
cameras += C
return cameras
/area/proc/atmosalert(danger_level, var/alarm_source)
if (danger_level == 0)
if(danger_level == 0)
atmosphere_alarm.clearAlarm(src, alarm_source)
else
atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level)
//Check all the alarms before lowering atmosalm. Raising is perfectly fine.
for (var/obj/machinery/alarm/AA in src)
if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level)
for(var/obj/machinery/alarm/AA in src)
if(!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level)
danger_level = max(danger_level, AA.danger_level)
if(danger_level != atmosalm)
if (danger_level < 1 && atmosalm >= 1)
if(danger_level < 1 && atmosalm >= 1)
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
air_doors_open()
else if (danger_level >= 2 && atmosalm < 2)
else if(danger_level >= 2 && atmosalm < 2)
air_doors_close()
atmosalm = danger_level
for (var/obj/machinery/alarm/AA in src)
for(var/obj/machinery/alarm/AA in src)
AA.update_icon()
air_alarm_repository.update_cache(src)
@@ -103,7 +103,7 @@
air_doors_close()
/area/proc/fire_reset()
if (fire)
if(fire)
fire = 0 //used for firedoor checks
updateicon()
mouse_opacity = 0
@@ -159,14 +159,14 @@
return
/area/proc/partyalert()
if (!( party ))
if(!( party ))
party = 1
updateicon()
mouse_opacity = 0
return
/area/proc/partyreset()
if (party)
if(party)
party = 0
mouse_opacity = 0
updateicon()
@@ -183,7 +183,7 @@
if(radalert) // always show the radiation alert, regardless of power
icon_state = "radiation"
blend_mode = BLEND_MULTIPLY
else if ((fire || eject || party) && (!requires_power||power_environ))//If it doesn't require power, can still activate this proc.
else if((fire || eject || party) && (!requires_power||power_environ))//If it doesn't require power, can still activate this proc.
if(fire && !radalert && !eject && !party)
icon_state = "red"
blend_mode = BLEND_MULTIPLY
@@ -237,7 +237,7 @@
/area/proc/power_change()
for(var/obj/machinery/M in src) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
if (fire || eject || party)
if(fire || eject || party)
updateicon()
/area/proc/usage(var/chan)
@@ -323,7 +323,7 @@
if(L && L.client && !L.client.ambience_playing && (L.client.prefs.sound & SOUND_BUZZ)) //split off the white noise from the rest of the ambience because of annoyance complaints - Kluys
L.client.ambience_playing = 1
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
else if (L && L.client && !(L.client.prefs.sound & SOUND_BUZZ)) L.client.ambience_playing = 0
else if(L && L.client && !(L.client.prefs.sound & SOUND_BUZZ)) L.client.ambience_playing = 0
if(prob(35) && !newarea.media_source && L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE))
var/sound = pick(ambientsounds)
@@ -347,7 +347,7 @@
if(istype(M.shoes, /obj/item/clothing/shoes/magboots) && (M.shoes.flags & NOSLIP))
return
if (M.buckled) //Cam't fall down if you are buckled
if(M.buckled) //Cam't fall down if you are buckled
return
if(istype(get_turf(M), /turf/space)) // Can't fall onto nothing.
@@ -357,7 +357,7 @@
M.Stun(5)
M.Weaken(5)
else if (istype(M,/mob/living/carbon/human/))
else if(istype(M,/mob/living/carbon/human/))
M.Stun(2)
M.Weaken(2)
+4 -4
View File
@@ -96,7 +96,7 @@
return null
/atom/proc/check_eye(user as mob)
if (istype(user, /mob/living/silicon/ai)) // WHYYYY
if(istype(user, /mob/living/silicon/ai)) // WHYYYY
return 1
return
@@ -225,7 +225,7 @@
return
/atom/proc/hitby(atom/movable/AM as mob|obj)
if (density)
if(density)
AM.throwing = 0
return
@@ -275,14 +275,14 @@
add_fibers(M)
//He has no prints!
if (FINGERPRINTS in M.mutations)
if(FINGERPRINTS in M.mutations)
if(fingerprintslast != M.key)
fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]"
fingerprintslast = M.key
return 0 //Now, lets get to the dirty work.
//First, make sure their DNA makes sense.
var/mob/living/carbon/human/H = M
if (!istype(H.dna, /datum/dna) || !H.dna.uni_identity || (length(H.dna.uni_identity) != 32))
if(!istype(H.dna, /datum/dna) || !H.dna.uni_identity || (length(H.dna.uni_identity) != 32))
if(!istype(H.dna, /datum/dna))
H.dna = new /datum/dna(null)
H.dna.real_name = H.real_name
+22 -22
View File
@@ -30,8 +30,8 @@
for(var/atom/movable/AM in contents)
qdel(AM)
loc = null
if (pulledby)
if (pulledby.pulling == src)
if(pulledby)
if(pulledby.pulling == src)
pulledby.pulling = null
pulledby = null
return ..()
@@ -49,30 +49,30 @@
var/atom/oldloc = loc
if(loc != newloc)
if (!(direct & (direct - 1))) //Cardinal move
if(!(direct & (direct - 1))) //Cardinal move
. = ..()
else //Diagonal move, split it into cardinal moves
if (direct & 1)
if (direct & 4)
if (step(src, NORTH))
if(direct & 1)
if(direct & 4)
if(step(src, NORTH))
. = step(src, EAST)
else if (step(src, EAST))
else if(step(src, EAST))
. = step(src, NORTH)
else if (direct & 8)
if (step(src, NORTH))
else if(direct & 8)
if(step(src, NORTH))
. = step(src, WEST)
else if (step(src, WEST))
else if(step(src, WEST))
. = step(src, NORTH)
else if (direct & 2)
if (direct & 4)
if (step(src, SOUTH))
else if(direct & 2)
if(direct & 4)
if(step(src, SOUTH))
. = step(src, EAST)
else if (step(src, EAST))
else if(step(src, EAST))
. = step(src, SOUTH)
else if (direct & 8)
if (step(src, SOUTH))
else if(direct & 8)
if(step(src, SOUTH))
. = step(src, WEST)
else if (step(src, WEST))
else if(step(src, WEST))
. = step(src, SOUTH)
@@ -102,7 +102,7 @@
if(src.throwing)
src.throw_impact(A)
if (A && sendBump)
if(A && sendBump)
A.last_bumped = world.time
A.Bumped(src)
else
@@ -215,13 +215,13 @@
var/dist_y = abs(target.y - src.y)
var/dx
if (target.x > src.x)
if(target.x > src.x)
dx = EAST
else
dx = WEST
var/dy
if (target.y > src.y)
if(target.y > src.y)
dy = NORTH
else
dy = SOUTH
@@ -305,13 +305,13 @@
return
/atom/movable/overlay/attackby(a, b, c)
if (src.master)
if(src.master)
return src.master.attackby(a, b, c)
return
/atom/movable/overlay/attack_hand(a, b, c)
if (src.master)
if(src.master)
return src.master.attack_hand(a, b, c)
return
+2 -2
View File
@@ -247,7 +247,7 @@
//Borgie battery tracking!
/mob/living/silicon/robot/proc/diag_hud_set_borgcell()
var/image/holder = hud_list[DIAG_BATT_HUD]
if (cell)
if(cell)
var/chargelvl = (cell.charge/cell.maxcharge)
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
else
@@ -263,7 +263,7 @@
/obj/mecha/proc/diag_hud_set_mechcell()
var/image/holder = hud_list[DIAG_BATT_HUD]
if (cell)
if(cell)
var/chargelvl = cell.charge/cell.maxcharge
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
else
+16 -16
View File
@@ -197,7 +197,7 @@ var/global/list/bad_blocks[0]
// Set a DNA UI block's raw value.
/datum/dna/proc/SetUIValue(var/block,var/value,var/defer=0)
if (block<=0) return
if(block<=0) return
ASSERT(value>0)
ASSERT(value<=4095)
UI[block]=value
@@ -207,13 +207,13 @@ var/global/list/bad_blocks[0]
// Get a DNA UI block's raw value.
/datum/dna/proc/GetUIValue(var/block)
if (block<=0) return 0
if(block<=0) return 0
return UI[block]
// Set a DNA UI block's value, given a value and a max possible value.
// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue,var/defer=0)
if (block<=0)
if(block<=0)
return
if(value == 0)
value = 1
@@ -224,20 +224,20 @@ var/global/list/bad_blocks[0]
// Getter version of above.
/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue)
if (block<=0) return 0
if(block<=0) return 0
var/value = GetUIValue(block)
return round(1 +(value / 4096)*maxvalue)
// Is the UI gene "on" or "off"?
// For UI, this is simply a check of if the value is > 2050.
/datum/dna/proc/GetUIState(var/block)
if (block<=0) return
if(block<=0) return
return UI[block] > 2050
// Set UI gene "on" (1) or "off" (0)
/datum/dna/proc/SetUIState(var/block,var/on,var/defer=0)
if (block<=0) return
if(block<=0) return
var/val
if(on)
val=rand(2050,4095)
@@ -253,7 +253,7 @@ var/global/list/bad_blocks[0]
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetUIBlock(var/block,var/value,var/defer=0)
if (block<=0) return
if(block<=0) return
return SetUIValue(block,hex2num(value),defer)
// Get a sub-block from a block.
@@ -264,7 +264,7 @@ var/global/list/bad_blocks[0]
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetUISubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
if (block<=0) return
if(block<=0) return
var/oldBlock=GetUIBlock(block)
var/newBlock=""
for(var/i=1, i<=length(oldBlock), i++)
@@ -287,7 +287,7 @@ var/global/list/bad_blocks[0]
// Set a DNA SE block's raw value.
/datum/dna/proc/SetSEValue(var/block,var/value,var/defer=0)
if (block<=0) return
if(block<=0) return
ASSERT(value>=0)
ASSERT(value<=4095)
SE[block]=value
@@ -298,13 +298,13 @@ var/global/list/bad_blocks[0]
// Get a DNA SE block's raw value.
/datum/dna/proc/GetSEValue(var/block)
if (block<=0) return 0
if(block<=0) return 0
return SE[block]
// Set a DNA SE block's value, given a value and a max possible value.
// Might be used for species?
/datum/dna/proc/SetSEValueRange(var/block,var/value,var/maxvalue)
if (block<=0) return
if(block<=0) return
ASSERT(maxvalue<=4095)
var/range = round(4095 / maxvalue)
if(value)
@@ -312,20 +312,20 @@ var/global/list/bad_blocks[0]
// Getter version of above.
/datum/dna/proc/GetSEValueRange(var/block,var/maxvalue)
if (block<=0) return 0
if(block<=0) return 0
var/value = GetSEValue(block)
return round(1 +(value / 4096)*maxvalue)
// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
/datum/dna/proc/GetSEState(var/block)
if (block<=0) return 0
if(block<=0) return 0
var/list/BOUNDS=GetDNABounds(block)
var/value=GetSEValue(block)
return (value >= BOUNDS[DNA_ON_LOWERBOUND])
// Set a block "on" or "off".
/datum/dna/proc/SetSEState(var/block,var/on,var/defer=0)
if (block<=0) return
if(block<=0) return
var/list/BOUNDS=GetDNABounds(block)
var/val
if(on)
@@ -342,7 +342,7 @@ var/global/list/bad_blocks[0]
// Set a block from a hex string. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0)
if (block<=0) return
if(block<=0) return
var/nval=hex2num(value)
//testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]")
return SetSEValue(block,nval,defer)
@@ -354,7 +354,7 @@ var/global/list/bad_blocks[0]
// Set a sub-block from a hex character. This is inefficient. If you can, use SetUIValue().
// Used in DNA modifiers.
/datum/dna/proc/SetSESubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0)
if (block<=0) return
if(block<=0) return
var/oldBlock=GetSEBlock(block)
var/newBlock=""
for(var/i=1, i<=length(oldBlock), i++)
+8 -12
View File
@@ -5,10 +5,10 @@
// Pads 0s to t until length == u
/proc/add_zero2(t, u)
var/temp1
while (length(t) < u)
while(length(t) < u)
t = "0[t]"
temp1 = t
if (length(t) > u)
if(length(t) > u)
temp1 = copytext(t,2,u+1)
return temp1
@@ -63,15 +63,15 @@
/proc/miniscramble(input,rs,rd)
var/output
output = null
if (input == "C" || input == "D" || input == "E" || input == "F")
if(input == "C" || input == "D" || input == "E" || input == "F")
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3")
if (input == "8" || input == "9" || input == "A" || input == "B")
if(input == "8" || input == "9" || input == "A" || input == "B")
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
if (input == "4" || input == "5" || input == "6" || input == "7")
if(input == "4" || input == "5" || input == "6" || input == "7")
output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
if (input == "0" || input == "1" || input == "2" || input == "3")
if(input == "0" || input == "1" || input == "2" || input == "3")
output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F")
if (!output) output = "5"
if(!output) output = "5"
return output
// HELLO I MAKE BELL CURVES AROUND YOUR DESIRED TARGET
@@ -161,7 +161,7 @@
H.s_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative.
if (dna.GetUIState(DNA_UI_GENDER))
if(dna.GetUIState(DNA_UI_GENDER))
H.change_gender(FEMALE, 0)
else
H.change_gender(MALE, 0)
@@ -196,7 +196,3 @@
return 1
else
return 0
// Used below, simple injection modifier.
/proc/probinj(var/pr, var/inj)
return prob(pr+inj*pr)
+84 -84
View File
@@ -107,7 +107,7 @@
return 0
/obj/machinery/dna_scannernew/relaymove(mob/user as mob)
if (user.stat)
if(user.stat)
return
src.go_out()
return
@@ -117,7 +117,7 @@
set category = null
set name = "Eject DNA Scanner"
if (usr.stat != 0)
if(usr.stat != 0)
return
eject_occupant()
@@ -142,17 +142,17 @@
set category = null
set name = "Enter DNA Scanner"
if (usr.stat != 0)
if(usr.stat != 0)
return
if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other
return
if (!ishuman(usr)) //Make sure they're a mob that has dna
if(!ishuman(usr)) //Make sure they're a mob that has dna
to_chat(usr, "<span class='notice'>Try as you might, you can not climb up into the [src].</span>")
return
if (src.occupant)
if(src.occupant)
to_chat(usr, "<span class='boldnotice'>The [src] is already occupied!</span>")
return
if (usr.abiotic())
if(usr.abiotic())
to_chat(usr, "<span class='boldnotice'>Subject cannot have abiotic items on.</span>")
return
usr.stop_pulling()
@@ -196,7 +196,7 @@
if(M.Victim == L)
to_chat(usr, "[L.name] will not fit into the [src] because they have a slime latched onto their head.")
return
if (L == user)
if(L == user)
visible_message("[user] climbs into the [src].")
else
visible_message("[user] puts [L.name] into the [src].")
@@ -233,15 +233,15 @@
item.forceMove(src)
user.visible_message("[user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!")
return
else if (!istype(item, /obj/item/weapon/grab))
else if(!istype(item, /obj/item/weapon/grab))
return
var/obj/item/weapon/grab/G = item
if (!ismob(G.affecting))
if(!ismob(G.affecting))
return
if (src.occupant)
if(src.occupant)
to_chat(user, "<span class='boldnotice'>The scanner is already occupied!</span>")
return
if (G.affecting.abiotic())
if(G.affecting.abiotic())
to_chat(user, "<span class='boldnotice'>Subject cannot have abiotic items on.</span>")
return
if(panel_open)
@@ -275,15 +275,15 @@
return
/obj/machinery/dna_scannernew/proc/go_out()
if (!src.occupant)
if(!src.occupant)
to_chat(usr, "<span class='warning'>The scanner is empty!</span>")
return
if (src.locked)
if(src.locked)
to_chat(usr, "<span class='warning'>The scanner is locked!</span>")
return
if (src.occupant.client)
if(src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.forceMove(src.loc)
@@ -302,7 +302,7 @@
qdel(src)
return
if(2.0)
if (prob(50))
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
ex_act(severity)
@@ -311,7 +311,7 @@
qdel(src)
return
if(3.0)
if (prob(25))
if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
ex_act(severity)
@@ -339,7 +339,7 @@
return 1
var/radiation_protection = occupant.run_armor_check(null, "rad", "Your clothes feel warm.", "Your clothes feel warm.")
if (radiation_protection > NEGATE_MUTATION_THRESHOLD)
if(radiation_protection > NEGATE_MUTATION_THRESHOLD)
return 1
return 0
@@ -373,8 +373,8 @@
var/waiting_for_user_input=0 // Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X
/obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob, params)
if (istype(I, /obj/item/weapon/disk/data)) //INSERT SOME diskS
if (!src.disk)
if(istype(I, /obj/item/weapon/disk/data)) //INSERT SOME diskS
if(!src.disk)
user.drop_item()
I.forceMove(src)
src.disk = I
@@ -392,7 +392,7 @@
qdel(src)
return
if(2.0)
if (prob(50))
if(prob(50))
//SN src = null
qdel(src)
return
@@ -436,7 +436,7 @@
/obj/machinery/computer/scan_consolenew/process() //not really used right now
if(stat & (NOPOWER|BROKEN))
return
if (!( src.status )) //remove this
if(!( src.status )) //remove this
return
return
*/
@@ -487,7 +487,7 @@
data["hasDisk"] = disk ? 1 : 0
var/diskData[0]
if (!disk || !disk.buf)
if(!disk || !disk.buf)
diskData["data"] = null
diskData["owner"] = null
diskData["label"] = null
@@ -515,7 +515,7 @@
data["selectedUITargetHex"] = selected_ui_target_hex
var/occupantData[0]
if (!src.connected.occupant || !src.connected.occupant.dna)
if(!src.connected.occupant || !src.connected.occupant.dna)
occupantData["name"] = null
occupantData["stat"] = null
occupantData["isViableSubject"] = null
@@ -530,7 +530,7 @@
occupantData["name"] = connected.occupant.dna.real_name
occupantData["stat"] = connected.occupant.stat
occupantData["isViableSubject"] = 1
if ((NOCLONE in connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
if((NOCLONE in connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
occupantData["isViableSubject"] = 0
occupantData["health"] = connected.occupant.health
occupantData["maxHealth"] = connected.occupant.maxHealth
@@ -546,13 +546,13 @@
data["beakerVolume"] = 0
if(connected.beaker)
data["beakerLabel"] = connected.beaker.label_text ? connected.beaker.label_text : null
if (connected.beaker.reagents && connected.beaker.reagents.reagent_list.len)
if(connected.beaker.reagents && connected.beaker.reagents.reagent_list.len)
for(var/datum/reagent/R in connected.beaker.reagents.reagent_list)
data["beakerVolume"] += R.volume
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700)
@@ -575,16 +575,16 @@
add_fingerprint(usr)
if (href_list["selectMenuKey"])
if(href_list["selectMenuKey"])
selected_menu_key = href_list["selectMenuKey"]
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["toggleLock"])
if ((src.connected && src.connected.occupant))
if(href_list["toggleLock"])
if((src.connected && src.connected.occupant))
src.connected.locked = !( src.connected.locked )
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["pulseRadiation"])
if(href_list["pulseRadiation"])
irradiating = src.radiation_duration
var/lock_state = src.connected.locked
src.connected.locked = 1//lock it
@@ -595,7 +595,7 @@
irradiating = 0
src.connected.locked = lock_state
if (!src.connected.occupant)
if(!src.connected.occupant)
return 1 // return 1 forces an update to all Nano uis attached to src
var/radiation = (((src.radiation_intensity*3)+src.radiation_duration*3) / connected.damage_coeff)
@@ -603,7 +603,7 @@
if(src.connected.radiation_check())
return 1
if (prob(95))
if(prob(95))
if(prob(75))
randmutb(src.connected.occupant)
else
@@ -616,28 +616,28 @@
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["radiationDuration"])
if (text2num(href_list["radiationDuration"]) > 0)
if (src.radiation_duration < 20)
if(href_list["radiationDuration"])
if(text2num(href_list["radiationDuration"]) > 0)
if(src.radiation_duration < 20)
src.radiation_duration += 2
else
if (src.radiation_duration > 2)
if(src.radiation_duration > 2)
src.radiation_duration -= 2
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["radiationIntensity"])
if (text2num(href_list["radiationIntensity"]) > 0)
if (src.radiation_intensity < 10)
if(href_list["radiationIntensity"])
if(text2num(href_list["radiationIntensity"]) > 0)
if(src.radiation_intensity < 10)
src.radiation_intensity++
else
if (src.radiation_intensity > 1)
if(src.radiation_intensity > 1)
src.radiation_intensity--
return 1 // return 1 forces an update to all Nano uis attached to src
////////////////////////////////////////////////////////
if (href_list["changeUITarget"] && text2num(href_list["changeUITarget"]) > 0)
if (src.selected_ui_target < 15)
if(href_list["changeUITarget"] && text2num(href_list["changeUITarget"]) > 0)
if(src.selected_ui_target < 15)
src.selected_ui_target++
src.selected_ui_target_hex = src.selected_ui_target
switch(selected_ui_target)
@@ -658,8 +658,8 @@
src.selected_ui_target_hex = 0
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["changeUITarget"] && text2num(href_list["changeUITarget"]) < 1)
if (src.selected_ui_target > 0)
if(href_list["changeUITarget"] && text2num(href_list["changeUITarget"]) < 1)
if(src.selected_ui_target > 0)
src.selected_ui_target--
src.selected_ui_target_hex = src.selected_ui_target
switch(selected_ui_target)
@@ -678,16 +678,16 @@
src.selected_ui_target_hex = "F"
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["selectUIBlock"] && href_list["selectUISubblock"]) // This chunk of code updates selected block / sub-block based on click
if(href_list["selectUIBlock"] && href_list["selectUISubblock"]) // This chunk of code updates selected block / sub-block based on click
var/select_block = text2num(href_list["selectUIBlock"])
var/select_subblock = text2num(href_list["selectUISubblock"])
if ((select_block <= DNA_UI_LENGTH) && (select_block >= 1))
if((select_block <= DNA_UI_LENGTH) && (select_block >= 1))
src.selected_ui_block = select_block
if ((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1))
if((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1))
src.selected_ui_subblock = select_subblock
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["pulseUIRadiation"])
if(href_list["pulseUIRadiation"])
var/block = src.connected.occupant.dna.GetUISubBlock(src.selected_ui_block,src.selected_ui_subblock)
irradiating = src.radiation_duration
@@ -700,10 +700,10 @@
irradiating = 0
src.connected.locked = lock_state
if (!src.connected.occupant)
if(!src.connected.occupant)
return 1
if (prob((80 + (src.radiation_duration / 2))))
if(prob((80 + (src.radiation_duration / 2))))
var/radiation = (src.radiation_intensity+src.radiation_duration)
src.connected.occupant.apply_effect(radiation,IRRADIATE,0)
@@ -719,7 +719,7 @@
if(src.connected.radiation_check())
return 1
if (prob(20+src.radiation_intensity))
if(prob(20+src.radiation_intensity))
randmutb(src.connected.occupant)
domutcheck(src.connected.occupant,src.connected)
else
@@ -729,13 +729,13 @@
////////////////////////////////////////////////////////
if (href_list["injectRejuvenators"])
if (!connected.occupant)
if(href_list["injectRejuvenators"])
if(!connected.occupant)
return 0
var/inject_amount = round(text2num(href_list["injectRejuvenators"]), 5) // round to nearest 5
if (inject_amount < 0) // Since the user can actually type the commands himself, some sanity checking
if(inject_amount < 0) // Since the user can actually type the commands himself, some sanity checking
inject_amount = 0
if (inject_amount > 50)
if(inject_amount > 50)
inject_amount = 50
connected.beaker.reagents.trans_to(connected.occupant, inject_amount)
connected.beaker.reagents.reaction(connected.occupant)
@@ -743,17 +743,17 @@
////////////////////////////////////////////////////////
if (href_list["selectSEBlock"] && href_list["selectSESubblock"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
if(href_list["selectSEBlock"] && href_list["selectSESubblock"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
var/select_block = text2num(href_list["selectSEBlock"])
var/select_subblock = text2num(href_list["selectSESubblock"])
if ((select_block <= DNA_SE_LENGTH) && (select_block >= 1))
if((select_block <= DNA_SE_LENGTH) && (select_block >= 1))
src.selected_se_block = select_block
if ((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1))
if((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1))
src.selected_se_subblock = select_subblock
//testing("User selected block [selected_se_block] (sent [select_block]), subblock [selected_se_subblock] (sent [select_block]).")
return 1 // return 1 forces an update to all Nano uis attached to src
if (href_list["pulseSERadiation"])
if(href_list["pulseSERadiation"])
var/block = src.connected.occupant.dna.GetSESubBlock(src.selected_se_block,src.selected_se_subblock)
//var/original_block=block
//testing("Irradiating SE block [src.selected_se_block]:[src.selected_se_subblock] ([block])...")
@@ -769,7 +769,7 @@
src.connected.locked = lock_state
if(src.connected.occupant)
if (prob((80 + ((src.radiation_duration / 2) + (connected.precision_coeff ** 3)))))
if(prob((80 + ((src.radiation_duration / 2) + (connected.precision_coeff ** 3)))))
var/radiation = ((src.radiation_intensity+src.radiation_duration) / connected.damage_coeff)
src.connected.occupant.apply_effect(radiation,IRRADIATE,0)
@@ -779,9 +779,9 @@
var/real_SE_block=selected_se_block
block = miniscramble(block, src.radiation_intensity, src.radiation_duration)
if(prob(20))
if (src.selected_se_block > 1 && src.selected_se_block < DNA_SE_LENGTH/2)
if(src.selected_se_block > 1 && src.selected_se_block < DNA_SE_LENGTH/2)
real_SE_block++
else if (src.selected_se_block > DNA_SE_LENGTH/2 && src.selected_se_block < DNA_SE_LENGTH)
else if(src.selected_se_block > DNA_SE_LENGTH/2 && src.selected_se_block < DNA_SE_LENGTH)
real_SE_block--
//testing("Irradiated SE block [real_SE_block]:[src.selected_se_subblock] ([original_block] now [block]) [(real_SE_block!=selected_se_block) ? "(SHIFTED)":""]!")
@@ -794,7 +794,7 @@
if(src.connected.radiation_check())
return 1
if (prob(80-src.radiation_duration))
if(prob(80-src.radiation_duration))
//testing("Random bad mut!")
randmutb(src.connected.occupant)
domutcheck(src.connected.occupant,src.connected)
@@ -820,8 +820,8 @@
var/bufferOption = href_list["bufferOption"]
// These bufferOptions do not require a bufferId
if (bufferOption == "wipeDisk")
if ((isnull(src.disk)) || (src.disk.read_only))
if(bufferOption == "wipeDisk")
if((isnull(src.disk)) || (src.disk.read_only))
//src.temphtml = "Invalid disk. Please try again."
return 0
@@ -829,23 +829,23 @@
//src.temphtml = "Data saved."
return 1
if (bufferOption == "ejectDisk")
if (!src.disk)
if(bufferOption == "ejectDisk")
if(!src.disk)
return
src.disk.forceMove(get_turf(src))
src.disk = null
return 1
// All bufferOptions from here on require a bufferId
if (!href_list["bufferId"])
if(!href_list["bufferId"])
return 0
var/bufferId = text2num(href_list["bufferId"])
if (bufferId < 1 || bufferId > 3)
if(bufferId < 1 || bufferId > 3)
return 0 // Not a valid buffer id
if (bufferOption == "saveUI")
if(bufferOption == "saveUI")
if(src.connected.occupant && src.connected.occupant.dna)
var/datum/dna2/record/databuf=new
databuf.types = DNA2_BUF_UI // DNA2_BUF_UE
@@ -856,7 +856,7 @@
src.buffers[bufferId] = databuf
return 1
if (bufferOption == "saveUIAndUE")
if(bufferOption == "saveUIAndUE")
if(src.connected.occupant && src.connected.occupant.dna)
var/datum/dna2/record/databuf=new
databuf.types = DNA2_BUF_UI|DNA2_BUF_UE
@@ -867,7 +867,7 @@
src.buffers[bufferId] = databuf
return 1
if (bufferOption == "saveSE")
if(bufferOption == "saveSE")
if(src.connected.occupant && src.connected.occupant.dna)
var/datum/dna2/record/databuf=new
databuf.types = DNA2_BUF_SE
@@ -878,19 +878,19 @@
src.buffers[bufferId] = databuf
return 1
if (bufferOption == "clear")
if(bufferOption == "clear")
src.buffers[bufferId]=new /datum/dna2/record()
return 1
if (bufferOption == "changeLabel")
if(bufferOption == "changeLabel")
var/datum/dna2/record/buf = src.buffers[bufferId]
var/text = sanitize(input(usr, "New Label:", "Edit Label", buf.name) as text|null)
buf.name = text
src.buffers[bufferId] = buf
return 1
if (bufferOption == "transfer")
if (!src.connected.occupant || (NOCLONE in src.connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
if(bufferOption == "transfer")
if(!src.connected.occupant || (NOCLONE in src.connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
return 1
irradiating = 2
@@ -911,18 +911,18 @@
var/datum/dna2/record/buf = src.buffers[bufferId]
if ((buf.types & DNA2_BUF_UI))
if ((buf.types & DNA2_BUF_UE))
if((buf.types & DNA2_BUF_UI))
if((buf.types & DNA2_BUF_UE))
src.connected.occupant.real_name = buf.dna.real_name
src.connected.occupant.name = buf.dna.real_name
src.connected.occupant.UpdateAppearance(buf.dna.UI.Copy())
else if (buf.types & DNA2_BUF_SE)
else if(buf.types & DNA2_BUF_SE)
src.connected.occupant.dna.SE = buf.dna.SE.Copy()
src.connected.occupant.dna.UpdateSE()
domutcheck(src.connected.occupant,src.connected)
return 1
if (bufferOption == "createInjector")
if(bufferOption == "createInjector")
if(injector_ready && !waiting_for_user_input)
var/success = 1
@@ -951,8 +951,8 @@
src.injector_ready = 1
return 1
if (bufferOption == "loadDisk")
if ((isnull(src.disk)) || (!src.disk.buf))
if(bufferOption == "loadDisk")
if((isnull(src.disk)) || (!src.disk.buf))
//src.temphtml = "Invalid disk. Please try again."
return 0
@@ -960,8 +960,8 @@
//src.temphtml = "Data loaded."
return 1
if (bufferOption == "saveDisk")
if ((isnull(src.disk)) || (src.disk.read_only))
if(bufferOption == "saveDisk")
if((isnull(src.disk)) || (src.disk.read_only))
//src.temphtml = "Invalid disk. Please try again."
return 0
+40 -30
View File
@@ -28,6 +28,7 @@
return 1 // Always set!
/datum/dna/gene/disability/activate(var/mob/M, var/connected, var/flags)
..()
if(mutation && !(mutation in M.mutations))
M.mutations.Add(mutation)
if(disability)
@@ -35,11 +36,12 @@
if(sdisability)
M.sdisabilities|=sdisability
if(activation_message)
to_chat(M, "\red [activation_message]")
to_chat(M, "<span class='warning'>[activation_message]</span>")
else
testing("[name] has no activation message.")
/datum/dna/gene/disability/deactivate(var/mob/M, var/connected, var/flags)
..()
if(mutation && (mutation in M.mutations))
M.mutations.Remove(mutation)
if(disability)
@@ -47,7 +49,7 @@
if(sdisability)
M.sdisabilities &= ~sdisability
if(deactivation_message)
to_chat(M, "\red [deactivation_message]")
to_chat(M, "<span class='warning'>[deactivation_message]</span>")
else
testing("[name] has no deactivation message.")
@@ -55,46 +57,51 @@
name="Hallucinate"
activation_message="Your mind says 'Hello'."
deactivation_message ="Sanity returns. Or does it?"
instability = -GENE_INSTABILITY_MODERATE
mutation=HALLUCINATE
New()
block=HALLUCINATIONBLOCK
/datum/dna/gene/disability/hallucinate/New()
block=HALLUCINATIONBLOCK
/datum/dna/gene/disability/epilepsy
name="Epilepsy"
activation_message="You get a headache."
deactivation_message ="Your headache is gone, at last."
instability = -GENE_INSTABILITY_MODERATE
disability=EPILEPSY
New()
block=EPILEPSYBLOCK
/datum/dna/gene/disability/epilepsy/New()
block=EPILEPSYBLOCK
/datum/dna/gene/disability/cough
name="Coughing"
activation_message="You start coughing."
deactivation_message ="Your throat stops aching."
instability = -GENE_INSTABILITY_MINOR
disability=COUGHING
New()
block=COUGHBLOCK
/datum/dna/gene/disability/cough/New()
block=COUGHBLOCK
/datum/dna/gene/disability/clumsy
name="Clumsiness"
activation_message="You feel lightheaded."
deactivation_message ="You regain some control of your movements"
instability = -GENE_INSTABILITY_MINOR
mutation=CLUMSY
New()
block=CLUMSYBLOCK
/datum/dna/gene/disability/clumsy/New()
block=CLUMSYBLOCK
/datum/dna/gene/disability/tourettes
name="Tourettes"
activation_message="You twitch."
deactivation_message ="Your mouth tastes like soap."
instability = -GENE_INSTABILITY_MODERATE
disability=TOURETTES
New()
block=TWITCHBLOCK
/datum/dna/gene/disability/tourettes/New()
block=TWITCHBLOCK
/datum/dna/gene/disability/nervousness
name="Nervousness"
@@ -102,39 +109,42 @@
deactivation_message ="You feel much calmer."
disability=NERVOUS
New()
block=NERVOUSBLOCK
/datum/dna/gene/disability/nervousness/New()
block=NERVOUSBLOCK
/datum/dna/gene/disability/blindness
name="Blindness"
activation_message="You can't seem to see anything."
deactivation_message ="You can see now, in case you didn't notice..."
instability = -GENE_INSTABILITY_MAJOR
sdisability=BLIND
New()
block=BLINDBLOCK
/datum/dna/gene/disability/blindness/New()
block=BLINDBLOCK
/datum/dna/gene/disability/deaf
name="Deafness"
activation_message="It's kinda quiet."
deactivation_message ="You can hear again!"
instability = -GENE_INSTABILITY_MAJOR
sdisability=DEAF
New()
block=DEAFBLOCK
/datum/dna/gene/disability/deaf/New()
block=DEAFBLOCK
activate(var/mob/M, var/connected, var/flags)
..(M,connected,flags)
M.ear_deaf = 1
/datum/dna/gene/disability/deaf/activate(var/mob/M, var/connected, var/flags)
..(M,connected,flags)
M.ear_deaf = 1
/datum/dna/gene/disability/nearsighted
name="Nearsightedness"
activation_message="Your eyes feel weird..."
deactivation_message ="You can see clearly now"
instability = -GENE_INSTABILITY_MODERATE
disability=NEARSIGHTED
New()
block=GLASSESBLOCK
/datum/dna/gene/disability/nearsighted/New()
block=GLASSESBLOCK
/datum/dna/gene/disability/lisp
@@ -144,12 +154,12 @@
deactivation_message = "You now feel able to pronounce consonants."
mutation = LISP
New()
..()
block=LISPBLOCK
/datum/dna/gene/disability/lisp/New()
..()
block=LISPBLOCK
OnSay(var/mob/M, var/message)
return replacetext(message,"s","th")
/datum/dna/gene/disability/lisp/OnSay(var/mob/M, var/message)
return replacetext(message,"s","th")
/datum/dna/gene/disability/comic
name = "Comic"
@@ -158,5 +168,5 @@
deactivation_message = "Well thank god that's over with."
mutation=COMIC
New()
block = COMICBLOCK
/datum/dna/gene/disability/comic/New()
block = COMICBLOCK
+13 -6
View File
@@ -23,7 +23,10 @@
// Any of a number of GENE_ flags.
var/flags=0
/**
// Chance of the gene to cause adverse effects when active
var/instability=0
/*
* Is the gene active in this mob's DNA?
*/
/datum/dna/gene/proc/is_active(var/mob/M)
@@ -35,14 +38,16 @@
return 0
// Called when the gene activates. Do your magic here.
/datum/dna/gene/proc/activate(var/mob/M, var/connected, var/flags)
/datum/dna/gene/proc/activate(var/mob/living/M, var/connected, var/flags)
M.gene_stability -= instability
return
/**
* Called when the gene deactivates. Undo your magic here.
* Only called when the block is deactivated.
*/
/datum/dna/gene/proc/deactivate(var/mob/M, var/connected, var/flags)
/datum/dna/gene/proc/deactivate(var/mob/living/M, var/connected, var/flags)
M.gene_stability += instability
return
// This section inspired by goone's bioEffects.
@@ -107,16 +112,18 @@
if(flags & MUTCHK_FORCED)
return 1
// Probability check
return probinj(activation_prob,(flags&MUTCHK_FORCED))
return prob(activation_prob)
/datum/dna/gene/basic/activate(var/mob/M)
..()
M.mutations.Add(mutation)
if(activation_messages.len)
var/msg = pick(activation_messages)
to_chat(M, "\blue [msg]")
to_chat(M, "<span class='notice'>[msg]</span>")
/datum/dna/gene/basic/deactivate(var/mob/M)
..()
M.mutations.Remove(mutation)
if(deactivation_messages.len)
var/msg = pick(deactivation_messages)
to_chat(M, "\red [msg]")
to_chat(M, "<span class='warning'>[msg]</span>")

Some files were not shown because too many files have changed in this diff Show More