Skip to content

Commit

Permalink
Makes the heretic blademaking ritual shatter blades over the limit wh…
Browse files Browse the repository at this point in the history
…en new ones are made (#10138)

* heretics fixed real

* sound! alerts sec

* upped the volume a bit so the sound plays from evidence

* Local idiot strikes again (thanks for the report wilson)
  • Loading branch information
JixS4v authored Nov 6, 2023
1 parent 165275c commit c1a615d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
18 changes: 17 additions & 1 deletion code/modules/antagonists/heretic/heretic_knowledge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
var/limit = 1
/// A list of weakrefs to all items we've created.
var/list/datum/weakref/created_items
// Destroys the item furthest from user if over the amount limit
var/destroy_if_over_limit = FALSE

/datum/heretic_knowledge/limited_amount/Destroy(force, ...)
LAZYCLEARLIST(created_items)
Expand All @@ -193,9 +195,23 @@
if(QDELETED(real_thing))
LAZYREMOVE(created_items, ref)

if(LAZYLEN(created_items) >= limit)
if(LAZYLEN(created_items) >= limit && !destroy_if_over_limit)
loc.balloon_alert(user, "ritual failed, at limit!")
return FALSE
else if(LAZYLEN(created_items) >= limit && destroy_if_over_limit)
var/atom/furthest
var/furthest_distance
for(var/datum/weakref/ref in created_items)
if(!furthest)
furthest = ref.resolve()
furthest_distance = get_dist(user, furthest)
else
var/atom/prospective = ref.resolve()
if(get_dist(user, prospective)>furthest_distance)
furthest = prospective
playsound(furthest, "shatter", 100, TRUE)
if(!QDELETED(furthest))
qdel(furthest)

return TRUE

Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/heretic/knowledge/ash_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
name = "Nightwatcher's Secret"
desc = "Opens up the Path of Ash to you. \
Allows you to transmute a match and a knife into an Ashen Blade. \
You can only create two at a time."
You can only create two at a time. Destroys the blade furthest from you if you invoke this ritual at the limit."
gain_text = "The City Guard know their watch. If you ask them at night, they may tell you about the ashy lantern."
next_knowledge = list(/datum/heretic_knowledge/ashen_grasp)
banned_knowledge = list(
Expand All @@ -45,6 +45,7 @@
)
result_atoms = list(/obj/item/melee/sickly_blade/ash)
limit = 2
destroy_if_over_limit = TRUE
cost = 1
priority = MAX_KNOWLEDGE_PRIORITY - 5
route = HERETIC_PATH_ASH
Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/heretic/knowledge/flesh_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
name = "Principle of Hunger"
desc = "Opens up the Path of Flesh to you. \
Allows you to transmute a knife and a pool of blood into a Bloody Blade. \
You can only create three at a time."
You can only create three at a time. Destroys the blade furthest from you if you invoke this ritual at the limit."
gain_text = "Hundreds of us starved, but not me... I found strength in my greed."
next_knowledge = list(/datum/heretic_knowledge/limited_amount/flesh_grasp)
banned_knowledge = list(
Expand All @@ -50,6 +50,7 @@
)
result_atoms = list(/obj/item/melee/sickly_blade/flesh)
limit = 3 // Bumped up so they can arm up their ghouls too.
destroy_if_over_limit = TRUE
cost = 1
priority = MAX_KNOWLEDGE_PRIORITY - 5
route = HERETIC_PATH_FLESH
Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/heretic/knowledge/rust_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
name = "Blacksmith's Tale"
desc = "Opens up the Path of Rust to you. \
Allows you to transmute a knife with any trash item into a Rusty Blade. \
You can only create two at a time."
You can only create two at a time. Destroys the blade furthest from you if you invoke this ritual at the limit."
gain_text = "\"Let me tell you a story\", said the Blacksmith, as he gazed deep into his rusty blade."
next_knowledge = list(/datum/heretic_knowledge/rust_fist)
banned_knowledge = list(
Expand All @@ -45,6 +45,7 @@
)
result_atoms = list(/obj/item/melee/sickly_blade/rust)
limit = 2
destroy_if_over_limit = TRUE
cost = 1
priority = MAX_KNOWLEDGE_PRIORITY - 5
route = HERETIC_PATH_RUST
Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/heretic/knowledge/void_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
name = "Glimmer of Winter"
desc = "Opens up the path of void to you. \
Allows you to transmute a knife in sub-zero temperatures into a Void Blade. \
You can only create two at a time."
You can only create two at a time. Destroys the blade furthest from you if you invoke this ritual at the limit."
gain_text = "I feel a shimmer in the air, the air around me gets colder. \
I start to realize the emptiness of existence. Something's watching me."
next_knowledge = list(/datum/heretic_knowledge/void_grasp)
Expand All @@ -43,6 +43,7 @@
required_atoms = list(/obj/item/knife = 1)
result_atoms = list(/obj/item/melee/sickly_blade/void)
limit = 2
destroy_if_over_limit = TRUE
cost = 1
priority = MAX_KNOWLEDGE_PRIORITY - 5
route = HERETIC_PATH_VOID
Expand Down

0 comments on commit c1a615d

Please sign in to comment.