From 8085022d97ff922abb24d27e84e9cefc62f18d74 Mon Sep 17 00:00:00 2001 From: BlackMajor Date: Tue, 31 Dec 2019 23:28:30 +1300 Subject: [PATCH] Couple of changes. Starting on the point bank. --- code/game/objects/items/robot/robot_items.dm | 1 + code/game/turfs/simulated/minerals.dm | 3 +- code/modules/mining/equipment/mining_tools.dm | 10 +--- code/modules/mining/point_bank.dm | 49 +++++++++++++++ .../designs/mechfabricator_designs.dm | 11 +++- code/modules/research/techweb/all_nodes.dm | 2 +- tgstation.dme | 1 + tgui/src/interfaces/point_bank.ract | 60 +++++++++++++++++++ 8 files changed, 127 insertions(+), 10 deletions(-) create mode 100644 code/modules/mining/point_bank.dm create mode 100644 tgui/src/interfaces/point_bank.ract diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 8610eafa38..b35c07bcea 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -886,5 +886,6 @@ /obj/item/card/id/miningborg name = "mining point card" + desc = "A robotic ID strip used for claiming and transferring mining points. Must be held in an active slot to transfer points." access = list(ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MAILSORTING, ACCESS_MINERAL_STOREROOM) icon_state = "data_1" \ No newline at end of file diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index a706bb022a..2a060f4452 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -63,9 +63,10 @@ to_chat(user, "You start picking...") if(I.use_tool(src, user, 40, volume=50)) + var/range = I.digrange //Store the current digrange so people don't cheese digspeed swapping for faster mining if(ismineralturf(src)) if(I.digrange > 0) - for(var/turf/closed/mineral/M in range(user,I.digrange)) + for(var/turf/closed/mineral/M in range(user,range)) if(get_dir(user,M)&user.dir) M.gets_drilled() to_chat(user, "You finish cutting into the rock.") diff --git a/code/modules/mining/equipment/mining_tools.dm b/code/modules/mining/equipment/mining_tools.dm index 86c1a86acb..d776628def 100644 --- a/code/modules/mining/equipment/mining_tools.dm +++ b/code/modules/mining/equipment/mining_tools.dm @@ -16,7 +16,7 @@ toolspeed = 1 usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg') attack_verb = list("hit", "pierced", "sliced", "attacked") - var/digrange = 0 + var/digrange = 1 /obj/item/pickaxe/attack_self(mob/user) if(initial(digrange) > 0) @@ -26,7 +26,7 @@ to_chat(user, "You increase the tools dig range, decreasing its mining speed.") else digrange = 0 - toolspeed = toolspeed/3 + toolspeed = toolspeed/2 to_chat(user, "You decrease the tools dig range, increasing its mining speed.") else to_chat(user, "Tool does not have a configureable dig range.") @@ -65,7 +65,6 @@ desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt." force = 19 materials = list(MAT_DIAMOND=4000) - digrange = 1 /obj/item/pickaxe/drill name = "mining drill" @@ -79,10 +78,9 @@ /obj/item/pickaxe/drill/cyborg name = "cyborg mining drill" - desc = "An integrated electric mining drill. Mines in 3 wide" + desc = "An integrated electric mining drill." flags_1 = NONE toolspeed = 0.5 - digrange = 1 /obj/item/pickaxe/drill/cyborg/Initialize() . = ..() @@ -93,7 +91,6 @@ icon_state = "diamonddrill" toolspeed = 0.4 desc = "Yours is the drill that will pierce the heavens!" - digrange = 1 /obj/item/pickaxe/drill/cyborg/diamond //This is the BORG version! name = "diamond-tipped cyborg mining drill" //To inherit the NODROP_1 flag, and easier to change borg specific drill mechanics. @@ -106,7 +103,6 @@ icon_state = "jackhammer" item_state = "jackhammer" w_class = WEIGHT_CLASS_HUGE - digrange = 2 toolspeed = 0.2 //the epitome of powertools. extremely fast mining, laughs at puny walls usesound = 'sound/weapons/sonic_jackhammer.ogg' hitsound = 'sound/weapons/sonic_jackhammer.ogg' diff --git a/code/modules/mining/point_bank.dm b/code/modules/mining/point_bank.dm new file mode 100644 index 0000000000..8d0bb4e1e4 --- /dev/null +++ b/code/modules/mining/point_bank.dm @@ -0,0 +1,49 @@ +/obj/machinery/point_bank + name = "mining point bank" + desc = "A wall mounted machine that can be used to store and transfer mining points. Sharing is caring!" + icon = 'icons/obj/machines/mining_machines.dmi' + icon_state = "ore_redemption" + density = FALSE + req_access = list(ACCESS_MINERAL_STOREROOM) + circuit = null + layer = BELOW_OBJ_LAYER + var/points = 0 + +/obj/machinery/point_bank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "point_bank", "Point Bank", 200, 100, master_ui, state) + ui.open() + +/obj/machinery/point_bank/ui_data(mob/user) + var/list/data = list() + data["totalPoints"] = points + return data + +/obj/machinery/mineral/ore_redemption/ui_act(action, params) + if(..()) + return + switch(action) + if("Claim") + var/mob/M = usr + var/obj/item/card/id/I = M.get_idcard(TRUE) + if(points) + if(I) + I.mining_points += points + points = 0 + else + to_chat(usr, "No ID detected.") + else + to_chat(usr, "No points to claim.") + return TRUE + +/obj/machinery/point_bank/power_change() + ..() + update_icon() + +/obj/machinery/point_bank/update_icon() + if(powered()) + icon_state = initial(icon_state) + else + icon_state = "[initial(icon_state)]-off" + return \ No newline at end of file diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm index a6d0f384b8..5fab7705a8 100644 --- a/code/modules/research/designs/mechfabricator_designs.dm +++ b/code/modules/research/designs/mechfabricator_designs.dm @@ -629,7 +629,16 @@ id = "borg_upgrade_advcutter" build_type = MECHFAB build_path = /obj/item/borg/upgrade/advcutter - materials = list(MAT_METAL=8000, MAT_PLASMA=2000) + materials = list(MAT_METAL=8000, MAT_PLASMA=2000, MAT_GOLD= 2000) + construction_time = 120 + category = list("Cyborg Upgrade Modules") + +/datum/design/borg_upgrade_premiumka + name = "Cyborg Upgrade (Premium Kinetic Accelerator)" + id = "borg_upgrade_premiumka" + build_type = MECHFAB + build_path = /obj/item/borg/upgrade/premiumka + materials = list(MAT_METAL=8000, MAT_GLASS=4000, MAT_TITANIUM=2000) construction_time = 120 category = list("Cyborg Upgrade Modules") diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index d08a486ad5..fb0cdd755e 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -365,7 +365,7 @@ display_name = "Advanced Robotics Research" description = "It can even do the dishes!" prereq_ids = list("robotics") - design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop", "borg_upgrade_advcutter") + design_ids = list("borg_upgrade_diamonddrill", "borg_upgrade_advancedmop", "borg_upgrade_advcutter", "borg_upgrade_premiumka") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000) export_price = 5000 diff --git a/tgstation.dme b/tgstation.dme index 5526e5eaf0..087003423a 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2023,6 +2023,7 @@ #include "code\modules\mining\mint.dm" #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ores_coins.dm" +#include "code\modules\mining\point_bank.dm" #include "code\modules\mining\satchel_ore_boxdm.dm" #include "code\modules\mining\shelters.dm" #include "code\modules\mining\equipment\explorer_gear.dm" diff --git a/tgui/src/interfaces/point_bank.ract b/tgui/src/interfaces/point_bank.ract new file mode 100644 index 0000000000..837a66427a --- /dev/null +++ b/tgui/src/interfaces/point_bank.ract @@ -0,0 +1,60 @@ + + + Current stored points: {{data.totalPoints}} +
+
+ + -All + +
+
+ + -1000 + +
+
+ + -100 + +
+
+ + -10 + +
+
+ + -1 + +
+
+ Transfer Points +
+
+ + +1 + +
+
+ + +10 + +
+
+ + +100 + +
+
+ + +1000 + +
+
+ + +All + +
+
+
+