From 6fb8aa7ee1d4bae05b439261c2f9c14a6137e705 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Wed, 24 May 2017 16:32:43 -0500 Subject: [PATCH 1/2] Adds marker beacons to mining as a vendible item --- code/__DEFINES/lighting.dm | 2 + code/modules/jobs/job_types/cargo_service.dm | 6 +- .../mining/equipment/marker_beacons.dm | 142 ++++++++++++++++++ code/modules/mining/machine_vending.dm | 4 + tgstation.dme.rej | 9 ++ 5 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 code/modules/mining/equipment/marker_beacons.dm create mode 100644 tgstation.dme.rej diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index 7cfed2b483..6d7c9568a9 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -51,8 +51,10 @@ #define LIGHT_COLOR_GREEN "#64C864" //Bright but quickly dissipating neon green. rgb(100, 200, 100) #define LIGHT_COLOR_BLUE "#6496FA" //Cold, diluted blue. rgb(100, 150, 250) +#define LIGHT_COLOR_BLUEGREEN "#7DE1AF" //Light blueish green. rgb(125, 225, 175) #define LIGHT_COLOR_CYAN "#7DE1E1" //Diluted cyan. rgb(125, 225, 225) #define LIGHT_COLOR_LIGHT_CYAN "#40CEFF" //More-saturated cyan. rgb(64, 206, 255) +#define LIGHT_COLOR_DARK_BLUE "#6496FA" //Saturated blue. rgb(51, 117, 248) #define LIGHT_COLOR_PINK "#E17DE1" //Diluted, mid-warmth pink. rgb(225, 125, 225) #define LIGHT_COLOR_YELLOW "#E1E17D" //Dimmed yellow, leaning kaki. rgb(225, 225, 125) #define LIGHT_COLOR_BROWN "#966432" //Clear brown, mostly dim. rgb(150, 100, 50) diff --git a/code/modules/jobs/job_types/cargo_service.dm b/code/modules/jobs/job_types/cargo_service.dm index b606000ef4..18c26349fb 100644 --- a/code/modules/jobs/job_types/cargo_service.dm +++ b/code/modules/jobs/job_types/cargo_service.dm @@ -89,7 +89,8 @@ Shaft Miner backpack_contents = list( /obj/item/weapon/storage/bag/ore=1,\ /obj/item/weapon/kitchen/knife/combat/survival=1,\ - /obj/item/weapon/mining_voucher=1) + /obj/item/weapon/mining_voucher=1,\ + /obj/item/stack/marker_beacon/ten=1) backpack = /obj/item/weapon/storage/backpack/explorer satchel = /obj/item/weapon/storage/backpack/satchel/explorer @@ -113,7 +114,8 @@ Shaft Miner /obj/item/weapon/kitchen/knife/combat/survival=1, /obj/item/weapon/mining_voucher=1, /obj/item/device/t_scanner/adv_mining_scanner/lesser=1, - /obj/item/weapon/gun/energy/kinetic_accelerator=1) + /obj/item/weapon/gun/energy/kinetic_accelerator=1,\ + /obj/item/stack/marker_beacon/ten=1) /datum/outfit/job/miner/equipped/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) ..() diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm new file mode 100644 index 0000000000..2770897c34 --- /dev/null +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -0,0 +1,142 @@ +/*****************Marker Beacons**************************/ +GLOBAL_LIST_INIT(marker_beacon_colors, list( +"Random" = FALSE,//not a true color, will pick a random color +"Burgundy" = LIGHT_COLOR_FLARE, +"Bronze" = LIGHT_COLOR_ORANGE, +"Yellow" = LIGHT_COLOR_YELLOW, +"Lime" = LIGHT_COLOR_SLIME_LAMP, +"Olive" = LIGHT_COLOR_GREEN, +"Jade" = LIGHT_COLOR_BLUEGREEN, +"Teal" = LIGHT_COLOR_LIGHT_CYAN, +"Cerulean" = LIGHT_COLOR_BLUE, +"Indigo" = LIGHT_COLOR_DARK_BLUE, +"Purple" = LIGHT_COLOR_PURPLE, +"Violet" = LIGHT_COLOR_LAVENDER, +"Fuchsia" = LIGHT_COLOR_PINK)) + +/obj/item/stack/marker_beacon + name = "marker beacon" + singular_name = "marker beacon" + desc = "Prism-brand path illumination devices. Used by miners to mark paths and warn of danger." + icon = 'icons/obj/lighting.dmi' + icon_state = "marker" + merge_type = /obj/item/stack/marker_beacon + max_amount = 100 + var/picked_color = "random" + +/obj/item/stack/marker_beacon/ten //miners start with 10 of these + amount = 10 + +/obj/item/stack/marker_beacon/thirty //and they're bought in stacks of 1, 10, or 30 + amount = 30 + +/obj/item/stack/marker_beacon/Initialize(mapload) + . = ..() + update_icon() + +/obj/item/stack/marker_beacon/examine(mob/user) + ..() + to_chat(user, "Use in-hand to place a [singular_name].") + to_chat(user, "Alt-click to select a color. Current color is [picked_color].") + +/obj/item/stack/marker_beacon/update_icon() + icon_state = "[initial(icon_state)][lowertext(picked_color)]" + +/obj/item/stack/marker_beacon/attack_self(mob/user) + if(!isturf(user.loc)) + to_chat(user, "You need more space to place a [singular_name] here.") + return + if(locate(/obj/structure/marker_beacon) in user.loc) + to_chat(user, "There is already a [singular_name] here.") + return + if(use(1)) + to_chat(user, "You activate and anchor [amount ? "a":"the"] [singular_name] in place.") + playsound(user, 'sound/machines/click.ogg', 50, 1) + var/obj/structure/marker_beacon/M = new(user.loc, picked_color) + transfer_fingerprints_to(M) + +/obj/item/stack/marker_beacon/AltClick(mob/user) + if(user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user)) + return + var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors + if(user.incapacitated() || !in_range(src, user)) + return + if(input_color) + picked_color = input_color + update_icon() + +/obj/structure/marker_beacon + name = "marker beacon" + desc = "A Prism-brand path illumination device. It is anchored in place and glowing steadily." + icon = 'icons/obj/lighting.dmi' + icon_state = "marker" + layer = BELOW_OPEN_DOOR_LAYER + armor = list(melee = 50, bullet = 75, laser = 75, energy = 75, bomb = 25, bio = 100, rad = 100, fire = 25, acid = 0) + obj_integrity = 50 + max_integrity = 50 + anchored = TRUE + light_range = 2 + light_power = 3 + var/remove_speed = 15 + var/picked_color + +/obj/structure/marker_beacon/Initialize(mapload, set_color) + . = ..() + picked_color = set_color + update_icon() + +/obj/structure/marker_beacon/deconstruct(disassembled = TRUE) + if(!(flags & NODECONSTRUCT)) + var/obj/item/stack/marker_beacon/M = new(loc) + M.picked_color = picked_color + M.update_icon() + qdel(src) + +/obj/structure/marker_beacon/examine(mob/user) + ..() + to_chat(user, "Alt-click to select a color. Current color is [picked_color].") + +/obj/structure/marker_beacon/update_icon() + while(!picked_color || !GLOB.marker_beacon_colors[picked_color]) + picked_color = pick(GLOB.marker_beacon_colors) + icon_state = "[initial(icon_state)][lowertext(picked_color)]-on" + set_light(light_range, light_power, GLOB.marker_beacon_colors[picked_color]) + +/obj/structure/marker_beacon/attack_hand(mob/living/user) + to_chat(user, "You start picking [src] up...") + if(do_after(user, remove_speed, target = src)) + var/obj/item/stack/marker_beacon/M = new(loc) + M.picked_color = picked_color + M.update_icon() + transfer_fingerprints_to(M) + if(user.put_in_hands(M, TRUE)) //delete the beacon if it fails + playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) + qdel(src) //otherwise delete us + +/obj/structure/marker_beacon/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/stack/marker_beacon)) + var/obj/item/stack/marker_beacon/M = I + to_chat(user, "You start picking [src] up...") + if(do_after(user, remove_speed, target = src) && M.amount + 1 <= M.max_amount) + M.add(1) + playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) + qdel(src) + else + return ..() + +/obj/structure/marker_beacon/AltClick(mob/user) + ..() + if(user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user)) + return + var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors + if(user.incapacitated() || !in_range(src, user)) + return + if(input_color) + picked_color = input_color + update_icon() diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 371fb11fec..5e3064eeb5 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -9,6 +9,9 @@ anchored = 1 var/obj/item/weapon/card/id/inserted_id var/list/prize_list = list( //if you add something to this, please, for the love of god, use tabs and not spaces. + new /datum/data/mining_equipment("1 Marker Beacon", /obj/item/stack/marker_beacon, 10), + new /datum/data/mining_equipment("10 Marker Beacons", /obj/item/stack/marker_beacon/ten, 100), + new /datum/data/mining_equipment("30 Marker Beacons", /obj/item/stack/marker_beacon/thirty, 300), new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 100), new /datum/data/mining_equipment("Absinthe", /obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe/premium,100), new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150), @@ -182,6 +185,7 @@ if("Extraction and Rescue Kit") new /obj/item/weapon/extraction_pack(loc) new /obj/item/fulton_core(loc) + new /obj/item/stack/marker_beacon/thirty(loc) if("Crusher Kit") new /obj/item/weapon/twohanded/required/mining_hammer(loc) new /obj/item/weapon/storage/belt/mining/alt(loc) diff --git a/tgstation.dme.rej b/tgstation.dme.rej new file mode 100644 index 0000000000..1c849ddc28 --- /dev/null +++ b/tgstation.dme.rej @@ -0,0 +1,9 @@ +diff a/tgstation.dme b/tgstation.dme (rejected hunks) +@@ -1444,6 +1444,7 @@ + #include "code\modules\mining\ores_coins.dm" + #include "code\modules\mining\satchel_ore_boxdm.dm" + #include "code\modules\mining\shelters.dm" ++#include "code\modules\mining\equipment\marker_beacons.dm" + #include "code\modules\mining\laborcamp\laborshuttle.dm" + #include "code\modules\mining\laborcamp\laborstacker.dm" + #include "code\modules\mining\lavaland\ash_flora.dm" From 4cecb15ffc7bfec94f42f10dbb9122de945a1ea1 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 30 May 2017 14:23:25 -0500 Subject: [PATCH 2/2] beacons --- tgstation.dme | 1 + tgstation.dme.rej | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 tgstation.dme.rej diff --git a/tgstation.dme b/tgstation.dme index f61256862c..328469038f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1490,6 +1490,7 @@ #include "code\modules\mining\equipment\explorer_gear.dm" #include "code\modules\mining\equipment\kinetic_crusher.dm" #include "code\modules\mining\equipment\lazarus_injector.dm" +#include "code\modules\mining\equipment\marker_beacons.dm" #include "code\modules\mining\equipment\mineral_scanner.dm" #include "code\modules\mining\equipment\resonator.dm" #include "code\modules\mining\equipment\vendor_items.dm" diff --git a/tgstation.dme.rej b/tgstation.dme.rej deleted file mode 100644 index 1c849ddc28..0000000000 --- a/tgstation.dme.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/tgstation.dme b/tgstation.dme (rejected hunks) -@@ -1444,6 +1444,7 @@ - #include "code\modules\mining\ores_coins.dm" - #include "code\modules\mining\satchel_ore_boxdm.dm" - #include "code\modules\mining\shelters.dm" -+#include "code\modules\mining\equipment\marker_beacons.dm" - #include "code\modules\mining\laborcamp\laborshuttle.dm" - #include "code\modules\mining\laborcamp\laborstacker.dm" - #include "code\modules\mining\lavaland\ash_flora.dm"