Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDawnFox committed Jan 22, 2025
1 parent 542839b commit 4d54ca4
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 20 deletions.
30 changes: 15 additions & 15 deletions code/datums/components/ritual_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@
/datum/component/ritual_object/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_ATOM_ATTACK_HAND)

/datum/component/ritual_object/proc/get_rituals() // We'll get all rituals for flexibility.
/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)
continue

rituals += new ritual

for(var/datum/ritual/ritual as anything in rituals)
ritual.ritual_object = parent

return

/datum/component/ritual_object/proc/attackby(datum/source, mob/living/carbon/human/human)
SIGNAL_HANDLER

if(active_ui)
return

Expand All @@ -79,7 +79,7 @@
active_ui = TRUE
INVOKE_ASYNC(src, PROC_REF(open_ritual_ui), human)

return COMPONENT_CANCEL_ATTACK_CHAIN
return COMPONENT_CANCEL_ATTACK_CHAIN

/datum/component/ritual_object/proc/open_ritual_ui(mob/living/carbon/human/human)
var/list/rituals_list = get_available_rituals(human)
Expand All @@ -94,7 +94,7 @@
if(!choosen_ritual)
active_ui = FALSE
return

return handle_ritual_selection(human, choosen_ritual)

/datum/component/ritual_object/proc/handle_ritual_selection(mob/living/carbon/human/human, choosen_ritual)
Expand Down Expand Up @@ -123,7 +123,7 @@
var/message

ritual.handle_ritual_object(RITUAL_STARTED)

. = ritual_invoke_check(invoker)

if(!(. & RITUAL_SUCCESSFUL))
Expand All @@ -139,7 +139,7 @@
if(. & RITUAL_FAILED_ON_PROCEED)
cause_disaster = TRUE
start_cooldown = TRUE

if(start_cooldown)
COOLDOWN_START(ritual, ritual_cooldown, ritual.cooldown_after_cast)

Expand Down Expand Up @@ -194,11 +194,11 @@
return ritual.do_ritual(invoker, invokers, used_things)

/datum/component/ritual_object/proc/track_atoms(
atom/source,
atom/old_loc,
movement_dir,
forced,
atom/old_locs,
atom/source,
atom/old_loc,
movement_dir,
forced,
atom/old_locs,
momentum_change
)
SIGNAL_HANDLER
Expand Down Expand Up @@ -251,7 +251,7 @@
for(var/req_type in requirements)
if(requirements[req_type] <= 0)
continue

if(!istype(atom, req_type))
continue

Expand All @@ -266,7 +266,7 @@
var/list/what_are_we_missing = list()
for(var/req_type in requirements)
var/number_of_things = requirements[req_type]

if(number_of_things <= 0)
continue

Expand Down
64 changes: 62 additions & 2 deletions code/datums/rituals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@
/// If ritual can be invoked only by shaman
var/shaman_only = FALSE
allowed_species = list(/datum/species/unathi/ashwalker, /datum/species/unathi/draconid)
/// If our ritual needed any dyes on the body. Use names from code/modules/mining/ash_walkers/lavaland_dye.dm
var/needed_dye = null
/// Same, but for totems. This should be made little better, but i have no frackin idea how. Use same file.
var/totem_dye = null

/datum/ritual/ashwalker/is_valid_invoker(atom/atom)
return istype(atom, /obj/structure/grace_of_lazis) || ..()
return istype(atom, /obj/structure/ash_totem) || ..()

/datum/ritual/ashwalker/check_invokers(mob/living/carbon/human/invoker, list/invokers)
/datum/ritual/ashwalker/check_invokers(atom/invoker, list/invokers)
. = ..()

if(!.)
Expand All @@ -91,6 +95,24 @@
to_chat(invoker, span_warning("Только шаман может выполнить данный ритуал!"))
return FALSE

if(needed_dye)
for(var/mob/living/carbon/human/human in invokers)
if(human.m_styles["body"] != needed_dye)
human.balloon_alert(invoker, "нет нужной краски!")
return FALSE
human.m_styles["body"] = "None"
to_chat(human, span_notice("Краска на вашем теле медленно испаряется."))
human.update_markings()

for(var/obj/structure/ash_totem/totem in invokers)
if(totem.applied_dye != totem_dye)
totem.balloon_alert(invoker, "нет нужной краски!")
return FALSE
totem.applied_dye = null
totem.applied_dye_fluff_name = null
totem.visible_message(span_notice("Краска медленно испаряется с тотема."))
totem.update_icon(UPDATE_OVERLAYS)

var/list/shaman_invokers = list()

if(extra_shaman_invokers)
Expand All @@ -106,6 +128,44 @@

return TRUE

/datum/ritual/ashwalker/test_cinnabar_one_person
name = "cinnabar 1 walkers"
cooldown_after_cast = 10 SECONDS
cast_time = 10 SECONDS
fail_chance = 0
disaster_prob = 0
needed_dye = "Cinnabar Dyes"
totem_dye = "cinnabar"

/datum/ritual/ashwalker/test_crimson_one_person
name = "crimson 1 walker"
cooldown_after_cast = 10 SECONDS
cast_time = 10 SECONDS
fail_chance = 0
disaster_prob = 0
needed_dye = "Crimson Dyes"
totem_dye = "crimson"

/datum/ritual/ashwalker/test_mint_two_persons
name = "mint 2 walkers"
cooldown_after_cast = 10 SECONDS
cast_time = 10 SECONDS
fail_chance = 0
disaster_prob = 0
extra_invokers = 1
needed_dye = "Mint Dyes"
totem_dye = "mint"

/datum/ritual/ashwalker/test_amber_three_persons
name = "amber 3 walkers"
cooldown_after_cast = 10 SECONDS
cast_time = 10 SECONDS
fail_chance = 0
disaster_prob = 0
extra_invokers = 2
needed_dye = "Amber Dyes"
totem_dye = "amber"

/datum/ritual/ashwalker/summon_ashstorm
name = "Ash storm summon"
shaman_only = TRUE
Expand Down
7 changes: 4 additions & 3 deletions code/modules/mining/ash_walkers/lavaland_dye.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
/obj/item/lavaland_dye/attack_obj(obj/object, mob/living/user, params) //это все будет переписано, поэтому коммент на русском. Чтобы не забыть
if(istype(object, /obj/structure/ash_totem))
var/obj/structure/ash_totem/totem = object
totem.applied_dye = totem_dye
totem.applied_dye_fluff_name = fluff_name
totem.update_icon(UPDATE_OVERLAYS)
if(!totem.applied_dye)
totem.applied_dye = totem_dye
totem.applied_dye_fluff_name = fluff_name
totem.update_icon(UPDATE_OVERLAYS)

/obj/item/lavaland_dye/cinnabar
name = "cinnabar-colored spleen"
Expand Down

0 comments on commit 4d54ca4

Please sign in to comment.