Merge pull request #16284 from AffectedArc07/sorium-ldm-nerf

Nerfs sorium and LDM
This commit is contained in:
Fox McCloud
2021-07-13 00:41:05 -04:00
committed by GitHub
3 changed files with 27 additions and 8 deletions
@@ -29,7 +29,7 @@
/datum/reagent/consumable/drink/apple_pocalypse/on_mob_life(mob/living/M)
if(prob(1))
var/turf/simulated/T = get_turf(M)
goonchem_vortex(T, 1, 0)
goonchem_vortex(T, TRUE, 0, TRUE) // Ignore the 0 volume
to_chat(M, "<span class='notice'>You briefly feel super-massive, like a black hole. Probably just your imagination...</span>")
return ..()
@@ -119,7 +119,7 @@
/datum/reagent/consumable/drink/grape_granade/on_mob_life(mob/living/M)
if(prob(1))
var/turf/simulated/T = get_turf(M)
goonchem_vortex(T, 0, 0)
goonchem_vortex(T, FALSE, 0, TRUE) // Ignore the 0 volume
M.emote("burp")
to_chat(M, "<span class='notice'>You feel ready to burst! Oh wait, just a burp...</span>")
else if(prob(25))
+23 -4
View File
@@ -53,18 +53,37 @@
for(var/j = 1, j <= rand(1, 3), j++)
step(S, pick(NORTH,SOUTH,EAST,WEST))
/proc/goonchem_vortex(turf/T, setting_type, volume)
if(setting_type)
/**
* Throws or pulls objects to/from a chem reaction
*
* Scales the amount of objects thrown with the volume, unless ignore_volume is TRUE
*
* Arguments:
* * T - The turf to use as the throw from/to point
* * pull - Do we want to pull objects towards T (TRUE) or push them away from it (FALSE)
* * volume - The volume of reagents. Used to scale the effect is ignore_volume = FALSE
* * ignore_volume - Do we want to ignore the volume of reagents and just throw regardless
*/
/proc/goonchem_vortex(turf/T, pull, volume, ignore_volume = FALSE)
if(pull)
new /obj/effect/temp_visual/implosion(T)
playsound(T, 'sound/effects/whoosh.ogg', 25, 1) //credit to Robinhood76 of Freesound.org for this.
else
new /obj/effect/temp_visual/shockwave(T)
playsound(T, 'sound/effects/bang.ogg', 25, 1)
for(var/atom/movable/X in view(2 + setting_type + (volume > 30 ? 1 : 0), T))
// PARADISE EDIT: Allow only a certain amount of atoms to be pulled per unit
var/units_per_atom = 5
var/atoms_to_move = round(volume / units_per_atom)
var/moved_count = 0
// The ternary below isnt exactly needed, but it makes code more readable because `pull` is a bool
for(var/atom/movable/X in view(2 + (pull ? 1 : 0) + (volume > 30 ? 1 : 0), T))
if(istype(X, /obj/effect))
continue //stop pulling smoke and hotspots please
if(X && !X.anchored && X.move_resist <= MOVE_FORCE_DEFAULT)
if(setting_type)
if(pull)
X.throw_at(T, 20 + round(volume * 2), 1 + round(volume / 10))
else
X.throw_at(get_edge_target_turf(T, get_dir(T, X)), 20 + round(volume * 2), 1 + round(volume / 10))
moved_count++
if((moved_count >= atoms_to_move) && !ignore_volume)
break
@@ -104,7 +104,7 @@
var/turf/T = get_turf(holder.my_atom)
if(!T)
return
goonchem_vortex(T, 0, created_volume)
goonchem_vortex(T, FALSE, created_volume)
/datum/chemical_reaction/sorium_explosion/sorium
name = "sorium_vortex"
@@ -133,7 +133,7 @@
var/turf/simulated/T = get_turf(holder.my_atom)
if(!T)
return
goonchem_vortex(T, 1, created_volume)
goonchem_vortex(T, TRUE, created_volume)
/datum/chemical_reaction/ldm_implosion/liquid_dark_matter
name = "LDM Vortex"