
Safe Codes
"
/obj/item/paper/safe_code/Initialize(mapload)
+ ..()
return INITIALIZE_HINT_LATELOAD
/obj/item/paper/safe_code/LateInitialize(mapload)
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 5acd4f7d8a3..bdab5ca2466 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -128,7 +128,7 @@
/obj/structure/table/CanAStarPass(ID, dir, caller)
. = !density
- if(ismovableatom(caller))
+ if(ismovable(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSTABLE)
@@ -224,8 +224,8 @@
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
return
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
- I.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
- I.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
+ I.pixel_x = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
+ I.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
item_placed(I)
else
return ..()
@@ -666,7 +666,7 @@
/obj/structure/rack/CanAStarPass(ID, dir, caller)
. = !density
- if(ismovableatom(caller))
+ if(ismovable(caller))
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSTABLE)
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 2d886f44bfd..55b4f336917 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -27,7 +27,6 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama
var/burnt = 0
var/current_overlay = null
var/floor_tile = null //tile that this floor drops
- var/obj/item/stack/tile/builtin_tile = null //needed for performance reasons when the singularity rips off floor tiles
var/list/broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
var/list/burnt_states = list("floorscorched1", "floorscorched2")
var/list/prying_tool_list = list(TOOL_CROWBAR) //What tool/s can we use to pry up the tile?
@@ -38,13 +37,6 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama
icon_regular_floor = "floor"
else
icon_regular_floor = icon_state
- if(floor_tile)
- builtin_tile = new floor_tile
-
-/turf/simulated/floor/Destroy()
- QDEL_NULL(builtin_tile)
- return ..()
-
//turf/simulated/floor/CanPass(atom/movable/mover, turf/target, height=0)
// if((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
@@ -209,30 +201,26 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama
else
if(user && !silent)
to_chat(user, "
You remove the floor tile.")
- if(builtin_tile && make_tile)
- builtin_tile.forceMove(src)
- builtin_tile = null
+ if(floor_tile && make_tile)
+ new floor_tile(src)
return make_plating()
/turf/simulated/floor/singularity_pull(S, current_size)
..()
if(current_size == STAGE_THREE)
if(prob(30))
- if(builtin_tile)
- builtin_tile.loc = src
- builtin_tile = null
+ if(floor_tile)
+ new floor_tile(src)
make_plating()
else if(current_size == STAGE_FOUR)
if(prob(50))
- if(builtin_tile)
- builtin_tile.loc = src
- builtin_tile = null
+ if(floor_tile)
+ new floor_tile(src)
make_plating()
else if(current_size >= STAGE_FIVE)
- if(builtin_tile)
+ if(floor_tile)
if(prob(70))
- builtin_tile.loc = src
- builtin_tile = null
+ new floor_tile(src)
make_plating()
else if(prob(50))
ReplaceWithLattice()
diff --git a/code/game/turfs/simulated/floor/asteroid.dm b/code/game/turfs/simulated/floor/asteroid.dm
index 6d5d95dff0e..6118885a921 100644
--- a/code/game/turfs/simulated/floor/asteroid.dm
+++ b/code/game/turfs/simulated/floor/asteroid.dm
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me
break
var/list/L = list(45)
- if(IsOdd(dir2angle(dir))) // We're going at an angle and we want thick angled tunnels.
+ if(ISODD(dir2angle(dir))) // We're going at an angle and we want thick angled tunnels.
L += -45
// Expand the edges of our tunnel
diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm
index 3ab424e69cc..f8dc414ef85 100644
--- a/code/game/turfs/simulated/floor/fancy_floor.dm
+++ b/code/game/turfs/simulated/floor/fancy_floor.dm
@@ -31,9 +31,8 @@
if(make_tile)
if(user && !silent)
to_chat(user, "
You unscrew the planks.")
- if(builtin_tile)
- builtin_tile.forceMove(src)
- builtin_tile = null
+ if(floor_tile)
+ new floor_tile(src)
else
if(user && !silent)
to_chat(user, "
You forcefully pry off the planks, destroying them in the process.")
diff --git a/code/game/turfs/simulated/floor/lava.dm b/code/game/turfs/simulated/floor/lava.dm
index aa1be2200fa..b32580b9bab 100644
--- a/code/game/turfs/simulated/floor/lava.dm
+++ b/code/game/turfs/simulated/floor/lava.dm
@@ -80,8 +80,8 @@
O.resistance_flags |= FLAMMABLE //Even fireproof things burn up in lava
if(O.resistance_flags & FIRE_PROOF)
O.resistance_flags &= ~FIRE_PROOF
- if(O.armor["fire"] > 50) //obj with 100% fire armor still get slowly burned away.
- O.armor["fire"] = 50
+ if(O.armor.getRating("fire") > 50) //obj with 100% fire armor still get slowly burned away.
+ O.armor = O.armor.setRating(fire_value = 50)
O.fire_act(10000, 1000)
else if(isliving(thing))
diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm
index 332cf745a4c..2c24a422343 100644
--- a/code/game/turfs/simulated/floor/light_floor.dm
+++ b/code/game/turfs/simulated/floor/light_floor.dm
@@ -77,14 +77,13 @@
/turf/simulated/floor/light/attackby(obj/item/C, mob/user, params)
if(istype(C,/obj/item/light/bulb)) //only for light tiles
- if(istype(builtin_tile, /obj/item/stack/tile/light))
- if(!state)
- qdel(C)
- state = LIGHTFLOOR_ON
- update_icon()
- to_chat(user, "
You replace the light bulb.")
- else
- to_chat(user, "
The light bulb seems fine, no need to replace it.")
+ if(!state)
+ qdel(C)
+ state = LIGHTFLOOR_ON
+ update_icon()
+ to_chat(user, "
You replace the light bulb.")
+ else
+ to_chat(user, "
The light bulb seems fine, no need to replace it.")
else
return ..()
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index c18acf19d0a..23d0c9789bd 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -34,7 +34,6 @@
var/sheet_type = /obj/item/stack/sheet/metal
var/sheet_amount = 2
var/girder_type = /obj/structure/girder
- var/obj/item/stack/sheet/builtin_sheet = null
canSmoothWith = list(
/turf/simulated/wall,
@@ -46,10 +45,6 @@
/turf/simulated/wall/r_wall/coated)
smooth = SMOOTH_TRUE
-/turf/simulated/wall/New()
- ..()
- builtin_sheet = new sheet_type
-
/turf/simulated/wall/BeforeChange()
for(var/obj/effect/overlay/wall_rot/WR in src)
qdel(WR)
diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm
index d2d7f8386ee..f34465fd60f 100644
--- a/code/game/turfs/simulated/walls_misc.dm
+++ b/code/game/turfs/simulated/walls_misc.dm
@@ -3,7 +3,6 @@
desc = "A cold metal wall engraved with indecipherable symbols. Studying them causes your head to pound."
icon = 'icons/turf/walls/cult_wall.dmi'
icon_state = "cult"
- builtin_sheet = null
canSmoothWith = null
smooth = SMOOTH_FALSE
sheet_type = /obj/item/stack/sheet/runed_metal
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index b4f71a38c2c..d1541dcc4fa 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -3,7 +3,7 @@
level = 1
luminosity = 1
- var/intact = 1
+ var/intact = TRUE
var/turf/baseturf = /turf/space
var/slowdown = 0 //negative for faster, positive for slower
@@ -33,7 +33,7 @@
var/list/blueprint_data //for the station blueprints, images of objects eg: pipes
- var/list/footstep_sounds = list()
+ var/list/footstep_sounds
var/shoe_running_volume = 50
var/shoe_walking_volume = 20
@@ -68,7 +68,7 @@
if(AA.smooth)
queue_smooth(AA)
log_startup_progress(" Smoothed atoms in [stop_watch(watch)]s.")
- return 1
+ return TRUE
/turf/Destroy()
// Adds the adjacent turfs to the current atmos processing
@@ -85,7 +85,7 @@
user.Move_Pulled(src)
/turf/ex_act(severity)
- return 0
+ return FALSE
/turf/rpd_act(mob/user, obj/item/rpd/our_rpd) //This is the default turf behaviour for the RPD; override it as required
if(our_rpd.mode == RPD_ATMOS_MODE)
@@ -103,55 +103,53 @@
else if(our_rpd.mode == RPD_DELETE_MODE)
our_rpd.delete_all_pipes(user, src)
-/turf/bullet_act(var/obj/item/projectile/Proj)
- if(istype(Proj ,/obj/item/projectile/beam/pulse))
+/turf/bullet_act(obj/item/projectile/Proj)
+ if(istype(Proj, /obj/item/projectile/beam/pulse))
src.ex_act(2)
..()
- return 0
+ return FALSE
-/turf/bullet_act(var/obj/item/projectile/Proj)
- if(istype(Proj ,/obj/item/projectile/bullet/gyro))
+/turf/bullet_act(obj/item/projectile/Proj)
+ if(istype(Proj, /obj/item/projectile/bullet/gyro))
explosion(src, -1, 0, 2)
..()
- return 0
+ return FALSE
-/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
+/turf/Enter(atom/movable/mover as mob|obj, atom/forget)
if(!mover)
- return 1
-
+ return TRUE
// First, make sure it can leave its square
if(isturf(mover.loc))
// Nothing but border objects stop you from leaving a tile, only one loop is needed
for(var/obj/obstacle in mover.loc)
if(!obstacle.CheckExit(mover, src) && obstacle != mover && obstacle != forget)
- mover.Bump(obstacle, 1)
- return 0
+ mover.Bump(obstacle, TRUE)
+ return FALSE
var/list/large_dense = list()
//Next, check objects to block entry that are on the border
for(var/atom/movable/border_obstacle in src)
- if(border_obstacle.flags&ON_BORDER)
- if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle))
- mover.Bump(border_obstacle, 1)
- return 0
+ if(border_obstacle.flags & ON_BORDER)
+ if(!border_obstacle.CanPass(mover, mover.loc, 1) && (forget != border_obstacle))
+ mover.Bump(border_obstacle, TRUE)
+ return FALSE
else
large_dense += border_obstacle
//Then, check the turf itself
if(!src.CanPass(mover, src))
- mover.Bump(src, 1)
- return 0
+ mover.Bump(src, TRUE)
+ return FALSE
//Finally, check objects/mobs to block entry that are not on the border
for(var/atom/movable/obstacle in large_dense)
- if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle))
- mover.Bump(obstacle, 1)
- return 0
- return 1 //Nothing found to block so return success!
+ if(!obstacle.CanPass(mover, mover.loc, 1) && (forget != obstacle))
+ mover.Bump(obstacle, TRUE)
+ return FALSE
+ return TRUE //Nothing found to block so return success!
-
-/turf/Entered(atom/movable/M, atom/OL, ignoreRest = 0)
+/turf/Entered(atom/movable/M, atom/OL, ignoreRest = FALSE)
..()
if(ismob(M))
var/mob/O = M
@@ -164,7 +162,7 @@
if(loopsanity == 0)
break
loopsanity--
- A.HasProximity(M, 1)
+ A.HasProximity(M)
// If an opaque movable atom moves around we need to potentially update visibility.
if(M.opacity)
@@ -180,7 +178,7 @@
/turf/space/levelupdate()
for(var/obj/O in src)
if(O.level == 1)
- O.hide(0)
+ O.hide(FALSE)
// Removes all signs of lattice on the pos of the turf -Donkieyo
/turf/proc/RemoveLattice()
@@ -250,7 +248,7 @@
return
// I'm including `ignore_air` because BYOND lacks positional-only arguments
-/turf/proc/AfterChange(ignore_air, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf()
+/turf/proc/AfterChange(ignore_air = FALSE, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf()
levelupdate()
CalculateAdjacentTurfs()
@@ -261,7 +259,7 @@
for(var/obj/structure/cable/C in contents)
qdel(C)
-/turf/simulated/AfterChange(ignore_air, keep_cabling = FALSE)
+/turf/simulated/AfterChange(ignore_air = FALSE, keep_cabling = FALSE)
..()
RemoveLattice()
if(!ignore_air)
@@ -280,7 +278,7 @@
var/turf_count = 0
for(var/direction in GLOB.cardinal)//Only use cardinals to cut down on lag
- var/turf/T = get_step(src,direction)
+ var/turf/T = get_step(src, direction)
if(istype(T, /turf/space))//Counted as no air
turf_count++//Considered a valid turf for air calcs
continue
@@ -315,12 +313,11 @@
/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
//Useful to batch-add creatures to the list.
for(var/mob/living/M in src)
- if(M==U) continue//Will not harm U. Since null != M, can be excluded to kill everyone.
- spawn(0)
- M.gib()
+ if(M == U)
+ continue//Will not harm U. Since null != M, can be excluded to kill everyone.
+ INVOKE_ASYNC(M, /mob/.proc/gib)
for(var/obj/mecha/M in src)//Mecha are not gibbed but are damaged.
- spawn(0)
- M.take_damage(100, "brute")
+ INVOKE_ASYNC(M, /obj/mecha/.proc/take_damage, 100, "brute")
/turf/proc/Bless()
flags |= NOJAUNT
@@ -377,11 +374,11 @@
// Returns the surrounding simulated turfs with open links
// Including through doors openable with the ID
-/turf/proc/AdjacentTurfsWithAccess(var/obj/item/card/id/ID = null,var/list/closed)//check access if one is passed
+/turf/proc/AdjacentTurfsWithAccess(obj/item/card/id/ID = null, list/closed)//check access if one is passed
var/list/L = new()
var/turf/simulated/T
- for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties
- T = get_step(src,dir)
+ for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties
+ T = get_step(src, dir)
if(T in closed) //turf already proceeded in A*
continue
if(istype(T) && !T.density)
@@ -390,11 +387,11 @@
return L
//Idem, but don't check for ID and goes through open doors
-/turf/proc/AdjacentTurfs(var/list/closed)
+/turf/proc/AdjacentTurfs(list/closed)
var/list/L = new()
var/turf/simulated/T
- for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties
- T = get_step(src,dir)
+ for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties
+ T = get_step(src, dir)
if(T in closed) //turf already proceeded by A*
continue
if(istype(T) && !T.density)
@@ -403,11 +400,11 @@
return L
// check for all turfs, including unsimulated ones
-/turf/proc/AdjacentTurfsSpace(var/obj/item/card/id/ID = null, var/list/closed)//check access if one is passed
+/turf/proc/AdjacentTurfsSpace(obj/item/card/id/ID = null, list/closed)//check access if one is passed
var/list/L = new()
var/turf/T
- for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties
- T = get_step(src,dir)
+ for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties
+ T = get_step(src, dir)
if(T in closed) //turf already proceeded by A*
continue
if(istype(T) && !T.density)
@@ -424,20 +421,21 @@
//////////////////////////////
//Distance associates with all directions movement
-/turf/proc/Distance(var/turf/T)
- return get_dist(src,T)
+/turf/proc/Distance(turf/T)
+ return get_dist(src, T)
// This Distance proc assumes that only cardinal movement is
// possible. It results in more efficient (CPU-wise) pathing
// for bots and anything else that only moves in cardinal dirs.
/turf/proc/Distance_cardinal(turf/T)
- if(!src || !T) return 0
+ if(!src || !T)
+ return 0
return abs(src.x - T.x) + abs(src.y - T.y)
////////////////////////////////////////////////////
/turf/acid_act(acidpwr, acid_volume)
- . = 1
+ . = TRUE
var/acid_type = /obj/effect/acid
if(acidpwr >= 200) //alien acid power
acid_type = /obj/effect/acid/alien
@@ -462,7 +460,7 @@
if(!forced)
return
if(has_gravity(src))
- playsound(src, "bodyfall", 50, 1)
+ playsound(src, "bodyfall", 50, TRUE)
/turf/singularity_act()
if(intact)
@@ -472,7 +470,7 @@
if(O.invisibility == INVISIBILITY_MAXIMUM)
O.singularity_act()
ChangeTurf(baseturf)
- return(2)
+ return 2
/turf/proc/visibilityChanged()
if(SSticker)
@@ -483,25 +481,25 @@
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = I
for(var/obj/structure/cable/LC in src)
- if(LC.d1 == 0 || LC.d2==0)
- LC.attackby(C,user)
+ if(LC.d1 == 0 || LC.d2 == 0)
+ LC.attackby(C, user)
return
C.place_turf(src, user)
- return 1
+ return TRUE
else if(istype(I, /obj/item/twohanded/rcl))
var/obj/item/twohanded/rcl/R = I
if(R.loaded)
for(var/obj/structure/cable/LC in src)
- if(LC.d1 == 0 || LC.d2==0)
+ if(LC.d1 == 0 || LC.d2 == 0)
LC.attackby(R, user)
return
R.loaded.place_turf(src, user)
R.is_empty(user)
- return 0
+ return FALSE
/turf/proc/can_have_cabling()
- return 1
+ return TRUE
/turf/proc/can_lay_cable()
return can_have_cabling() & !intact
@@ -537,7 +535,7 @@
if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING)
add_blueprints(AM)
-/turf/proc/empty(turf_type=/turf/space)
+/turf/proc/empty(turf_type = /turf/space)
// Remove all atoms except observers, landmarks, docking ports, and (un)`simulated` atoms (lighting overlays)
var/turf/T0 = src
for(var/X in T0.GetAllContents())
@@ -550,13 +548,13 @@
continue
if(istype(A, /obj/docking_port))
continue
- qdel(A, force=TRUE)
+ qdel(A, force = TRUE)
T0.ChangeTurf(turf_type)
SSair.remove_from_active(T0)
T0.CalculateAdjacentTurfs()
- SSair.add_to_active(T0,1)
+ SSair.add_to_active(T0, TRUE)
/turf/AllowDrop()
return TRUE
diff --git a/code/game/world.dm b/code/game/world.dm
index dd9711515f8..4b1ccc641cf 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -1,5 +1,3 @@
-#define RECOMMENDED_VERSION 510
-
GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG)
/world/New()
@@ -11,8 +9,11 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG)
enable_debugger() // Enable the extools debugger
log_world("World loaded at [time_stamp()]")
log_world("[GLOB.vars.len - GLOB.gvars_datum_in_built_vars.len] global variables")
+ #ifdef UNIT_TESTS
+ log_world("Unit Tests Are Enabled!")
+ #endif
- if(byond_version < RECOMMENDED_VERSION)
+ if(byond_version < MIN_COMPILER_VERSION || byond_build < MIN_COMPILER_BUILD)
log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND")
if(config && config.server_name != null && config.server_suffix && world.port > 0)
@@ -35,8 +36,9 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG)
Master.Initialize(10, FALSE)
-
-#undef RECOMMENDED_VERSION
+ #ifdef UNIT_TESTS
+ HandleTestRun()
+ #endif
return
@@ -315,6 +317,11 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday)
GLOB.dbcon.Disconnect() // DCs cleanly from the database
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
+ #ifdef UNIT_TESTS
+ FinishTestRun()
+ return
+ #endif
+
for(var/client/C in GLOB.clients)
if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
C << link("byond://[config.server]")
diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm
index 238c380f417..2db6e09b354 100644
--- a/code/modules/admin/sql_notes.dm
+++ b/code/modules/admin/sql_notes.dm
@@ -186,9 +186,13 @@
var/err = query_list_notes.ErrorMsg()
log_game("SQL ERROR obtaining ckey from notes table. Error : \[[err]\]\n")
return
+ to_chat(usr, "
Started regex note search for [search]. Please wait for results...")
+ message_admins("[usr] has started a note search with regex [search]. CPU usage may be higher.")
while(query_list_notes.NextRow())
index_ckey = query_list_notes.item[1]
output += "
[index_ckey]"
+ CHECK_TICK
+ message_admins("The note search started by [usr] has complete. CPU should return to normal.")
else
output += "
\[Add Note\]"
output += ruler
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
index e2da701cf4d..018b45422c5 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
@@ -430,7 +430,7 @@
else if(expression[start + 1] == "\[" && islist(v))
var/list/L = v
var/index = SDQL_expression(source, expression[start + 2])
- if(isnum(index) && (!IsInteger(index) || L.len < index))
+ if(isnum(index) && (!ISINTEGER(index) || L.len < index))
to_chat(world, "
Invalid list index: [index]")
return null
return L[index]
diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm
index 798c5176770..752d3232d23 100644
--- a/code/modules/alarm/alarm.dm
+++ b/code/modules/alarm/alarm.dm
@@ -50,7 +50,7 @@
sources_assoc[source] = AS
// Currently only non-0 durations can be altered (normal alarms VS EMP blasts)
if(AS.duration)
- duration = SecondsToTicks(duration)
+ duration = duration SECONDS
AS.duration = duration
AS.severity = severity
diff --git a/code/modules/arcade/mob_hunt/battle_computer.dm b/code/modules/arcade/mob_hunt/battle_computer.dm
index 94337a5cfac..cb144c99f01 100644
--- a/code/modules/arcade/mob_hunt/battle_computer.dm
+++ b/code/modules/arcade/mob_hunt/battle_computer.dm
@@ -80,7 +80,7 @@
/obj/machinery/computer/mob_battle_terminal/proc/eject_card(override = 0)
if(!override)
if(ready && SSmob_hunt.battle_turn != team)
- audible_message("You can't recall on your rival's turn!", null, 2)
+ atom_say("You can't recall on your rival's turn!")
return
card.mob_data = mob_info
mob_info = null
@@ -202,7 +202,7 @@
start_battle()
else if(option == 2)
ready = 0
- audible_message("[team] Player cancels their battle challenge.", null, 5)
+ atom_say("[team] Player cancels their battle challenge.")
updateUsrDialog()
@@ -246,7 +246,7 @@
var/message = "[mob_info.mob_name] attacks!"
if(mob_info.nickname)
message = "[mob_info.nickname] attacks!"
- audible_message(message, null, 5)
+ atom_say(message)
SSmob_hunt.launch_attack(team, mob_info.get_raw_damage(), mob_info.get_attack_type())
/obj/machinery/computer/mob_battle_terminal/proc/start_battle()
@@ -255,7 +255,7 @@
if(!card) //don't do anything if there isn't a card inserted
return
ready = 1
- audible_message("[team] Player is ready for battle! Waiting for rival...", null, 5)
+ atom_say("[team] Player is ready for battle! Waiting for rival...")
SSmob_hunt.start_check()
/obj/machinery/computer/mob_battle_terminal/proc/receive_attack(raw_damage, datum/mob_type/attack_type)
@@ -268,7 +268,7 @@
SSmob_hunt.end_turn()
/obj/machinery/computer/mob_battle_terminal/proc/surrender()
- audible_message("[team] Player surrenders the battle!", null, 5)
+ atom_say("[team] Player surrenders the battle!")
SSmob_hunt.end_battle(team, 1)
//////////////////////////////
diff --git a/code/modules/arcade/mob_hunt/mob_avatar.dm b/code/modules/arcade/mob_hunt/mob_avatar.dm
index 89eda41be7c..d1077bc81e1 100644
--- a/code/modules/arcade/mob_hunt/mob_avatar.dm
+++ b/code/modules/arcade/mob_hunt/mob_avatar.dm
@@ -55,7 +55,7 @@
var/datum/data/pda/app/mob_hunter_game/client = P.current_app
var/total_catch_mod = client.catch_mod + catch_mod //negative values decrease the chance of the mob running, positive values makes it more likely to flee
if(!client.connected) //must be connected to attempt captures
- P.audible_message("[bicon(P)] No server connection. Capture aborted.", null, 4)
+ P.atom_say("No server connection. Capture aborted.")
return
if(mob_info.is_trap) //traps work even if you ran into them before, which is why this is before the clients_encountered check
@@ -79,7 +79,7 @@
return
else //deal with the new hunter by either running away or getting caught
clients_encountered += client
- var/message = "[bicon(P)] "
+ var/message = null
var/effective_run_chance = mob_info.run_chance + total_catch_mod
if((effective_run_chance > 0) && prob(effective_run_chance))
message += "Capture failed! [name] escaped [P.owner ? "from [P.owner]" : "from this hunter"]!"
@@ -91,7 +91,7 @@
else
message += "Capture error! Try again."
clients_encountered -= client //if the capture registration failed somehow, let them have another chance with this mob
- P.audible_message(message, null, 4)
+ P.atom_say(message)
/obj/effect/nanomob/proc/despawn()
if(SSmob_hunt)
diff --git a/code/modules/arcade/mob_hunt/mob_datums.dm b/code/modules/arcade/mob_hunt/mob_datums.dm
index a50fab183e6..25a4569ede9 100644
--- a/code/modules/arcade/mob_hunt/mob_datums.dm
+++ b/code/modules/arcade/mob_hunt/mob_datums.dm
@@ -139,7 +139,7 @@
for(var/areapath in typesof(A))
possible_areas[areapath] -= 2
//removes "bad areas" which shouldn't be on-station but are subtypes of station areas. probably should the unused ones and consider repathing the rest
- var/list/bad_areas = list(subtypesof(/area/construction), /area/solar/derelict_starboard, /area/solar/derelict_aft, /area/solar/constructionsite)
+ var/list/bad_areas = list(subtypesof(/area/construction), /area/solar/derelict_starboard, /area/solar/derelict_aft)
for(var/A in bad_areas)
possible_areas -= A
//weight check, remove negative or zero weight areas from the list, then return the list.
diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm
index a83df5501c9..a0a7c43a7a9 100644
--- a/code/modules/assembly/health.dm
+++ b/code/modules/assembly/health.dm
@@ -55,7 +55,7 @@
health_scan = M.health
if(health_scan <= alarm_health)
pulse()
- audible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*")
+ audible_message("[bicon(src)] *beep* *beep*")
toggle_scan()
return
return
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index 400b50614a6..9de2f32ed6f 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -129,7 +129,7 @@
return FALSE
cooldown = 2
pulse(FALSE)
- audible_message("[bicon(src)] *beep* *beep*", null, 3)
+ audible_message("[bicon(src)] *beep* *beep*", hearing_distance = 3)
if(first)
qdel(first)
addtimer(CALLBACK(src, .proc/process_cooldown), 10)
diff --git a/code/modules/awaymissions/mission_code/centcomAway.dm b/code/modules/awaymissions/mission_code/centcomAway.dm
index bd9890aa43a..92fa90891e0 100644
--- a/code/modules/awaymissions/mission_code/centcomAway.dm
+++ b/code/modules/awaymissions/mission_code/centcomAway.dm
@@ -7,32 +7,32 @@
/area/awaymission/centcomAway/general
name = "XCC-P5831"
- music = "music/ambigen3.ogg"
+ ambientsounds = list('sound/ambience/ambigen3.ogg')
/area/awaymission/centcomAway/maint
name = "XCC-P5831 Maintenance"
icon_state = "away1"
- music = "music/ambisin1.ogg"
+ ambientsounds = list('sound/ambience/ambisin1.ogg')
/area/awaymission/centcomAway/thunderdome
name = "XCC-P5831 Thunderdome"
icon_state = "away2"
- music = "music/ambisin2.ogg"
+ ambientsounds = list('sound/ambience/ambisin2.ogg')
/area/awaymission/centcomAway/cafe
name = "XCC-P5831 Kitchen Arena"
icon_state = "away3"
- music = "music/ambisin3.ogg"
+ ambientsounds = list('sound/ambience/ambisin3.ogg')
/area/awaymission/centcomAway/courtroom
name = "XCC-P5831 Courtroom"
icon_state = "away4"
- music = "music/ambisin4.ogg"
+ ambientsounds = list('sound/ambience/ambisin4.ogg')
/area/awaymission/centcomAway/hangar
name = "XCC-P5831 Hangars"
icon_state = "away4"
- music = "music/ambigen5.ogg"
+ ambientsounds = list('sound/ambience/ambigen5.ogg')
//centcomAway items
diff --git a/code/modules/awaymissions/mission_code/ruins/oldstation.dm b/code/modules/awaymissions/mission_code/ruins/oldstation.dm
index 4d3c54f8f4b..9489ddec45b 100644
--- a/code/modules/awaymissions/mission_code/ruins/oldstation.dm
+++ b/code/modules/awaymissions/mission_code/ruins/oldstation.dm
@@ -321,6 +321,7 @@
name = "Beta Station Atmospherics"
icon_state = "red"
has_gravity = FALSE
+ ambientsounds = ENGINEERING_SOUNDS
/area/ruin/space/ancientstation/betanorth
name = "Beta Station North Corridor"
@@ -333,6 +334,7 @@
/area/ruin/space/ancientstation/engi
name = "Charlie Station Engineering"
icon_state = "engine"
+ ambientsounds = ENGINEERING_SOUNDS
/area/ruin/space/ancientstation/comm
name = "Charlie Station Command"
diff --git a/code/modules/buildmode/effects/line.dm b/code/modules/buildmode/effects/line.dm
index b49d35af095..5cc88309e56 100644
--- a/code/modules/buildmode/effects/line.dm
+++ b/code/modules/buildmode/effects/line.dm
@@ -12,7 +12,7 @@
var/matrix/mat = matrix()
mat.Translate(0, 16)
mat.Scale(1, sqrt((x_offset * x_offset) + (y_offset * y_offset)) / 32)
- mat.Turn(90 - Atan2(x_offset, y_offset)) // So... You pass coords in order x,y to this version of atan2. It should be called acsc2.
+ mat.Turn(90 - ATAN2(x_offset, y_offset)) // So... You pass coords in order x,y to this version of atan2. It should be called acsc2.
mat.Translate(atom_a.pixel_x, atom_a.pixel_y)
transform = mat
diff --git a/code/modules/buildmode/submodes/copy.dm b/code/modules/buildmode/submodes/copy.dm
index 48cbb2c3cf0..95d8eee8b87 100644
--- a/code/modules/buildmode/submodes/copy.dm
+++ b/code/modules/buildmode/submodes/copy.dm
@@ -22,6 +22,6 @@
if(stored)
DuplicateObject(stored, perfectcopy=1, sameloc=0,newloc=T)
else if(right_click)
- if(ismovableatom(object)) // No copying turfs for now.
+ if(ismovable(object)) // No copying turfs for now.
to_chat(user, "
[object] set as template.")
stored = object
diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm
index 94f724b77a6..4219935c766 100644
--- a/code/modules/client/preference/preferences_mysql.dm
+++ b/code/modules/client/preference/preferences_mysql.dm
@@ -96,7 +96,7 @@
UI_style_alpha='[UI_style_alpha]',
be_role='[sanitizeSQL(list2params(be_special))]',
default_slot='[default_slot]',
- toggles='[num2text(toggles, Ceiling(log(10, (TOGGLES_TOTAL))))]',
+ toggles='[num2text(toggles, CEILING(log(10, (TOGGLES_TOTAL)), 1))]',
atklog='[atklog]',
sound='[sound]',
randomslot='[randomslot]',
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index 5a01c9f6f55..1198792c980 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -531,7 +531,7 @@
/obj/item/clothing/suit/space/hardsuit/shielded/process()
if(world.time > recharge_cooldown && current_charges < max_charges)
- current_charges = Clamp((current_charges + recharge_rate), 0, max_charges)
+ current_charges = clamp((current_charges + recharge_rate), 0, max_charges)
playsound(loc, 'sound/magic/charge.ogg', 50, TRUE)
if(current_charges == max_charges)
playsound(loc, 'sound/machines/ding.ogg', 50, TRUE)
diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm
index cd4ac697406..0d106a874a7 100644
--- a/code/modules/clothing/spacesuits/rig/rig.dm
+++ b/code/modules/clothing/spacesuits/rig/rig.dm
@@ -155,9 +155,8 @@
if(piece.siemens_coefficient > siemens_coefficient) //So that insulated gloves keep their insulation.
piece.siemens_coefficient = siemens_coefficient
piece.permeability_coefficient = permeability_coefficient
- if(islist(armor))
- var/list/L = armor
- piece.armor = L.Copy()
+ if(armor)
+ piece.armor = armor
update_icon(1)
@@ -286,7 +285,7 @@
if(helmet)
helmet.update_light(wearer)
- correct_piece.armor["bio"] = 100
+ correct_piece.armor = correct_piece.armor.setRating(bio_value = 100)
sealing = FALSE
@@ -389,7 +388,7 @@
if(helmet)
helmet.update_light(wearer)
- correct_piece.armor["bio"] = armor["bio"]
+ correct_piece.armor = correct_piece.armor.setRating(bio_value = armor.getRating("bio"))
sealing = FALSE
@@ -553,7 +552,7 @@
data["charge"] = cell ? round(cell.charge,1) : 0
data["maxcharge"] = cell ? cell.maxcharge : 0
- data["chargestatus"] = cell ? Floor((cell.charge/cell.maxcharge)*50) : 0
+ data["chargestatus"] = cell ? FLOOR((cell.charge/cell.maxcharge)*50, 1) : 0
data["emagged"] = subverted
data["coverlock"] = locked
diff --git a/code/modules/clothing/spacesuits/rig/rig_armormod.dm b/code/modules/clothing/spacesuits/rig/rig_armormod.dm
index 68daec45b5a..c04270aa97b 100644
--- a/code/modules/clothing/spacesuits/rig/rig_armormod.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_armormod.dm
@@ -9,13 +9,22 @@
multi *= (100 - chest.damage) / 100 //If we have some breaches, lower the armor value.
//TODO check for other armor mods, likely modules, which need to be coded.
+ if(!armor) //Did we even give them some armor, if this is the case, the list should be initialized from New()
+ return
+ var/datum/armor/A = armor
for(var/obj/item/piece in list(gloves, helmet, boots, chest))
if(!istype(piece)) //Do we have the piece
continue
- if(islist(armor)) //Did we even give them some armor, if this is the case, the list should be initialized from New()
- var/list/L = armor
- for(var/armortype in L)
- piece.armor[armortype] = L[armortype]*multi
+
+ piece.armor = piece.armor.setRating(melee_value = A.getRating("melee") * multi,
+ bullet_value = A.getRating("bullet") * multi,
+ laser_value = A.getRating("laser") * multi,
+ energy_value = A.getRating("energy") * multi,
+ bomb_value = A.getRating("bomb") * multi,
+ bio_value = A.getRating("bio") * multi,
+ rad_value = A.getRating("rad") * multi,
+ fire_value = A.getRating("fire") * multi,
+ acid_value = A.getRating("acidd") * multi)
//Perfect place to also add something like shield modules, or any other hit_reaction modules check.
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index b417df89426..63fd1fa26b5 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -37,8 +37,13 @@
var/mob/M = has_suit.loc
A.Grant(M)
- for(var/armor_type in armor)
- has_suit.armor[armor_type] += armor[armor_type]
+ if (islist(has_suit.armor) || isnull(has_suit.armor)) // This proc can run before /obj/Initialize has run for U and src,
+ has_suit.armor = getArmor(arglist(has_suit.armor)) // we have to check that the armor list has been transformed into a datum before we try to call a proc on it
+ // This is safe to do as /obj/Initialize only handles setting up the datum if actually needed.
+ if (islist(armor) || isnull(armor))
+ armor = getArmor(arglist(armor))
+
+ has_suit.armor = has_suit.armor.attachArmor(armor)
if(user)
to_chat(user, "
You attach [src] to [has_suit].")
@@ -56,8 +61,7 @@
var/mob/M = has_suit.loc
A.Remove(M)
- for(var/armor_type in armor)
- has_suit.armor[armor_type] -= armor[armor_type]
+ has_suit.armor = has_suit.armor.detachArmor(armor)
has_suit = null
if(user)
@@ -314,6 +318,36 @@
if(isliving(user))
user.visible_message("
[user] invades [M]'s personal space, thrusting [src] into [M.p_their()] face insistently.","
You invade [M]'s personal space, thrusting [src] into [M.p_their()] face insistently. You are the law.")
+//////////////
+//OBJECTION!//
+//////////////
+
+/obj/item/clothing/accessory/lawyers_badge
+ name = "attorney's badge"
+ desc = "Fills you with the conviction of JUSTICE. Lawyers tend to want to show it to everyone they meet."
+ icon_state = "lawyerbadge"
+ item_state = "lawyerbadge"
+ item_color = "lawyerbadge"
+ var/cached_bubble_icon = null
+
+/obj/item/clothing/accessory/attack_self(mob/user)
+ if(prob(1))
+ user.say("The testimony contradicts the evidence!")
+ user.visible_message("
[user] shows [user.p_their()] attorney's badge.", "
You show your attorney's badge.")
+
+/obj/item/clothing/accessory/lawyers_badge/on_attached(obj/item/clothing/under/S, mob/user)
+ ..()
+ if(has_suit && ismob(has_suit.loc))
+ var/mob/M = has_suit.loc
+ cached_bubble_icon = M.bubble_icon
+ M.bubble_icon = "lawyer"
+
+/obj/item/clothing/accessory/lawyers_badge/on_removed(mob/user)
+ if(has_suit && ismob(has_suit.loc))
+ var/mob/M = has_suit.loc
+ M.bubble_icon = cached_bubble_icon
+ ..()
+
///////////
//SCARVES//
///////////
diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm
index a9c47e760e7..a0d6823fe80 100644
--- a/code/modules/crafting/craft.dm
+++ b/code/modules/crafting/craft.dm
@@ -128,7 +128,7 @@
continue main_loop
return FALSE
for(var/obj/item/T in tools_used)
- if(!T.tool_start_check(user, 0)) //Check if all our tools are valid for their use
+ if(!T.tool_start_check(null, user, 0)) //Check if all our tools are valid for their use
return FALSE
return TRUE
diff --git a/code/modules/detective_work/footprints_and_rag.dm b/code/modules/detective_work/footprints_and_rag.dm
index 2646d03fb0f..bfc9d0aa824 100644
--- a/code/modules/detective_work/footprints_and_rag.dm
+++ b/code/modules/detective_work/footprints_and_rag.dm
@@ -18,7 +18,6 @@
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(5)
volume = 5
- can_be_placed_into = null
flags = NOBLUDGEON
container_type = OPENCONTAINER
has_lid = FALSE
diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm
index 6995e260500..aafc91cb849 100644
--- a/code/modules/economy/Accounts_DB.dm
+++ b/code/modules/economy/Accounts_DB.dm
@@ -159,7 +159,7 @@ GLOBAL_VAR(current_date_string)
var/account_name = href_list["holder_name"]
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
- starting_funds = Clamp(starting_funds, 0, GLOB.station_account.money) // Not authorized to put the station in debt.
+ starting_funds = clamp(starting_funds, 0, GLOB.station_account.money) // Not authorized to put the station in debt.
starting_funds = min(starting_funds, fund_cap) // Not authorized to give more than the fund cap.
var/datum/money_account/M = create_account(account_name, starting_funds, src)
diff --git a/code/modules/events/anomaly_pyro.dm b/code/modules/events/anomaly_pyro.dm
index 79e7c7b8434..0a5dc14bc3a 100644
--- a/code/modules/events/anomaly_pyro.dm
+++ b/code/modules/events/anomaly_pyro.dm
@@ -15,7 +15,7 @@
if(!newAnomaly)
kill()
return
- if(IsMultiple(activeFor, 5))
+ if(ISMULTIPLE(activeFor, 5))
newAnomaly.anomalyEffect()
/datum/event/anomaly/anomaly_pyro/end()
diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm
index d3b7cf012b8..8d91635c458 100644
--- a/code/modules/events/brand_intelligence.dm
+++ b/code/modules/events/brand_intelligence.dm
@@ -55,12 +55,12 @@
kill()
return
- if(IsMultiple(activeFor, 4))
+ if(ISMULTIPLE(activeFor, 4))
var/obj/machinery/vending/rebel = pick(vendingMachines)
vendingMachines.Remove(rebel)
infectedMachines.Add(rebel)
rebel.shut_up = 0
rebel.shoot_inventory = 1
- if(IsMultiple(activeFor, 8))
+ if(ISMULTIPLE(activeFor, 8))
originMachine.speak(pick(rampant_speeches))
diff --git a/code/modules/events/communications_blackout.dm b/code/modules/events/communications_blackout.dm
index 2d83372d625..52baf0fe05c 100644
--- a/code/modules/events/communications_blackout.dm
+++ b/code/modules/events/communications_blackout.dm
@@ -17,7 +17,7 @@
/datum/event/communications_blackout/start()
// This only affects the cores, relays should be unaffected imo
for(var/obj/machinery/tcomms/core/T in GLOB.tcomms_machines)
- T.disable_machine()
+ T.start_ion()
// Bring it back sometime between 3-5 minutes. This uses deciseconds, so 1800 and 3000 respecticely.
- // Note that because this is a strict enable not a toggle, the crew or AI can re-enable the machine themselves
- addtimer(CALLBACK(T, /obj/machinery/tcomms.proc/enable_machine), rand(1800, 3000))
+ // The AI cannot disable this, it must be waited for
+ addtimer(CALLBACK(T, /obj/machinery/tcomms.proc/end_ion), rand(1800, 3000))
diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm
index 90718ef2928..2c718580d2c 100644
--- a/code/modules/events/ion_storm.dm
+++ b/code/modules/events/ion_storm.dm
@@ -493,7 +493,7 @@
/proc/generate_static_ion_law()
var/list/players = list()
for(var/mob/living/carbon/human/player in GLOB.player_list)
- if( !player.mind || player.mind.assigned_role == player.mind.special_role || player.client.inactivity > MinutesToTicks(10))
+ if( !player.mind || player.mind.assigned_role == player.mind.special_role || player.client.inactivity > 10 MINUTES)
continue
players += player.real_name
var/random_player = "The Captain"
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index 90929175eba..d6395bf3d43 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -72,8 +72,8 @@
if(istype(H.head, /obj/item/clothing/head) && affecting == "head")
// If their head has an armor value, assign headarmor to it, else give it 0.
- if(H.head.armor["melee"])
- headarmor = H.head.armor["melee"]
+ if(H.head.armor.getRating("melee"))
+ headarmor = H.head.armor.getRating("melee")
else
headarmor = 0
else
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index 7be44052729..9a7c8cca075 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -438,7 +438,7 @@
overlays += I
return
- var/offset = Floor(20/cards.len + 1)
+ var/offset = FLOOR(20/cards.len + 1, 1)
var/matrix/M = matrix()
if(direction)
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index c1b5e471315..bb25025cb7f 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -327,7 +327,7 @@
else if(href_list["create"])
var/amount = (text2num(href_list["amount"]))
//Can't be outside these (if you change this keep a sane limit)
- amount = Clamp(amount, 1, 10)
+ amount = clamp(amount, 1, 10)
var/datum/design/D = locate(href_list["create"])
create_product(D, amount)
updateUsrDialog()
diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm
index d39a0168f14..7ce64f40b20 100644
--- a/code/modules/hydroponics/gene_modder.dm
+++ b/code/modules/hydroponics/gene_modder.dm
@@ -71,7 +71,7 @@
for(var/obj/item/stock_parts/micro_laser/ML in component_parts)
var/wratemod = ML.rating * 2.5
- min_wrate = Floor(10-wratemod) // 7,5,2,0 Clamps at 0 and 10 You want this low
+ min_wrate = FLOOR(10-wratemod, 1) // 7,5,2,0 Clamps at 0 and 10 You want this low
min_wchance = 67-(ML.rating*16) // 48,35,19,3 Clamps at 0 and 67 You want this low
for(var/obj/item/circuitboard/plantgenes/vaultcheck in component_parts)
if(istype(vaultcheck, /obj/item/circuitboard/plantgenes/vault)) // TRAIT_DUMB BOTANY TUTS
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index 50a7db9952b..a3b522187e2 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -40,7 +40,7 @@
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_new(src, newloc)
seed.prepare_result(src)
- transform *= TransformUsingVariable(seed.potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency!
+ transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency!
add_juice()
/obj/item/reagent_containers/food/snacks/grown/Destroy()
@@ -184,3 +184,4 @@
D.consume(src)
else
return ..()
+
diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm
index b27d7504847..f10b286469a 100644
--- a/code/modules/hydroponics/growninedible.dm
+++ b/code/modules/hydroponics/growninedible.dm
@@ -28,7 +28,7 @@
if(istype(src, seed.product)) // no adding reagents if it is just a trash item
seed.prepare_result(src)
- transform *= TransformUsingVariable(seed.potency, 100, 0.5)
+ transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5
add_juice()
/obj/item/grown/Destroy()
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 0f41ba4b602..5bc63d4bace 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -888,7 +888,7 @@
/obj/machinery/hydroponics/wrench_act(mob/user, obj/item/I)
. = TRUE
- if(!I.tool_start_check(user, 0))
+ if(!I.tool_start_check(src, user, 0))
return
if(wrenchable)
if(using_irrigation)
@@ -949,30 +949,30 @@
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
- nutrilevel = Clamp(nutrilevel + adjustamt, 0, maxnutri)
+ nutrilevel = clamp(nutrilevel + adjustamt, 0, maxnutri)
plant_hud_set_nutrient()
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
- waterlevel = Clamp(waterlevel + adjustamt, 0, maxwater)
+ waterlevel = clamp(waterlevel + adjustamt, 0, maxwater)
plant_hud_set_water()
if(adjustamt>0)
adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
/obj/machinery/hydroponics/proc/adjustHealth(adjustamt)
if(myseed && !dead)
- plant_health = Clamp(plant_health + adjustamt, 0, myseed.endurance)
+ plant_health = clamp(plant_health + adjustamt, 0, myseed.endurance)
plant_hud_set_health()
/obj/machinery/hydroponics/proc/adjustToxic(adjustamt)
- toxic = Clamp(toxic + adjustamt, 0, 100)
+ toxic = clamp(toxic + adjustamt, 0, 100)
plant_hud_set_toxin()
/obj/machinery/hydroponics/proc/adjustPests(adjustamt)
- pestlevel = Clamp(pestlevel + adjustamt, 0, 10)
+ pestlevel = clamp(pestlevel + adjustamt, 0, 10)
plant_hud_set_pest()
/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt)
- weedlevel = Clamp(weedlevel + adjustamt, 0, 10)
+ weedlevel = clamp(weedlevel + adjustamt, 0, 10)
plant_hud_set_weed()
/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood
diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm
index 8cfc9b7d5f0..08ccac07062 100644
--- a/code/modules/hydroponics/seeds.dm
+++ b/code/modules/hydroponics/seeds.dm
@@ -182,7 +182,7 @@
/// Setters procs ///
/obj/item/seeds/proc/adjust_yield(adjustamt)
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
- yield = Clamp(yield + adjustamt, 0, 10)
+ yield = clamp(yield + adjustamt, 0, 10)
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
yield = 1 // Mushrooms always have a minimum yield of 1.
@@ -191,39 +191,39 @@
C.value = yield
/obj/item/seeds/proc/adjust_lifespan(adjustamt)
- lifespan = Clamp(lifespan + adjustamt, 10, 100)
+ lifespan = clamp(lifespan + adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
if(C)
C.value = lifespan
/obj/item/seeds/proc/adjust_endurance(adjustamt)
- endurance = Clamp(endurance + adjustamt, 10, 100)
+ endurance = clamp(endurance + adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
if(C)
C.value = endurance
/obj/item/seeds/proc/adjust_production(adjustamt)
if(yield != -1)
- production = Clamp(production + adjustamt, 1, 10)
+ production = clamp(production + adjustamt, 1, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
if(C)
C.value = production
/obj/item/seeds/proc/adjust_potency(adjustamt)
if(potency != -1)
- potency = Clamp(potency + adjustamt, 0, 100)
+ potency = clamp(potency + adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
if(C)
C.value = potency
/obj/item/seeds/proc/adjust_weed_rate(adjustamt)
- weed_rate = Clamp(weed_rate + adjustamt, 0, 10)
+ weed_rate = clamp(weed_rate + adjustamt, 0, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
if(C)
C.value = weed_rate
/obj/item/seeds/proc/adjust_weed_chance(adjustamt)
- weed_chance = Clamp(weed_chance + adjustamt, 0, 67)
+ weed_chance = clamp(weed_chance + adjustamt, 0, 67)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
if(C)
C.value = weed_chance
@@ -232,7 +232,7 @@
/obj/item/seeds/proc/set_yield(adjustamt)
if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
- yield = Clamp(adjustamt, 0, 10)
+ yield = clamp(adjustamt, 0, 10)
if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
yield = 1 // Mushrooms always have a minimum yield of 1.
@@ -241,39 +241,39 @@
C.value = yield
/obj/item/seeds/proc/set_lifespan(adjustamt)
- lifespan = Clamp(adjustamt, 10, 100)
+ lifespan = clamp(adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan)
if(C)
C.value = lifespan
/obj/item/seeds/proc/set_endurance(adjustamt)
- endurance = Clamp(adjustamt, 10, 100)
+ endurance = clamp(adjustamt, 10, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance)
if(C)
C.value = endurance
/obj/item/seeds/proc/set_production(adjustamt)
if(yield != -1)
- production = Clamp(adjustamt, 1, 10)
+ production = clamp(adjustamt, 1, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production)
if(C)
C.value = production
/obj/item/seeds/proc/set_potency(adjustamt)
if(potency != -1)
- potency = Clamp(adjustamt, 0, 100)
+ potency = clamp(adjustamt, 0, 100)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency)
if(C)
C.value = potency
/obj/item/seeds/proc/set_weed_rate(adjustamt)
- weed_rate = Clamp(adjustamt, 0, 10)
+ weed_rate = clamp(adjustamt, 0, 10)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate)
if(C)
C.value = weed_rate
/obj/item/seeds/proc/set_weed_chance(adjustamt)
- weed_chance = Clamp(adjustamt, 0, 67)
+ weed_chance = clamp(adjustamt, 0, 67)
var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance)
if(C)
C.value = weed_chance
diff --git a/code/modules/library/computers/checkout.dm b/code/modules/library/computers/checkout.dm
index 31eebc5d05c..f9aae71b2a5 100644
--- a/code/modules/library/computers/checkout.dm
+++ b/code/modules/library/computers/checkout.dm
@@ -95,7 +95,7 @@
dat += "
ERROR: Unable to contact External Archive. Please contact your system administrator for assistance."
else
num_results = src.get_num_results()
- num_pages = Ceiling(num_results/LIBRARY_BOOKS_PER_PAGE)
+ num_pages = CEILING(num_results/LIBRARY_BOOKS_PER_PAGE, 1)
dat += {"
"}
@@ -207,7 +207,7 @@
var/obj/item/barcodescanner/scanner = W
scanner.computer = src
to_chat(user, "[scanner]'s associated machine has been set to [src].")
- audible_message("[src] lets out a low, short blip.", 2)
+ audible_message("[src] lets out a low, short blip.", hearing_distance = 2)
return 1
else
return ..()
@@ -224,13 +224,13 @@
else
var/pn = text2num(href_list["pagenum"])
if(!isnull(pn))
- page_num = Clamp(pn, 1, num_pages)
+ page_num = clamp(pn, 1, num_pages)
if(href_list["page"])
if(num_pages == 0)
page_num = 1
else
- page_num = Clamp(text2num(href_list["page"]), 1, num_pages)
+ page_num = clamp(text2num(href_list["page"]), 1, num_pages)
if(href_list["settitle"])
var/newtitle = input("Enter a title to search for:") as text|null
if(newtitle)
@@ -252,7 +252,7 @@
if(href_list["search"])
num_results = src.get_num_results()
- num_pages = Ceiling(num_results/LIBRARY_BOOKS_PER_PAGE)
+ num_pages = CEILING(num_results/LIBRARY_BOOKS_PER_PAGE, 1)
page_num = 1
screenstate = 4
@@ -413,7 +413,7 @@
return
if(bibledelay)
- audible_message("
[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
+ visible_message("
[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
else
bibledelay = 1
spawn(60)
diff --git a/code/modules/library/computers/public.dm b/code/modules/library/computers/public.dm
index f94369b11b7..3c5116bc074 100644
--- a/code/modules/library/computers/public.dm
+++ b/code/modules/library/computers/public.dm
@@ -75,7 +75,7 @@
else
var/pn = text2num(href_list["pagenum"])
if(!isnull(pn))
- page_num = Clamp(pn, 1, num_pages)
+ page_num = clamp(pn, 1, num_pages)
if(href_list["settitle"])
var/newtitle = input("Enter a title to search for:") as text|null
@@ -100,11 +100,11 @@
if(num_pages == 0)
page_num = 1
else
- page_num = Clamp(text2num(href_list["page"]), 1, num_pages)
+ page_num = clamp(text2num(href_list["page"]), 1, num_pages)
if(href_list["search"])
num_results = src.get_num_results()
- num_pages = Ceiling(num_results/LIBRARY_BOOKS_PER_PAGE)
+ num_pages = CEILING(num_results/LIBRARY_BOOKS_PER_PAGE, 1)
page_num = 1
screenstate = 1
diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm
index ff4bc517979..fa848700557 100644
--- a/code/modules/lighting/lighting_atom.dm
+++ b/code/modules/lighting/lighting_atom.dm
@@ -38,7 +38,7 @@
if(!light_power || !light_range) // We won't emit light anyways, destroy the light source.
QDEL_NULL(light)
else
- if(!ismovableatom(loc)) // We choose what atom should be the top atom of the light here.
+ if(!ismovable(loc)) // We choose what atom should be the top atom of the light here.
. = src
else
. = loc
diff --git a/code/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm
index e9728bc7901..a0ea3eb7639 100644
--- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm
+++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm
@@ -81,7 +81,7 @@
var/mob/dead/observer/current_spirits = list()
for(var/mob/dead/observer/O in GLOB.player_list)
- if((O.following in contents))
+ if((O.orbiting in contents))
ghost_counter++
O.invisibility = 0
current_spirits |= O
@@ -97,13 +97,13 @@
force = 0
var/ghost_counter = ghost_check()
- force = Clamp((ghost_counter * 4), 0, 75)
+ force = clamp((ghost_counter * 4), 0, 75)
user.visible_message("
[user] strikes with the force of [ghost_counter] vengeful spirits!")
..()
/obj/item/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
var/ghost_counter = ghost_check()
- final_block_chance += Clamp((ghost_counter * 5), 0, 75)
+ final_block_chance += clamp((ghost_counter * 5), 0, 75)
owner.visible_message("
[owner] is protected by a ring of [ghost_counter] ghosts!")
return ..()
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 7f1b520e7f8..9630395e0cd 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -221,7 +221,7 @@
. = TRUE
if(!powered())
return
- if(!I.tool_start_check(user, 0))
+ if(!I.tool_start_check(src, user, 0))
return
input_dir = turn(input_dir, -90)
output_dir = turn(output_dir, -90)
diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm
index 1198e2fb9d3..dbaa24fef34 100644
--- a/code/modules/mining/minebot.dm
+++ b/code/modules/mining/minebot.dm
@@ -101,7 +101,7 @@
if(user.a_intent != INTENT_HELP)
return
. = TRUE
- if(!I.tool_start_check(user, 0))
+ if(!I.tool_start_check(src, user, 0))
return
I.melee_attack_chain(user, stored_gun)
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index c6d23a1bbde..9cabe4ac486 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -70,7 +70,7 @@
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
- coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
+ coinsToProduce = clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = TRUE
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 8bff776c176..997920c8e23 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -23,7 +23,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
//If you died in the game and are a ghsot - this will remain as null.
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = TRUE
- var/atom/movable/following = null
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = TRUE //is the ghost able to see things humans can't?
var/seedarkness = TRUE
@@ -230,7 +229,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/Move(NewLoc, direct)
update_parallax_contents()
- following = null
setDir(direct)
ghostimage.setDir(dir)
@@ -412,7 +410,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
forceMove(pick(L))
update_parallax_contents()
- following = null
/mob/dead/observer/verb/follow()
set category = "Ghost"
@@ -424,7 +421,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
A.on_close(CALLBACK(src, .proc/ManualFollow))
// This is the ghost's follow verb with an argument
-/mob/dead/observer/proc/ManualFollow(var/atom/movable/target)
+/mob/dead/observer/proc/ManualFollow(atom/movable/target)
if(!target || !isobserver(usr))
return
@@ -432,7 +429,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
if(target != src)
- if(following && following == target)
+ if(orbiting && orbiting == target)
return
var/icon/I = icon(target.icon,target.icon_state,target.dir)
@@ -458,7 +455,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else //Circular
rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle
- following = target
to_chat(src, "
Now following [target]")
orbit(target,orbitsize, FALSE, 20, rot_seg)
@@ -485,7 +481,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
A.forceMove(T)
M.update_parallax_contents()
- following = null
return
to_chat(A, "This mob is not located in the game world.")
@@ -642,7 +637,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!client)
return
forceMove(T)
- following = null
if(href_list["reenter"])
reenter_corpse()
diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm
index 7f3a7049558..92d936227cc 100644
--- a/code/modules/mob/language.dm
+++ b/code/modules/mob/language.dm
@@ -33,7 +33,7 @@
for(var/i = 0;i
0;x--)
+ for(var/x = rand(FLOOR(syllable_count/2, 1),syllable_count);x>0;x--)
new_name += pick(syllables)
full_name += " [capitalize(lowertext(new_name))]"
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 247e0bcbab2..f6354b61940 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -2,6 +2,7 @@
name = "alien"
voice_name = "alien"
speak_emote = list("hisses")
+ bubble_icon = "alien"
icon = 'icons/mob/alien.dmi'
gender = NEUTER
dna = null
@@ -226,7 +227,7 @@ Des: Removes all infected images from the alien.
/mob/living/carbon/alien/handle_footstep(turf/T)
if(..())
- if(T.footstep_sounds["xeno"])
+ if(T.footstep_sounds && T.footstep_sounds["xeno"])
var/S = pick(T.footstep_sounds["xeno"])
if(S)
if(m_intent == MOVE_INTENT_RUN)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
index 63514686f3d..a28b3f33a53 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
@@ -6,6 +6,7 @@
icon_state = "alienq_s"
status_flags = CANPARALYSE
mob_size = MOB_SIZE_LARGE
+ bubble_icon = "alienroyal"
large = 1
ventcrawler = 0
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index a34f02bc868..fed50d442c9 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -139,10 +139,18 @@
//WHO THE FUCK THOUGHT THAT WAS A GOOD FUCKING IDEA!?!?
if("howl", "howls")
- var/M = handle_emote_param(param) //Check to see if the param is valid (mob with the param name is in view).
- message = "[src] howls[M ? " at [M]" : ""]!"
- playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 1, 10, frequency = get_age_pitch())
- m_type = 2
+ var/M = handle_emote_param(param)
+ if(miming)
+ message = "[src] acts out a howl[M ? " at [M]" : ""]!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] howls[M ? " at [M]" : ""]!"
+ playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 1, 10, frequency = get_age_pitch())
+ m_type = 2
+ else
+ message = "[src] makes a very loud noise[M ? " at [M]" : ""]."
+ m_type = 2
if("growl", "growls")
var/M = handle_emote_param(param)
diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm
index 89aa7854264..f9058065fb0 100644
--- a/code/modules/mob/living/carbon/human/human_damage.dm
+++ b/code/modules/mob/living/carbon/human/human_damage.dm
@@ -30,7 +30,7 @@
if(dna.species && amount > 0)
if(use_brain_mod)
amount = amount * dna.species.brain_mod
- sponge.damage = Clamp(sponge.damage + amount, 0, 120)
+ sponge.damage = clamp(sponge.damage + amount, 0, 120)
if(sponge.damage >= 120)
visible_message("[src] goes limp, [p_their()] facial expression utterly blank.")
death()
@@ -48,7 +48,7 @@
if(dna.species && amount > 0)
if(use_brain_mod)
amount = amount * dna.species.brain_mod
- sponge.damage = Clamp(amount, 0, 120)
+ sponge.damage = clamp(amount, 0, 120)
if(sponge.damage >= 120)
visible_message("[src] goes limp, [p_their()] facial expression utterly blank.")
death()
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 82b61a04391..a849235af64 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -134,7 +134,7 @@ emp_act
if(bp && istype(bp ,/obj/item/clothing))
var/obj/item/clothing/C = bp
if(C.body_parts_covered & def_zone.body_part)
- protection += C.armor[type]
+ protection += C.armor.getRating(type)
return protection
@@ -185,19 +185,19 @@ emp_act
var/block_chance_modifier = round(damage / -3)
if(l_hand && !istype(l_hand, /obj/item/clothing))
- var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
+ var/final_block_chance = l_hand.block_chance - (clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
if(l_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(r_hand && !istype(r_hand, /obj/item/clothing))
- var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
+ var/final_block_chance = r_hand.block_chance - (clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
if(r_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(wear_suit)
- var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
+ var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(w_uniform)
- var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
+ var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 85bf001a206..5e1b5163a24 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -81,7 +81,7 @@
/mob/living/carbon/human/handle_footstep(turf/T)
if(..())
- if(T.footstep_sounds["human"])
+ if(T.footstep_sounds && T.footstep_sounds["human"])
var/S = pick(T.footstep_sounds["human"])
if(S)
if(m_intent == MOVE_INTENT_RUN)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index c74340d0901..5030c5c4170 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -197,7 +197,7 @@
if(!(RADIMMUNE in dna.species.species_traits))
if(radiation)
- radiation = Clamp(radiation, 0, 200)
+ radiation = clamp(radiation, 0, 200)
var/autopsy_damage = 0
switch(radiation)
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 207a3012ad8..a2df4b30e9e 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -162,7 +162,7 @@
//TOXINS/PLASMA
if(Toxins_partialpressure > safe_tox_max)
var/ratio = (breath.toxins/safe_tox_max) * 10
- adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
+ adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
else
clear_alert("too_much_tox")
@@ -243,7 +243,7 @@
adjustToxLoss(3)
updatehealth("handle mutations and radiation(75-100)")
- radiation = Clamp(radiation, 0, 100)
+ radiation = clamp(radiation, 0, 100)
/mob/living/carbon/handle_chemicals_in_body()
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 604fd47de16..b38f1819524 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -79,9 +79,9 @@
/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
if(throwforce && w_class)
- return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
+ return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
else if(w_class)
- return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
+ return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
else
return 0
@@ -175,7 +175,7 @@
return
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
- fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
+ fire_stacks = clamp(fire_stacks + add_fire_stacks, -20, 20)
if(on_fire && fire_stacks <= 0)
ExtinguishMob()
@@ -260,8 +260,6 @@
add_attack_logs(user, src, "Grabbed passively", ATKLOG_ALL)
var/obj/item/grab/G = new /obj/item/grab(user, src)
- if(buckled)
- to_chat(user, "You cannot grab [src]; [p_they()] [p_are()] buckled in!")
if(!G) //the grab will delete itself in New if src is anchored
return 0
user.put_in_active_hand(G)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index fb633f116bd..4cdd77aa336 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -269,12 +269,12 @@ proc/get_radio_key_from_channel(var/channel)
M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol, sound_frequency)
if(M.client)
speech_bubble_recipients.Add(M.client)
- spawn(0)
- if(loc && !isturf(loc))
- var/atom/A = loc //Non-turf, let it handle the speech bubble
- A.speech_bubble("hR[speech_bubble_test]", A, speech_bubble_recipients)
- else //Turf, leave speech bubbles to the mob
- speech_bubble("h[speech_bubble_test]", src, speech_bubble_recipients)
+
+ if(loc && !isturf(loc))
+ var/atom/A = loc //Non-turf, let it handle the speech bubble
+ A.speech_bubble("[A.bubble_icon][speech_bubble_test]", A, speech_bubble_recipients)
+ else //Turf, leave speech bubbles to the mob
+ speech_bubble("[bubble_icon][speech_bubble_test]", src, speech_bubble_recipients)
for(var/obj/O in listening_obj)
spawn(0)
@@ -462,10 +462,7 @@ proc/get_radio_key_from_channel(var/channel)
if(M.client)
speech_bubble_recipients.Add(M.client)
- spawn(0)
- var/image/I = image('icons/mob/talk.dmi', src, "h[speech_bubble_test]", MOB_LAYER + 1)
- I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
- flick_overlay(I, speech_bubble_recipients, 30)
+ speech_bubble("[bubble_icon][speech_bubble_test]", src, speech_bubble_recipients)
if(watching.len)
var/rendered = "[name] [not_heard]."
@@ -474,7 +471,7 @@ proc/get_radio_key_from_channel(var/channel)
return 1
-/mob/living/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
- var/image/I = image('icons/mob/talk.dmi', bubble_loc, bubble_state, MOB_LAYER + 1)
+/mob/living/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list())
+ var/image/I = image('icons/mob/talk.dmi', bubble_loc, bubble_state, FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
- flick_overlay(I, bubble_recipients, 30)
+ INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, bubble_recipients, 30)
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index 39bedc78c77..f932f4270ba 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -6,6 +6,7 @@
icon_state = "repairbot"
maxHealth = 35
health = 35
+ bubble_icon = "machine"
universal_speak = 0
universal_understand = 1
gender = NEUTER
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
index 7958f983805..8f2b9fee6ae 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
@@ -64,7 +64,7 @@
..()
can_hold = typecacheof(can_hold)
-/obj/item/gripper/verb/drop_item()
+/obj/item/gripper/verb/drop_item_gripped()
set name = "Drop Gripped Item"
set desc = "Release an item from your magnetic gripper."
set category = "Drone"
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index afdab2f5649..07080e694bf 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -36,7 +36,7 @@
if(is_component_functioning("power cell") && cell.charge)
if(cell.charge <= 100)
uneq_all()
- var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
+ var/amt = clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
else
uneq_all()
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 2eb1e4669ab..d7f42a9ceb5 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -9,6 +9,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
icon_state = "robot"
maxHealth = 100
health = 100
+ bubble_icon = "robot"
universal_understand = 1
deathgasp_on_death = TRUE
@@ -16,8 +17,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/custom_name = ""
var/custom_sprite = 0 //Due to all the sprites involved, a var for our custom borgs may be best
-//Hud stuff
-
+ //Hud stuff
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
@@ -27,7 +27,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
var/obj/screen/robot_modules_background
-//3 Modules can be activated at any one time.
+ //3 Modules can be activated at any one time.
var/obj/item/robot_module/module = null
var/module_active = null
var/module_state_1 = null
@@ -57,6 +57,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/is_emaggable = TRUE
var/eye_protection = 0
var/ear_protection = 0
+ var/damage_protection = 0
+ var/emp_protection = FALSE
+ var/xeno_disarm_chance = 85
var/list/force_modules = list()
var/allow_rename = TRUE
@@ -86,7 +89,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/tracking_entities = 0 //The number of known entities currently accessing the internal camera
var/braintype = "Cyborg"
var/base_icon = ""
- var/crisis = 0
var/modules_break = TRUE
var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting.
@@ -97,6 +99,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD)
+ var/default_cell_type = /obj/item/stock_parts/cell/high
var/magpulse = 0
var/ionpulse = 0 // Jetpack-like effect.
var/ionpulse_on = 0 // Jetpack-like effect.
@@ -132,7 +135,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
init()
- if(!scrambledcodes && !camera)
+ if(!camera && (!scrambledcodes || designation == "ERT"))
camera = new /obj/machinery/camera(src)
camera.c_tag = real_name
camera.network = list("SS13","Robots")
@@ -144,7 +147,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
mmi.icon_state = "boris"
if(!cell) // Make sure a new cell gets created *before* executing initialize_components(). The cell component needs an existing cell for it to get set up properly
- cell = new /obj/item/stock_parts/cell/high(src)
+ cell = new default_cell_type(src)
initialize_components()
//if(!unfinished)
@@ -288,12 +291,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
/mob/living/silicon/robot/proc/pick_module()
if(module)
return
- var/list/modules = list("Standard", "Engineering", "Medical", "Miner", "Janitor", "Service", "Security")
+ var/list/modules = list("Generalist", "Engineering", "Medical", "Miner", "Janitor", "Service", "Security")
if(islist(force_modules) && force_modules.len)
modules = force_modules.Copy()
- if(GLOB.security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis)
- to_chat(src, "Crisis mode active. The combat module is now available.")
- modules += "Combat"
if(mmi != null && mmi.alien)
modules = list("Hunter")
modtype = input("Please, select a module!", "Robot", null, null) as null|anything in modules
@@ -306,9 +306,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
return
switch(modtype)
- if("Standard")
+ if("Generalist")
module = new /obj/item/robot_module/standard(src)
- module.channels = list("Service" = 1)
+ module.channels = list("Engineering" = 1, "Medical" = 1, "Security" = 1, "Service" = 1)
module_sprites["Basic"] = "robot_old"
module_sprites["Android"] = "droid"
module_sprites["Default"] = "Standard"
@@ -337,6 +337,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
module_sprites["Standard"] = "Standard-Mine"
module_sprites["Noble-DIG"] = "Noble-DIG"
module_sprites["Cricket"] = "Cricket-MINE"
+ module_sprites["Lavaland"] = "lavaland"
if("Medical")
module = new /obj/item/robot_module/medical(src)
@@ -353,6 +354,17 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
status_flags &= ~CANPUSH
if("Security")
+ if(!weapons_unlock)
+ var/count_secborgs = 0
+ for(var/mob/living/silicon/robot/R in GLOB.alive_mob_list)
+ if(R && R.stat != DEAD && R.module && istype(R.module, /obj/item/robot_module/security))
+ count_secborgs++
+ var/max_secborgs = 2
+ if(GLOB.security_level == SEC_LEVEL_GREEN)
+ max_secborgs = 1
+ if(count_secborgs >= max_secborgs)
+ to_chat(src, "There are too many Security cyborgs active. Please choose another module.")
+ return
module = new /obj/item/robot_module/security(src)
module.channels = list("Security" = 1)
module_sprites["Basic"] = "secborg"
@@ -387,10 +399,16 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
module_sprites["Noble-CLN"] = "Noble-CLN"
module_sprites["Cricket"] = "Cricket-JANI"
- if("Combat")
- module = new /obj/item/robot_module/combat(src)
+ if("Destroyer") // Rolling Borg
+ module = new /obj/item/robot_module/destroyer(src)
module.channels = list("Security" = 1)
icon_state = "droidcombat"
+ status_flags &= ~CANPUSH
+
+ if("Combat") // Gamma ERT
+ module = new /obj/item/robot_module/combat(src)
+ icon_state = "ertgamma"
+ status_flags &= ~CANPUSH
if("Hunter")
module = new /obj/item/robot_module/alien/hunter(src)
@@ -442,6 +460,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
ionpulse = FALSE
magpulse = FALSE
add_language("Robot Talk", 1)
+ if("lava" in weather_immunities) // Remove the lava-immunity effect given by a printable upgrade
+ weather_immunities -= "lava"
status_flags |= CANPUSH
@@ -916,7 +936,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
return 0
/mob/living/silicon/robot/update_icons()
-
overlays.Cut()
if(stat != DEAD && !(paralysis || stunned || IsWeakened() || low_power_mode)) //Not dead, not stunned.
if(custom_panel in custom_eye_names)
@@ -925,36 +944,24 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
overlays += "eyes-[icon_state]"
else
overlays -= "eyes"
-
if(opened)
var/panelprefix = "ov"
if(custom_sprite) //Custom borgs also have custom panels, heh
panelprefix = "[ckey]"
-
if(custom_panel in custom_panel_names) //For default borgs with different panels
panelprefix = custom_panel
-
if(wiresexposed)
overlays += "[panelprefix]-openpanel +w"
else if(cell)
overlays += "[panelprefix]-openpanel +c"
else
overlays += "[panelprefix]-openpanel -c"
-
- var/combat = list("Combat")
- if(modtype in combat)
- if(base_icon == "")
- base_icon = icon_state
- if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
- icon_state = "[base_icon]-roll"
- else
- icon_state = base_icon
- if(module)
- for(var/obj/item/borg/combat/shield/S in module.modules)
- if(activated(S))
- overlays += "[base_icon]-shield"
+ borg_icons()
update_fire()
+/mob/living/silicon/robot/proc/borg_icons() // Exists so that robot/destroyer can override it
+ return
+
/mob/living/silicon/robot/proc/installed_modules()
if(weapon_lock)
to_chat(src, "Weapon lock active, unable to use modules! Count:[weaponlock_time]")
@@ -1309,6 +1316,16 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
..()
update_module_icon()
+/mob/living/silicon/robot/emp_act(severity)
+ if(emp_protection)
+ return
+ ..()
+ switch(severity)
+ if(1)
+ disable_component("comms", 160)
+ if(2)
+ disable_component("comms", 60)
+
/mob/living/silicon/robot/deathsquad
base_icon = "nano_bloodhound"
icon_state = "nano_bloodhound"
@@ -1321,44 +1338,29 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
pdahide = 1
eye_protection = 2 // Immunity to flashes and the visual part of flashbangs
ear_protection = 1 // Immunity to the audio part of flashbangs
+ damage_protection = 10 // Reduce all incoming damage by this number
+ xeno_disarm_chance = 20
allow_rename = FALSE
modtype = "Commando"
faction = list("nanotrasen")
is_emaggable = FALSE
-
-/mob/living/silicon/robot/deathsquad/New(loc)
- ..()
- cell = new /obj/item/stock_parts/cell/hyper(src)
+ default_cell_type = /obj/item/stock_parts/cell/bluespace
/mob/living/silicon/robot/deathsquad/init()
laws = new /datum/ai_laws/deathsquad
module = new /obj/item/robot_module/deathsquad(src)
-
aiCamera = new/obj/item/camera/siliconcam/robot_camera(src)
radio = new /obj/item/radio/borg/deathsquad(src)
radio.recalculateChannels()
-
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
-/mob/living/silicon/robot/combat
- base_icon = "droidcombat"
- icon_state = "droidcombat"
- modtype = "Combat"
- designation = "Combat"
+/mob/living/silicon/robot/deathsquad/bullet_act(var/obj/item/projectile/P)
+ if(istype(P) && P.is_reflectable && P.starting)
+ visible_message("The [P.name] gets reflected by [src]!", "The [P.name] gets reflected by [src]!")
+ P.reflect_back(src)
+ return -1
+ return ..(P)
-/mob/living/silicon/robot/combat/init()
- ..()
- module = new /obj/item/robot_module/combat(src)
- module.channels = list("Security" = 1)
- //languages
- module.add_languages(src)
- //subsystems
- module.add_subsystems_and_actions(src)
-
- status_flags &= ~CANPUSH
-
- radio.config(module.channels)
- notify_ai(2)
/mob/living/silicon/robot/ert
designation = "ERT"
@@ -1366,11 +1368,12 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
scrambledcodes = 1
req_one_access = list(ACCESS_CENT_SPECOPS)
ionpulse = 1
-
force_modules = list("Engineering", "Medical", "Security")
static_radio_channels = 1
allow_rename = FALSE
weapons_unlock = TRUE
+ default_cell_type = /obj/item/stock_parts/cell/super
+ var/eprefix = "Amber"
/mob/living/silicon/robot/ert/init()
@@ -1379,11 +1382,10 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
radio.recalculateChannels()
aiCamera = new/obj/item/camera/siliconcam/robot_camera(src)
-/mob/living/silicon/robot/ert/New(loc, cyborg_unlock)
+/mob/living/silicon/robot/ert/New(loc)
..(loc)
- cell = new /obj/item/stock_parts/cell/hyper(src)
var/rnum = rand(1,1000)
- var/borgname = "ERT [rnum]"
+ var/borgname = "[eprefix] ERT [rnum]"
name = borgname
custom_name = borgname
real_name = name
@@ -1392,22 +1394,63 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
mind.original = src
mind.assigned_role = SPECIAL_ROLE_ERT
mind.special_role = SPECIAL_ROLE_ERT
- if(cyborg_unlock)
- crisis = 1
if(!(mind in SSticker.minds))
SSticker.minds += mind
SSticker.mode.ert += mind
-/mob/living/silicon/robot/ert/gamma
- crisis = 1
-/mob/living/silicon/robot/emp_act(severity)
+/mob/living/silicon/robot/ert/red
+ eprefix = "Red"
+ default_cell_type = /obj/item/stock_parts/cell/hyper
+
+/mob/living/silicon/robot/ert/gamma
+ default_cell_type = /obj/item/stock_parts/cell/bluespace
+ force_modules = list("Combat", "Engineering", "Medical")
+ damage_protection = 5 // Reduce all incoming damage by this number
+ eprefix = "Gamma"
+ magpulse = 1
+ xeno_disarm_chance = 40
+
+
+/mob/living/silicon/robot/destroyer
+ // admin-only borg, the seraph / special ops officer of borgs
+ base_icon = "droidcombat"
+ icon_state = "droidcombat"
+ modtype = "Destroyer"
+ designation = "Destroyer"
+ lawupdate = 0
+ scrambledcodes = 1
+ req_one_access = list(ACCESS_CENT_SPECOPS)
+ ionpulse = 1
+ magpulse = 1
+ pdahide = 1
+ eye_protection = 2 // Immunity to flashes and the visual part of flashbangs
+ ear_protection = 1 // Immunity to the audio part of flashbangs
+ emp_protection = TRUE // Immunity to EMP, due to heavy shielding
+ damage_protection = 20 // Reduce all incoming damage by this number. Very high in the case of /destroyer borgs, since it is an admin-only borg.
+ xeno_disarm_chance = 10
+ default_cell_type = /obj/item/stock_parts/cell/bluespace
+
+/mob/living/silicon/robot/destroyer/init()
..()
- switch(severity)
- if(1)
- disable_component("comms", 160)
- if(2)
- disable_component("comms", 60)
+ module = new /obj/item/robot_module/destroyer(src)
+ module.add_languages(src)
+ module.add_subsystems_and_actions(src)
+ status_flags &= ~CANPUSH
+ if(radio)
+ qdel(radio)
+ radio = new /obj/item/radio/borg/ert/specops(src)
+ radio.recalculateChannels()
+
+/mob/living/silicon/robot/destroyer/borg_icons()
+ if(base_icon == "")
+ base_icon = icon_state
+ if(module_active && istype(module_active,/obj/item/borg/destroyer/mobility))
+ icon_state = "[base_icon]-roll"
+ else
+ icon_state = base_icon
+ overlays += "[base_icon]-shield"
+
/mob/living/silicon/robot/extinguish_light()
update_headlamp(1, 150)
diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm
index f4290d764d6..b7b81ed40b7 100644
--- a/code/modules/mob/living/silicon/robot/robot_damage.dm
+++ b/code/modules/mob/living/silicon/robot/robot_damage.dm
@@ -76,29 +76,6 @@
if(!LAZYLEN(components))
return
- //Combat shielding absorbs a percentage of damage directly into the cell.
- var/obj/item/borg/combat/shield/shield
- if(module_state_1 && istype(module_state_1, /obj/item/borg/combat/shield))
- shield = module_state_1
- else if(module_state_2 && istype(module_state_2, /obj/item/borg/combat/shield))
- shield = module_state_2
- else if(module_state_3 && istype(module_state_3, /obj/item/borg/combat/shield))
- shield = module_state_3
- if(shield)
- //Shields absorb a certain percentage of damage based on their power setting.
- var/absorb_brute = brute * shield.shield_level
- var/absorb_burn = burn * shield.shield_level
- var/cost = (absorb_brute+absorb_burn) * 100
-
- cell.charge -= cost
- if(cell.charge <= 0)
- cell.charge = 0
- to_chat(src, "Your shield has overloaded!")
- else
- brute -= absorb_brute
- burn -= absorb_burn
- to_chat(src, "Your shield absorbs some of the impact!")
-
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute, burn, sharp, updating_health)
@@ -127,32 +104,15 @@
updatehealth("heal overall damage")
/mob/living/silicon/robot/take_overall_damage(brute = 0, burn = 0, updating_health = TRUE, used_weapon = null, sharp = 0)
- if(status_flags & GODMODE) return //godmode
+ if(status_flags & GODMODE)
+ return
+
+ if(damage_protection)
+ brute = clamp(brute - damage_protection, 0, brute)
+ burn = clamp(burn - damage_protection, 0, burn)
+
var/list/datum/robot_component/parts = get_damageable_components()
- //Combat shielding absorbs a percentage of damage directly into the cell.
- var/obj/item/borg/combat/shield/shield
- if(module_state_1 && istype(module_state_1, /obj/item/borg/combat/shield))
- shield = module_state_1
- else if(module_state_2 && istype(module_state_2, /obj/item/borg/combat/shield))
- shield = module_state_2
- else if(module_state_3 && istype(module_state_3, /obj/item/borg/combat/shield))
- shield = module_state_3
- if(shield)
- //Shields absorb a certain percentage of damage based on their power setting.
- var/absorb_brute = brute * shield.shield_level
- var/absorb_burn = burn * shield.shield_level
- var/cost = (absorb_brute+absorb_burn) * 100
-
- cell.charge -= cost
- if(cell.charge <= 0)
- cell.charge = 0
- to_chat(src, "Your shield has overloaded!")
- else
- brute -= absorb_brute
- burn -= absorb_burn
- to_chat(src, "Your shield absorbs some of the impact!")
-
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute, burn, sharp)
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
index 9b4f1089f46..8445a399582 100644
--- a/code/modules/mob/living/silicon/robot/robot_defense.dm
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -2,7 +2,7 @@
if(M.a_intent == INTENT_DISARM)
if(!lying)
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
- if(prob(85))
+ if(prob(xeno_disarm_chance))
Stun(7)
step(src, get_dir(M,src))
spawn(5)
diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm
index 92115986b2e..b1abb49d2ef 100644
--- a/code/modules/mob/living/silicon/robot/robot_items.dm
+++ b/code/modules/mob/living/silicon/robot/robot_items.dm
@@ -73,24 +73,7 @@
/obj/item/borg
var/powerneeded // Percentage of power remaining required to run item
-/obj/item/borg/combat/shield
- name = "personal shielding"
- desc = "A powerful experimental module that turns aside or absorbs incoming attacks at the cost of charge."
- icon = 'icons/obj/decals.dmi'
- icon_state = "shock"
- powerneeded = 25
- var/shield_level = 0.5 //Percentage of damage absorbed by the shield.
-
-/obj/item/borg/combat/shield/verb/set_shield_level()
- set name = "Set shield level"
- set category = "Object"
- set src in range(0)
-
- var/N = input("How much damage should the shield absorb?") in list("5","10","25","50","75","100")
- if(N)
- shield_level = text2num(N)/100
-
-/obj/item/borg/combat/mobility
+/obj/item/borg/destroyer/mobility
name = "mobility module"
desc = "By retracting limbs and tucking in its head, a combat android can roll at high speeds."
icon = 'icons/obj/decals.dmi'
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index 3260775c674..c6dac721d27 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -118,20 +118,48 @@
return
/obj/item/robot_module/standard
- name = "standard robot module"
+ // if station is fine, assist with constructing station goal room, cleaning, and repairing cables chewed by rats
+ // if medical crisis, assist by providing basic healthcare, retrieving corpses, and monitoring crew lifesigns
+ // if eng crisis, assist by helping repair hull breaches
+ // if sec crisis, assist by opening doors for sec and providing a backup stunbaton on patrols
+ name = "generalist robot module"
module_type = "Standard"
+ subsystems = list(/mob/living/silicon/proc/subsystem_power_monitor, /mob/living/silicon/proc/subsystem_crew_monitor)
+ stacktypes = list(
+ /obj/item/stack/sheet/metal/cyborg = 50,
+ /obj/item/stack/cable_coil/cyborg = 50,
+ /obj/item/stack/rods/cyborg = 60,
+ /obj/item/stack/tile/plasteel = 20
+ )
/obj/item/robot_module/standard/New()
..()
- modules += new /obj/item/melee/baton/loaded(src)
- modules += new /obj/item/extinguisher(src)
- modules += new /obj/item/wrench/cyborg(src)
+ // sec
+ modules += new /obj/item/restraints/handcuffs/cable/zipties(src)
+ // janitorial
+ modules += new /obj/item/soap/nanotrasen(src)
+ modules += new /obj/item/lightreplacer/cyborg(src)
+ // eng
modules += new /obj/item/crowbar/cyborg(src)
+ modules += new /obj/item/wrench/cyborg(src)
+ modules += new /obj/item/extinguisher(src) // for firefighting, and propulsion in space
+ modules += new /obj/item/weldingtool/largetank/cyborg(src)
+ // mining
+ modules += new /obj/item/pickaxe(src)
+ modules += new /obj/item/t_scanner/adv_mining_scanner(src)
+ modules += new /obj/item/storage/bag/ore/cyborg(src)
+ // med
modules += new /obj/item/healthanalyzer(src)
+ modules += new /obj/item/reagent_containers/borghypo/basic(src)
+ modules += new /obj/item/roller_holder(src) // for taking the injured to medbay without worsening their injuries or leaving a blood trail the whole way
emag = new /obj/item/melee/energy/sword/cyborg(src)
-
+ for(var/G in stacktypes)
+ var/obj/item/stack/sheet/M = new G(src)
+ M.amount = stacktypes[G]
+ modules += M
fix_modules()
+
/obj/item/robot_module/medical
name = "medical robot module"
module_type = "Medical"
@@ -259,6 +287,7 @@
modules += new /obj/item/mop/advanced/cyborg(src)
modules += new /obj/item/lightreplacer/cyborg(src)
modules += new /obj/item/holosign_creator(src)
+ modules += new /obj/item/extinguisher/mini(src)
emag = new /obj/item/reagent_containers/spray(src)
emag.reagents.add_reagent("lube", 250)
@@ -483,25 +512,44 @@
fix_modules()
-/obj/item/robot_module/combat
- name = "combat robot module"
+/obj/item/robot_module/destroyer
+ name = "destroyer robot module"
module_type = "Malf"
module_actions = list(
/datum/action/innate/robot_sight/thermal,
)
+/obj/item/robot_module/destroyer/New()
+ ..()
+
+ modules += new /obj/item/gun/energy/immolator/multi/cyborg(src) // See comments on /robot_module/combat below
+ modules += new /obj/item/melee/baton/loaded(src) // secondary weapon, for things immune to burn, immune to ranged weapons, or for arresting low-grade threats
+ modules += new /obj/item/restraints/handcuffs/cable/zipties/cyborg(src)
+ modules += new /obj/item/pickaxe/drill/jackhammer(src) // for breaking walls to execute flanking moves
+ modules += new /obj/item/borg/destroyer/mobility(src)
+ emag = null
+ fix_modules()
+
+
+/obj/item/robot_module/combat
+ name = "combat robot module"
+ module_type = "Malf"
+ module_actions = list()
+
/obj/item/robot_module/combat/New()
..()
+ modules += new /obj/item/gun/energy/immolator/multi/cyborg(src) // primary weapon, strong at close range (ie: against blob/terror/xeno), but consumes a lot of energy per shot.
+ // Borg gets 40 shots of this weapon. Gamma Sec ERT gets 10.
+ // So, borg has way more burst damage, but also takes way longer to recharge / get back in the fight once depleted. Has to find a borg recharger and sit in it for ages.
+ // Organic gamma sec ERT carries alternate weapons, including a box of flashbangs, and can load up on a huge number of guns from science. Borg cannot do either.
+ // Overall, gamma borg has higher skill floor but lower skill ceiling.
+ modules += new /obj/item/melee/baton/loaded(src) // secondary weapon, for things immune to burn, immune to ranged weapons, or for arresting low-grade threats
modules += new /obj/item/restraints/handcuffs/cable/zipties/cyborg(src)
- modules += new /obj/item/gun/energy/gun/cyborg(src)
- modules += new /obj/item/pickaxe/drill/jackhammer(src)
- modules += new /obj/item/borg/combat/shield(src)
- modules += new /obj/item/borg/combat/mobility(src)
- modules += new /obj/item/wrench/cyborg(src)
- emag = new /obj/item/gun/energy/lasercannon/cyborg(src)
-
+ modules += new /obj/item/pickaxe/drill/jackhammer(src) // for breaking walls to execute flanking moves
+ emag = null
fix_modules()
+
/obj/item/robot_module/alien/hunter
name = "alien hunter module"
module_type = "Standard"
diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm
index 4b645b02849..1d3e1cade6d 100644
--- a/code/modules/mob/living/silicon/robot/robot_movement.dm
+++ b/code/modules/mob/living/silicon/robot/robot_movement.dm
@@ -9,7 +9,7 @@
/mob/living/silicon/robot/movement_delay()
. = ..()
. += speed
- if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
+ if(module_active && istype(module_active,/obj/item/borg/destroyer/mobility))
. -= 3
. += config.robot_delay
diff --git a/code/modules/mob/living/silicon/robot/syndicate.dm b/code/modules/mob/living/silicon/robot/syndicate.dm
index f5ac3e5532b..98afb8285d1 100644
--- a/code/modules/mob/living/silicon/robot/syndicate.dm
+++ b/code/modules/mob/living/silicon/robot/syndicate.dm
@@ -5,6 +5,7 @@
scrambledcodes = 1
pdahide = 1
faction = list("syndicate")
+ bubble_icon = "syndibot"
designation = "Syndicate Assault"
modtype = "Syndicate"
req_access = list(ACCESS_SYNDICATE)
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index 6457afc87d4..c923e0912b7 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -2,7 +2,9 @@
gender = NEUTER
robot_talk_understand = 1
voice_name = "synthesized voice"
+ bubble_icon = "machine"
has_unlimited_silicon_privilege = 1
+ weather_immunities = list("ash")
var/syndicate = 0
var/const/MAIN_CHANNEL = "Main Frequency"
var/lawchannel = MAIN_CHANNEL // Default channel on which to state laws
@@ -283,7 +285,7 @@
/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised)
if(!next_alarm_notice)
- next_alarm_notice = world.time + SecondsToTicks(10)
+ next_alarm_notice = world.time + 10 SECONDS
var/list/alarms = queued_alarms[alarm_handler]
if(was_raised)
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index 962b4722f39..5c5300a2579 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -18,7 +18,7 @@
speak_emote = list("states")
friendly = "boops"
-
+ bubble_icon = "machine"
faction = list("neutral", "silicon")
var/obj/machinery/bot_core/bot_core = null
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 728b050dd54..f1278918898 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -323,13 +323,13 @@
/mob/living/simple_animal/bot/mulebot/proc/buzz(type)
switch(type)
if(SIGH)
- audible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.")
+ audible_message("[src] makes a sighing buzz.")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
if(ANNOYED)
- audible_message("[src] makes an annoyed buzzing sound.", "You hear an electronic buzzing sound.")
+ audible_message("[src] makes an annoyed buzzing sound.")
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
if(DELIGHT)
- audible_message("[src] makes a delighted ping!", "You hear a ping.")
+ audible_message("[src] makes a delighted ping!")
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
@@ -601,7 +601,7 @@
/mob/living/simple_animal/bot/mulebot/proc/at_target()
if(!reached_target)
radio_channel = "Supply" //Supply channel
- audible_message("[src] makes a chiming sound!", "You hear a chime.")
+ audible_message("[src] makes a chiming sound!")
playsound(loc, 'sound/machines/chime.ogg', 50, 0)
reached_target = 1
diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm
index 6ba69de6a61..fdcbf95216b 100644
--- a/code/modules/mob/living/simple_animal/damage_procs.dm
+++ b/code/modules/mob/living/simple_animal/damage_procs.dm
@@ -3,7 +3,7 @@
if(status_flags & GODMODE)
return FALSE
var/oldbruteloss = bruteloss
- bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
+ bruteloss = clamp(bruteloss + amount, 0, maxHealth)
if(oldbruteloss == bruteloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm
index 4b29e703116..07a21af8a0b 100644
--- a/code/modules/mob/living/simple_animal/friendly/dog.dm
+++ b/code/modules/mob/living/simple_animal/friendly/dog.dm
@@ -153,16 +153,16 @@
if(def_zone)
if(def_zone == "head")
if(inventory_head)
- armorval = inventory_head.armor[type]
+ armorval = inventory_head.armor.getRating(type)
else
if(inventory_back)
- armorval = inventory_back.armor[type]
+ armorval = inventory_back.armor.getRating(type)
return armorval
else
if(inventory_head)
- armorval += inventory_head.armor[type]
+ armorval += inventory_head.armor.getRating(type)
if(inventory_back)
- armorval += inventory_back.armor[type]
+ armorval += inventory_back.armor.getRating(type)
return armorval * 0.5
/mob/living/simple_animal/pet/dog/corgi/attackby(obj/item/O, mob/user, params)
diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm
index 038b3b3d221..7c7b4dd6a2f 100644
--- a/code/modules/mob/living/simple_animal/hostile/alien.dm
+++ b/code/modules/mob/living/simple_animal/hostile/alien.dm
@@ -20,6 +20,7 @@
melee_damage_upper = 25
attacktext = "slashes"
speak_emote = list("hisses")
+ bubble_icon = "alien"
a_intent = INTENT_HARM
attack_sound = 'sound/weapons/bladeslice.ogg'
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
@@ -127,6 +128,7 @@
icon_state = "queen_s"
icon_living = "queen_s"
icon_dead = "queen_dead"
+ bubble_icon = "alienroyal"
move_to_delay = 4
maxHealth = 400
health = 400
@@ -153,7 +155,7 @@
icon_dead = "maid_dead"
/mob/living/simple_animal/hostile/alien/maid/AttackingTarget()
- if(ismovableatom(target))
+ if(ismovable(target))
if(istype(target, /obj/effect/decal/cleanable))
visible_message("\The [src] cleans up \the [target].")
qdel(target)
diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm
index 8d2ba52709f..ced4a61d8c5 100644
--- a/code/modules/mob/living/simple_animal/hostile/headcrab.dm
+++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm
@@ -62,8 +62,8 @@
is_zombie = TRUE
if(H.wear_suit)
var/obj/item/clothing/suit/armor/A = H.wear_suit
- if(A.armor && A.armor["melee"])
- maxHealth += A.armor["melee"] //That zombie's got armor, I want armor!
+ if(A.armor && A.armor.getRating("melee"))
+ maxHealth += A.armor.getRating("melee") //That zombie's got armor, I want armor!
maxHealth += 200
health = maxHealth
name = "zombie"
diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm
index d2a97949c8e..c6f3ac845e3 100644
--- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm
+++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm
@@ -25,6 +25,7 @@
gold_core_spawnable = HOSTILE_SPAWN
loot = list(/obj/effect/decal/cleanable/blood/gibs/robot)
deathmessage = "blows apart!"
+ bubble_icon = "machine"
del_on_death = 1
/mob/living/simple_animal/hostile/hivebot/range
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
index c9139ea7bfd..469ff0cc7e1 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm
@@ -116,8 +116,8 @@ Difficulty: Hard
if(charging)
return
- anger_modifier = Clamp(((maxHealth - health)/60),0,20)
- enrage_time = initial(enrage_time) * Clamp(anger_modifier / 20, 0.5, 1)
+ anger_modifier = clamp(((maxHealth - health)/60),0,20)
+ enrage_time = initial(enrage_time) * clamp(anger_modifier / 20, 0.5, 1)
ranged_cooldown = world.time + 50
if(client)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index 7f1b3942d94..b8c72d7cf84 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -83,7 +83,7 @@ Difficulty: Very Hard
chosen_attack_num = 4
/mob/living/simple_animal/hostile/megafauna/colossus/OpenFire()
- anger_modifier = Clamp(((maxHealth - health)/50),0,20)
+ anger_modifier = clamp(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + 120
if(client)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
index e97b7671b67..6dca834169b 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
@@ -103,7 +103,7 @@ Difficulty: Medium
if(swooping)
return
- anger_modifier = Clamp(((maxHealth - health)/50),0,20)
+ anger_modifier = clamp(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + ranged_cooldown_time
if(client)
@@ -254,7 +254,7 @@ Difficulty: Medium
/mob/living/simple_animal/hostile/megafauna/dragon/proc/line_target(var/offset, var/range, var/atom/at = target)
if(!at)
return
- var/angle = Atan2(at.x - src.x, at.y - src.y) + offset
+ var/angle = ATAN2(at.x - src.x, at.y - src.y) + offset
var/turf/T = get_turf(src)
for(var/i in 1 to range)
var/turf/check = locate(src.x + cos(angle) * i, src.y + sin(angle) * i, src.z)
@@ -344,10 +344,10 @@ Difficulty: Medium
//ensure swoop direction continuity.
if(negative)
- if(IsInRange(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
+ if(ISINRANGE(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
negative = FALSE
else
- if(IsInRange(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
+ if(ISINRANGE(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
negative = TRUE
new /obj/effect/temp_visual/dragon_flight/end(loc, negative)
new /obj/effect/temp_visual/dragon_swoop(loc)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
index a4a3481d61b..65d056188a8 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
@@ -482,7 +482,7 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/calculate_rage() //how angry we are overall
did_reset = FALSE //oh hey we're doing SOMETHING, clearly we might need to heal if we recall
- anger_modifier = Clamp(((maxHealth - health) / 42),0,50)
+ anger_modifier = clamp(((maxHealth - health) / 42),0,50)
burst_range = initial(burst_range) + round(anger_modifier * 0.08)
beam_range = initial(beam_range) + round(anger_modifier * 0.12)
diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
index 6f40dfe2a3f..7ebddfeec12 100644
--- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm
+++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
@@ -363,6 +363,7 @@
minbodytemp = 0
mob_size = MOB_SIZE_TINY
flying = 1
+ bubble_icon = "syndibot"
gold_core_spawnable = HOSTILE_SPAWN
del_on_death = 1
deathmessage = "is smashed into pieces!"
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm
index 241cceb3d2c..bf3c98bb86a 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm
@@ -168,7 +168,7 @@
neststep = 4
else
spider_lastspawn = world.time
- var/spiders_left_to_spawn = Clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
+ var/spiders_left_to_spawn = clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
DoLayTerrorEggs(pick(spider_types_standard), spiders_left_to_spawn)
if(4)
// Nest should be full. Otherwise, start replenishing nest (stage 5).
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index ada8ed9896b..7d31b5d523b 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -144,7 +144,7 @@
/mob/living/simple_animal/updatehealth(reason = "none given")
..(reason)
- health = Clamp(health, 0, maxHealth)
+ health = clamp(health, 0, maxHealth)
med_hud_set_health()
/mob/living/simple_animal/StartResting(updating = 1)
diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm
index bd9d001f12f..3f978abbfbb 100644
--- a/code/modules/mob/living/simple_animal/slime/powers.dm
+++ b/code/modules/mob/living/simple_animal/slime/powers.dm
@@ -190,7 +190,7 @@
step_away(M,src)
M.Friends = Friends.Copy()
babies += M
- M.mutation_chance = Clamp(mutation_chance+(rand(5,-5)),0,100)
+ M.mutation_chance = clamp(mutation_chance+(rand(5,-5)),0,100)
feedback_add_details("slime_babies_born", "slimebirth_[replacetext(M.colour," ","_")]")
var/mob/living/simple_animal/slime/new_slime = pick(babies)
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index 8c7d14b23f4..15f483bef76 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -17,6 +17,7 @@
response_harm = "stomps on"
emote_see = list("jiggles", "bounces in place")
speak_emote = list("blorbles")
+ bubble_icon = "slime"
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index a4a94130eea..3a47427cdf7 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -127,14 +127,12 @@
// self_message (optional) is what the src mob hears.
// deaf_message (optional) is what deaf people will see.
// hearing_distance (optional) is the range, how many tiles away the message can be heard.
-/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message)
+/mob/audible_message(message, deaf_message, hearing_distance)
var/range = 7
if(hearing_distance)
range = hearing_distance
var/msg = message
for(var/mob/M in get_mobs_in_view(range, src))
- if(self_message && M == src)
- msg = self_message
M.show_message(msg, 2, deaf_message, 1)
// based on say code
@@ -156,12 +154,12 @@
// message is the message output to anyone who can hear.
// deaf_message (optional) is what deaf people will see.
// hearing_distance (optional) is the range, how many tiles away the message can be heard.
-/atom/proc/audible_message(var/message, var/deaf_message, var/hearing_distance)
+/atom/proc/audible_message(message, deaf_message, hearing_distance)
var/range = 7
if(hearing_distance)
range = hearing_distance
for(var/mob/M in get_mobs_in_view(range, src))
- M.show_message( message, 2, deaf_message, 1)
+ M.show_message(message, 2, deaf_message, 1)
/mob/proc/findname(msg)
for(var/mob/M in GLOB.mob_list)
diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm
index f595f6b4839..640ffb09d4f 100644
--- a/code/modules/mob/mob_grab.dm
+++ b/code/modules/mob/mob_grab.dm
@@ -53,12 +53,11 @@
hud.master = src
//check if assailant is grabbed by victim as well
- if(assailant.grabbed_by)
- for(var/obj/item/grab/G in assailant.grabbed_by)
- if(G.assailant == affecting && G.affecting == assailant)
- G.dancing = 1
- G.adjust_position()
- dancing = 1
+ for(var/obj/item/grab/G in assailant.grabbed_by)
+ if(G.assailant == affecting && G.affecting == assailant)
+ G.dancing = 1
+ G.adjust_position()
+ dancing = 1
clean_grabbed_by(assailant, affecting)
adjust_position()
@@ -276,7 +275,7 @@
assailant.visible_message("[assailant] has reinforced [assailant.p_their()] grip on [affecting] (now neck)!")
state = GRAB_NECK
icon_state = "grabbed+1"
- assailant.setDir(get_dir(assailant, affecting))
+
add_attack_logs(assailant, affecting, "Neck grabbed", ATKLOG_ALL)
if(!iscarbon(assailant))
affecting.LAssailant = null
@@ -296,7 +295,7 @@
assailant.next_move = world.time + 10
if(!affecting.get_organ_slot("breathing_tube"))
affecting.AdjustLoseBreath(1)
- affecting.setDir(WEST)
+
adjust_position()
//This is used to make sure the victim hasn't managed to yackety sax away before using the grab.
@@ -433,9 +432,10 @@
/obj/item/grab/Destroy()
if(affecting)
- affecting.pixel_x = 0
- affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
- affecting.layer = initial(affecting.layer)
+ if(!affecting.buckled)
+ affecting.pixel_x = 0
+ affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
+ affecting.layer = initial(affecting.layer)
affecting.grabbed_by -= src
affecting = null
if(assailant)
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 471ddc42557..4797c685fe1 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -26,25 +26,6 @@
else
to_chat(usr, "This mob type cannot throw items.")
-
-/client/verb/drop_item()
- set hidden = 1
- if(!isrobot(mob))
- mob.drop_item_v()
- return
-
-
-/* /client/Center()
- /* No 3D movement in 2D spessman game. dir 16 is Z Up
- if(isobj(mob.loc))
- var/obj/O = mob.loc
- if(mob.canmove)
- return O.relaymove(mob, 16)
- */
- return
- */
-
-
/client/proc/Move_object(direct)
if(mob && mob.control_object)
if(mob.control_object.density)
@@ -186,7 +167,7 @@
if(newdir)
direct = newdir
n = get_step(mob, direct)
-
+
. = mob.SelfMove(n, direct, delay)
mob.setDir(direct)
diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm
index 81d22e40a0b..0417e28f546 100644
--- a/code/modules/mob/say.dm
+++ b/code/modules/mob/say.dm
@@ -114,7 +114,7 @@
return get_turf(src)
-/mob/proc/say_test(var/text)
+/proc/say_test(text)
var/ending = copytext(text, length(text))
if(ending == "?")
return "1"
diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm
index b61ce171194..3a053e74e16 100644
--- a/code/modules/mob/status_procs.dm
+++ b/code/modules/mob/status_procs.dm
@@ -207,4 +207,4 @@
/mob/proc/adjust_bodytemperature(amount, min_temp = 0, max_temp = INFINITY)
if(bodytemperature >= min_temp && bodytemperature <= max_temp)
- bodytemperature = Clamp(bodytemperature + amount, min_temp, max_temp)
+ bodytemperature = clamp(bodytemperature + amount, min_temp, max_temp)
diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm
index 4dfbddc2d84..a2ca226147c 100644
--- a/code/modules/mob/typing_indicator.dm
+++ b/code/modules/mob/typing_indicator.dm
@@ -5,31 +5,32 @@ mob/var/typing
mob/var/last_typed
mob/var/last_typed_time
-GLOBAL_DATUM(typing_indicator, /image)
+GLOBAL_LIST_EMPTY(typing_indicator)
-/mob/proc/set_typing_indicator(var/state)
+/mob/proc/set_typing_indicator(state)
- if(!GLOB.typing_indicator)
- GLOB.typing_indicator = image('icons/mob/talk.dmi', null, "typing", MOB_LAYER + 1)
- GLOB.typing_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
+ if(!GLOB.typing_indicator[bubble_icon])
+ GLOB.typing_indicator[bubble_icon] = image('icons/mob/talk.dmi', null, "[bubble_icon]typing", FLY_LAYER)
+ var/image/I = GLOB.typing_indicator[bubble_icon]
+ I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
if(ishuman(src))
var/mob/living/carbon/human/H = src
if((MUTE in H.mutations) || H.silent)
- overlays -= GLOB.typing_indicator
+ overlays -= GLOB.typing_indicator[bubble_icon]
return
if(client)
if((client.prefs.toggles & SHOW_TYPING) || stat != CONSCIOUS || is_muzzled())
- overlays -= GLOB.typing_indicator
+ overlays -= GLOB.typing_indicator[bubble_icon]
else
if(state)
if(!typing)
- overlays += GLOB.typing_indicator
+ overlays += GLOB.typing_indicator[bubble_icon]
typing = 1
else
if(typing)
- overlays -= GLOB.typing_indicator
+ overlays -= GLOB.typing_indicator[bubble_icon]
typing = 0
return state
diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm
index f2423e57c2f..64850ea954d 100644
--- a/code/modules/nano/modules/law_manager.dm
+++ b/code/modules/nano/modules/law_manager.dm
@@ -99,7 +99,7 @@
if(href_list["change_supplied_law_position"])
var/new_position = input(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position) as num|null
if(isnum(new_position) && can_still_topic())
- supplied_law_position = Clamp(new_position, 1, MAX_SUPPLIED_LAW_NUMBER)
+ supplied_law_position = clamp(new_position, 1, MAX_SUPPLIED_LAW_NUMBER)
return 1
if(href_list["edit_law"])
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 5ca53396253..d5cbbdc0ad6 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -340,7 +340,7 @@
return 0
else
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
- atom_say("Attention: Posterior Placed on Printing Plaque!")
+ atom_say("Attention: Posterior Placed on Printing Plaque!")
return 1
/obj/machinery/photocopier/emag_act(user as mob)
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 1134f7a0752..0cb571d576c 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -237,7 +237,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
if(A.invisibility)
if(see_ghosts && istype(A,/mob/dead/observer))
var/mob/dead/observer/O = A
- if(O.following)
+ if(O.orbiting)
continue
if(user.mind && !(user.mind.assigned_role == "Chaplain"))
atoms.Add(image('icons/mob/mob.dmi', O.loc, pick(GLOB.SpookyGhosts), 4, SOUTH))
@@ -297,7 +297,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
if(M.invisibility)
if(see_ghosts && istype(M,/mob/dead/observer))
var/mob/dead/observer/O = M
- if(O.following)
+ if(O.orbiting)
continue
if(!mob_detail)
mob_detail = "You can see a g-g-g-g-ghooooost! "
@@ -562,13 +562,13 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
talk_into(M, msg)
for(var/obj/machinery/computer/security/telescreen/T in GLOB.machines)
if(T.watchers[M] == camera)
- T.audible_message("(Newscaster) [M] says, '[msg]'", hearing_distance = 2)
+ T.atom_say(msg)
/obj/item/videocam/hear_message(mob/M as mob, msg)
if(camera && on)
for(var/obj/machinery/computer/security/telescreen/T in GLOB.machines)
if(T.watchers[M] == camera)
- T.audible_message("(Newscaster) [M] [msg]", hearing_distance = 2)
+ T.atom_say(msg)
///hauntings, like hallucinations but more spooky
diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm
index 6c03241a096..d47f4184daf 100644
--- a/code/modules/pda/cart_apps.dm
+++ b/code/modules/pda/cart_apps.dm
@@ -366,6 +366,7 @@
JaniData["user_loc"] = list("x" = cl.x, "y" = cl.y)
else
JaniData["user_loc"] = list("x" = 0, "y" = 0)
+
var/MopData[0]
for(var/obj/item/mop/M in GLOB.janitorial_equipment)
var/turf/ml = get_turf(M)
@@ -375,10 +376,6 @@
var/direction = get_dir(pda, M)
MopData[++MopData.len] = list ("x" = ml.x, "y" = ml.y, "dir" = uppertext(dir2text(direction)), "status" = M.reagents.total_volume ? "Wet" : "Dry")
- if(!MopData.len)
- MopData[++MopData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
-
-
var/BucketData[0]
for(var/obj/structure/mopbucket/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
@@ -386,13 +383,10 @@
if(bl.z != cl.z)
continue
var/direction = get_dir(pda,B)
- BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
-
- if(!BucketData.len)
- BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
+ BucketData[++BucketData.len] = list ("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "volume" = B.reagents.total_volume, "max_volume" = B.reagents.maximum_volume)
var/CbotData[0]
- for(var/mob/living/simple_animal/bot/cleanbot/B in GLOB.simple_animals)
+ for(var/mob/living/simple_animal/bot/cleanbot/B in GLOB.bots_list)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)
@@ -400,9 +394,6 @@
var/direction = get_dir(pda,B)
CbotData[++CbotData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.on ? "Online" : "Offline")
-
- if(!CbotData.len)
- CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CartData[0]
for(var/obj/structure/janitorialcart/B in GLOB.janitorial_equipment)
var/turf/bl = get_turf(B)
@@ -410,12 +401,10 @@
if(bl.z != cl.z)
continue
var/direction = get_dir(pda,B)
- CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
- if(!CartData.len)
- CartData[++CartData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
+ CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "volume" = B.reagents.total_volume, "max_volume" = B.reagents.maximum_volume)
- JaniData["mops"] = MopData
- JaniData["buckets"] = BucketData
- JaniData["cleanbots"] = CbotData
- JaniData["carts"] = CartData
+ JaniData["mops"] = MopData.len ? MopData : null
+ JaniData["buckets"] = BucketData.len ? BucketData : null
+ JaniData["cleanbots"] = CbotData.len ? CbotData : null
+ JaniData["carts"] = CartData.len ? CartData : null
data["janitor"] = JaniData
diff --git a/code/modules/pda/mob_hunt_game_app.dm b/code/modules/pda/mob_hunt_game_app.dm
index c48ebdd4e9e..c72aa6d0d41 100644
--- a/code/modules/pda/mob_hunt_game_app.dm
+++ b/code/modules/pda/mob_hunt_game_app.dm
@@ -47,7 +47,7 @@
SSmob_hunt.connected_clients += src
connected = 1
if(pda)
- pda.audible_message("[bicon(pda)] Connection established. Capture all of the mobs, [pda.owner ? pda.owner : "hunter"]!", null, 2)
+ pda.atom_say("Connection established. Capture all of the mobs, [pda.owner ? pda.owner : "hunter"]!")
return 1
/datum/data/pda/app/mob_hunter_game/proc/get_player()
@@ -67,7 +67,7 @@
connected = 0
//show a disconnect message if we were disconnected involuntarily (reason argument provided)
if(pda && reason)
- pda.audible_message("[bicon(pda)] Disconnected from server. Reason: [reason].", null, 2)
+ pda.atom_say("Disconnected from server. Reason: [reason].")
/datum/data/pda/app/mob_hunter_game/program_process()
if(!SSmob_hunt || !connected)
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 234b885284e..f613f34a8fd 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -147,7 +147,7 @@
if(terminal)
terminal.connect_to_network()
-/obj/machinery/power/apc/New(turf/loc, ndir, building = 0)
+/obj/machinery/power/apc/New(turf/loc, direction, building = 0)
if(!armor)
armor = list("melee" = 20, "bullet" = 20, "laser" = 10, "energy" = 100, "bomb" = 30, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50)
..()
@@ -158,12 +158,11 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if(building)
- setDir(ndir)
- tdir = dir // to fix Vars bug
- setDir(SOUTH)
+ setDir(direction) // We set this to direction only for pixel location determination.
+
+ set_pixel_offsets_from_dir(24, -24, 24, -24) // Set pixel offsets based on `dir`
+ setDir(SOUTH) // APC's should always appear to *face* south.
- pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24)
- pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0
if(building)
area = get_area(src)
area.apc |= src
@@ -177,7 +176,7 @@
/obj/machinery/power/apc/Destroy()
GLOB.apcs -= src
if(malfai && operating)
- malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
+ malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000)
area.power_light = 0
area.power_equip = 0
area.power_environ = 0
@@ -545,7 +544,7 @@
/obj/machinery/power/apc/crowbar_act(mob/living/user, obj/item/I)
. = TRUE
- if(!I.tool_start_check(user, 0))
+ if(!I.tool_start_check(src, user, 0))
return
if(opened) // a) on open apc
if(has_electronics==1)
@@ -1333,7 +1332,7 @@
/obj/machinery/power/apc/proc/set_broken()
if(malfai && operating)
- malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
+ malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000)
stat |= BROKEN
operating = 0
if(occupier)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 0dc2fe0a129..b6c65d979cf 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -125,7 +125,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/proc/surplus()
if(powernet)
- return Clamp(powernet.avail-powernet.load, 0, powernet.avail)
+ return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
@@ -141,7 +141,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/proc/delayed_surplus()
if(powernet)
- return Clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
+ return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index 24f55d34454..b92b456890f 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -160,7 +160,7 @@
/obj/item/stock_parts/cell/proc/get_electrocute_damage()
if(charge >= 1000)
- return Clamp(20 + round(charge / 25000), 20, 195) + rand(-5, 5)
+ return clamp(20 + round(charge / 25000), 20, 195) + rand(-5, 5)
else
return 0
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index b4cc25bf390..ff4074d045e 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -42,7 +42,7 @@
/obj/machinery/power/proc/surplus()
if(powernet)
- return Clamp(powernet.avail-powernet.load, 0, powernet.avail)
+ return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
@@ -58,7 +58,7 @@
/obj/machinery/power/proc/delayed_surplus()
if(powernet)
- return Clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
+ return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm
index a4ab64a2099..f73498cff2c 100644
--- a/code/modules/power/powernet.dm
+++ b/code/modules/power/powernet.dm
@@ -97,6 +97,6 @@
/datum/powernet/proc/get_electrocute_damage()
if(avail >= 1000)
- return Clamp(20 + round(avail / 25000), 20, 195) + rand(-5, 5)
+ return clamp(20 + round(avail / 25000), 20, 195) + rand(-5, 5)
else
return 0
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index f1a7f130592..b8ba53ae432 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -24,6 +24,7 @@
wires = new(src)
connected_parts = list()
update_icon()
+ use_log = list()
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm
index 7e1d4f59267..d3f5f76303c 100644
--- a/code/modules/power/supermatter/supermatter.dm
+++ b/code/modules/power/supermatter/supermatter.dm
@@ -218,7 +218,7 @@
damage = max(0, damage + between(-DAMAGE_RATE_LIMIT, (removed.temperature - CRITICAL_TEMPERATURE) / 150, damage_inc_limit))
//Maxes out at 100% oxygen pressure
- oxygen = Clamp((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / removed.total_moles(), 0, 1)
+ oxygen = clamp((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / removed.total_moles(), 0, 1)
var/temp_factor
var/equilibrium_power
diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm
index 60b2a30dc34..d9b20c9d075 100644
--- a/code/modules/power/tesla/energy_ball.dm
+++ b/code/modules/power/tesla/energy_ball.dm
@@ -51,7 +51,7 @@
pixel_x = -32
pixel_y = -32
for(var/ball in orbiting_balls)
- var/range = rand(1, Clamp(orbiting_balls.len, 3, 7))
+ var/range = rand(1, clamp(orbiting_balls.len, 3, 7))
tesla_zap(ball, range, TESLA_MINI_POWER/7*range, TRUE)
else
energy = 0 // ensure we dont have miniballs of miniballs
@@ -271,7 +271,7 @@
closest_grounding_rod.tesla_act(power, explosive)
else if(closest_mob)
- var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5, 5)
+ var/shock_damage = clamp(round(power/400), 10, 90) + rand(-5, 5)
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = TRUE)
if(issilicon(closest_mob))
var/mob/living/silicon/S = closest_mob
diff --git a/code/modules/power/treadmill.dm b/code/modules/power/treadmill.dm
index 39c5d732128..6fd72d0ae9c 100644
--- a/code/modules/power/treadmill.dm
+++ b/code/modules/power/treadmill.dm
@@ -50,7 +50,7 @@
update_icon()
return
- speed = Clamp(speed - friction, 0, MAX_SPEED)
+ speed = clamp(speed - friction, 0, MAX_SPEED)
for(var/A in (loc.contents - src))
var/atom/movable/AM = A
if(AM.anchored)
diff --git a/code/modules/projectiles/ammunition/energy.dm b/code/modules/projectiles/ammunition/energy.dm
index e0eb509aa9d..bcadfc62e08 100644
--- a/code/modules/projectiles/ammunition/energy.dm
+++ b/code/modules/projectiles/ammunition/energy.dm
@@ -12,7 +12,7 @@
select_name = "kill"
/obj/item/ammo_casing/energy/laser/cyborg //to balance cyborg energy cost seperately
- e_cost = 250
+ e_cost = 250
/obj/item/ammo_casing/energy/lasergun
projectile_type = /obj/item/projectile/beam/laser
@@ -75,6 +75,10 @@
e_cost = 125
select_name = "precise"
+/obj/item/ammo_casing/energy/immolator/strong/cyborg
+ // Used by gamma ERT borgs
+ e_cost = 1000 // 5x that of the standard laser, for 2.25x the damage (if 1/1 shots hit) plus ignite. Not energy-efficient, but can be used for sniping.
+
/obj/item/ammo_casing/energy/immolator/scatter
projectile_type = /obj/item/projectile/beam/immolator/weak
e_cost = 125
@@ -82,6 +86,10 @@
variance = 25
select_name = "scatter"
+/obj/item/ammo_casing/energy/immolator/scatter/cyborg
+ // Used by gamma ERT borgs
+ e_cost = 1000 // 5x that of the standard laser, for 7.5x the damage (if 6/6 shots hit) plus ignite. Efficient only if you hit with at least 4/6 of the shots.
+
/obj/item/ammo_casing/energy/electrode
projectile_type = /obj/item/projectile/energy/electrode
select_name = "stun"
diff --git a/code/modules/projectiles/ammunition/magazines.dm b/code/modules/projectiles/ammunition/magazines.dm
index 5890110b635..8cb48f8e36a 100644
--- a/code/modules/projectiles/ammunition/magazines.dm
+++ b/code/modules/projectiles/ammunition/magazines.dm
@@ -383,7 +383,7 @@
/obj/item/ammo_box/magazine/m12g/update_icon()
..()
- icon_state = "[initial(icon_state)]-[Ceiling(ammo_count(0)/8)*8]"
+ icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/8, 1)*8]"
/obj/item/ammo_box/magazine/m12g/buckshot
name = "shotgun magazine (12g buckshot slugs)"
@@ -494,7 +494,7 @@
/obj/item/ammo_box/magazine/laser/update_icon()
..()
- icon_state = "[initial(icon_state)]-[Ceiling(ammo_count(0)/20)*20]"
+ icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/20, 1)*20]"
/obj/item/ammo_box/magazine/toy/smgm45
name = "donksoft SMG magazine"
diff --git a/code/modules/projectiles/firing.dm b/code/modules/projectiles/firing.dm
index d1e549dbdb0..869feae8f97 100644
--- a/code/modules/projectiles/firing.dm
+++ b/code/modules/projectiles/firing.dm
@@ -96,7 +96,7 @@
var/ox = round(screenview/2) //"origin" x
var/oy = round(screenview/2) //"origin" y
- var/angle = Atan2(y - oy, x - ox)
+ var/angle = ATAN2(y - oy, x - ox)
Angle = angle
if(spread)
Angle += spread
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index d071ad236d1..ce0abc8cc69 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -136,7 +136,7 @@
/obj/item/gun/energy/update_icon()
overlays.Cut()
- var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
+ var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
var/iconState = "[icon_state]_charge"
var/itemState = null
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index ecf5eeed77e..19316cb9540 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -253,7 +253,7 @@
icon = 'icons/obj/objects.dmi'
icon_state = "modkit"
origin_tech = "programming=2;materials=2;magnets=4"
- require_module = 1
+ require_module = TRUE
module_type = /obj/item/robot_module/miner
usesound = 'sound/items/screwdriver.ogg'
var/denied_type = null
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 9d4cfaee3d4..3e9c882458e 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -139,6 +139,12 @@
var/append = shot.select_name
overlays += image(icon = icon, icon_state = "multilensimmolator-[append]")
+
+/obj/item/gun/energy/immolator/multi/cyborg
+ name = "cyborg immolator cannon"
+ ammo_type = list(/obj/item/ammo_casing/energy/immolator/scatter/cyborg, /obj/item/ammo_casing/energy/immolator/strong/cyborg) // scatter is default, because it is more useful
+
+
////////Laser Tag////////////////////
/obj/item/gun/energy/laser/tag
diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm
index 7a013f3083c..5823e69b39a 100644
--- a/code/modules/projectiles/guns/magic/wand.dm
+++ b/code/modules/projectiles/guns/magic/wand.dm
@@ -12,9 +12,9 @@
/obj/item/gun/magic/wand/New()
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
if(prob(33))
- max_charges = Ceiling(max_charges / 3)
+ max_charges = CEILING(max_charges / 3, 1)
else
- max_charges = Ceiling(max_charges / 2)
+ max_charges = CEILING(max_charges / 2, 1)
..()
/obj/item/gun/magic/wand/examine(mob/user)
diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm
index f2ce54bbd52..17a20f82d59 100644
--- a/code/modules/projectiles/guns/projectile/automatic.dm
+++ b/code/modules/projectiles/guns/projectile/automatic.dm
@@ -112,7 +112,7 @@
/obj/item/gun/projectile/automatic/c20r/update_icon()
..()
- icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
+ icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
//WT550//
/obj/item/gun/projectile/automatic/wt550
@@ -134,7 +134,7 @@
/obj/item/gun/projectile/automatic/wt550/update_icon()
..()
- icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
+ icon_state = "wt550[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
//Type-U3 Uzi//
/obj/item/gun/projectile/automatic/mini_uzi
@@ -194,8 +194,8 @@
overlays += "[initial(icon_state)]gren"
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
if(magazine)
- overlays += image(icon = icon, icon_state = "m90-[Ceiling(get_ammo(0)/6)*6]")
- item_state = "m90-[Ceiling(get_ammo(0)/7.5)]"
+ overlays += image(icon = icon, icon_state = "m90-[CEILING(get_ammo(0)/6, 1)*6]")
+ item_state = "m90-[CEILING(get_ammo(0)/7.5, 1)]"
else
item_state = "m90-0"
return
@@ -303,4 +303,4 @@
/obj/item/gun/projectile/automatic/lasercarbine/update_icon()
..()
- icon_state = "lasercarbine[magazine ? "-[Ceiling(get_ammo(0)/5)*5]" : ""]"
+ icon_state = "lasercarbine[magazine ? "-[CEILING(get_ammo(0)/5, 1)*5]" : ""]"
diff --git a/code/modules/projectiles/guns/projectile/saw.dm b/code/modules/projectiles/guns/projectile/saw.dm
index 5b70f2b3282..3c25bc30f93 100644
--- a/code/modules/projectiles/guns/projectile/saw.dm
+++ b/code/modules/projectiles/guns/projectile/saw.dm
@@ -23,7 +23,7 @@
update_icon()
/obj/item/gun/projectile/automatic/l6_saw/update_icon()
- icon_state = "l6[cover_open ? "open" : "closed"][magazine ? Ceiling(get_ammo(0)/12.5)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
+ icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
/obj/item/gun/projectile/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
diff --git a/code/modules/projectiles/guns/throw/crossbow.dm b/code/modules/projectiles/guns/throw/crossbow.dm
index dc03a76fb48..7613c335141 100644
--- a/code/modules/projectiles/guns/throw/crossbow.dm
+++ b/code/modules/projectiles/guns/throw/crossbow.dm
@@ -132,13 +132,13 @@
switch(choice)
if(XBOW_TENSION_20)
- drawtension = Ceiling(0.2 * maxtension)
+ drawtension = CEILING(0.2 * maxtension, 1)
if(XBOW_TENSION_40)
- drawtension = Ceiling(0.4 * maxtension)
+ drawtension = CEILING(0.4 * maxtension, 1)
if(XBOW_TENSION_60)
- drawtension = Ceiling(0.6 * maxtension)
+ drawtension = CEILING(0.6 * maxtension, 1)
if(XBOW_TENSION_80)
- drawtension = Ceiling(0.8 * maxtension)
+ drawtension = CEILING(0.8 * maxtension, 1)
if(XBOW_TENSION_FULL)
drawtension = maxtension
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 626bcaf05a8..c10d8dec600 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -26,7 +26,6 @@
var/speed = 1 //Amount of deciseconds it takes for projectile to travel
var/Angle = null
var/spread = 0 //amount (in degrees) of projectile spread
- var/legacy = FALSE //legacy projectile system
animate_movement = 0
var/ignore_source_check = FALSE
@@ -175,7 +174,7 @@
/obj/item/projectile/proc/vol_by_damage()
if(damage)
- return Clamp((damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
+ return clamp((damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
else
return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume
@@ -199,7 +198,7 @@
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
if(isturf(A) && hitsound_wall)
- var/volume = Clamp(vol_by_damage() + 20, 0, 100)
+ var/volume = clamp(vol_by_damage() + 20, 0, 100)
if(suppressed)
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
@@ -232,74 +231,61 @@
return 1 //Bullets don't drift in space
/obj/item/projectile/proc/fire(var/setAngle)
+ set waitfor = FALSE
if(setAngle)
Angle = setAngle
- if(!legacy) //new projectiles
- set waitfor = 0
- while(loc)
- if(!paused)
- if((!( current ) || loc == current))
- current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
- if(isnull(Angle))
- Angle=round(Get_Angle(src,current))
- if(spread)
- Angle += (rand() - 0.5) * spread
- var/matrix/M = new
- M.Turn(Angle)
- transform = M
- var/Pixel_x=round(sin(Angle)+16*sin(Angle)*2)
- var/Pixel_y=round(cos(Angle)+16*cos(Angle)*2)
- var/pixel_x_offset = pixel_x + Pixel_x
- var/pixel_y_offset = pixel_y + Pixel_y
- var/new_x = x
- var/new_y = y
+ while(!QDELETED(src))
+ if(!paused)
+ if((!current || loc == current))
+ current = locate(clamp(x + xo, 1, world.maxx), clamp(y + yo, 1, world.maxy), z)
+ if(isnull(Angle))
+ Angle = round(Get_Angle(src, current))
+ if(spread)
+ Angle += (rand() - 0.5) * spread
+ var/matrix/M = new
+ M.Turn(Angle)
+ transform = M
- while(pixel_x_offset > 16)
- pixel_x_offset -= 32
- pixel_x -= 32
- new_x++// x++
- while(pixel_x_offset < -16)
- pixel_x_offset += 32
- pixel_x += 32
- new_x--
+ var/Pixel_x = round(sin(Angle) + 16 * sin(Angle) * 2)
+ var/Pixel_y = round(cos(Angle) + 16 * cos(Angle) * 2)
+ var/pixel_x_offset = pixel_x + Pixel_x
+ var/pixel_y_offset = pixel_y + Pixel_y
+ var/new_x = x
+ var/new_y = y
- while(pixel_y_offset > 16)
- pixel_y_offset -= 32
- pixel_y -= 32
- new_y++
- while(pixel_y_offset < -16)
- pixel_y_offset += 32
- pixel_y += 32
- new_y--
+ while(pixel_x_offset > 16)
+ pixel_x_offset -= 32
+ pixel_x -= 32
+ new_x++ // x++
+ while(pixel_x_offset < -16)
+ pixel_x_offset += 32
+ pixel_x += 32
+ new_x--
- speed = round(speed)
- step_towards(src, locate(new_x, new_y, z))
- if(speed <= 1)
- pixel_x = pixel_x_offset
- pixel_y = pixel_y_offset
- else
- animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (speed <= 3 ? speed - 1 : speed)))
+ while(pixel_y_offset > 16)
+ pixel_y_offset -= 32
+ pixel_y -= 32
+ new_y++
+ while(pixel_y_offset < -16)
+ pixel_y_offset += 32
+ pixel_y += 32
+ new_y--
- if(original && (original.layer>=2.75) || ismob(original))
- if(loc == get_turf(original))
- if(!(original in permutated))
- Bump(original, 1)
- Range()
- sleep(max(1, speed))
- else //old projectile system
- set waitfor = 0
- while(loc)
- if(!paused)
- if((!( current ) || loc == current))
- current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
- step_towards(src, current)
- if(original && (original.layer>=2.75) || ismob(original))
- if(loc == get_turf(original))
- if(!(original in permutated))
- Bump(original, 1)
- Range()
- sleep(1)
+ speed = round(speed)
+ step_towards(src, locate(new_x, new_y, z))
+ if(speed <= 1)
+ pixel_x = pixel_x_offset
+ pixel_y = pixel_y_offset
+ else
+ animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (speed <= 3 ? speed - 1 : speed)))
+
+ if(original && (original.layer >= 2.75 || ismob(original)))
+ if(loc == get_turf(original))
+ if(!(original in permutated))
+ Bump(original, TRUE)
+ Range()
+ sleep(max(1, speed))
obj/item/projectile/proc/reflect_back(atom/source, list/position_modifiers = list(0, 0, 0, 0, 0, -1, 1, -2, 2))
if(starting)
@@ -311,7 +297,7 @@ obj/item/projectile/proc/reflect_back(atom/source, list/position_modifiers = lis
firer = source // The reflecting mob will be the new firer
else
firer = null // Reflected by something other than a mob so firer will be null
-
+
// redirect the projectile
original = locate(new_x, new_y, z)
starting = curloc
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 8811d8f2584..d40c96b5381 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -182,7 +182,7 @@
return amount
/datum/reagents/proc/set_reagent_temp(new_temp = T0C, react = TRUE)
- chem_temp = Clamp(new_temp, temperature_min, temperature_max)
+ chem_temp = clamp(new_temp, temperature_min, temperature_max)
if(react)
temperature_react()
handle_reactions()
@@ -623,7 +623,7 @@
if(total_volume + amount > maximum_volume) amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
if(amount <= 0)
return 0
- chem_temp = Clamp((chem_temp * total_volume + reagtemp * amount) / (total_volume + amount), temperature_min, temperature_max) //equalize with new chems
+ chem_temp = clamp((chem_temp * total_volume + reagtemp * amount) / (total_volume + amount), temperature_min, temperature_max) //equalize with new chems
for(var/A in reagent_list)
diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm
index 79fc47d61a8..39aa91099c0 100644
--- a/code/modules/reagents/chemistry/machinery/chem_heater.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm
@@ -118,10 +118,10 @@
if(href_list["adjust_temperature"])
var/val = href_list["adjust_temperature"]
if(isnum(val))
- desired_temp = Clamp(desired_temp+val, 0, 1000)
+ desired_temp = clamp(desired_temp+val, 0, 1000)
else if(val == "input")
var/target = input("Please input the target temperature", name) as num
- desired_temp = Clamp(target, 0, 1000)
+ desired_temp = clamp(target, 0, 1000)
else
return FALSE
. = 1
diff --git a/code/modules/reagents/chemistry/reagents/blob.dm b/code/modules/reagents/chemistry/reagents/blob.dm
index acf244a892d..7600fb25222 100644
--- a/code/modules/reagents/chemistry/reagents/blob.dm
+++ b/code/modules/reagents/chemistry/reagents/blob.dm
@@ -125,7 +125,7 @@
/datum/reagent/blob/proc/reagent_vortex(mob/living/M, setting_type, volume)
var/turf/pull = get_turf(M)
- var/range_power = Clamp(round(volume/5, 1), 1, 5)
+ var/range_power = clamp(round(volume/5, 1), 1, 5)
for(var/atom/movable/X in range(range_power,pull))
if(istype(X, /obj/effect))
continue
diff --git a/code/modules/reagents/chemistry/reagents/drugs.dm b/code/modules/reagents/chemistry/reagents/drugs.dm
index a848330e431..ea110581083 100644
--- a/code/modules/reagents/chemistry/reagents/drugs.dm
+++ b/code/modules/reagents/chemistry/reagents/drugs.dm
@@ -543,7 +543,7 @@
M.AdjustConfused(-5)
update_flags |= M.SetWeakened(0, FALSE)
if(volume >= 70 && prob(25))
- if(M.reagents.has_reagent("thc") <= 20)
+ if(M.reagents.get_reagent_amount("thc") <= 20)
M.Drowsy(10)
if(prob(25))
update_flags |= M.adjustBruteLoss(-2, FALSE)
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index a091f65a34c..01a5e6823a5 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -61,8 +61,9 @@ obj/item/reagent_containers/proc/add_initial_reagents()
update_icon()
return
-/obj/item/reagent_containers/afterattack(obj/target, mob/user , flag)
- return
+/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone)
+ if(user.a_intent == INTENT_HARM)
+ return ..()
/obj/item/reagent_containers/wash(mob/user, atom/source)
if(is_open_container())
diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm
index 1fa4930b0f6..6012f480072 100644
--- a/code/modules/reagents/reagent_containers/borghydro.dm
+++ b/code/modules/reagents/reagent_containers/borghydro.dm
@@ -47,7 +47,7 @@
/obj/item/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
charge_tick++
- if(charge_tick < recharge_time)
+ if(charge_tick < recharge_time)
return FALSE
charge_tick = 0
@@ -126,4 +126,9 @@
if(empty)
. += "It is currently empty. Allow some time for the internal syntheszier to produce more."
+/obj/item/reagent_containers/borghypo/basic
+ name = "Basic Medical Hypospray"
+ desc = "A very basic medical hypospray, capable of providing simple medical treatment in emergencies."
+ reagent_ids = list("salglu_solution", "epinephrine")
+
#undef BORGHYPO_REFILL_VALUE
diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm
index 3e9480f166d..6f32411a261 100644
--- a/code/modules/reagents/reagent_containers/glass_containers.dm
+++ b/code/modules/reagents/reagent_containers/glass_containers.dm
@@ -14,38 +14,7 @@
container_type = OPENCONTAINER
has_lid = TRUE
resistance_flags = ACID_PROOF
-
var/label_text = ""
- // the fucking asshole who designed this can go die in a fire - Iamgoofball
- var/list/can_be_placed_into = list(
- /obj/machinery/chem_master/,
- /obj/machinery/chem_heater/,
- /obj/machinery/chem_dispenser/,
- /obj/machinery/reagentgrinder,
- /obj/structure/table,
- /obj/structure/closet,
- /obj/structure/sink,
- /obj/structure/toilet,
- /obj/item/storage,
- /obj/machinery/atmospherics/unary/cryo_cell,
- /obj/machinery/dna_scannernew,
- /obj/item/grenade/chem_grenade,
- /mob/living/simple_animal/bot/medbot,
- /obj/item/storage/secure/safe,
- /obj/machinery/iv_drip,
- /obj/machinery/computer/pandemic,
- /obj/machinery/disposal,
- /mob/living/simple_animal/cow,
- /mob/living/simple_animal/hostile/retaliate/goat,
- /obj/machinery/sleeper,
- /obj/machinery/smartfridge/,
- /obj/machinery/biogenerator,
- /obj/machinery/hydroponics,
- /obj/machinery/constructable_frame,
- /obj/machinery/icemachine,
- /obj/item/bombcore/chemical,
- /obj/machinery/vending,
- /obj/machinery/fishtank)
/obj/item/reagent_containers/glass/New()
..()
@@ -98,56 +67,44 @@
reagents.reaction(M, REAGENT_INGEST, fraction)
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
- else
- return ..()
/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
- if(!proximity)
+ if((!proximity) || !check_allowed_items(target,target_self = TRUE))
return
if(!is_open_container())
return
- for(var/type in can_be_placed_into)
- if(istype(target, type))
+ if(target.is_refillable()) //Something like a glass. Player probably wants to transfer TO it.
+ if(!reagents.total_volume)
+ to_chat(user, "[src] is empty!")
return
- if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
- if(target.reagents && !target.reagents.total_volume)
+ if(target.reagents.holder_full())
+ to_chat(user, "[target] is full.")
+ return
+
+ var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
+ to_chat(user, "You transfer [trans] unit\s of the solution to [target].")
+
+ else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us.
+ if(!target.reagents.total_volume)
to_chat(user, "[target] is empty and can't be refilled!")
return
- if(reagents.total_volume >= reagents.maximum_volume)
- to_chat(user, "[src] is full.")
+ if(reagents.holder_full())
+ to_chat(user, "[src] is full.")
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
to_chat(user, "You fill [src] with [trans] unit\s of the contents of [target].")
- else if(target.is_refillable() && is_drainable()) //Something like a glass. Player probably wants to transfer TO it.
- if(!reagents.total_volume)
- to_chat(user, "[src] is empty.")
- return
-
- if(target.reagents.total_volume >= target.reagents.maximum_volume)
- to_chat(user, "[target] is full.")
- return
-
- var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
- to_chat(user, "You transfer [trans] units of the solution to [target].")
-
- else if(istype(target, /obj/item/reagent_containers/glass) && !target.is_open_container())
- to_chat(user, "You cannot fill [target] while it is sealed.")
- return
-
- else if(istype(target, /obj/effect/decal)) //stops splashing while scooping up fluids
- return
-
- else if(reagents.total_volume && user.a_intent == INTENT_HARM)
- user.visible_message("[user] splashes the contents of [src] onto [target]!", \
- "You splash the contents of [src] onto [target].")
- reagents.reaction(target, REAGENT_TOUCH)
- reagents.clear_reagents()
+ else if(reagents.total_volume)
+ if(user.a_intent == INTENT_HARM)
+ user.visible_message("[user] splashes the contents of [src] onto [target]!", \
+ "You splash the contents of [src] onto [target].")
+ reagents.reaction(target, REAGENT_TOUCH)
+ reagents.clear_reagents()
/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index e87e72d8750..8783d8a8c19 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -149,7 +149,7 @@
cut_overlays()
var/rounded_vol
if(reagents && reagents.total_volume)
- rounded_vol = Clamp(round((reagents.total_volume / volume * 15), 5), 1, 15)
+ rounded_vol = clamp(round((reagents.total_volume / volume * 15), 5), 1, 15)
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
filling_overlay.icon += mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling_overlay)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 544deb8d11f..2aec9412def 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -272,7 +272,7 @@
/obj/machinery/disposal/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
- var/pressure = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
+ var/pressure = clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
var/pressure_round = round(pressure,1)
data["isAI"] = isAI(user)
@@ -794,8 +794,8 @@
return
if(T.intact && istype(T,/turf/simulated/floor)) //intact floor, pop the tile
var/turf/simulated/floor/F = T
- new F.builtin_tile.type(H)
- F.remove_tile(null,TRUE,FALSE)
+ new F.floor_tile(H)
+ F.remove_tile(null, TRUE, FALSE)
if(direction) // direction is specified
if(istype(T, /turf/space)) // if ended in space, then range is unlimited
diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm
index 5b5dba286fd..76eabe46761 100644
--- a/code/modules/research/designs/mechfabricator_designs.dm
+++ b/code/modules/research/designs/mechfabricator_designs.dm
@@ -1081,8 +1081,17 @@
construction_time = 120
category = list("Cyborg Upgrade Modules")
+/datum/design/borg_upgrade_lavaproof
+ name = "Cyborg Upgrade (Lavaproof Chassis)"
+ id = "borg_upgrade_lavaproof"
+ build_type = MECHFAB
+ build_path = /obj/item/borg/upgrade/lavaproof
+ materials = list(MAT_METAL = 10000, MAT_PLASMA = 4000, MAT_TITANIUM = 5000)
+ construction_time = 120
+ category = list("Cyborg Upgrade Modules")
+
/datum/design/borg_syndicate_module
- name = "Cyborg Upgrade (Illegal Modules)"
+ name = "Cyborg Upgrade (Safety Override)"
id = "borg_syndicate_module"
build_type = MECHFAB
req_tech = list("combat" = 4, "syndicate" = 2)
diff --git a/code/modules/research/designs/telecomms_designs.dm b/code/modules/research/designs/telecomms_designs.dm
index 083420d68a4..733d76834e4 100644
--- a/code/modules/research/designs/telecomms_designs.dm
+++ b/code/modules/research/designs/telecomms_designs.dm
@@ -13,7 +13,7 @@
category = list("Subspace Telecomms")
/datum/design/telecomms_relay
- name = "Machine Board (Telecommunications Core)"
+ name = "Machine Board (Telecommunications Relay)"
desc = "Allows for the construction of Telecommunications Relays."
id = "s-relay"
req_tech = list("programming" = 2, "engineering" = 2, "bluespace" = 2)
diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm
index df3a7945e92..91306d910f1 100644
--- a/code/modules/research/message_server.dm
+++ b/code/modules/research/message_server.dm
@@ -103,12 +103,12 @@ GLOBAL_LIST_EMPTY(message_servers)
if(2)
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
- Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5)
+ Console.atom_say("PRIORITY Alert in [sender]")
Console.message_log += "High Priority message from [sender]
[authmsg]"
else
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
- Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'Message from [sender]'"),,4)
+ Console.atom_say("Message from [sender]")
Console.message_log += "Message from [sender]
[authmsg]"
Console.set_light(2)
diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm
index b5fc9e9c879..444a2f9d017 100644
--- a/code/modules/research/research.dm
+++ b/code/modules/research/research.dm
@@ -117,7 +117,7 @@ research holder datum.
AddDesign2Known(PD)
for(var/v in known_tech)
var/datum/tech/T = known_tech[v]
- T.level = Clamp(T.level, 0, 20)
+ T.level = clamp(T.level, 0, 20)
//Refreshes the levels of a given tech.
//Input: Tech's ID and Level; Output: null
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index de9194953da..ab0461a8908 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -68,7 +68,7 @@
if(0 to T0C)
health = min(100, health + 1)
if(T0C to (T20C + 20))
- health = Clamp(health, 0, 100)
+ health = clamp(health, 0, 100)
if((T20C + 20) to (T0C + 70))
health = max(0, health - 1)
if(health <= 0)
diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm
index c71c3f6f8d8..7c35730f4aa 100644
--- a/code/modules/research/xenobiology/xenobiology.dm
+++ b/code/modules/research/xenobiology/xenobiology.dm
@@ -319,7 +319,7 @@
return ..()
to_chat(user, "You feed the slime the stabilizer. It is now less likely to mutate.")
- M.mutation_chance = Clamp(M.mutation_chance-15,0,100)
+ M.mutation_chance = clamp(M.mutation_chance-15,0,100)
qdel(src)
/obj/item/slimepotion/slime/mutator
@@ -343,7 +343,7 @@
return ..()
to_chat(user, "You feed the slime the mutator. It is now more likely to mutate.")
- M.mutation_chance = Clamp(M.mutation_chance+12,0,100)
+ M.mutation_chance = clamp(M.mutation_chance+12,0,100)
M.mutator_used = TRUE
qdel(src)
diff --git a/code/modules/response_team/ert.dm b/code/modules/response_team/ert.dm
index 6155c1de6b9..a25be3814a7 100644
--- a/code/modules/response_team/ert.dm
+++ b/code/modules/response_team/ert.dm
@@ -135,8 +135,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
/client/proc/create_response_team(new_gender, role, turf/spawn_location)
if(role == "Cyborg")
- var/cyborg_unlock = GLOB.active_team.getCyborgUnlock()
- var/mob/living/silicon/robot/ert/R = new /mob/living/silicon/robot/ert(spawn_location, cyborg_unlock)
+ var/mob/living/silicon/robot/ert/R = new GLOB.active_team.borg_path(spawn_location)
return R
var/mob/living/carbon/human/M = new(null)
@@ -208,7 +207,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
var/security_outfit
var/janitor_outfit
var/paranormal_outfit
- var/cyborg_unlock = 0
+ var/borg_path = /mob/living/silicon/robot/ert
/datum/response_team/proc/setSlots(com=1, sec=3, med=3, eng=3, jan=0, par=0, cyb=0)
slots["Commander"] = com
@@ -223,9 +222,6 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
slots[role]--
count++
-/datum/response_team/proc/getCyborgUnlock()
- return cyborg_unlock
-
/datum/response_team/proc/get_slot_list()
RETURN_TYPE(/list)
var/list/slots_available = list()
@@ -285,6 +281,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
command_outfit = /datum/outfit/job/centcom/response_team/commander/red
janitor_outfit = /datum/outfit/job/centcom/response_team/janitorial/red
paranormal_outfit = /datum/outfit/job/centcom/response_team/paranormal/red
+ borg_path = /mob/living/silicon/robot/ert/red
/datum/response_team/red/announce_team()
GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a code RED Emergency Response Team. Standby.", "ERT En-Route")
@@ -298,7 +295,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
command_outfit = /datum/outfit/job/centcom/response_team/commander/gamma
janitor_outfit = /datum/outfit/job/centcom/response_team/janitorial/gamma
paranormal_outfit = /datum/outfit/job/centcom/response_team/paranormal/gamma
- cyborg_unlock = 1
+ borg_path = /mob/living/silicon/robot/ert/gamma
/datum/response_team/gamma/announce_team()
GLOB.event_announcement.Announce("Attention, [station_name()]. We are sending a code GAMMA elite Emergency Response Team. Standby.", "ERT En-Route")
diff --git a/code/modules/ruins/ruin_areas.dm b/code/modules/ruins/ruin_areas.dm
index 754f8d44f29..cf3b08aa0f2 100644
--- a/code/modules/ruins/ruin_areas.dm
+++ b/code/modules/ruins/ruin_areas.dm
@@ -5,8 +5,8 @@
icon_state = "away"
has_gravity = TRUE
there_can_be_many = TRUE
- ambientsounds = list('sound/ambience/ambimine.ogg')
dynamic_lighting = DYNAMIC_LIGHTING_FORCED
+ ambientsounds = RUINS_SOUNDS
/area/ruin/unpowered
always_unpowered = FALSE
diff --git a/code/modules/security_levels/security levels.dm b/code/modules/security_levels/security levels.dm
index 0f07107a00b..00c575e53b0 100644
--- a/code/modules/security_levels/security levels.dm
+++ b/code/modules/security_levels/security levels.dm
@@ -31,15 +31,6 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
// Mark down this time to prevent shuttle cheese
SSshuttle.emergency_sec_level_time = world.time
- // Reset gamma borgs if the new security level is lower than Gamma.
- if(level < SEC_LEVEL_GAMMA)
- for(var/M in GLOB.silicon_mob_list)
- if(isrobot(M))
- var/mob/living/silicon/robot/R = M
- if(istype(R.module, /obj/item/robot_module/combat) && !R.crisis)
- R.reset_module()
- to_chat(R, "Crisis mode deactivated. The combat module is no longer available and your module has been reset.")
-
switch(level)
if(SEC_LEVEL_GREEN)
GLOB.security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.")
diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm
index 18db87f6eb7..b73901cf2fa 100644
--- a/code/modules/shuttle/navigation_computer.dm
+++ b/code/modules/shuttle/navigation_computer.dm
@@ -32,8 +32,6 @@
jumpto_ports += list("nav_z1" = 1)
if(access_tcomms)
jumpto_ports += list("nav_z3" = 1)
- if(access_construction)
- jumpto_ports += list("nav_z4" = 1)
if(access_mining)
jumpto_ports += list("nav_z5" = 1)
if(access_derelict)
diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm
index fd4bb0b6ad5..d6645ce6f2b 100644
--- a/code/modules/shuttle/shuttle.dm
+++ b/code/modules/shuttle/shuttle.dm
@@ -463,7 +463,7 @@
var/rotation = dir2angle(S1.dir)-dir2angle(dir)
if((rotation % 90) != 0)
rotation += (rotation % 90) //diagonal rotations not allowed, round up
- rotation = SimplifyDegrees(rotation)
+ rotation = SIMPLIFY_DEGREES(rotation)
//remove area surrounding docking port
if(areaInstance.contents.len)
@@ -863,7 +863,7 @@
desc = "Used to control the White Ship."
circuit = /obj/item/circuitboard/white_ship
shuttleId = "whiteship"
- possible_destinations = "whiteship_away;whiteship_home;whiteship_z4"
+ possible_destinations = "whiteship_away;whiteship_home"
/obj/machinery/computer/shuttle/engineering
name = "Engineering Shuttle Console"
@@ -913,7 +913,7 @@
desc = "Used to control the Golem Ship."
circuit = /obj/item/circuitboard/shuttle/golem_ship
shuttleId = "freegolem"
- possible_destinations = "freegolem_lavaland;freegolem_z5;freegolem_z4;freegolem_z6"
+ possible_destinations = "freegolem_lavaland;freegolem_z5;freegolem_z6"
/obj/machinery/computer/shuttle/golem_ship/attack_hand(mob/user)
if(!isgolem(user) && !isobserver(user))
diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm
index 50cf7ff7d28..b1eeb07a6de 100644
--- a/code/modules/shuttle/supply.dm
+++ b/code/modules/shuttle/supply.dm
@@ -487,7 +487,7 @@
var/num_input = input(usr, "Amount:", "How many crates?") as null|num
if(!num_input || ..())
return 1
- crates = Clamp(round(num_input), 1, 20)
+ crates = clamp(round(num_input), 1, 20)
var/timeout = world.time + 600
var/reason = input(usr,"Reason:","Why do you require this item?","") as null|text
@@ -668,7 +668,7 @@
var/num_input = input(usr, "Amount:", "How many crates?") as null|num
if(!num_input || !is_authorized(usr) || ..())
return 1
- crates = Clamp(round(num_input), 1, 20)
+ crates = clamp(round(num_input), 1, 20)
var/timeout = world.time + 600
var/reason = input(usr,"Reason:","Why do you require this item?","") as null|text
diff --git a/code/modules/surgery/organs/blood.dm b/code/modules/surgery/organs/blood.dm
index 63a7f8a3590..e01c75dcbd0 100644
--- a/code/modules/surgery/organs/blood.dm
+++ b/code/modules/surgery/organs/blood.dm
@@ -72,7 +72,7 @@
bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects naturally decreases
- var/additional_bleed = round(Clamp((reagents.get_reagent_amount("heparin") / 10), 0, 2), 1) //Heparin worsens existing bleeding
+ var/additional_bleed = round(clamp((reagents.get_reagent_amount("heparin") / 10), 0, 2), 1) //Heparin worsens existing bleeding
if(internal_bleeding_rate && !(status_flags & FAKEDEATH))
bleed_internal(internal_bleeding_rate + additional_bleed)
diff --git a/code/modules/telesci/rcs.dm b/code/modules/telesci/rcs.dm
new file mode 100644
index 00000000000..83dbe6cb8f0
--- /dev/null
+++ b/code/modules/telesci/rcs.dm
@@ -0,0 +1,121 @@
+#define RCS_MODE_CALIBRATED 0
+#define RCS_MODE_UNCALIBRATED 1
+
+/obj/item/rcs
+ name = "rapid-crate-sender (RCS)"
+ desc = "A device used to teleport crates and closets to cargo telepads."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "rcs"
+ item_state = "rcd"
+ flags = CONDUCT
+ force = 10.0
+ throwforce = 10.0
+ throw_speed = 2
+ throw_range = 5
+ toolspeed = 1
+ usesound = 'sound/machines/click.ogg'
+ var/obj/item/stock_parts/cell/high/rcell = null
+ var/obj/machinery/pad = null
+ var/mode = RCS_MODE_CALIBRATED
+ var/rand_x = 0
+ var/rand_y = 0
+ var/emagged = FALSE
+ var/teleporting = FALSE
+ var/chargecost = 1000
+
+/obj/item/rcs/get_cell()
+ return rcell
+
+/obj/item/rcs/New()
+ ..()
+ rcell = new(src)
+
+/obj/item/rcs/examine(mob/user)
+ . = ..()
+ . += "There are [round(rcell.charge/chargecost)] charge\s left."
+
+/obj/item/rcs/Destroy()
+ QDEL_NULL(rcell)
+ return ..()
+
+/obj/item/rcs/attack_self(mob/user)
+ if(!emagged)
+ return
+ if(mode == RCS_MODE_CALIBRATED)
+ mode = RCS_MODE_UNCALIBRATED
+ playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
+ to_chat(user, "The telepad locator has become uncalibrated.")
+ else
+ mode = RCS_MODE_CALIBRATED
+ playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
+ to_chat(user, "You calibrate the telepad locator.")
+
+/obj/item/rcs/emag_act(user as mob)
+ if(!emagged)
+ emagged = TRUE
+ do_sparks(5, 1, src)
+ to_chat(user, "You emag the RCS. Activate it to toggle between modes.")
+ return
+
+/obj/item/rcs/proc/try_send_container(mob/user, obj/structure/closet/C)
+ if(teleporting)
+ to_chat(user, "You're already using [src]!")
+ return
+ if(user in C.contents) //to prevent self-teleporting.
+ return
+ if(!rcell || (rcell.charge < chargecost))
+ to_chat(user, "Out of charges.")
+ return
+
+ if(!is_level_reachable(C.z))
+ to_chat(user, "The rapid-crate-sender can't locate any telepads!")
+ return
+
+ if(mode == RCS_MODE_CALIBRATED)
+ var/list/L = list()
+ var/list/areaindex = list()
+ for(var/obj/machinery/telepad_cargo/R in GLOB.machines)
+ if(R.stage)
+ continue
+ var/turf/T = get_turf(R)
+ var/tmpname = T.loc.name
+ if(areaindex[tmpname])
+ tmpname = "[tmpname] ([++areaindex[tmpname]])"
+ else
+ areaindex[tmpname] = 1
+ L[tmpname] = R
+
+ var/desc = input("Please select a telepad.", "RCS") in L
+ pad = L[desc]
+ try_teleport(user, C, pad)
+ else
+ rand_x = rand(50,200)
+ rand_y = rand(50,200)
+ var/L = locate(rand_x, rand_y, 6)
+ try_teleport(user, C, L)
+
+/obj/item/rcs/proc/try_teleport(mob/user, obj/structure/closet/C, target)
+ if(!C.Adjacent(user))
+ to_chat(user, "Unable to teleport, too far from [C].")
+ return
+ var/turf/ownTurf = get_turf(src)
+ playsound(ownTurf, usesound, 50, 1)
+ to_chat(user, "Teleporting [C]...")
+ teleporting = TRUE
+ if(!do_after(user, 50 * toolspeed, target = C))
+ teleporting = FALSE
+ return
+ teleporting = FALSE
+ if(user in C.contents)
+ to_chat(user, "Error: User located in container--aborting for safety.")
+ playsound(ownTurf, 'sound/machines/buzz-sigh.ogg', 50, 1)
+ return
+ if(!(rcell && rcell.use(chargecost)))
+ to_chat(user, "Unable to teleport, insufficient charge.")
+ return
+ do_sparks(5, 1, C)
+ do_teleport(C, target)
+ to_chat(user, "Teleport successful. [round(rcell.charge/chargecost)] charge\s left.")
+
+#undef RCS_MODE_CALIBRATED
+#undef RCS_MODE_UNCALIBRATED
diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm
index 1ec94634b47..af73f65de87 100644
--- a/code/modules/telesci/telepad.dm
+++ b/code/modules/telesci/telepad.dm
@@ -88,7 +88,7 @@
/obj/machinery/telepad_cargo/wrench_act(mob/user, obj/item/I)
. = TRUE
default_unfasten_wrench(user, I)
-
+
/obj/machinery/telepad_cargo/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -113,59 +113,3 @@
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
qdel(src)
return
-
-///HANDHELD TELEPAD USER///
-/obj/item/rcs
- name = "rapid-crate-sender (RCS)"
- desc = "A device used to teleport crates and closets to cargo telepads."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "rcs"
- item_state = "rcd"
- flags = CONDUCT
- force = 10.0
- throwforce = 10.0
- throw_speed = 2
- throw_range = 5
- toolspeed = 1
- usesound = 'sound/machines/click.ogg'
- var/obj/item/stock_parts/cell/high/rcell = null
- var/obj/machinery/pad = null
- var/mode = 0
- var/rand_x = 0
- var/rand_y = 0
- var/emagged = 0
- var/teleporting = 0
- var/chargecost = 1000
-
-/obj/item/rcs/get_cell()
- return rcell
-
-/obj/item/rcs/New()
- ..()
- rcell = new(src)
-
-/obj/item/rcs/examine(mob/user)
- . = ..()
- . += "There are [round(rcell.charge/chargecost)] charge\s left."
-
-/obj/item/rcs/Destroy()
- QDEL_NULL(rcell)
- return ..()
-
-/obj/item/rcs/attack_self(mob/user)
- if(emagged)
- if(mode == 0)
- mode = 1
- playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
- to_chat(user, " The telepad locator has become uncalibrated.")
- else
- mode = 0
- playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
- to_chat(user, " You calibrate the telepad locator.")
-
-/obj/item/rcs/emag_act(user as mob)
- if(!emagged)
- emagged = 1
- do_sparks(5, 1, src)
- to_chat(user, " You emag the RCS. Activate it to toggle between modes.")
- return
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index 9d66758207f..d373e73f77b 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -169,15 +169,15 @@
if(telepad)
- var/truePower = Clamp(power + power_off, 1, 1000)
+ var/truePower = clamp(power + power_off, 1, 1000)
var/trueRotation = rotation + rotation_off
- var/trueAngle = Clamp(angle, 1, 90)
+ var/trueAngle = clamp(angle, 1, 90)
var/datum/projectile_data/proj_data = projectile_trajectory(telepad.x, telepad.y, trueRotation, trueAngle, truePower)
last_tele_data = proj_data
- var/trueX = Clamp(round(proj_data.dest_x, 1), 1, world.maxx)
- var/trueY = Clamp(round(proj_data.dest_y, 1), 1, world.maxy)
+ var/trueX = clamp(round(proj_data.dest_x, 1), 1, world.maxx)
+ var/trueY = clamp(round(proj_data.dest_y, 1), 1, world.maxy)
var/spawn_time = round(proj_data.time) * 10
var/turf/target = locate(trueX, trueY, z_co)
@@ -291,12 +291,12 @@
return
- var/truePower = Clamp(power + power_off, 1, 1000)
+ var/truePower = clamp(power + power_off, 1, 1000)
var/trueRotation = rotation + rotation_off
- var/trueAngle = Clamp(angle, 1, 90)
+ var/trueAngle = clamp(angle, 1, 90)
var/datum/projectile_data/proj_data = projectile_trajectory(telepad.x, telepad.y, trueRotation, trueAngle, truePower)
- var/turf/target = locate(Clamp(round(proj_data.dest_x, 1), 1, world.maxx), Clamp(round(proj_data.dest_y, 1), 1, world.maxy), z_co)
+ var/turf/target = locate(clamp(round(proj_data.dest_x, 1), 1, world.maxx), clamp(round(proj_data.dest_y, 1), 1, world.maxy), z_co)
var/area/A = get_area(target)
if(A.tele_proof == 1)
@@ -336,14 +336,14 @@
var/new_rot = input("Please input desired bearing in degrees.", name, rotation) as num
if(..()) // Check after we input a value, as they could've moved after they entered something
return
- rotation = Clamp(new_rot, -900, 900)
+ rotation = clamp(new_rot, -900, 900)
rotation = round(rotation, 0.01)
if(href_list["setangle"])
var/new_angle = input("Please input desired elevation in degrees.", name, angle) as num
if(..())
return
- angle = Clamp(round(new_angle, 0.1), 1, 9999)
+ angle = clamp(round(new_angle, 0.1), 1, 9999)
if(href_list["setpower"])
var/index = href_list["setpower"]
@@ -356,7 +356,7 @@
var/new_z = input("Please input desired sector.", name, z_co) as num
if(..())
return
- z_co = Clamp(round(new_z), 1, 10)
+ z_co = clamp(round(new_z), 1, 10)
if(href_list["ejectGPS"])
if(inserted_gps)
diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm
new file mode 100644
index 00000000000..5b1409af4e7
--- /dev/null
+++ b/code/modules/unit_tests/_unit_tests.dm
@@ -0,0 +1,12 @@
+//include unit test files in this module in this ifdef
+//Keep this sorted alphabetically
+
+#ifdef UNIT_TESTS
+#include "component_tests.dm"
+#include "reagent_id_typos.dm"
+#include "spawn_humans.dm"
+#include "sql.dm"
+#include "subsystem_init.dm"
+#include "timer_sanity.dm"
+#include "unit_test.dm"
+#endif
diff --git a/code/modules/unit_tests/component_tests.dm b/code/modules/unit_tests/component_tests.dm
new file mode 100644
index 00000000000..0099d7508c5
--- /dev/null
+++ b/code/modules/unit_tests/component_tests.dm
@@ -0,0 +1,12 @@
+/datum/unit_test/component_duping/Run()
+ var/list/bad_dms = list()
+ var/list/bad_dts = list()
+ for(var/t in typesof(/datum/component))
+ var/datum/component/comp = t
+ if(!isnum(initial(comp.dupe_mode)))
+ bad_dms += t
+ var/dupe_type = initial(comp.dupe_type)
+ if(dupe_type && !ispath(dupe_type))
+ bad_dts += t
+ if(length(bad_dms) || length(bad_dts))
+ Fail("Components with invalid dupe modes: ([bad_dms.Join(",")]) ||| Components with invalid dupe types: ([bad_dts.Join(",")])")
diff --git a/code/modules/unit_tests/reagent_id_typos.dm b/code/modules/unit_tests/reagent_id_typos.dm
new file mode 100644
index 00000000000..7f45774db0b
--- /dev/null
+++ b/code/modules/unit_tests/reagent_id_typos.dm
@@ -0,0 +1,11 @@
+
+
+/datum/unit_test/reagent_id_typos
+
+/datum/unit_test/reagent_id_typos/Run()
+ for(var/I in GLOB.chemical_reactions_list)
+ for(var/V in GLOB.chemical_reactions_list[I])
+ var/datum/chemical_reaction/R = V
+ for(var/id in (R.required_reagents + R.required_catalysts))
+ if(!GLOB.chemical_reagents_list[id])
+ Fail("Unknown chemical id \"[id]\" in recipe [R.type]")
diff --git a/code/modules/unit_tests/spawn_humans.dm b/code/modules/unit_tests/spawn_humans.dm
new file mode 100644
index 00000000000..ae1f4961b02
--- /dev/null
+++ b/code/modules/unit_tests/spawn_humans.dm
@@ -0,0 +1,8 @@
+/datum/unit_test/spawn_humans/Run()
+ var/locs = block(run_loc_bottom_left, run_loc_top_right)
+
+ for(var/I in 1 to 5)
+ new /mob/living/carbon/human(pick(locs))
+
+ // There is a 5 second delay here so that all the items on the humans have time to initialize and spawn
+ sleep(50)
diff --git a/code/modules/unit_tests/sql.dm b/code/modules/unit_tests/sql.dm
new file mode 100644
index 00000000000..d14bdf11001
--- /dev/null
+++ b/code/modules/unit_tests/sql.dm
@@ -0,0 +1,42 @@
+// Unit test to check SQL version has been updated properly.,
+/datum/unit_test/sql_version/Run()
+ // Check if the SQL version set in the code is equal to the travis DB config
+ if(config.sql_enabled && sql_version != SQL_VERSION)
+ Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/travis/dbconfig.txt")
+ // Check if the travis DB config is up to date with the example dbconfig
+ // This proc is a little unclean but it works
+ var/example_db_version
+ var/list/Lines = file2list("config/example/dbconfig.txt")
+ for(var/t in Lines)
+ if(!t) continue
+
+ t = trim(t)
+ if(length(t) == 0)
+ continue
+ else if(copytext(t, 1, 2) == "#")
+ continue
+
+ var/pos = findtext(t, " ")
+ var/name = null
+ var/value = null
+
+ if(pos)
+ name = lowertext(copytext(t, 1, pos))
+ value = copytext(t, pos + 1)
+ else
+ name = lowertext(t)
+
+ if(!name)
+ continue
+
+ switch(name)
+ if("db_version")
+ example_db_version = text2num(value)
+
+ if(!example_db_version)
+ Fail("SQL version error: File config/example/dbconfig.txt does not have a valid SQL version set!")
+
+ if(example_db_version != SQL_VERSION)
+ Fail("SQL version error: Game is running V[SQL_VERSION] but config/example/dbconfig.txt is V[example_db_version].")
+
+
diff --git a/code/modules/unit_tests/subsystem_init.dm b/code/modules/unit_tests/subsystem_init.dm
new file mode 100644
index 00000000000..7d5473bc1bb
--- /dev/null
+++ b/code/modules/unit_tests/subsystem_init.dm
@@ -0,0 +1,7 @@
+/datum/unit_test/subsystem_init/Run()
+ for(var/i in Master.subsystems)
+ var/datum/controller/subsystem/ss = i
+ if(ss.flags & SS_NO_INIT)
+ continue
+ if(!ss.initialized)
+ Fail("[ss]([ss.type]) is a subsystem meant to initialize but doesn't get set as initialized.")
diff --git a/code/modules/unit_tests/timer_sanity.dm b/code/modules/unit_tests/timer_sanity.dm
new file mode 100644
index 00000000000..d92323a5253
--- /dev/null
+++ b/code/modules/unit_tests/timer_sanity.dm
@@ -0,0 +1,3 @@
+/datum/unit_test/timer_sanity/Run()
+ if(SStimer.bucket_count < 0)
+ Fail("SStimer is going into negative bucket count from something")
diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm
new file mode 100644
index 00000000000..3a1d39bd133
--- /dev/null
+++ b/code/modules/unit_tests/unit_test.dm
@@ -0,0 +1,102 @@
+/*
+Usage:
+Override /Run() to run your test code
+Call Fail() to fail the test (You should specify a reason)
+You may use /New() and /Destroy() for setup/teardown respectively
+You can use the run_loc_bottom_left and run_loc_top_right to get turfs for testing
+*/
+
+/// VARS FOR UNIT TESTS
+GLOBAL_DATUM(current_test, /datum/unit_test)
+GLOBAL_VAR_INIT(failed_any_test, FALSE)
+GLOBAL_VAR(test_log)
+
+/datum/unit_test
+ //Bit of metadata for the future maybe
+ var/list/procs_tested
+
+ //usable vars
+ var/turf/run_loc_bottom_left
+ var/turf/run_loc_top_right
+
+ //internal shit
+ var/succeeded = TRUE
+ var/list/fail_reasons
+
+/datum/unit_test/New()
+ run_loc_bottom_left = locate(1, 1, 1)
+ run_loc_top_right = locate(5, 5, 1)
+
+/datum/unit_test/Destroy()
+ //clear the test area
+ for(var/atom/movable/AM in block(run_loc_bottom_left, run_loc_top_right))
+ qdel(AM)
+ return ..()
+
+/datum/unit_test/proc/Run()
+ Fail("Run() called parent or not implemented")
+
+/datum/unit_test/proc/Fail(reason = "No reason")
+ succeeded = FALSE
+
+ if(!istext(reason))
+ reason = "FORMATTED: [reason != null ? reason : "NULL"]"
+
+ LAZYADD(fail_reasons, reason)
+
+/proc/RunUnitTests()
+ CHECK_TICK
+
+ for(var/I in subtypesof(/datum/unit_test))
+ var/datum/unit_test/test = new I
+
+ GLOB.current_test = test
+ var/duration = REALTIMEOFDAY
+
+ test.Run()
+
+ duration = REALTIMEOFDAY - duration
+ GLOB.current_test = null
+ GLOB.failed_any_test |= !test.succeeded
+
+ var/list/log_entry = list("[test.succeeded ? "PASS" : "FAIL"]: [I] [duration / 10]s")
+ var/list/fail_reasons = test.fail_reasons
+
+ qdel(test)
+
+ for(var/J in 1 to LAZYLEN(fail_reasons))
+ log_entry += "\tREASON #[J]: [fail_reasons[J]]"
+ log_world(log_entry.Join("\n"))
+
+ CHECK_TICK
+
+ world.Reboot("Unit Test Reboot", "end_test", "tests ended", 0)
+
+
+// OTHER MISC PROCS RELATED TO UNIT TESTS //
+
+/world/proc/HandleTestRun()
+ //trigger things to run the whole process
+ Master.sleep_offline_after_initializations = FALSE
+ // This will have the ticker set the game up
+ // Running the tests is part of the ticker's start function, because I cant think of any better place to put it
+ SSticker.force_start = TRUE
+
+/world/proc/FinishTestRun()
+ set waitfor = FALSE
+ var/list/fail_reasons
+ if(GLOB)
+ if(GLOB.total_runtimes != 0)
+ fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
+ if(!GLOB.log_directory)
+ LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
+ if(GLOB.failed_any_test)
+ LAZYADD(fail_reasons, "Unit Tests failed!")
+ else
+ fail_reasons = list("Missing GLOB!")
+ if(!fail_reasons)
+ text2file("Success!", "data/clean_run.lk")
+ else
+ log_world("Test run failed!\n[fail_reasons.Join("\n")]")
+ sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
+ del(src) //shut it down
diff --git a/icons/mob/robots.dmi b/icons/mob/robots.dmi
index eb59b0288b3..dcbce35fb27 100644
Binary files a/icons/mob/robots.dmi and b/icons/mob/robots.dmi differ
diff --git a/icons/mob/talk.dmi b/icons/mob/talk.dmi
index 4b74a2891e3..961cffec7f6 100644
Binary files a/icons/mob/talk.dmi and b/icons/mob/talk.dmi differ
diff --git a/icons/mob/ties.dmi b/icons/mob/ties.dmi
index bbb986c088e..e399e5e3a8b 100644
Binary files a/icons/mob/ties.dmi and b/icons/mob/ties.dmi differ
diff --git a/icons/obj/clothing/ties.dmi b/icons/obj/clothing/ties.dmi
index 4799e9ad963..7675ec0d51c 100644
Binary files a/icons/obj/clothing/ties.dmi and b/icons/obj/clothing/ties.dmi differ
diff --git a/icons/obj/clothing/ties_overlay.dmi b/icons/obj/clothing/ties_overlay.dmi
index 975059bfeeb..fd3b6023185 100644
Binary files a/icons/obj/clothing/ties_overlay.dmi and b/icons/obj/clothing/ties_overlay.dmi differ
diff --git a/libmariadb.so b/libmariadb.so
old mode 100644
new mode 100755
diff --git a/librust_g.so b/librust_g.so
old mode 100644
new mode 100755
index d70052a39c9..57d9ed9fa57
Binary files a/librust_g.so and b/librust_g.so differ
diff --git a/nano/templates/pda_janitor.tmpl b/nano/templates/pda_janitor.tmpl
index a2fd282ad3f..864692d8a04 100644
--- a/nano/templates/pda_janitor.tmpl
+++ b/nano/templates/pda_janitor.tmpl
@@ -8,43 +8,59 @@
{{/if}}
+ERROR: An Ionspheric overload has occured. Please wait for the machine to reboot. This cannot be manually done.
+
+{{/if}}
+
{{if data.tab == "CONFIG"}}