Skip to content

Commit

Permalink
Plasma cutter fixes (#804)
Browse files Browse the repository at this point in the history
* ASRS without acces (for SDMM)

* Undo ASRS

* Plasma Cutter Changes (#16773)

* Fixeki

* Fixeki 2

* Resin wall dmg fix

* Sound fixes

* Sound fixes 2

* Review fixes

* Fixeki 3

* Silo plasma cutter dmg up

* obj/item to obj/item/.../plasmacutter

* Fixeki 4

---------

Signed-off-by: CheBokJam <[email protected]>
Co-authored-by: Rune Knight <[email protected]>
Co-authored-by: Helg2 <[email protected]>
  • Loading branch information
3 people authored Dec 15, 2024
1 parent 499dc6e commit e912220
Show file tree
Hide file tree
Showing 15 changed files with 164 additions and 92 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@

#define iscrowbar(I) (istype(I, /obj/item/tool/crowbar))

#define isplasmacutter(I) (istype(I, /obj/item/tool/pickaxe/plasmacutter))

#define iscell(I) (istype(I, /obj/item/cell))

#define islascell(I) (istype(I, /obj/item/cell/lasgun))
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define TOOL_WIRECUTTER "wirecutter"
#define TOOL_WRENCH "wrench"
#define TOOL_WELDER "welder"
#define TOOL_WELD_CUTTER "weld_cutter"
#define TOOL_PLASMACUTTER "plasmacutter"
#define TOOL_ANALYZER "analyzer"
#define TOOL_MINING "mining"
#define TOOL_SHOVEL "shovel"
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
return target.wirecutter_act(user, src)
if(TOOL_WELDER)
return target.welder_act(user, src)
if(TOOL_WELD_CUTTER)
return target.weld_cut_act(user, src)
if(TOOL_PLASMACUTTER)
return target.plasmacutter_act(user, src)
if(TOOL_ANALYZER)
return target.analyzer_act(user, src)
if(TOOL_FULTON)
Expand Down Expand Up @@ -336,7 +336,7 @@
return FALSE

if(!force)
return FALSE
return FALSE

if(!M)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ directive is properly returned.
/atom/proc/welder_act(mob/living/user, obj/item/I)
return FALSE

/atom/proc/weld_cut_act(mob/living/user, obj/item/I)
/atom/proc/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
return FALSE

/atom/proc/analyzer_act(mob/living/user, obj/item/I)
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/weeds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
SSblackbox.record_feedback(FEEDBACK_TALLY, "round_statistics", 1, "weeds_destroyed")
return ..()

/obj/alien/weeds/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
return FALSE // Just attack normally.

/obj/alien/weeds/Initialize(mapload, obj/alien/weeds/node/node, swapped = FALSE)
. = ..()
var/static/list/connections = list(
Expand Down
19 changes: 1 addition & 18 deletions code/game/objects/items/tools/mining_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
light_range = 2
light_power = 0.6
light_color = LIGHT_COLOR_PURPLE
tool_behaviour = TOOL_PLASMACUTTER
var/cutting_sound = 'sound/items/welder2.ogg'
var/powered = FALSE
var/dirt_amt_per_dig = 5
var/obj/item/cell/rtg/large/cell //The plasma cutter cell is unremovable and recharges over time
tool_behaviour = TOOL_WELD_CUTTER

/obj/item/tool/pickaxe/plasmacutter/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -282,20 +282,3 @@
ST.update_appearance()
ST.update_sides()
cut_apart(user, target.name, target, 0, "You melt the snow with [src]. ") //costs nothing



/obj/item/tool/pickaxe/plasmacutter/attack_obj(obj/O, mob/living/user)
if(!powered || user.do_actions || CHECK_BITFIELD(O.resistance_flags, INDESTRUCTIBLE) || CHECK_BITFIELD(O.resistance_flags, PLASMACUTTER_IMMUNE))
..()
return TRUE

if(!start_cut(user, O.name, O))
return TRUE

if(!do_after(user, calc_delay(user), NONE, O, BUSY_ICON_HOSTILE))
return TRUE

cut_apart(user, O.name, O)
O.deconstruct(TRUE)
return TRUE
18 changes: 18 additions & 0 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,21 @@
playsound(loc, 'sound/items/welder2.ogg', 25, TRUE)
handle_weldingtool_overlay(TRUE)
return TRUE

/obj/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(user.do_actions)
return FALSE
if(!(obj_flags & CAN_BE_HIT) || CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE) || CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
if(!I.powered || (I.flags_item & NOBLUDGEON))
return FALSE
if(user.a_intent == INTENT_HARM) // Attack normally.
return FALSE
if(!I.start_cut(user, name, src))
return FALSE
if(!do_after(user, I.calc_delay(user), NONE, src, BUSY_ICON_HOSTILE))
return TRUE

I.cut_apart(user, name, src)
deconstruct(FALSE)
return TRUE
69 changes: 56 additions & 13 deletions code/game/objects/structures/mineral_doors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,74 @@
else
icon_state = "[base_icon_state][smoothing_flags ? "-[smoothing_junction]" : ""]"

/obj/structure/mineral_door/attackby(obj/item/W, mob/living/user)
/obj/structure/mineral_door/attackby(obj/item/attacking_item, mob/living/user)
. = ..()
if(QDELETED(src))
return

var/multiplier = 1
if(istype(W, /obj/item/tool/pickaxe/plasmacutter) && !user.do_actions)
var/obj/item/tool/pickaxe/plasmacutter/P = W
if(P.start_cut(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD))
if(istype(src, /obj/structure/mineral_door/resin))
multiplier += PLASMACUTTER_RESIN_MULTIPLIER //Plasma cutters are particularly good at destroying resin structures.
else
multiplier += PLASMACUTTER_RESIN_MULTIPLIER * 0.5
P.cut_apart(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Minimal energy cost.
if(W.damtype == BURN && istype(src, /obj/structure/mineral_door/resin)) //Burn damage deals extra vs resin structures (mostly welders).
multiplier += 1 //generally means we do double damage to resin doors
if(user.a_intent == INTENT_HARM)
return

if(!(obj_flags & CAN_BE_HIT))
return

return attacking_item.attack_obj(src, user)

take_damage(max(0, W.force * multiplier - W.force), W.damtype, MELEE)
/obj/structure/mineral_door/attacked_by(obj/item/attacking_item, mob/living/user, def_zone)
. = ..()
if(attacking_item.damtype != BURN)
return
var/damage_multiplier = get_burn_damage_multiplier(attacking_item, user, def_zone)

take_damage(max(0, attacking_item.force * damage_multiplier), attacking_item.damtype, MELEE)

/obj/structure/mineral_door/Destroy()
if(material_type)
for(var/i in 1 to rand(1,5))
new material_type(get_turf(src))
return ..()

///Takes extra damage if our attacking item does burn damage
/obj/structure/mineral_door/proc/get_burn_damage_multiplier(obj/item/attacking_item, mob/living/user, def_zone, bonus_damage = 0)
if(!isplasmacutter(attacking_item))
return bonus_damage

var/obj/item/tool/pickaxe/plasmacutter/attacking_pc = attacking_item
if(attacking_pc.start_cut(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD, no_string = TRUE))
bonus_damage += PLASMACUTTER_RESIN_MULTIPLIER * 0.5
attacking_pc.cut_apart(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Minimal energy cost.

return bonus_damage

/obj/structure/mineral_door/resin/get_burn_damage_multiplier(obj/item/attacking_item, mob/living/user, def_zone, bonus_damage = 1)
if(!isplasmacutter(attacking_item))
return bonus_damage

var/obj/item/tool/pickaxe/plasmacutter/attacking_pc = attacking_item
if(attacking_pc.start_cut(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD, no_string = TRUE))
bonus_damage += PLASMACUTTER_RESIN_MULTIPLIER
attacking_pc.cut_apart(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Minimal energy cost.

return bonus_damage

/obj/structure/mineral_door/resin/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(user.do_actions)
return FALSE
if(!(obj_flags & CAN_BE_HIT) || CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE) || CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
if(!I.powered || (I.flags_item & NOBLUDGEON))
return FALSE
var/charge_cost = PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD
if(!I.start_cut(user, name, src, charge_cost, no_string = TRUE))
return FALSE

user.changeNext_move(I.attack_speed)
user.do_attack_animation(src, used_item = I)
I.cut_apart(user, name, src, charge_cost)
take_damage(max(0, I.force * (1 + PLASMACUTTER_RESIN_MULTIPLIER)), I.damtype, MELEE)
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)
return TRUE

/obj/structure/mineral_door/get_explosion_resistance()
if(CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return EXPLOSION_MAX_POWER
Expand Down
36 changes: 18 additions & 18 deletions code/game/turfs/closed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@
"The stone. The rock. The boulder. Its name matters not when we consume it.",
"Delicious, delectable, simply exquisite. Just a few more minerals and it'd be perfect...")), null, 5)

/turf/closed/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(user.do_actions)
return FALSE
if(CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE) || CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
to_chat(user, span_warning("[I] can't cut through this!"))
return FALSE
if(!I.powered || (I.flags_item & NOBLUDGEON))
return FALSE
if(!I.start_cut(user, name, src))
return FALSE
if(!do_after(user, PLASMACUTTER_CUT_DELAY, NONE, src, BUSY_ICON_FRIENDLY))
return FALSE

I.cut_apart(user, name, src)
// Change targetted turf to a new one to simulate deconstruction.
ChangeTurf(open_turf_type)
return TRUE

/turf/closed/mineral/smooth
name = "rock"
icon = 'icons/turf/walls/lvwall.dmi'
Expand Down Expand Up @@ -292,24 +310,6 @@
/turf/closed/glass/thin/intersection
icon_state = "Intersection"

/turf/closed/attackby(obj/item/I, mob/user, params)
. = ..()

if(istype(I, /obj/item/tool/pickaxe/plasmacutter) && !user.do_actions)
var/obj/item/tool/pickaxe/plasmacutter/P = I
if(CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE))
to_chat(user, span_warning("[P] can't cut through this!"))
return
else if(!P.start_cut(user, name, src))
return
else if(!do_after(user, PLASMACUTTER_CUT_DELAY, NONE, src, BUSY_ICON_FRIENDLY))
return
else
P.cut_apart(user, name, src) //purely a cosmetic effect

//change targetted turf to a new one to simulate deconstruction
ChangeTurf(open_turf_type)

//Ice Thin Wall
/turf/closed/ice/thin
name = "thin ice wall"
Expand Down
25 changes: 18 additions & 7 deletions code/game/turfs/walls/resin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
ChangeTurf(/turf/closed/wall/resin/thick)
return TRUE

/turf/closed/wall/resin/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(user.do_actions)
return FALSE
if(CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE) || CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
if(!I.powered || (I.flags_item & NOBLUDGEON))
return FALSE
var/charge_cost = PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD
if(!I.start_cut(user, name, src, charge_cost, no_string = TRUE))
return FALSE
user.changeNext_move(I.attack_speed)
user.do_attack_animation(src, used_item = I)
I.cut_apart(user, name, src, charge_cost)
take_damage(max(0, I.force * (2 + PLASMACUTTER_RESIN_MULTIPLIER)), I.damtype, MELEE)
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)
return TRUE

/turf/closed/wall/resin/thick
name = "thick resin wall"
desc = "Weird slime solidified into a thick wall."
Expand Down Expand Up @@ -101,14 +118,8 @@
if(I.damtype == BURN) //Burn damage deals extra vs resin structures (mostly welders).
multiplier += 1

if(istype(I, /obj/item/tool/pickaxe/plasmacutter) && !user.do_actions)
var/obj/item/tool/pickaxe/plasmacutter/P = I
if(P.start_cut(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD))
multiplier += PLASMACUTTER_RESIN_MULTIPLIER
P.cut_apart(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)

damage *= max(0, multiplier)
take_damage(damage, BRUTE, MELEE)
take_damage(damage, I.damtype, MELEE)
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)

/turf/closed/wall/resin/dismantle_wall()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,18 @@
else // pump_direction == SIPHONING
icon_state = "[base_icon_state]_in"

/obj/machinery/atmospherics/components/unary/vent_pump/weld_cut_act(mob/living/user, obj/item/W)
if(istype(W, /obj/item/tool/pickaxe/plasmacutter))
var/obj/item/tool/pickaxe/plasmacutter/P = W
if(!welded)
to_chat(user, span_warning("\The [P] can only cut open welds!"))
return FALSE
if(!(P.start_cut(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)))
return FALSE
if(do_after(user, P.calc_delay(user) * PLASMACUTTER_VLOW_MOD, NONE, src, BUSY_ICON_BUILD))
P.cut_apart(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Vents require much less charge
welded = FALSE
update_icon()
return TRUE
return FALSE
/obj/machinery/atmospherics/components/unary/vent_pump/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(!welded)
to_chat(user, span_warning("\The [I] can only cut open welds!"))
return FALSE
if(!(I.start_cut(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)))
return FALSE
if(!do_after(user, I.calc_delay(user) * PLASMACUTTER_VLOW_MOD, NONE, src, BUSY_ICON_BUILD))
return FALSE
I.cut_apart(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Vents require much less charge
welded = FALSE
update_icon()
return TRUE

/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/I)
if(iswelder(I))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,18 @@
..()
update_icon_nopipes()

/obj/machinery/atmospherics/components/unary/vent_scrubber/weld_cut_act(mob/living/user, obj/item/W)
if(istype(W, /obj/item/tool/pickaxe/plasmacutter))
var/obj/item/tool/pickaxe/plasmacutter/P = W

if(!welded)
to_chat(user, span_warning("\The [P] can only cut open welds!"))
return FALSE
if(!(P.start_cut(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)))
return FALSE
if(do_after(user, P.calc_delay(user) * PLASMACUTTER_VLOW_MOD, NONE, src, BUSY_ICON_BUILD))
P.cut_apart(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Vents require much less charge
welded = FALSE
update_icon()
return TRUE
return FALSE
/obj/machinery/atmospherics/components/unary/vent_scrubber/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(!welded)
to_chat(user, span_warning("\The [I] can only cut open welds!"))
return FALSE
if(!(I.start_cut(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)))
return FALSE
if(!do_after(user, I.calc_delay(user) * PLASMACUTTER_VLOW_MOD, NONE, src, BUSY_ICON_BUILD))
return FALSE
I.cut_apart(user, src.name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD) //Vents require much less charge
welded = FALSE
update_icon()
return TRUE

/obj/machinery/atmospherics/components/unary/vent_scrubber/welder_act(mob/living/user, obj/item/W)
if(iswelder(W))
Expand Down
17 changes: 17 additions & 0 deletions code/modules/xenomorph/_xeno_structure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,20 @@
balloon_alert_to_viewers("\The [xeno_attacker] tears down \the [src]!", "We tear down \the [src].")
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)
take_damage(max_integrity) // Ensure its destroyed

/obj/structure/xeno/plasmacutter_act(mob/living/user, obj/item/tool/pickaxe/plasmacutter/I)
if(user.do_actions)
return FALSE
if(!(obj_flags & CAN_BE_HIT) || CHECK_BITFIELD(resistance_flags, PLASMACUTTER_IMMUNE) || CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE))
return FALSE
if(!I.powered || (I.flags_item & NOBLUDGEON))
return FALSE
var/charge_cost = PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD
if(!I.start_cut(user, name, src, charge_cost, no_string = TRUE))
return FALSE
user.changeNext_move(I.attack_speed)
user.do_attack_animation(src, used_item = I)
I.cut_apart(user, name, src, charge_cost)
take_damage(max(0, I.force * (1 + PLASMACUTTER_RESIN_MULTIPLIER)), I.damtype, MELEE)
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)
return TRUE
2 changes: 1 addition & 1 deletion code/modules/xenomorph/silo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
bound_width = 96
bound_height = 96
max_integrity = 1000
resistance_flags = UNACIDABLE | DROPSHIP_IMMUNE | PLASMACUTTER_IMMUNE
resistance_flags = UNACIDABLE | DROPSHIP_IMMUNE
xeno_structure_flags = IGNORE_WEED_REMOVAL|CRITICAL_STRUCTURE
plane = FLOOR_PLANE
///How many larva points one silo produce in one minute
Expand Down
2 changes: 1 addition & 1 deletion code/modules/xenomorph/turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
P.cut_apart(user, name, src, PLASMACUTTER_BASE_COST * PLASMACUTTER_VLOW_MOD)

damage *= max(0, multiplier)
take_damage(damage, BRUTE, MELEE)
take_damage(damage, I.damtype, MELEE)
playsound(src, SFX_ALIEN_RESIN_BREAK, 25)

///Signal handler for hard del of hostile
Expand Down

0 comments on commit e912220

Please sign in to comment.