Conflicts:
	code/game/objects/items/weapons/kitchen.dm
This commit is contained in:
Markolie
2015-02-25 20:44:32 +01:00
68 changed files with 1185 additions and 690 deletions
+5 -5
View File
@@ -54,11 +54,11 @@
if(target.initialize_directions_he & get_dir(target,src))
node2 = target
break
if(!node1 && !node2)
del(src)
return
update_icon()
return
@@ -105,10 +105,10 @@
if(target.initialize_directions_he & get_dir(target,src))
node2 = target
break
if(!node1 && !node2)
del(src)
return
qdel(src)
return
update_icon()
return
+28 -27
View File
@@ -55,9 +55,10 @@
return parent.return_network(reference)
/obj/machinery/atmospherics/pipe/Del()
/obj/machinery/atmospherics/pipe/Destroy()
del(parent)
if(air_temporary)
if(air_temporary && loc)
loc.assume_air(air_temporary)
..()
@@ -70,7 +71,7 @@
if(istype(W,/obj/item/device/pipe_painter))
return 0
if (istype(W, /obj/item/device/pipe_freezer))
if(!src.frozen) // If the pipe is not already frozen
user << "\red You begin to freeze the [src]"
@@ -88,7 +89,7 @@
"You hear dripping water.")
add_fingerprint(user)
return 1
return 1
if (!istype(W, /obj/item/weapon/wrench))
return ..()
@@ -96,7 +97,7 @@
if (level==1 && isturf(T) && T.intact)
user << "\red You must remove the plating first."
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
@@ -129,7 +130,7 @@
/*
/obj/machinery/atmospherics/pipe/add_underlay(var/obj/machinery/atmospherics/node, var/direction)
if(istype(src, /obj/machinery/atmospherics/pipe/tank)) //todo: move tanks to unary devices
if(istype(src, /obj/machinery/atmospherics/pipe/tank)) //todo: move tanks to unary devices
return ..()
if(node)
@@ -182,7 +183,7 @@
/obj/machinery/atmospherics/pipe/simple/New()
..()
// Pipe colors and icon states are handled by an image cache - so color and icon should
// be null. For mapping purposes color is defined in the object definitions.
icon = null
@@ -242,7 +243,7 @@
else if(dir==12)
dir = 4
/obj/machinery/atmospherics/pipe/simple/Del()
/obj/machinery/atmospherics/pipe/simple/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -276,7 +277,7 @@
if (meter.target == src)
new /obj/item/pipe_meter(T)
del(meter)
del(src)
qdel(src)
else if(node1 && node2)
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type)
else
@@ -313,9 +314,9 @@
src.connected_to = c
node2 = target
break
if(!node1 && !node2)
del(src)
qdel(src)
return
var/turf/T = get_turf(src)
@@ -359,7 +360,7 @@
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/simple/visible/yellow
color = PIPE_COLOR_YELLOW
@@ -394,7 +395,7 @@
layer = 2.39
icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/simple/visible/universal
name="Universal pipe adapter"
desc = "An adapter for regular, supply and scrubbers pipes"
@@ -567,7 +568,7 @@
else
. = PROCESS_KILL
/obj/machinery/atmospherics/pipe/manifold/Del()
/obj/machinery/atmospherics/pipe/manifold/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -620,19 +621,19 @@
if (meter.target == src)
new /obj/item/pipe_meter(T)
del(meter)
del(src)
qdel(src)
else
overlays.Cut()
overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type)
overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type)
underlays.Cut()
var/turf/T = get_turf(src)
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
var/node1_direction = get_dir(src, node1)
var/node2_direction = get_dir(src, node2)
var/node3_direction = get_dir(src, node3)
directions -= dir
directions -= add_underlay(T,node1,node1_direction,icon_connect_type)
@@ -692,7 +693,7 @@
break
if (node3)
break
if(!node1 && !node2 && !node3)
del(src)
return
@@ -804,7 +805,7 @@
else
. = PROCESS_KILL
/obj/machinery/atmospherics/pipe/manifold4w/Del()
/obj/machinery/atmospherics/pipe/manifold4w/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -866,13 +867,13 @@
if (meter.target == src)
new /obj/item/pipe_meter(T)
del(meter)
del(src)
qdel(src)
else
overlays.Cut()
overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type)
overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type)
underlays.Cut()
/*
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
@@ -884,7 +885,7 @@
for(var/D in directions)
add_underlay(,D)
*/
var/turf/T = get_turf(src)
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
var/node1_direction = get_dir(src, node1)
@@ -948,7 +949,7 @@
src.connected_to = c
node4 = target
break
if(!node1 && !node2 && !node3&& !node4)
del(src)
return
@@ -1059,7 +1060,7 @@
..()
else
. = PROCESS_KILL
/obj/machinery/atmospherics/pipe/cap/Del()
/obj/machinery/atmospherics/pipe/cap/Destroy()
if(node)
node.disconnect(src)
@@ -1176,7 +1177,7 @@
else
. = PROCESS_KILL
/obj/machinery/atmospherics/pipe/tank/Del()
/obj/machinery/atmospherics/pipe/tank/Destroy()
if(node1)
node1.disconnect(src)
@@ -1263,7 +1264,7 @@
air_temporary.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)
air_temporary.nitrogen = (25*ONE_ATMOSPHERE*N2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)
..()
..()
icon_state = "air"
/obj/machinery/atmospherics/pipe/tank/oxygen
@@ -1376,7 +1377,7 @@
else
parent.mingle_with_turf(loc, volume)
/obj/machinery/atmospherics/pipe/vent/Del()
/obj/machinery/atmospherics/pipe/vent/Destroy()
if(node1)
node1.disconnect(src)
+87 -61
View File
@@ -1,5 +1,5 @@
/*
* Experimental procs by ESwordTheCat.
* Experimental procs by ESwordTheCat!
*/
/*
@@ -15,7 +15,7 @@
* -1, parameter B is not a char
* -2, parameter A is not a string
*/
/proc/EgijkAeN(const/A, const/B)
/proc/strpos(const/A, const/B)
if (istext(A) == 0 || length(A) < 1)
return -2
@@ -31,29 +31,24 @@
. = i
i = findtext(A, B, i + 1)
/obj/machinery/proc/getArea()
var/area/A = loc.loc
if (A != myArea)
myArea = A
. = myArea
/**
* Object pooling.
*
* If this file is named experimental,
* well treat this implementation as experimental experimental (redundancy intended).
*
* WARNING, only supports /mob and /obj.
* WARNING, only supports /atom/movable (/mob and /obj)
*/
// Uncomment to show debug messages.
//#define DEBUG_OBJECT_POOL
#define MAINTAINING_OBJECT_POOL_COUNT 20
#define MAINTAINING_OBJECT_POOL_COUNT 500
var/list/masterPool = list()
var/global/list/masterPool = new
// Read-only or compile-time vars and special exceptions.
var/list/exclude = list("inhand_states", "loc", "locs", "parent_type", "vars", "verbs", "type", "x", "y", "z")
/*
* @args
@@ -62,27 +57,35 @@ var/list/masterPool = list()
*
* Example call: getFromPool(/obj/item/weapon/shard, loc)
*/
/proc/getFromPool(const/A, const/B)
if (isnull(masterPool[A]))
/proc/getFromPool()
var/A = args[1]
var/list/B = list()
B += (args - A)
if(length(masterPool["[A]"]) <= 0)
#ifdef DEBUG_OBJECT_POOL
world << "DEBUG_OBJECT_POOL: new proc has been called ([A])."
world << text("DEBUG_OBJECT_POOL: new proc has been called ([]).", A)
#endif
//so the GC knows we're pooling this type.
if(isnull(masterPool["[A]"]))
masterPool["[A]"] = list(new A)
if(B && B.len)
return new A(arglist(B))
else
return new A()
return new A(B)
var/atom/movable/Object = masterPool[A][1]
masterPool[A] -= Object
var/objectLength = length(masterPool[A])
var/atom/movable/O = masterPool["[A]"][1]
masterPool["[A]"] -= O
#ifdef DEBUG_OBJECT_POOL
world << "DEBUG_OBJECT_POOL: getFromPool([A]) [objectLength] left."
world << text("DEBUG_OBJECT_POOL: getFromPool([]) [] left.", A, length(masterPool[A]))
#endif
if (!objectLength)
masterPool[A] = null
Object.loc = B
return Object
if(!O || !istype(O))
O = new A(arglist(B))
else
if(length(B))
O.loc = B[1]
O.New(arglist(B))
return O
/*
* @args
@@ -93,31 +96,26 @@ var/list/masterPool = list()
*
* Example call: returnToPool(src)
*/
/proc/returnToPool(const/A)
if (!istype(A, /atom/movable))
return -1
/proc/returnToPool(const/atom/movable/AM)
if(istype(AM.loc,/mob/living))
var/mob/living/L = AM.loc
L.unEquip(AM)
if(length(masterPool["[AM.type]"]) > MAINTAINING_OBJECT_POOL_COUNT)
#ifdef DEBUG_OBJECT_POOL
world << text("DEBUG_OBJECT_POOL: returnToPool([]) exceeds [] discarding...", AM.type, MAINTAINING_OBJECT_POOL_COUNT)
#endif
var/atom/movable/Object = A
Object.resetVariables()
qdel(AM, 1)
return
switch(length(masterPool[Object.type]))
if (MAINTAINING_OBJECT_POOL_COUNT to 1.#INF)
#ifdef DEBUG_OBJECT_POOL
world << "DEBUG_OBJECT_POOL: returnToPool([Object.type]) exceeds [num2text(MAINTAINING_OBJECT_POOL_COUNT)] discarding..."
#endif
if(isnull(masterPool["[AM.type]"]))
masterPool["[AM.type]"] = list()
return
if (0) // In a numeric context (like a mathematical operation), null evaluates to 0.
#ifdef DEBUG_OBJECT_POOL
world << "DEBUG_OBJECT_POOL: [Object.type] pool is empty, recreating pool."
#endif
masterPool[Object.type] = list()
masterPool[Object.type] += Object
AM.resetVariables()
masterPool["[AM.type]"] += AM
#ifdef DEBUG_OBJECT_POOL
world << "DEBUG_OBJECT_POOL: returnToPool([Object.type]) [length(masterPool[Object.type])] left."
world << text("DEBUG_OBJECT_POOL: returnToPool([]) [] left.", AM.type, length(masterPool["[AM.type]"]))
#endif
#undef MAINTAINING_OBJECT_POOL_COUNT
@@ -127,20 +125,48 @@ var/list/masterPool = list()
#endif
/*
* Override this if the object variables needed to reset.
* if you have a variable that needed to be preserve, override this and call ..
*
* Example: see, code\game\objects\items\stacks\sheets\glass.dm
* @/obj/item/weapon/shard
* @resetVariables()
* example
*
* /obj/item/resetVariables()
* ..("var1", "var2", "var3")
*
* however, if the object has a child type an it has overridden resetVariables()
* this should be
*
* /obj/item/resetVariables()
* ..("var1", "var2", "var3", args)
*
* /obj/item/weapon/resetVariables()
* ..("var4")
*/
/atom/movable
proc/resetVariables()
var/list/exclude = list("loc", "locs", "parent_type", "vars", "verbs", "type") // Read-only or compile-time vars and whatevs.
exclude += args // Explicit var exclusion
var/list/varsCopy = vars - exclude
var/key
/atom/movable/proc/resetVariables()
loc = null
for (key in varsCopy)
vars[key] = initial(vars[key])
var/list/exclude = global.exclude + args // explicit var exclusion
vars["loc"] = null // Making sure the loc is null not a compile-time var value.
for(var/key in vars)
if(key in exclude)
continue
vars[key] = initial(vars[key])
/proc/isInTypes(atom/Object, types)
var/prototype = Object.type
Object = null
for (var/type in params2list(types))
if (ispath(prototype, text2path(type)))
return 1
return 0
/obj/machinery/proc/getArea()
var/area/A = loc.loc
if (A != myArea)
myArea = A
. = myArea
+2 -2
View File
@@ -108,7 +108,7 @@ var/const/tk_maxrange = 15
return
var/d = get_dist(user, target)
if(focus)
if(focus)
d = max(d,get_dist(user,focus)) // whichever is further
if(d > tk_maxrange)
user << "<span class='warning'>Your mind won't reach that far.</span>"
@@ -163,7 +163,7 @@ var/const/tk_maxrange = 15
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
qdel(O)
return
@@ -160,14 +160,6 @@ atom/movable/New()
trueLuminosity = luminosity * luminosity
light = new(src)
//Objects with opacity will trigger nearby lights to update at next lighting process.
atom/movable/Destroy()
if(opacity)
if(isturf(loc))
if(loc:lighting_lumcount > 1)
UpdateAffectingLights()
..()
//Sets our luminosity.
//If we have no light it will create one.
+7 -7
View File
@@ -134,12 +134,12 @@
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
var/default_laws = 0 //Controls what laws the AI spawns with.
var/list/station_levels = list(1) // Defines which Z-levels the station exists on.
var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle
var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect
var/list/player_levels = list(1, 3, 4, 5, 6, 7) // Defines all Z-levels a character can typically reach
var/const/minutes_to_ticks = 60 * 10
// Event settings
var/expected_round_length = 60 * 2 * minutes_to_ticks // 2 hours
@@ -168,7 +168,7 @@
src.probabilities[M.config_tag] = M.probability
if (M.votable)
src.votable_modes += M.config_tag
del(M)
qdel(M)
src.votable_modes += "secret"
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
@@ -209,9 +209,9 @@
if ("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
config.use_age_restriction_for_antags = 1
if ("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
@@ -462,7 +462,7 @@
if("max_maint_drones")
config.max_maint_drones = text2num(value)
if("station_levels")
config.station_levels = text2numlist(value, ";")
@@ -474,7 +474,7 @@
if("player_levels")
config.player_levels = text2numlist(value, ";")
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
+55 -45
View File
@@ -1,68 +1,78 @@
var/datum/controller/failsafe/Failsafe
var/global/datum/controller/failsafe/failsafe
/datum/controller/failsafe // This thing pretty much just keeps poking the master controller
var/processing = 0
var/processing_interval = 100 //poke the MC every 10 seconds
/datum/controller/failsafe // This thing pretty much just keeps poking the controllers.
processing_interval = 100 // Poke the controllers every 10 seconds.
var/MC_iteration = 0
var/MC_defcon = 0 //alert level. For every poke that fails this is raised by 1. When it reaches 5 the MC is replaced with a new one. (effectively killing any master_controller.process() and starting a new one)
/*
* Controller alert level.
* For every poke that fails this is raised by 1.
* When it reaches 5 the MC is replaced with a new one
* (effectively killing any controller process() and starting a new one).
*/
var/lighting_iteration = 0
var/lighting_defcon = 0 //alert level for lighting controller.
// master
var/masterControllerIteration = 0
var/masterControllerAlertLevel = 0
// lighting
var/lightingControllerIteration = 0
var/lightingControllerAlertLevel = 0
/datum/controller/failsafe/New()
//There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one)
if(Failsafe != src)
if(istype(Failsafe))
del(Failsafe)
Failsafe = src
Failsafe.process()
. = ..()
// There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one).
if (failsafe != src)
if (istype(failsafe))
recover()
qdel(failsafe)
failsafe = src
failsafe.process()
/datum/controller/failsafe/proc/process()
processing = 1
spawn(0)
//set background = 1
while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop
if(!master_controller) new /datum/controller/game_controller() //replace the missing master_controller! This should never happen.
if(!lighting_controller) new /datum/controller/lighting() //replace the missing lighting_controller
set background = BACKGROUND_ENABLED
while(1) // More efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop.
iteration++
if(processing)
if(master_controller.processing) //only poke if these overrides aren't in effect
if(MC_iteration == controller_iteration) //master_controller hasn't finished processing in the defined interval
switch(MC_defcon)
if(master_controller.processing) // Only poke if these overrides aren't in effect
if(masterControllerIteration == master_controller.iteration) // Master controller hasn't finished processing in the defined interval.
switch(masterControllerAlertLevel)
if(0 to 3)
MC_defcon++
masterControllerAlertLevel++
if(4)
admins << "<font color='red' size='2'><b>Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
MC_defcon = 5
admins << "<font color='red' size='2'><b>Warning. The master Controller has not fired in the last [masterControllerAlertLevel * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
masterControllerAlertLevel = 5
if(5)
admins << "<font color='red' size='2'><b>Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process)
master_controller.process() //Start it rolling again
MC_defcon = 0
admins << "<font color='red' size='2'><b>Warning. The master Controller has still not fired within the last [masterControllerAlertLevel * processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/game_controller() // Replace the old master controller (hence killing the old one's process).
master_controller.process() // Start it rolling again.
masterControllerAlertLevel = 0
else
MC_defcon = 0
MC_iteration = controller_iteration
masterControllerAlertLevel = 0
masterControllerIteration = master_controller.iteration
if(lighting_controller.processing)
if(lighting_iteration == lighting_controller.iteration) //master_controller hasn't finished processing in the defined interval
switch(lighting_defcon)
if(lightingControllerIteration == lighting_controller.iteration) // Lighting controller hasn't finished processing in the defined interval.
switch(lightingControllerAlertLevel)
if(0 to 3)
lighting_defcon++
lightingControllerAlertLevel++
if(4)
admins << "<font color='red' size='2'><b>Warning. The Lighting Controller has not fired in the last [lighting_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
lighting_defcon = 5
admins << "<font color='red' size='2'><b>Warning. The lighting_controller controller has not fired in the last [lightingControllerAlertLevel * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
lightingControllerAlertLevel = 5
if(5)
admins << "<font color='red' size='2'><b>Warning. The Lighting Controller has still not fired within the last [lighting_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/lighting() //replace the old lighting_controller (hence killing the old one's process)
lighting_controller.process() //Start it rolling again
lighting_defcon = 0
admins << "<font color='red' size='2'><b>Warning. The lighting_controller controller has still not fired within the last [lightingControllerAlertLevel * processing_interval] ticks. Killing and restarting...</b></font>"
new /datum/controller/lighting() // Replace the old lighting_controller (hence killing the old one's process).
lighting_controller.process() // Start it rolling again.
lightingControllerAlertLevel = 0
else
lighting_defcon = 0
lighting_iteration = lighting_controller.iteration
else
MC_defcon = 0
lighting_defcon = 0
lightingControllerAlertLevel = 0
lightingControllerIteration = lighting_controller.iteration
sleep(processing_interval)
sleep(processing_interval)
+172 -110
View File
@@ -1,124 +1,186 @@
#define GC_COLLECTIONS_PER_TICK 300 // Was 100.
#define GC_COLLECTION_TIMEOUT (30 SECONDS)
#define GC_FORCE_DEL_PER_TICK 60
//#define GC_DEBUG
#define GC_COLLECTIONS_PER_TICK 250 // Was 100
#define GC_COLLECTION_TIMEOUT 100 // 10s
var/global/datum/controller/garbage_collector/garbage
var/global/list/uncollectable_vars=list(
"alpha",
"bestF",
"bounds",
"bound_height",
"bound_width",
"ckey",
"color",
"contents",
"gender",
"group",
"key",
//"loc",
"locs",
"luminosity",
"parent",
"parent_type",
"step_size",
"glide_size",
"gc_destroyed",
"step_x",
"step_y",
"step_z",
"tag",
"thermal_conductivity",
"type",
"vars",
"verbs",
"x",
"y",
"z",
)
/datum/controller/garbage_collector
var/list/queue=list()
var/list/destroyed=list()
var/waiting=0
var/del_everything=1
var/turf/trashbin=null
var/list/gc_hard_del_types = new
var/datum/garbage_collector/garbageCollector
New()
trashbin=locate(0,0,CENTCOMM_Z)
/client/proc/gc_dump_hdl()
set name = "(GC) Hard Del List"
set desc = "List types that are hard del()'d by the GC."
set category = "Debug"
proc/AddTrash(var/atom/movable/A)
if(!A)
return
if(del_everything)
del(A)
return
A.loc=trashbin
queue.Add(A)
waiting++
for(var/A in gc_hard_del_types)
usr << "[A] = [gc_hard_del_types[A]]"
proc/Pop()
var/atom/movable/A = queue[1]
if(!A)
if(isnull(A))
var/loopcheck = 0
while(queue.Remove(null))
loopcheck++
if(loopcheck > 50)
break
return
if(del_everything)
del(A)
return
if(!istype(A,/atom/movable))
testing("GC given a [A.type].")
del(A)
return
for(var/vname in A.vars)
if(!issaved(A.vars[vname]))
continue
if(vname in uncollectable_vars)
continue
//testing("Unsetting [vname] in [A.type]!")
A.vars[vname]=null
A.loc=null
destroyed.Add("\ref[A]")
queue.Remove(A)
/datum/garbage_collector
var/list/queue = new
var/del_everything = 0
proc/process()
for(var/i=0;i<min(waiting,GC_COLLECTIONS_PER_TICK);i++)
if(waiting)
Pop()
waiting--
for(var/i=0;i<min(destroyed.len,GC_COLLECTIONS_PER_TICK);i++)
if(destroyed.len)
var/refID=destroyed[1]
var/atom/A = locate(refID)
if(A && A.gc_destroyed && A.gc_destroyed >= world.time - GC_COLLECTION_TIMEOUT)
// Something's still referring to the qdel'd object. Kill it.
del(A)
destroyed.Remove(refID)
// To let them know how hardworking am I :^).
var/dels_count = 0
var/hard_dels = 0
var/soft_dels = 0
/**
* NEVER USE THIS FOR ANYTHING OTHER THAN /atom/movable
* OTHER TYPES CANNOT BE QDEL'D BECAUSE THEIR LOC IS LOCKED OR THEY DON'T HAVE ONE.
*/
/proc/qdel(var/atom/movable/A)
if(!A) return
if(!istype(A))
warning("qdel() passed object of type [A.type]. qdel() can only handle /atom/movable types.")
del(A)
/datum/garbage_collector/proc/addTrash(const/atom/movable/AM)
if(!istype(AM))
return
if(!garbage)
del(A)
if(del_everything)
del(AM)
hard_dels++
dels_count++
return
// Let our friend know they're about to get fucked up.
A.Destroy()
garbage.AddTrash(A)
queue["\ref[AM]"] = world.timeofday
/datum/garbage_collector/proc/process()
var/remainingCollectionPerTick = GC_COLLECTIONS_PER_TICK
var/remainingForceDelPerTick = GC_FORCE_DEL_PER_TICK
var/collectionTimeScope = world.timeofday - GC_COLLECTION_TIMEOUT
if(narsie_cometh) return //don't even fucking bother, its over.
while(queue.len && --remainingCollectionPerTick >= 0)
var/refID = queue[1]
var/destroyedAtTime = queue[refID]
if(destroyedAtTime > collectionTimeScope)
break
var/atom/movable/AM = locate(refID)
if(AM) // Something's still referring to the qdel'd object. del it.
if(isnull(AM.gcDestroyed))
queue -= refID
continue
if(remainingForceDelPerTick <= 0)
break
#ifdef GC_DEBUG
WARNING("gc process force delete [AM.type]")
#endif
AM.hard_deleted = 1
if(!AM.type in gc_hard_del_types)
gc_hard_del_types += AM.type
del AM
hard_dels++
remainingForceDelPerTick--
#ifdef GC_DEBUG
#undef GC_DEBUG
#endif
#undef GC_FORCE_DEL_PER_TICK
#undef GC_COLLECTION_TIMEOUT
#undef GC_COLLECTIONS_PER_TICK
/datum/garbage_collector/proc/dequeue(id)
if (queue)
queue -= id
dels_count++
/*
* NEVER USE THIS FOR ANYTHING OTHER THAN /atom/movable
* OTHER TYPES CANNOT BE QDEL'D BECAUSE THEIR LOC IS LOCKED OR THEY DON'T HAVE ONE.
*/
/proc/qdel(const/atom/movable/AM, ignore_pooling = 0)
if(isnull(AM))
return
if(isnull(garbageCollector))
del(AM)
return
if(!istype(AM))
WARNING("qdel() passed object of type [AM.type]. qdel() can only handle /atom/movable types.")
if(!AM.type in gc_hard_del_types)
gc_hard_del_types += AM.type
del(AM)
garbageCollector.hard_dels++
garbageCollector.dels_count++
return
//We are object pooling this.
if(("[AM.type]" in masterPool) && !ignore_pooling)
returnToPool(AM)
return
if(isnull(AM.gcDestroyed))
// Let our friend know they're about to get fucked up.
AM.Destroy()
garbageCollector.addTrash(AM)
/datum/controller
var/processing = 0
var/iteration = 0
var/processing_interval = 0
/datum/controller/proc/recover() // If we are replacing an existing controller (due to a crash) we attempt to preserve as much as we can.
/*
* Like Del(), but for qdel.
* Called BEFORE qdel moves shit.
*/
/datum/proc/Destroy()
del(src)
/client/proc/qdel_toggle()
set name = "Toggle qdel Behavior"
set desc = "Toggle qdel usage between normal and force del()."
set category = "Debug"
garbage.del_everything = !garbage.del_everything
world << "<b>GC: qdel turned [garbage.del_everything?"off":"on"].</b>"
log_admin("[key_name(usr)] turned qdel [garbage.del_everything?"off":"on"].")
message_admins("\blue [key_name(usr)] turned qdel [garbage.del_everything?"off":"on"].", 1)
garbageCollector.del_everything = !garbageCollector.del_everything
world << "<b>GC: qdel turned [garbageCollector.del_everything ? "off" : "on"].</b>"
log_admin("[key_name(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].")
message_admins("\blue [key_name(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].", 1)
/*/client/var/running_find_references
/atom/verb/find_references()
set category = "Debug"
set name = "Find References"
set background = 1
set src in world
if(!usr || !usr.client)
return
if(usr.client.running_find_references)
testing("CANCELLED search for references to a [usr.client.running_find_references].")
usr.client.running_find_references = null
return
if(alert("Running this will create a lot of lag until it finishes. You can cancel it by running it again. Would you like to begin the search?", "Find References", "Yes", "No") == "No")
return
qdel(src)
// Remove this object from the list of things to be auto-deleted.
if(garbageCollector)
garbageCollector.queue -= "\ref[src]"
usr.client.running_find_references = type
testing("Beginning search for references to a [type].")
var/list/things = list()
for(var/client/thing)
things += thing
for(var/datum/thing)
things += thing
for(var/atom/thing)
things += thing
for(var/event/thing)
things += thing
testing("Collected list of things in search for references to a [type]. ([things.len] Thing\s)")
for(var/datum/thing in things)
if(!usr.client.running_find_references) return
for(var/varname in thing.vars)
var/variable = thing.vars[varname]
if(variable == src)
testing("Found [src.type] \ref[src] in [thing.type]'s [varname] var.")
else if(islist(variable))
if(src in variable)
testing("Found [src.type] \ref[src] in [thing.type]'s [varname] list var.")
testing("Completed search for references to a [type].")
usr.client.running_find_references = null
*/
+2 -4
View File
@@ -1,10 +1,8 @@
var/datum/controller/lighting/lighting_controller = new ()
datum/controller/lighting
var/processing = 0
var/processing_interval = 5 //setting this too low will probably kill the server. Don't be silly with it!
processing_interval = 5 //setting this too low will probably kill the server. Don't be silly with it!
var/process_cost = 0
var/iteration = 0
var/lighting_states = 7
@@ -21,7 +19,7 @@ datum/controller/lighting/New()
if(lighting_controller != src)
if(istype(lighting_controller,/datum/controller/lighting))
Recover() //if we are replacing an existing lighting_controller (due to a crash) we attempt to preserve as much as we can
del(lighting_controller)
qdel(lighting_controller)
lighting_controller = src
+8 -11
View File
@@ -11,7 +11,6 @@ var/global/air_processing_killed = 0
var/global/pipe_processing_killed = 0
datum/controller/game_controller
var/processing = 0
var/breather_ticks = 2 //a somewhat crude attempt to iron over the 'bumps' caused by high-cpu use by letting the MC have a breather for this many ticks after every loop
var/minimum_ticks = 20 //The minimum length of time between MC ticks
@@ -28,7 +27,7 @@ datum/controller/game_controller
var/events_cost = 0
var/puddles_cost
var/ticker_cost = 0
var/gc_cost = 0
var/garbageCollectorCost = 0
var/total_cost = 0
var/last_thing_processed
@@ -36,13 +35,14 @@ datum/controller/game_controller
var/list/shuttle_list // For debugging and VV
var/datum/ore_distribution/asteroid_ore_map // For debugging and VV.
var/global/datum/garbage_collector/garbageCollector
datum/controller/game_controller/New()
//There can be only one master_controller. Out with the old and in with the new.
if(master_controller != src)
if(istype(master_controller))
Recover()
del(master_controller)
qdel(master_controller)
master_controller = src
if(!job_master)
@@ -71,9 +71,6 @@ datum/controller/game_controller/proc/setup()
ticker = new /datum/controller/gameticker()
*/
if(!garbage)
garbage = new /datum/controller/garbage_collector()
color_windows_init()
setup_objects()
@@ -134,7 +131,7 @@ datum/controller/game_controller/proc/process()
spawn(0)
//set background = 1
while(1) //far more efficient than recursively calling ourself
if(!Failsafe) new /datum/controller/failsafe()
if(!failsafe) new /datum/controller/failsafe()
if(processing)
@@ -246,12 +243,12 @@ datum/controller/game_controller/proc/process()
// GC
timer = world.timeofday
last_thing_processed = garbage.type
garbage.process()
gc_cost = (world.timeofday - timer) / 10
last_thing_processed = garbageCollector.type
garbageCollector.process()
garbageCollectorCost = (world.timeofday - timer) / 10
//TIMING
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + aibots_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + puddles_cost + ticker_cost + gc_cost
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + aibots_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + puddles_cost + ticker_cost + garbageCollectorCost
var/end_time = world.timeofday
if(end_time < start_time) //why not just use world.time instead?
+12 -9
View File
@@ -49,7 +49,7 @@
return
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras","Garbage", "Transfer Controller","Event"))
/client/proc/debug_controller(controller in list("Master","failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras","Garbage", "Transfer Controller","Event","Scheduler"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
@@ -59,18 +59,15 @@
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
if("Failsafe")
debug_variables(Failsafe)
feedback_add_details("admin_verb","DFailsafe")
if ("failsafe")
debug_variables(failsafe)
feedback_add_details("admin_verb", "dfailsafe")
if("Ticker")
debug_variables(ticker)
feedback_add_details("admin_verb","DTicker")
if("Lighting")
debug_variables(lighting_controller)
feedback_add_details("admin_verb","DLighting")
if("Garbage")
debug_variables(garbage)
feedback_add_details("admin_verb","DGarbage")
if("Air")
debug_variables(air_master)
feedback_add_details("admin_verb","DAir")
@@ -103,7 +100,13 @@
feedback_add_details("admin_verb","DCameras")
if("Event")
debug_variables(event_manager)
feedback_add_details("admin_verb","DEvent")
feedback_add_details("admin_verb","DEvent")
if("Garbage")
debug_variables(garbageCollector)
feedback_add_details("admin_verb","DGarbage")
if("Scheduler")
debug_variables(processScheduler)
feedback_add_details("admin_verb","DprocessScheduler")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
return
+1 -1
View File
@@ -17,7 +17,7 @@ datum/controller/vote
New()
if(vote != src)
if(istype(vote))
del(vote)
qdel(vote)
vote = src
proc/process() //called by master_controller
+2 -2
View File
@@ -627,7 +627,7 @@ client
for(var/obj/Obj in world)
if(Obj.type == O_type)
i++
del(Obj)
qdel(Obj)
if(!i)
usr << "No objects of this type exist"
return
@@ -638,7 +638,7 @@ client
for(var/obj/Obj in world)
if(istype(Obj,O_type))
i++
del(Obj)
qdel(Obj)
if(!i)
usr << "No objects of this type exist"
return
@@ -231,7 +231,7 @@
user.visible_message(fixText(state["vis_msg"],user),fixText(state["self_msg"],user))
if("delete" in state)
del(used_atom)
qdel(used_atom)
else if("spawn" in state)
var/spawntype=state["spawn"]
var/atom/A = new spawntype(holder.loc)
+1 -1
View File
@@ -49,7 +49,7 @@
//must succeed in most cases
proc/setTeleatom(atom/movable/ateleatom)
if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
del(ateleatom)
qdel(ateleatom)
return 0
if(istype(ateleatom))
teleatom = ateleatom
+26 -26
View File
@@ -735,7 +735,7 @@ datum/mind
var/obj/item/device/flash/flash = locate() in L
if (!flash)
usr << "\red Deleting flash failed!"
del(flash)
qdel(flash)
if("repairflash")
var/list/L = current.get_contents()
@@ -748,7 +748,7 @@ datum/mind
if("reequip")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
del(flash)
qdel(flash)
take_uplink()
var/fail = 0
fail |= !ticker.mode.equip_traitor(current, 1)
@@ -927,17 +927,17 @@ datum/mind
if("lair")
current.loc = get_turf(locate("landmark*Syndicate-Spawn"))
if("dressup")
del(H.belt)
del(H.back)
del(H.l_ear)
del(H.r_ear)
del(H.gloves)
del(H.head)
del(H.shoes)
del(H.wear_id)
del(H.wear_pda)
del(H.wear_suit)
del(H.w_uniform)
qdel(H.belt)
qdel(H.back)
qdel(H.l_ear)
qdel(H.r_ear)
qdel(H.gloves)
qdel(H.head)
qdel(H.shoes)
qdel(H.wear_id)
qdel(H.wear_pda)
qdel(H.wear_suit)
qdel(H.w_uniform)
if (!ticker.mode.equip_syndicate(current))
usr << "\red Equipping a syndicate failed!"
@@ -1150,7 +1150,7 @@ datum/mind
proc/take_uplink()
var/obj/item/device/uplink/hidden/H = find_syndicate_uplink()
if(H)
del(H)
qdel(H)
proc/make_AI_Malf()
@@ -1191,17 +1191,17 @@ datum/mind
current.loc = get_turf(locate("landmark*Syndicate-Spawn"))
var/mob/living/carbon/human/H = current
del(H.belt)
del(H.back)
del(H.l_ear)
del(H.r_ear)
del(H.gloves)
del(H.head)
del(H.shoes)
del(H.wear_id)
del(H.wear_pda)
del(H.wear_suit)
del(H.w_uniform)
qdel(H.belt)
qdel(H.back)
qdel(H.l_ear)
qdel(H.r_ear)
qdel(H.gloves)
qdel(H.head)
qdel(H.shoes)
qdel(H.wear_id)
qdel(H.wear_pda)
qdel(H.wear_suit)
qdel(H.w_uniform)
ticker.mode.equip_syndicate(current)
@@ -1290,7 +1290,7 @@ datum/mind
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
del(flash)
qdel(flash)
take_uplink()
var/fail = 0
// fail |= !ticker.mode.equip_traitor(current, 1)
+2 -2
View File
@@ -79,7 +79,7 @@
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
O.reagents.trans_to(result_obj, O.reagents.total_volume)
del(O)
qdel(O)
container.reagents.clear_reagents()
return result_obj
@@ -91,7 +91,7 @@
O.reagents.del_reagent("nutriment")
O.reagents.update_total()
O.reagents.trans_to(result_obj, O.reagents.total_volume)
del(O)
qdel(O)
container.reagents.clear_reagents()
return result_obj
+5 -5
View File
@@ -234,7 +234,7 @@
if(H)
user << "<span class='notice'>You use [src] to destroy [H].</span>"
signs -= H
del(H)
qdel(H)
else
if(signs.len < max_signs)
H = new(get_turf(target))
@@ -250,7 +250,7 @@
if(signs.len)
var/list/L = signs.Copy()
for(var/sign in L)
del(sign)
qdel(sign)
signs -= sign
user << "<span class='notice'>You clear all active holograms.</span>"
@@ -313,7 +313,7 @@
if(ishuman(C))
dead_legs(C)
if(src)
del(src)
qdel(src)
proc/dead_legs(mob/living/carbon/human/H as mob)
var/datum/organ/external/l = H.get_organ("l_leg")
@@ -562,8 +562,8 @@
if(istype(A, /obj/effect/plantsegment))
for(var/obj/effect/plantsegment/B in orange(A,1))
if(prob(80))
del B
del A
qdel(B)
qdel(A)
/*
/obj/item/weapon/cigarpacket
+13 -8
View File
@@ -1,3 +1,6 @@
var/global/list/del_profiling = list()
var/global/list/gdel_profiling = list()
var/global/list/ghdel_profiling = list()
/atom
layer = 2
var/level = 2
@@ -24,16 +27,18 @@
// Garbage collection
var/gc_destroyed=null
/atom/Del()
// Pass to Destroy().
if(!gc_destroyed)
Destroy()
..()
/atom/proc/Destroy()
gc_destroyed=world.time
/atom/Destroy()
SetOpacity(0)
if(reagents)
reagents.Destroy()
reagents = null
// Idea by ChuckTheSheep to make the object even more unreferencable.
invisibility = 101
/atom/proc/CheckParts()
return
@@ -242,7 +247,7 @@ its easier to just keep the beam vertical.
return
/atom/proc/emag_act()
return
return
/atom/proc/hitby(atom/movable/AM as mob|obj)
if (density)
+55 -1
View File
@@ -15,13 +15,67 @@
var/mob/pulledby = null
var/area/areaMaster
var/hard_deleted = 0
/atom/movable/New()
. = ..()
areaMaster = get_area_master(src)
/atom/movable/Destroy()
if(opacity)
if(isturf(loc))
if(loc:lighting_lumcount > 1)
UpdateAffectingLights()
gcDestroyed = "Bye, world!"
tag = null
loc = null
/*
if(istype(beams) && beams.len)
for(var/obj/effect/beam/B in beams)
if(B && B.target == src)
B.target = null
if(B.master && B.master.target == src)
B.master.target = null
beams.len = 0
*/
..()
/proc/delete_profile(var/type, code = 0)
if(!ticker || !ticker.current_state < 3) return
switch(code)
if(0)
if (!("[type]" in del_profiling))
del_profiling["[type]"] = 0
del_profiling["[type]"] += 1
if(1)
if (!("[type]" in ghdel_profiling))
ghdel_profiling["[type]"] = 0
ghdel_profiling["[type]"] += 1
if(2)
if (!("[type]" in gdel_profiling))
gdel_profiling["[type]"] = 0
gdel_profiling["[type]"] += 1
if(garbageCollector)
garbageCollector.soft_dels++
/atom/movable/Del()
if (gcDestroyed)
garbageCollector.dequeue("\ref[src]")
if (hard_deleted)
delete_profile("[type]", 1)
else
delete_profile("[type]", 2)
else // direct del calls or nulled explicitly.
delete_profile("[type]", 0)
Destroy()
..()
// Used in shuttle movement and AI eye stuff.
// Primarily used to notify objects being moved by a shuttle/bluespace fuckup.
/atom/movable/proc/setLoc(var/T, var/teleported=0)
+4 -4
View File
@@ -65,7 +65,7 @@
component_parts += new /obj/item/stack/cable_coil(src, 1)
component_parts += new /obj/item/stack/cable_coil(src, 1)
RefreshParts()
/obj/machinery/dna_scannernew/upgraded/New()
..()
component_parts = list()
@@ -233,7 +233,7 @@
return
put_in(G.affecting)
src.add_fingerprint(user)
del(G)
qdel(G)
return
/obj/machinery/dna_scannernew/proc/put_in(var/mob/M)
@@ -309,7 +309,7 @@
if(prob(75))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
del(src)
qdel(src)
/obj/machinery/computer/scan_consolenew
name = "DNA Modifier Access Console"
@@ -367,7 +367,7 @@
/obj/machinery/computer/scan_consolenew/blob_act()
if(prob(75))
del(src)
qdel(src)
/obj/machinery/computer/scan_consolenew/power_change()
if(stat & BROKEN)
+1 -1
View File
@@ -316,7 +316,7 @@
else
usr.visible_message("\red [usr] eats \the [the_item].")
playsound(usr.loc, 'sound/items/eatfood.ogg', 50, 0)
del(the_item)
qdel(the_item)
doHeal(usr)
return
+3 -3
View File
@@ -33,7 +33,7 @@
animation.master = src
flick("h2monkey", animation)
sleep(48)
del(animation)
qdel(animation)
var/mob/living/carbon/monkey/O = null
@@ -56,7 +56,7 @@
for(var/obj/T in (M.contents-implants))
del(T)
qdel(T)
O.loc = M.loc
@@ -78,7 +78,7 @@
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
del(M)
qdel(M)
return
/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags)
+6
View File
@@ -227,6 +227,12 @@ var/global/datum/controller/gameticker/ticker
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
votetimer()
for(var/mob/M in mob_list)
if(istype(M,/mob/new_player))
var/mob/new_player/N = M
N.new_player_panel_proc()
return 1
/datum/controller/gameticker
+3 -1
View File
@@ -1,7 +1,7 @@
/mob/proc/rightandwrong(var/summon_type) //0 = Summon Guns, 1 = Summon Magic
var/list/gunslist = list("taser","egun","laser","revolver","detective","c20r","nuclear","deagle","gyrojet","pulse","silenced","cannon","doublebarrel","shotgun","combatshotgun","bulldog","mateba","sabr","crossbow","saw","car")
var/list/gunslist = list("taser","egun","laser","revolver","detective","c20r","nuclear","deagle","gyrojet","pulse","silenced","cannon","doublebarrel","shotgun","combatshotgun","bulldog","mateba","sabr","crossbow","saw","car","boltaction")
var/list/magiclist = list("fireball","smoke","blind","mindswap","forcewall","knock","horsemask","charge", "summonitem", "wandnothing", "wanddeath", "wandresurrection", "wandpolymorph", "wandteleport", "wanddoor", "wandfireball", "staffhealing", "armor", "scrying", "staffdoor", "special")
var/list/magicspeciallist = list("staffchange","staffanimation", "wandbelt", "contract", "staffchaos")
usr << "<B>You summoned [summon_type ? "magic" : "guns"]!</B>"
@@ -70,6 +70,8 @@
new /obj/item/weapon/gun/projectile/automatic/l6_saw(get_turf(H))
if("car")
new /obj/item/weapon/gun/projectile/automatic/c90gl(get_turf(H))
if("boltaction")
new /obj/item/weapon/gun/projectile/shotgun/boltaction(get_turf(H))
else
switch (randomizemagic)
if("fireball")
+17 -5
View File
@@ -21,6 +21,7 @@ RCD
m_amt = 100000
origin_tech = "engineering=4;materials=2"
var/datum/effect/effect/system/spark_spread/spark_system
var/max_matter = 100
var/matter = 0
var/working = 0
var/mode = 1
@@ -39,15 +40,16 @@ RCD
attackby(obj/item/weapon/W, mob/user, params)
..()
if(istype(W, /obj/item/weapon/rcd_ammo))
if((matter + 20) > 100)
var/obj/item/weapon/rcd_ammo/R = W
if((matter + R.ammoamt) > max_matter)
user << "<span class='notice'>The RCD cant hold any more matter-units.</span>"
return
user.drop_item()
del(W)
matter += 20
matter += R.ammoamt
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user << "<span class='notice'>The RCD now holds [matter]/100 matter-units.</span>"
desc = "A RCD. It currently holds [matter]/100 matter-units."
user << "<span class='notice'>The RCD now holds [matter]/[max_matter] matter-units.</span>"
desc = "A RCD. It currently holds [matter]/[max_matter] matter-units."
return
@@ -186,6 +188,12 @@ RCD
desc = "A device used to rapidly build and deconstruct walls and floors."
canRwall = 1
/obj/item/weapon/rcd/combat
name = "combat RCD"
max_matter = 500
matter = 500
canRwall = 1
/obj/item/weapon/rcd_ammo
name = "compressed matter cartridge"
desc = "Highly compressed matter for the RCD."
@@ -197,4 +205,8 @@ RCD
anchored = 0.0
origin_tech = "materials=2"
m_amt = 16000
g_amt = 8000
g_amt = 8000
var/ammoamt = 20
/obj/item/weapon/rcd_ammo/large
ammoamt = 100
+5 -5
View File
@@ -52,20 +52,20 @@
/obj/item/weapon/defibrillator/proc/update_overlays()
overlays.Cut()
if(!on)
overlays += "defibunit-paddles"
overlays += "[icon_state]-paddles"
if(powered)
overlays += "defibunit-powered"
overlays += "[icon_state]-powered"
if(!bcell)
overlays += "defibunit-nocell"
overlays += "[icon_state]-nocell"
if(!safety)
overlays += "defibunit-emagged"
overlays += "[icon_state]-emagged"
/obj/item/weapon/defibrillator/proc/update_charge()
if(powered) //so it doesn't show charge if it's unpowered
if(bcell)
var/ratio = bcell.charge / bcell.maxcharge
ratio = Ceiling(ratio*4) * 25
overlays += "defibunit-charge[ratio]"
overlays += "[icon_state]-charge[ratio]"
/obj/item/weapon/defibrillator/CheckParts()
bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
@@ -120,6 +120,14 @@
m_amt = 0
g_amt = 0
/obj/item/weapon/stock_parts/cell/pulse/carbine
name = "pulse carbine power cell"
maxcharge = 4000
/obj/item/weapon/stock_parts/cell/pulse/pistol
name = "pulse pistol power cell"
maxcharge = 1600
/obj/item/weapon/stock_parts/cell/emproof
name = "\improper EMP-proof cell"
desc = "An EMP-proof cell."
@@ -134,4 +142,4 @@
return
/obj/item/weapon/stock_parts/cell/emproof/corrupt()
return
return
@@ -59,6 +59,9 @@
new /obj/item/weapon/wirecutters(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
/obj/item/weapon/storage/belt/utility/full/response_team/New()
..()
new /obj/item/device/multitool(src)
/obj/item/weapon/storage/belt/utility/atmostech/New()
..()
@@ -128,6 +131,13 @@
..()
new /obj/item/device/flashlight/seclite(src)
/obj/item/weapon/storage/belt/security/response_team/New()
..()
new /obj/item/weapon/grenade/flashbang(src)
new /obj/item/weapon/grenade/flashbang(src)
new /obj/item/weapon/melee/telebaton(src)
new /obj/item/weapon/restraints/handcuffs(src)
/obj/item/weapon/storage/belt/soulstone
name = "soul stone belt"
desc = "Designed for ease of access to the shards during a fight, as to not let a single enemy spirit slip away"
@@ -77,6 +77,17 @@
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
return
/obj/item/weapon/storage/box/response_team
New()
..()
contents = list()
sleep(1)
new /obj/item/clothing/mask/breath( src )
new /obj/item/weapon/tank/emergency_oxygen/double/full( src )
new /obj/item/clothing/glasses/night( src )
new /obj/item/weapon/kitchenknife/combat( src ) // SURVIVAL KNIFE, FOR CARVING A BOW OUT OF THE BONES OF ASSISTANTS AFTER YOU CRASH-LAND ON THE STATION.
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
return
/obj/item/weapon/storage/box/gloves
name = "box of latex gloves"
@@ -480,7 +491,7 @@
new /obj/item/weapon/restraints/handcuffs(src)
new /obj/item/weapon/restraints/handcuffs(src)
new /obj/item/weapon/restraints/handcuffs(src)
/obj/item/weapon/storage/box/zipties
name = "box of spare zipties"
desc = "A box full of zipties."
@@ -14,43 +14,4 @@
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/weapon/storage/briefcase/New()
..()
/obj/item/weapon/storage/briefcase/attack(mob/living/M as mob, mob/living/user as mob)
//..()
if ((CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>)")
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
if (M.stat < 2 && M.health < 50 && prob(90))
var/mob/H = M
// ******* Check
if ((istype(H, /mob/living/carbon/human) && istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80)))
M << "\red The helmet protects you from being hit hard in the head!"
return
var/time = rand(2, 6)
if (prob(75))
M.Paralyse(time)
else
M.Stun(time)
if(M.stat != 2) M.stat = 1
for(var/mob/O in viewers(M, null))
O.show_message(text("\red <B>[] has been knocked unconscious!</B>", M), 1, "\red You hear someone fall.", 2)
else
M << text("\red [] tried to knock you unconcious!",user)
M.eye_blurry += 3
return
..()
@@ -64,7 +64,7 @@
// -> storage/attackby() what with handle insertion, etc
..()
emag_act(user as mob, weapon as obj)
if(!emagged)
emagged = 1
@@ -177,42 +177,6 @@
src.add_fingerprint(user)
return
//I consider this worthless but it isn't my code so whatever. Remove or uncomment.
/*attack(mob/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
var/t = user:zone_sel.selecting
if (t == "head")
if(ishuman(M))
var/mob/living/carbon/human/H = M
if (H.stat < 2 && H.health < 50 && prob(90))
// ******* Check
if (istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80))
H << "\red The helmet protects you from being hit hard in the head!"
return
var/time = rand(2, 6)
if (prob(75))
H.Paralyse(time)
else
H.Stun(time)
if(H.stat != 2) H.stat = 1
for(var/mob/O in viewers(H, null))
O.show_message(text("\red <B>[] has been knocked unconscious!</B>", H), 1, "\red You hear someone fall.", 2)
else
H << text("\red [] tried to knock you unconcious!",user)
H.eye_blurry += 3
return*/
// -----------------------------
// Secure Safe
// -----------------------------
+2 -1
View File
@@ -25,7 +25,8 @@
/obj/structure/Destroy()
if(hascall(src, "unbuckle"))
src:unbuckle()
..()
/obj/structure/mech_melee_attack(obj/mecha/M)
if(M.damtype == "brute")
M.occupant_message("<span class='danger'>You hit [src].</span>")
+1 -1
View File
@@ -19,7 +19,7 @@
instrumentDir = dir
instrumentObj = obj
/datum/song/proc/Destroy()
/datum/song/Destroy()
instrumentObj = null
return
+173 -12
View File
@@ -55,23 +55,28 @@ var/can_call_ert
usr << "<font color=red><b>You are jobbanned from the emergency reponse team!"
return
if(response_team_members.len > 5) usr << "The emergency response team is already full!"
if(response_team_members.len > 6) usr << "The emergency response team is already full!"
for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Commando")
for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Response Team")
L.name = null//Reserving the place.
var/new_name = input(usr, "Pick a name","Name") as null|text
/*var/new_name = alert(usr, "Pick a name","Name") as null|text
if(!new_name)//Somebody changed his mind, place is available again.
L.name = "Commando"
return*/
if(alert(usr, "Join the ERT?", "Emergency Response Team", "Yes", "No") == "No")
L.name = "Response Team"
return
var/leader_selected = isemptylist(response_team_members)
if(!src.client)
return
var/client/C = src.client
var/mob/living/carbon/human/new_commando = C.create_response_team(L.loc, leader_selected, new_name)
var/mob/living/carbon/human/new_commando = C.create_response_team(L.loc, leader_selected)
del(L)
new_commando.mind.key = usr.key
new_commando.key = usr.key
new_commando.update_icons()
new_commando << "\blue You are [!leader_selected?"a member":"the <B>LEADER</B>"] of an Emergency Response Team, a type of military division, under CentComm's service. There is a code red alert on [station_name()], you are tasked to go and fix the problem."
new_commando << "<b>You should first gear up and discuss a plan with your team. More members may be joining, don't move out before you're ready."
@@ -168,7 +173,7 @@ proc/trigger_armed_response_team(var/force = 0)
continue
*/
/client/proc/create_response_team(obj/spawn_location, leader_selected = 0, commando_name)
/client/proc/create_response_team(obj/spawn_location, leader_selected = 0)
//usr << "\red ERT has been temporarily disabled. Talk to a coder."
//return
@@ -178,7 +183,7 @@ proc/trigger_armed_response_team(var/force = 0)
//todo: god damn this.
//make it a panel, like in character creation
var/new_facial = input("Please select facial hair color.", "Character Generation") as color
/*var/new_facial = input("Please select facial hair color.", "Character Generation") as color
if(new_facial)
M.r_facial = hex2num(copytext(new_facial, 2, 4))
M.g_facial = hex2num(copytext(new_facial, 4, 6))
@@ -262,14 +267,20 @@ proc/trigger_armed_response_team(var/force = 0)
if(new_gender == "Male")
M.gender = MALE
else
M.gender = FEMALE
M.gender = FEMALE*/
//M.rebuild_appearance()
M.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(M)
M.update_hair()
M.update_body()
M.check_dna(M)
M.real_name = commando_name
M.name = commando_name
M.real_name = "[!leader_selected ? pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major") : pick("Lieutenant", "Captain", "Major")] [pick(last_names)]"
M.name = M.real_name
M.age = !leader_selected ? rand(23,35) : rand(35,45)
M.dna.ready_dna(M)//Creates DNA.
@@ -283,10 +294,160 @@ proc/trigger_armed_response_team(var/force = 0)
if(!(M.mind in ticker.minds))
ticker.minds += M.mind//Adds them to regular mind list.
M.loc = spawn_location
M.equip_strike_team(leader_selected)
if(leader_selected)
equip_emergencyresponsesquad(M, "commander")
else
switch(input("Which class?") in list("Security","Engineer","Medical"))
if("Security")
equip_emergencyresponsesquad(M, "sec")
if("Engineer")
equip_emergencyresponsesquad(M, "eng")
if("Medical")
equip_emergencyresponsesquad(M, "med")
return M
/mob/living/carbon/human/proc/equip_strike_team(leader_selected = 0)
/proc/equip_emergencyresponsesquad(var/mob/living/carbon/human/M, var/ertrole)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
L.imp_in = M
L.implanted = 1
switch(ertrole)
if("commander")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/commander(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/captain(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(M), slot_glasses)
var/obj/item/weapon/card/id/W = new(src)
W.assignment = "Emergency Response Team Leader"
W.registered_name = M.real_name
W.name = "[M.real_name]'s ID Card (Emergency Response Team - Commander)"
W.icon_state = "centcom"
W.access = get_all_accesses()
W.access += list(access_cent_general, access_cent_living, access_cent_medical, access_cent_storage, access_cent_thunder, access_cent_teleporter)
M.equip_to_slot_or_del(W, slot_wear_id)
var/obj/item/device/pda/heads/pda = new(src)
pda.owner = M.real_name
pda.ownjob = "Emergency Response Team Leader"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_to_slot_or_del(pda, slot_wear_pda)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/response_team(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/ert/commander(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/pinpointer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/security/response_team(M), slot_belt)
if("sec")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/security(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(M), slot_glasses)
var/obj/item/weapon/card/id/W = new(src)
W.assignment = "Emergency Response Team"
W.registered_name = M.real_name
W.name = "[M.real_name]'s ID Card (Emergency Response Team - Officer)"
W.icon_state = "centcom"
W.access = get_all_accesses()
W.access += list(access_cent_general, access_cent_living, access_cent_thunder)
M.equip_to_slot_or_del(W, slot_wear_id)
var/obj/item/device/pda/heads/pda = new(src)
pda.owner = M.real_name
pda.ownjob = "Emergency Response Team"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
pda.icon_state = "pda-security"
M.equip_to_slot_or_del(pda, slot_wear_pda)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/response_team(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/handcuffs(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/ert/security(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun/nuclear(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/security/response_team(M), slot_belt)
if("med")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/medical(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health_advanced(M), slot_glasses)
var/obj/item/weapon/card/id/W = new(src)
W.assignment = "Emergency Response Team"
W.registered_name = M.real_name
W.name = "[M.real_name]'s ID Card (Emergency Response Team - Medic)"
W.icon_state = "centcom"
W.access = get_all_accesses()
W.access += list(access_cent_general, access_cent_living, access_cent_medical)
M.equip_to_slot_or_del(W, slot_wear_id)
var/obj/item/device/pda/heads/pda = new(src)
pda.owner = M.real_name
pda.ownjob = "Emergency Response Team"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
pda.icon_state = "pda-medical"
M.equip_to_slot_or_del(pda, slot_wear_pda)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/response_team(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/ert/medical(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/o2(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/toxin(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/CMO(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/defibrillator/compact/combat/loaded(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/adv(M), slot_r_hand)
if("eng")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/engineer(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson(M), slot_glasses)
var/obj/item/weapon/card/id/W = new(src)
W.assignment = "Emergency Response Team"
W.registered_name = M.real_name
W.name = "[M.real_name]'s ID Card (Emergency Response Team - Engineer)"
W.icon_state = "centcom"
W.access = get_all_accesses()
W.access += list(access_cent_general, access_cent_living, access_cent_storage)
M.equip_to_slot_or_del(W, slot_wear_id)
var/obj/item/device/pda/heads/pda = new(src)
pda.owner = M.real_name
pda.ownjob = "Emergency Response Team"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
pda.icon_state = "pda-engineer"
M.equip_to_slot_or_del(pda, slot_wear_pda)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/response_team(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/ert/engineer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/rcd/combat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/rcd_ammo/large(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/rcd_ammo/large(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/response_team(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase/inflatable(M), slot_l_hand)
/*/mob/living/carbon/human/proc/equip_strike_team(leader_selected = 0) Old ERT equip verb.
//Special radio setup
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
@@ -321,7 +482,7 @@ proc/trigger_armed_response_team(var/force = 0)
L.imp_in = src
L.implanted = 1
return 1
return 1*/
//debug verb (That is horribly coded, LEAVE THIS OFF UNLESS PRIVATELY TESTING. Seriously.
/*client/verb/ResponseTeam()
+4 -5
View File
@@ -131,9 +131,8 @@ var/list/mechtoys = list(
var/comment = null
/datum/controller/supply
var/processing = 1
var/processing_interval = 300
var/iteration = 0
processing = 1
processing_interval = 300
//supply points
var/points = 50
var/points_per_process = 1
@@ -224,8 +223,8 @@ var/list/mechtoys = list(
plat_count += P.amount
// If you send something in a crate, centcom's keeping it! - fixes secure crates being sent to centom to open them
del(A)
del(MA)
qdel(A)
qdel(MA)
if(plasma_count)
points += plasma_count * points_per_plasma
+2 -1
View File
@@ -144,7 +144,8 @@ var/list/admin_verbs_debug = list(
/client/proc/callproc,
/client/proc/callproc_datum,
/client/proc/toggledebuglogs,
/client/proc/qdel_toggle // /vg/
/client/proc/qdel_toggle, // /vg/
/client/proc/gc_dump_hdl
)
var/list/admin_verbs_possess = list(
/proc/possess,
+5 -5
View File
@@ -899,7 +899,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_if_possible(pda, slot_r_store)
M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt)
M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
var/obj/item/weapon/card/id/centcom/W = new(M)
W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Captain)"
@@ -964,7 +964,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
@@ -992,7 +992,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
var/obj/item/device/pda/centcom/pda = new(M)
@@ -1104,7 +1104,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
@@ -1130,7 +1130,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_in_backpack)
+1
View File
@@ -5,6 +5,7 @@
item_state = "helm-command"
armor = list(melee = 50, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 60)
siemens_coefficient = 0.6
rig_restrict_helmet = 0 // ERT helmets can be taken on and off at will.
var/obj/machinery/camera/camera
/obj/item/clothing/head/helmet/space/rig/ert/attack_self(mob/user)
+3 -2
View File
@@ -371,6 +371,7 @@
_color = "syndi"
armor = list(melee = 60, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
on = 1
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | THICKMATERIAL
action_button_name = "Toggle Helmet Mode"
icon_action_button = "Action_hardsuit1-syndi"
species_restricted = null
@@ -388,7 +389,7 @@
user << "<span class='notice'>You switch your helmet to travel mode.</span>"
name = "blood-red hardsuit helmet"
desc = "A dual-mode advanced helmet designed for work in special operations. It is in travel mode. Property of Gorlex Marauders."
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | THICKMATERIAL
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
cold_protection = HEAD
user.AddLuminosity(brightness_on)
@@ -431,7 +432,7 @@
name = "blood-red hardsuit helmet"
desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in travel mode. Property of Gorlex Marauders."
slowdown = 1
flags = STOPSPRESSUREDMAGE
flags = STOPSPRESSUREDMAGE | THICKMATERIAL
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT
cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS
else
+6
View File
@@ -46,6 +46,12 @@
desc = "Dark Green beret with an old insignia on it."
icon_state = "sparkyninja_beret"
/obj/item/weapon/book/manual/security_space_law/black
name = "Space Law - Limited Edition"
desc = "A leather-bound, immaculately-written copy of JUSTICE."
icon_state = "bookSpaceLawblack"
title = "Space Law - Limited Edition"
//////////////////////////////////
////////// Fluff Items ///////////
//////////////////////////////////
+15
View File
@@ -1,3 +1,18 @@
#define EMOTE_COOLDOWN 50 //Time in deciseconds that the cooldown lasts
//Emote Cooldown System (it's so simple!)
/mob/proc/handle_emote_CD()
if(emote_cd == 2) return 1 // Cooldown emotes were disabled by an admin, prevent use
if(src.emote_cd == 1) return 1 // Already on CD, prevent use
src.emote_cd = 1 // Starting cooldown
spawn(EMOTE_COOLDOWN)
if(emote_cd == 2) return 1 // Don't reset if cooldown emotes were disabled by an admin during the cooldown
src.emote_cd = 0 // Cooldown complete, ready for more!
return 0 // Proceed with emote
//--FalseIncarnate
// All mobs should have custom emote, really..
/mob/proc/custom_emote(var/m_type=1,var/message = null)
+107 -51
View File
@@ -20,69 +20,100 @@
if(src.stat == 2.0 && (act != "deathgasp"))
return
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
var/on_CD = 0
switch(act)
//Cooldown-inducing emotes
if("ping","buzz","beep")
if (species.name == "Machine") //Only Machines can beep, ping, and buzz
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
else //Everyone else fails, skip the emote attempt
return
if("squish")
if(species.name == "Slime People") //Only Slime People can squish
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
else //Everyone else fails, skip the emote attempt
return
if("scream", "fart", "flip")
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
//Everything else, including typos of the above emotes
else
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
if(on_CD == 1) // Check if we need to suppress the emote attempt.
return // Suppress emote, you're still cooling off.
//--FalseIncarnate
switch(act)
if("ping")
if (species.name == "Machine")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if (param)
message = "<B>[src]</B> pings at [param]."
else
if (!species.name == "Machine")
return
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if("buzz")
if (species.name == "Machine")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
if (!species.name == "Machine")
return
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if("beep")
if(species.name == "Machine")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> beeps at [param]."
else
message = "<B>[src]</B> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 1
if (param)
message = "<B>[src]</B> beeps at [param]."
else
if (!species.name == "Machine")
return
message = "<B>[src]</B> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 1
if("squish")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> squishes at [param]."
else
message = "<B>[src]</B> squishes."
playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound.
m_type = 1
if("wag")
if(species.bodyflags & TAIL_WAGGING)
@@ -204,6 +235,31 @@
if(miming)
m_type = 1
if ("flip")
m_type = 1
if (!src.restrained())
var/M = null
if (param)
for (var/mob/A in view(1, null))
if (param == A.name)
M = A
break
if (M == src)
M = null
if (M)
if(src.lying || src.weakened)
message = "<B>[src]</B> flops and flails around on the floor."
else
message = "<B>[src]</B> flips in [M]'s general direction."
src.SpinAnimation(5,1)
else
if(src.lying || src.weakened)
message = "<B>[src]</B> flops and flails around on the floor."
else
message = "<B>[src]</B> does a flip!"
src.SpinAnimation(5,1)
if ("aflap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings ANGRILY!"
@@ -208,7 +208,7 @@ emp_act
user << "\red You sneakily slide the card into the dataport on [src]'s [affecting.display_name] and short out the safeties."
affecting.sabotaged = 1
return 1
//Returns 1 if the attack hit, 0 if it missed.
/mob/living/carbon/human/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone)
if(!I || !user) return 0
@@ -249,7 +249,7 @@ emp_act
if(istype(I,/obj/item/weapon/card/emag))
emag_act(user, affecting)
if(! I.discrete)
if(I.attack_verb.len)
visible_message("\red <B>[src] has been [pick(I.attack_verb)] in the [hit_area] with [I.name] by [user]!</B>")
@@ -288,8 +288,10 @@ emp_act
switch(hit_area)
if("head")//Harder to score a stun but if you do it lasts a bit longer
if(prob(I.force))
apply_effect(20, PARALYZE, armor)
visible_message("\red <B>[src] has been knocked unconscious!</B>")
apply_effect(5, WEAKEN, armor)
confused += 15
visible_message("<span class='danger'>[src] has been knocked down!</span>", \
"<span class='userdanger'>[src] has been knocked down!</span>")
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
@@ -340,7 +342,7 @@ emp_act
/mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = 5)
if(istype(AM,/obj/))
var/obj/O = AM
if(in_throw_mode && !get_active_hand() && speed <= 5) //empty active hand and we're in throw mode
if(canmove && !restrained())
if(isturf(O.loc))
@@ -348,7 +350,7 @@ emp_act
visible_message("<span class='warning'>[src] catches [O]!</span>")
throw_mode_off()
return
var/zone = ran_zone("chest", 65)
var/dtype = BRUTE
if(istype(O,/obj/item/weapon))
+21 -4
View File
@@ -11,6 +11,24 @@
var/muzzled = is_muzzled()
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
var/on_CD = 0
switch(act)
//Cooldown-inducing emotes
if("chirp")
if(istype(src,/mob/living/carbon/monkey/diona)) //Only Diona Nymphs can chirp
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
else //Everyone else fails, skip the emote attempt
return
//Everything else, including typos of the above emotes
else
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
if(on_CD == 1) // Check if we need to suppress the emote attempt.
return // Suppress emote, you're still cooling off.
//--FalseIncarnate
switch(act)
if ("me")
if(silent)
@@ -32,10 +50,9 @@
return custom_emote(m_type, message)
if ("chirp")
if(istype(src,/mob/living/carbon/monkey/diona))
message = "<B>The [src.name]</B> chirps!"
playsound(src.loc, 'sound/misc/nymphchirp.ogg', 50, 0)
m_type = 2
message = "<B>The [src.name]</B> chirps!"
playsound(src.loc, 'sound/misc/nymphchirp.ogg', 50, 0)
m_type = 2
if("sign")
if (!src.restrained())
message = text("<B>The monkey</B> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
@@ -0,0 +1,28 @@
/mob/living/carbon/monkey/say(var/message)
var/verb = "says"
var/message_range = world.view
if(client)
if(client.prefs.muted & MUTE_IC)
src << "\red You cannot speak in IC (Muted)."
return
message = trim_strip_html_properly(message)
if(stat == 2)
return say_dead(message)
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
var/datum/language/speaking = parse_language(message)
if(speaking)
message = copytext(message, 2+length(speaking.key))
message = trim(message)
if(!message || stat)
return
..(message, speaking, verb, null, null, message_range, null)
@@ -8,6 +8,21 @@
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act))
//Emote Cooldown System (it's so simple!)
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
var/on_CD = 0
switch(act)
//Cooldown-inducing emotes
if("ping","buzz","beep","law") //halt is exempt because it's used to stop criminal scum
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
//Everything else, including typos of the above emotes
else
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
if(on_CD == 1) // Check if we need to suppress the emote attempt.
return // Suppress emote, you're still cooling off.
//--FalseIncarnate
switch(act)
if ("me")
if (src.client)
@@ -46,6 +46,10 @@
projectilesound = 'sound/weapons/Gunshot.ogg'
casingtype = /obj/item/ammo_casing/a357
/mob/living/simple_animal/hostile/russian/ranged/New()
if(prob(50) && ispath(weapon1,/obj/item/weapon/gun/projectile/revolver/mateba)) //to preserve varedits
weapon1 = /obj/item/weapon/gun/projectile/shotgun/boltaction
casingtype = /obj/item/ammo_casing/a762
/mob/living/simple_animal/hostile/russian/Die()
..()
+11 -19
View File
@@ -855,7 +855,7 @@ var/list/slot_equipment_priority = list( \
return 0
src << message
return 1
/mob/proc/is_muzzled()
return 0
@@ -873,25 +873,14 @@ var/list/slot_equipment_priority = list( \
stat(null, "CPU:\t[world.cpu]")
stat(null, "Instances:\t[world.contents.len]")
if(master_controller)
/* HANDLED THROUGH PROCESS SCHEDULER
stat(null, "MasterController-[last_tick_duration] ([master_controller.processing?"On":"Off"]-[controller_iteration])")
stat(null, "Air-[master_controller.air_cost]")
stat(null, "Sun-[master_controller.sun_cost]")
stat(null, "Mob-[master_controller.mobs_cost]\t#[mob_list.len]")
stat(null, "Dis-[master_controller.diseases_cost]\t#[active_diseases.len]")
stat(null, "Mch-[master_controller.machines_cost]\t#[machines.len]")
stat(null, "Bots-[master_controller.aibots_cost]\t#[aibots.len]")
stat(null, "Obj-[master_controller.objects_cost]\t#[processing_objects.len]")
stat(null, "PiNet-[master_controller.networks_cost]\t#[pipe_networks.len]")
stat(null, "PoNet-[master_controller.powernets_cost]\t#[powernets.len]")
stat(null, "NanoUI-[master_controller.nano_cost]\t#[nanomanager.processing_uis.len]")
// stat(null, "GC-[master_controller.gc_cost]\t#[garbage.queue.len]")
stat(null, "Tick-[master_controller.ticker_cost]")*/
stat(null,"Events-[master_controller.events_cost]\t#[event_manager.active_events.len]")
stat(null, "ALL-[master_controller.total_cost]")
if (garbageCollector)
stat(null, "\tqdel - [garbageCollector.del_everything ? "off" : "on"]")
stat(null, "\ton queue - [garbageCollector.queue.len]")
stat(null, "\ttotal delete - [garbageCollector.dels_count]")
stat(null, "\tsoft delete - [garbageCollector.soft_dels]")
stat(null, "\thard delete - [garbageCollector.hard_dels]")
else
stat(null, "MasterController-ERROR")
stat(null, "Garbage Controller is not running.")
if(processScheduler.getIsRunning())
var/datum/controller/process/process
@@ -929,6 +918,9 @@ var/list/slot_equipment_priority = list( \
process = processScheduler.getProcess("disease")
stat(null, "DIS([active_diseases.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("garbage")
stat(null, "GAR\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
//process = processScheduler.getProcess("sun")
//stat(null, "SUN\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
+2
View File
@@ -138,6 +138,8 @@
var/coughedtime = null
var/emote_cd = 0 // Used to supress emote spamming. 1 if on CD, 2 if disabled by admin (manually set), else 0
var/inertia_dir = 0
var/music_lastplayed = "null"
+15 -16
View File
@@ -24,9 +24,7 @@
proc/new_player_panel_proc()
var/output = "<div align='center'><B>New Player Options</B>"
output +="<hr>"
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
var/output = "<center><p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
if(!ticker || ticker.current_state <= GAME_STATE_PREGAME)
if(!ready) output += "<p><a href='byond://?src=\ref[src];ready=1'>Declare Ready</A></p>"
@@ -57,9 +55,9 @@
else
output += "<p><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A></p>"
output += "</div>"
output += "</center>"
var/datum/browser/popup = new(src, "playersetup", "<div align='center'>New Player Options</div>", 210, 240)
var/datum/browser/popup = new(src, "playersetup", "<div align='center'>New Player Options</div>", 220, 290)
popup.set_window_options("can_close=0")
popup.set_content(output)
popup.open(0)
@@ -105,6 +103,7 @@
if(href_list["ready"])
ready = !ready
new_player_panel_proc()
if(href_list["refresh"])
src << browse(null, "window=playersetup") //closes the player setup window
@@ -115,7 +114,7 @@
if(alert(src,"Are you sure you wish to observe? You will have to wait 30 minutes before being able to respawn!","Player Setup","Yes","No") == "Yes")
if(!client) return 1
var/mob/dead/observer/observer = new()
src << browse(null, "window=playersetup")
spawning = 1
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo
@@ -309,7 +308,7 @@
EquipRacialItems(character)
character = job_master.EquipRank(character, rank, 1) //equips the human
EquipCustomItems(character)
// AIs don't need a spawnpoint, they must spawn at an empty core
if(character.mind.assigned_role == "AI")
@@ -346,7 +345,7 @@
else
character.loc = pick(latejoin)
join_message = "has arrived on the station"
character.lastarea = get_area(loc)
// Moving wheelchair if they have one
if(character.buckled && istype(character.buckled, /obj/structure/stool/bed/chair/wheelchair))
@@ -398,12 +397,12 @@
if(character.mind)
if((character.mind.special_role != "MODE"))
var/arrivalmessage = "A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"]."
announcer.say(";[arrivalmessage]")
announcer.say(";[arrivalmessage]")
else
if(character.mind)
if((character.mind.special_role != "MODE"))
// can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc.
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
proc/LateChoices()
var/mills = world.time // 1/10 of a second, not real milliseconds but whatever
@@ -444,9 +443,9 @@
proc/create_character()
spawning = 1
close_spawn_windows()
var/mob/living/carbon/human/new_character
var/datum/species/chosen_species
if(client.prefs.species)
chosen_species = all_species[client.prefs.species]
@@ -454,10 +453,10 @@
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
if(is_species_whitelisted(chosen_species) || has_admin_rights())
new_character = new(loc, client.prefs.species)
if(!new_character)
new_character = new(loc)
new_character.lastarea = get_area(loc)
var/datum/language/chosen_language
@@ -505,9 +504,9 @@
if(client.prefs.disabilities & DISABILITY_FLAG_DEAF)
new_character.dna.SetSEState(DEAFBLOCK,1,1)
new_character.sdisabilities |= DEAF
chosen_species.handle_dna(new_character)
domutcheck(new_character)
new_character.dna.UpdateSE()
@@ -1,6 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
// Added spess ghoasts/cameras to this so they don't add to the lag. - N3X
var/global/narsie_cometh = 0
var/global/list/uneatable = list(
/turf/space,
/obj/effect/overlay,
@@ -508,6 +509,7 @@ var/global/list/uneatable = list(
if(emergency_shuttle && emergency_shuttle.can_call())
emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall
narsie_cometh = 1
/obj/machinery/singularity/narsie/proc/spawn_animation()
@@ -541,7 +543,7 @@ var/global/list/uneatable = list(
if(istype(A,/obj/))
var/obj/O = A
O.ex_act(1.0)
if(O) del(O)
if(O) qdel(O)
else if(isturf(A))
var/turf/T = A
@@ -565,7 +567,7 @@ var/global/list/uneatable = list(
var/obj/O = A
machines -= O
processing_objects -= O
O.loc = null
qdel(O)
else if(isturf(A))
var/turf/T = A
if(istype(T,/turf/simulated/wall))
@@ -95,7 +95,7 @@
desc = "An incendiary-coated shotgun slug."
icon_state = "ishell"
projectile_type = "/obj/item/projectile/bullet/incendiary/shell"
/obj/item/ammo_casing/shotgun/frag12
name = "FRAG-12 slug"
desc = "A high explosive breaching round for a 12 gauge shotgun."
@@ -144,6 +144,7 @@
/obj/item/ammo_casing/a762
desc = "A 7.62mm bullet casing."
icon_state = "762-casing"
caliber = "a762"
projectile_type = "/obj/item/projectile/bullet"
@@ -40,6 +40,14 @@
max_ammo = 4
multiple_sprites = 1
/obj/item/ammo_box/a762
name = "stripper clip (7.62mm)"
desc = "A stripper clip."
icon_state = "762"
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 5
multiple_sprites = 1
/obj/item/ammo_box/shotgun
name = "Ammunition Box (slug)"
icon_state = "9mmbox"
@@ -86,6 +86,14 @@
ammo_type = "/obj/item/ammo_casing/a40mm"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/boltaction
name = "bolt action rifle internal magazine"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/a762"
caliber = "a762"
max_ammo = 5
multiload = 1
///////////EXTERNAL MAGAZINES////////////////
/obj/item/ammo_box/magazine/m10mm
+26 -9
View File
@@ -16,7 +16,7 @@
switch(mode)
if(2)
mode = 0
charge_cost = 100
charge_cost = 50
fire_sound = 'sound/weapons/Taser.ogg'
user << "\red [src.name] is now set to stun."
projectile_type = "/obj/item/projectile/energy/electrode"
@@ -57,14 +57,31 @@
attack_self(mob/living/user as mob)
user << "\red [src.name] has three settings, and they are all DESTROY."
/obj/item/weapon/gun/energy/pulse_rifle/M1911
name = "m1911-P"
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
icon_state = "m1911-p"
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
w_class = 3.0
/obj/item/weapon/gun/energy/pulse_rifle/carbine
name = "pulse carbine"
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
w_class = 3
slot_flags = SLOT_BELT
icon_state = "pulse_carbine"
item_state = "pulse"
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/carbine"
can_flashlight = 1
/obj/item/weapon/gun/energy/pulse_rifle/pistol
name = "pulse pistol"
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
w_class = 2
slot_flags = SLOT_BELT
icon_state = "pulse_pistol"
item_state = "gun"
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/pistol"
/obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911
name = "\improper M1911-P"
desc = "A compact pulse core in a classic handgun frame for Nanotrasen officers. It's not the size of the gun, it's the size of the hole it puts through people."
icon_state = "m1911-p"
item_state = "gun"
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
isHandgun()
return 1
@@ -9,7 +9,6 @@
slot_flags = SLOT_BACK
origin_tech = "combat=4;materials=2"
var/recentpump = 0 // to prevent spammage
var/pumped = 0
mag_type = "/obj/item/ammo_box/magazine/internal/shot"
/obj/item/weapon/gun/projectile/shotgun/attackby(var/obj/item/A as obj, mob/user as mob, params)
@@ -52,24 +51,31 @@
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M as mob)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
pumped = 0
pump_unload(M)
pump_reload(M)
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/proc/pump_unload(mob/M)
if(chambered)//We have a shell in the chamber
chambered.loc = get_turf(src)//Eject casing
chambered.SpinAnimation(5, 1)
chambered = null
if(in_chamber)
in_chamber = null
/obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M)
if(!magazine.ammo_count()) return 0
var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing.
chambered = AC
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/examine()
..()
if (chambered)
usr << "A [chambered.BB ? "live" : "spent"] one is in the chamber."
// COMBAT SHOTGUN //
/obj/item/weapon/gun/projectile/shotgun/combat
name = "combat shotgun"
desc = "A traditional shotgun with tactical furniture and an eight-shell capacity underneath."
@@ -78,6 +84,8 @@
mag_type = "/obj/item/ammo_box/magazine/internal/shotcom"
w_class = 5
// RIOT SHOTGUN //
/obj/item/weapon/gun/projectile/shotgun/riot //for spawn in the armory
name = "riot shotgun"
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
@@ -90,6 +98,45 @@
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/melee/energy) || istype(A, /obj/item/weapon/pickaxe/plasmacutter))
sawoff(user)
///////////////////////
// BOLT ACTION RIFLE //
///////////////////////
/obj/item/weapon/gun/projectile/shotgun/boltaction
name = "bolt action rifle"
desc = "This piece of junk looks like something that could have been used 700 years ago."
icon_state = "moistnugget"
item_state = "moistnugget"
icon_override = 'icons/mob/in-hand/guns.dmi'
slot_flags = 0 //no SLOT_BACK sprite, alas
mag_type = "/obj/item/ammo_box/magazine/internal/boltaction"
var/bolt_open = 0
/obj/item/weapon/gun/projectile/shotgun/boltaction/pump(mob/M)
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
if(bolt_open)
pump_reload(M)
else
pump_unload(M)
bolt_open = !bolt_open
update_icon() //I.E. fix the desc
return 1
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(var/obj/item/A as obj, mob/user as mob)
if(!bolt_open)
user << "<span class='notice'>The bolt is closed!</span>"
return
. = ..()
/obj/item/weapon/gun/projectile/shotgun/boltaction/examine(mob/user)
..()
user << "The bolt is [bolt_open ? "open" : "closed"]."
/////////////////////////////
// DOUBLE BARRELED SHOTGUN //
/////////////////////////////
/obj/item/weapon/gun/projectile/revolver/doublebarrel
name = "double-barreled shotgun"
desc = "A true classic."
@@ -152,6 +199,7 @@
item_state = "shotgun"
w_class = 4.0
force = 10
slot_flags = null
origin_tech = "combat=2;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/improvised"
sawn_desc = "I'm just here for the gasoline."
@@ -161,7 +209,6 @@
if(istype(A, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = A
if(C.use(10))
flags = CONDUCT
slot_flags = SLOT_BACK
icon_state = "ishotgunsling"
user << "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>"
@@ -640,3 +640,10 @@ datum
atom/proc/create_reagents(var/max_vol)
reagents = new/datum/reagents(max_vol)
reagents.my_atom = src
/datum/reagents/Destroy()
for(var/datum/reagent/reagent in reagent_list)
reagent.Destroy()
if(my_atom)
my_atom = null
+13 -1
View File
@@ -1713,6 +1713,12 @@ datum
..()
return
nanites
name = "Nanites"
id = "nanities"
description = "Nanomachines that aid in rapid cellular regeneration."
synaptizine
name = "Synaptizine"
id = "synaptizine"
@@ -3985,4 +3991,10 @@ datum
*/
// Undefine the alias for REAGENTS_EFFECT_MULTIPLER
#undef REM
#undef REM
/datum/reagent/Destroy()
if(holder)
holder.reagent_list -= src
holder = null
@@ -68,6 +68,14 @@
..()
reagents.add_reagent("synaptizine", 30)
/obj/item/weapon/reagent_containers/hypospray/combat/nanites
name = "combat stimulant injector"
desc = "A modified air-needle autoinjector filled with expensive regeneration nanites."
volume = 100
/obj/item/weapon/reagent_containers/hypospray/combat/New()
..()
reagents.add_reagent("nanites", 70)
/obj/item/weapon/reagent_containers/hypospray/autoinjector
name = "emergency autoinjector"