Reforge the Chains VI: Randartify cursed items
authorEdgar A. Bering IV <trizor@gmail.com>
Fri, 26 Feb 2021 08:59:36 +0000 (10:59 +0200)
committerEdgar A. Bering IV <trizor@gmail.com>
Fri, 26 Feb 2021 15:29:57 +0000 (17:29 +0200)
To make the curses more permanent, cursed items are made into randarts
if possible, locking in their brand and enchantment. No randart props
are granted (other than the skill boosts!). Randart names are generated
from a special Ashenzari keyword in the database for a thematic name.

Thanks to CanOfWorms,hatsuma, Lici_the_Crawler, nicolae, and
PleasingFungus for curse name suggestions.

crawl-ref/source/artefact.cc
crawl-ref/source/artefact.h
crawl-ref/source/dat/database/rand_all.txt
crawl-ref/source/dat/database/randname.txt
crawl-ref/source/dat/descript/ability.txt
crawl-ref/source/god-abil.cc

index d09e0c3..3621e3b 100644 (file)
@@ -1661,6 +1661,55 @@ bool make_item_randart(item_def &item, bool force_mundane)
     return true;
 }
 
+static string _ashenzari_artefact_name(item_def &item)
+{
+    const int old_orig = item.orig_monnum;
+
+    item.orig_monnum = -GOD_ASHENZARI;
+
+    int tries = 100;
+    string name;
+    do
+    {
+        name = _artefact_name_lookup(item, "Ashenzari");
+    }
+    while (--tries > 0 && strwidth(name) > 25);
+
+    item.orig_monnum = old_orig;
+
+    return item_base_name(item) + " " + (name.empty() ? "of Ashenzari" : name);
+}
+
+void make_ashenzari_randart(item_def &item)
+{
+    if (item.base_type != OBJ_WEAPONS
+        && item.base_type != OBJ_ARMOUR
+        && item.base_type != OBJ_JEWELLERY)
+    {
+        return;
+    }
+
+    // This item already is a randart, just rename
+    if (item.flags & ISFLAG_RANDART)
+    {
+        set_artefact_name(item, _ashenzari_artefact_name(item));
+        return;
+    }
+
+    // Too special, will just be cursed
+    if (item.flags & ISFLAG_UNRANDART)
+        return;
+
+    // Ash randarts get no props
+    _artefact_setup_prop_vectors(item);
+    item.flags |= ISFLAG_RANDART;
+    item.flags |= ISFLAG_KNOW_PROPERTIES;
+
+    set_artefact_name(item, _ashenzari_artefact_name(item));
+    item.props[ARTEFACT_APPEAR_KEY].get_string() =
+        make_artefact_name(item, true);
+}
+
 static void _make_faerie_armour(item_def &item)
 {
     item_def doodad;
index c4d3422..5cb65be 100644 (file)
@@ -123,6 +123,7 @@ int artefact_known_property(const item_def &item, artefact_prop_type prop);
 void artefact_learn_prop(item_def &item, artefact_prop_type prop);
 
 bool make_item_randart(item_def &item, bool force_mundane = false);
+void make_ashenzari_randart(item_def &item);
 bool make_item_unrandart(item_def &item, int unrand_index);
 void setup_unrandart(item_def &item, bool creating = true);
 
index 88f473e..2813583 100644 (file)
@@ -57,7 +57,7 @@ Wishful Thinking
 # FIXME: should appear on amulets only
 Yendor
 %%%%
-_suspicion_name_
+_suspicion_no_conflict_name_
 
 Doubts
 
@@ -78,8 +78,12 @@ Suspected Treachery
 Suspicion
 
 Trepidation
+%%%%
+_suspicion_name_
+
+@_suspicion_no_conflict_name_@
 
-w:20
+w:2
 @_conflict_name_@
 %%%%
 ######################################################
index 4dfaef0..06019fb 100644 (file)
@@ -7,9 +7,10 @@
 # phrases of randart type, namely "weapon", "armour" and "jewellery" as well
 # as in combination with those gods that occasionally gift randarts, i.e.
 # "Trog weapon", "Okawaru weapon", "Okawaru armour", "Xom weapon", "Xom armour"
-# and "Xom jewellery". Incidentally, they are listed in precisely that order.
-# At the end of the file you will also find a few lists of adjectives used for
-# unidentified randart appearances.
+# and "Xom jewellery". Ashenzari names cursed items; these names don't depend
+# on type and are found under the keyword "Ashenzari". Incidentally, they
+# are listed in precisely that order. At the end of the file you will also
+# find a few lists of adjectives used for unidentified randart appearances.
 #
 # The syntax for keywords is the same as that of monster speech (details are in
 # docs/develop/monster_speech.txt). Any phrase encased in '@' symbols is one
@@ -615,6 +616,244 @@ w:300
 @armour@
 %%%%
 ######################################################
+# ASHENZARI
+# All types of curses
+######################################################
+Ashenzari
+
+w:100
+of the @_ashenzari_adjective_@ @_ashenzari_object_@
+
+w:100
+of @god_name@'s @_ashenzari_object_@
+
+w:100
+"@_ashenzari_adjective_@ @_ashenzari_object_@"
+
+w:50
+"@_ashenzari_object_@ of @god_name@"
+
+w:100
+"@_ashenzari_object_@ of the @_ashenzari_epithet_@"
+
+w:20
+"@_celestial_bodies of the @_ashenzari_epithet_@
+
+w:20
+of the @_ashenzari_epithet_@
+
+w:20
+of the @_ashenzari_bound_adjective_@ @_celestial_bodies_@
+
+w:20
+of the @_ashenzari_knowledge_adjective_@ @_celestial_bodies_@
+
+w:20
+of @god_name@'s @_celestial_bodies_@
+
+of the @_ashenzari_bound_adjective_@ @_ashenzari_heavens_@
+
+of the @_ashenzari_knowledge_adjective_@ @_ashenzari_heavens_@
+
+"Gaze Upon Infinity"
+
+"Share My Sorrow"
+
+of the Wild Blue Yonder
+
+w:1
+@god_name@'s Oscillating Fan
+%%%%
+_ashenzari_object_
+
+Adversity
+
+Affliction
+
+Burden
+
+Fetters
+
+Loss
+
+Omen
+
+Ordeal
+
+Portent
+
+Prison
+
+Regret
+
+Repose
+
+Vision
+
+Yoke
+
+w:100
+@_diviner_name_@
+
+w:150
+@_discomfort_weapon_@
+
+w:100
+@_philosophy_name_@
+
+w:100
+@_discomfort_and_inaction_@
+
+w:100
+@_suspicion_no_conflict_name_@
+%%%%
+_ashenzari_adjective_
+
+w:50
+@_ashenzari_bound_adjective_@
+
+w:50
+@_ashenzari_knowledge_adjective_@
+
+@_ashenzari_celestial_adjective_@
+%%%%
+_ashenzari_bound_adjective_
+
+Bound
+
+Chained
+
+Circumscribed
+
+Cursed
+
+Ensconced
+
+Eternal
+
+Lashed
+
+Restrained
+
+Ruined
+
+Shackled
+
+Shattered
+
+Tethered
+%%%%
+_ashenzari_celestial_adjective_
+
+Astral
+
+Celestial
+
+Cosmic
+
+Distant
+
+Elysian
+
+Sidereal
+
+Stellar
+
+Sublime
+%%%%
+_ashenzari_knowledge_adjective_
+
+w:2
+All-seeing
+
+Astrological
+
+Clairvoyant
+
+Cryptic
+
+Enlightened
+
+Enigmatic
+
+Esoteric
+
+Manifest
+
+Mantic
+
+w:2
+Omniscient
+
+Oracular
+
+Perceptive
+
+Prescient
+
+Profound
+
+Prophetic
+
+Revealing
+
+Sibylline
+
+Unveiling
+
+Visionary
+%%%%
+_ashenzari_epithet_
+
+w:100
+@_ashenzari_adjective_@ God
+
+w:50
+@_ashenzari_bound_adjective_@ Augur
+
+w:50
+@_ashenzari_celestial_adjective_@ Augur
+
+w:50
+@_ashenzari_bound_adjective_@ Sage
+
+w:50
+@_ashenzari_celestial_adjective_@ Sage
+
+w:50
+@_ashenzari_bound_adjective_@ Seer
+
+w:50
+@_ashenzari_celestial_adjective_@ Seer
+
+All-Knowing
+
+Curse-Bearer
+
+Soothsayer
+
+Unmoving One
+%%%
+_ashenzari_heavens_
+
+Cosmos
+
+Empyrean
+
+Ether
+
+Firmament
+
+Heavens
+
+w:40
+Sky
+
+Sphere
+
+Welkin
+%%%%
+######################################################
 # Library of randart APPEARANCE (un-identified).
 ######################################################
 # common to all three types of randarts
index 39fc992..9048f53 100644 (file)
@@ -543,7 +543,8 @@ Removes a randomly selected bad mutation.
 Curse Item ability
 
 Curses a chosen equipped item, binding it to the wearer until the curse
-and the item both are broken.
+and the item both are broken. Cursed items can no longer be enchanted or
+modified.
 %%%%
 Shatter The Chains ability
 
index f553c28..81d62e5 100644 (file)
@@ -2300,6 +2300,7 @@ bool ashenzari_curse_item()
     }
 
     _do_curse_item(item);
+    make_ashenzari_randart(item);
     ash_check_bondage();
 
     you.props.erase(CURSE_KNOWLEDGE_KEY);