Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Sep 23, 2024
1 parent 2183be6 commit 7fc44f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 9 additions & 3 deletions code/datums/components/ritual_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

if(!isobj(parent))
return COMPONENT_INCOMPATIBLE

src.attacking_item_type = attacking_item_type
src.allowed_categories = allowed_categories
src.allowed_species = allowed_species
Expand All @@ -35,10 +36,13 @@

/datum/component/ritual_object/proc/get_rituals() // We'll get all rituals for flexibility.
LAZYCLEARLIST(rituals)

for(var/datum/ritual/ritual as anything in typecacheof(allowed_categories))
if(ritual.name)
rituals += new ritual
ritual.link_object(parent)
if(!ritual.name)
continue

rituals += new ritual
ritual.ritual_object = parent

return

Expand All @@ -56,6 +60,7 @@
return

var/mob/living/carbon/human/human = user

if(attacking_item_type && !istype(item, attacking_item_type))
return

Expand Down Expand Up @@ -92,6 +97,7 @@

/datum/component/ritual_object/proc/get_available_rituals(mob/living/carbon/human/human)
var/list/rituals_list = list()

for(var/datum/ritual/ritual as anything in rituals)
if(ritual.charges == 0)
continue
Expand Down
13 changes: 4 additions & 9 deletions code/datums/rituals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
var/list/invokers = list()
/// If defined - do_after will be added to your ritual
var/cast_time

/datum/ritual/proc/link_object(obj/obj)
ritual_object = obj


/datum/ritual/Destroy(force)
ritual_object = null
LAZYNULL(used_things)
Expand Down Expand Up @@ -179,8 +176,8 @@
var/needed_amount = required_things[thing]
var/current_amount = 0

for(var/obj in range(finding_range, ritual_object))
if(!ispath(obj, thing))
for(var/atom/obj in range(finding_range, ritual_object))
if(!istype(obj, thing))
continue

if(obj == invoker)
Expand Down Expand Up @@ -349,7 +346,6 @@
return RITUAL_FAILED_ON_PROCEED

message_admins("[key_name(human)] accomplished mindtransfer ritual on [key_name(invoker)]")

return RITUAL_SUCCESSFUL

/datum/ritual/ashwalker/mind_transfer/disaster(obj/item/item, mob/living/carbon/human/invoker)
Expand All @@ -368,7 +364,6 @@
return

. = ..(bitflags)

return .

/datum/ritual/ashwalker/summon
Expand Down Expand Up @@ -400,6 +395,7 @@
var/obj/item/stack/sheet/sinew/sinew = locate() in used_things
var/obj/item/stack/sheet/animalhide/goliath_hide/hide = locate() in used_things
var/obj/item/organ/internal/regenerative_core/core = locate() in used_things

sinew.use(3)
hide.use(1)
qdel(core)
Expand All @@ -420,7 +416,6 @@
return RITUAL_FAILED_ON_PROCEED

human.forceMove(ritual_object)

return RITUAL_SUCCESSFUL

/datum/ritual/ashwalker/summon/disaster(obj/item/item, mob/living/carbon/human/invoker)
Expand Down

0 comments on commit 7fc44f1

Please sign in to comment.