Items exploding while thrown admin option (or on arcane tampered floors) (#33830)

* Items exploding on arcane tampered floors (or as an admin option)

* Items exploding on arcane tampered floors (or as an admin option)

* throw_impact as suggested

* removing redundant check, adding sanities due to qdel possibility

* less indents

* less wizard cheese

* changed method, works muuuch better now

* inverted this on request

* fixing this

---------

Co-authored-by: SECBATON GRIFFON <sage>
This commit is contained in:
SECBATON GRIFFON
2023-03-12 05:31:33 +00:00
committed by GitHub
parent bad457429b
commit 67a6fd0a06
30 changed files with 77 additions and 65 deletions

View File

@@ -166,8 +166,7 @@ var/list/valid_ninja_suits = list(
//This can stick into silicons and humans
/obj/item/stack/shuriken/throw_impact(atom/impacted_atom, speed, mob/user)
..()
if(isliving(impacted_atom))
if(!..() && isliving(impacted_atom))
var/mob/living/L = impacted_atom
forceMove(L)
visible_message("<span class='warning'>The [src] sticks to \the [L]!</span>")

View File

@@ -213,6 +213,19 @@
..()
qdel(src)
var/global/objects_thrown_when_explode = FALSE
/obj/item/throw_impact(atom/impacted_atom, speed, mob/user)
..()
if(isturf(impacted_atom))
var/turf/T = impacted_atom
if(objects_thrown_when_explode || (T.arcanetampered && T.arcanetampered != user))
playsound(T, get_sfx("explosion_small"), 100, 1, get_rand_frequency(), falloff = 5)
T.turf_animation('icons/effects/96x96.dmi',"explosion_small",-WORLD_ICON_SIZE, -WORLD_ICON_SIZE, 13)
qdel(src)
return 1
return 0
/obj/item/Topic(href, href_list)
.=..()
if(href_list["close"])

View File

@@ -57,7 +57,8 @@
return ..()
/obj/item/ornament/throw_impact(atom/hit_atom)
..()
if(..())
return
src.visible_message("<span class='warning'>\The [src] shatters!</span>","<span class='warning'>You hear a shatter!</span>")
if(get_turf(src))
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)

View File

@@ -66,7 +66,8 @@
imbibe(M)
/obj/item/potion/throw_impact(atom/hit_atom)
..()
if(..())
return
src.visible_message("<span class='warning'>\The [src] shatters!</span>","<span class='warning'>You hear a shatter!</span>")
var/turf/T = get_turf(src)
if(T)

View File

@@ -176,8 +176,7 @@
surgerysound = 'sound/items/scalpel.ogg'
/obj/item/soulstone/gem/throw_impact(var/atom/hit_atom, var/speed, var/mob/user)
..()
if (isturf(loc))
if (!..() && isturf(loc))
var/obj/item/soulstone/S = new(loc)
if (shade)
shade.forceMove(S)

View File

@@ -618,8 +618,8 @@
w_class = W_CLASS_TINY
/obj/item/toy/snappop/throw_impact(atom/hit_atom)
..()
pop()
if(!..())
pop()
/obj/item/toy/snappop/Crossed(var/mob/living/M)
if(istype(M) && M.size > SIZE_SMALL) //i guess carp and shit shouldn't set them off

View File

@@ -577,8 +577,7 @@
..()
/obj/item/weapon/pocket_mirror/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(!isturf(hit_atom))
if(..() || !isturf(hit_atom))
return
if (prob(25))
shatter(user)

View File

@@ -94,8 +94,8 @@
diceroll(user, 0)
/obj/item/weapon/dice/throw_impact(atom/hit_atom, speed, user)
..()
diceroll(user, 1)
if(..())
diceroll(user, 1)
/obj/item/weapon/dice/proc/show_roll(mob/user as mob, thrown, result)
var/comment = ""

View File

@@ -264,8 +264,7 @@ var/global/list/bottle_colour_choices = list("Blue" = "#0094FF","Dark Blue" = "#
empty_contents_to(get_turf(attacked))
/obj/item/weapon/storage/pill_bottle/dice/cup/throw_impact(atom/impacted_atom, speed, mob/user)
..()
if(contents.len)
if(..() && contents.len)
empty_contents_to(get_turf(src))
/obj/item/weapon/storage/pill_bottle/dice/cup/empty_contents_to(var/atom/place)

View File

@@ -337,9 +337,9 @@
explosion(target, 0, 0, 1, whodunnit = user)
/obj/item/weapon/damocles/throw_impact(atom/hit_atom, speed, mob/user)
..()
explosion(get_turf(src), 0, 2, 3, whodunnit = user)
qdel(src)
if(..())
explosion(get_turf(src), 0, 2, 3, whodunnit = user)
qdel(src)
/obj/item/weapon/caber
name = "Ullapool Caber"
@@ -364,7 +364,7 @@
/obj/item/weapon/caber/Destroy()
processing_objects -= src
..()
/obj/item/weapon/caber/attack_self(mob/user)
cant_drop = !cant_drop
to_chat(user,"<span class='notice'>You [cant_drop ? "activate" : "deactivate"] the safety grip and explosive mode.</span>")

View File

@@ -882,6 +882,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretsfun=switchon'>Flip all (ALL Z-LEVELS) light switches to on (Lags briefly)</A><BR>
<A href='?src=\ref[src];secretsfun=create_artifact'>Create custom artifact</A><BR>
<BR>
<A href='?src=\ref[src];secretsfun=athfthrowing'>Toggle thrown items exploding on stop</A><BR>
<A href='?src=\ref[src];secretsfun=togglenarsie'>Toggle Nar-Sie's behaviour</A><BR>
<BR>
<A href='?src=\ref[src];secretsfun=fakealerts'>Trigger a fake alert</A><BR>

View File

@@ -3948,6 +3948,11 @@
if(choice == "Nar-Singulo")
message_admins("[key_name_admin(usr)] has set narsie's behaviour to \"Nar-Singulo\".")
narsie_behaviour = "Nar-Singulo"
if("athfthrowing")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","TE")
objects_thrown_when_explode = !objects_thrown_when_explode
message_admins("[key_name_admin(usr)] has toggled items exploding when thrown [objects_thrown_when_explode ? "ON" : "OFF"].")
if("hellonearth")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","NS")

View File

@@ -56,7 +56,7 @@
episode_names += new /datum/episode_name("THE CREW'S [pick("DAY OUT", "BIG GAY ADVENTURE", "LAST DAY", "[pick("WILD", "WACKY", "LAME", "UNEXPECTED")] VACATION", "CHANGE OF HEART", "NEW GROOVE", "SCHOOL MUSICAL", "HISTORY LESSON", "FLYING CIRCUS", "SMALL PROBLEM", "BIG SCORE", "BLOOPER REEL", "GOT IT", "LITTLE SECRET", "SPECIAL OFFER", "SPECIALTY", "WEAKNESS", "CURIOSITY", "ALIBI", "LEGACY", "BIRTHDAY PARTY", "REVELATION", "ENDGAME", "RESCUE", "PAYBACK")]")
episode_names += new /datum/episode_name("THE CREW GETS [pick("RACIST", "SERIOUS ABOUT [pick("DRUG ABUSE", "CRIME", "PRODUCTIVITY", "ANCIENT AMERICAN CARTOONS", "SPACEBALL")]", "PICKLED", "AN ANAL PROBE", "PIZZA", "NEW WHEELS", "A VALUABLE HISTORY LESSON", "A BREAK", "HIGH", "TO LIVE", "TO RELIVE THEIR CHILDHOOD", "EMBROILED IN CIVIL WAR", "DOWN WITH IT", "FIRED", "BUSY", "THEIR SECOND CHANCE", "TRAPPED", "THEIR REVENGE")]")
episode_names += new /datum/episode_name("[pick("BALANCE OF POWER", "SPACE TRACK", "SEX BOMB", "WHOSE IDEA WAS THIS ANYWAY?", "WHATEVER HAPPENED, HAPPENED", "THE GOOD, THE BAD, AND [uppr_name]", "RESTRAIN YOUR ENJOYMENT", "REAL HOUSEWIVES OF [uppr_name]", "MEANWHILE, ON [uppr_name]...", "CHOOSE YOUR OWN ADVENTURE", "NO PLACE LIKE HOME", "LIGHTS, CAMERA, [uppr_name]!", "50 SHADES OF [uppr_name]", "GOODBYE, [uppr_name]!", "THE SEARCH", \
"THE CURIOUS CASE OF [uppr_name]", "ONE HELL OF A PARTY", "FOR YOUR CONSIDERATION", "PRESS YOUR LUCK", "A STATION CALLED [uppr_name]", "CRIME AND PUNISHMENT", "MY DINNER WITH [uppr_name]", "UNFINISHED BUSINESS", "THE ONLY STATION THAT'S NOT ON FIRE (YET)", "SOMEONE'S GOTTA DO IT", "THE [uppr_name] MIX-UP", "PILOT", "PROLOGUE", "FINALE", "UNTITLED", "THE END")]")
"THE CURIOUS CASE OF [uppr_name]", "ONE HELL OF A PARTY", "FOR YOUR CONSIDERATION", "PRESS YOUR LUCK", "A STATION CALLED [uppr_name]", "CRIME AND PUNISHMENT", "MY DINNER WITH [uppr_name]", "UNFINISHED BUSINESS", "THE ONLY STATION THAT'S NOT ON FIRE (YET)", "SOMEONE'S GOTTA DO IT", "THE [uppr_name] MIX-UP", "TRULY THEY WERE, \A [uppr_name]", "PILOT", "PROLOGUE", "FINALE", "UNTITLED", "THE END")]")
episode_names += new /datum/episode_name("[pick("SPACE", "SEXY", "DRAGON", "WARLOCK", "LAUNDRY", "GUN", "ADVERTISING", "DOG", "CARBON MONOXIDE", "NINJA", "WIZARD", "SOCRATIC", "JUVENILE DELIQUENCY", "POLITICALLY MOTIVATED", "RADTACULAR SICKNASTY", "CORPORATE", "MEGA")] [pick("QUEST", "FORCE", "ADVENTURE")]", weight=25)
switch(score.crewscore)

View File

@@ -160,7 +160,8 @@
/obj/item/trash/plate/throw_impact(atom/hit_atom)
..()
if(..())
return
for (var/obj/item/trash/plate/P in plates)
plates -= P
if(prob(70))

View File

@@ -359,8 +359,7 @@
to_chat(user, "<span class='warning'>You cannot plant \the [O] in \the [src].</span>")
/obj/item/claypot/throw_impact(atom/hit_atom)
..()
if(prob(40))
if(!..() && prob(40))
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 75, 1)
new/obj/effect/decal/cleanable/clay_fragments(src.loc)
src.visible_message("<span class='warning'>\The [src.name] has been smashed.</span>","<span class='warning'>You hear a crashing sound.</span>")

View File

@@ -37,7 +37,7 @@
/obj/item/device/gps/mining,
/obj/item/weapon/storage/belt/mining,
)
/******************************Lantern*******************************/
/obj/item/device/flashlight/lantern
@@ -791,8 +791,7 @@
..()
/obj/item/device/mobcapsule/throw_impact(atom/A, speed, mob/user)
..()
if(!tripped)
if(!..() && !tripped)
if(contained_mob)
dump_contents(user)
tripped = 1

View File

@@ -218,8 +218,7 @@
icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom) //STOP LATCHING ONTO HEADLESS PEOPLE
..()
if(stat == CONSCIOUS)
if(!..() && stat == CONSCIOUS)
icon_state = "[initial(icon_state)]"
if(ishuman(hit_atom))
var/mob/living/carbon/human/H = hit_atom

View File

@@ -220,8 +220,8 @@
qdel(src)
/obj/item/weapon/holder/animal/slime/throw_impact(atom/hit_atom)
..()
unfreeze()
if(!..())
unfreeze()
/obj/item/weapon/holder/animal/slime/attack_self(mob/user)
..()

View File

@@ -107,8 +107,7 @@
throw_range = 12
throw_speed = 1
/obj/item/weapon/p_folded/plane/throw_impact(var/atom/target, speed, mob/user)
..()
if(user) //runtimes not allowed
if(!..() && user) //runtimes not allowed
if(ishuman(target) && (user.zone_sel.selecting == "eyes" || prob(20)))
var/mob/living/carbon/human/H = target
if (H.check_body_part_coverage(EYES))

View File

@@ -711,8 +711,8 @@ var/global/list/obj/machinery/light/alllights = list()
..()
/obj/item/weapon/light/throw_impact(atom/hit_atom)
..()
shatter()
if(!..())
shatter()
/obj/item/weapon/light/bulb/fire
name = "fire bulb"

View File

@@ -252,8 +252,7 @@
cannonAdjust()
/obj/item/cannonball/iron/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(isliving(hit_atom) && cannonFired)
if(!..() && isliving(hit_atom) && cannonFired)
siegeMob(hit_atom)
/obj/item/cannonball/iron/proc/siegeMachine(var/obj/machinery/M)
@@ -507,7 +506,8 @@
honkBounce(cTarg)
/obj/item/cannonball/bananium/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(..())
return
if(!cannonFired)
lastBounceCount = 0
return

View File

@@ -1818,8 +1818,7 @@
//smashing when thrown
/obj/item/weapon/reagent_containers/food/drinks/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(isGlass && isturf(loc)) // don't shatter if we got caught mid-flight
if(!..() && isGlass && isturf(loc)) // don't shatter if we got caught mid-flight
isGlass = 0 //to avoid it from hitting the wall, then hitting the floor, which would cause two broken bottles to appear
visible_message("<span class='warning'>The [smashtext][name] shatters!</span>","<span class='warning'>You hear a shatter!</span>")
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)

View File

@@ -43,7 +43,7 @@
volume = 100 //Double amount snacks can carry, so that food prepared from excellent items can contain all the nutriments it deserves
var/timer = 0 //currently only used on skittering food
/obj/item/weapon/reagent_containers/food/snacks/Destroy()
var/turf/T = get_turf(src)
if(contents.len)
@@ -583,7 +583,7 @@
// Consult sushi types below for examples of usage.
// Multispawners take the total amount of reagents, both the ones added by the recipe and the ingredients's ones, divides the number by the child volume and spawns that many of items.
// For example: If the child volume is 1 and the total reagents, both from the ingredients and the extra upon cooking, add to 10u, then it would spawn 10 items.
// For example: If the child volume is 1 and the total reagents, both from the ingredients and the extra upon cooking, add to 10u, then it would spawn 10 items.
// This means that "stronger" ingredients spawn more items.
// If you have child volume 5, the recipe adds 10u reagents and the ingredients' reagents add 10 more, the multispawner would spawn 4 items, since (10+10):5=4.
// Only the fooditem ingredient reagents get tallied, any "raw" reagents the recipe calls for, such as flour, don't get counted for multispawner purposes.
@@ -1575,7 +1575,8 @@
/obj/item/weapon/reagent_containers/food/snacks/pie/throw_impact(atom/hit_atom)
set waitfor = FALSE
..()
if(..())
return
if(ismob(hit_atom))
var/mob/M = hit_atom
src.visible_message("<span class='warning'>\The [src] splats in [M]'s face!</span>")
@@ -5145,7 +5146,7 @@
name = "xeno sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/xeno
child_volume = 3.5
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/xeno/New()
..()
reagents.add_reagent(NUTRIMENT, 4) //spawns 4
@@ -5159,7 +5160,7 @@
name = "chicken sliders"
child_type = /obj/item/weapon/reagent_containers/food/snacks/slider/chicken
child_volume = 3.5
/obj/item/weapon/reagent_containers/food/snacks/multispawner/slider/chicken/New()
..()
reagents.add_reagent(NUTRIMENT, 4) //spawns 4
@@ -7996,14 +7997,14 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
icon_state = "bugburger"
var/skitterdelay = 30
var/skitterchance = 50
/obj/item/weapon/reagent_containers/food/snacks/skitter/New()
..()
processing_objects += src
/obj/item/weapon/reagent_containers/food/snacks/skitter/pickup(mob/user)
timer = 0
/obj/item/weapon/reagent_containers/food/snacks/skitter/process()
timer += 1
if(timer > skitterdelay && istype(loc, /turf) && prob(skitterchance))
@@ -8023,7 +8024,7 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
icon_state = "bugburger"
food_flags = FOOD_MEAT
base_crumb_chance = 20
/obj/item/weapon/reagent_containers/food/snacks/skitter/gunkburger/New()
..()
reagents.add_reagent(NUTRIMENT, 6)
@@ -8039,7 +8040,7 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
icon_state = "deluxebugburger"
food_flags = FOOD_MEAT
base_crumb_chance = 20
/obj/item/weapon/reagent_containers/food/snacks/skitter/deluxegunkburger/New()
..()
reagents.add_reagent(NUTRIMENT, 12)
@@ -8057,7 +8058,7 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
base_crumb_chance = 20
skitterchance = 40
skitterdelay = 60 //takes longer for super gunkburgers to walk and they walk less, muh weight or something
/obj/item/weapon/reagent_containers/food/snacks/skitter/supergunkburger/New()
..()
reagents.add_reagent(NUTRIMENT, 40)
@@ -8101,9 +8102,9 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
icon_state = "cockroachsalad"
trash = /obj/item/trash/snack_bowl
food_flags = FOOD_MEAT
random_filling_colors = list("#610000", "#32AE32")
random_filling_colors = list("#610000", "#32AE32")
base_crumb_chance = 0
/obj/item/weapon/reagent_containers/food/snacks/popcorn/roachsalad/after_consume()
if(prob(unpopped))
to_chat(usr, "<span class='warning'>A cockroach wriggles out of the bowl!</span>")
@@ -8148,7 +8149,7 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
reagents.add_reagent(ROACHSHELL, 8) //no roaches were harmed this time, it's all exoskeleton flakes
reagents.add_reagent(WATER, 5)
bitesize = 5
/obj/item/weapon/reagent_containers/food/snacks/gunksoupembassy/process()
timer += 1
if(prob(20) && timer >= 10)
@@ -8205,7 +8206,7 @@ var/global/list/bomb_like_items = list(/obj/item/device/transfer_valve, /obj/ite
reagents.add_reagent(SALINE, 1)
desc = "The flavour of the maintenance halls in pie form."
bitesize = 3
/obj/item/weapon/reagent_containers/food/snacks/sliceable/gunkcake
name = "gunk cake"
desc = "The apex of garbage-based confectionary research."

View File

@@ -42,8 +42,7 @@
qdel(src)
/obj/item/weapon/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(isturf(hit_atom))
if(!..() && isturf(hit_atom))
new/obj/effect/decal/cleanable/egg_smudge(loc)
new/obj/item/trash/egg(loc)
splat_reagent_reaction(hit_atom,user)

View File

@@ -84,8 +84,7 @@ var/list/special_fruits = list()
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(!seed || !src)
if(..() || !seed || !src)
return
//if(seed.stinging) //we do NOT want to transfer reagents on throw, as it would mean plantbags full of throwable chloral injectors
// stinging_apply_reagents(M) //plus all sorts of nasty stuff like throw_impact not targeting a specific bodypart to check for protection.

View File

@@ -114,8 +114,7 @@
reagents.reaction(held_item)
/obj/item/weapon/reagent_containers/glass/jar/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(hit_atom)
if(!..() && hit_atom)
src.visible_message("<span class='warning'>The [src.name] shatters!</span>","<span class='warning'>You hear a shatter!</span>")
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
reagents.reaction(loc, TOUCH)

View File

@@ -133,7 +133,8 @@ var/global/list/invoked_emotions = list()
qdel(src)
/obj/item/weapon/paper/emotion_invoker/throw_impact(atom/hit_atom)
..()
if(..())
return
if(isActive)
if(hit_atom == curseTarget)
inflictCurse()

View File

@@ -37,7 +37,8 @@
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
/obj/item/bluespace_crystal/throw_impact(atom/hit_atom)
. = ..()
if(..())
return
var/datum/zLevel/L = get_z_level(src)
if(isliving(hit_atom) && L && !L.teleJammed)

View File

@@ -162,8 +162,8 @@ var/global/global_cricket_population = 0
escape()
/obj/item/cricketfarm/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
escape()
if(!..())
escape()
/obj/item/cricketfarm/kick_act(mob/user)
..()

View File

@@ -350,8 +350,7 @@ var/list/virusdishes = list()
processing_objects.Add(src)
/obj/item/weapon/virusdish/throw_impact(atom/hit_atom, var/speed, mob/user)
..()
if(isturf(hit_atom))
if(!..() && isturf(hit_atom))
visible_message("<span class='danger'>The virus dish shatters on impact!</span>")
shatter(user)