Buffs Magnitis (#31040)

* Update magnitis.dm

* Update magnitis.dm

* Update magnitis.dm

* Update magnitis.dm

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

* Update magnitis.dm

* Update magnitis.dm

* Update magnitis.dm

* Update magnitis.dm

* Update magnitis.dm

---------

Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Co-authored-by: Fordoxia <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
CRUNCH
2025-11-28 03:52:13 +00:00
committed by GitHub
co-authored by Luc Fordoxia
parent d4a435f740
commit b2f2aa4392
+53 -46
View File
@@ -1,3 +1,7 @@
#define LOW_ATTRACTION_RANGE 2
#define MEDIUM_ATTRACTION_RANGE 4
#define HIGH_ATTRACTION_RANGE 6
/datum/disease/magnitis
name = "Magnitis"
max_stages = 4
@@ -7,57 +11,60 @@
agent = "Fukkos Miracos"
viable_mobtypes = list(/mob/living/carbon/human)
permeability_mod = 0.75
desc = "This disease disrupts the magnetic field of your body, making it act as if a powerful magnet. Injections of iron help stabilize the field."
severity = VIRUS_MINOR
desc = "This disease disrupts the magnetic field of your body, making it act as a powerful magnet. Injections of iron help stabilize the field."
severity = VIRUS_DANGEROUS
/datum/disease/magnitis/stage_act()
if(!..())
return FALSE
switch(stage)
if(1)
if(prob(5)) // Water, air, fire and dirt! Fucking magnets, how do they work!?
to_chat(affected_mob, "<span class='danger'>You query upon the nature of miracles...</span>")
if(2)
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You feel a slight shock course through your body.</span>")
if(prob(2))
for(var/obj/M in orange(2,affected_mob))
if(!M.anchored && (M.flags & CONDUCT))
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(2,affected_mob))
if(is_ai(S)) continue
step_towards(S,affected_mob)
if(prob(10))
to_chat(affected_mob, "<span class='danger'>You feel a light tingling sensation.</span>")
if(prob(10))
to_chat(affected_mob, "<span class='danger'>You feel a slight shock course through your body!</span>")
magnetic_pull(affected_mob, LOW_ATTRACTION_RANGE, 0)
if(3)
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You feel a strong shock course through your body.</span>")
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You feel like clowning around.</span>")
if(prob(4))
for(var/obj/M in orange(4,affected_mob))
if(!M.anchored && (M.flags & CONDUCT))
var/i
var/iter = rand(1,2)
for(i=0,i<iter,i++)
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(4,affected_mob))
if(is_ai(S)) continue
var/i
var/iter = rand(1,2)
for(i=0,i<iter,i++)
step_towards(S,affected_mob)
if(prob(10))
to_chat(affected_mob, "<span class='danger'>You feel pins and needles radiating through you!</span>")
if(prob(10))
to_chat(affected_mob, "<span class='userdanger'>You feel a strong shock course through your body.</span>")
magnetic_pull(affected_mob, MEDIUM_ATTRACTION_RANGE, 50)
if(4)
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You feel a powerful shock course through your body.</span>")
if(prob(2))
to_chat(affected_mob, "<span class='danger'>You query upon the nature of miracles.</span>")
if(prob(8))
for(var/obj/M in orange(6,affected_mob))
if(!M.anchored && (M.flags & CONDUCT))
var/i
var/iter = rand(1,3)
for(i=0,i<iter,i++)
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(6,affected_mob))
if(is_ai(S)) continue
var/i
var/iter = rand(1,3)
for(i=0,i<iter,i++)
step_towards(S,affected_mob)
return
if(prob(10))
to_chat(affected_mob, "<span class='userdanger'>You feel a thousand pinpricks across every inch of your body!</span>")
if(prob(10))
to_chat(affected_mob, "<span class='userdanger'>You feel a powerful shock course through your body!</span>")
magnetic_pull(affected_mob, HIGH_ATTRACTION_RANGE, 100)
/**
* Handles magnitis pulling and throwing stuff.
* Arguments:
* * `affected_mob` - The magnitis-affected mob doing the pulling.
* * `pull_range` - How far the magnetic influence reaches.
* * `throw_chance` - Probability affected objects will be violently thrown at the `affected_mob` instead of being harmlessly pulled.
*/
/datum/disease/magnitis/proc/magnetic_pull(mob/living/affected_mob, pull_range, throw_chance)
var/list/valid_pull_targets = list()
for(var/atom/movable/A in orange(pull_range, affected_mob))
if(!A.anchored && (A.flags & CONDUCT))
valid_pull_targets |= A
continue
if((ismachineperson(A) || issilicon(A)))
var/mob/living/M = A
if(!M.anchored && !HAS_TRAIT(M, TRAIT_MAGPULSE))
valid_pull_targets |= A
for(var/atom/movable/attracted_body in valid_pull_targets)
if(prob(throw_chance))
attracted_body.throw_at(affected_mob, pull_range + 1, 1)
else
for(var/i in 1 to rand(1, 2))
step_towards(attracted_body, affected_mob)
#undef LOW_ATTRACTION_RANGE
#undef MEDIUM_ATTRACTION_RANGE
#undef HIGH_ATTRACTION_RANGE