From aa5fec0bd88046cb035cb7410f62f400b45dd80a Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Fri, 28 Apr 2017 06:13:42 -0500 Subject: [PATCH] Abductor fixes and tweaks --- .../miniantags/abduction/abduction_gear.dm | 75 ++++++++++++++----- .../miniantags/abduction/abduction_outfits.dm | 12 +-- .../miniantags/abduction/machinery/console.dm | 72 ++++++++++-------- .../abduction/machinery/dispenser.dm | 4 +- 4 files changed, 105 insertions(+), 58 deletions(-) diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index e6365d5e65..d7ab46cb9c 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -14,6 +14,13 @@ origin_tech = "magnets=7;biotech=4;powerstorage=4;abductor=4" armor = list(melee = 15, bullet = 15, laser = 15, energy = 15, bomb = 15, bio = 15, rad = 15, fire = 70, acid = 70) actions_types = list(/datum/action/item_action/hands_free/activate) + allowed = list( + /obj/item/device/abductor, + /obj/item/weapon/abductor_baton, + /obj/item/weapon/melee/baton, + /obj/item/weapon/gun/energy, + /obj/item/weapon/restraints/handcuffs + ) var/mode = VEST_STEALTH var/stealth_active = 0 var/combat_cooldown = 10 @@ -21,6 +28,11 @@ var/stealth_armor = list(melee = 15, bullet = 15, laser = 15, energy = 15, bomb = 15, bio = 15, rad = 15, fire = 70, acid = 70) var/combat_armor = list(melee = 50, bullet = 50, laser = 50, energy = 50, bomb = 50, bio = 50, rad = 50, fire = 90, acid = 90) +/obj/item/clothing/suit/armor/abductor/vest/proc/toggle_nodrop() + flags ^= NODROP + if(ismob(loc)) + to_chat(loc, "Your vest is now [flags & NODROP ? "locked" : "unlocked"].") + /obj/item/clothing/suit/armor/abductor/vest/proc/flip_mode() switch(mode) if(VEST_STEALTH) @@ -107,6 +119,18 @@ if(combat_cooldown==initial(combat_cooldown)) STOP_PROCESSING(SSobj, src) +/obj/item/clothing/suit/armor/abductor/Destroy() + STOP_PROCESSING(SSobj, src) + for(var/obj/machinery/abductor/console/C in GLOB.machines) + if(C.vest == src) + C.vest = null + break + . = ..() + + +/obj/item/device/abductor + icon = 'icons/obj/abductor.dmi' + /obj/item/device/abductor/proc/AbductorCheck(user) if(isabductor(user)) return TRUE @@ -114,14 +138,19 @@ return FALSE /obj/item/device/abductor/proc/ScientistCheck(user) + if(!AbductorCheck(user)) + return FALSE + var/mob/living/carbon/human/H = user var/datum/species/abductor/S = H.dna.species - return S.scientist + if(S.scientist) + return TRUE + to_chat(user, "You're not trained to use this!") + return FALSE /obj/item/device/abductor/gizmo name = "science tool" desc = "A dual-mode tool for retrieving specimens and scanning appearances. Scanning can be done through cameras." - icon = 'icons/obj/abductor.dmi' icon_state = "gizmo_scan" item_state = "silencer" origin_tech = "engineering=7;magnets=4;bluespace=4;abductor=3" @@ -130,11 +159,12 @@ var/obj/machinery/abductor/console/console /obj/item/device/abductor/gizmo/attack_self(mob/user) - if(!AbductorCheck(user)) - return if(!ScientistCheck(user)) - to_chat(user, "You're not trained to use this!") return + if(!console) + to_chat(user, "The device is not linked to console!") + return + if(mode == GIZMO_SCAN) mode = GIZMO_MARK icon_state = "gizmo_mark" @@ -144,11 +174,12 @@ to_chat(user, "You switch the device to [mode==GIZMO_SCAN? "SCAN": "MARK"] MODE") /obj/item/device/abductor/gizmo/attack(mob/living/M, mob/user) - if(!AbductorCheck(user)) - return if(!ScientistCheck(user)) - to_chat(user, "You're not trained to use this") return + if(!console) + to_chat(user, "The device is not linked to console!") + return + switch(mode) if(GIZMO_SCAN) scan(M, user) @@ -159,11 +190,12 @@ /obj/item/device/abductor/gizmo/afterattack(atom/target, mob/living/user, flag, params) if(flag) return - if(!AbductorCheck(user)) - return if(!ScientistCheck(user)) - to_chat(user, "You're not trained to use this") return + if(!console) + to_chat(user, "The device is not linked to console!") + return + switch(mode) if(GIZMO_SCAN) scan(target, user) @@ -172,9 +204,8 @@ /obj/item/device/abductor/gizmo/proc/scan(atom/target, mob/living/user) if(ishuman(target)) - if(console!=null) - console.AddSnapshot(target) - to_chat(user, "You scan [target] and add them to the database.") + console.AddSnapshot(target) + to_chat(user, "You scan [target] and add them to the database.") /obj/item/device/abductor/gizmo/proc/mark(atom/target, mob/living/user) if(marked == target) @@ -198,11 +229,15 @@ marked = target to_chat(user, "You finish preparing [target] for transport.") +/obj/item/device/abductor/gizmo/Destroy() + if(console) + console.gizmo = null + . = ..() + /obj/item/device/abductor/silencer name = "abductor silencer" desc = "A compact device used to shut down communications equipment." - icon = 'icons/obj/abductor.dmi' icon_state = "silencer" item_state = "gizmo" origin_tech = "materials=4;programming=7;abductor=3" @@ -419,10 +454,10 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(!C.handcuffed) C.handcuffed = new /obj/item/weapon/restraints/handcuffs/energy/used(C) C.update_handcuffed() - to_chat(user, "You handcuff [C].") + to_chat(user, "You restrain [C].") add_logs(user, C, "handcuffed") else - to_chat(user, "You fail to handcuff [C].") + to_chat(user, "You fail to restrain [C].") else to_chat(user, "[C] doesn't have two hands...") @@ -471,11 +506,11 @@ Congratulations! You are now trained for invasive xenobiology research!"} ..() switch(mode) if(BATON_STUN) - user <<"The baton is in stun mode." + to_chat(user, "The baton is in stun mode.") if(BATON_SLEEP) - user <<"The baton is in sleep inducement mode." + to_chat(user, "The baton is in sleep inducement mode.") if(BATON_CUFF) - user <<"The baton is in restraining mode." + to_chat(user, "The baton is in restraining mode.") if(BATON_PROBE) to_chat(user, "The baton is in probing mode.") diff --git a/code/game/gamemodes/miniantags/abduction/abduction_outfits.dm b/code/game/gamemodes/miniantags/abduction/abduction_outfits.dm index 100c485263..c92fdddf26 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_outfits.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_outfits.dm @@ -22,13 +22,13 @@ if(console) var/obj/item/clothing/suit/armor/abductor/vest/V = locate() in H if(V) - console.vest = V + console.AddVest(V) V.flags |= NODROP - var/obj/item/device/abductor/gizmo/G = locate() in H.getBackSlot() - if(G) - console.gizmo = G - G.console = console + var/obj/item/weapon/storage/backpack/B = locate() in H + if(B) + for(var/obj/item/device/abductor/gizmo/G in B.contents) + console.AddGizmo(G) /datum/outfit/abductor/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) ..() @@ -40,10 +40,10 @@ name = "Abductor Agent" head = /obj/item/clothing/head/helmet/abductor suit = /obj/item/clothing/suit/armor/abductor/vest + suit_store = /obj/item/weapon/abductor_baton belt = /obj/item/weapon/storage/belt/military/abductor/full backpack_contents = list( - /obj/item/weapon/abductor_baton = 1, /obj/item/weapon/gun/energy/alien = 1, /obj/item/device/abductor/silencer = 1 ) diff --git a/code/game/gamemodes/miniantags/abduction/machinery/console.dm b/code/game/gamemodes/miniantags/abduction/machinery/console.dm index 2a23c37444..c569ac00cc 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/console.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/console.dm @@ -7,7 +7,7 @@ //Console /obj/machinery/abductor/console - name = "Abductor console" + name = "abductor console" desc = "Ship command center." icon = 'icons/obj/abductor.dmi' icon_state = "console" @@ -32,7 +32,7 @@ var/dat = "" dat += "

Abductsoft 3000

" - if(experiment != null) + if(experiment) var/points = experiment.points var/credits = experiment.credits dat += "Collected Samples : [points]
" @@ -46,18 +46,18 @@ else dat += "NO EXPERIMENT MACHINE DETECTED
" - if(pad!=null) + if(pad) dat += "Emergency Teleporter System." dat += "Consider using primary observation console first." dat += "Activate Teleporter
" - if(gizmo!=null && gizmo.marked!=null) + if(gizmo && gizmo.marked) dat += "Retrieve Mark
" else dat += "Retrieve Mark
" else dat += "NO TELEPAD DETECTED
" - if(vest!=null) + if(vest) dat += "

Agent Vest Mode


" var/mode = vest.mode if(mode == VEST_STEALTH) @@ -88,7 +88,8 @@ else if(href_list["flip_vest"]) FlipVest() else if(href_list["toggle_vest"]) - toggle_vest() + if(vest) + vest.toggle_nodrop() else if(href_list["select_disguise"]) SelectDisguise() else if(href_list["dispense"]) @@ -105,23 +106,22 @@ Dispense(/obj/item/clothing/suit/armor/abductor/vest) updateUsrDialog() - /obj/machinery/abductor/console/proc/TeleporterRetrieve() - if(gizmo!=null && pad!=null && gizmo.marked) + if(pad && gizmo && gizmo.marked) pad.Retrieve(gizmo.marked) /obj/machinery/abductor/console/proc/TeleporterSend() - if(pad!=null) + if(pad) pad.Send() /obj/machinery/abductor/console/proc/FlipVest() - if(vest!=null) + if(vest) vest.flip_mode() /obj/machinery/abductor/console/proc/SelectDisguise(remote = 0) var/entry_name = input( "Choose Disguise", "Disguise") as null|anything in disguises var/datum/icon_snapshot/chosen = disguises[entry_name] - if(chosen && (remote || in_range(usr,src))) + if(chosen && vest && (remote || in_range(usr,src))) vest.SetDisguise(chosen) /obj/machinery/abductor/console/proc/SetDroppoint(turf/open/location,user) @@ -169,36 +169,48 @@ return disguises[entry.name] = entry +/obj/machinery/abductor/console/proc/AddGizmo(obj/item/device/abductor/gizmo/G) + if(G == gizmo && G.console == src) + return FALSE + + if(G.console) + G.console.gizmo = null + + gizmo = G + G.console = src + return TRUE + +/obj/machinery/abductor/console/proc/AddVest(obj/item/clothing/suit/armor/abductor/vest/V) + if(vest == V) + return FALSE + + for(var/obj/machinery/abductor/console/C in GLOB.machines) + if(C.vest == V) + C.vest = null + break + + vest = V + return TRUE + /obj/machinery/abductor/console/attackby(obj/O, mob/user, params) - if(istype(O, /obj/item/device/abductor/gizmo)) - var/obj/item/device/abductor/gizmo/G = O + if(istype(O, /obj/item/device/abductor/gizmo) && AddGizmo(O)) to_chat(user, "You link the tool to the console.") - gizmo = G - G.console = src - else if(istype(O, /obj/item/clothing/suit/armor/abductor/vest)) - var/obj/item/clothing/suit/armor/abductor/vest/V = O + else if(istype(O, /obj/item/clothing/suit/armor/abductor/vest) && AddVest(O)) to_chat(user, "You link the vest to the console.") - if(istype(vest)) - if(vest.flags & NODROP) - toggle_vest() - vest = V else return ..() + + /obj/machinery/abductor/console/proc/Dispense(item,cost=1) if(experiment && experiment.credits >= cost) experiment.credits -=cost say("Incoming supply!") + var/drop_location = loc if(pad) flick("alien-pad", pad) - new item(pad.loc) - else - new item(loc) + drop_location = pad.loc + new item(drop_location) + else say("Insufficent data!") - -/obj/machinery/abductor/console/proc/toggle_vest() - vest.flags ^= NODROP - var/mob/M = vest.loc - if(istype(M)) - to_chat(M, "[src] is now [vest.flags & NODROP ? "locked" : "unlocked"].") diff --git a/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm b/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm index d006ba0f68..8cf9acac0b 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm @@ -1,5 +1,5 @@ /obj/machinery/abductor/gland_dispenser - name = "Replacement Organ Storage" + name = "replacement organ storage" desc = "A tank filled with replacement organs." icon = 'icons/obj/abductor.dmi' icon_state = "dispenser" @@ -49,7 +49,7 @@ var/g_color = gland_colors[i] var/amount = amounts[i] dat += "[amount]" - if(item_count == 3) // Three boxes per line + if(item_count == 4) // Four boxes per line dat +="

" item_count = 0 var/datum/browser/popup = new(user, "glands", "Gland Dispenser", 200, 200)