annotate gm-bard.tf @ 1686:db1a3e72c1d1 default tip

Update to match in-game changes ('help item conditions').
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 18 May 2024 21:25:57 +0300
parents 356c3c26aee6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1356
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 ;;
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 ;; GgrTF::Alchemist - Alchemist guild support and utility macros
1655
356c3c26aee6 Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 1472
diff changeset
3 ;; (C) Copyright 2012 Matti Hamalainen (Ggr)
1356
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 ;;
1454
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
6 ;;
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
7 ;; This program is free software; you can redistribute it and/or
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
8 ;; modify it under the terms of the GNU General Public License
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
9 ;; version 2 as published by the Free Software Foundation.
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
10 ;;
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
11 ;; This program is distributed in the hope that it will be useful,
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
14 ;; file "COPYING.txt" for more details.
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
15 ;;
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
16 ;; You should have received a copy of the GNU General Public License
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
17 ;; along with this program; if not, write to the Free Software
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
18 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
19 ;; MA 02110-1301 USA.
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
20 ;;
113c9a66eaf1 Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1356
diff changeset
21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1356
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 ;;
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 ;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded.
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 ;;
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 /loaded GgrTF:Bard
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 /test prdefmodule("Bard")
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 ;; General settings and data
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 /set gbard_spells=Achromatic eyes|Campfire tune|Catchy singalong|Clandestine thoughts|Con fioco|Dancing blades|Jesters trivia|Kings feast|Melodical embracement|Melody of the misadventurer|Musicians alm|Noituloves deathlore|Noituloves dischord|Pathfinder|Singing shepherd|Soothing sounds|Sounds of silence|Strength in unity|Sweet lullaby|Uncontrollable mosh|Venturers way|Vigilant melody|War ensemble
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 /set gbard_masters=Zinbaf Gilian Endek Dria Yomototh Vahearun Sineyole Derevan Zantus Forsimnetu Cyarus Noitulove Stringbreaker Zord Tinebring Otharus Aline Malecketh Razmatag Patricia Holm Fyanna Talos
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 /eval /set gbard_list_spells=$[replace("|"," ",replace(" ","_",gbard_spells))]
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 /def -i prlist_get_idx_do =\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 /let _name=%{1}%;/shift%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 /let _idx=0%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 /while ({#})\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 /let _idx=$[_idx+1]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 /if ({1}=~_name) /result _idx%;/endif%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 /shift%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 /done%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 /result -1
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 /def -i prlist_get_idx =\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 /let _item=$[tolower(replace(" ","_",{2}))]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 /let _list=$[tolower(eval("/return %{1}",2))]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 /return $(/prlist_get_idx_do %{_item} %{_list})
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 /def -i gbard_get_master =\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 /let _idx=$[prlist_get_idx("gbard_list_spells", {1})]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 /if (_idx > 0)\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 /return "$(/nth %{_idx} %{gbard_masters})"%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 /else \
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 /return ""%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 /endif
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 /eval /def -i -F -p9999 -mregexp -t"^ (%{gbard_spells}) +(.+?) +(known by heart|not in memory|currently in memory|once heard, barely in memory)$$" gbard_score =\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 /let _col1=Cyellow%%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 /if ({P3}=~"known by heart") /let _col3=Cgreen%%;/let _col1=Cgreen%%;/let _status=KBH%%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 /elseif ({P3}=~"currently in memory") /let _col3=Cyellow%%;/let _status=memory%%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 /else /let _col3=Cred%%;/let _status=-%%;/endif%%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 /let _master=$$[gbard_get_master({P1})]%%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 /substitute -p @{%%{_col1}} $$[prsubipad({P1},23)]@{n} | $$[prsubipad({P2},25)] | @{%%{_col3}}$$[prsubipad(_status,7)]@{n} | %%{_master}
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 /def -i getmaster =\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 /let _master=$[gbard_get_master({*})]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 /if (_master!~"")\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 /msq Songmaster for spell '%{*}' is %{_master}.%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 /send @@bgreet $[tolower(_master)]%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 /else \
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 /msq No such bard spellsong '%{*}'.%;\
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 /endif
4c4f36b8920b Added skeleton bard module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77