Skip to content

Commit

Permalink
Buffs breaching tools (#11201)
Browse files Browse the repository at this point in the history
* Club buff

* Update grille.dm

* Fixes airlocks shocking shock proof tools on break

* Fixes forced damage and attack chain issues

* Fixes club force string message

* max_hit_damage
  • Loading branch information
PowerfulBacon authored Aug 14, 2024
1 parent fcd39b2 commit e3da78e
Show file tree
Hide file tree
Showing 37 changed files with 107 additions and 78 deletions.
26 changes: 15 additions & 11 deletions code/datums/wires/_wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,28 @@
/datum/wires/proc/is_dud_color(color)
return is_dud(get_wire(color))

/datum/wires/proc/cut(wire)
/// Cut a specific wire.
/// User may be null
/datum/wires/proc/cut(wire, mob/user_or_null)
if(is_cut(wire))
cut_wires -= wire
on_cut(wire, mend = TRUE)
on_cut(wire, user_or_null, mend = TRUE)
else
cut_wires += wire
on_cut(wire, mend = FALSE)
on_cut(wire, user_or_null, mend = FALSE)
ui_update()

/datum/wires/proc/cut_color(color)
cut(get_wire(color))
/datum/wires/proc/cut_color(color, mob/user_or_null)
cut(get_wire(color), user_or_null)
ui_update()

/datum/wires/proc/cut_random()
cut(wires[rand(1, wires.len)])
/datum/wires/proc/cut_random(mob/user_or_null)
cut(wires[rand(1, wires.len)], user_or_null)
ui_update()

/datum/wires/proc/cut_all()
/datum/wires/proc/cut_all(mob/user_or_null)
for(var/wire in wires)
cut(wire)
cut(wire, user_or_null)
ui_update()

/datum/wires/proc/pulse(wire, user)
Expand Down Expand Up @@ -208,7 +210,9 @@
/datum/wires/proc/get_status()
return list()

/datum/wires/proc/on_cut(wire, mend = FALSE)
/// Called when a wire is asked to be cut
/// User accepts null
/datum/wires/proc/on_cut(wire, mob/user, mend = FALSE)
return

/datum/wires/proc/on_pulse(wire, user)
Expand Down Expand Up @@ -283,7 +287,7 @@
if(I || IsAdminGhost(usr))
if(I && holder)
I.play_tool_sound(holder, 20)
cut_color(target_wire)
cut_color(target_wire, usr)
. = TRUE
else
to_chat(L, "<span class='warning'>You need wirecutters!</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/airalarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
A.post_alert(0)
A.update_icon()

/datum/wires/airalarm/on_cut(wire, mend)
/datum/wires/airalarm/on_cut(wire, mob/user, mend)
var/obj/machinery/airalarm/A = holder
switch(wire)
if(WIRE_POWER) // Short out forever.
Expand Down
14 changes: 7 additions & 7 deletions code/datums/wires/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@
wires.ui_update()
ui_update()

/datum/wires/airlock/on_cut(wire, mend)
/datum/wires/airlock/on_cut(wire, mob/user, mend)
var/obj/machinery/door/airlock/A = holder
switch(wire)
if(WIRE_POWER1, WIRE_POWER2) // Cut to loose power, repair all to gain power.
if(mend && !is_cut(WIRE_POWER1) && !is_cut(WIRE_POWER2))
A.regainMainPower()
else
A.loseMainPower()
if(isliving(usr))
A.shock(usr, 50)
if(isliving(user))
A.shock(user, 50)
if(WIRE_BACKUP1, WIRE_BACKUP2) // Cut to loose backup power, repair all to gain backup power.
if(mend && !is_cut(WIRE_BACKUP1) && !is_cut(WIRE_BACKUP2))
A.regainBackupPower()
Expand All @@ -160,12 +160,12 @@
if(WIRE_SHOCK) // Cut to shock the door, mend to unshock.
if(mend)
if(A.secondsElectrified)
A.set_electrified(MACHINE_NOT_ELECTRIFIED, usr)
A.set_electrified(MACHINE_NOT_ELECTRIFIED, user)
else
if(A.secondsElectrified != MACHINE_ELECTRIFIED_PERMANENT)
A.set_electrified(MACHINE_ELECTRIFIED_PERMANENT, usr)
if(isliving(usr))
A.shock(usr, 50)
A.set_electrified(MACHINE_ELECTRIFIED_PERMANENT, user)
if(isliving(user))
A.shock(user, 50)
if(WIRE_SAFETY) // Cut to disable safeties, mend to re-enable.
A.safe = mend
if(WIRE_TIMING) // Cut to disable auto-close, mend to re-enable.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/airlock_cycle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
A.aidisabled = TRUE
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/advanced_airlock_controller, reset), wire), 100)

/datum/wires/advanced_airlock_controller/on_cut(wire, mend)
/datum/wires/advanced_airlock_controller/on_cut(wire, mob/user, mend)
var/obj/machinery/advanced_airlock_controller/A = holder
switch(wire)
if(WIRE_POWER) // Short out forever.
Expand Down
8 changes: 5 additions & 3 deletions code/datums/wires/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/power/apc, reset), wire), 10)
ui_update()

/datum/wires/apc/on_cut(index, mend)
/datum/wires/apc/on_cut(index, mob/user, mend)
var/obj/machinery/power/apc/A = holder
switch(index)
if(WIRE_POWER1, WIRE_POWER2) // Short out.
if(mend && !is_cut(WIRE_POWER1) && !is_cut(WIRE_POWER2))
A.shorted = FALSE
A.shock(usr, 50)
if (user)
A.shock(user, 50)
else
A.shorted = TRUE
A.shock(usr, 50)
if (user)
A.shock(user, 50)
if(WIRE_AI) // Disable AI control.
if(mend)
A.aidisabled = FALSE
Expand Down
5 changes: 3 additions & 2 deletions code/datums/wires/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
A.begin_process()
ui_update()

/datum/wires/autolathe/on_cut(wire, mend)
/datum/wires/autolathe/on_cut(wire, mob/user, mend)
var/obj/machinery/modular_fabricator/autolathe/A = holder
switch(wire)
if(WIRE_HACK)
Expand All @@ -48,5 +48,6 @@
if(WIRE_DISABLE)
A.disabled = !mend
if(WIRE_ZAP)
A.shock(usr, 50)
if (user)
A.shock(user, 50)
ui_update()
6 changes: 3 additions & 3 deletions code/datums/wires/dna_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
S.shock(user, 50)
ui_update()

/datum/wires/dna_scanner/on_cut(wire, mend)
/datum/wires/dna_scanner/on_cut(wire, mob/user, mend)
var/obj/machinery/dna_scannernew/S = holder
switch(wire)
if(WIRE_IDSCAN)
Expand All @@ -60,6 +60,6 @@
S.locked = TRUE
S.update_icon()
if(WIRE_ZAP1, WIRE_ZAP2)
if(isliving(usr))
S.shock(usr, 90)
if(isliving(user))
S.shock(user, 90)
ui_update()
2 changes: 1 addition & 1 deletion code/datums/wires/ecto_sniffer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
our_sniffer.activate()
..()

/datum/wires/ecto_sniffer/on_cut(wire, mend)
/datum/wires/ecto_sniffer/on_cut(wire, mob/user, mend)
var/obj/machinery/ecto_sniffer/our_sniffer = holder
our_sniffer.sensor_enabled = mend
4 changes: 2 additions & 2 deletions code/datums/wires/explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/datum/wires/explosive/on_pulse(index)
explode()

/datum/wires/explosive/on_cut(index, mend)
/datum/wires/explosive/on_cut(index, mob/user, mend)
explode()

/datum/wires/explosive/proc/explode()
Expand Down Expand Up @@ -104,7 +104,7 @@
else // Boom
explode()

/datum/wires/explosive/pizza/on_cut(wire, mend)
/datum/wires/explosive/pizza/on_cut(wire, mob/user, mend)
var/obj/item/pizzabox/P = holder
switch(wire)
if(WIRE_DISARM) // Disarm and untrap the box.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/fax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if(WIRE_LOADCHECK)
machine.allow_exotic_faxes = !machine.allow_exotic_faxes

/datum/wires/fax/on_cut(wire, mend)
/datum/wires/fax/on_cut(wire, mob/user, mend)
var/obj/machinery/fax/machine = holder
switch(wire)
if(WIRE_SHOCK)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if(WIRE_ACTIVATE)
M.cook()

/datum/wires/microwave/on_cut(wire, mend)
/datum/wires/microwave/on_cut(wire, mob/user, mend)
var/obj/machinery/microwave/M = holder
switch(wire)
if(WIRE_ACTIVATE)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/particle_accelerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if(WIRE_LIMIT)
C.visible_message("[icon2html(C, viewers(holder))]<b>[C]</b> makes a large whirring noise.")

/datum/wires/particle_accelerator/control_box/on_cut(wire, mend)
/datum/wires/particle_accelerator/control_box/on_cut(wire, mob/user, mend)
var/obj/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_POWER)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/r_n_d.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if(WIRE_DISABLE)
R.disabled = !R.disabled
ui_update()
/datum/wires/rnd/on_cut(wire, mend)
/datum/wires/rnd/on_cut(wire, mob/user, mend)
var/obj/machinery/rnd/R = holder
switch(wire)
if(WIRE_HACK)
Expand Down
22 changes: 14 additions & 8 deletions code/datums/wires/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
R.visible_message("[R]'s module servos twitch.", "Your module display flickers.")
ui_update()

/datum/wires/robot/on_cut(wire, mend)
/datum/wires/robot/on_cut(wire, mob/user, mend)
var/mob/living/silicon/robot/R = holder
switch(wire)
if(WIRE_AI) // Cut the AI wire to reset AI control.
if(!mend)
R.notify_ai(DISCONNECT)
log_combat(usr, R, "cut AI wire on cyborg[R.connected_ai ? " and disconnected from [ADMIN_LOOKUP(R.connected_ai)]": ""]", important = FALSE)
if (user)
log_combat(user, R, "cut AI wire on cyborg[R.connected_ai ? " and disconnected from [ADMIN_LOOKUP(R.connected_ai)]": ""]", important = FALSE)
if(R.shell)
R.undeploy()
R.connected_ai = null
Expand All @@ -81,24 +82,29 @@
if(mend)
if(!R.emagged)
R.lawupdate = TRUE
log_combat(usr, R, "enabled lawsync via wire", important = FALSE)
if (user)
log_combat(user, R, "enabled lawsync via wire", important = FALSE)
else if(!R.deployed) //AI shells must always have the same laws as the AI
R.lawupdate = FALSE
log_combat(usr, R, "disabled lawsync via wire")
if (user)
log_combat(user, R, "disabled lawsync via wire")
R.logevent("Lawsync Module fault [mend?"cleared":"detected"]")
if (WIRE_CAMERA) // Disable the camera.
if(!QDELETED(R.builtInCamera) && !R.scrambledcodes)
R.builtInCamera.status = mend
R.builtInCamera.toggle_cam(usr, FALSE)
R.builtInCamera.toggle_cam(user, FALSE)
R.visible_message("[R]'s camera lens focuses loudly.", "Your camera lens focuses loudly.")
R.logevent("Camera Module fault [mend?"cleared":"detected"]")
log_combat(usr, R, "[mend ? "enabled" : "disabled"] cyborg camera via wire")
if (user)
log_combat(user, R, "[mend ? "enabled" : "disabled"] cyborg camera via wire")
if(WIRE_LOCKDOWN) // Simple lockdown.
R.SetLockdown(!mend)
R.logevent("Motor Controller fault [mend?"cleared":"detected"]")
log_combat(usr, R, "[!R.lockcharge ? "locked down" : "released"] via wire", important = FALSE)
if (user)
log_combat(user, R, "[!R.lockcharge ? "locked down" : "released"] via wire", important = FALSE)
if(WIRE_RESET_MODULE)
if(R.has_module() && !mend)
R.ResetModule()
log_combat(usr, R, "reset the cyborg module via wire", important = FALSE)
if (user)
log_combat(user, R, "reset the cyborg module via wire", important = FALSE)
ui_update()
6 changes: 3 additions & 3 deletions code/datums/wires/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
SSU.shock(usr)
ui_update()

/datum/wires/suit_storage_unit/on_cut(wire, mend)
/datum/wires/suit_storage_unit/on_cut(wire, mob/user, mend)
var/obj/machinery/suit_storage_unit/SSU = holder
switch(wire)
if(WIRE_HACK)
SSU.uv_super = !mend
if(WIRE_SAFETY)
SSU.safeties = mend
if(WIRE_ZAP)
if(usr)
SSU.shock(usr)
if(user)
SSU.shock(user)
ui_update()
2 changes: 1 addition & 1 deletion code/datums/wires/syndicatebomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
B.detonation_timer += 10 SECONDS
delayed_hesitate = TRUE

/datum/wires/syndicatebomb/on_cut(wire, mend)
/datum/wires/syndicatebomb/on_cut(wire, mob/user, mend)
var/obj/machinery/syndicatebomb/B = holder
switch(wire)
if(WIRE_BOOM)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wires/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
V.shut_up = !V.shut_up
ui_update()

/datum/wires/vending/on_cut(wire, mend)
/datum/wires/vending/on_cut(wire, mob/user, mend)
var/obj/machinery/vending/V = holder
switch(wire)
if(WIRE_THROW)
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/gangs/dominator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
anchored = TRUE
layer = HIGH_OBJ_LAYER
max_integrity = 300
max_hit_damage = 30
integrity_failure = 0.33
move_resist = INFINITY
armor = list(MELEE = 20, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 10, BIO = 100, RAD = 100, FIRE = 10, ACID = 70, STAMINA = 0, BLEED = 0)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@
/obj/machinery/door/airlock/proc/on_break()
if(!panel_open)
panel_open = TRUE
wires.cut_all()
wires.cut_all(null)

/obj/machinery/door/airlock/proc/set_electrified(seconds, mob/user)
secondsElectrified = seconds
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
if(storage)
storage.take_damage(burn_damage * 10, BURN, FIRE)
// The wires get damaged too.
wires.cut_all()
wires.cut_all(null)
if(!toasted) //Special toast check to prevent a double finishing message.
if(mob_occupant)
visible_message("<span class='warning'>[src]'s door slides open, barraging you with the nauseating smell of charred flesh.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/syndicatebomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@

/obj/machinery/syndicatebomb/empty/Initialize(mapload)
. = ..()
wires.cut_all()
wires.cut_all(null)

/obj/machinery/syndicatebomb/self_destruct
name = "self-destruct device"
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/crab17.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
pixel_z = -8
layer = LARGE_MOB_LAYER
max_integrity = 600
max_hit_damage = 30
/// when this gets at this hp, it will run away! oh no!
var/next_health_to_teleport
var/mob/living/carbon/human/bogdanoff
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/paicard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
pai.can_transmit = !pai.can_transmit
else //receiving
pai.can_receive = !pai.can_receive
pai.radio.wires.cut(transmit_holder)//wires.cut toggles cut and uncut states
pai.radio.wires.cut(transmit_holder, usr)//wires.cut toggles cut and uncut states
transmit_holder = (transmitting ? pai.can_transmit : pai.can_receive) //recycling can be fun!
to_chat(usr, "<span class='notice'>You [transmit_holder ? "enable" : "disable"] your pAI's [transmitting ? "outgoing" : "incoming"] radio transmissions!</span>")
to_chat(pai, "<span class='notice'>Your owner has [transmit_holder ? "enabled" : "disabled"] your [transmitting ? "outgoing" : "incoming"] radio transmissions!</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
/obj/item/radio/Initialize(mapload)
wires = new /datum/wires/radio(src)
if(prison_radio)
wires.cut(WIRE_TX) // OH GOD WHY
wires.cut(WIRE_TX, null) // OH GOD WHY
secure_radio_connections = new
. = ..()
frequency = sanitize_frequency(frequency, freerange)
Expand Down
Loading

0 comments on commit e3da78e

Please sign in to comment.