mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-05 22:09:05 +00:00
About The Pull Request Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage. Also changes a couple of places where a list was picked from instead of using get_sfx internal calls This was done via regex: (playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1 (playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0 full sed commands: /(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE /(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE I'm not very good with regex and these could probably be optimized, but they worked. Why It's Good For The Game Code usability
125 lines
3.7 KiB
Plaintext
125 lines
3.7 KiB
Plaintext
/obj/item/implant/explosive
|
|
name = "microbomb implant"
|
|
desc = "And boom goes the weasel."
|
|
icon_state = "explosive"
|
|
actions_types = list(/datum/action/item_action/explosive_implant)
|
|
// Explosive implant action is always available.
|
|
var/weak = 2
|
|
var/medium = 0.8
|
|
var/heavy = 0.4
|
|
var/delay = 7
|
|
var/popup = FALSE // is the DOUWANNABLOWUP window open?
|
|
var/active = FALSE
|
|
|
|
/obj/item/implant/explosive/on_mob_death(mob/living/L, gibbed)
|
|
activate("death")
|
|
|
|
/obj/item/implant/explosive/get_data()
|
|
var/dat = {"<b>Implant Specifications:</b><BR>
|
|
<b>Name:</b> Robust Corp RX-78 Employee Management Implant<BR>
|
|
<b>Life:</b> Activates upon death.<BR>
|
|
<b>Important Notes:</b> Explodes<BR>
|
|
<HR>
|
|
<b>Implant Details:</b><BR>
|
|
<b>Function:</b> Contains a compact, electrically detonated explosive that detonates upon receiving a specially encoded signal or upon host death.<BR>
|
|
<b>Special Features:</b> Explodes<BR>
|
|
"}
|
|
return dat
|
|
|
|
/obj/item/implant/explosive/activate(cause)
|
|
. = ..()
|
|
if(!cause || !imp_in || active)
|
|
return 0
|
|
if(cause == "action_button" && !popup)
|
|
popup = TRUE
|
|
var/response = alert(imp_in, "Are you sure you want to activate your [name]? This will cause you to explode!", "[name] Confirmation", "Yes", "No")
|
|
popup = FALSE
|
|
if(response == "No")
|
|
return 0
|
|
heavy = round(heavy)
|
|
medium = round(medium)
|
|
weak = round(weak)
|
|
to_chat(imp_in, "<span class='notice'>You activate your [name].</span>")
|
|
active = TRUE
|
|
var/turf/boomturf = get_turf(imp_in)
|
|
message_admins("[ADMIN_LOOKUPFLW(imp_in)] has activated their [name] at [ADMIN_VERBOSEJMP(boomturf)], with cause of [cause].")
|
|
//If the delay is short, just blow up already jeez
|
|
if(delay <= 7)
|
|
explosion(src,heavy,medium,weak,weak, flame_range = weak)
|
|
if(imp_in)
|
|
imp_in.gib(1)
|
|
qdel(src)
|
|
return
|
|
timed_explosion()
|
|
|
|
/obj/item/implant/explosive/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
|
|
for(var/X in target.implants)
|
|
if(istype(X, type))
|
|
var/obj/item/implant/explosive/imp_e = X
|
|
imp_e.heavy += heavy
|
|
imp_e.medium += medium
|
|
imp_e.weak += weak
|
|
imp_e.delay += delay
|
|
qdel(src)
|
|
return 1
|
|
|
|
return ..()
|
|
|
|
/obj/item/implant/explosive/proc/timed_explosion()
|
|
imp_in.visible_message("<span class='warning'>[imp_in] starts beeping ominously!</span>")
|
|
playsound(loc, 'sound/items/timer.ogg', 30, FALSE)
|
|
sleep(delay*0.25)
|
|
if(imp_in && !imp_in.stat)
|
|
imp_in.visible_message("<span class='warning'>[imp_in] doubles over in pain!</span>")
|
|
imp_in.Paralyze(140)
|
|
playsound(loc, 'sound/items/timer.ogg', 30, FALSE)
|
|
sleep(delay*0.25)
|
|
playsound(loc, 'sound/items/timer.ogg', 30, FALSE)
|
|
sleep(delay*0.25)
|
|
playsound(loc, 'sound/items/timer.ogg', 30, FALSE)
|
|
sleep(delay*0.25)
|
|
explosion(src,heavy,medium,weak,weak, flame_range = weak)
|
|
if(imp_in)
|
|
imp_in.gib(1)
|
|
qdel(src)
|
|
|
|
/obj/item/implant/explosive/macro
|
|
name = "macrobomb implant"
|
|
desc = "And boom goes the weasel. And everything else nearby."
|
|
icon_state = "explosive"
|
|
weak = 16
|
|
medium = 8
|
|
heavy = 4
|
|
delay = 70
|
|
|
|
/obj/item/implant/explosive/macro/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
|
|
for(var/X in target.implants)
|
|
if(istype(X, type))
|
|
return 0
|
|
|
|
for(var/Y in target.implants)
|
|
if(istype(Y, /obj/item/implant/explosive))
|
|
var/obj/item/implant/explosive/imp_e = Y
|
|
heavy += imp_e.heavy
|
|
medium += imp_e.medium
|
|
weak += imp_e.weak
|
|
delay += imp_e.delay
|
|
qdel(imp_e)
|
|
break
|
|
|
|
return ..()
|
|
|
|
|
|
/obj/item/implanter/explosive
|
|
name = "implanter (microbomb)"
|
|
imp_type = /obj/item/implant/explosive
|
|
|
|
/obj/item/implantcase/explosive
|
|
name = "implant case - 'Explosive'"
|
|
desc = "A glass case containing an explosive implant."
|
|
imp_type = /obj/item/implant/explosive
|
|
|
|
/obj/item/implanter/explosive_macro
|
|
name = "implanter (macrobomb)"
|
|
imp_type = /obj/item/implant/explosive/macro
|