This commit is contained in:
RavingManiac
2015-02-15 22:37:55 +08:00
74 changed files with 2848 additions and 2022 deletions

1
.gitignore vendored
View File

@@ -4,4 +4,5 @@
*.rsc
*.dmb
*.lk
*.backup
data/

View File

@@ -552,6 +552,7 @@
#include "code\game\objects\items\devices\pipe_painter.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\scanners.dm"
#include "code\game\objects\items\devices\spy_bug.dm"
#include "code\game\objects\items\devices\suit_cooling.dm"
#include "code\game\objects\items\devices\taperecorder.dm"
#include "code\game\objects\items\devices\traitordevices.dm"

View File

@@ -1,6 +1,11 @@
// BEGIN_INTERNALS
/*
MAP_ICON_TYPE: 0
WINDOW: code\ATMOSPHERICS\components\binary_devices\pump.dm;code\ATMOSPHERICS\components\binary_devices\circulator.dm;code\modules\power\generator.dm;code\ATMOSPHERICS\components\unary\heat_exchanger.dm;code\ATMOSPHERICS\components\unary\vent_pump.dm;maps\exodus-1.dmm
LAST_COMPILE_VERSION: 501.1217
DIR: code code\ATMOSPHERICS code\ATMOSPHERICS\components code\ATMOSPHERICS\components\binary_devices code\ATMOSPHERICS\components\unary code\game code\game\machinery\doors code\game\objects code\game\objects\items code\game\objects\items\weapons code\modules code\modules\power maps
FILE: maps\exodus-1.dmm
LAST_COMPILE_TIME: 1424008581
AUTO_FILE_DIR: OFF
*/
// END_INTERNALS

View File

@@ -9,6 +9,13 @@
src:Topic(href, href_list)
return null
/proc/is_on_same_plane_or_station(var/z1, var/z2)
if(z1 == z2)
return 1
if((z1 in config.station_levels) && (z2 in config.station_levels))
return 1
return 0
/proc/get_area(O)
var/turf/loc = get_turf(O)
if(!loc)
@@ -43,7 +50,7 @@
return level in config.station_levels
/proc/isNotStationLevel(var/level)
return !isStationLevel()
return !isStationLevel(level)
/proc/isPlayerLevel(var/level)
return level in config.player_levels

View File

@@ -288,6 +288,7 @@ datum/controller/game_controller/proc/process_machines_process()
last_thing_processed = Machine.type
if(Machine.process() != PROCESS_KILL)
if(Machine)
Machine.power_change()
if(Machine.use_power)
Machine.auto_use_power()
continue

View File

@@ -34,14 +34,17 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
/datum/wires/airlock/GetInteractWindow()
var/obj/machinery/door/airlock/A = holder
var/haspower = A.arePowerSystemsOn() //If there's no power, then no lights will be on.
. += ..()
. += text("<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
(A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"),
((A.hasPower()) ? "The test light is on." : "The test light is off!"),
((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
(A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
(A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
(A.aiDisabledIdScanner==0 ? "The IDScan light is on." : "The IDScan light is off."))
. += text("<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]<br>\n[]",
(A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
((A.lights && haspower) ? "The door bolt lights are on." : "The door bolt lights are off!"),
((haspower) ? "The test light is on." : "The test light is off!"),
((A.aiControlDisabled==0 && !A.emagged && haspower)? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
((A.safe==0 && haspower)? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
((A.normalspeed==0 && haspower)? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
((A.aiDisabledIdScanner==0 && haspower)? "The IDScan light is on." : "The IDScan light is off."))
/datum/wires/airlock/UpdateCut(var/index, var/mended)
@@ -127,7 +130,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
switch(index)
if(AIRLOCK_WIRE_IDSCAN)
//Sending a pulse through flashes the red light on the door (if the door has power).
if(A.hasPower() && A.density)
if(A.arePowerSystemsOn() && A.density)
A.do_animate("deny")
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
//Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter).
@@ -139,7 +142,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.locked = 1
A.audible_message("You hear a click from the bottom of the door.", null, 1)
else
if(A.hasPower()) //only can raise bolts if power's on
if(A.arePowerSystemsOn()) //only can raise bolts if power's on
A.locked = 0
A.audible_message("You hear a click from the bottom of the door.", null, 1)
A.update_icon()

View File

@@ -11,7 +11,7 @@ var/const/AALARM_WIRE_AALARM = 16
/datum/wires/alarm/CanUse(var/mob/living/L)
var/obj/machinery/alarm/A = holder
if(A.wiresexposed)
if(A.wiresexposed && A.buildstage == 2)
return 1
return 0

View File

@@ -1,3 +1,5 @@
#define CAT_HIDDEN 2 // Also in code/game/machinery/vending.dm
/datum/wires/vending
holder_type = /obj/machinery/vending
wire_count = 4
@@ -17,17 +19,12 @@ var/const/VENDING_WIRE_IDSCAN = 8
return 1
return 0
/datum/wires/vending/Interact(var/mob/living/user)
if(CanUse(user))
var/obj/machinery/vending/V = holder
V.attack_hand(user)
/datum/wires/vending/GetInteractWindow()
var/obj/machinery/vending/V = holder
. += ..()
. += "<BR>The orange light is [V.seconds_electrified ? "off" : "on"].<BR>"
. += "The red light is [V.shoot_inventory ? "off" : "blinking"].<BR>"
. += "The green light is [V.extended_inventory ? "on" : "off"].<BR>"
. += "The green light is [(V.categories & CAT_HIDDEN) ? "on" : "off"].<BR>"
. += "The [V.scan_id ? "purple" : "yellow"] light is on.<BR>"
/datum/wires/vending/UpdatePulsed(var/index)
@@ -36,7 +33,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !V.shoot_inventory
if(VENDING_WIRE_CONTRABAND)
V.extended_inventory = !V.extended_inventory
V.categories ^= CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
V.seconds_electrified = 30
if(VENDING_WIRE_IDSCAN)
@@ -48,7 +45,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !mended
if(VENDING_WIRE_CONTRABAND)
V.extended_inventory = 0
V.categories &= ~CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
if(mended)
V.seconds_electrified = 0

View File

@@ -84,7 +84,6 @@
throw_speed = 4
throw_range = 5
/obj/item/weapon/cane
name = "cane"
desc = "A cane used by a true gentlemen. Or a clown."
@@ -98,6 +97,46 @@
matter = list("metal" = 50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
/obj/item/weapon/cane/concealed
var/concealed_blade
/obj/item/weapon/cane/concealed/New()
..()
concealed_blade = new/obj/item/weapon/butterfly/switchblade(src)
/obj/item/weapon/cane/concealed/attack_self(mob/user)
if(concealed_blade)
user.visible_message("<span class='warning'>[user] has unsheathed \a [concealed_blade] from \his [src]!</span>", "You unsheathe \the [concealed_blade] from \the [src].")
// Calling drop/put in hands to properly call item drop/pickup procs
playsound(user.loc, 'sound/weapons/flipblade.ogg', 50, 1)
user.drop_from_inventory(src)
user.put_in_hands(concealed_blade)
user.put_in_hands(src)
concealed_blade = null
update_icon()
else
..()
/obj/item/weapon/cane/concealed/attackby(var/obj/item/weapon/butterfly/W, var/mob/user)
if(!src.concealed_blade && istype(W))
user.visible_message("<span class='warning'>[user] has sheathed \a [W] into \his [src]!</span>", "You sheathe \the [W] into \the [src].")
user.drop_from_inventory(W)
W.loc = src
src.concealed_blade = W
update_icon()
else
..()
/obj/item/weapon/cane/concealed/update_icon()
if(concealed_blade)
name = initial(name)
icon_state = initial(icon_state)
item_state = initial(icon_state)
else
name = "cane shaft"
icon_state = "nullrod"
item_state = "foldcane"
/obj/item/weapon/disk
name = "disk"
icon = 'icons/obj/items.dmi'

View File

@@ -679,11 +679,16 @@ var/list/datum/dna/hivemind_bank = list()
//////////
/mob/proc/sting_can_reach(mob/M as mob, sting_range = 1)
if(M.loc == src.loc) return 1 //target and source are in the same thing
if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something.
if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, sting_range)) //If a path exists, good!
return 1
if(M.loc == src.loc)
return 1 //target and source are in the same thing
if(!isturf(src.loc) || !isturf(M.loc))
src << "<span class='warning'>We cannot reach \the [M] with a sting!</span>"
return 0 //One is inside, the other is outside something.
// Maximum queued turfs set to 25; I don't *think* anything raises sting_range above 2, but if it does the 25 may need raising
if(!AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, max_nodes=25, max_node_depth=sting_range)) //If we can't find a path, fail
src << "<span class='warning'>We cannot find a path to sting \the [M] by!</span>"
return 0
return 1
//Handles the general sting code to reduce on copypasta (seeming as somebody decided to make SO MANY dumb abilities)
/mob/proc/changeling_sting(var/required_chems=0, var/verb_path)

View File

@@ -33,47 +33,58 @@
var/uplink_uses = 10
var/list/datum/uplink_item/uplink_items = list(
"Highly Visible and Dangerous Weapons" = list(
new/datum/uplink_item(/obj/item/weapon/gun/projectile, 6, "Revolver", "RE"),
new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "Ammo-9mm", "R9"),
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, "Ammo-357", "RA"),
new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM"),
new/datum/uplink_item(/obj/item/weapon/melee/energy/sword, 4, "Energy Sword", "ES"),
new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/g9mm, 5, "Silenced 9mm", "S9"),
new/datum/uplink_item(/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser, 6, "Exosuit Rigged Laser", "RL"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU"),
new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM")
new/datum/uplink_item(/obj/item/weapon/gun/projectile, 6, "Revolver", "RE"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU")
),
"Stealthy and Inconspicuous Weapons" = list(
new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
new/datum/uplink_item(/obj/item/weapon/soap/syndie, 1, "Subversive Soap", "SP"),
new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC")
new/datum/uplink_item(/obj/item/weapon/cane/concealed, 2, "Concealed Cane Sword", "CC"),
new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC"),
new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH")
),
"Stealth and Camouflage Items" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
new/datum/uplink_item(/obj/item/weapon/card/id/syndicate, 2, "Agent ID card", "AC"),
new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "SK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"),
new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"),
new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP")
new/datum/uplink_item(/obj/item/weapon/disk/file/cameras/syndicate, 6, "Camera Network Access - Floppy", "SF")
),
"Devices and Tools" = list(
new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"),
new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/clerical, 3, "Morphic Clerical Kit", "CK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/space, 3, "Space Suit", "SS"),
new/datum/uplink_item(/obj/item/clothing/glasses/thermal/syndi, 3, "Thermal Imaging Glasses", "TM"),
new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
new/datum/uplink_item(/obj/item/weapon/aiModule/syndicate, 7, "Hacked AI Upload Module", "AI"),
new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
new/datum/uplink_item(/obj/item/device/powersink, 5, "Powersink (DANGER!)", "PS",),
new/datum/uplink_item(/obj/item/device/radio/beacon/syndicate, 7, "Singularity Beacon (DANGER!)", "SB"),
new/datum/uplink_item(/obj/item/weapon/circuitboard/teleporter, 20, "Teleporter Circuit Board", "TP")
),
"Implants" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_freedom, 3, "Freedom Implant", "FI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_explosive, 6, "Explosive Implant (DANGER!)", "EI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI")
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI")
),
"Health Aids" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/donkpockets, 1, "Box of Donk-Pockets", "DP"),
new/datum/uplink_item(/obj/item/weapon/storage/firstaid/combat, 5, "Combat medical kit", "CM")
),
"(Pointless) Badassery" = list(
new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS")
new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS"),
new/datum/uplink_item(/obj/item/toy/nanotrasenballoon, 10, "For showing that you love NT SOO much (Useless Balloon)", "NT")
)
)

View File

@@ -921,8 +921,13 @@ table tr:first-child th:first-child { border: none;}
update_icon()
return
if (wiresexposed && ((istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters))))
return attack_hand(user)
if (wiresexposed && istype(W, /obj/item/weapon/wirecutters))
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You have cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
buildstage = 1
update_icon()
return
if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))

View File

@@ -5,7 +5,7 @@
// Allows remote operation of electrical systems on station (SMESs and Breaker Boxes)
/obj/machinery/computer/rcon
name = "\improper RCON remote control console"
name = "\improper RCON console"
desc = "Console used to remotely control machinery on the station."
icon = 'icons/obj/computer.dmi'
icon_state = "ai-fixer"
@@ -62,7 +62,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "rcon.tmpl", "RCON Control Console", 600, 400)
ui = new(user, src, ui_key, "rcon.tmpl", "RCON Console", 600, 400)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)

View File

@@ -68,29 +68,32 @@
for(var/obj/item/clothing/under/C in src.tracked)
var/turf/pos = get_turf(C)
if((C) && (C.has_sensor) && (pos) && (pos.z == src.z) && C.sensor_mode)
if((C) && (C.has_sensor) && (pos) && (pos.z == src.z) && (C.sensor_mode != SUIT_SENSOR_OFF))
if(istype(C.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C.loc
if(H.w_uniform != C)
continue
var/list/crewmemberData = list()
var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1)
crewmemberData["sensor_type"] = C.sensor_mode
crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
if(C.sensor_mode >= SUIT_SENSOR_BINARY)
crewmemberData["dead"] = H.stat > 1
if(C.sensor_mode >= SUIT_SENSOR_VITAL)
crewmemberData["oxy"] = round(H.getOxyLoss(), 1)
crewmemberData["tox"] = round(H.getToxLoss(), 1)
crewmemberData["fire"] = round(H.getFireLoss(), 1)
crewmemberData["brute"] = round(H.getBruteLoss(), 1)
crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
if(C.sensor_mode >= SUIT_SENSOR_TRACKING)
var/area/A = get_area(H)
crewmemberData["area"] = sanitize(A.name)
crewmemberData["x"] = pos.x

View File

@@ -123,6 +123,12 @@
desc = "Monitors the prison."
networks = list("Prison")
/datum/file/camnet_key/syndicate
name = "Camera Network Key"
title = "%!#BUFFER OVERFLOW"
desc = "Connects to security cameras."
networks = list("SS13")
hidden_file = 1
/*
@@ -174,7 +180,7 @@
/datum/file/program/security
name = "camera monitor"
desc = "Connets to the Nanotrasen Camera Network"
desc = "Connects to the Nanotrasen Camera Network"
image = 'icons/ntos/camera.png'
active_state = "camera-static"
@@ -268,15 +274,19 @@
reset_current()
usr.reset_view(null)
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
camera_list = null
update_icon()
computer.update_icon()
select_key(key)
if(key)
interact()
else
usr << "The screen turns to static."
return
/datum/file/program/security/proc/select_key(var/selected_key)
key = selected_key
camera_list = null
update_icon()
computer.update_icon()
/datum/file/program/security/proc/set_current(var/obj/machinery/camera/C)
if(current == C)
return
@@ -300,3 +310,35 @@
// Atlantis: Required for camnetkeys to work.
/datum/file/program/security/hidden
hidden_file = 1
/*
Camera monitoring program
Works much as the parent program, except:
* It requires a camera to be found using the proximity network card.
* It begins with all cam-access.
*/
/datum/file/program/security/syndicate
name = "camer# moni!%r"
desc = "Cons the Nanotrash Camera Network"
var/special_key = new/datum/file/camnet_key/syndicate
var/camera_conn = null
interact()
if(!interactable())
return
if(!computer.net)
computer.Crash(MISSING_PERIPHERAL)
return
camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn)
if(!camera_conn)
computer.Crash(NETWORK_FAILURE)
return
// On interact, override camera key selection
select_key(special_key)
..()

View File

@@ -169,6 +169,9 @@
if(typekey == null)
typekey = /obj/machinery
var/list/machines = list()
for(var/obj/O in T)
if(istype(O,typekey))
machines += O
for(var/d in cardinal)
var/turf/T2 = get_step(T,d)
for(var/obj/O in T2)

View File

@@ -28,6 +28,13 @@
icon_state = "datadisk_arcade"
spawn_files = list(/datum/file/program/security)
/obj/item/weapon/disk/file/cameras/syndicate
name = "Camera Viewer"
desc = "A program install disk. A crude skull has been drawn on it and there is a list of items:\nFloppy Drive\nCamera Card\nNetwork Card: Adjacent\nPosition laptop nearby camera, enjoy."
icon = 'icons/obj/stock_parts.dmi'
icon_state = "datadisk_arcade"
spawn_files = list(/datum/file/program/security/syndicate)
/obj/item/weapon/disk/file/card
name = "ID Card Modifier"
desc = "A program install disk."

View File

@@ -330,7 +330,7 @@ About the new airlock wires panel:
return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerLoss()));
/obj/machinery/door/airlock/proc/arePowerSystemsOn()
if (stat & NOPOWER)
if (stat & (NOPOWER|BROKEN))
return 0
return (src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0)
@@ -451,7 +451,7 @@ About the new airlock wires panel:
if(density)
flick("door_spark", src)
if("deny")
if(density && !(stat & (BROKEN|NOPOWER)))
if(density && src.arePowerSystemsOn())
flick("door_deny", src)
return
@@ -900,12 +900,7 @@ About the new airlock wires panel:
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
else if(!repairing && istype(C, /obj/item/weapon/crowbar))
var/beingcrowbarred = null
if(istype(C, /obj/item/weapon/crowbar) )
beingcrowbarred = 1 //derp, Agouri
else
beingcrowbarred = 0
if( beingcrowbarred && src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
if(src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
if(do_after(user,40))
@@ -936,7 +931,7 @@ About the new airlock wires panel:
del(src)
return
else if(arePowerSystemsOn() && !(stat & BROKEN))
else if(arePowerSystemsOn())
user << "\blue The airlock's motors resist your efforts to force it."
else if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
@@ -946,22 +941,22 @@ About the new airlock wires panel:
else
spawn(0) close(1)
else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && (!arePowerSystemsOn() || (stat & BROKEN)))
else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && !arePowerSystemsOn())
if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
else if( !welded && !operating )
if(density)
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
if(F.wielded)
spawn(0) open(1)
else
user << "\red You need to be wielding the Fire axe to do that."
user << "\red You need to be wielding \the [C] to do that."
else
var/obj/item/weapon/twohanded/fireaxe/F = C
if(F:wielded)
if(F.wielded)
spawn(0) close(1)
else
user << "\red You need to be wielding the Fire axe to do that."
user << "\red You need to be wielding \the [C] to do that."
else
..()
@@ -1007,7 +1002,9 @@ About the new airlock wires panel:
if(operating || welded || locked)
return
if(!forced)
if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS) )
//despite the name, this wire is for general door control.
//Bolts are already covered by the check for locked, above
if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_OPEN_DOOR) )
return
if(safe)
for(var/turf/turf in locs)
@@ -1131,9 +1128,6 @@ About the new airlock wires panel:
..()
update_icon()
/obj/machinery/door/airlock/proc/hasPower()
return ((src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) && !(stat & (NOPOWER|BROKEN)))
/obj/machinery/door/airlock/proc/prison_open()
src.unlock()
src.open()

View File

@@ -8,11 +8,6 @@ obj/machinery/door/airlock
var/datum/radio_frequency/radio_connection
var/cur_command = null //the command the door is currently attempting to complete
obj/machinery/door/airlock/proc/can_radio()
if(!arePowerSystemsOn())
return 0
return 1
obj/machinery/door/airlock/process()
..()
if (arePowerSystemsOn())
@@ -21,8 +16,6 @@ obj/machinery/door/airlock/process()
obj/machinery/door/airlock/receive_signal(datum/signal/signal)
if (!arePowerSystemsOn()) return //no power
if (!can_radio()) return //no radio
if(!signal || signal.encryption) return
if(id_tag != signal.data["tag"] || !signal.data["command"]) return

View File

@@ -70,7 +70,7 @@ datum/track/New(var/title_name, var/audio)
return
if(stat & (NOPOWER|BROKEN))
usr << "\the [src] doesn't appear to function."
usr << "\The [src] doesn't appear to function."
return
if(href_list["change_track"])
@@ -109,7 +109,7 @@ datum/track/New(var/title_name, var/audio)
/obj/machinery/media/jukebox/interact(mob/user)
if(stat & (NOPOWER|BROKEN))
usr << "\the [src] doesn't appear to function."
usr << "\The [src] doesn't appear to function."
return
ui_interact(user)

View File

@@ -1,17 +1,38 @@
#define CAT_NORMAL 0
#define CAT_HIDDEN 1
#define CAT_COIN 2
#define CAT_NORMAL 1
#define CAT_HIDDEN 2 // also used in corresponding wires/vending.dm
#define CAT_COIN 4
/**
* Datum used to hold information about a product in a vending machine
*/
/datum/data/vending_product
var/product_name = "generic"
var/product_name = "generic" // Display name for the product
var/product_path = null
var/amount = 0
var/price = 0
var/display_color = "blue"
var/category = CAT_NORMAL
var/amount = 0 // Amount held in the vending machine
var/price = 0 // Price to buy one
var/display_color = null // Display color for vending machine listing
var/category = CAT_NORMAL // CAT_HIDDEN for contraband, CAT_COIN for premium
/datum/data/vending_product/New(var/path, var/name = null, var/amount = 1, var/price = 0, var/color = null, var/category = CAT_NORMAL)
..()
src.product_path = path
if(!name)
var/atom/tmp = new path
src.product_name = initial(tmp.name)
del(tmp)
else
src.product_name = name
src.amount = amount
src.price = price
src.display_color = color
src.category = category
/**
* A vending machine
*/
/obj/machinery/vending
name = "Vendomat"
desc = "A generic vending machine."
@@ -21,68 +42,107 @@
anchored = 1
density = 1
var/icon_vend //Icon_state when vending
var/icon_deny //Icon_state when denying access
// Power
use_power = 1
idle_power_usage = 10
var/vend_power_usage = 150 //actuators and stuff
// Vending-related
var/active = 1 //No sales pitches if off!
var/vend_ready = 1 //Are we ready to vend?? Is it time??
var/vend_delay = 10 //How long does it take to vend?
var/datum/data/vending_product/currently_vending = null // A /datum/data/vending_product instance of what we're paying for right now.
var/categories = CAT_NORMAL // Bitmask of cats we're currently showing
var/datum/data/vending_product/currently_vending = null // What we're requesting payment for right now
var/status_message = "" // Status screen messages like "insufficient funds", displayed in NanoUI
var/status_error = 0 // Set to 1 if status_message is an error
// To be filled out at compile time
/*
Variables used to initialize the product list
These are used for initialization only, and so are optional if
product_records is specified
*/
var/list/products = list() // For each, use the following pattern:
var/list/contraband = list() // list(/type/path = amount,/type/path2 = amount2)
var/list/premium = list() // No specified amount = only one in stock
var/list/prices = list() // Prices for each item, list(/type/path = price), items not in the list don't have a price.
var/product_slogans = "" //String of slogans separated by semicolons, optional
var/product_ads = "" //String of small ad messages in the vending screen - random chance
// List of vending_product items available.
var/list/product_records = list()
var/list/hidden_records = list()
var/list/coin_records = list()
// Variables used to initialize advertising
var/product_slogans = "" //String of slogans spoken out loud, separated by semicolons
var/product_ads = "" //String of small ad messages in the vending screen
var/list/ads_list = list()
// Stuff relating vocalizations
var/list/slogan_list = list()
var/list/small_ads = list() // small ad messages in the vending screen - random chance of popping up whenever you open it
var/shut_up = 1 //Stop spouting those godawful pitches!
var/vend_reply //Thank you for shopping!
var/last_reply = 0
var/last_slogan = 0 //When did we last pitch?
var/slogan_delay = 6000 //How long until we can pitch again?
var/icon_vend //Icon_state when vending!
var/icon_deny //Icon_state when vending!
//var/emagged = 0 //Ignores if somebody doesn't have card access to that machine.
// Things that can go wrong
emagged = 0 //Ignores if somebody doesn't have card access to that machine.
var/seconds_electrified = 0 //Shock customers like an airlock.
var/shoot_inventory = 0 //Fire items at customers! We're broken!
var/shut_up = 1 //Stop spouting those godawful pitches!
var/extended_inventory = 0 //can we access the hidden inventory?
var/scan_id = 1
var/obj/item/weapon/coin/coin
var/datum/wires/vending/wires = null
var/check_accounts = 0 // 1 = requires PIN and checks accounts. 0 = You slide an ID, it vends, SPACE COMMUNISM!
var/obj/item/weapon/spacecash/ewallet/ewallet
/obj/machinery/vending/New()
..()
wires = new(src)
spawn(4)
src.slogan_list = text2list(src.product_slogans, ";")
if(src.product_slogans)
src.slogan_list += text2list(src.product_slogans, ";")
// So not all machines speak at the exact same time.
// The first time this machine says something will be at slogantime + this random value,
// so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated.
src.last_slogan = world.time + rand(0, slogan_delay)
src.build_inventory(products)
//Add hidden inventory
src.build_inventory(contraband, 1)
src.build_inventory(premium, 0, 1)
if(src.product_ads)
src.ads_list += text2list(src.product_ads, ";")
src.build_inventory()
power_change()
return
return
/**
* Build src.produdct_records from the products lists
*
* src.products, src.contraband, src.premium, and src.prices allow specifying
* products that the vending machine is to carry without manually populating
* src.product_records.
*/
/obj/machinery/vending/proc/build_inventory()
var/list/all_products = list(
list(src.products, CAT_NORMAL),
list(src.contraband, CAT_HIDDEN),
list(src.premium, CAT_COIN))
for(var/current_list in all_products)
var/category = current_list[2]
for(var/entry in current_list[1])
var/datum/data/vending_product/product = new/datum/data/vending_product(entry)
product.price = (entry in src.prices) ? src.prices[entry] : 0
product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1
product.category = category
src.product_records.Add(product)
/obj/machinery/vending/Del()
del(wires) // qdel
wires = null
@@ -118,37 +178,30 @@
return
/obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0)
for(var/typepath in productlist)
var/amount = productlist[typepath]
var/price = prices[typepath]
if(isnull(amount)) amount = 1
var/datum/data/vending_product/R = new /datum/data/vending_product()
R.product_path = typepath
R.amount = amount
R.price = price
R.display_color = pick("red","blue","green")
if(hidden)
R.category=CAT_HIDDEN
hidden_records += R
else if(req_coin)
R.category=CAT_COIN
coin_records += R
else
R.category=CAT_NORMAL
product_records += R
var/atom/temp = typepath
R.product_name = initial(temp.name)
// world << "Added: [R.product_name]] - [R.amount] - [R.product_path]"
return
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (currently_vending && vendor_account && !vendor_account.suspended)
var/paid = 0
var/handled = 0
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
paid = pay_with_card(C)
handled = 1
else if (istype(W, /obj/item/weapon/spacecash/ewallet))
var/obj/item/weapon/spacecash/ewallet/C = W
paid = pay_with_ewallet(C)
handled = 1
else if (istype(W, /obj/item/weapon/spacecash))
var/obj/item/weapon/spacecash/C = W
paid = pay_with_cash(C, user)
handled = 1
if(paid)
src.vend(currently_vending, usr)
return
else if(handled)
nanomanager.update_uis(src)
return // don't smack that machine with your 2 thalers
if (istype(W, /obj/item/weapon/card/emag))
src.emagged = 1
user << "You short out the product lock on [src]"
@@ -159,7 +212,8 @@
src.overlays.Cut()
if(src.panel_open)
src.overlays += image(src.icon, "[initial(icon_state)]-panel")
src.updateUsrDialog()
nanomanager.update_uis(src) // Speaker switch is on the main UI, not wires UI
return
else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters))
if(src.panel_open)
@@ -169,19 +223,11 @@
user.drop_item()
W.loc = src
coin = W
categories |= CAT_COIN
user << "\blue You insert the [W] into the [src]"
nanomanager.update_uis(src)
return
else if(istype(W, /obj/item/weapon/card) && currently_vending)
var/obj/item/weapon/card/I = W
scan_card(I)
else if (istype(W, /obj/item/weapon/spacecash/ewallet))
user.drop_item()
W.loc = src
ewallet = W
user << "\blue You insert the [W] into the [src]"
else if(istype(W, /obj/item/weapon/wrench))
if(do_after(user, 20))
if(!src) return
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
@@ -204,162 +250,205 @@
else
..()
/obj/machinery/vending/proc/scan_card(var/obj/item/weapon/card/I)
if(!currently_vending) return
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
/**
* Receive payment with cashmoney.
*
* usr is the mob who gets the change.
*/
/obj/machinery/vending/proc/pay_with_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user)
if(currently_vending.price > cashmoney.worth)
// This is not a status display message, since it's something the character
// themselves is meant to see BEFORE putting the money in
usr << "\icon[cashmoney] <span class='warning'>That is not enough money.</span>"
return 0
if(istype(cashmoney, /obj/item/weapon/spacecash/bundle))
// Bundles can just have money subtracted, and will work
visible_message("<span class='info'>[usr] inserts some cash into [src].</span>")
var/obj/item/weapon/spacecash/bundle/cashmoney_bundle = cashmoney
cashmoney_bundle.worth -= currently_vending.price
if(cashmoney_bundle.worth <= 0)
usr.drop_from_inventory(cashmoney_bundle)
del(cashmoney_bundle)
else
cashmoney_bundle.update_icon()
else
// Bills (banknotes) cannot really have worth different than face value,
// so we have to eat the bill and spit out change in a bundle
// This is really dirty, but there's no superclass for all bills, so we
// just assume that all spacecash that's not something else is a bill
visible_message("<span class='info'>[usr] inserts a bill into [src].</span>")
var/left = cashmoney.worth - currently_vending.price
usr.drop_from_inventory(cashmoney)
del(cashmoney)
if(left)
spawn_money(left, src.loc, user)
// Vending machines have no idea who paid with cash
credit_purchase("(cash)")
return 1
/**
* Scan a chargecard and deduct payment from it.
*
* Takes payment for whatever is the currently_vending item. Returns 1 if
* successful, 0 if failed.
*/
/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/weapon/spacecash/ewallet/wallet)
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
var/datum/money_account/CH = get_account(C.associated_account_number)
if (CH) // Only proceed if card contains proper account number.
if(!CH.suspended)
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account)
if(currently_vending.price > wallet.worth)
src.status_message = "Insufficient funds on chargecard."
src.status_error = 1
return 0
else
wallet.worth -= currently_vending.price
credit_purchase("[wallet.owner_name] (chargecard)")
return 1
/**
* Scan a card and attempt to transfer payment from associated account.
*
* Takes payment for whatever is the currently_vending item. Returns 1 if
* successful, 0 if failed
*/
/obj/machinery/vending/proc/pay_with_card(var/obj/item/weapon/card/id/I)
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
var/datum/money_account/customer_account = get_account(I.associated_account_number)
if (!customer_account)
src.status_message = "Error: Unable to access account. Please contact technical support if problem persists."
src.status_error = 1
return 0
if(customer_account.suspended)
src.status_message = "Unable to access account: account suspended."
src.status_error = 1
return 0
// Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is
// empty at high security levels
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
transfer_and_vend(D)
else
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
else
//Just Vend it.
transfer_and_vend(CH)
else
usr << "\icon[src]<span class='warning'>Connected account has been suspended.</span>"
else
usr << "\icon[src]<span class='warning'>Error: Unable to access your account. Please contact technical support if problem persists.</span>"
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
/obj/machinery/vending/proc/transfer_and_vend(var/datum/money_account/acc)
if(acc)
var/transaction_amount = currently_vending.price
if(transaction_amount <= acc.money)
if(!customer_account)
src.status_message = "Unable to access account: incorrect credentials."
src.status_error = 1
return 0
//transfer the money
acc.money -= transaction_amount
vendor_account.money += transaction_amount
if(currently_vending.price > customer_account.money)
src.status_message = "Insufficient funds in account."
src.status_error = 1
return 0
else
// Okay to move the money at this point
//create entries in the two account transaction logs
// debit money from the purchaser's account
customer_account.money -= currently_vending.price
// create entry in the purchaser's account log
var/datum/transaction/T = new()
T.target_name = "[vendor_account.owner_name] (via [src.name])"
T.purpose = "Purchase of [currently_vending.product_name]"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
if(currently_vending.price > 0)
T.amount = "([currently_vending.price])"
else
T.amount = "[transaction_amount]"
T.amount = "[currently_vending.price]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
acc.transaction_log.Add(T)
//
T = new()
T.target_name = acc.owner_name
customer_account.transaction_log.Add(T)
// Give the vendor the money. We use the account owner name, which means
// that purchases made with stolen/borrowed card will look like the card
// owner made them
credit_purchase(customer_account.owner_name)
return 1
/**
* Add money for current purchase to the vendor account.
*
* Called after the money has already been taken from the customer.
*/
/obj/machinery/vending/proc/credit_purchase(var/target as text)
vendor_account.money += currently_vending.price
var/datum/transaction/T = new()
T.target_name = target
T.purpose = "Purchase of [currently_vending.product_name]"
T.amount = "[transaction_amount]"
T.amount = "[currently_vending.price]"
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
// Vend the item
src.vend(src.currently_vending, usr)
currently_vending = null
else
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
else
usr << "\icon[src]<span class='warning'>Error: Unable to access your account. Please contact technical support if problem persists.</span>"
/obj/machinery/vending/attack_ai(mob/user as mob)
return attack_hand(user)
/obj/machinery/vending/proc/GetProductIndex(var/datum/data/vending_product/P)
var/list/plist
switch(P.category)
if(CAT_NORMAL)
plist=product_records
if(CAT_HIDDEN)
plist=hidden_records
if(CAT_COIN)
plist=coin_records
else
warning("UNKNOWN CATEGORY [P.category] IN TYPE [P.product_path] INSIDE [type]!")
return plist.Find(P)
/obj/machinery/vending/proc/GetProductByID(var/pid, var/category)
switch(category)
if(CAT_NORMAL)
return product_records[pid]
if(CAT_HIDDEN)
return hidden_records[pid]
if(CAT_COIN)
return coin_records[pid]
else
warning("UNKNOWN PRODUCT: PID: [pid], CAT: [category] INSIDE [type]!")
return null
/obj/machinery/vending/attack_hand(mob/user as mob)
if(stat & (BROKEN|NOPOWER))
return
user.set_machine(src)
if(src.seconds_electrified != 0)
if(src.shock(user, 100))
return
var/vendorname = (src.name) //import the machine's name
wires.Interact(user)
ui_interact(user)
if(src.currently_vending)
var/dat = "<TT><center><b>[vendorname]</b></center><hr /><br>" //display the name, and added a horizontal rule
dat += "<b>You have selected [currently_vending.product_name].<br>Please swipe your ID to pay for the article.</b><br>"
dat += "<a href='byond://?src=\ref[src];cancel_buying=1'>Cancel</a>"
user << browse(dat, "window=vending")
onclose(user, "")
return
/**
* Display the NanoUI window for the vending machine.
*
* See NanoUI documentation for details.
*/
/obj/machinery/vending/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
var/dat = "<TT><center><b>[vendorname]</b></center><hr /><br>" //display the name, and added a horizontal rule
dat += "<b>Select an item: </b><br><br>" //the rest is just general spacing and bolding
if (premium.len > 0)
dat += "<b>Coin slot:</b> [coin ? coin : "No coin inserted"] (<a href='byond://?src=\ref[src];remove_coin=1'>Remove</A>)<br>"
if (ewallet)
dat += "<b>Charge card's credits:</b> [ewallet ? ewallet.worth : "No charge card inserted"] (<a href='byond://?src=\ref[src];remove_ewallet=1'>Remove</A>)<br><br>"
if (src.product_records.len == 0)
dat += "<font color = 'red'>No product loaded!</font>"
var/list/data = list()
if(currently_vending)
data["mode"] = 1
data["product"] = currently_vending.product_name
data["price"] = currently_vending.price
data["message_err"] = 0
data["message"] = src.status_message
data["message_err"] = src.status_error
else
var/list/display_records = list()
display_records += src.product_records
data["mode"] = 0
var/list/listed_products = list()
for(var/key = 1 to src.product_records.len)
var/datum/data/vending_product/I = src.product_records[key]
if(!(I.category & src.categories))
continue
listed_products.Add(list(list(
"key" = key,
"name" = I.product_name,
"price" = I.price,
"color" = I.display_color,
"amount" = I.amount)))
data["products"] = listed_products
if(src.extended_inventory)
display_records += src.hidden_records
if(src.coin)
display_records += src.coin_records
data["coin"] = src.coin.name
for (var/datum/data/vending_product/R in display_records)
dat += "<FONT color = '[R.display_color]'><B>[R.product_name]</B>:"
dat += " <b>[R.amount]</b> </font>"
if(R.price)
dat += " <b>(Price: [R.price])</b>"
if (R.amount > 0)
var/idx=GetProductIndex(R)
dat += " <a href='byond://?src=\ref[src];vend=[idx];cat=[R.category]'>(Vend)</A>"
if(src.panel_open)
data["panel"] = 1
data["speaker"] = src.shut_up ? 0 : 1
else
dat += " <font color = 'red'>SOLD OUT</font>"
dat += "<br>"
data["panel"] = 0
dat += "</TT>"
if(panel_open)
dat += wires()
if(product_slogans != "")
dat += "The speaker switch is [shut_up ? "off" : "on"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a>"
user << browse(dat, "window=vending")
onclose(user, "")
return
// returns the wire panel text
/obj/machinery/vending/proc/wires()
return wires.GetInteractWindow()
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600)
ui.set_initial_data(data)
ui.open()
/obj/machinery/vending/Topic(href, href_list)
if(stat & (BROKEN|NOPOWER))
@@ -377,19 +466,9 @@
usr.put_in_hands(coin)
usr << "\blue You remove the [coin] from the [src]"
coin = null
if(href_list["remove_ewallet"] && !istype(usr,/mob/living/silicon))
if (!ewallet)
usr << "There is no charge card in this machine."
return
ewallet.loc = src.loc
if(!usr.get_active_hand())
usr.put_in_hands(ewallet)
usr << "\blue You remove the [ewallet] from the [src]"
ewallet = null
categories &= ~CAT_COIN
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
usr.set_machine(src)
if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
if(istype(usr,/mob/living/silicon))
@@ -407,43 +486,32 @@
flick(icon_deny,src)
return
var/idx=text2num(href_list["vend"])
var/cat=text2num(href_list["cat"])
var/key = text2num(href_list["vend"])
var/datum/data/vending_product/R = product_records[key]
var/datum/data/vending_product/R = GetProductByID(idx,cat)
if (!R || !istype(R) || !R.product_path || R.amount <= 0)
// This should not happen unless the request from NanoUI was bad
if(!(R.category & src.categories))
return
if(R.price == null)
if(R.price <= 0)
src.vend(R, usr)
else
if (ewallet)
if (R.price <= ewallet.worth)
ewallet.worth -= R.price
src.vend(R, usr)
else
usr << "\red The ewallet doesn't have enough money to pay for that."
src.currently_vending = R
src.updateUsrDialog()
if(!vendor_account || vendor_account.suspended)
src.status_message = "This machine is currently unable to process payments due to problems with the associated account."
src.status_error = 1
else
src.currently_vending = R
src.updateUsrDialog()
return
src.status_message = "Please swipe a card or insert cash to pay for the item."
src.status_error = 0
else if (href_list["cancel_buying"])
else if (href_list["cancelpurchase"])
src.currently_vending = null
src.updateUsrDialog()
return
else if ((href_list["togglevoice"]) && (src.panel_open))
src.shut_up = !src.shut_up
src.add_fingerprint(usr)
src.updateUsrDialog()
else
usr << browse(null, "window=vending")
return
return
nanomanager.update_uis(src)
/obj/machinery/vending/proc/vend(datum/data/vending_product/R, mob/user)
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
@@ -451,8 +519,11 @@
flick(src.icon_deny,src)
return
src.vend_ready = 0 //One thing at a time!!
src.status_message = "Vending..."
src.status_error = 0
nanomanager.update_uis(src)
if (R in coin_records)
if (R.category & CAT_COIN)
if(!coin)
user << "\blue You need to insert a coin to get this item."
return
@@ -462,8 +533,10 @@
else
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
del(coin)
categories &= ~CAT_COIN
else
del(coin)
categories &= ~CAT_COIN
R.amount--
@@ -477,17 +550,18 @@
flick(src.icon_vend,src)
spawn(src.vend_delay)
new R.product_path(get_turf(src))
src.status_message = ""
src.status_error = 0
src.vend_ready = 1
return
src.updateUsrDialog()
currently_vending = null
nanomanager.update_uis(src)
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
if(src.panel_open)
user << "\blue You stock the [src] with \a [R.product_name]"
R.amount++
src.updateUsrDialog()
nanomanager.update_uis(src)
/obj/machinery/vending/process()
if(stat & (BROKEN|NOPOWER))
@@ -794,34 +868,31 @@
/obj/item/seeds/nettleseed = 2,/obj/item/seeds/reishimycelium = 2,/obj/item/seeds/reishimycelium = 2,/obj/item/seeds/shandseed = 2,)
premium = list(/obj/item/toy/waterflower = 1)
/obj/machinery/vending/hydroseeds/build_inventory(var/list/productlist,hidden=0,req_coin=0)
/**
* Populate hydroseeds product_records
*
* This needs to be customized to fetch the actual names of the seeds, otherwise
* the machine would simply list "packet of seeds" times 20
*/
/obj/machinery/vending/hydroseeds/build_inventory()
var/list/all_products = list(
list(src.products, CAT_NORMAL),
list(src.contraband, CAT_HIDDEN),
list(src.premium, CAT_COIN))
for(var/typepath in productlist)
var/amount = productlist[typepath]
var/price = prices[typepath]
if(isnull(amount)) amount = 1
for(var/current_list in all_products)
var/category = current_list[2]
var/datum/data/vending_product/R = new /datum/data/vending_product()
for(var/entry in current_list[1])
var/obj/item/seeds/S = new entry(src)
var/name = S.name
var/datum/data/vending_product/product = new/datum/data/vending_product(entry, name)
R.product_path = typepath
R.amount = amount
R.price = price
R.display_color = pick("red","blue","green")
product.price = (entry in src.prices) ? src.prices[entry] : 0
product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1
product.category = category
if(hidden)
R.category=CAT_HIDDEN
hidden_records += R
else if(req_coin)
R.category=CAT_COIN
coin_records += R
else
R.category=CAT_NORMAL
product_records += R
var/obj/item/seeds/S = new typepath(src)
R.product_name = S.name
del(S)
return
src.product_records.Add(product)
/obj/machinery/vending/magivend
name = "MagiVend"

View File

@@ -141,9 +141,10 @@
if(isliving(src.loc))
return
user.next_move = max(user.next_move+2,world.time + 2)
src.pickup(user)
add_fingerprint(user)
user.put_in_active_hand(src)
if(src.loc == user)
src.pickup(user)
return

View File

@@ -115,13 +115,10 @@
listening = !listening && !(wires.IsIndexCut(WIRE_RECEIVE) || wires.IsIndexCut(WIRE_SIGNAL))
/obj/item/device/radio/Topic(href, href_list)
//..()
if (usr.stat || !on)
return
if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
if(..() || !on)
usr << browse(null, "window=radio")
return
usr.set_machine(src)
if (href_list["track"])
var/mob/target = locate(href_list["track"])
@@ -152,17 +149,7 @@
else
channels[chan_name] |= FREQ_LISTENING
if (!( master ))
if (istype(loc, /mob))
interact(loc)
else
updateDialog()
else
if (istype(master.loc, /mob))
interact(master.loc)
else
updateDialog()
add_fingerprint(usr)
interact(usr)
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT
var/datum/radio_frequency/connection = null

View File

@@ -0,0 +1,154 @@
/obj/item/device/spy_bug
name = "bug"
desc = "" // Nothing to see here
icon = 'icons/obj/weapons.dmi'
icon_state = "eshield0"
item_state = "nothing"
layer = TURF_LAYER+0.2
flags = CONDUCT
force = 5.0
w_class = 1.0
throwforce = 5.0
throw_range = 15
throw_speed = 3
origin_tech = "programming=1;engineering=1;syndicate=3"
var/obj/item/device/radio/spy/radio
var/obj/machinery/camera/spy/camera
/obj/item/device/spy_bug/New()
..()
radio = new(src)
camera = new(src)
/obj/item/device/spy_bug/examine(mob/user)
. = ..(user, 0)
if(.)
user << "It's a tiny camera, microphone, and transmission device in a happy union."
user << "Needs to be both configured and brought in contact with monitor device to be fully functional."
/obj/item/device/spy_bug/attack_self(mob/user)
radio.attack_self(user)
/obj/item/device/spy_bug/attackby(obj/W as obj, mob/living/user as mob)
if(istype(W, /obj/item/device/spy_monitor))
var/obj/item/device/spy_monitor/SM = W
SM.pair(src, user)
else
..()
/obj/item/device/spy_bug/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
radio.hear_talk(M, msg, speaking)
/obj/item/device/spy_monitor
name = "\improper PDA"
desc = "A portable microcomputer by Thinktronic Systems, LTD. Functionality determined by a preprogrammed ROM cartridge."
icon = 'icons/obj/pda.dmi'
icon_state = "pda"
item_state = "electronic"
w_class = 2.0
origin_tech = "programming=1;engineering=1;syndicate=3"
var/operating = 0
var/obj/item/device/radio/spy/radio
var/obj/machinery/camera/spy/selected_camera
var/list/obj/machinery/camera/spy/cameras = new()
/obj/item/device/spy_monitor/New()
radio = new(src)
/obj/item/device/spy_monitor/examine(mob/user)
. = ..(user, 1)
if(.)
user << "The time '12:00' is blinking in the corner of the screen and \the [src] looks very cheaply made."
/obj/item/device/spy_monitor/attack_self(mob/user)
if(operating)
return
radio.attack_self(user)
view_cameras(user)
/obj/item/device/spy_monitor/attackby(obj/W as obj, mob/living/user as mob)
if(istype(W, /obj/item/device/spy_bug))
pair(W, user)
else
return ..()
/obj/item/device/spy_monitor/proc/pair(var/obj/item/device/spy_bug/SB, var/mob/living/user)
if(SB.camera in cameras)
user << "<span class='notice'>\The [SB] has been unpaired from \the [src].</span>"
cameras -= SB.camera
else
user << "<span class='notice'>\The [SB] has been paired with \the [src].</span>"
cameras += SB.camera
/obj/item/device/spy_monitor/proc/view_cameras(mob/user)
if(!can_use_cam(user))
return
selected_camera = cameras[1]
view_camera(user)
operating = 1
while(selected_camera && Adjacent(user))
selected_camera = input("Select camera bug to view.") as null|anything in cameras
selected_camera = null
operating = 0
/obj/item/device/spy_monitor/proc/view_camera(mob/user)
spawn(0)
while(selected_camera && Adjacent(user))
var/turf/T = get_turf(selected_camera)
if(!T || !is_on_same_plane_or_station(T.z, user.z) || !selected_camera.can_use())
user.unset_machine()
user.reset_view(null)
user << "<span class='notice'>[selected_camera] unavailable.</span>"
sleep(90)
else
user.set_machine(selected_camera)
user.reset_view(selected_camera)
sleep(10)
user.unset_machine()
user.reset_view(null)
/obj/item/device/spy_monitor/proc/can_use_cam(mob/user)
if(operating)
return
if(!cameras.len)
user << "<span class='warning'>No paired cameras detected!</span>"
user << "<span class='warning'>Bring a bug in contact with this device to pair the camera.</span>"
return
return 1
/obj/item/device/spy_monitor/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
return radio.hear_talk(M, msg, speaking)
/obj/machinery/camera/spy
// These cheap toys are accessible from the mercenary camera console as well
network = list("NUKE")
/obj/machinery/camera/spy/New()
..()
name = "DV-136ZB #[rand(1000,9999)]"
c_tag = name
cameranet.removeCamera(src) // Sorry, no AI spying.
/obj/machinery/camera/spy/check_eye(var/mob/user as mob)
return 1
/obj/item/device/radio/spy
listening = 0
frequency = 1473
broadcasting = 0
canhear_range = 1
name = "spy device"
icon_state = "syn_cypherkey"

View File

@@ -99,6 +99,18 @@
item_state = "syndballoon"
w_class = 4.0
/obj/item/toy/nanotrasenballoon
name = "criminal balloon"
desc = "Across the balloon the following is printed: \"Man, I love NT soooo much. I use only NanoTrasen products. You have NO idea.\""
throwforce = 0
throw_speed = 4
throw_range = 20
force = 0
icon = 'icons/obj/weapons.dmi'
icon_state = "ntballoon"
item_state = "ntballoon"
w_class = 4.0
/*
* Fake telebeacon
*/

View File

@@ -86,7 +86,7 @@
if(affecting.take_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
if(!(H.species & NO_PAIN))
if(!(H.species && (H.species.flags & NO_PAIN)))
H.Weaken(3)
..()

View File

@@ -36,7 +36,7 @@
max_w_class = 2
storage_slots = 21
can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear")
cant_hold = list(/obj/item/weapon/disk/nuclear)
/obj/item/weapon/storage/bag/trash/update_icon()
if(contents.len == 0)
@@ -63,7 +63,7 @@
max_w_class = 2
storage_slots = 21
can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear")
cant_hold = list(/obj/item/weapon/disk/nuclear)
// -----------------------------
// Mining Satchel
@@ -79,7 +79,7 @@
storage_slots = 50
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
max_w_class = 3
can_hold = list("/obj/item/weapon/ore")
can_hold = list(/obj/item/weapon/ore)
// -----------------------------
@@ -94,7 +94,7 @@
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
max_w_class = 3
w_class = 2
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/grown","/obj/item/seeds","/obj/item/weapon/grown")
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/grown,/obj/item/seeds,/obj/item/weapon/grown)
// -----------------------------
@@ -252,4 +252,4 @@
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * cash.w_class
max_w_class = 3
w_class = 2
can_hold = list("/obj/item/weapon/coin","/obj/item/weapon/spacecash")
can_hold = list(/obj/item/weapon/coin,/obj/item/weapon/spacecash)

View File

@@ -13,19 +13,19 @@
icon_state = "utilitybelt"
item_state = "utility"
can_hold = list(
//"/obj/item/weapon/combitool",
"/obj/item/weapon/crowbar",
"/obj/item/weapon/screwdriver",
"/obj/item/weapon/weldingtool",
"/obj/item/weapon/wirecutters",
"/obj/item/weapon/wrench",
"/obj/item/device/multitool",
"/obj/item/device/flashlight",
"/obj/item/stack/cable_coil",
"/obj/item/device/t_scanner",
"/obj/item/device/analyzer",
"/obj/item/taperoll/engineering",
"/obj/item/device/robotanalyzer")
///obj/item/weapon/combitool,
/obj/item/weapon/crowbar,
/obj/item/weapon/screwdriver,
/obj/item/weapon/weldingtool,
/obj/item/weapon/wirecutters,
/obj/item/weapon/wrench,
/obj/item/device/multitool,
/obj/item/device/flashlight,
/obj/item/stack/cable_coil,
/obj/item/device/t_scanner,
/obj/item/device/analyzer,
/obj/item/taperoll/engineering,
/obj/item/device/robotanalyzer)
/obj/item/weapon/storage/belt/utility/full/New()
@@ -55,22 +55,21 @@
icon_state = "medicalbelt"
item_state = "medical"
can_hold = list(
"/obj/item/device/healthanalyzer",
"/obj/item/weapon/dnainjector",
"/obj/item/weapon/reagent_containers/dropper",
"/obj/item/weapon/reagent_containers/glass/beaker",
"/obj/item/weapon/reagent_containers/glass/bottle",
"/obj/item/weapon/reagent_containers/pill",
"/obj/item/weapon/reagent_containers/syringe",
"/obj/item/weapon/reagent_containers/glass/dispenser",
"/obj/item/weapon/flame/lighter/zippo",
"/obj/item/weapon/storage/fancy/cigarettes",
"/obj/item/weapon/storage/pill_bottle",
"/obj/item/stack/medical",
"/obj/item/device/flashlight/pen",
"/obj/item/clothing/mask/surgical",
"/obj/item/clothing/gloves/latex",
"/obj/item/weapon/reagent_containers/hypospray"
/obj/item/device/healthanalyzer,
/obj/item/weapon/dnainjector,
/obj/item/weapon/reagent_containers/dropper,
/obj/item/weapon/reagent_containers/glass/beaker,
/obj/item/weapon/reagent_containers/glass/bottle,
/obj/item/weapon/reagent_containers/pill,
/obj/item/weapon/reagent_containers/syringe,
/obj/item/weapon/flame/lighter/zippo,
/obj/item/weapon/storage/fancy/cigarettes,
/obj/item/weapon/storage/pill_bottle,
/obj/item/stack/medical,
/obj/item/device/flashlight/pen,
/obj/item/clothing/mask/surgical,
/obj/item/clothing/gloves/latex,
/obj/item/weapon/reagent_containers/hypospray
)
/obj/item/weapon/storage/belt/medical/emt
@@ -90,25 +89,24 @@
max_w_class = 3
max_combined_w_class = 21
can_hold = list(
"/obj/item/weapon/grenade",
"/obj/item/weapon/reagent_containers/spray/pepper",
"/obj/item/weapon/handcuffs",
"/obj/item/device/flash",
"/obj/item/clothing/glasses",
"/obj/item/ammo_casing/shotgun",
"/obj/item/ammo_magazine",
"/obj/item/weapon/reagent_containers/food/snacks/donut/normal",
"/obj/item/weapon/reagent_containers/food/snacks/donut/jelly",
"/obj/item/weapon/melee/baton",
"/obj/item/weapon/gun/energy/taser",
"/obj/item/weapon/flame/lighter/zippo",
"/obj/item/weapon/cigpacket",
"/obj/item/clothing/glasses/hud/security",
"/obj/item/device/flashlight",
"/obj/item/device/pda",
"/obj/item/device/radio/headset",
"/obj/item/weapon/melee",
"/obj/item/taperoll/police"
/obj/item/weapon/grenade,
/obj/item/weapon/reagent_containers/spray/pepper,
/obj/item/weapon/handcuffs,
/obj/item/device/flash,
/obj/item/clothing/glasses,
/obj/item/ammo_casing/shotgun,
/obj/item/ammo_magazine,
/obj/item/weapon/reagent_containers/food/snacks/donut/normal,
/obj/item/weapon/reagent_containers/food/snacks/donut/jelly,
/obj/item/weapon/melee/baton,
/obj/item/weapon/gun/energy/taser,
/obj/item/weapon/flame/lighter/zippo,
/obj/item/clothing/glasses/hud/security,
/obj/item/device/flashlight,
/obj/item/device/pda,
/obj/item/device/radio/headset,
/obj/item/weapon/melee,
/obj/item/taperoll/police
)
/obj/item/weapon/storage/belt/soulstone
@@ -118,7 +116,7 @@
item_state = "soulstonebelt"
storage_slots = 6
can_hold = list(
"/obj/item/device/soulstone"
/obj/item/device/soulstone
)
/obj/item/weapon/storage/belt/soulstone/full/New()

View File

@@ -324,13 +324,27 @@
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
/obj/item/weapon/storage/box/sinpockets
name = "box of sin-pockets"
desc = "<B>Instructions:</B> <I>Crush bottom of package to initiate chemical heating. Wait for 20 seconds before consumption. Product will cool if not eaten within seven minutes.</I>"
icon_state = "donk_kit"
New()
..()
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket(src)
/obj/item/weapon/storage/box/monkeycubes
name = "monkey cube box"
desc = "Drymate brand monkey cubes. Just add water!"
icon = 'icons/obj/food.dmi'
icon_state = "monkeycubebox"
storage_slots = 7
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/monkeycube")
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/monkeycube)
New()
..()
if(src.type == /obj/item/weapon/storage/box/monkeycubes)
@@ -444,7 +458,7 @@
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"
storage_slots = 8
can_hold = list("/obj/item/toy/snappop")
can_hold = list(/obj/item/toy/snappop)
New()
..()
for(var/i=1; i <= storage_slots; i++)
@@ -459,7 +473,7 @@
storage_slots = 10
w_class = 1
slot_flags = SLOT_BELT
can_hold = list("/obj/item/weapon/flame/match")
can_hold = list(/obj/item/weapon/flame/match)
New()
..()
@@ -492,7 +506,7 @@
item_state = "syringe_kit"
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
storage_slots=21
can_hold = list("/obj/item/weapon/light/tube", "/obj/item/weapon/light/bulb")
can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
max_combined_w_class = 42 //holds 21 items of w_class 2
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try

View File

@@ -48,7 +48,7 @@
name = "egg box"
storage_slots = 12
max_combined_w_class = 24
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg")
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/egg)
/obj/item/weapon/storage/fancy/egg_box/New()
..()
@@ -91,7 +91,7 @@
storage_slots = 6
icon_type = "crayon"
can_hold = list(
"/obj/item/toy/crayon"
/obj/item/toy/crayon
)
/obj/item/weapon/storage/fancy/crayons/New()
@@ -134,7 +134,7 @@
throwforce = 2
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list("/obj/item/clothing/mask/cigarette")
can_hold = list(/obj/item/clothing/mask/smokable/cigarette)
icon_type = "cigarette"
/obj/item/weapon/storage/fancy/cigarettes/New()
@@ -190,7 +190,7 @@
throwforce = 2
slot_flags = SLOT_BELT
storage_slots = 7
can_hold = list("/obj/item/clothing/mask/cigarette/cigar")
can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar)
icon_type = "cigar"
/obj/item/weapon/storage/fancy/cigar/New()
@@ -239,7 +239,7 @@
icon_type = "vial"
name = "vial storage box"
storage_slots = 6
can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial")
can_hold = list(/obj/item/weapon/reagent_containers/glass/beaker/vial)
/obj/item/weapon/storage/fancy/vials/New()
@@ -255,7 +255,7 @@
icon_state = "vialbox0"
item_state = "syringe_kit"
max_w_class = 3
can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial")
can_hold = list(/obj/item/weapon/reagent_containers/glass/beaker/vial)
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
storage_slots = 6
req_access = list(access_virology)

View File

@@ -109,6 +109,25 @@
new /obj/item/stack/medical/advanced/ointment(src)
new /obj/item/stack/medical/splint(src)
return
/obj/item/weapon/storage/firstaid/combat
name = "combat medical kit"
desc = "Contains advanced medical treatments."
icon_state = "bezerk"
item_state = "firstaid-advanced"
/obj/item/weapon/storage/firstaid/combat/New()
..()
if (empty) return
new /obj/item/weapon/storage/pill_bottle/bicaridine(src)
new /obj/item/weapon/storage/pill_bottle/dermaline(src)
new /obj/item/weapon/storage/pill_bottle/dexalin_plus(src)
new /obj/item/weapon/storage/pill_bottle/dylovene(src)
new /obj/item/weapon/storage/pill_bottle/tramadol(src)
new /obj/item/weapon/storage/pill_bottle/spaceacillin(src)
new /obj/item/stack/medical/splint(src)
return
/*
* Pill Bottles
*/
@@ -119,26 +138,12 @@
icon = 'icons/obj/chemical.dmi'
item_state = "contsolid"
w_class = 2.0
can_hold = list("/obj/item/weapon/reagent_containers/pill","/obj/item/weapon/dice","/obj/item/weapon/paper")
can_hold = list(/obj/item/weapon/reagent_containers/pill,/obj/item/weapon/dice,/obj/item/weapon/paper)
allow_quick_gather = 1
use_to_pickup = 1
storage_slots = 14
use_sound = null
/obj/item/weapon/storage/pill_bottle/kelotane
name = "bottle of kelotane pills"
desc = "Contains pills used to treat burns."
New()
..()
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
/obj/item/weapon/storage/pill_bottle/antitox
name = "bottle of Dylovene pills"
desc = "Contains pills used to counter toxins."
@@ -153,6 +158,62 @@
new /obj/item/weapon/reagent_containers/pill/antitox( src )
new /obj/item/weapon/reagent_containers/pill/antitox( src )
/obj/item/weapon/storage/pill_bottle/bicaridine
name = "bottle of Bicaridine pills"
desc = "Contains pills used to stabilize the severely injured."
/obj/item/weapon/storage/pill_bottle/bicaridine/New()
..()
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
/obj/item/weapon/storage/pill_bottle/dexalin_plus
name = "bottle of Dexalin Plus pills"
desc = "Contains pills used to treat extreme cases of oxygen deprivation."
/obj/item/weapon/storage/pill_bottle/dexalin_plus/New()
..()
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
new /obj/item/weapon/reagent_containers/pill/dexalin_plus(src)
/obj/item/weapon/storage/pill_bottle/dermaline
name = "bottle of Dermaline pills"
desc = "Contains pills used to treat burn wounds."
/obj/item/weapon/storage/pill_bottle/dermaline/New()
..()
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
new /obj/item/weapon/reagent_containers/pill/dermaline(src)
/obj/item/weapon/storage/pill_bottle/dylovene
name = "bottle of Dylovene pills"
desc = "Contains pills used to treat toxic substances in the blood."
/obj/item/weapon/storage/pill_bottle/dylovene/New()
..()
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
new /obj/item/weapon/reagent_containers/pill/dylovene(src)
/obj/item/weapon/storage/pill_bottle/inaprovaline
name = "bottle of Inaprovaline pills"
desc = "Contains pills used to stabilize patients."
@@ -167,8 +228,36 @@
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
/obj/item/weapon/storage/pill_bottle/kelotane
name = "bottle of kelotane pills"
desc = "Contains pills used to treat burns."
New()
..()
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
/obj/item/weapon/storage/pill_bottle/spaceacillin
name = "bottle of Spaceacillin pills"
desc = "A theta-lactam antibiotic. Effective against many diseases likely to be encountered in space."
/obj/item/weapon/storage/pill_bottle/spaceacillin/New()
..()
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
new /obj/item/weapon/reagent_containers/pill/spaceacillin(src)
/obj/item/weapon/storage/pill_bottle/tramadol
name = "bottle of Tramadol Pills"
name = "bottle of Tramadol pills"
desc = "Contains pills used to relieve pain."
New()

View File

@@ -17,7 +17,7 @@
name = "donut box"
storage_slots = 6
var/startswith = 6
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/donut")
can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/donut)
foldable = /obj/item/stack/sheet/cardboard
/obj/item/weapon/storage/donut_box/New()

View File

@@ -220,7 +220,7 @@
max_w_class = 8
anchored = 1.0
density = 0
cant_hold = list("/obj/item/weapon/storage/secure/briefcase")
cant_hold = list(/obj/item/weapon/storage/secure/briefcase)
New()
..()

View File

@@ -209,21 +209,14 @@
usr << "<span class='notice'>[src] is full, make some space.</span>"
return 0 //Storage item is full
if(can_hold.len)
var/ok = 0
for(var/A in can_hold)
if(istype(W, text2path(A) ))
ok = 1
break
if(!ok)
if(can_hold.len && !is_type_in_list(W, can_hold))
if(!stop_messages)
if (istype(W, /obj/item/weapon/hand_labeler))
return 0
usr << "<span class='notice'>[src] cannot hold [W].</span>"
return 0
for(var/A in cant_hold) //Check for specific items which this container can't hold.
if(istype(W, text2path(A) ))
if(cant_hold.len && is_type_in_list(W, cant_hold))
if(!stop_messages)
usr << "<span class='notice'>[src] cannot hold [W].</span>"
return 0

View File

@@ -149,3 +149,71 @@
..()
new /obj/item/weapon/stamp/chameleon(src)
new /obj/item/weapon/pen/chameleon(src)
new /obj/item/device/destTagger(src)
new /obj/item/weapon/packageWrap(src)
new /obj/item/weapon/hand_labeler(src)
/obj/item/weapon/storage/box/syndie_kit/spy
name = "spy kit"
desc = "For when you want to conduct voyeurism from afar."
/obj/item/weapon/storage/box/syndie_kit/spy/New()
..()
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_bug(src)
new /obj/item/device/spy_monitor(src)
/obj/item/weapon/storage/box/syndie_kit/g9mm
name = "\improper Smooth operator"
desc = "9mm with silencer kit."
/obj/item/weapon/storage/box/syndie_kit/g9mm/New()
..()
new /obj/item/weapon/gun/projectile/pistol(src)
new /obj/item/weapon/silencer(src)
/obj/item/weapon/storage/box/syndie_kit/cigarette
name = "\improper Tricky smokes"
desc = "Comes with the following brands of cigarettes, in this order: 2xFlash, 2xSmoke, 1xMindBreaker, 1xTricordrazine. Avoid mixing them up."
/obj/item/weapon/storage/box/syndie_kit/cigarette/New()
..()
var/obj/item/weapon/storage/fancy/cigarettes/pack
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
fill_cigarre_package(pack, list("aluminum" = 5, "potassium" = 5, "sulfur" = 5))
pack.desc += " 'F' has been scribbled on it."
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
fill_cigarre_package(pack, list("aluminum" = 5, "potassium" = 5, "sulfur" = 5))
pack.desc += " 'F' has been scribbled on it."
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
fill_cigarre_package(pack, list("potassium" = 5, "sugar" = 5, "phosphorus" = 5))
pack.desc += " 'S' has been scribbled on it."
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
fill_cigarre_package(pack, list("potassium" = 5, "sugar" = 5, "phosphorus" = 5))
pack.desc += " 'S' has been scribbled on it."
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
// Dylovene. Going with 1.5 rather than 1.6666666...
fill_cigarre_package(pack, list("potassium" = 1.5, "nitrogen" = 1.5, "silicon" = 1.5))
// Mindbreaker
fill_cigarre_package(pack, list("silicon" = 4.5, "hydrogen" = 4.5))
pack.desc += " 'MB' has been scribbled on it."
pack = new /obj/item/weapon/storage/fancy/cigarettes(src)
pack.reagents.add_reagent("tricordrazine", 15 * pack.storage_slots)
pack.desc += " 'T' has been scribbled on it."
new /obj/item/weapon/flame/lighter/zippo(src)
/proc/fill_cigarre_package(var/obj/item/weapon/storage/fancy/cigarettes/C, var/list/reagents)
for(var/reagent in reagents)
C.reagents.add_reagent(reagent, reagents[reagent] * C.storage_slots)

View File

@@ -5,25 +5,25 @@
icon_state = "wallet"
w_class = 2
can_hold = list(
"/obj/item/weapon/spacecash",
"/obj/item/weapon/card",
"/obj/item/clothing/mask/cigarette",
"/obj/item/device/flashlight/pen",
"/obj/item/seeds",
"/obj/item/stack/medical",
"/obj/item/toy/crayon",
"/obj/item/weapon/coin",
"/obj/item/weapon/dice",
"/obj/item/weapon/disk",
"/obj/item/weapon/implanter",
"/obj/item/weapon/flame/lighter",
"/obj/item/weapon/flame/match",
"/obj/item/weapon/paper",
"/obj/item/weapon/pen",
"/obj/item/weapon/photo",
"/obj/item/weapon/reagent_containers/dropper",
"/obj/item/weapon/screwdriver",
"/obj/item/weapon/stamp")
/obj/item/weapon/spacecash,
/obj/item/weapon/card,
/obj/item/clothing/mask/smokable/cigarette/,
/obj/item/device/flashlight/pen,
/obj/item/seeds,
/obj/item/stack/medical,
/obj/item/toy/crayon,
/obj/item/weapon/coin,
/obj/item/weapon/dice,
/obj/item/weapon/disk,
/obj/item/weapon/implanter,
/obj/item/weapon/flame/lighter,
/obj/item/weapon/flame/match,
/obj/item/weapon/paper,
/obj/item/weapon/pen,
/obj/item/weapon/photo,
/obj/item/weapon/reagent_containers/dropper,
/obj/item/weapon/screwdriver,
/obj/item/weapon/stamp)
slot_flags = SLOT_ID
var/obj/item/weapon/card/id/front_id = null

View File

@@ -253,6 +253,7 @@
icon_state = "inf_box"
item_state = "syringe_kit"
max_combined_w_class = 21
can_hold = list(/obj/item/inflatable)
New()
..()

View File

@@ -104,7 +104,7 @@
return
..()
take_damage(Proj.damage * 4)
take_damage(Proj.damage)
return

View File

@@ -1148,15 +1148,22 @@ var/global/floorIsLava = 0
switch(detail)
if(0)
return "<b>[key_name(C, link, name, highlight_special)]</b>"
if(1)
if(1) //Private Messages
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>)</b>"
if(2)
if(2) //Admins
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=holder;adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?_src_=holder;check_antagonist=1'>CA</A>)</b>"
if(3)
if(3) //Devs
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>)(<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>)</b>"
if(4) //Mentors
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>)</b>"
/proc/ishost(whom)
if(!whom)

View File

@@ -87,7 +87,11 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
var/ai_cl
if(ai_found)
ai_cl = " (<A HREF='?_src_=holder;adminchecklaws=\ref[mob]'>CL</A>)"
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 0, 0, 1, 0)][ai_cl]:</b> [msg]"
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
// highlight special roles (0 = everyone has same looking name, 1 = antags / special roles get a golden name)
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 4, 1, 1, 0)][ai_cl]:</b> [msg]"
msg = "\blue <b><font color=red>Request for Help:: </font>[get_options_bar(mob, 2, 1, 1)][ai_cl]:</b> [msg]"
var/admin_number_afk = 0

View File

@@ -1299,7 +1299,7 @@ datum/preferences
if("hair")
if(species == "Human" || species == "Unathi" || species == "Tajara" || species == "Skrell")
var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference") as color|null
var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference", rgb(r_hair, g_hair, b_hair)) as color|null
if(new_hair)
r_hair = hex2num(copytext(new_hair, 2, 4))
g_hair = hex2num(copytext(new_hair, 4, 6))
@@ -1319,7 +1319,7 @@ datum/preferences
h_style = new_h_style
if("facial")
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as color|null
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(r_facial, g_facial, b_facial)) as color|null
if(new_facial)
r_facial = hex2num(copytext(new_facial, 2, 4))
g_facial = hex2num(copytext(new_facial, 4, 6))
@@ -1364,7 +1364,7 @@ datum/preferences
ShowChoices(user)
if("eyes")
var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference") as color|null
var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(r_eyes, g_eyes, b_eyes)) as color|null
if(new_eyes)
r_eyes = hex2num(copytext(new_eyes, 2, 4))
g_eyes = hex2num(copytext(new_eyes, 4, 6))
@@ -1379,7 +1379,7 @@ datum/preferences
if("skin")
if(species == "Unathi" || species == "Tajara" || species == "Skrell")
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference") as color|null
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(r_skin, g_skin, b_skin)) as color|null
if(new_skin)
r_skin = hex2num(copytext(new_skin, 2, 4))
g_skin = hex2num(copytext(new_skin, 4, 6))

View File

@@ -197,8 +197,8 @@
target_mob = H
if(target_mob != H)
H << "<span class='danger'>You inject [target_mob] with [chems_to_use] unit[chems_to_use == 1 ? "" : "s"] of [charge.display_name].</span>"
target_mob << "<span class='danger'>You feel a rushing in your veins as [chems_to_use] unit[chems_to_use == 1 ? "" : "s"] of [charge.display_name] [chems_to_use == 1 ? "is" : "are"] injected.</span>"
H << "<span class='danger'>You inject [target_mob] with [chems_to_use] unit\s of [charge.display_name].</span>"
target_mob << "<span class='danger'>You feel a rushing in your veins as [chems_to_use] unit\s of [charge.display_name] [chems_to_use == 1 ? "is" : "are"] injected.</span>"
target_mob.reagents.add_reagent(charge.display_name, chems_to_use)
charge.charges -= chems_to_use

View File

@@ -180,11 +180,7 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/donkpocket //SPECIAL
proc/warm_up(var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/being_cooked)
being_cooked.warm = 1
being_cooked.reagents.add_reagent("tricordrazine", 5)
being_cooked.bitesize = 6
being_cooked.name = "Warm " + being_cooked.name
being_cooked.cooltime()
being_cooked.heat()
make_food(var/obj/container as obj)
var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/being_cooked = ..(container)
warm_up(being_cooked)

View File

@@ -112,7 +112,7 @@
else if(grown_seed.heat_tolerance < 10)
dat += "<br>It is very sensitive to temperature shifts."
dat += "<br>It thrives in a light level of [grown_seed.ideal_light] lumen[grown_seed.ideal_light == 1 ? "" : "s"]."
dat += "<br>It thrives in a light level of [grown_seed.ideal_light] lumen\s."
if(grown_seed.light_tolerance > 10)
dat += "<br>It is well adapted to a range of light levels."

View File

@@ -256,7 +256,7 @@ proc/populate_seed_list()
if(prob(90))
requires_nutrients = 1
nutrient_consumption = rand(100)*0.1
nutrient_consumption = rand(25)/100
else
requires_nutrients = 0

View File

@@ -23,7 +23,7 @@
"exotic matter" = 0
)
for(var/turf/T in oview(3,get_turf(user)))
for(var/turf/T in range(3,get_turf(user)))
if(!T.has_resources)
continue

View File

@@ -107,7 +107,7 @@
return
else
if(language)
message = language.scramble(language)
message = language.scramble(message)
else
message = stars(message)

View File

@@ -1,3 +1,5 @@
#define SCRAMBLE_CACHE_LEN 20
/*
Datum based languages. Easily editable and modular.
*/
@@ -35,11 +37,21 @@
return "[trim(full_name)]"
/datum/language
var/list/scramble_cache = list()
/datum/language/proc/scramble(var/input)
if(!syllables || !syllables.len)
return stars(input)
// If the input is cached already, move it to the end of the cache and return it
if(input in scramble_cache)
var/n = scramble_cache[input]
scramble_cache -= input
scramble_cache[input] = n
return n
var/input_size = length(input)
var/scrambled_text = ""
var/capitalize = 1
@@ -64,6 +76,13 @@
var/input_ending = copytext(input, input_size)
if(input_ending in list("!","?","."))
scrambled_text += input_ending
// Add it to cache, cutting old entries if the list is too long
scramble_cache[input] = scrambled_text
if(scramble_cache.len > SCRAMBLE_CACHE_LEN)
scramble_cache.Cut(1, scramble_cache.len-SCRAMBLE_CACHE_LEN-1)
return scrambled_text
/datum/language/proc/format_message(message, verb)
@@ -497,3 +516,5 @@
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
#undef SCRAMBLE_CACHE_LEN

View File

@@ -434,6 +434,7 @@
step(pulling, get_dir(pulling.loc, T))
if(t)
M.start_pulling(t)
else
if (pulling)

View File

@@ -792,7 +792,7 @@ note dizziness decrements automatically in the mob's Life() proc.
/mob/Stat()
..()
if(statpanel("Status")) //not looking at that panel
if(statpanel("MC")) //not looking at that panel
if(client && client.holder)
stat(null,"Location:\t([x], [y], [z])")
@@ -808,6 +808,7 @@ note dizziness decrements automatically in the mob's Life() proc.
stat(null,"Obj-[master_controller.objects_cost]\t#[processing_objects.len]")
stat(null,"Net-[master_controller.networks_cost]\tPnet-[master_controller.powernets_cost]")
stat(null,"NanoUI-[master_controller.nano_cost]\t#[nanomanager.processing_uis.len]")
stat(null,"Events-[master_controller.events_cost]\t#[event_manager.active_events.len]")
stat(null,"Tick-[master_controller.ticker_cost]\tALL-[master_controller.total_cost]")
else
stat(null,"MasterController-ERROR")

View File

@@ -137,3 +137,33 @@
/obj/item/weapon/pen/chameleon/get_signature(var/mob/user)
return signature ? signature : "Anonymous"
/obj/item/weapon/pen/chameleon/verb/set_colour()
set name = "Change Pen Colour"
set category = "Object"
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red", "Invisible", "Black")
var/selected_type = input("Pick new colour.", "Pen Colour", null, null) as null|anything in possible_colours
if(selected_type)
switch(selected_type)
if("Yellow")
colour = COLOR_YELLOW
if("Green")
colour = COLOR_GREEN
if("Pink")
colour = COLOR_PINK
if("Blue")
colour = COLOR_BLUE
if("Orange")
colour = COLOR_ORANGE
if("Cyan")
colour = COLOR_CYAN
if("Red")
colour = COLOR_RED
if("Invisible")
colour = COLOR_WHITE
else
colour = COLOR_BLACK
usr << "<span class='info'>You select the [lowertext(selected_type)] ink container.</span>"

View File

@@ -86,7 +86,7 @@ var/global/photo_count = 0
icon = 'icons/obj/items.dmi'
icon_state = "album"
item_state = "briefcase"
can_hold = list("/obj/item/weapon/photo",)
can_hold = list(/obj/item/weapon/photo)
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)

View File

@@ -893,6 +893,11 @@
if(!can_use(usr, 1))
return 1
if(!istype(usr, /mob/living/silicon) && locked)
// Shouldn't happen, this is here to prevent href exploits
usr << "You must unlock the panel to use this!"
return 1
if (href_list["lock"])
coverlocked = !coverlocked

View File

@@ -15,7 +15,7 @@
var/power_output = 1
/obj/machinery/power/port_gen/proc/IsBroken()
return (crit_fail || (stat & BROKEN|EMPED))
return (crit_fail || (stat & (BROKEN|EMPED)))
/obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check.
return 1
@@ -84,9 +84,9 @@
//A power generator that runs on solid plasma sheets.
/obj/machinery/power/port_gen/pacman
name = "\improper P.A.C.M.A.N.-type Portable Generator"
desc = "A power generator that runs on solid plasma sheets. Rated for 80 kW max safe output."
desc = "A power generator that runs on solid phoron sheets. Rated for 80 kW max safe output."
var/sheet_name = "solid plasma sheet"
var/sheet_name = "Phoron Sheets"
var/sheet_path = /obj/item/stack/sheet/mineral/phoron
var/board_path = "/obj/item/weapon/circuitboard/pacman"
@@ -98,6 +98,7 @@
*/
power_gen = 20000 //Watts output per power_output level
var/max_power_output = 5 //The maximum power setting without emagging.
var/max_safe_output = 4 // For UI use, maximal output that won't cause overheat.
var/time_per_sheet = 96 //fuel efficiency - how long 1 sheet lasts at power level 1
var/max_sheets = 100 //max capacity of the hopper
var/max_temperature = 300 //max temperature before overheating increases
@@ -122,8 +123,6 @@
component_parts += new /obj/item/stack/cable_coil(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new board_path(src)
var/obj/sheet = new sheet_path(null)
sheet_name = sheet.name
RefreshParts()
/obj/machinery/power/port_gen/pacman/Del()
@@ -150,7 +149,7 @@
/obj/machinery/power/port_gen/pacman/examine(mob/user)
..(user)
user << "\The [src] appears to be producing [power_gen*power_output] W."
user << "There are [sheets] [sheet_name]\s left in the hopper."
user << "There [sheets == 1 ? "is" : "are"] [sheets] sheet\s left in the hopper."
if(IsBroken()) user << "<span class='warning'>\The [src] seems to have broken down.</span>"
if(overheating) user << "<span class='danger'>\The [src] is overheating!</span>"
@@ -236,6 +235,9 @@
temperature = max(temperature - temp_loss, cooling_temperature)
src.updateDialog()
if(overheating)
overheating--
/obj/machinery/power/port_gen/pacman/proc/overheat()
overheating++
if (overheating > 60)
@@ -261,7 +263,7 @@
if(amount < 1)
user << "\blue The [src.name] is full!"
return
user << "\blue You add [amount] [addstack.singular_name]\s to the [src.name]."
user << "\blue You add [amount] sheet\s to the [src.name]."
sheets += amount
addstack.use(amount)
updateUsrDialog()
@@ -305,11 +307,46 @@
..()
if (!anchored)
return
interact(user)
ui_interact(user)
/obj/machinery/power/port_gen/pacman/attack_ai(mob/user as mob)
interact(user)
ui_interact(user)
/obj/machinery/power/port_gen/pacman/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(IsBroken())
return
var/data[0]
data["active"] = active
if(istype(user, /mob/living/silicon/ai))
data["is_ai"] = 1
else if(istype(user, /mob/living/silicon/robot) && !Adjacent(user))
data["is_ai"] = 1
else
data["is_ai"] = 0
data["output_set"] = power_output
data["output_max"] = max_power_output
data["output_safe"] = max_safe_output
data["output_watts"] = power_output * power_gen
data["temperature_current"] = src.temperature
data["temperature_max"] = src.max_temperature
data["temperature_overheat"] = overheating
// 1 sheet = 1000cm3?
data["fuel_stored"] = round((sheets * 1000) + (sheet_left * 1000))
data["fuel_capacity"] = round(max_sheets * 1000, 0.1)
data["fuel_usage"] = active ? round((power_output / time_per_sheet) * 1000) : 0
data["fuel_type"] = sheet_name
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560)
ui.open()
ui.set_auto_update(1)
/*
/obj/machinery/power/port_gen/pacman/interact(mob/user)
if (get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon/ai))
@@ -335,6 +372,7 @@
dat += "<br><A href='?src=\ref[src];action=close'>Close</A>"
user << browse("[dat]", "window=port_gen")
onclose(user, "port_gen")
*/
/obj/machinery/power/port_gen/pacman/Topic(href, href_list)
if(..())
@@ -346,33 +384,26 @@
if(!active && HasFuel() && !IsBroken())
active = 1
icon_state = "portgen1"
src.updateUsrDialog()
if(href_list["action"] == "disable")
if (active)
active = 0
icon_state = "portgen0"
src.updateUsrDialog()
if(href_list["action"] == "eject")
if(!active)
DropFuel()
src.updateUsrDialog()
if(href_list["action"] == "lower_power")
if (power_output > 1)
power_output--
src.updateUsrDialog()
if (href_list["action"] == "higher_power")
if (power_output < max_power_output || (emagged && power_output < round(max_power_output*2.5)))
power_output++
src.updateUsrDialog()
if (href_list["action"] == "close")
usr << browse(null, "window=port_gen")
usr.unset_machine()
/obj/machinery/power/port_gen/pacman/super
name = "S.U.P.E.R.P.A.C.M.A.N.-type Portable Generator"
desc = "A power generator that utilizes uranium sheets as fuel. Can run for much longer than the standard PACMAN type generators. Rated for 80 kW max safe output."
icon_state = "portgen1"
sheet_path = /obj/item/stack/sheet/mineral/uranium
sheet_name = "Uranium Sheets"
time_per_sheet = 576 //same power output, but a 50 sheet stack will last 2 hours at max safe power
board_path = "/obj/item/weapon/circuitboard/pacman/super"
@@ -399,11 +430,13 @@
desc = "An advanced power generator that runs on tritium. Rated for 200 kW maximum safe output!"
icon_state = "portgen2"
sheet_path = /obj/item/stack/sheet/mineral/tritium
sheet_name = "Tritium Fuel Sheets"
//I don't think tritium has any other use, so we might as well make this rewarding for players
//max safe power output (power level = 8) is 200 kW and lasts for 1 hour - 3 or 4 of these could power the station
power_gen = 25000 //watts
max_power_output = 10
max_safe_output = 8
time_per_sheet = 576
max_temperature = 800
temperature_gain = 90

View File

@@ -63,8 +63,10 @@
if(!src.loc)
return 0
if(!use_power)
return 1
//Don't do this. It allows machines that set use_power to 0 when off (many machines) to
//be turned on again and used after a power failure because they never gain the NOPOWER flag.
//if(!use_power)
// return 1
var/area/A = src.loc.loc // make sure it's in an area
if(!A || !isarea(A) || !A.master)

View File

@@ -315,7 +315,7 @@
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "smes.tmpl", "SMES Power Storage Unit", 540, 380)
ui = new(user, src, ui_key, "smes.tmpl", "SMES Unit", 540, 380)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window

View File

@@ -66,8 +66,10 @@
max_ammo = 10
multiple_sprites = 1
/obj/item/ammo_magazine/mc9mm/empty
max_ammo = 0
/obj/item/ammo_magazine/mc9mm/empty/New()
..()
stored_ammo = list()
update_icon()
/obj/item/ammo_magazine/c9mm
name = "Ammunition Box (9mm)"

View File

@@ -85,7 +85,7 @@
origin_tech = "combat=2;materials=2;syndicate=2"
ammo_type = "/obj/item/ammo_casing/c9mm"
load_method = MAGAZINE
mag_type = /obj/item/ammo_magazine/mc9mm/empty
mag_type = /obj/item/ammo_magazine/mc9mm
/obj/item/weapon/gun/projectile/pistol/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
..()

View File

@@ -1900,8 +1900,8 @@ datum
M.Weaken(2)
M.drowsyness = max(M.drowsyness, 20)
if(50 to INFINITY)
M.Weaken(20)
M.drowsyness = max(M.drowsyness, 30)
M.sleeping = max(M.sleeping, 20)
M.drowsyness = max(M.drowsyness, 60)
data++
..()
return
@@ -1925,10 +1925,11 @@ datum
if(1)
M.confused += 2
M.drowsyness += 2
if(2 to 199)
if(2 to 20)
M.Weaken(30)
if(200 to INFINITY)
M.sleeping += 1
M.eye_blurry = max(M.eye_blurry, 10)
if(20 to INFINITY)
M.sleeping = max(M.sleeping, 30)
..()
return

View File

@@ -698,6 +698,23 @@
reagents.add_reagent("protein", 6)
bitesize = 2
/obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket
name = "\improper Sin-pocket"
desc = "The food of choice for the veteran. Do <B>NOT</B> overconsume."
filling_color = "#6D6D00"
heated_reagents = list("doctorsdelight" = 5, "hyperzine" = 0.75, "synaptizine" = 0.25)
var/has_been_heated = 0
/obj/item/weapon/reagent_containers/food/snacks/donkpocket/sinpocket/attack_self(mob/user)
if(has_been_heated)
user << "<span class='notice'>The heating chemicals have already been spent.</span>"
return
has_been_heated = 1
user.visible_message("<span class='notice'>[user] crushes \the [src] package.</span>", "You crush \the [src] package and feel a comfortable heat build up.")
spawn(200)
user << "You think \the [src] is ready to eat about now."
heat()
/obj/item/weapon/reagent_containers/food/snacks/donkpocket
name = "Donk-pocket"
desc = "The food of choice for the seasoned traitor."
@@ -710,12 +727,22 @@
reagents.add_reagent("protein", 2)
var/warm = 0
proc/cooltime() //Not working, derp?
var/list/heated_reagents = list("tricordrazine" = 5)
proc/heat()
warm = 1
for(var/reagent in heated_reagents)
reagents.add_reagent(reagent, heated_reagents[reagent])
bitesize = 6
name = "Warm " + name
cooltime()
proc/cooltime()
if (src.warm)
spawn(4200)
src.warm = 0
src.reagents.del_reagent("tricordrazine")
src.name = "donk-pocket"
for(var/reagent in heated_reagents)
src.reagents.del_reagent(reagent)
src.name = initial(name)
return
/obj/item/weapon/reagent_containers/food/snacks/brainburger

View File

@@ -190,6 +190,38 @@
..()
reagents.add_reagent("dexalin", 15)
/obj/item/weapon/reagent_containers/pill/dexalin_plus
name = "Dexalin Plus pill"
desc = "Used to treat extreme oxygen deprivation."
icon_state = "pill8"
New()
..()
reagents.add_reagent("dexalin", 15)
/obj/item/weapon/reagent_containers/pill/dermaline
name = "Dermaline pill"
desc = "Used to treat burn wounds."
icon_state = "pill12"
New()
..()
reagents.add_reagent("dermaline", 15)
/obj/item/weapon/reagent_containers/pill/dylovene
name = "Dylovene pill"
desc = "A broad-spectrum anti-toxin."
icon_state = "pill13"
New()
..()
reagents.add_reagent("anti_toxin", 15)
/obj/item/weapon/reagent_containers/pill/inaprovaline
name = "Inaprovaline pill"
desc = "Used to stabilize patients."
icon_state = "pill20"
New()
..()
reagents.add_reagent("inaprovaline", 30)
/obj/item/weapon/reagent_containers/pill/bicaridine
name = "Bicaridine pill"
desc = "Used to treat physical injuries."
@@ -216,3 +248,11 @@
reagents.add_reagent("impedrezene", 10)
reagents.add_reagent("synaptizine", 5)
reagents.add_reagent("hyperzine", 5)
/obj/item/weapon/reagent_containers/pill/spaceacillin
name = "Spaceacillin"
desc = "Contains antiviral agents."
icon_state = "pill19"
New()
..()
reagents.add_reagent("spaceacillin", 15)

View File

@@ -462,10 +462,10 @@
if(prob(75))
I.loc = src
for(var/mob/M in viewers(src))
M.show_message("\the [I] lands in \the [src].", 3)
M.show_message("\The [I] lands in \the [src].", 3)
else
for(var/mob/M in viewers(src))
M.show_message("\the [I] bounces off of \the [src]'s rim!", 3)
M.show_message("\The [I] bounces off of \the [src]'s rim!", 3)
return 0
else
return ..(mover, target, height, air_group)

View File

@@ -5,24 +5,24 @@
icon_state = "gearbelt"
item_state = "utility"
can_hold = list(
"/obj/item/weapon/storage/box/samplebags",
"/obj/item/device/core_sampler",
"/obj/item/device/beacon_locator",
"/obj/item/device/radio/beacon",
"/obj/item/device/gps",
"/obj/item/device/measuring_tape",
"/obj/item/device/flashlight",
"/obj/item/weapon/pickaxe",
"/obj/item/device/depth_scanner",
"/obj/item/device/camera",
"/obj/item/weapon/paper",
"/obj/item/weapon/photo",
"/obj/item/weapon/folder",
"/obj/item/weapon/pen",
"/obj/item/weapon/folder",
"/obj/item/weapon/clipboard",
"/obj/item/weapon/anodevice",
"/obj/item/clothing/glasses",
"/obj/item/weapon/wrench",
"/obj/item/weapon/storage/box/excavation",
"/obj/item/weapon/anobattery")
/obj/item/weapon/storage/box/samplebags,
/obj/item/device/core_sampler,
/obj/item/device/beacon_locator,
/obj/item/device/radio/beacon,
/obj/item/device/gps,
/obj/item/device/measuring_tape,
/obj/item/device/flashlight,
/obj/item/weapon/pickaxe,
/obj/item/device/depth_scanner,
/obj/item/device/camera,
/obj/item/weapon/paper,
/obj/item/weapon/photo,
/obj/item/weapon/folder,
/obj/item/weapon/pen,
/obj/item/weapon/folder,
/obj/item/weapon/clipboard,
/obj/item/weapon/anodevice,
/obj/item/clothing/glasses,
/obj/item/weapon/wrench,
/obj/item/weapon/storage/box/excavation,
/obj/item/weapon/anobattery)

View File

@@ -33,4 +33,4 @@
storage_slots = 50
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
max_w_class = 3
can_hold = list("/obj/item/weapon/fossil")
can_hold = list(/obj/item/weapon/fossil)

View File

@@ -110,13 +110,13 @@
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
storage_slots = 7
w_class = 2
can_hold = list("/obj/item/weapon/pickaxe/brush",\
"/obj/item/weapon/pickaxe/one_pick",\
"/obj/item/weapon/pickaxe/two_pick",\
"/obj/item/weapon/pickaxe/three_pick",\
"/obj/item/weapon/pickaxe/four_pick",\
"/obj/item/weapon/pickaxe/five_pick",\
"/obj/item/weapon/pickaxe/six_pick")
can_hold = list(/obj/item/weapon/pickaxe/brush,\
/obj/item/weapon/pickaxe/one_pick,\
/obj/item/weapon/pickaxe/two_pick,\
/obj/item/weapon/pickaxe/three_pick,\
/obj/item/weapon/pickaxe/four_pick,\
/obj/item/weapon/pickaxe/five_pick,\
/obj/item/weapon/pickaxe/six_pick)
max_combined_w_class = 17
max_w_class = 4
use_to_pickup = 1 // for picking up broken bulbs, not that most people will try

View File

@@ -644,6 +644,7 @@ var/list/be_special_flags = list(
#define COLOR_YELLOW "#FFFF00"
#define COLOR_ORANGE "#FF9900"
#define COLOR_WHITE "#FFFFFF"
#define COLOR_BLACK "#000000"
/*
* Germs and infections.

View File

@@ -56,6 +56,14 @@ should be listed in the changelog upon commit though. Thanks. -->
<!-- DO NOT REMOVE, MOVE, OR COPY THIS COMMENT! THIS MUST BE THE LAST NON-EMPTY LINE BEFORE THE LOGS #ADDTOCHANGELOGMARKER# -->
<div class='commit sansserif'>
<h2 class='date'>12 February 2015</h2>
<h3 class='author'>Daranz updated:</h3>
<ul class='changes bgimages16'>
<li class='rscadd'>Vending machines now use NanoUI and accept cash. The vendor account can now be suspended to disable all sales in all machines on station.</li>
</ul>
</div>
<div class='commit sansserif'>
<h2 class='date'>4 February 2015</h2>
<h3 class='author'>RavingManiac updated:</h3>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

File diff suppressed because it is too large Load Diff

113
nano/templates/pacman.tmpl Normal file
View File

@@ -0,0 +1,113 @@
<h3>Status</h3>
<div class='item'>
<div class="itemLabel">
Generator Status:
</div>
<div class = "itemContent">
{{if data.active}}
<span class="good">Online</span>
{{else}}
<span class="average">Offline</span>
{{/if}}
</div>
<div class="itemLabel">
Generator Control:
</div>
<div class = "itemContent">
{{if data.active}}
{{:helper.link('STOP', 'power', {'action' : "disable"})}}
{{else}}
{{:helper.link('START', 'power', {'action' : "enable"})}}
{{/if}}
</div>
</div>
<h3>Fuel</h3>
<div class='item'>
<div class="itemLabel">
Fuel Type:
</div>
<div class="itemContent">
<span class="good">{{:data.fuel_type}}</span>
</div>
<div class="itemLabel">
Fuel Level:
</div>
<div class="itemContent">
{{if data.fuel_stored >= 5000}}
{{:helper.displayBar(data.fuel_stored, 0, data.fuel_capacity, 'good')}}
<br><span class="good">{{:data.fuel_stored}}/{{:data.fuel_capacity}} cm3</span>
{{else data.fuel_stored >= 1000}}
{{:helper.displayBar(data.fuel_stored, 0, data.fuel_capacity, 'average')}}
<br><span class="average">{{:data.fuel_stored}}/{{:data.fuel_capacity}} cm3</span>
{{else}}
{{:helper.displayBar(data.fuel_stored, 0, data.fuel_capacity, 'bad')}}
<br><span class="bad">{{:data.fuel_stored}}/{{:data.fuel_capacity}} cm3</span>
{{/if}}
</div>
<div class="itemLabel">
Fuel Usage:
</div>
<div class="itemContent">
<span class="good">{{:data.fuel_usage}} cm3/s</span>
</div>
{{if !data.is_ai}}
<div class="itemLabel">
Control:
</div>
<div class="itemContent">
{{:helper.link('EJECT FUEL', 'arrowupthick-1-s', {'action' : "eject"}, data.active ? 'disabled' : null)}}
</div>
{{/if}}
</div>
<h3>Output</h3>
<div class='item'>
<div class="itemLabel">
Power setting:
</div>
<div class="itemContent">
{{if data.output_set > data.output_safe}}
<span class="bad">{{:data.output_set}} / {{:data.output_max}} ({{:data.output_watts}} W)</span>
{{else}}
<span class="good">{{:data.output_set}} / {{:data.output_max}} ({{:data.output_watts}} W)</span>
{{/if}}
</div>
<div class="itemLabel">
Control:
</div>
<div class="itemContent">
{{:helper.link('+', null, {'action' : "higher_power"})}}
{{:helper.link('-', null, {'action' : "lower_power"})}}
</div>
</div>
<h3>Temperature</h3>
<div class='item'>
<div class="itemLabel">
Temperature:
</div>
<div class="itemContent">
{{if data.temperature_current < (data.temperature_max * 0.8)}}
{{:helper.displayBar(data.temperature_current, 0, (data.temperature_max * 1.5), 'good')}}
<br><span class="good">{{:data.temperature_current}} C</span>
{{else data.temperature_current < data.temperature_max}}
{{:helper.displayBar(data.temperature_current, 0, (data.temperature_max * 1.5), 'average')}}
<br><span class="average">{{:data.temperature_current}} C</span>
{{else}}
{{:helper.displayBar(data.temperature_current, 0, (data.temperature_max * 1.5), 'bad')}}
<br><span class="bad">{{:data.temperature_current}} C</span>
{{/if}}
</div>
<div class="itemLabel">
Generator Status:
</div>
<div class="itemContent">
{{if data.temperature_overheat > 50}}
<span class="bad">DANGER: CRITICAL OVERHEAT! Deactivate generator immediately!</span>
{{else data.temperature_overheat > 20}}
<span class="average">WARNING: Overheating!</span>
{{else data.temperature_overheat > 1}}
<span class="average">Temperature High</span>
{{else}}
<span class="good">Optimal</span>
{{/if}}
</div>
</div>

View File

@@ -0,0 +1,56 @@
<!--
Interface for vending machines
See: code/game/machinery/vending.dm
-->
{{if data.mode == 0}} <!-- Listing -->
<h2>Items available</h2>
<div class='item'>
{{for data.products}}
<div class='item'>
<div style='float'>
{{if value.price > 0}}
{{:helper.link('Buy (' + value.price + ')', 'cart', { "vend" : value.key }, value.amount > 0 ? null : 'disabled')}}
{{else}}
{{:helper.link('Vend', 'circle-arrow-s', { "vend" : value.key }, value.amount > 0 ? null : 'disabled')}}
{{/if}}
</div>
<div class='itemContent'>
{{if value.color}}<span style='color:{{:value.color}}'>{{:value.name}}</span>
{{else}}{{:value.name}}
{{/if}}
({{:value.amount ? value.amount : "NONE LEFT"}})
</div>
</div>
{{empty}}
No items available!
{{/for}}
</div>
{{if data.coin}}
<h2>Coin</h2>
<div class='item'>
<div class='itemLabel'>Coin deposited:</div>
<div class='itemContent'>{{:helper.link(data.coin, 'eject', {'remove_coin' : 1})}}</div>
</div>
{{/if}}
{{else data.mode == 1}} <!-- Payment screen -->
<h2>Item selected</h2>
<div class='item'>
<div class='item'>
<div class='itemLabel'>Item selected:</div> <div class='itemContent'>{{:data.product}}</div>
<div class='itemLabel'>Charge:</div> <div class='itemContent'>{{:data.price}}</div>
</div>
<div class='statusDisplay' style='overflow: auto;'>
{{if data.message_err}} <span class='uiIcon16 icon-alert' ></span>{{/if}} {{:data.message}}
</div>
<div class='item'>
{{:helper.link('Cancel', 'arrowreturn-1-w', {'cancelpurchase' : 1})}}
</div>
</div>
{{/if}}
{{if data.panel}}
<h2>Maintenance panel</h2>
<div class='item'>
<div class='itemLabel'>Speaker</div><div class='item'>{{:helper.link(data.speaker ? 'Enabled' : 'Disabled', 'gear', {'togglevoice' : 1})}}</div>
</div>
{{/if}}