Skip to content

Commit

Permalink
tweak: ritual cast time & unhardcode update_rank() (#6201)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Dec 15, 2024
1 parent 9364fba commit b797034
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 46 deletions.
8 changes: 4 additions & 4 deletions code/__DEFINES/rituals.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// Used in ritual variables
#define DEFAULT_RITUAL_RANGE_FIND 1
#define DEFAULT_RITUAL_COOLDOWN (100 SECONDS)
#define DEFAULT_RITUAL_DISASTER_PROB 10
#define DEFAULT_RITUAL_FAIL_PROB 10
#define DEFAULT_RITUAL_RANGE_FIND 1
#define DEFAULT_RITUAL_COOLDOWN (100 SECONDS)
#define DEFAULT_RITUAL_DISASTER_PROB 10
#define DEFAULT_RITUAL_FAIL_PROB 10
/// Ritual object bitflags
#define RITUAL_STARTED (1<<0)
#define RITUAL_ENDED (1<<1)
Expand Down
46 changes: 29 additions & 17 deletions code/datums/rituals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
LAZYADD(invokers_list, invoker)

for(var/mob/living/carbon/human/human as anything in invokers_list)
if(!do_after(human, cast_time, ritual_object, extra_checks = CALLBACK(src, PROC_REF(action_check_contents))))
if(!do_after(human, cast_time, ritual_object, DA_IGNORE_HELD_ITEM, extra_checks = CALLBACK(src, PROC_REF(action_check_contents))))
. = FALSE

return .
Expand Down Expand Up @@ -385,7 +385,7 @@
fail_chance = 50
extra_invokers = 1
cooldown_after_cast = 480 SECONDS
cast_time = 70 SECONDS
cast_time = 30 SECONDS
ritual_should_del_things_on_fail = TRUE
required_things = list(
/obj/item/twohanded/spear = 3,
Expand Down Expand Up @@ -439,15 +439,20 @@
fail_chance = 30
shaman_only = TRUE
cooldown_after_cast = 900 SECONDS
cast_time = 50 SECONDS
cast_time = 30 SECONDS
extra_invokers = 1

/datum/ritual/ashwalker/summon/do_ritual(mob/living/carbon/human/invoker)
var/list/ready_for_summoning = list()

for(var/mob/living/carbon/human/human in GLOB.mob_list)
if(isashwalker(human))
LAZYADD(ready_for_summoning, human)
if(!human.ckey)
continue

if(!isashwalker(human))
continue

LAZYADD(ready_for_summoning, human)

if(!LAZYLEN(ready_for_summoning))
return RITUAL_FAILED_ON_PROCEED
Expand All @@ -457,17 +462,24 @@
if(!human)
return RITUAL_FAILED_ON_PROCEED

LAZYADD(invokers, invoker)
deal_damage()
summon(human)

for(var/mob/living/carbon/human/summoner as anything in invokers)
return RITUAL_SUCCESSFUL

/datum/ritual/ashwalker/summon/proc/deal_damage()
for(var/mob/living/carbon/human/summoner in range(finding_range, ritual_object))
summoner.blood_volume -= (summoner.blood_volume * 0.20)
summoner.apply_damage(25, def_zone = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))

human.forceMove(ritual_object)
return TRUE

/datum/ritual/ashwalker/summon/proc/summon(mob/living/carbon/human/human)
human.forceMove(get_turf(ritual_object))
human.vomit()
human.Weaken(10 SECONDS)

return RITUAL_SUCCESSFUL
return TRUE

/datum/ritual/ashwalker/summon/disaster(mob/living/carbon/human/invoker)
if(!prob(70))
Expand Down Expand Up @@ -499,7 +511,7 @@
disaster_prob = 30
fail_chance = 30
cooldown_after_cast = 600 SECONDS
cast_time = 60 SECONDS
cast_time = 30 SECONDS
charges = 3
shaman_only = TRUE
extra_invokers = 2
Expand Down Expand Up @@ -565,7 +577,7 @@
fail_chance = 40
charges = 1
cooldown_after_cast = 800 SECONDS
cast_time = 80 SECONDS
cast_time = 30 SECONDS
shaman_only = TRUE
extra_invokers = 4
required_things = list(
Expand Down Expand Up @@ -640,7 +652,7 @@
charges = 3
extra_invokers = 2
cooldown_after_cast = 180 SECONDS
cast_time = 100 SECONDS
cast_time = 30 SECONDS
shaman_only = TRUE
disaster_prob = 25
fail_chance = 35
Expand Down Expand Up @@ -707,7 +719,7 @@
disaster_prob = 30
fail_chance = 50
cooldown_after_cast = 360 SECONDS
cast_time = 90 SECONDS
cast_time = 30 SECONDS
shaman_only = TRUE
required_things = list(
/mob/living/simple_animal/hostile/asteroid/basilisk/watcher = 1,
Expand Down Expand Up @@ -788,7 +800,7 @@
extra_invokers = 2
charges = 1
cooldown_after_cast = 120 SECONDS
cast_time = 40 SECONDS
cast_time = 30 SECONDS
ritual_should_del_things_on_fail = TRUE
required_things = list(
/obj/item/reagent_containers/food/snacks/grown/ash_flora/cactus_fruit = 1,
Expand Down Expand Up @@ -872,7 +884,7 @@
name = "Soul ritual"
extra_invokers = 3
cooldown_after_cast = 1200 SECONDS
cast_time = 60 SECONDS
cast_time = 30 SECONDS
required_things = list(
/mob/living/carbon/human = 3,
/obj/item/stack/sheet/animalhide/ashdrake = 1
Expand Down Expand Up @@ -1085,7 +1097,7 @@
cooldown_after_cast = 150 SECONDS
shaman_only = TRUE
extra_invokers = 2
cast_time = 60 SECONDS
cast_time = 30 SECONDS
required_things = list(
/mob/living/carbon/human = 2
)
Expand Down Expand Up @@ -1161,7 +1173,7 @@
shaman_only = TRUE
disaster_prob = 35
extra_invokers = 1
cast_time = 60 SECONDS
cast_time = 30 SECONDS
required_things = list(
/mob/living/simple_animal = 1,
/obj/item/organ/internal/regenerative_core = 1,
Expand Down
46 changes: 22 additions & 24 deletions code/modules/antagonists/borer/borer_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
show_in_roundend = FALSE
job_rank = ROLE_BORER
special_role = SPECIAL_ROLE_BORER
var/mob/living/simple_animal/borer/user // our borer
var/mob/living/carbon/human/host // our host
var/mob/living/carbon/human/previous_host // previous host, used to del transferable effects from previous host.

var/mob/living/simple_animal/borer/user
var/mob/living/carbon/human/host
/// previous host, used to del transferable effects from previous host.
var/mob/living/carbon/human/previous_host
/// Rank of our borer
var/datum/borer_rank/borer_rank
var/list/learned_focuses = list() // what focuses learned borer
var/datum/borer_misc/change_host_and_scale/scaling = new // chemical scaling, gained when acquired unique host

var/reproductions = 0 // used to upgrade rank
var/evo_points = 0 // used for borer shopping, gained by reproductions
/// Which focuses we have
var/list/learned_focuses = list()
/// chemical scaling, gained when acquired unique host
var/datum/borer_misc/change_host_and_scale/scaling = new
/// used to upgrade rank
var/reproductions = 0
/// used for borer shopping, gained by reproductions
var/evo_points = 0

var/tick_interval = 1 SECONDS

Expand Down Expand Up @@ -68,13 +72,6 @@
reproductions++
evo_points++

if(!borer_rank?.required_reproductions)
return

if(reproductions < borer_rank.required_reproductions)
return

reproductions -= borer_rank.required_reproductions
update_rank()

return
Expand Down Expand Up @@ -194,16 +191,17 @@
if(QDELING(src))
return

/datum/antagonist/borer/proc/update_rank()
switch(borer_rank.type)
if(BORER_RANK_YOUNG)
borer_rank = new BORER_RANK_MATURE(user)
if(BORER_RANK_MATURE)
borer_rank = new BORER_RANK_ADULT(user)
if(BORER_RANK_ADULT)
borer_rank = new BORER_RANK_ELDER(user)
/datum/antagonist/borer/proc/update_rank()
if(!borer_rank?.required_reproductions || !borer_rank.next_rank_type)
return FALSE

if(reproductions < borer_rank.required_reproductions)
return FALSE

reproductions -= borer_rank.required_reproductions
borer_rank = new borer_rank.next_rank_type(user)
to_chat(user.controlling ? host : user, span_notice("Вы эволюционировали. Ваш текущий ранг - [borer_rank.rankname]."))

return TRUE

/datum/borer_misc // category for small datums.
Expand Down
7 changes: 6 additions & 1 deletion code/modules/antagonists/borer/borer_rank.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/datum/borer_rank
var/rankname = "Error"
var/required_reproductions = null // how many reproductions we need to gain new rank
/// how many reproductions we need to gain new rank
var/required_reproductions
var/datum/antagonist/borer/parent
var/mob/living/simple_animal/borer/owner
var/next_rank_type

/datum/borer_rank/Destroy(force)
parent = null
Expand All @@ -23,14 +25,17 @@
/datum/borer_rank/young
rankname = "Young"
required_reproductions = REPRODUCTIONS_TO_MATURE
next_rank_type = BORER_RANK_MATURE

/datum/borer_rank/mature
rankname = "Mature"
required_reproductions = REPRODUCTIONS_TO_ADULT
next_rank_type = BORER_RANK_ADULT

/datum/borer_rank/adult
rankname = "Adult"
required_reproductions = REPRODUCTIONS_TO_ELDER
next_rank_type = BORER_RANK_ELDER

/datum/borer_rank/elder
rankname = "Elder"
Expand Down

0 comments on commit b797034

Please sign in to comment.