Merge pull request #4288 from Fox-McCloud/door-wands

Ports Door Wands
This commit is contained in:
TheDZD
2016-04-26 19:31:41 -04:00
10 changed files with 147 additions and 25 deletions
+11 -1
View File
@@ -220,4 +220,14 @@
#define R_HAND_LAYER 28
#define TARGETED_LAYER 29 //BS12: Layer for the target overlay from weapon targeting system
#define FIRE_LAYER 30 //If you're on fire
#define TOTAL_LAYERS 30
#define TOTAL_LAYERS 30
///Access Region Codes///
#define REGION_ALL 0
#define REGION_GENERAL 1
#define REGION_SECURITY 2
#define REGION_MEDBAY 3
#define REGION_RESEARCH 4
#define REGION_ENGINEERING 5
#define REGION_SUPPLY 6
#define REGION_COMMAND 7
+23 -23
View File
@@ -249,43 +249,43 @@
/proc/get_absolutely_all_accesses()
return (get_all_accesses() | get_all_centcom_access() | get_all_syndicate_access() | get_all_misc_access())
/proc/get_region_accesses(var/code)
/proc/get_region_accesses(code)
switch(code)
if(0)
if(REGION_ALL)
return get_all_accesses()
if(1) //security
if(REGION_GENERAL) //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(REGION_SECURITY) //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
if(REGION_MEDBAY) //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
if(REGION_RESEARCH) //research
return list(access_research, access_tox, access_tox_storage, access_genetics, access_robotics, access_xenobiology, access_xenoarch, access_minisat, access_rd)
if(REGION_ENGINEERING) //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
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(REGION_SUPPLY) //supply
return list(access_mailsorting, access_mining, access_mining_station, access_mineral_storeroom, access_cargo, access_qm)
if(REGION_COMMAND) //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)
/proc/get_region_accesses_name(code)
switch(code)
if(0)
if(REGION_ALL)
return "All"
if(1) //security
if(REGION_GENERAL) //station general
return "General"
if(REGION_SECURITY) //security
return "Security"
if(2) //medbay
if(REGION_MEDBAY) //medbay
return "Medbay"
if(3) //research
if(REGION_RESEARCH) //research
return "Research"
if(4) //engineering and maintenance
if(REGION_ENGINEERING) //engineering and maintenance
return "Engineering"
if(5) //command
return "Command"
if(6) //station general
return "Station General"
if(7) //supply
if(REGION_SUPPLY) //supply
return "Supply"
if(REGION_COMMAND) //command
return "Command"
/proc/get_access_desc(A)
+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 = REGION_ALL
/obj/item/weapon/door_remote/captain
name = "command door remote"
icon_state = "gangtool-yellow"
region_access = REGION_COMMAND
/obj/item/weapon/door_remote/chief_engineer
name = "engineering door remote"
icon_state = "gangtool-orange"
region_access = REGION_ENGINEERING
/obj/item/weapon/door_remote/research_director
name = "research door remote"
icon_state = "gangtool-purple"
region_access = REGION_RESEARCH
/obj/item/weapon/door_remote/head_of_security
name = "security door remote"
icon_state = "gangtool-red"
region_access = REGION_SECURITY
/obj/item/weapon/door_remote/quartermaster
name = "supply door remote"
icon_state = "gangtool-green"
region_access = REGION_SUPPLY
/obj/item/weapon/door_remote/chief_medical_officer
name = "medical door remote"
icon_state = "gangtool-blue"
region_access = REGION_MEDBAY
/obj/item/weapon/door_remote/civillian
name = "civillian door remote"
icon_state = "gangtool-white"
region_access = REGION_GENERAL
#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
@@ -699,6 +699,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"