[MIRROR] mech bustin update 2022 [MDB IGNORE] (#17504)

* mech bustin update 2022 (#70891)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
Adds a huge ass crowbar to robotics (the mech removal tool), it deals 5
damage unwielded, or 19 wielded. (should be fine, considering robotics
also has the easiest access to the materials needed for a chainsaw)
You can use it while wielded on mechs to break the occupants out. This
takes 5 seconds (or 3 in an unenclosed mech like a ripley)
When you die in a mech you no longer automatically get ejected.
refactors fire axe cabinets to support more items than the fireaxe
makes some vehicle code better
closes #70845 (you can still enter a mech without limbs, i think thats
fine because you can use it to protect yourself from death in a
dangerous situation or something until someone breaks you out with the
really large crowbar)
video: https://streamable.com/x4gom2

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
robotics having a giant ass crowbar to break people out of mechs seems
like a fun idea
you currently cant exit a mech if youre incapacitated inside it unless
you DIE

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑 Fikou, sprites by Halcyon
refactor: fire axe cabinets support items that aren't fire axes
balance: mechs no longer eject you when you die in them
add: Adds a giant crowbar to robotics, it can break open mechs to eject
their pilots.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

* mech bustin update 2022

* vr for the love of god

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: Jolly-66 <70232195+Jolly-66@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-11-16 14:41:58 -08:00
committed by GitHub
co-authored by Fikou Jolly-66
parent 24eb8217c0
commit 1ba95626a6
25 changed files with 2364 additions and 2315 deletions
+66 -61
View File
@@ -8,57 +8,62 @@
armor = list(MELEE = 50, BULLET = 20, LASER = 0, ENERGY = 100, BOMB = 10, BIO = 0, FIRE = 90, ACID = 50)
max_integrity = 150
integrity_failure = 0.33
/// Do we need to be unlocked to be opened.
var/locked = TRUE
/// Are we opened, can someone take the held item out.
var/open = FALSE
var/obj/item/fireaxe/fireaxe
/// The item we're holding.
var/obj/item/held_item
/// The path of the item we spawn and can hold.
var/item_path = /obj/item/fireaxe
/// Overlay we get when the item is inside us.
var/item_overlay = "axe"
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32)
/obj/structure/fireaxecabinet/Initialize(mapload)
. = ..()
fireaxe = new(src)
held_item = new item_path(src)
update_appearance()
/obj/structure/fireaxecabinet/Destroy()
if(fireaxe)
QDEL_NULL(fireaxe)
if(held_item)
QDEL_NULL(held_item)
return ..()
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/living/user, params)
if(iscyborg(user) || I.tool_behaviour == TOOL_MULTITOOL)
/obj/structure/fireaxecabinet/attackby(obj/item/attacking_item, mob/living/user, params)
if(iscyborg(user) || attacking_item.tool_behaviour == TOOL_MULTITOOL)
toggle_lock(user)
else if(I.tool_behaviour == TOOL_WELDER && !user.combat_mode && !broken)
else if(attacking_item.tool_behaviour == TOOL_WELDER && !user.combat_mode && !broken)
if(atom_integrity < max_integrity)
if(!I.tool_start_check(user, amount=2))
if(!attacking_item.tool_start_check(user, amount = 2))
return
to_chat(user, span_notice("You begin repairing [src]."))
if(I.use_tool(src, user, 40, volume=50, amount=2))
atom_integrity = max_integrity
balloon_alert(user, "repairing...")
if(attacking_item.use_tool(src, user, 4 SECONDS, volume= 50, amount = 2))
repair_damage(max_integrity - get_integrity())
update_appearance()
to_chat(user, span_notice("You repair [src]."))
balloon_alert(user, "repaired")
else
to_chat(user, span_warning("[src] is already in good condition!"))
balloon_alert(user, "already repaired!")
return
else if(istype(I, /obj/item/stack/sheet/glass) && broken)
var/obj/item/stack/sheet/glass/G = I
if(G.get_amount() < 2)
to_chat(user, span_warning("You need two glass sheets to fix [src]!"))
else if(istype(attacking_item, /obj/item/stack/sheet/glass) && broken)
var/obj/item/stack/sheet/glass/glass_stack = attacking_item
if(glass_stack.get_amount() < 2)
balloon_alert(user, "need more glass!")
return
to_chat(user, span_notice("You start fixing [src]..."))
if(do_after(user, 20, target = src) && G.use(2))
balloon_alert(user, "repairing")
if(do_after(user, 2 SECONDS, target = src) && glass_stack.use(2))
broken = FALSE
atom_integrity = max_integrity
repair_damage(max_integrity - get_integrity())
update_appearance()
else if(open || broken)
if(istype(I, /obj/item/fireaxe) && !fireaxe)
if(HAS_TRAIT(I, TRAIT_WIELDED))
to_chat(user, span_warning("Unwield [I] first."))
if(istype(attacking_item, item_path) && !held_item)
if(HAS_TRAIT(attacking_item, TRAIT_WIELDED))
balloon_alert(user, "unwield it!")
return
if(!user.transferItemToLoc(I, src))
if(!user.transferItemToLoc(attacking_item, src))
return
fireaxe = I
to_chat(user, span_notice("You place [I] back in [src]."))
held_item = attacking_item
update_appearance()
return
else if(!broken)
@@ -66,6 +71,12 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32)
else
return ..()
/obj/structure/fireaxecabinet/Exited(atom/movable/gone, direction)
if(gone == held_item)
held_item = null
update_appearance()
return ..()
/obj/structure/fireaxecabinet/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
@@ -94,36 +105,30 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32)
/obj/structure/fireaxecabinet/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(fireaxe && loc)
fireaxe.forceMove(loc)
fireaxe = null
if(held_item && loc)
held_item.forceMove(loc)
new /obj/item/stack/sheet/iron(loc, 2)
qdel(src)
/obj/structure/fireaxecabinet/blob_act(obj/structure/blob/B)
if(fireaxe)
fireaxe.forceMove(loc)
fireaxe = null
if(held_item)
held_item.forceMove(loc)
qdel(src)
/obj/structure/fireaxecabinet/attack_hand(mob/user, list/modifiers)
. = ..()
if(.)
return
if((open || broken) && fireaxe)
user.put_in_hands(fireaxe)
to_chat(user, span_notice("You take [fireaxe] from [src]."))
fireaxe = null
src.add_fingerprint(user)
update_appearance()
return
if(locked)
to_chat(user, span_warning("\The [src] won't budge!"))
return
else
open = !open
if((open || broken) && held_item)
user.put_in_hands(held_item)
add_fingerprint(user)
update_appearance()
return
toggle_open(user)
/obj/structure/fireaxecabinet/attack_hand_secondary(mob/user, list/modifiers)
toggle_open(user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/structure/fireaxecabinet/attack_paw(mob/living/user, list/modifiers)
return attack_hand(user, modifiers)
@@ -132,20 +137,14 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32)
toggle_lock(user)
return
/obj/structure/fireaxecabinet/attack_tk(mob/user)
. = COMPONENT_CANCEL_ATTACK_CHAIN
if(locked)
to_chat(user, span_warning("The [name] won't budge!"))
return
open = !open
update_appearance()
toggle_open(user)
/obj/structure/fireaxecabinet/update_overlays()
. = ..()
if(fireaxe)
. += "axe"
if(held_item)
. += item_overlay
if(open)
. += "glass_raised"
return
@@ -168,20 +167,26 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet, 32)
/obj/structure/fireaxecabinet/proc/toggle_lock(mob/user)
to_chat(user, span_notice("Resetting circuitry..."))
playsound(src, 'sound/machines/locktoggle.ogg', 50, TRUE)
if(do_after(user, 20, target = src))
if(do_after(user, 2 SECONDS, target = src))
to_chat(user, span_notice("You [locked ? "disable" : "re-enable"] the locking modules."))
locked = !locked
update_appearance()
/obj/structure/fireaxecabinet/verb/toggle_open()
set name = "Open/Close"
set category = "Object"
set src in oview(1)
/obj/structure/fireaxecabinet/proc/toggle_open(mob/user)
if(locked)
to_chat(usr, span_warning("The [name] won't budge!"))
balloon_alert(user, "won't budge!")
return
else
open = !open
playsound(src, 'sound/machines/click.ogg', 30, TRUE)
update_appearance()
return
/obj/structure/fireaxecabinet/mechremoval
name = "mech removal tool cabinet"
desc = "There is a small label that reads \"For Emergency use only\" along with details for safe use of the tool. As if."
icon_state = "mechremoval"
item_path = /obj/item/crowbar/mechremoval
item_overlay = "crowbar"
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fireaxecabinet/mechremoval, 32)