Skip to content

Commit

Permalink
Merge pull request #1236 from Gboster-0/artefacts
Browse files Browse the repository at this point in the history
Fixes hand-held artefacts not triggering their faults if in a player's inventory
  • Loading branch information
wraith-54321 authored Feb 23, 2024
2 parents 0d93561 + 8587642 commit 6d26110
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@
/datum/artifact_fault/on_trigger(datum/component/artifact/component)
if(component.active)
component.artifact_deactivate()

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
trigger_chance = 3
visible_message = "reaches a catastrophic overload, cracks forming at its surface!"


/datum/artifact_fault/explosion/on_trigger(datum/component/artifact/component)
component.holder.Shake(duration = 5 SECONDS, shake_interval = 0.08 SECONDS)
addtimer(CALLBACK(src, PROC_REF(payload), component), 5 SECONDS)


/datum/artifact_fault/explosion/proc/payload(datum/component/artifact/component)
explosion(component.holder, light_impact_range = 2, explosion_cause = src)
qdel(component.holder)

7 changes: 6 additions & 1 deletion monkestation/code/modules/art_sci_overrides/faults/ignite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
visible_message = "starts rapidly heating up while covering everything around it in something that seems to be oil."

/datum/artifact_fault/ignite/on_trigger(datum/component/artifact/component)
for(var/mob/living/living in range(rand(3, 5), component.parent))
var/center_turf = get_turf(component.parent)

if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/living in range(rand(3, 5), center_turf))
living.adjust_fire_stacks(10)
living.ignite_mob()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
trigger_chance = 1
visible_message = "blows someone up with mind."


/datum/artifact_fault/death/on_trigger(datum/component/artifact/component)
var/list/mobs = list()
var/mob/living/carbon/human
for(var/mob/living/carbon/mob in range(rand(3, 4), component.holder))

var/center_turf = get_turf(component.parent)

if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/carbon/mob in range(rand(3, 4), center_turf))
mobs += mob
human = pick(mobs)
if(!human)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
. = ..()
if(!length(reagents))
return
for(var/mob/living/carbon/living in range(rand(3, 5), component.parent))

var/center_turf = get_turf(component.parent)

if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/carbon/living in range(rand(3, 5), center_turf))
living.reagents.add_reagent(pick(reagents), rand(1, 5))
to_chat(living, span_warning("You feel a soft prick."))

Expand Down
7 changes: 6 additions & 1 deletion monkestation/code/modules/art_sci_overrides/faults/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
if(!length(speech))
return

for(var/mob/living/living in range(rand(7, 10), component.parent))
var/center_turf = get_turf(component.parent)

if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/living in range(rand(7, 10), center_turf))
if(prob(50))
living.say("; [pick(speech)]")
else
Expand Down
6 changes: 5 additions & 1 deletion monkestation/code/modules/art_sci_overrides/faults/warps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
if(!length(warp_areas))
warp_areas = GLOB.the_station_areas
var/turf/safe_turf = get_safe_random_station_turf(warp_areas)
var/center_turf = get_turf(component.parent)

for(var/mob/living/living in range(rand(3, 5), component.parent))
if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/living in range(rand(3, 5), center_turf))
living.forceMove(safe_turf)
to_chat(living, span_warning("You feel woozy after being warped around."))
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
if(!length(whispers))
return

for(var/mob/living/living in range(rand(7, 10), component.parent))
var/center_turf = get_turf(component.parent)

if(!center_turf)
CRASH("[src] had attempted to trigger, but failed to find the center turf!")

for(var/mob/living/living in range(rand(7, 10), center_turf))
to_chat(living, span_hear("[pick(whispers)]"))

0 comments on commit 6d26110

Please sign in to comment.