Mercurial > hg > batmud > ggrtf
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 |
rev | line source |
---|---|
1356 | 1 ;; |
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 | 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 | 22 ;; |
23 ;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded. | |
24 ;; | |
25 /loaded GgrTF:Bard | |
26 /test prdefmodule("Bard") | |
27 | |
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
29 ;; General settings and data | |
30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
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 | |
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 | |
33 /eval /set gbard_list_spells=$[replace("|"," ",replace(" ","_",gbard_spells))] | |
34 | |
35 | |
36 /def -i prlist_get_idx_do =\ | |
37 /let _name=%{1}%;/shift%;\ | |
38 /let _idx=0%;\ | |
39 /while ({#})\ | |
40 /let _idx=$[_idx+1]%;\ | |
41 /if ({1}=~_name) /result _idx%;/endif%;\ | |
42 /shift%;\ | |
43 /done%;\ | |
44 /result -1 | |
45 | |
46 /def -i prlist_get_idx =\ | |
47 /let _item=$[tolower(replace(" ","_",{2}))]%;\ | |
48 /let _list=$[tolower(eval("/return %{1}",2))]%;\ | |
49 /return $(/prlist_get_idx_do %{_item} %{_list}) | |
50 | |
51 /def -i gbard_get_master =\ | |
52 /let _idx=$[prlist_get_idx("gbard_list_spells", {1})]%;\ | |
53 /if (_idx > 0)\ | |
54 /return "$(/nth %{_idx} %{gbard_masters})"%;\ | |
55 /else \ | |
56 /return ""%;\ | |
57 /endif | |
58 | |
59 | |
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 =\ | |
61 /let _col1=Cyellow%%;\ | |
62 /if ({P3}=~"known by heart") /let _col3=Cgreen%%;/let _col1=Cgreen%%;/let _status=KBH%%;\ | |
63 /elseif ({P3}=~"currently in memory") /let _col3=Cyellow%%;/let _status=memory%%;\ | |
64 /else /let _col3=Cred%%;/let _status=-%%;/endif%%;\ | |
65 /let _master=$$[gbard_get_master({P1})]%%;\ | |
66 /substitute -p @{%%{_col1}} $$[prsubipad({P1},23)]@{n} | $$[prsubipad({P2},25)] | @{%%{_col3}}$$[prsubipad(_status,7)]@{n} | %%{_master} | |
67 | |
68 | |
69 /def -i getmaster =\ | |
70 /let _master=$[gbard_get_master({*})]%;\ | |
71 /if (_master!~"")\ | |
72 /msq Songmaster for spell '%{*}' is %{_master}.%;\ | |
73 /send @@bgreet $[tolower(_master)]%;\ | |
74 /else \ | |
75 /msq No such bard spellsong '%{*}'.%;\ | |
76 /endif | |
77 |