From 4f17f09ee961e364e80c1ae51f09dfd3491db20b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 7 Aug 2022 17:43:24 +0200 Subject: [PATCH] [MIRROR] mining modsuit changes [MDB IGNORE] (#15452) * mining modsuit changes (#69011) the mining modsuit now costs 3000 from 2500 the mining modsuit now still slows you down over lava, though you still resist it the plasma core now accepts plasma both in sheet form and ore form the plasma core should no longer buggily not refill you the mining modsuit bombs should now have enemies target you * mining modsuit changes Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> --- code/__HELPERS/_lists.dm | 2 +- code/_onclick/hud/alert.dm | 4 ++-- code/modules/mining/machine_vending.dm | 2 +- code/modules/mod/mod_core.dm | 15 ++++++++------- code/modules/mod/modules/modules_supply.dm | 21 +++++++++++++++------ 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 178624560a8..7bc9d165ba8 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -206,7 +206,7 @@ * Arguments: * - [type_to_check][/datum]: An instance to check. * - [list_to_check][/list]: A list of typepaths to check the type_to_check against. - * - zebra: Whether to use the value of the mathing type in the list instead of just returning true when a match is found. + * - zebra: Whether to use the value of the matching type in the list instead of just returning true when a match is found. */ /proc/is_type_in_list(datum/type_to_check, list/list_to_check, zebra = FALSE) if(!LAZYLEN(list_to_check) || !type_to_check) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 6c424d01d8e..88ce60cf904 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -648,7 +648,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." /atom/movable/screen/alert/emptycell/plasma name = "Out of Power" desc = "Unit's plasma core has no charge remaining. No modules available until plasma core is recharged. \ - Unit can be refilled through plasma ore." + Unit can be refilled through plasma fuel." /atom/movable/screen/alert/emptycell/plasma/update_desc() . = ..() @@ -656,7 +656,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." /atom/movable/screen/alert/lowcell/plasma name = "Low Charge" - desc = "Unit's plasma core is running low. Unit can be refilled through plasma ore." + desc = "Unit's plasma core is running low. Unit can be refilled through plasma fuel." /atom/movable/screen/alert/lowcell/plasma/update_desc() . = ..() diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index b8c853c6c08..8f41a9ed304 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -47,7 +47,7 @@ new /datum/data/mining_equipment("Super Resonator", /obj/item/resonator/upgraded, 2500), new /datum/data/mining_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2500), new /datum/data/mining_equipment("Ice Hiking Boots", /obj/item/clothing/shoes/winterboots/ice_boots, 2500), - new /datum/data/mining_equipment("Mining MODsuit", /obj/item/mod/control/pre_equipped/mining, 2500), + new /datum/data/mining_equipment("Mining MODsuit", /obj/item/mod/control/pre_equipped/mining, 3000), new /datum/data/mining_equipment("Luxury Shelter Capsule", /obj/item/survivalcapsule/luxury, 3000), new /datum/data/mining_equipment("Luxury Bar Capsule", /obj/item/survivalcapsule/luxuryelite, 10000), new /datum/data/mining_equipment("Nanotrasen Minebot", /mob/living/simple_animal/hostile/mining_drone, 800), diff --git a/code/modules/mod/mod_core.dm b/code/modules/mod/mod_core.dm index f72247f847e..79422230f16 100644 --- a/code/modules/mod/mod_core.dm +++ b/code/modules/mod/mod_core.dm @@ -283,13 +283,13 @@ name = "MOD plasma core" icon_state = "mod-core-plasma" desc = "Nanotrasen's attempt at capitalizing on their plasma research. These plasma cores are refueled \ - through plasma ore, allowing for easy continued use by their mining squads." + through plasma fuel, allowing for easy continued use by their mining squads." /// How much charge we can store. var/maxcharge = 10000 /// How much charge we are currently storing. var/charge = 10000 - /// Charge per plasma ore. - var/charge_given = 1500 + /// Associated list of charge sources and how much they charge, only stacks allowed. + var/list/charger_list = list(/obj/item/stack/ore/plasma = 1500, /obj/item/stack/sheet/mineral/plasma = 2000) /obj/item/mod/core/plasma/install(obj/item/mod/control/mod_unit) . = ..() @@ -345,12 +345,13 @@ return COMPONENT_NO_AFTERATTACK return NONE -/obj/item/mod/core/plasma/proc/charge_plasma(obj/item/stack/ore/plasma/plasma, mob/user) - if(!istype(plasma)) +/obj/item/mod/core/plasma/proc/charge_plasma(obj/item/stack/plasma, mob/user) + var/charge_given = is_type_in_list(plasma, charger_list, zebra = TRUE) + if(!charge_given) return FALSE - var/uses_needed = min(plasma.amount, round((max_charge_amount() - charge_amount()) / charge_given)) + var/uses_needed = min(plasma.amount, ROUND_UP((max_charge_amount() - charge_amount()) / charge_given)) if(!plasma.use(uses_needed)) return FALSE - add_charge(uses_needed*charge_given) + add_charge(uses_needed * charge_given) balloon_alert(user, "core refueled") return TRUE diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index 95127c56a24..39a2aeccfc6 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -503,7 +503,6 @@ ADD_TRAIT(mod.wearer, TRAIT_HANDS_BLOCKED, MOD_TRAIT) ADD_TRAIT(mod.wearer, TRAIT_FORCED_STANDING, MOD_TRAIT) ADD_TRAIT(mod.wearer, TRAIT_NOSLIPALL, MOD_TRAIT) - mod.wearer.add_movespeed_mod_immunities(MOD_TRAIT, /datum/movespeed_modifier/turf_slowdown) mod.wearer.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6) mod.wearer.AddElement(/datum/element/footstep, FOOTSTEP_OBJ_ROBOT, 1, -6, sound_vary = TRUE) mod.wearer.add_movespeed_modifier(/datum/movespeed_modifier/sphere) @@ -575,6 +574,12 @@ light_color = COLOR_LIGHT_ORANGE ammo_type = /obj/structure/mining_bomb +/obj/projectile/bullet/reusable/mining_bomb/handle_drop() + if(dropped) + return + dropped = TRUE + new ammo_type(get_turf(src), firer) + /obj/structure/mining_bomb name = "mining bomb" desc = "A bomb. Why are you examining this?" @@ -597,26 +602,30 @@ /// Image overlaid on explosion. var/static/image/explosion_image -/obj/structure/mining_bomb/Initialize(mapload) +/obj/structure/mining_bomb/Initialize(mapload, atom/movable/firer) . = ..() if(!explosion_image) explosion_image = image('icons/effects/96x96.dmi', "judicial_explosion") explosion_image.pixel_x = -32 explosion_image.pixel_y = -32 explosion_image.plane = ABOVE_GAME_PLANE - addtimer(CALLBACK(src, .proc/prime), prime_time) + addtimer(CALLBACK(src, .proc/prime, firer), prime_time) -/obj/structure/mining_bomb/proc/prime() +/obj/structure/mining_bomb/proc/prime(atom/movable/firer) add_overlay(explosion_image) - addtimer(CALLBACK(src, .proc/boom), explosion_time) + addtimer(CALLBACK(src, .proc/boom, firer), explosion_time) -/obj/structure/mining_bomb/proc/boom() +/obj/structure/mining_bomb/proc/boom(atom/movable/firer) visible_message(span_danger("[src] explodes!")) playsound(src, 'sound/magic/magic_missile.ogg', 200, vary = TRUE) for(var/turf/closed/mineral/rock in circle_range_turfs(src, 2)) rock.gets_drilled() for(var/mob/living/mob in range(1, src)) mob.apply_damage(12 * (ishostile(mob) ? fauna_boost : 1), BRUTE, spread_damage = TRUE) + if(!ishostile(mob) || !firer) + continue + var/mob/living/simple_animal/hostile/hostile_mob = mob + hostile_mob.GiveTarget(firer) for(var/obj/object in range(1, src)) object.take_damage(damage, BRUTE, BOMB) qdel(src)