From cb3305a18b317b8751770992bce7de41ba903410 Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@posteo.net>
Date: Tue, 5 Dec 2023 19:19:35 +0100
Subject: [PATCH] create index for talismans

---
 loot.sty  | 10 +++++++++-
 magic.sty | 12 +++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/loot.sty b/loot.sty
index 60a4d224..5b5bc5a6 100644
--- a/loot.sty
+++ b/loot.sty
@@ -79,29 +79,37 @@
 \newcommand{\lootMagic}{%
   \iftoggle{verbose}{
     \ifnum\value{noAppearing}>1%
-    Mana stone holding 2 MP%
     \else%
     \iftoggle{genExamples}{}%
       {%
         \ifnum\value{treasure}>8\setcounter{treasure}{0}\fi%
         \ifcase\value{treasure}\relax%
           \scrollOfFriendship%
+          \spellName
         \or%1
           \bloodCandle%
+          \spellName
         \or%2
           \minersWeed%
+          \spellName
         \or%3
           \oceanPhial%
+          \spellName
         \or%
           \labyrinthScroll%
+          \spellName
         \or%4
           \hagFinger%
+          \spellName
         \or%4
           \safetyScroll%
+          \spellName
         \or%4
           \snacklet%
+          \spellName
         \else%11
           \homeScroll%
+          \spellName
         \fi%
         \setcounter{track}{\value{treasure}}%
         \stepcounter{treasure}%
diff --git a/magic.sty b/magic.sty
index 4d93db38..1c5bf939 100644
--- a/magic.sty
+++ b/magic.sty
@@ -6,6 +6,7 @@
 % |_|  |_|\__,_|\__, |_|\___|
 %               |___/        
 
+\makeindex[name=talismans,title={Talisman Summaries},columns=2]
 
 % Some spells inflict X fatigue, where X is the spell level plus 2.
 \newcounter{spellCost}
@@ -114,8 +115,10 @@
     \foreach \i in {1,...,\arabic{spellCost}}%
       {\multiply\value{spellTargets} by \value{spellCost}\addtocounter{spellTargets}{0}}
   }{}
-  \iftoggle{talisman}{}{%
-    \index[spells]{\textbf{#1} (Cost: \arabic{spellCost}, \spellEnhancements\ \spellAction~\spellSphere) Range: \spellRange, Targets: \arabic{spellTargets}, Resisted by: \detokenize{#5}, \spellSum.|adfclosedflourishleft~p.~}
+  \iftoggle{talisman}{
+    \index[talismans]{\textbf{#1} (\spellEnhancements\ \spellAction~\spellSphere) Range: \spellRange, Area: \arabic{spellTargets}, Resisted by: \detokenize{#5}, Bonus: \arabic{spellCost}. \spellSum|adfclosedflourishleft~p.~}
+  }{%
+    \index[spells]{\textbf{#1} (Cost: \arabic{spellCost}, \spellEnhancements\ \spellAction~\spellSphere) Range: \spellRange, Area: \arabic{spellTargets}, Resisted by: \detokenize{#5}, \spellSum.|adfclosedflourishleft~p.~}
   }
 }
 
@@ -153,6 +156,7 @@
 }
 
 \newcommand\spell[7]{%
+  \togglefalse{talisman}
   \calcSpell{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
   \iftoggle{fullSpells}{%
     \fullSpell%
@@ -210,12 +214,10 @@
 }
 
 \newcommand\talisman[7]{%
+  \toggletrue{talisman}
   \setcounter{Charisma}{0}%
   \calcSpell{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
-  \index{Talismans!#1}%
   \setcounter{castingBonus}{\value{spellCost}}%
-  \showTalisman
-  \togglefalse{talisman}
 }
 
 \newcommand\explainTalisman{%
-- 
GitLab