Files
MrMelbertandRoxy bc2215667f Re-refactors batons / Refactors attack chain force modifiers (#90809)
Melee attack chain now has a list passed along with it,
`attack_modifiers`, which you can stick force modifiers to change the
resulting attack

This is basically a soft implementation of damage packets until a more
definitive pr, but one that only applies to item attack chain, and not
unarmed attacks.

This change was done to facilitate a baton refactor - batons no longer
hack together their own attack chain, and are now integrated straight
into the real attack chain. This refactor itself was done because batons
don't send any attack signals, which has been annoying in the past (for
swing combat).

🆑 Melbert
refactor: Batons have been refactored again. Baton stuns now properly
count as an attack, when before it was a nothing. Report any oddities,
particularly in regards to harmbatonning vs normal batonning.
refactor: The method of adjusting item damage mid-attack has been
refactored - some affected items include the Nullblade and knives.
Report any strange happenings with damage numbers.
refactor: A few objects have been moved to the new interaction chain -
records consoles, mawed crucible, alien weeds and space vines, hedges,
restaurant portals, and some mobs - to name a few.
fix: Spears only deal bonus damage against secure lockers, not all
closet types (including crates)
/🆑
2025-05-22 21:30:07 -04:00

83 lines
2.4 KiB
Plaintext

/obj/machinery/mass_driver
name = "mass driver"
desc = "The finest in spring-loaded piston toy technology, now on a space station near you."
icon = 'icons/obj/machines/floor.dmi'
icon_state = "mass_driver"
circuit = /obj/item/circuitboard/machine/mass_driver
var/power = 1
var/code = 1
var/id = 1
var/drive_range = 10
var/power_per_obj = 1000
/obj/machinery/mass_driver/Initialize(mapload)
. = ..()
wires = new /datum/wires/mass_driver(src)
/obj/machinery/mass_driver/chapelgun
name = "holy driver"
id = MASSDRIVER_CHAPEL
/obj/machinery/mass_driver/ordnance
id = MASSDRIVER_ORDNANCE
/obj/machinery/mass_driver/trash
id = MASSDRIVER_DISPOSALS
/obj/machinery/mass_driver/shack
id = MASSDRIVER_SHACK
/obj/machinery/mass_driver/Destroy()
for(var/obj/machinery/computer/pod/control as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/pod))
if(control.id == id)
control.connected = null
return ..()
/obj/machinery/mass_driver/connect_to_shuttle(mapload, obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
id = "[port.shuttle_id]_[id]"
/obj/machinery/mass_driver/proc/drive(amount)
if(machine_stat & (BROKEN|NOPOWER) || panel_open)
return
use_energy(power_per_obj)
var/O_limit
var/atom/target = get_edge_target_turf(src, dir)
for(var/atom/movable/O in loc)
if(!O.anchored || ismecha(O)) //Mechs need their launch platforms.
if(ismob(O) && !isliving(O))
continue
O_limit++
if(O_limit >= 20)
audible_message(span_notice("[src] lets out a screech, it doesn't seem to be able to handle the load."))
break
use_energy(power_per_obj)
O.throw_at(target, drive_range * power, power)
flick("mass_driver1", src)
/obj/machinery/mass_driver/attackby(obj/item/item, mob/living/user, list/modifiers, list/attack_modifiers)
if(is_wire_tool(item) && panel_open)
wires.interact(user)
return
if(default_deconstruction_screwdriver(user, "mass_driver_o", "mass_driver", item))
return
if(default_change_direction_wrench(user, item))
return
if(default_deconstruction_crowbar(item))
return
return ..()
/obj/machinery/mass_driver/RefreshParts()
. = ..()
for(var/datum/stock_part/servo/new_servo in component_parts)
drive_range += new_servo.tier * 10
/obj/machinery/mass_driver/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(machine_stat & (BROKEN|NOPOWER) || panel_open)
return
drive()