Skip to content

Commit

Permalink
Angle grinder AGAIN! Also, makes plasma cutters used for salvage inst…
Browse files Browse the repository at this point in the history
…ead of mining (and base gearpacks) (#3146)

<!-- 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
re-implements #1716 as a base and adds cutter functionality to plasma
cutters
also implements and uses gear packs from #2103 that never got in.
makes plasma cutters unable to mine, shorter range, and do burn instead
of brute.
angle grinders are integrated into grinder packs, like water backtanks.
Also draws power from a cell.
jackhammers can no longer break down walls and girders.
### Cutters can currently deconstruct:
- girders
- walls
- reinforced walls
- airlocks
- airlock frames
- grilles
- machine frames
- computer frames
- catwalks
- chairs
- beds
- tables
- lockers & crates
- salvage machines (the wasteplanet ones)
- railings
- lattice
- wooden barricades

cutters can also cut open safes and locked lockers & crates

attempted to revert map changes but using git checkout doesn't
completely revert the gecko. Will try again later.

adds a mech salvage saw and a prototype energy saw. Doesn't make either
available yet.

sprites by me

![image](https://github.com/shiptest-ss13/Shiptest/assets/90987989/65bd6b99-d63d-4c75-9227-a9987fddf9d2)


https://github.com/shiptest-ss13/Shiptest/assets/90987989/12262338-055f-4c7c-86d1-d31279ab953c

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Jackhammers as a main salvage tool is dumb, and angle grinders and
cutters make more sense and have better functionality. Cutting apart old
ruins and ships should be a reasonable source of material and shouldn't
take years.
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog



:cl:
add: angle grinders for salvage
add: reworks plasma cutters for salvage
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: 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. -->

---------

Signed-off-by: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com>
Co-authored-by: ritorizo <ritorizo@localhost>
Co-authored-by: FalloutFalcon <falloutfalconplays@gmail.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 5, 2024
1 parent b5370df commit dd08ffa
Show file tree
Hide file tree
Showing 45 changed files with 778 additions and 67 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
#define COMSIG_ATOM_CROWBAR_ACT "atom_crowbar_act"
///from base of atom/analyser_act(): (mob/living/user, obj/item/I)
#define COMSIG_ATOM_ANALYSER_ACT "atom_analyser_act"
///from base of atom/deconstruct_act(): (mob/living/user, obj/item/I)
#define COMSIG_ATOM_DECONSTRUCT_ACT "atom_deconstruct_act"

///for any tool behaviors: (mob/living/user, obj/item/I, list/recipes)
#define COMSIG_ATOM_TOOL_ACT(tooltype) "tool_act_[tooltype]"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define TOOL_SCALPEL "scalpel"
#define TOOL_SAW "saw"
#define TOOL_KNIFE "knife" //luv me kuh-nyfe
#define TOOL_DECONSTRUCT "deconstruct"

// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
// tool sound is only played when op is started. If not, it's played twice.
Expand Down
3 changes: 3 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@
/datum/action/item_action/toggle_mister
name = "Toggle Mister"

/datum/action/item_action/toggle_gear_handle
name = "Toggle Gear Handle"

/datum/action/item_action/activate_injector
name = "Activate Injector"

Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS // Only one of the component can exist on an item
var/wielded = FALSE /// Are we holding the two handed item properly
var/force_multiplier = 0 /// The multiplier applied to force when wielded, does not work with force_wielded, and force_unwielded
var/force_wielded = 0 /// The force of the item when weilded
var/force_unwielded = 0 /// The force of the item when unweilded
var/force_wielded = 0 /// The force of the item when wielded
var/force_unwielded = 0 /// The force of the item when unwielded
var/wieldsound = FALSE /// Play sound when wielded
var/unwieldsound = FALSE /// Play sound when unwielded
var/attacksound = FALSE /// Play sound on attack when wielded
Expand Down
40 changes: 40 additions & 0 deletions code/datums/elements/tool_bang.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Tool bang bespoke element
*
* Bang the user when using this tool
*/
/datum/element/tool_bang
element_flags = ELEMENT_BESPOKE
id_arg_index = 2
/// Strength of the bang
var/bang_strength

/datum/element/tool_bang/Attach(datum/target, bang_strength)
. = ..()
if(!isitem(target))
return ELEMENT_INCOMPATIBLE

src.bang_strength = bang_strength

RegisterSignal(target, COMSIG_TOOL_IN_USE, PROC_REF(prob_bang))
RegisterSignal(target, COMSIG_TOOL_START_USE, PROC_REF(bang))

/datum/element/tool_bang/Detach(datum/source, force)
. = ..()
UnregisterSignal(source, list(COMSIG_TOOL_IN_USE, COMSIG_TOOL_START_USE))

/datum/element/tool_bang/proc/prob_bang(datum/source, mob/living/user)
SIGNAL_HANDLER

if(prob(90))
return
bang(source, user)

/datum/element/tool_bang/proc/bang(datum/source, mob/living/user)
SIGNAL_HANDLER

if(user && get_dist(get_turf(source), get_turf(user)) <= 1)
if(istype(user, /mob/living/carbon))
var/mob/living/carbon/carbon = user
carbon.soundbang_act(min(bang_strength,1), 0, 1, 5)

6 changes: 6 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,8 @@
. = welder_act(user, I)
if(TOOL_ANALYZER)
. = analyzer_act(user, I)
if(TOOL_DECONSTRUCT)
. |= deconstruct_act(user, I)
if(. || signal_result & COMPONENT_BLOCK_TOOL_ATTACK) //Either the proc or the signal handled the tool's events in some way.
return TRUE

Expand Down Expand Up @@ -1362,6 +1364,10 @@
/atom/proc/analyzer_act(mob/living/user, obj/item/I)
return SEND_SIGNAL(src, COMSIG_ATOM_ANALYSER_ACT, user, I)

///Deconstruct act
/atom/proc/deconstruct_act(mob/living/user, obj/item/I)
return SEND_SIGNAL(src, COMSIG_ATOM_DECONSTRUCT_ACT, user, I)

///Generate a tag for this atom
/atom/proc/GenerateTag()
return
Expand Down
12 changes: 10 additions & 2 deletions code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@
. += "It has \a [circuit] installed."


/obj/structure/frame/deconstruct(disassembled = TRUE)
/obj/structure/frame/deconstruct(disassembled = TRUE, scrapped = FALSE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal(loc, 5)
if(circuit)
if(circuit && !scrapped)
circuit.forceMove(loc)
circuit = null
qdel(src)

/obj/structure/frame/deconstruct_act(mob/living/user, obj/item/I)
. = ..()
if(!I.tool_start_check(user, amount=0))
return FALSE
if(I.use_tool(src, user, 3 SECONDS, volume=0))
to_chat(user, "<span class='warning'>You cut apart \the [src].</span>", "<span class='notice'>You cut apart \the [src].</span>")
deconstruct()
return TRUE

/obj/structure/frame/machine
name = "machine frame"
Expand Down
8 changes: 8 additions & 0 deletions code/game/machinery/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
return
return ..()

/obj/structure/barricade/wooden/deconstruct_act(mob/living/user, obj/item/I)
. = ..()
if(!I.tool_start_check(user, amount=0))
return FALSE
if (I.use_tool(src, user, 2 SECONDS, volume=0))
to_chat(user, "<span class='warning'>You cut apart [src].</span>")
deconstruct()
return TRUE

/obj/structure/barricade/wooden/crude
name = "crude plank barricade"
Expand Down
15 changes: 15 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,21 @@
return
INVOKE_ASYNC(src, (density ? PROC_REF(open) : PROC_REF(close)), 2)

/obj/machinery/door/airlock/deconstruct_act(mob/living/user, obj/item/I)
. = ..()
if(!I.tool_start_check(user, amount=0))
return FALSE
var/decon_time = 5 SECONDS
if(welded)
decon_time += 5 SECONDS
if(locked)
decon_time += 5 SECONDS
if(seal)
decon_time += 15 SECONDS
if (I.use_tool(src, user, decon_time, volume=100))
to_chat(user, "<span class='warning'>You cut open the [src].</span>")
deconstruct(FALSE, user)
return TRUE

/obj/machinery/door/airlock/open(forced=0)
if(operating || welded || locked || seal || !wires)
Expand Down
80 changes: 80 additions & 0 deletions code/game/mecha/equipment/tools/work_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,86 @@
return 1
//WS Edit End - Readded from Smartwire Revert

/obj/item/mecha_parts/mecha_equipment/salvage_saw
name = "109-C Salvage Saw"
desc = "Equipment for cutting open walls and airlocks."
icon_state = "mecha_saw"
equip_cooldown = 5
energy_drain = 10
force = 15
var/dam_force = 30
harmful = TRUE
tool_behaviour = TOOL_DECONSTRUCT
toolspeed = 0.5
var/datum/effect_system/spark_spread/spark_system

/obj/item/mecha_parts/mecha_equipment/salvage_saw/can_attach(obj/mecha/M as obj)
if(..())
if(istype(M, /obj/mecha/working) || istype(M, /obj/mecha/combat))
return 1
return 0

/obj/item/mecha_parts/mecha_equipment/salvage_saw/attach()
..()
toolspeed = 0.5
return

/obj/item/mecha_parts/mecha_equipment/salvage_saw/detach()
..()
toolspeed = 10 //yeah sure, use a mech tool without a mech. see how far that gets you
return ..()

/obj/item/mecha_parts/mecha_equipment/salvage_saw/action(atom/target)
if(!action_checks(target))
return
if(isliving(target))
if(chassis.occupant.a_intent == INTENT_HARM)
var/mob/living/M = target
saw_mob(M, chassis.occupant)
return
else
target.add_overlay(GLOB.cutting_effect)
if(target.deconstruct_act(chassis.occupant, src))
do_sparks(2, TRUE, src)
chassis.stopped--
target.cut_overlay(GLOB.cutting_effect)
if(!chassis.stopped)
occupant_message("[src] finishes cutting, allowing movement again.")

/obj/item/mecha_parts/mecha_equipment/salvage_saw/tool_start_check(user, amount)
if(!chassis.stopped)
occupant_message("[src] begins cutting, locking in place!")
chassis.stopped++
return TRUE

/obj/item/mecha_parts/mecha_equipment/salvage_saw/proc/saw_mob(mob/living/target, mob/user)
target.visible_message("<span class='danger'>[chassis] is sawing [target] with [src]!</span>", \
"<span class='userdanger'>[chassis] is sawing you with [src]!</span>")
if(!do_after_cooldown(target))
return
log_combat(user, target, "sawed", "[name]", "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
if(target.stat == DEAD && target.getBruteLoss() >= 400)
log_combat(user, target, "gibbed", name)
target.gib()
else
var/obj/item/bodypart/target_part = target.get_bodypart(ran_zone(BODY_ZONE_CHEST))
target.apply_damage(15, BRUTE, BODY_ZONE_CHEST, target.run_armor_check(target_part, "melee"))

//blood splatters
var/splatter_dir = get_dir(chassis, target)
if(isalien(target))
new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(target.drop_location(), splatter_dir)
else
var/splatter_color = null
if(iscarbon(target))
var/mob/living/carbon/carbon_target = target
splatter_color = carbon_target.dna.blood_type.color
new /obj/effect/temp_visual/dir_setting/bloodsplatter(target.drop_location(), splatter_dir, splatter_color)

//organs go everywhere
if(target_part && prob(10))
target_part.dismember(BRUTE)

//Dunno where else to put this so shrug
/obj/item/mecha_parts/mecha_equipment/conversion_kit
name = "Exosuit Conversion Kit"
Expand Down
3 changes: 3 additions & 0 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
light_on = FALSE
var/ruin_mecha = FALSE //if the mecha starts on a ruin, don't automatically give it a tracking beacon to prevent metagaming.
var/can_move = 0 //time of next allowed movement
var/stopped = FALSE
var/mob/living/carbon/occupant = null
var/step_in = 10 //make a step in step_in/10 sec.
var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
Expand Down Expand Up @@ -596,6 +597,8 @@
/obj/mecha/proc/domove(direction)
if(can_move >= world.time)
return 0
if(stopped)
return 0
if(!Process_Spacemove(direction))
return 0
if(!has_charge(step_energy_drain))
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e

GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons/effects/welding_effect.dmi', "welding_sparks", GASFIRE_LAYER, ABOVE_LIGHTING_PLANE))

GLOBAL_DATUM_INIT(cutting_effect, /mutable_appearance, mutable_appearance('icons/effects/cutting_effect.dmi', "cutting_effect", GASFIRE_LAYER, ABOVE_LIGHTING_PLANE))

GLOBAL_DATUM_INIT(advanced_cutting_effect, /mutable_appearance, mutable_appearance('icons/effects/cutting_effect.dmi', "advanced_cutting_effect", GASFIRE_LAYER, ABOVE_LIGHTING_PLANE))

GLOBAL_DATUM_INIT(cleaning_bubbles, /mutable_appearance, mutable_appearance('icons/effects/effects.dmi', "bubbles", ABOVE_MOB_LAYER, GAME_PLANE))

GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
Expand Down
Loading

0 comments on commit dd08ffa

Please sign in to comment.