Removes the random chance that a detomatix cartridge will backfire (#23906)

* Bro why is this a thing

* Eh this is neater

* Apply suggestions from code review

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>

---------

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-01-30 14:45:08 +00:00
committed by GitHub
co-authored by GDN
parent 122f12ab97
commit c872f31612
2 changed files with 7 additions and 22 deletions
+6 -21
View File
@@ -42,32 +42,17 @@
name = "*Detonate*"
icon = "exclamation-circle"
/datum/data/pda/messenger_plugin/virus/detonate/user_act(mob/user as mob, obj/item/pda/P)
. = ..(user, P)
/datum/data/pda/messenger_plugin/virus/detonate/user_act(mob/user, obj/item/pda/pda_to_detonate)
. = ..()
if(.)
var/difficulty = 0
if(pda.cartridge)
difficulty += pda.cartridge.programs.len / 2
else
difficulty += 2
if(!P.detonate || P.hidden_uplink)
if(!pda_to_detonate.detonate || pda_to_detonate.hidden_uplink)
user.show_message("<span class='warning'>The target PDA does not seem to respond to the detonation command.</span>", 1)
pda.cartridge.charges++
else if(prob(difficulty * 12))
user.show_message("<span class='warning'>An error flashes on your [pda].</span>", 1)
else if(prob(difficulty * 3))
user.show_message("<span class='danger'>Energy feeds back into your [pda]!</span>", 1)
pda.close(user)
pda.explode()
log_admin("[key_name(user)] just attempted to blow up [P] with the Detomatix cartridge but failed, blowing themselves up")
message_admins("[key_name_admin(user)] just attempted to blow up [P] with the Detomatix cartridge but failed, blowing themselves up", 1)
else
user.show_message("<span class='notice'>Success!</span>", 1)
log_admin("[key_name(user)] just attempted to blow up [P] with the Detomatix cartridge and succeeded")
message_admins("[key_name_admin(user)] just attempted to blow up [P] with the Detomatix cartridge and succeeded", 1)
P.explode()
log_admin("[key_name(user)] just blew up [pda_to_detonate] with the Detomatix cartridge")
message_admins("[key_name_admin(user)] just blew up [pda_to_detonate] with the Detomatix cartridge", 1)
pda_to_detonate.explode()
/datum/data/pda/messenger_plugin/virus/frame
icon = "exclamation-circle"