Merge branch 'master' into upstream-merge-30079

This commit is contained in:
LetterJay
2017-09-06 09:24:23 -05:00
committed by GitHub
550 changed files with 13328 additions and 156749 deletions
-10
View File
@@ -1,10 +0,0 @@
diff a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm (rejected hunks)
@@ -130,7 +130,7 @@
new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0)
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
- chainsaw.flags |= NODROP
+ chainsaw.flags_1 |= NODROP_1
victim.drop_all_held_items()
victim.put_in_hands(chainsaw)
chainsaw.attack_self(victim)
+13 -6
View File
@@ -35,10 +35,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
pressure_resistance = 4
var/obj/item/master = null
var/heat_protection = 0 //flags_1 which determine which body parts are protected from heat. Use the HEAD, CHEST, GROIN, etc. flags_1. See setup.dm
var/cold_protection = 0 //flags_1 which determine which body parts are protected from cold. Use the HEAD, CHEST, GROIN, etc. flags_1. See setup.dm
var/max_heat_protection_temperature //Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags_1
var/min_cold_protection_temperature //Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags_1
var/heat_protection = 0 //flags which determine which body parts are protected from heat. Use the HEAD, CHEST, GROIN, etc. flags. See setup.dm
var/cold_protection = 0 //flags which determine which body parts are protected from cold. Use the HEAD, CHEST, GROIN, etc. flags. See setup.dm
var/max_heat_protection_temperature //Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags
var/min_cold_protection_temperature //Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags
var/list/actions //list of /datum/action's that this item has.
var/list/actions_types //list of paths of action datums to give to the item on New().
@@ -48,7 +48,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/item_color = null //this needs deprecating, soonish
var/body_parts_covered = 0 //see setup.dm for appropriate bit flags_1
var/body_parts_covered = 0 //see setup.dm for appropriate bit flags
//var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible
var/gas_transfer_coefficient = 1 // for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets)
var/permeability_coefficient = 1 // for chemicals/diseases
@@ -64,6 +64,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/list/materials
var/origin_tech = null //Used by R&D to determine what research bonuses it grants.
var/needs_permit = 0 //Used by security bots to determine if this item is safe for public use.
var/emagged = FALSE
var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item
@@ -86,7 +87,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/embedded_unsafe_removal_pain_multiplier = EMBEDDED_UNSAFE_REMOVAL_PAIN_MULTIPLIER //The coefficient of multiplication for the damage removing this without surgery causes (this*w_class)
var/embedded_unsafe_removal_time = EMBEDDED_UNSAFE_REMOVAL_TIME //A time in ticks, multiplied by the w_class.
var/flags_cover = 0 //for flags_1 such as GLASSESCOVERSEYES
var/flags_cover = 0 //for flags such as GLASSESCOVERSEYES
var/heat = 0
var/sharpness = IS_BLUNT
var/toolspeed = 1
@@ -128,6 +129,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
if(force_string)
force_string_override = TRUE
if(!hitsound)
if(damtype == "fire")
hitsound = 'sound/items/welder.ogg'
if(damtype == "brute")
hitsound = "swing_hit"
/obj/item/Destroy()
flags_1 &= ~DROPDEL_1 //prevent reqdels
if(ismob(loc))
-10
View File
@@ -1,10 +0,0 @@
diff a/code/game/objects/items.dm b/code/game/objects/items.dm (rejected hunks)
@@ -135,7 +135,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
hitsound = "swing_hit"
/obj/item/Destroy()
- flags &= ~DROPDEL //prevent reqdels
+ flags_1 &= ~DROPDEL_1 //prevent reqdels
if(ismob(loc))
var/mob/m = loc
m.temporarilyRemoveItemFromInventory(src, TRUE)
+3 -1
View File
@@ -19,11 +19,13 @@
var/list/colors = list("red", "yellow", "green", "blue", "pink", "orange", "cyan", "white")
var/current_color_index = 1
var/ghetto = FALSE
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
/obj/item/twohanded/rcl/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(!loaded)
if(!user.transferItemToLoc(W, src))
to_chat(user, "<span class='warning'>[src] is stuck to your hand!</span>")
-1
View File
@@ -123,7 +123,6 @@ RSF
var/toxin = 0
var/cooldown = 0
var/cooldowndelay = 10
var/emagged = FALSE
w_class = WEIGHT_CLASS_NORMAL
/obj/item/cookiesynth/examine(mob/user)
File diff suppressed because it is too large Load Diff
@@ -212,7 +212,6 @@
build_path = /obj/machinery/computer/cargo
origin_tech = "programming=3"
var/contraband = FALSE
var/emagged = FALSE
/obj/item/circuitboard/computer/cargo/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/multitool))
@@ -16,7 +16,6 @@
materials = list(MAT_METAL = 150, MAT_GLASS = 150)
var/scanning = 0
var/radiation_count = 0
var/emagged = FALSE
/obj/item/device/geiger_counter/New()
..()
+261 -262
View File
@@ -1,269 +1,268 @@
// Light Replacer (LR)
//
// ABOUT THE DEVICE
//
// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
// they don't have hands or a way to replace lightbulbs.
//
// HOW IT WORKS
//
// You attack a light fixture with it, if the light fixture is broken it will replace the
// light fixture with a working light; the broken light is then placed on the floor for the
// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.
//
// HOW TO REFILL THE DEVICE
//
// It will need to be manually refilled with lights.
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
//
// EMAGGED FEATURES
//
// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.
//
// I'm not sure everyone will react the emag's features so please say what your opinions are of it.
//
// When emagged it will rig every light it replaces, which will explode when the light is on.
// This is VERY noticable, even the device's name changes when you emag it so if anyone
// examines you when you're holding it in your hand, you will be discovered.
// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
// access to them, and only one of them can emag their device.
//
// The explosion cannot insta-kill anyone with 30% or more health.
#define LIGHT_OK 0
#define LIGHT_EMPTY 1
#define LIGHT_BROKEN 2
#define LIGHT_BURNED 3
/obj/item/device/lightreplacer
name = "light replacer"
desc = "A device to automatically replace lights. Refill with broken or working lightbulbs, or sheets of glass."
icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0"
item_state = "electronic"
// Light Replacer (LR)
//
// ABOUT THE DEVICE
//
// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
// they don't have hands or a way to replace lightbulbs.
//
// HOW IT WORKS
//
// You attack a light fixture with it, if the light fixture is broken it will replace the
// light fixture with a working light; the broken light is then placed on the floor for the
// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.
//
// HOW TO REFILL THE DEVICE
//
// It will need to be manually refilled with lights.
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
//
// EMAGGED FEATURES
//
// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.
//
// I'm not sure everyone will react the emag's features so please say what your opinions are of it.
//
// When emagged it will rig every light it replaces, which will explode when the light is on.
// This is VERY noticable, even the device's name changes when you emag it so if anyone
// examines you when you're holding it in your hand, you will be discovered.
// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
// access to them, and only one of them can emag their device.
//
// The explosion cannot insta-kill anyone with 30% or more health.
#define LIGHT_OK 0
#define LIGHT_EMPTY 1
#define LIGHT_BROKEN 2
#define LIGHT_BURNED 3
/obj/item/device/lightreplacer
name = "light replacer"
desc = "A device to automatically replace lights. Refill with broken or working lightbulbs, or sheets of glass."
icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = SLOT_BELT
origin_tech = "magnets=3;engineering=4"
var/max_uses = 20
var/uses = 0
var/emagged = FALSE
var/failmsg = ""
// How much to increase per each glass?
var/increment = 5
// How much to take from the glass?
var/decrement = 1
var/charge = 1
// Eating used bulbs gives us bulb shards
var/bulb_shards = 0
// when we get this many shards, we get a free bulb.
var/shards_required = 4
/obj/item/device/lightreplacer/New()
uses = max_uses / 2
failmsg = "The [name]'s refill light blinks red."
..()
/obj/item/device/lightreplacer/examine(mob/user)
..()
to_chat(user, status_string())
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = W
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
else if(G.use(decrement))
AddUses(increment)
to_chat(user, "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] light\s remaining.</span>")
return
else
to_chat(user, "<span class='warning'>You need one sheet of glass to replace lights!</span>")
if(istype(W, /obj/item/shard))
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(round(increment*0.75))
to_chat(user, "<span class='notice'>You insert a shard of glass into the [src.name]. You have [uses] light\s remaining.</span>")
qdel(W)
return
if(istype(W, /obj/item/light))
var/obj/item/light/L = W
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(1)
qdel(L)
else
if(!user.temporarilyRemoveItemFromInventory(W))
return
to_chat(user, "<span class='notice'>You insert the [L.name] into the [src.name]</span>")
AddShards(1, user)
qdel(L)
return
if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
var/found_lightbulbs = FALSE
var/replaced_something = TRUE
for(var/obj/item/I in S.contents)
slot_flags = SLOT_BELT
origin_tech = "magnets=3;engineering=4"
var/max_uses = 20
var/uses = 0
var/failmsg = ""
// How much to increase per each glass?
var/increment = 5
// How much to take from the glass?
var/decrement = 1
var/charge = 1
// Eating used bulbs gives us bulb shards
var/bulb_shards = 0
// when we get this many shards, we get a free bulb.
var/shards_required = 4
/obj/item/device/lightreplacer/New()
uses = max_uses / 2
failmsg = "The [name]'s refill light blinks red."
..()
/obj/item/device/lightreplacer/examine(mob/user)
..()
to_chat(user, status_string())
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = W
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
else if(G.use(decrement))
AddUses(increment)
to_chat(user, "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] light\s remaining.</span>")
return
else
to_chat(user, "<span class='warning'>You need one sheet of glass to replace lights!</span>")
if(istype(W, /obj/item/shard))
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(round(increment*0.75))
to_chat(user, "<span class='notice'>You insert a shard of glass into the [src.name]. You have [uses] light\s remaining.</span>")
qdel(W)
return
if(istype(W, /obj/item/light))
var/obj/item/light/L = W
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(1)
qdel(L)
else
if(!user.temporarilyRemoveItemFromInventory(W))
return
to_chat(user, "<span class='notice'>You insert the [L.name] into the [src.name]</span>")
AddShards(1, user)
qdel(L)
return
if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
var/found_lightbulbs = FALSE
var/replaced_something = TRUE
for(var/obj/item/I in S.contents)
if(istype(I, /obj/item/light))
var/obj/item/light/L = I
found_lightbulbs = TRUE
if(src.uses >= max_uses)
break
if(L.status == LIGHT_OK)
replaced_something = TRUE
AddUses(1)
qdel(L)
else if(L.status == LIGHT_BROKEN || L.status == LIGHT_BURNED)
replaced_something = TRUE
AddShards(1, user)
qdel(L)
if(!found_lightbulbs)
to_chat(user, "<span class='warning'>\The [S] contains no bulbs.</span>")
return
if(!replaced_something && src.uses == max_uses)
to_chat(user, "<span class='warning'>\The [src] is full!</span>")
return
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
/obj/item/device/lightreplacer/emag_act()
var/obj/item/light/L = I
found_lightbulbs = TRUE
if(src.uses >= max_uses)
break
if(L.status == LIGHT_OK)
replaced_something = TRUE
AddUses(1)
qdel(L)
else if(L.status == LIGHT_BROKEN || L.status == LIGHT_BURNED)
replaced_something = TRUE
AddShards(1, user)
qdel(L)
if(!found_lightbulbs)
to_chat(user, "<span class='warning'>\The [S] contains no bulbs.</span>")
return
if(!replaced_something && src.uses == max_uses)
to_chat(user, "<span class='warning'>\The [src] is full!</span>")
return
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
/obj/item/device/lightreplacer/emag_act()
if(emagged)
return
Emag()
/obj/item/device/lightreplacer/attack_self(mob/user)
to_chat(user, status_string())
/obj/item/device/lightreplacer/update_icon()
icon_state = "lightreplacer[emagged]"
/obj/item/device/lightreplacer/proc/status_string()
return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)."
/obj/item/device/lightreplacer/proc/Use(mob/user)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
AddUses(-1)
return 1
// Negative numbers will subtract
/obj/item/device/lightreplacer/proc/AddUses(amount = 1)
uses = Clamp(uses + amount, 0, max_uses)
/obj/item/device/lightreplacer/proc/AddShards(amount = 1, user)
bulb_shards += amount
var/new_bulbs = round(bulb_shards / shards_required)
if(new_bulbs > 0)
AddUses(new_bulbs)
bulb_shards = bulb_shards % shards_required
if(new_bulbs != 0)
to_chat(user, "<span class='notice'>\The [src] has fabricated a new bulb from the broken glass it has stored. It now has [uses] uses.</span>")
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
return new_bulbs
/obj/item/device/lightreplacer/proc/Charge(var/mob/user)
charge += 1
if(charge > 3)
AddUses(1)
charge = 1
/obj/item/device/lightreplacer/proc/ReplaceLight(obj/machinery/light/target, mob/living/U)
if(target.status != LIGHT_OK)
if(CanUse(U))
if(!Use(U)) return
to_chat(U, "<span class='notice'>You replace the [target.fitting] with \the [src].</span>")
if(target.status != LIGHT_EMPTY)
AddShards(1, U)
target.status = LIGHT_EMPTY
target.update()
var/obj/item/light/L2 = new target.light_type()
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = emagged
target.brightness = L2.brightness
target.on = target.has_power()
target.update()
qdel(L2)
if(target.on && target.rigged)
target.explode()
return
else
to_chat(U, failmsg)
return
else
to_chat(U, "<span class='warning'>There is a working [target.fitting] already inserted!</span>")
return
/obj/item/device/lightreplacer/proc/Emag()
emagged = !emagged
playsound(src.loc, "sparks", 100, 1)
if(emagged)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
update_icon()
/obj/item/device/lightreplacer/proc/CanUse(mob/living/user)
src.add_fingerprint(user)
if(uses > 0)
return 1
else
return 0
/obj/item/device/lightreplacer/afterattack(atom/T, mob/U, proximity)
if(!proximity)
return
if(!isturf(T))
return
var/used = FALSE
for(var/atom/A in T)
if(!CanUse(U))
break
used = TRUE
if(istype(A, /obj/machinery/light))
ReplaceLight(A, U)
if(!used)
to_chat(U, failmsg)
/obj/item/device/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.myreplacer = src
J.update_icon()
/obj/item/device/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
#undef LIGHT_BURNED
/obj/item/device/lightreplacer/attack_self(mob/user)
to_chat(user, status_string())
/obj/item/device/lightreplacer/update_icon()
icon_state = "lightreplacer[emagged]"
/obj/item/device/lightreplacer/proc/status_string()
return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)."
/obj/item/device/lightreplacer/proc/Use(mob/user)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
AddUses(-1)
return 1
// Negative numbers will subtract
/obj/item/device/lightreplacer/proc/AddUses(amount = 1)
uses = Clamp(uses + amount, 0, max_uses)
/obj/item/device/lightreplacer/proc/AddShards(amount = 1, user)
bulb_shards += amount
var/new_bulbs = round(bulb_shards / shards_required)
if(new_bulbs > 0)
AddUses(new_bulbs)
bulb_shards = bulb_shards % shards_required
if(new_bulbs != 0)
to_chat(user, "<span class='notice'>\The [src] has fabricated a new bulb from the broken glass it has stored. It now has [uses] uses.</span>")
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
return new_bulbs
/obj/item/device/lightreplacer/proc/Charge(var/mob/user)
charge += 1
if(charge > 3)
AddUses(1)
charge = 1
/obj/item/device/lightreplacer/proc/ReplaceLight(obj/machinery/light/target, mob/living/U)
if(target.status != LIGHT_OK)
if(CanUse(U))
if(!Use(U)) return
to_chat(U, "<span class='notice'>You replace the [target.fitting] with \the [src].</span>")
if(target.status != LIGHT_EMPTY)
AddShards(1, U)
target.status = LIGHT_EMPTY
target.update()
var/obj/item/light/L2 = new target.light_type()
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = emagged
target.brightness = L2.brightness
target.on = target.has_power()
target.update()
qdel(L2)
if(target.on && target.rigged)
target.explode()
return
else
to_chat(U, failmsg)
return
else
to_chat(U, "<span class='warning'>There is a working [target.fitting] already inserted!</span>")
return
/obj/item/device/lightreplacer/proc/Emag()
emagged = !emagged
playsound(src.loc, "sparks", 100, 1)
if(emagged)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
update_icon()
/obj/item/device/lightreplacer/proc/CanUse(mob/living/user)
src.add_fingerprint(user)
if(uses > 0)
return 1
else
return 0
/obj/item/device/lightreplacer/afterattack(atom/T, mob/U, proximity)
if(!proximity)
return
if(!isturf(T))
return
var/used = FALSE
for(var/atom/A in T)
if(!CanUse(U))
break
used = TRUE
if(istype(A, /obj/machinery/light))
ReplaceLight(A, U)
if(!used)
to_chat(U, failmsg)
/obj/item/device/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.myreplacer = src
J.update_icon()
/obj/item/device/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
#undef LIGHT_BURNED
@@ -8,7 +8,6 @@
w_class = WEIGHT_CLASS_SMALL
siemens_coefficient = 1
var/spamcheck = 0
var/emagged = FALSE
var/list/voicespan = list(SPAN_COMMAND)
/obj/item/device/megaphone/get_held_item_speechspans(mob/living/carbon/user)
@@ -75,14 +75,16 @@ effective or pretty fucking useless.
var/intensity = 10 // how much damage the radiation does
var/wavelength = 10 // time it takes for the radiation to kick in, in seconds
var/used = 0 // is it cooling down?
var/stealth = FALSE
/obj/item/device/healthanalyzer/rad_laser/attack(mob/living/M, mob/living/user)
..()
if(!stealth || !irradiate)
..()
if(!irradiate)
return
if(!used)
add_logs(user, M, "irradiated", src)
var/cooldown = round(max(10, (intensity*5 - wavelength/4))) * 10
var/cooldown = GetCooldown()
used = 1
icon_state = "health1"
handle_cooldown(cooldown) // splits off to handle the cooldown while handling wavelength
@@ -103,11 +105,15 @@ effective or pretty fucking useless.
/obj/item/device/healthanalyzer/rad_laser/attack_self(mob/user)
interact(user)
/obj/item/device/healthanalyzer/rad_laser/proc/GetCooldown()
return round(max(10, (stealth*30 + intensity*5 - wavelength/4)))
/obj/item/device/healthanalyzer/rad_laser/interact(mob/user)
user.set_machine(src)
var/cooldown = round(max(10, (intensity*5 - wavelength/4)))
var/cooldown = GetCooldown()
var/dat = "Irradiation: <A href='?src=\ref[src];rad=1'>[irradiate ? "On" : "Off"]</A><br>"
dat += "Stealth Mode (NOTE: Deactivates automatically while Irradiation is off): <A href='?src=\ref[src];stealthy=[TRUE]'>[stealth ? "On" : "Off"]</A><br>"
dat += "Scan Mode: <a href='?src=\ref[src];mode=1'>"
if(!scanmode)
dat += "Scan Health"
@@ -141,6 +147,9 @@ effective or pretty fucking useless.
usr.set_machine(src)
if(href_list["rad"])
irradiate = !irradiate
else if(href_list["stealthy"])
stealth = !stealth
else if(href_list["mode"])
scanmode += 1
File diff suppressed because it is too large Load Diff
+1 -12
View File
@@ -47,19 +47,8 @@
if(!active)
if(clown_check(user))
to_chat(user, "<span class='warning'>You light the [name]!</span>")
active = TRUE
cut_overlay("improvised_grenade_filled")
icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
message_admins("[ADMIN_LOOKUPFLW(user)] has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)].")
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].")
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
addtimer(CALLBACK(src, .proc/prime), det_time)
preprime(user, null, FALSE)
/obj/item/grenade/iedcasing/prime() //Blowing that can up
update_mob()
+20 -25
View File
@@ -26,15 +26,9 @@
/obj/item/grenade/proc/clown_check(mob/living/carbon/human/user)
if(user.disabilities & CLUMSY && prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?</span>")
active = 1
icon_state = initial(icon_state) + "_active"
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
spawn(5)
if(user)
user.drop_item()
prime()
return 0
return 1
preprime(user, 5, FALSE)
return FALSE
return TRUE
/obj/item/grenade/examine(mob/user)
@@ -50,26 +44,27 @@
if(!active)
if(clown_check(user))
preprime(user)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
/obj/item/grenade/proc/preprime(mob/user)
if(user)
to_chat(user, "<span class='warning'>You prime the [name]! [det_time/10] seconds!</span>")
/obj/item/grenade/proc/log_grenade(mob/user, turf/T)
var/area/A = get_area(T)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed \a [src] for detonation at [ADMIN_COORDJMP(T)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(user)] has primed \a [src] for detonation at [A.name] [COORD(T)].")
/obj/item/grenade/proc/preprime(mob/user, delayoverride, msg = TRUE)
var/turf/T = get_turf(src)
log_grenade(user, T)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
if(msg)
to_chat(user, "<span class='warning'>You prime \the [src]! [det_time/10] seconds!</span>")
playsound(loc, 'sound/weapons/armbomb.ogg', 60, 1)
active = TRUE
icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
if(user)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].")
addtimer(CALLBACK(src, .proc/prime), det_time)
addtimer(CALLBACK(src, .proc/prime), isnull(delayoverride)? det_time : delayoverride)
/obj/item/grenade/proc/prime()
@@ -110,4 +105,4 @@
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
prime()
return 1 //It hit the grenade, not them
return TRUE //It hit the grenade, not them
+4
View File
@@ -105,6 +105,10 @@
/obj/item/nullrod/claymore/darkblade
icon_state = "cultblade"
item_state = "cultblade"
lefthand_file = 'icons/mob/inhands/64x64_lefthand.dmi'
righthand_file = 'icons/mob/inhands/64x64_righthand.dmi'
inhand_x_dimension = 64
inhand_y_dimension = 64
name = "dark blade"
desc = "Spread the glory of the dark gods!"
slot_flags = SLOT_BELT
@@ -278,7 +278,6 @@
desc = "Releases a harmless blast that confuses most organics. For when the harm is JUST TOO MUCH"
icon_state = "megaphone"
var/cooldown = 0
var/emagged = FALSE
/obj/item/device/harmalarm/emag_act(mob/user)
emagged = !emagged
@@ -1,10 +0,0 @@
diff a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm (rejected hunks)
@@ -151,7 +151,7 @@
/obj/item/borg/charger
name = "power connector"
icon_state = "charger_draw"
- flags = NOBLUDGEON
+ flags_1 = NOBLUDGEON_1
var/mode = "draw"
var/static/list/charge_machines = typecacheof(list(/obj/machinery/cell_charger, /obj/machinery/recharger, /obj/machinery/recharge_station, /obj/machinery/mech_bay_recharge_port))
var/static/list/charge_items = typecacheof(list(/obj/item/stock_parts/cell, /obj/item/gun/energy))
@@ -21,6 +21,10 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("swivel chair", /obj/structure/chair/office/dark, 5, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("comfy chair", /obj/structure/chair/comfy/beige, 2, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("bed", /obj/structure/bed, 2, one_per_turf = TRUE, on_floor = TRUE), \
new /datum/stack_recipe("sofa (middle)", /obj/structure/chair/sofa, one_per_turf = TRUE, on_floor = TRUE), \
new /datum/stack_recipe("sofa (left)", /obj/structure/chair/sofa/left, one_per_turf = TRUE, on_floor = TRUE), \
new /datum/stack_recipe("sofa (right)", /obj/structure/chair/sofa/right, one_per_turf = TRUE, on_floor = TRUE), \
new /datum/stack_recipe("sofa (corner)", /obj/structure/chair/sofa/corner, one_per_turf = TRUE, on_floor = TRUE), \
null, \
new/datum/stack_recipe("rack parts", /obj/item/rack_parts), \
new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = TRUE, on_floor = TRUE), \
@@ -421,4 +425,4 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra
/obj/item/stack/sheet/paperframes/twenty
amount = 20
/obj/item/stack/sheet/paperframes/fifty
amount = 50
amount = 50
@@ -1,19 +0,0 @@
diff a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm (rejected hunks)
@@ -9,7 +9,7 @@
desc = "Wrap packages with this festive paper to make gifts."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "wrap_paper"
- flags = NOBLUDGEON
+ flags_1 = NOBLUDGEON_1
amount = 25
max_amount = 25
resistance_flags = FLAMMABLE
@@ -30,7 +30,7 @@
desc = "You can use this to wrap items in."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "deliveryPaper"
- flags = NOBLUDGEON
+ flags_1 = NOBLUDGEON_1
amount = 25
max_amount = 25
resistance_flags = FLAMMABLE
File diff suppressed because it is too large Load Diff
@@ -1,9 +0,0 @@
diff a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm (rejected hunks)
@@ -732,7 +732,6 @@
/obj/item/storage/box/ingredients //This box is for the randomely chosen version the chef spawns with, it shouldn't actually exist.
name = "ingredients box"
illustration = "donk_kit"
- icon_state = null
/obj/item/storage/box/ingredients/Initialize()
..()
+273 -273
View File
@@ -1,273 +1,273 @@
/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
* TODO: Cigarette boxes should be ported to this standard
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
* Cigarette Box
* Cigar Case
*/
/obj/item/storage/fancy
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
name = "donut box"
resistance_flags = FLAMMABLE
var/icon_type = "donut"
var/spawn_type = null
var/fancy_open = FALSE
/obj/item/storage/fancy/PopulateContents()
for(var/i = 1 to storage_slots)
new spawn_type(src)
/obj/item/storage/fancy/update_icon(itemremoved = 0)
if(fancy_open)
var/total_contents = src.contents.len - itemremoved
icon_state = "[icon_type]box[total_contents]"
else
icon_state = "[icon_type]box"
/obj/item/storage/fancy/examine(mob/user)
..()
if(fancy_open)
if(contents.len == 1)
to_chat(user, "There is one [src.icon_type] left.")
else
to_chat(user, "There are [contents.len <= 0 ? "no" : "[src.contents.len]"] [src.icon_type]s left.")
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
update_icon()
/obj/item/storage/fancy/content_can_dump(atom/dest_object, mob/user)
. = ..()
if(.)
fancy_open = TRUE
update_icon()
/obj/item/storage/fancy/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
fancy_open = TRUE
return ..()
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
fancy_open = TRUE
return ..()
/*
* Donut Box
*/
/obj/item/storage/fancy/donut_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
storage_slots = 6
can_hold = list(/obj/item/reagent_containers/food/snacks/donut)
spawn_type = /obj/item/reagent_containers/food/snacks/donut
fancy_open = TRUE
/*
* Egg Box
*/
/obj/item/storage/fancy/egg_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "eggbox"
icon_type = "egg"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
name = "egg box"
storage_slots = 12
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
spawn_type = /obj/item/reagent_containers/food/snacks/egg
/*
* Candle Box
*/
/obj/item/storage/fancy/candle_box
name = "candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
storage_slots = 5
throwforce = 2
slot_flags = SLOT_BELT
spawn_type = /obj/item/candle
fancy_open = TRUE
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
return
////////////
//CIG PACK//
////////////
/obj/item/storage/fancy/cigarettes
name = "\improper Space Cigarettes packet"
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig"
item_state = "cigpacket"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list(/obj/item/clothing/mask/cigarette, /obj/item/lighter)
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
if(user.get_active_held_item())
return
for(var/obj/item/lighter/lighter in src)
remove_from_storage(lighter, user.loc)
user.put_in_active_hand(lighter)
break
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)
cut_overlays()
if(!contents.len)
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
add_overlay("[icon_state]_open")
var/i = contents.len
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
inserted_overlay.pixel_x = 1 * (i - 1)
if(istype(C, /obj/item/lighter/greyscale))
inserted_overlay.icon_state = "lighter_in"
else if(istype(C, /obj/item/lighter))
inserted_overlay.icon_state = "zippo_in"
else
inserted_overlay.icon_state = "cigarette"
add_overlay(inserted_overlay)
i--
else
cut_overlays()
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
remove_from_storage(W, M)
M.equip_to_slot_if_possible(W, slot_wear_mask)
contents -= W
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
else
..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/dromedaryco
name = "\improper DromedaryCo packet"
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
icon_state = "dromedary"
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
/obj/item/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
desc = "Your favorite brand, now menthol flavored."
icon_state = "uplift"
spawn_type = /obj/item/clothing/mask/cigarette/uplift
/obj/item/storage/fancy/cigarettes/cigpack_robust
name = "\improper Robust packet"
desc = "Smoked by the robust."
icon_state = "robust"
spawn_type = /obj/item/clothing/mask/cigarette/robust
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
name = "\improper Robust Gold packet"
desc = "Smoked by the truly robust."
icon_state = "robustg"
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
desc = "Since 2313."
icon_state = "carp"
spawn_type = /obj/item/clothing/mask/cigarette/carp
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "cigarette packet"
desc = "An obscure brand of cigarettes."
icon_state = "syndie"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_midori
name = "\improper Midori Tabako packet"
desc = "You can't understand the runes, but the packet smells funny."
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
name = "\improper Shady Jim's Super Slims packet"
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
/obj/item/storage/fancy/rollingpapers
name = "rolling paper pack"
desc = "A pack of NanoTrasen brand rolling papers."
w_class = WEIGHT_CLASS_TINY
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper_pack"
storage_slots = 10
icon_type = "rolling paper"
can_hold = list(/obj/item/rollingpaper)
spawn_type = /obj/item/rollingpaper
/obj/item/storage/fancy/rollingpapers/update_icon()
cut_overlays()
if(!contents.len)
add_overlay("[icon_state]_empty")
/////////////
//CIGAR BOX//
/////////////
/obj/item/storage/fancy/cigarettes/cigars
name = "\improper premium cigar case"
desc = "A case of premium cigars. Very expensive."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigarcase"
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 5
can_hold = list(/obj/item/clothing/mask/cigarette/cigar)
icon_type = "premium cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
cut_overlays()
if(fancy_open)
add_overlay("[icon_state]_open")
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, icon_type)
for(var/c = contents.len, c >= 1, c--)
cigar_overlay.pixel_x = 4 * (c - 1)
add_overlay(cigar_overlay)
else
icon_state = "cigarcase"
/obj/item/storage/fancy/cigarettes/cigars/cohiba
name = "\improper cohiba robusto cigar case"
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper premium havanian cigar case"
desc = "A case of classy Havanian cigars."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
* TODO: Cigarette boxes should be ported to this standard
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
* Cigarette Box
* Cigar Case
*/
/obj/item/storage/fancy
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
name = "donut box"
resistance_flags = FLAMMABLE
var/icon_type = "donut"
var/spawn_type = null
var/fancy_open = FALSE
/obj/item/storage/fancy/PopulateContents()
for(var/i = 1 to storage_slots)
new spawn_type(src)
/obj/item/storage/fancy/update_icon(itemremoved = 0)
if(fancy_open)
var/total_contents = src.contents.len - itemremoved
icon_state = "[icon_type]box[total_contents]"
else
icon_state = "[icon_type]box"
/obj/item/storage/fancy/examine(mob/user)
..()
if(fancy_open)
if(contents.len == 1)
to_chat(user, "There is one [src.icon_type] left.")
else
to_chat(user, "There are [contents.len <= 0 ? "no" : "[src.contents.len]"] [src.icon_type]s left.")
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
update_icon()
/obj/item/storage/fancy/dump_content_at(atom/dest_object, mob/user)
. = ..()
if(.)
fancy_open = TRUE
update_icon()
/obj/item/storage/fancy/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
fancy_open = TRUE
return ..()
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
fancy_open = TRUE
return ..()
/*
* Donut Box
*/
/obj/item/storage/fancy/donut_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
storage_slots = 6
can_hold = list(/obj/item/reagent_containers/food/snacks/donut)
spawn_type = /obj/item/reagent_containers/food/snacks/donut
fancy_open = TRUE
/*
* Egg Box
*/
/obj/item/storage/fancy/egg_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "eggbox"
icon_type = "egg"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
name = "egg box"
storage_slots = 12
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
spawn_type = /obj/item/reagent_containers/food/snacks/egg
/*
* Candle Box
*/
/obj/item/storage/fancy/candle_box
name = "candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
storage_slots = 5
throwforce = 2
slot_flags = SLOT_BELT
spawn_type = /obj/item/candle
fancy_open = TRUE
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
return
////////////
//CIG PACK//
////////////
/obj/item/storage/fancy/cigarettes
name = "\improper Space Cigarettes packet"
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig"
item_state = "cigpacket"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list(/obj/item/clothing/mask/cigarette, /obj/item/lighter)
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
if(user.get_active_held_item())
return
for(var/obj/item/lighter/lighter in src)
remove_from_storage(lighter, user.loc)
user.put_in_active_hand(lighter)
break
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)
cut_overlays()
if(!contents.len)
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
add_overlay("[icon_state]_open")
var/i = contents.len
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
inserted_overlay.pixel_x = 1 * (i - 1)
if(istype(C, /obj/item/lighter/greyscale))
inserted_overlay.icon_state = "lighter_in"
else if(istype(C, /obj/item/lighter))
inserted_overlay.icon_state = "zippo_in"
else
inserted_overlay.icon_state = "cigarette"
add_overlay(inserted_overlay)
i--
else
cut_overlays()
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
remove_from_storage(W, M)
M.equip_to_slot_if_possible(W, slot_wear_mask)
contents -= W
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
else
..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/dromedaryco
name = "\improper DromedaryCo packet"
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
icon_state = "dromedary"
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
/obj/item/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
desc = "Your favorite brand, now menthol flavored."
icon_state = "uplift"
spawn_type = /obj/item/clothing/mask/cigarette/uplift
/obj/item/storage/fancy/cigarettes/cigpack_robust
name = "\improper Robust packet"
desc = "Smoked by the robust."
icon_state = "robust"
spawn_type = /obj/item/clothing/mask/cigarette/robust
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
name = "\improper Robust Gold packet"
desc = "Smoked by the truly robust."
icon_state = "robustg"
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
desc = "Since 2313."
icon_state = "carp"
spawn_type = /obj/item/clothing/mask/cigarette/carp
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "cigarette packet"
desc = "An obscure brand of cigarettes."
icon_state = "syndie"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_midori
name = "\improper Midori Tabako packet"
desc = "You can't understand the runes, but the packet smells funny."
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
name = "\improper Shady Jim's Super Slims packet"
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
/obj/item/storage/fancy/rollingpapers
name = "rolling paper pack"
desc = "A pack of Nanotrasen brand rolling papers."
w_class = WEIGHT_CLASS_TINY
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper_pack"
storage_slots = 10
icon_type = "rolling paper"
can_hold = list(/obj/item/rollingpaper)
spawn_type = /obj/item/rollingpaper
/obj/item/storage/fancy/rollingpapers/update_icon()
cut_overlays()
if(!contents.len)
add_overlay("[icon_state]_empty")
/////////////
//CIGAR BOX//
/////////////
/obj/item/storage/fancy/cigarettes/cigars
name = "\improper premium cigar case"
desc = "A case of premium cigars. Very expensive."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigarcase"
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 5
can_hold = list(/obj/item/clothing/mask/cigarette/cigar)
icon_type = "premium cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
cut_overlays()
if(fancy_open)
add_overlay("[icon_state]_open")
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, icon_type)
for(var/c = contents.len, c >= 1, c--)
cigar_overlay.pixel_x = 4 * (c - 1)
add_overlay(cigar_overlay)
else
icon_state = "cigarcase"
/obj/item/storage/fancy/cigarettes/cigars/cohiba
name = "\improper cohiba robusto cigar case"
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper premium havanian cigar case"
desc = "A case of classy Havanian cigars."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
+181 -181
View File
@@ -1,182 +1,182 @@
/obj/item/storage/lockbox
name = "lockbox"
desc = "A locked box."
icon_state = "lockbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 4
req_access = list(ACCESS_ARMORY)
var/locked = TRUE
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
return
if(allowed(user))
locked = !locked
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
close_all()
return
else
icon_state = icon_closed
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
return
else
to_chat(user, "<span class='danger'>Access Denied.</span>")
return
if(!locked)
return ..()
else
to_chat(user, "<span class='danger'>It's locked!</span>")
/obj/item/storage/lockbox/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = TRUE
locked = FALSE
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
return
/obj/item/storage/lockbox/show_to(mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
else
..()
return
//Check the destination item type for contentto.
/obj/item/storage/lockbox/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return 0
open = TRUE
return ..()
/obj/item/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
/obj/item/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/loyalty/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/implantcase/mindshield(src)
new /obj/item/implanter/mindshield(src)
/obj/item/storage/lockbox/clusterbang
name = "lockbox of clusterbangs"
desc = "You have a bad feeling about opening this."
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/clusterbang/PopulateContents()
new /obj/item/grenade/clusterbuster(src)
/obj/item/storage/lockbox/medal
name = "medal box"
desc = "A locked box used to store medals of honor."
icon_state = "medalbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
storage_slots = 10
max_combined_w_class = 20
req_access = list(ACCESS_CAPTAIN)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/storage/lockbox/medal/AltClick()
if(!locked)
open = (open ? FALSE : TRUE)
update_icon()
..()
/obj/item/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/bronze_heart(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/conduct(src)
/obj/item/storage/lockbox/medal/update_icon()
cut_overlays()
if(locked)
icon_state = "medalbox+l"
open = FALSE
else
icon_state = "medalbox"
if(open)
icon_state += "open"
if(broken)
icon_state += "+b"
if(contents && open)
for (var/i in 1 to contents.len)
var/obj/item/clothing/accessory/medal/M = contents[i]
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
if(i > 1 && i <= 5)
medalicon.pixel_x += ((i-1)*3)
else if(i > 5)
medalicon.pixel_y -= 7
medalicon.pixel_x -= 2
medalicon.pixel_x += ((i-6)*3)
add_overlay(medalicon)
/obj/item/storage/lockbox/medal/sec
name = "security medal box"
desc = "A locked box used to store medals to be given to members of the security department."
req_access = list(ACCESS_HOS)
/obj/item/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/security(src)
/obj/item/storage/lockbox/medal/sci
name = "science medal box"
desc = "A locked box used to store medals to be given to members of the science department."
req_access = list(ACCESS_RD)
/obj/item/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
/obj/item/storage/lockbox
name = "lockbox"
desc = "A locked box."
icon_state = "lockbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 4
req_access = list(ACCESS_ARMORY)
var/locked = TRUE
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
return
if(allowed(user))
locked = !locked
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
close_all()
return
else
icon_state = icon_closed
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
return
else
to_chat(user, "<span class='danger'>Access Denied.</span>")
return
if(!locked)
return ..()
else
to_chat(user, "<span class='danger'>It's locked!</span>")
/obj/item/storage/lockbox/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = TRUE
locked = FALSE
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
return
/obj/item/storage/lockbox/show_to(mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
else
..()
return
//Check the destination item type for contentto.
/obj/item/storage/lockbox/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return null
open = TRUE
return ..()
/obj/item/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
/obj/item/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
open = TRUE
update_icon()
return ..()
/obj/item/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/loyalty/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/implantcase/mindshield(src)
new /obj/item/implanter/mindshield(src)
/obj/item/storage/lockbox/clusterbang
name = "lockbox of clusterbangs"
desc = "You have a bad feeling about opening this."
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/clusterbang/PopulateContents()
new /obj/item/grenade/clusterbuster(src)
/obj/item/storage/lockbox/medal
name = "medal box"
desc = "A locked box used to store medals of honor."
icon_state = "medalbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
storage_slots = 10
max_combined_w_class = 20
req_access = list(ACCESS_CAPTAIN)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/storage/lockbox/medal/AltClick()
if(!locked)
open = (open ? FALSE : TRUE)
update_icon()
..()
/obj/item/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/bronze_heart(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/conduct(src)
/obj/item/storage/lockbox/medal/update_icon()
cut_overlays()
if(locked)
icon_state = "medalbox+l"
open = FALSE
else
icon_state = "medalbox"
if(open)
icon_state += "open"
if(broken)
icon_state += "+b"
if(contents && open)
for (var/i in 1 to contents.len)
var/obj/item/clothing/accessory/medal/M = contents[i]
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
if(i > 1 && i <= 5)
medalicon.pixel_x += ((i-1)*3)
else if(i > 5)
medalicon.pixel_y -= 7
medalicon.pixel_x -= 2
medalicon.pixel_x += ((i-6)*3)
add_overlay(medalicon)
/obj/item/storage/lockbox/medal/sec
name = "security medal box"
desc = "A locked box used to store medals to be given to members of the security department."
req_access = list(ACCESS_HOS)
/obj/item/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/security(src)
/obj/item/storage/lockbox/medal/sci
name = "science medal box"
desc = "A locked box used to store medals to be given to members of the science department."
req_access = list(ACCESS_RD)
/obj/item/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
+197 -197
View File
@@ -1,197 +1,197 @@
/*
* Absorbs /obj/item/secstorage.
* Reimplements it only slightly to use existing storage functionality.
*
* Contains:
* Secure Briefcase
* Wall Safe
*/
// -----------------------------
// Generic Item
// -----------------------------
/obj/item/storage/secure
name = "secstorage"
var/icon_locking = "secureb"
var/icon_sparking = "securespark"
var/icon_opened = "secure0"
var/locked = TRUE
var/code = ""
var/l_code = null
var/l_set = 0
var/l_setshort = 0
var/l_hacking = 0
var/open = FALSE
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
max_combined_w_class = 14
/obj/item/storage/secure/examine(mob/user)
..()
to_chat(user, text("The service panel is [src.open ? "open" : "closed"]."))
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(locked)
if (istype(W, /obj/item/screwdriver))
if (do_after(user, 20*W.toolspeed, target = src))
src.open =! src.open
user.show_message("<span class='notice'>You [open ? "open" : "close"] the service panel.</span>", 1)
return
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
user.show_message("<span class='danger'>Now attempting to reset internal memory, please hold.</span>", 1)
src.l_hacking = 1
if (do_after(usr, 100*W.toolspeed, target = src))
if (prob(33))
src.l_setshort = 1
src.l_set = 0
user.show_message("<span class='danger'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
sleep(80)
src.l_setshort = 0
src.l_hacking = 0
else
user.show_message("<span class='danger'>Unable to reset internal memory.</span>", 1)
src.l_hacking = 0
else
src.l_hacking = 0
return
//At this point you have exhausted all the special things to do when locked
// ... but it's still locked.
return
// -> storage/attackby() what with handle insertion, etc
return ..()
/obj/item/storage/secure/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/secure/attack_self(mob/user)
user.set_machine(src)
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
if ((src.l_set == 0) && (!src.l_setshort))
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
if (src.l_setshort)
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
message = text("[]", src.code)
if (!src.locked)
message = "*****"
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
user << browse(dat, "window=caselock;size=300x280")
/obj/item/storage/secure/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
return
if (href_list["type"])
if (href_list["type"] == "E")
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
src.l_code = src.code
src.l_set = 1
else if ((src.code == src.l_code) && (src.l_set == 1))
src.locked = FALSE
cut_overlays()
add_overlay(icon_opened)
src.code = null
else
src.code = "ERROR"
else
if ((href_list["type"] == "R") && (!src.l_setshort))
src.locked = TRUE
cut_overlays()
src.code = null
src.close(usr)
else
src.code += text("[]", sanitize_text(href_list["type"]))
if (length(src.code) > 5)
src.code = "ERROR"
src.add_fingerprint(usr)
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
return
return
/obj/item/storage/secure/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return 0
return ..()
/obj/item/storage/secure/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
// -----------------------------
// Secure Briefcase
// -----------------------------
/obj/item/storage/secure/briefcase
name = "secure briefcase"
icon = 'icons/obj/storage.dmi'
icon_state = "secure"
item_state = "sec-case"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
desc = "A large briefcase with a digital locking system."
force = 8
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/storage/secure/briefcase/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/briefcase/attack_hand(mob/user)
if ((src.loc == user) && (src.locked == 1))
to_chat(usr, "<span class='warning'>[src] is locked and cannot be opened!</span>")
add_fingerprint(user)
else
..()
//Syndie variant of Secure Briefcase. Contains space cash, slightly more robust.
/obj/item/storage/secure/briefcase/syndie
force = 15
/obj/item/storage/secure/briefcase/syndie/PopulateContents()
..()
for(var/i = 0, i < storage_slots - 2, i++)
new /obj/item/stack/spacecash/c1000(src)
// -----------------------------
// Secure Safe
// -----------------------------
/obj/item/storage/secure/safe
name = "secure safe"
icon = 'icons/obj/storage.dmi'
icon_state = "safe"
icon_opened = "safe0"
icon_locking = "safeb"
icon_sparking = "safespark"
force = 8
w_class = WEIGHT_CLASS_GIGANTIC
max_w_class = 8
anchored = TRUE
density = FALSE
cant_hold = list(/obj/item/storage/secure/briefcase)
/obj/item/storage/secure/safe/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/safe/attack_hand(mob/user)
return attack_self(user)
/obj/item/storage/secure/safe/HoS
name = "head of security's safe"
/*
* Absorbs /obj/item/secstorage.
* Reimplements it only slightly to use existing storage functionality.
*
* Contains:
* Secure Briefcase
* Wall Safe
*/
// -----------------------------
// Generic Item
// -----------------------------
/obj/item/storage/secure
name = "secstorage"
var/icon_locking = "secureb"
var/icon_sparking = "securespark"
var/icon_opened = "secure0"
var/locked = TRUE
var/code = ""
var/l_code = null
var/l_set = 0
var/l_setshort = 0
var/l_hacking = 0
var/open = FALSE
w_class = WEIGHT_CLASS_NORMAL
max_w_class = WEIGHT_CLASS_SMALL
max_combined_w_class = 14
/obj/item/storage/secure/examine(mob/user)
..()
to_chat(user, text("The service panel is [src.open ? "open" : "closed"]."))
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(locked)
if (istype(W, /obj/item/screwdriver))
if (do_after(user, 20*W.toolspeed, target = src))
src.open =! src.open
user.show_message("<span class='notice'>You [open ? "open" : "close"] the service panel.</span>", 1)
return
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
user.show_message("<span class='danger'>Now attempting to reset internal memory, please hold.</span>", 1)
src.l_hacking = 1
if (do_after(usr, 100*W.toolspeed, target = src))
if (prob(33))
src.l_setshort = 1
src.l_set = 0
user.show_message("<span class='danger'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
sleep(80)
src.l_setshort = 0
src.l_hacking = 0
else
user.show_message("<span class='danger'>Unable to reset internal memory.</span>", 1)
src.l_hacking = 0
else
src.l_hacking = 0
return
//At this point you have exhausted all the special things to do when locked
// ... but it's still locked.
return
// -> storage/attackby() what with handle insertion, etc
return ..()
/obj/item/storage/secure/MouseDrop(over_object, src_location, over_location)
if (locked)
src.add_fingerprint(usr)
to_chat(usr, "<span class='warning'>It's locked!</span>")
return 0
..()
/obj/item/storage/secure/attack_self(mob/user)
user.set_machine(src)
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
if ((src.l_set == 0) && (!src.l_setshort))
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
if (src.l_setshort)
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
message = text("[]", src.code)
if (!src.locked)
message = "*****"
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
user << browse(dat, "window=caselock;size=300x280")
/obj/item/storage/secure/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
return
if (href_list["type"])
if (href_list["type"] == "E")
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
src.l_code = src.code
src.l_set = 1
else if ((src.code == src.l_code) && (src.l_set == 1))
src.locked = FALSE
cut_overlays()
add_overlay(icon_opened)
src.code = null
else
src.code = "ERROR"
else
if ((href_list["type"] == "R") && (!src.l_setshort))
src.locked = TRUE
cut_overlays()
src.code = null
src.close(usr)
else
src.code += text("[]", sanitize_text(href_list["type"]))
if (length(src.code) > 5)
src.code = "ERROR"
src.add_fingerprint(usr)
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
return
return
/obj/item/storage/secure/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
if(locked)
to_chat(user, "<span class='warning'>It's locked!</span>")
return null
return ..()
/obj/item/storage/secure/can_be_inserted(obj/item/W, stop_messages = 0)
if(locked)
return 0
return ..()
// -----------------------------
// Secure Briefcase
// -----------------------------
/obj/item/storage/secure/briefcase
name = "secure briefcase"
icon = 'icons/obj/storage.dmi'
icon_state = "secure"
item_state = "sec-case"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
desc = "A large briefcase with a digital locking system."
force = 8
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/storage/secure/briefcase/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/briefcase/attack_hand(mob/user)
if ((src.loc == user) && (src.locked == 1))
to_chat(usr, "<span class='warning'>[src] is locked and cannot be opened!</span>")
add_fingerprint(user)
else
..()
//Syndie variant of Secure Briefcase. Contains space cash, slightly more robust.
/obj/item/storage/secure/briefcase/syndie
force = 15
/obj/item/storage/secure/briefcase/syndie/PopulateContents()
..()
for(var/i = 0, i < storage_slots - 2, i++)
new /obj/item/stack/spacecash/c1000(src)
// -----------------------------
// Secure Safe
// -----------------------------
/obj/item/storage/secure/safe
name = "secure safe"
icon = 'icons/obj/storage.dmi'
icon_state = "safe"
icon_opened = "safe0"
icon_locking = "safeb"
icon_sparking = "safespark"
force = 8
w_class = WEIGHT_CLASS_GIGANTIC
max_w_class = 8
anchored = TRUE
density = FALSE
cant_hold = list(/obj/item/storage/secure/briefcase)
/obj/item/storage/secure/safe/PopulateContents()
new /obj/item/paper(src)
new /obj/item/pen(src)
/obj/item/storage/secure/safe/attack_hand(mob/user)
return attack_self(user)
/obj/item/storage/secure/safe/HoS
name = "head of security's safe"
File diff suppressed because it is too large Load Diff
-12
View File
@@ -1,12 +0,0 @@
diff a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm (rejected hunks)
@@ -244,8 +244,8 @@
// Copied from /obj/item/melee/transforming/energy/sword/attackby
/obj/item/toy/sword/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/toy/sword))
- if((W.flags & NODROP) || (flags & NODROP))
- to_chat(user, "<span class='warning'>\the [flags & NODROP ? src : W] is stuck to your hand, you can't attach it to \the [flags & NODROP ? W : src]!</span>")
+ if((W.flags_1 & NODROP_1) || (flags_1 & NODROP_1))
+ to_chat(user, "<span class='warning'>\the [flags_1 & NODROP_1 ? src : W] is stuck to your hand, you can't attach it to \the [flags_1 & NODROP_1 ? W : src]!</span>")
return
else
to_chat(user, "<span class='notice'>You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool.</span>")
+223 -221
View File
@@ -1,228 +1,230 @@
/obj
var/crit_fail = FALSE
animate_movement = 2
var/throwforce = 0
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
var/damtype = BRUTE
var/force = 0
var/list/armor
/obj
var/crit_fail = FALSE
animate_movement = 2
var/throwforce = 0
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
var/damtype = BRUTE
var/force = 0
var/list/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
var/resistance_flags = 0 // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
var/acid_level = 0 //how much acid is on that obj
var/being_shocked = FALSE
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
var/unique_rename = FALSE // can you customize the description/name of the thing?
var/current_skin //Has the item been reskinned?
var/list/unique_reskin //List of options to reskin.
var/dangerous_possession = FALSE //Admin possession yes/no
/obj/vv_edit_var(vname, vval)
switch(vname)
if("dangerous_possession")
return FALSE
if("control_object")
var/obj/O = vval
if(istype(O) && O.dangerous_possession)
return FALSE
..()
/obj/Initialize()
. = ..()
if (!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0)
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
var/resistance_flags = 0 // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
var/acid_level = 0 //how much acid is on that obj
var/being_shocked = FALSE
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
var/unique_rename = FALSE // can you customize the description/name of the thing?
var/current_skin //Has the item been reskinned?
var/list/unique_reskin //List of options to reskin.
var/dangerous_possession = FALSE //Admin possession yes/no
/obj/vv_edit_var(vname, vval)
switch(vname)
if("dangerous_possession")
return FALSE
if("control_object")
var/obj/O = vval
if(istype(O) && O.dangerous_possession)
return FALSE
..()
/obj/Initialize()
. = ..()
if (!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0)
if(obj_integrity == null)
obj_integrity = max_integrity
if(on_blueprints && isturf(loc))
var/turf/T = loc
if(force_blueprints)
T.add_blueprints(src)
else
T.add_blueprints_preround(src)
/obj/Destroy(force=FALSE)
if(!istype(src, /obj/machinery))
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
SStgui.close_uis(src)
. = ..()
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
..()
if(on_blueprints && isturf(loc))
var/turf/T = loc
if(force_blueprints)
T.add_blueprints(src)
else
T.add_blueprints_preround(src)
/obj/Destroy(force=FALSE)
if(!istype(src, /obj/machinery))
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
SStgui.close_uis(src)
. = ..()
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
..()
if(flags_2 & FROZEN_2)
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
qdel(src)
/obj/assume_air(datum/gas_mixture/giver)
if(loc)
return loc.assume_air(giver)
else
return null
/obj/remove_air(amount)
if(loc)
return loc.remove_air(amount)
else
return null
/obj/return_air()
if(loc)
return loc.return_air()
else
return null
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
//Return: (NONSTANDARD)
// null if object handles breathing logic for lifeform
// datum/air_group to tell lifeform to process using that breath return
//DEFAULT: Take air from turf to give to have mob process
if(breath_request>0)
var/datum/gas_mixture/environment = return_air()
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
return remove_air(environment.total_moles() * breath_percentage)
else
return null
/obj/proc/updateUsrDialog()
if(in_use)
var/is_in_use = 0
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = 1
src.attack_hand(M)
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
if (!(usr in nearby))
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = 1
src.attack_ai(usr)
// check for TK users
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(!(usr in nearby))
if(usr.client && usr.machine==src)
if(H.dna.check_mutation(TK))
is_in_use = 1
src.attack_hand(usr)
in_use = is_in_use
/obj/proc/updateDialog()
// Check that people are actually using the machine. If not, don't update anymore.
if(in_use)
var/list/nearby = viewers(1, src)
var/is_in_use = 0
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = 1
src.interact(M)
var/ai_in_use = AutoUpdateAI(src)
if(!ai_in_use && !is_in_use)
in_use = 0
/obj/attack_ghost(mob/user)
if(ui_interact(user) != -1)
return
..()
/obj/proc/container_resist(mob/living/user)
return
/obj/proc/update_icon()
return
/mob/proc/unset_machine()
if(machine)
machine.on_unset_machine(src)
machine = null
//called when the user unsets the machine.
/atom/movable/proc/on_unset_machine(mob/user)
return
/mob/proc/set_machine(obj/O)
if(src.machine)
unset_machine()
src.machine = O
if(istype(O))
O.in_use = 1
/obj/item/proc/updateSelfDialog()
var/mob/M = src.loc
if(istype(M) && M.client && M.machine == src)
src.attack_self(M)
/obj/proc/hide(h)
return
/obj/singularity_pull(S, current_size)
if(!anchored || current_size >= STAGE_FIVE)
step_towards(src,S)
/obj/get_spans()
return ..() | SPAN_ROBOT
/obj/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
var/turf/T = get_turf(src)
return T.storage_contents_dump_act(src_object, user)
/obj/proc/CanAStarPass()
. = !density
/obj/proc/check_uplink_validity()
return 1
/obj/proc/on_mob_move(dir, mob, oldLoc)
return
/obj/proc/on_mob_turn(dir, mob)
return
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
qdel(src)
/obj/assume_air(datum/gas_mixture/giver)
if(loc)
return loc.assume_air(giver)
else
return null
/obj/remove_air(amount)
if(loc)
return loc.remove_air(amount)
else
return null
/obj/return_air()
if(loc)
return loc.return_air()
else
return null
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
//Return: (NONSTANDARD)
// null if object handles breathing logic for lifeform
// datum/air_group to tell lifeform to process using that breath return
//DEFAULT: Take air from turf to give to have mob process
if(breath_request>0)
var/datum/gas_mixture/environment = return_air()
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
return remove_air(environment.total_moles() * breath_percentage)
else
return null
/obj/proc/updateUsrDialog()
if(in_use)
var/is_in_use = 0
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = 1
src.attack_hand(M)
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
if (!(usr in nearby))
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = 1
src.attack_ai(usr)
// check for TK users
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(!(usr in nearby))
if(usr.client && usr.machine==src)
if(H.dna.check_mutation(TK))
is_in_use = 1
src.attack_hand(usr)
in_use = is_in_use
/obj/proc/updateDialog()
// Check that people are actually using the machine. If not, don't update anymore.
if(in_use)
var/list/nearby = viewers(1, src)
var/is_in_use = 0
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = 1
src.interact(M)
var/ai_in_use = AutoUpdateAI(src)
if(!ai_in_use && !is_in_use)
in_use = 0
/obj/attack_ghost(mob/user)
if(ui_interact(user) != -1)
return
..()
/obj/proc/container_resist(mob/living/user)
return
/obj/proc/update_icon()
return
/mob/proc/unset_machine()
if(machine)
machine.on_unset_machine(src)
machine = null
//called when the user unsets the machine.
/atom/movable/proc/on_unset_machine(mob/user)
return
/mob/proc/set_machine(obj/O)
if(src.machine)
unset_machine()
src.machine = O
if(istype(O))
O.in_use = 1
/obj/item/proc/updateSelfDialog()
var/mob/M = src.loc
if(istype(M) && M.client && M.machine == src)
src.attack_self(M)
/obj/proc/hide(h)
return
/obj/singularity_pull(S, current_size)
if(!anchored || current_size >= STAGE_FIVE)
step_towards(src,S)
/obj/get_spans()
return ..() | SPAN_ROBOT
/obj/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
return
/obj/get_dumping_location(obj/item/storage/source,mob/user)
return get_turf(src)
/obj/proc/CanAStarPass()
. = !density
/obj/proc/check_uplink_validity()
return 1
/obj/proc/on_mob_move(dir, mob, oldLoc)
return
/obj/proc/on_mob_turn(dir, mob)
return
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
return
/obj/vv_get_dropdown()
. = ..()
.["Delete all of type"] = "?_src_=vars;delall=\ref[src]"
/obj/examine(mob/user)
..()
if(unique_rename)
to_chat(user, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
/obj/AltClick(mob/user)
. = ..()
if(unique_reskin && !current_skin && in_range(user,src))
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
reskin_obj(user)
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/choice = input(M,"Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
if(!QDELETED(src) && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(!unique_reskin[choice])
return
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice].'")
/obj/proc/gang_contraband_value()
return 0
/obj/vv_get_dropdown()
. = ..()
.["Delete all of type"] = "?_src_=vars;delall=\ref[src]"
/obj/examine(mob/user)
..()
if(unique_rename)
to_chat(user, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
/obj/AltClick(mob/user)
. = ..()
if(unique_reskin && !current_skin && in_range(user,src))
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
reskin_obj(user)
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/choice = input(M,"Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
if(!QDELETED(src) && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(!unique_reskin[choice])
return
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice].'")
/obj/proc/gang_contraband_value()
return 0
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm (rejected hunks)
@@ -31,7 +31,7 @@
return attack_hand(user)
/obj/structure/bed/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !(flags&NODECONSTRUCT))
+ if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, W.usesound, 50, 1)
deconstruct(TRUE)
else
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm (rejected hunks)
@@ -41,7 +41,7 @@
qdel(src)
/obj/structure/chair/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/wrench) && !(flags&NODECONSTRUCT))
+ if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, W.usesound, 50, 1)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
@@ -0,0 +1,12 @@
/obj/structure/chair/sofa
name = "old ratty sofa"
icon_state = "sofamiddle"
icon = 'icons/obj/sofa.dmi'
buildstackamount = 1
/obj/structure/chair/sofa/left
icon_state = "sofaend_left"
/obj/structure/chair/sofa/right
icon_state = "sofaend_right"
/obj/structure/chair/sofa/corner
icon_state = "sofacorner"
@@ -1,453 +1,453 @@
/obj/structure/closet
name = "closet"
desc = "It's a basic storage unit."
icon = 'icons/obj/closet.dmi'
icon_state = "generic"
density = TRUE
var/icon_door = null
var/icon_door_override = FALSE //override to have open overlay use icon different to its base's
var/secure = FALSE //secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights
var/opened = FALSE
var/welded = FALSE
var/locked = FALSE
var/large = TRUE
var/wall_mounted = 0 //never solid (You can always pass over it)
max_integrity = 200
integrity_failure = 50
armor = list(melee = 20, bullet = 10, laser = 10, energy = 0, bomb = 10, bio = 0, rad = 0, fire = 70, acid = 60)
var/breakout_time = 2
var/lastbang
var/can_weld_shut = TRUE
var/horizontal = FALSE
var/allow_objects = FALSE
var/allow_dense = FALSE
var/dense_when_open = FALSE //if it's dense when open or not
var/max_mob_size = MOB_SIZE_HUMAN //Biggest mob_size accepted by the container
var/mob_storage_capacity = 3 // how many human sized mob/living can fit together inside a closet.
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/cutting_tool = /obj/item/weldingtool
var/open_sound = 'sound/machines/click.ogg'
var/close_sound = 'sound/machines/click.ogg'
var/cutting_sound = 'sound/items/welder.ogg'
var/material_drop = /obj/item/stack/sheet/metal
var/material_drop_amount = 2
var/delivery_icon = "deliverycloset" //which icon to use when packagewrapped. null to be unwrappable.
var/anchorable = TRUE
/obj/structure/closet/Initialize(mapload)
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
addtimer(CALLBACK(src, .proc/take_contents), 0)
. = ..()
update_icon()
PopulateContents()
//USE THIS TO FILL IT, NOT INITIALIZE OR NEW
/obj/structure/closet/proc/PopulateContents()
return
/obj/structure/closet/Destroy()
dump_contents()
return ..()
/obj/structure/closet/update_icon()
cut_overlays()
if(!opened)
if(icon_door)
add_overlay("[icon_door]_door")
else
add_overlay("[icon_state]_door")
if(welded)
add_overlay("welded")
if(secure)
if(!broken)
if(locked)
add_overlay("locked")
else
add_overlay("unlocked")
else
add_overlay("off")
else
if(icon_door_override)
add_overlay("[icon_door]_open")
else
add_overlay("[icon_state]_open")
/obj/structure/closet/examine(mob/user)
..()
if(anchored)
to_chat(user, "It is anchored to the ground.")
else if(secure && !opened)
to_chat(user, "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>")
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
if(wall_mounted)
return 1
return !density
/obj/structure/closet/proc/can_open(mob/living/user)
if(welded || locked)
return 0
var/turf/T = get_turf(src)
for(var/mob/living/L in T)
if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
if(user)
to_chat(user, "<span class='danger'>There's something large on top of [src], preventing it from opening.</span>" )
return 0
return 1
/obj/structure/closet/proc/can_close(mob/living/user)
var/turf/T = get_turf(src)
for(var/obj/structure/closet/closet in T)
if(closet != src && !closet.wall_mounted)
return 0
for(var/mob/living/L in T)
if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
if(user)
to_chat(user, "<span class='danger'>There's something too large in [src], preventing it from closing.</span>")
return 0
return 1
/obj/structure/closet/proc/dump_contents()
var/atom/L = drop_location()
for(var/atom/movable/AM in src)
AM.forceMove(L)
if(throwing) // you keep some momentum when getting out of a thrown closet
step(AM, dir)
if(throwing)
throwing.finalize(FALSE)
/obj/structure/closet/proc/take_contents()
var/atom/L = drop_location()
for(var/atom/movable/AM in L)
if(AM != src && insert(AM) == -1) // limit reached
break
/obj/structure/closet/proc/open(mob/living/user)
if(opened || !can_open(user))
return
playsound(loc, open_sound, 15, 1, -3)
opened = 1
if(!dense_when_open)
density = FALSE
climb_time *= 0.5 //it's faster to climb onto an open thing
dump_contents()
update_icon()
return 1
/obj/structure/closet/proc/insert(atom/movable/AM)
if(contents.len >= storage_capacity)
return -1
if(ismob(AM))
if(!isliving(AM)) //let's not put ghosts or camera mobs inside closets...
return
var/mob/living/L = AM
if(L.anchored || L.buckled || L.incorporeal_move || L.has_buckled_mobs())
return
if(L.mob_size > MOB_SIZE_TINY) // Tiny mobs are treated as items.
if(horizontal && L.density)
return
if(L.mob_size > max_mob_size)
return
var/mobs_stored = 0
for(var/mob/living/M in contents)
if(++mobs_stored >= mob_storage_capacity)
return
L.stop_pulling()
else if(istype(AM, /obj/structure/closet))
return
else if(isobj(AM))
if(!allow_objects && !istype(AM, /obj/item) && !istype(AM, /obj/effect/dummy/chameleon))
return
if(!allow_dense && AM.density)
return
if(AM.anchored || AM.has_buckled_mobs() || (AM.flags_1 & NODROP_1))
return
else
return
AM.forceMove(src)
if(AM.pulledby)
AM.pulledby.stop_pulling()
return 1
/obj/structure/closet/proc/close(mob/living/user)
if(!opened || !can_close(user))
return 0
take_contents()
playsound(loc, close_sound, 15, 1, -3)
climb_time = initial(climb_time)
opened = 0
density = TRUE
update_icon()
return 1
/obj/structure/closet/proc/toggle(mob/living/user)
if(opened)
return close(user)
else
return open(user)
/obj/structure/closet/deconstruct(disassembled = TRUE)
if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
new material_drop(loc, material_drop_amount)
qdel(src)
/obj/structure/closet/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
bust_open()
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
if(user in src)
return
if(opened)
if(istype(W, cutting_tool))
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
playsound(loc, cutting_sound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!opened || !WT.isOn())
return
playsound(loc, cutting_sound, 50, 1)
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
deconstruct(TRUE)
return 0
else // for example cardboard box is cut with wirecutters
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE)
return 0
if(user.drop_item()) // so we put in unlit welder too
W.forceMove(loc)
return 1
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
return
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
playsound(loc, 'sound/items/welder2.ogg', 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(opened || !WT.isOn())
return
playsound(loc, WT.usesound, 50, 1)
welded = !welded
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unweldeds"] \the [src].</span>",
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
update_icon()
else if(istype(W, /obj/item/wrench) && anchorable)
if(isinspace() && !anchored)
return
anchored = !anchored
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
else if(user.a_intent != INTENT_HARM && !(W.flags_1 & NOBLUDGEON_1))
if(W.GetID() || !toggle(user))
togglelock(user)
return 1
else
return ..()
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
if(!istype(O) || O.anchored || istype(O, /obj/screen))
return
if(!istype(user) || user.incapacitated() || user.lying)
return
if(!Adjacent(user) || !user.Adjacent(O))
return
if(user == O) //try to climb onto it
return ..()
if(!opened)
return
if(!isturf(O.loc))
return
var/actuallyismob = 0
if(isliving(O))
actuallyismob = 1
else if(!isitem(O))
return
var/turf/T = get_turf(src)
var/list/targets = list(O, src)
add_fingerprint(user)
user.visible_message("<span class='warning'>[user] [actuallyismob ? "tries to ":""]stuff [O] into [src].</span>", \
"<span class='warning'>You [actuallyismob ? "try to ":""]stuff [O] into [src].</span>", \
"<span class='italics'>You hear clanging.</span>")
if(actuallyismob)
if(do_after_mob(user, targets, 40))
user.visible_message("<span class='notice'>[user] stuffs [O] into [src].</span>", \
"<span class='notice'>You stuff [O] into [src].</span>", \
"<span class='italics'>You hear a loud metal bang.</span>")
var/mob/living/L = O
if(!issilicon(L))
L.Knockdown(40)
O.forceMove(T)
close()
else
O.forceMove(T)
return 1
/obj/structure/closet/relaymove(mob/user)
if(user.stat || !isturf(loc) || !isliving(user))
return
var/mob/living/L = user
if(!open())
if(L.last_special <= world.time)
container_resist(L)
if(world.time > lastbang+5)
lastbang = world.time
for(var/mob/M in get_hearers_in_view(src, null))
M.show_message("<FONT size=[max(0, 5 - get_dist(src, M))]>BANG, bang!</FONT>", 2)
/obj/structure/closet/attack_hand(mob/user)
..()
if(user.lying && get_dist(src, user) > 0)
return
if(!toggle(user))
togglelock(user)
return
/obj/structure/closet/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/closet/attack_robot(mob/user)
if(user.Adjacent(src))
return attack_hand(user)
// tk grab then use on self
/obj/structure/closet/attack_self_tk(mob/user)
return attack_hand(user)
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"
set name = "Toggle Open"
if(!usr.canmove || usr.stat || usr.restrained())
return
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
attack_hand(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
// Objects that try to exit a locker by stepping were doing so successfully,
// and due to an oversight in turf/Enter() were going through walls. That
// should be independently resolved, but this is also an interesting twist.
/obj/structure/closet/Exit(atom/movable/AM)
open()
if(AM.loc == src)
return 0
return 1
/obj/structure/closet/container_resist(mob/living/user)
if(opened)
return
if(ismovableatom(loc))
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
var/atom/movable/AM = loc
AM.relay_container_resist(user, src)
return
if(!welded && !locked)
open()
return
//okay, so the closet is either welded or locked... resist!!!
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You lean on the back of [src] and start pushing the door open.</span>")
visible_message("<span class='warning'>[src] begins to shake violently!</span>")
if(do_after(user,(breakout_time * 60 * 10), target = src)) //minutes * 60seconds * 10deciseconds
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
return
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
user.visible_message("<span class='danger'>[user] successfully broke out of [src]!</span>",
"<span class='notice'>You successfully break out of [src]!</span>")
bust_open()
else
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
/obj/structure/closet/proc/bust_open()
welded = FALSE //applies to all lockers
locked = FALSE //applies to critter crates and secure lockers only
broken = 1 //applies to secure lockers only
open()
/obj/structure/closet/AltClick(mob/user)
..()
if(!user.canUseTopic(src, be_close=TRUE))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(opened || !secure)
return
else
togglelock(user)
/obj/structure/closet/proc/togglelock(mob/living/user)
if(secure && !broken)
if(allowed(user))
if(iscarbon(user))
add_fingerprint(user)
locked = !locked
user.visible_message("<span class='notice'>[user] [locked ? null : "un"]locks [src].</span>",
"<span class='notice'>You [locked ? null : "un"]lock [src].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>Access Denied</span>")
else if(secure && broken)
to_chat(user, "<span class='warning'>\The [src] is broken!</span>")
/obj/structure/closet/emag_act(mob/user)
if(secure && !broken)
user.visible_message("<span class='warning'>Sparks fly from [src]!</span>",
"<span class='warning'>You scramble [src]'s lock, breaking it open!</span>",
"<span class='italics'>You hear a faint electrical spark.</span>")
playsound(src, "sparks", 50, 1)
broken = 1
locked = FALSE
update_icon()
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
/obj/structure/closet/emp_act(severity)
for(var/obj/O in src)
O.emp_act(severity)
if(secure && !broken)
if(prob(50 / severity))
locked = !locked
update_icon()
if(prob(20 / severity) && !opened)
if(!locked)
open()
else
req_access = list()
req_access += pick(get_all_accesses())
..()
/obj/structure/closet/contents_explosion(severity, target)
for(var/atom/A in contents)
A.ex_act(severity, target)
CHECK_TICK
/obj/structure/closet/singularity_act()
dump_contents()
..()
/obj/structure/closet/AllowDrop()
return TRUE
/obj/structure/closet
name = "closet"
desc = "It's a basic storage unit."
icon = 'icons/obj/closet.dmi'
icon_state = "generic"
density = TRUE
var/icon_door = null
var/icon_door_override = FALSE //override to have open overlay use icon different to its base's
var/secure = FALSE //secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights
var/opened = FALSE
var/welded = FALSE
var/locked = FALSE
var/large = TRUE
var/wall_mounted = 0 //never solid (You can always pass over it)
max_integrity = 200
integrity_failure = 50
armor = list(melee = 20, bullet = 10, laser = 10, energy = 0, bomb = 10, bio = 0, rad = 0, fire = 70, acid = 60)
var/breakout_time = 2
var/lastbang
var/can_weld_shut = TRUE
var/horizontal = FALSE
var/allow_objects = FALSE
var/allow_dense = FALSE
var/dense_when_open = FALSE //if it's dense when open or not
var/max_mob_size = MOB_SIZE_HUMAN //Biggest mob_size accepted by the container
var/mob_storage_capacity = 3 // how many human sized mob/living can fit together inside a closet.
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/cutting_tool = /obj/item/weldingtool
var/open_sound = 'sound/machines/click.ogg'
var/close_sound = 'sound/machines/click.ogg'
var/cutting_sound = 'sound/items/welder.ogg'
var/material_drop = /obj/item/stack/sheet/metal
var/material_drop_amount = 2
var/delivery_icon = "deliverycloset" //which icon to use when packagewrapped. null to be unwrappable.
var/anchorable = TRUE
/obj/structure/closet/Initialize(mapload)
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
addtimer(CALLBACK(src, .proc/take_contents), 0)
. = ..()
update_icon()
PopulateContents()
//USE THIS TO FILL IT, NOT INITIALIZE OR NEW
/obj/structure/closet/proc/PopulateContents()
return
/obj/structure/closet/Destroy()
dump_contents()
return ..()
/obj/structure/closet/update_icon()
cut_overlays()
if(!opened)
if(icon_door)
add_overlay("[icon_door]_door")
else
add_overlay("[icon_state]_door")
if(welded)
add_overlay("welded")
if(secure)
if(!broken)
if(locked)
add_overlay("locked")
else
add_overlay("unlocked")
else
add_overlay("off")
else
if(icon_door_override)
add_overlay("[icon_door]_open")
else
add_overlay("[icon_state]_open")
/obj/structure/closet/examine(mob/user)
..()
if(anchored)
to_chat(user, "It is anchored to the ground.")
else if(secure && !opened)
to_chat(user, "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>")
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
if(wall_mounted)
return 1
return !density
/obj/structure/closet/proc/can_open(mob/living/user)
if(welded || locked)
return 0
var/turf/T = get_turf(src)
for(var/mob/living/L in T)
if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
if(user)
to_chat(user, "<span class='danger'>There's something large on top of [src], preventing it from opening.</span>" )
return 0
return 1
/obj/structure/closet/proc/can_close(mob/living/user)
var/turf/T = get_turf(src)
for(var/obj/structure/closet/closet in T)
if(closet != src && !closet.wall_mounted)
return 0
for(var/mob/living/L in T)
if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
if(user)
to_chat(user, "<span class='danger'>There's something too large in [src], preventing it from closing.</span>")
return 0
return 1
/obj/structure/closet/proc/dump_contents()
var/atom/L = drop_location()
for(var/atom/movable/AM in src)
AM.forceMove(L)
if(throwing) // you keep some momentum when getting out of a thrown closet
step(AM, dir)
if(throwing)
throwing.finalize(FALSE)
/obj/structure/closet/proc/take_contents()
var/atom/L = drop_location()
for(var/atom/movable/AM in L)
if(AM != src && insert(AM) == -1) // limit reached
break
/obj/structure/closet/proc/open(mob/living/user)
if(opened || !can_open(user))
return
playsound(loc, open_sound, 15, 1, -3)
opened = 1
if(!dense_when_open)
density = FALSE
climb_time *= 0.5 //it's faster to climb onto an open thing
dump_contents()
update_icon()
return 1
/obj/structure/closet/proc/insert(atom/movable/AM)
if(contents.len >= storage_capacity)
return -1
if(ismob(AM))
if(!isliving(AM)) //let's not put ghosts or camera mobs inside closets...
return
var/mob/living/L = AM
if(L.anchored || L.buckled || L.incorporeal_move || L.has_buckled_mobs())
return
if(L.mob_size > MOB_SIZE_TINY) // Tiny mobs are treated as items.
if(horizontal && L.density)
return
if(L.mob_size > max_mob_size)
return
var/mobs_stored = 0
for(var/mob/living/M in contents)
if(++mobs_stored >= mob_storage_capacity)
return
L.stop_pulling()
else if(istype(AM, /obj/structure/closet))
return
else if(isobj(AM))
if(!allow_objects && !istype(AM, /obj/item) && !istype(AM, /obj/effect/dummy/chameleon))
return
if(!allow_dense && AM.density)
return
if(AM.anchored || AM.has_buckled_mobs() || (AM.flags_1 & NODROP_1))
return
else
return
AM.forceMove(src)
if(AM.pulledby)
AM.pulledby.stop_pulling()
return 1
/obj/structure/closet/proc/close(mob/living/user)
if(!opened || !can_close(user))
return 0
take_contents()
playsound(loc, close_sound, 15, 1, -3)
climb_time = initial(climb_time)
opened = 0
density = TRUE
update_icon()
return 1
/obj/structure/closet/proc/toggle(mob/living/user)
if(opened)
return close(user)
else
return open(user)
/obj/structure/closet/deconstruct(disassembled = TRUE)
if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
new material_drop(loc, material_drop_amount)
qdel(src)
/obj/structure/closet/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
bust_open()
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
if(user in src)
return
if(opened)
if(istype(W, cutting_tool))
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
playsound(loc, cutting_sound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!opened || !WT.isOn())
return
playsound(loc, cutting_sound, 50, 1)
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
deconstruct(TRUE)
return 0
else // for example cardboard box is cut with wirecutters
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE)
return 0
if(user.drop_item()) // so we put in unlit welder too
W.forceMove(loc)
return 1
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
return
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
playsound(loc, 'sound/items/welder2.ogg', 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(opened || !WT.isOn())
return
playsound(loc, WT.usesound, 50, 1)
welded = !welded
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unweldeds"] \the [src].</span>",
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
update_icon()
else if(istype(W, /obj/item/wrench) && anchorable)
if(isinspace() && !anchored)
return
anchored = !anchored
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
else if(user.a_intent != INTENT_HARM && !(W.flags_1 & NOBLUDGEON_1))
if(W.GetID() || !toggle(user))
togglelock(user)
return 1
else
return ..()
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
if(!istype(O) || O.anchored || istype(O, /obj/screen))
return
if(!istype(user) || user.incapacitated() || user.lying)
return
if(!Adjacent(user) || !user.Adjacent(O))
return
if(user == O) //try to climb onto it
return ..()
if(!opened)
return
if(!isturf(O.loc))
return
var/actuallyismob = 0
if(isliving(O))
actuallyismob = 1
else if(!isitem(O))
return
var/turf/T = get_turf(src)
var/list/targets = list(O, src)
add_fingerprint(user)
user.visible_message("<span class='warning'>[user] [actuallyismob ? "tries to ":""]stuff [O] into [src].</span>", \
"<span class='warning'>You [actuallyismob ? "try to ":""]stuff [O] into [src].</span>", \
"<span class='italics'>You hear clanging.</span>")
if(actuallyismob)
if(do_after_mob(user, targets, 40))
user.visible_message("<span class='notice'>[user] stuffs [O] into [src].</span>", \
"<span class='notice'>You stuff [O] into [src].</span>", \
"<span class='italics'>You hear a loud metal bang.</span>")
var/mob/living/L = O
if(!issilicon(L))
L.Knockdown(40)
O.forceMove(T)
close()
else
O.forceMove(T)
return 1
/obj/structure/closet/relaymove(mob/user)
if(user.stat || !isturf(loc) || !isliving(user))
return
var/mob/living/L = user
if(!open())
if(L.last_special <= world.time)
container_resist(L)
if(world.time > lastbang+5)
lastbang = world.time
for(var/mob/M in get_hearers_in_view(src, null))
M.show_message("<FONT size=[max(0, 5 - get_dist(src, M))]>BANG, bang!</FONT>", 2)
/obj/structure/closet/attack_hand(mob/user)
..()
if(user.lying && get_dist(src, user) > 0)
return
if(!toggle(user))
togglelock(user)
return
/obj/structure/closet/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/closet/attack_robot(mob/user)
if(user.Adjacent(src))
return attack_hand(user)
// tk grab then use on self
/obj/structure/closet/attack_self_tk(mob/user)
return attack_hand(user)
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"
set name = "Toggle Open"
if(!usr.canmove || usr.stat || usr.restrained())
return
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
attack_hand(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
// Objects that try to exit a locker by stepping were doing so successfully,
// and due to an oversight in turf/Enter() were going through walls. That
// should be independently resolved, but this is also an interesting twist.
/obj/structure/closet/Exit(atom/movable/AM)
open()
if(AM.loc == src)
return 0
return 1
/obj/structure/closet/container_resist(mob/living/user)
if(opened)
return
if(ismovableatom(loc))
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
var/atom/movable/AM = loc
AM.relay_container_resist(user, src)
return
if(!welded && !locked)
open()
return
//okay, so the closet is either welded or locked... resist!!!
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You lean on the back of [src] and start pushing the door open.</span>")
visible_message("<span class='warning'>[src] begins to shake violently!</span>")
if(do_after(user,(breakout_time * 60 * 10), target = src)) //minutes * 60seconds * 10deciseconds
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
return
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
user.visible_message("<span class='danger'>[user] successfully broke out of [src]!</span>",
"<span class='notice'>You successfully break out of [src]!</span>")
bust_open()
else
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
/obj/structure/closet/proc/bust_open()
welded = FALSE //applies to all lockers
locked = FALSE //applies to critter crates and secure lockers only
broken = 1 //applies to secure lockers only
open()
/obj/structure/closet/AltClick(mob/user)
..()
if(!user.canUseTopic(src, be_close=TRUE))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(opened || !secure)
return
else
togglelock(user)
/obj/structure/closet/proc/togglelock(mob/living/user)
if(secure && !broken)
if(allowed(user))
if(iscarbon(user))
add_fingerprint(user)
locked = !locked
user.visible_message("<span class='notice'>[user] [locked ? null : "un"]locks [src].</span>",
"<span class='notice'>You [locked ? null : "un"]lock [src].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>Access Denied</span>")
else if(secure && broken)
to_chat(user, "<span class='warning'>\The [src] is broken!</span>")
/obj/structure/closet/emag_act(mob/user)
if(secure && !broken)
user.visible_message("<span class='warning'>Sparks fly from [src]!</span>",
"<span class='warning'>You scramble [src]'s lock, breaking it open!</span>",
"<span class='italics'>You hear a faint electrical spark.</span>")
playsound(src, "sparks", 50, 1)
broken = 1
locked = FALSE
update_icon()
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
/obj/structure/closet/emp_act(severity)
for(var/obj/O in src)
O.emp_act(severity)
if(secure && !broken)
if(prob(50 / severity))
locked = !locked
update_icon()
if(prob(20 / severity) && !opened)
if(!locked)
open()
else
req_access = list()
req_access += pick(get_all_accesses())
..()
/obj/structure/closet/contents_explosion(severity, target)
for(var/atom/A in contents)
A.ex_act(severity, target)
CHECK_TICK
/obj/structure/closet/singularity_act()
dump_contents()
..()
/obj/structure/closet/AllowDrop()
return TRUE
@@ -1,16 +0,0 @@
diff a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm (rejected hunks)
@@ -193,12 +193,12 @@
return open(user)
/obj/structure/closet/deconstruct(disassembled = TRUE)
- if(ispath(material_drop) && material_drop_amount && !(flags & NODECONSTRUCT))
+ if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
new material_drop(loc, material_drop_amount)
qdel(src)
/obj/structure/closet/obj_break(damage_flag)
- if(!broken && !(flags & NODECONSTRUCT))
+ if(!broken && !(flags_1 & NODECONSTRUCT_1))
bust_open()
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
@@ -183,6 +183,7 @@
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/clothing/suit/armor/vest/det_suit(src)
new /obj/item/storage/belt/holster/full(src)
new /obj/item/device/mass_spectrometer(src)
/obj/structure/closet/secure_closet/injection
name = "lethal injections"
@@ -1,19 +0,0 @@
diff a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm (rejected hunks)
@@ -50,7 +50,7 @@
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/displaycase/deconstruct(disassembled = TRUE)
- if(!(flags & NODECONSTRUCT))
+ if(!(flags_1 & NODECONSTRUCT_1))
dump()
if(!disassembled)
new /obj/item/shard( src.loc )
@@ -58,7 +58,7 @@
qdel(src)
/obj/structure/displaycase/obj_break(damage_flag)
- if(!broken && !(flags & NODECONSTRUCT))
+ if(!broken && !(flags_1 & NODECONSTRUCT_1))
density = FALSE
broken = 1
new /obj/item/shard( src.loc )
+2 -2
View File
@@ -137,8 +137,8 @@
new mineral(loc)
qdel(src)
/obj/structure/falsewall/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
return 0
/obj/structure/falsewall/get_dumping_location(obj/item/storage/source,mob/user)
return null
/obj/structure/falsewall/examine_status(mob/user) //So you can't detect falsewalls by examine.
return null
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm (rejected hunks)
@@ -91,7 +91,7 @@
new /obj/item/shard(loc)
/obj/structure/fireaxecabinet/deconstruct(disassembled = TRUE)
- if(!(flags & NODECONSTRUCT))
+ if(!(flags_1 & NODECONSTRUCT_1))
if(fireaxe && loc)
fireaxe.forceMove(loc)
fireaxe = null
-10
View File
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm (rejected hunks)
@@ -13,7 +13,7 @@
var/log_amount = 10
/obj/structure/flora/tree/attackby(obj/item/W, mob/user, params)
- if(!cut && log_amount && (!(NODECONSTRUCT in flags)))
+ if(!cut && log_amount && (!(flags_1 & NODECONSTRUCT_1)))
if(W.sharpness && W.force > 0)
if(W.hitsound)
playsound(get_turf(src), W.hitsound, 100, 0, 0)
+2 -2
View File
@@ -226,8 +226,8 @@
C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
return ..()
/obj/structure/grille/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
return 0
/obj/structure/grille/get_dumping_location(obj/item/storage/source,mob/user)
return null
/obj/structure/grille/broken // Pre-broken grilles for map placement
icon_state = "brokengrille"
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm (rejected hunks)
@@ -5,7 +5,7 @@
icon_state = "cart"
anchored = FALSE
density = TRUE
- container_type = OPENCONTAINER
+ container_type = OPENCONTAINER_1
//copypaste sorry
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
var/obj/item/storage/bag/trash/mybag = null
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/manned_turret.dm b/code/game/objects/structures/manned_turret.dm (rejected hunks)
@@ -177,7 +177,7 @@
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "offhand"
w_class = WEIGHT_CLASS_HUGE
- flags = ABSTRACT | NODROP | NOBLUDGEON | DROPDEL
+ flags_1 = ABSTRACT_1 | NODROP_1 | NOBLUDGEON_1 | DROPDEL_1
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/obj/machinery/manned_turret/turret
@@ -1,18 +0,0 @@
diff a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm (rejected hunks)
@@ -47,14 +47,14 @@
..()
/obj/structure/mirror/obj_break(damage_flag)
- if(!broken && !(flags & NODECONSTRUCT))
+ if(!broken && !(flags_1 & NODECONSTRUCT_1))
icon_state = "mirror_broke"
playsound(src, "shatter", 70, 1)
desc = "Oh no, seven years of bad luck!"
broken = 1
/obj/structure/mirror/deconstruct(disassembled = TRUE)
- if(!(flags & NODECONSTRUCT))
+ if(!(flags_1 & NODECONSTRUCT_1))
if(!disassembled)
new /obj/item/shard( src.loc )
qdel(src)
-11
View File
@@ -1,11 +0,0 @@
diff a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm (rejected hunks)
@@ -326,6 +326,6 @@
icon_state = "direction_bridge"
/obj/structure/sign/logo
- name = "station logo"
- desc = "A sign: SPACE STATION 13."
+ name = "nanotrasen logo"
+ desc = "The Nanotrasen corporate logo."
icon_state = "nanotrasen_sign1"
\ No newline at end of file
@@ -1,37 +0,0 @@
diff a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm (rejected hunks)
@@ -94,7 +94,7 @@
/obj/structure/table/attackby(obj/item/I, mob/user, params)
- if(!(flags & NODECONSTRUCT))
+ if(!(flags_1 & NODECONSTRUCT_1))
if(istype(I, /obj/item/screwdriver) && deconstruction_ready)
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
playsound(src.loc, I.usesound, 50, 1)
@@ -429,7 +429,7 @@
/obj/structure/rack/attackby(obj/item/W, mob/user, params)
- if (istype(W, /obj/item/wrench) && !(flags&NODECONSTRUCT))
+ if (istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
playsound(src.loc, W.usesound, 50, 1)
deconstruct(TRUE)
return
@@ -466,7 +466,7 @@
*/
/obj/structure/rack/deconstruct(disassembled = TRUE)
- if(!(flags&NODECONSTRUCT))
+ if(!(flags_1&NODECONSTRUCT_1))
density = FALSE
var/obj/item/rack_parts/newparts = new(loc)
transfer_fingerprints_to(newparts)
@@ -482,7 +482,7 @@
desc = "Parts of a rack."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "rack_parts"
- flags = CONDUCT
+ flags_1 = CONDUCT_1
materials = list(MAT_METAL=2000)
var/building = FALSE
@@ -535,6 +535,7 @@
name = "puddle"
desc = "A puddle used for washing one's hands and face."
icon_state = "puddle"
resistance_flags = UNACIDABLE
/obj/structure/sink/puddle/attack_hand(mob/M)
icon_state = "puddle-splash"
@@ -546,6 +547,10 @@
. = ..()
icon_state = "puddle"
/obj/structure/sink/puddle/deconstruct(disassembled = TRUE)
qdel(src)
//Shower Curtains//
//Defines used are pre-existing in layers.dm//
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm (rejected hunks)
@@ -462,7 +462,7 @@
if(istype(O, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RG = O
- if(RG.container_type & OPENCONTAINER)
+ if(RG.container_type & OPENCONTAINER_1)
if(!RG.reagents.holder_full())
RG.reagents.add_reagent("[dispensedreagent]", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
to_chat(user, "<span class='notice'>You fill [RG] from [src].</span>")
@@ -1,10 +0,0 @@
diff a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm (rejected hunks)
@@ -188,7 +188,7 @@
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
- if(!(flags&NODECONSTRUCT))
+ if(!(flags_1&NODECONSTRUCT_1))
if(istype(I, /obj/item/screwdriver))
playsound(src, I.usesound, 75, 1)
if(reinf)