Ports Door Wands

This commit is contained in:
Fox-McCloud
2016-04-25 06:06:20 -04:00
parent a190c4131c
commit c587019b87
9 changed files with 125 additions and 13 deletions
+12 -12
View File
@@ -253,20 +253,20 @@
switch(code)
if(0)
return get_all_accesses()
if(1) //security
return list(access_sec_doors, access_weapons, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_pilot, access_hos)
if(2) //medbay
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_psychiatrist, access_virology, access_surgery, access_cmo, access_paramedic)
if(3) //research
return list(access_research, access_tox, access_tox_storage, access_robotics, access_xenobiology, access_xenoarch, access_minisat, access_rd)
if(4) //engineering and maintenance
return list(access_construction, access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_minisat, access_ce, access_mechanic)
if(5) //command
return list(access_heads, access_RC_announce, access_keycard_auth, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_tcomsat, access_gateway, access_all_personal_lockers, access_heads_vault, access_blueshield, access_ntrep, access_hop, access_captain)
if(6) //station general
if(1) //station general
return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_magistrate, access_clown, access_mime)
if(7) //supply
if(2) //security
return list(access_sec_doors, access_weapons, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_pilot, access_hos)
if(3) //medbay
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_psychiatrist, access_virology, access_surgery, access_cmo, access_paramedic)
if(4) //research
return list(access_research, access_tox, access_tox_storage, access_genetics, access_robotics, access_xenobiology, access_xenoarch, access_minisat, access_rd)
if(5) //engineering and maintenance
return list(access_construction, access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_minisat, access_ce, access_mechanic)
if(6) //supply
return list(access_mailsorting, access_mining, access_mining_station, access_mineral_storeroom, access_cargo, access_qm)
if(7) //command
return list(access_heads, access_RC_announce, access_keycard_auth, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_tcomsat, access_gateway, access_all_personal_lockers, access_heads_vault, access_blueshield, access_ntrep, access_hop, access_captain)
/proc/get_region_accesses_name(var/code)
switch(code)
+104
View File
@@ -0,0 +1,104 @@
#define WAND_OPEN "Open Door"
#define WAND_BOLT "Toggle Bolts"
#define WAND_EMERGENCY "Toggle Emergency Access"
/obj/item/weapon/door_remote
icon_state = "gangtool-white"
item_state = "electronic"
icon = 'icons/obj/device.dmi'
name = "control wand"
desc = "Remotely controls airlocks."
w_class = 1
var/mode = WAND_OPEN
var/region_access = 1 //See access.dm
var/obj/item/weapon/card/id/ID
/obj/item/weapon/door_remote/New()
..()
ID = new /obj/item/weapon/card/id
ID.access = get_region_accesses(region_access)
/obj/item/weapon/door_remote/attack_self(mob/user)
switch(mode)
if(WAND_OPEN)
mode = WAND_BOLT
if(WAND_BOLT)
mode = WAND_EMERGENCY
if(WAND_EMERGENCY)
mode = WAND_OPEN
to_chat(user, "Now in mode: [mode].")
/obj/item/weapon/door_remote/afterattack(obj/machinery/door/airlock/D, mob/user)
if(!istype(D))
return
if(!(D.arePowerSystemsOn()))
to_chat(user, "<span class='danger'>[D] has no power!</span>")
return
if(!D.requiresID())
to_chat(user, "<span class='danger'>[D]'s ID scan is disabled!</span>")
return
if(D.check_access(src.ID))
switch(mode)
if(WAND_OPEN)
if(D.density)
D.open()
else
D.close()
if(WAND_BOLT)
if(D.locked)
D.unlock()
else
D.lock()
if(WAND_EMERGENCY)
if(D.emergency)
D.emergency = 0
else
D.emergency = 1
D.update_icon()
else
to_chat(user, "<span class='danger'>[src] does not have access to this door.</span>")
/obj/item/weapon/door_remote/omni
name = "omni door remote"
desc = "This control wand can access any door on the station."
icon_state = "gangtool-yellow"
region_access = 0
/obj/item/weapon/door_remote/captain
name = "command door remote"
icon_state = "gangtool-yellow"
region_access = 7
/obj/item/weapon/door_remote/chief_engineer
name = "engineering door remote"
icon_state = "gangtool-orange"
region_access = 5
/obj/item/weapon/door_remote/research_director
name = "research door remote"
icon_state = "gangtool-purple"
region_access = 4
/obj/item/weapon/door_remote/head_of_security
name = "security door remote"
icon_state = "gangtool-red"
region_access = 2
/obj/item/weapon/door_remote/quartermaster
name = "supply door remote"
icon_state = "gangtool-green"
region_access = 6
/obj/item/weapon/door_remote/chief_medical_officer
name = "medical door remote"
icon_state = "gangtool-blue"
region_access = 3
/obj/item/weapon/door_remote/civillian
name = "civillian door remote"
icon_state = "gangtool-white"
region_access = 1
#undef WAND_OPEN
#undef WAND_BOLT
#undef WAND_EMERGENCY
@@ -39,4 +39,5 @@
new /obj/item/weapon/tank/emergency_oxygen(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson(src)
new /obj/item/clothing/head/soft(src)
new /obj/item/clothing/head/soft(src)
new /obj/item/weapon/door_remote/quartermaster(src)
@@ -31,6 +31,7 @@
new /obj/item/device/flash(src)
new /obj/item/taperoll/engineering(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/weapon/door_remote/chief_engineer(src)
/obj/structure/closet/secure_closet/engineering_electrical
name = "electrical supplies locker"
@@ -175,6 +175,7 @@
new /obj/item/device/flash(src)
new /obj/item/weapon/reagent_containers/hypospray/CMO(src)
new /obj/item/organ/internal/cyberimp/eyes/hud/medical(src)
new /obj/item/weapon/door_remote/chief_medical_officer(src)
@@ -49,6 +49,7 @@
new /obj/item/clothing/suit/armor/reactive(src)
new /obj/item/device/flash(src)
new /obj/item/device/laser_pointer(src)
new /obj/item/weapon/door_remote/research_director(src)
/obj/structure/closet/secure_closet/research_reagents
name = "research chemical storage closet"
@@ -26,6 +26,7 @@
new /obj/item/device/radio/headset/heads/captain/alt(src)
new /obj/item/clothing/gloves/color/captain(src)
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/weapon/door_remote/captain(src)
@@ -52,6 +53,7 @@
new /obj/item/device/flash(src)
new /obj/item/weapon/mining_voucher(src)
new /obj/item/clothing/accessory/petcollar(src)
new /obj/item/weapon/door_remote/civillian(src)
/obj/structure/closet/secure_closet/hop2
name = "head of personnel's attire"
@@ -114,6 +116,7 @@
new /obj/item/weapon/storage/belt/security/sec(src)
new /obj/item/taperoll/police(src)
new /obj/item/weapon/gun/energy/hos(src)
new /obj/item/weapon/door_remote/head_of_security(src)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 33 KiB

+1
View File
@@ -698,6 +698,7 @@
#include "code\game\objects\items\candle.dm"
#include "code\game\objects\items\changestone.dm"
#include "code\game\objects\items\contraband.dm"
#include "code\game\objects\items\control_wand.dm"
#include "code\game\objects\items\crayons.dm"
#include "code\game\objects\items\dehy_carp.dm"
#include "code\game\objects\items\documents.dm"