Mercurial > hg > batmud > ggrtf
annotate gm-identify.tf @ 1682:de46e2e23c66
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Apr 2024 23:03:33 +0300 |
parents | 356c3c26aee6 |
children | db1a3e72c1d1 |
rev | line source |
---|---|
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 ;; |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 ;; GgrTF::Identify - Identify output mangler |
1655
356c3c26aee6
Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
3 ;; (C) Copyright 2009-2015 Matti Hamalainen (Ggr) |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
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:
1287
diff
changeset
|
5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
6 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
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:
1287
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:
1287
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:
1287
diff
changeset
|
10 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
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:
1287
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:
1287
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:
1287
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:
1287
diff
changeset
|
15 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
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:
1287
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:
1287
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:
1287
diff
changeset
|
19 ;; MA 02110-1301 USA. |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
20 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 ;; |
1277
980a1f19a258
More copyright and version requirement updates.
Matti Hamalainen <ccr@tnsp.org>
parents:
1275
diff
changeset
|
23 ;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded. |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 ;; |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 /loaded GgrTF:Identify |
1035
c10f8a59a2e3
Use module depencies for checking required parent modules.
Matti Hamalainen <ccr@tnsp.org>
parents:
990
diff
changeset
|
26 /test prdefmodule("Identify", "Magical") |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 /def -i gidentify_print =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 /let _res=$[prpadwith({1},8,".")]: %;/shift%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 /while ({#})\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 /let _rlen=$[strlen(_res)+1]%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 /if (_rlen >= idc_width-2 | _rlen+strlen({1}) >= idc_width)\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 /test msw(strcat("| ", pad(_res, - idc_width), " |"))%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 /let _res= %{1}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 /else \ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 /let _res=%{_res} %{1}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 /endif%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
40 /shift%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
41 /done%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
42 /test msw(strcat("| ", pad(_res, - idc_width), " |")) |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
43 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 /def -i gidentify_maxcond =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
45 /if ({1}=~"it's BRAND NEW") /return "AWESOME"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
46 /elseif ({1}=~"have been used just a few times")/return "incredible"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 /elseif ({1}=~"as good as new") /return "superb"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 /elseif ({1}=~"has some small repairs") /return "excellent"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 /elseif ({1}=~"has some minor fixes") /return "great"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 /elseif ({1}=~"been fixed a few times") /return "good"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
51 /elseif ({1}=~"been fixed several times") /return "fine"%;\ |
1130
731cc2036539
Add two item max condition 'translations'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1035
diff
changeset
|
52 /elseif ({1}=~"patched up a few times") /return "battered"%;\ |
731cc2036539
Add two item max condition 'translations'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1035
diff
changeset
|
53 /elseif ({1}=~"patched up several times") /return "poor"%;\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 /elseif ({1}=~"repaired a few times") /return "bad(?)"%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
55 /else /return {1}%;/endif |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
56 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 /def -i gidentify_sep =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 /msw +$[strrep("-",idc_width+2)]+ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
60 /def -i gidentify_sep2 =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
61 /msw +-| @{BCgreen}%{1}@{n} |$[strrep("-",idc_width-strlen({1})-3)]+ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
62 |
1515
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
63 /def -i gidentify_idc_add =\ |
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
64 /set idc_st=$[idc_st+1]%;/set idc_imp=%{idc_imp} $[replace(" ","_",{1})] |
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
65 |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
66 |
970
8ebad7495db2
Don't gag normal 'identify' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
968
diff
changeset
|
67 /def -i -F -p9999 -mregexp -t"^The following messages seem to vibrate from (.+):$" gidentify_start =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
68 /msq Collecting information ...%;\ |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
69 /if (opt_havebelt=~"on") /set idc_getweight=1%;@@weigh %{P1}%;/endif%;\ |
974
0c1fc48bd056
Use merchant belt's "weigh" command, if belt option has been enabled, to measure accurate weight.
Matti Hamalainen <ccr@tnsp.org>
parents:
970
diff
changeset
|
70 /set idc_item=%{P1}%;/set idc_st=1%;/set idc_kgw=UNKNOWN%;\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
71 /set idc_imp=%;/set idc_age=%;/set idc_cond=%;/set idc_handles=%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
72 /set idc_maxcond=%;/set idc_cond=%;/set idc_name=%;/set idc_quality=%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
73 /set idc_size=%;/set idc_slots=%;/set idc_weight=%;/set idc_worth=%;\ |
990
43998c8c3724
Remember to clear certain variables on trigger macro init.
Matti Hamalainen <ccr@tnsp.org>
parents:
975
diff
changeset
|
74 /set idc_material=UNKNOWN%;/set idc_fwd=%;/set idc_worn=%;\ |
43998c8c3724
Remember to clear certain variables on trigger macro init.
Matti Hamalainen <ccr@tnsp.org>
parents:
975
diff
changeset
|
75 /set idc_wielded=%;/set idc_names=%;\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
76 /repeat -2 1 /gidentify_output |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 |
1275 | 78 /def -i -F -Eidc_getweight -ag -p9999 -mregexp -t"^: *([0-9]+\.[0-9]+) " gidentify_weight =\ |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
79 /set idc_getweight=0%;/set idc_kgw=%{P1} |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
80 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
81 /def -i -F -Eidc_st>=1 -p9999 -mregexp -t"^It is called (.+) and identified as (.+)\.$" gidentify_handles =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
82 /set idc_st=$[idc_st+1]%;/set idc_name=%{P1}%;/set idc_handles=%{P2} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
83 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
84 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It takes the following slots: (.*)\.$" gidentify_slots =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
85 /set idc_st=$[idc_st+1]%;/set idc_slots=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
86 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
87 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It will (.+)\.$" gidentify_sksp =\ |
1515
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
88 /test gidentify_idc_add({P1}) |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
89 |
1515
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
90 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^(A halo of purity surrounds it|An aura of blackness surrounds it)\." gidentify_specials =\ |
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
91 /test gidentify_idc_add({P1}) |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
92 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
93 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^([A-Z][A-Za-z, ]+) did the heroic deed to bring" gidentify_i1 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
94 /set idc_names=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
95 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
96 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"has been in the game for ([0-9a-z, ]+)\." gidentify_i2 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
97 /set idc_age=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
98 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
99 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"It is ([A-Za-z -]+), ([A-Za-z -]+)," gidentify_i3 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
100 /set idc_weight=%{P1}%;/set idc_size=%{P2} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
101 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
102 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"in ([A-Za-z '-]+) condition, ([A-Za-z '-]+)" gidentify_i4 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
103 /set idc_cond=%{P1}%;/set idc_maxcond=$[gidentify_maxcond({P2})] |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
104 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
105 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"of ([A-Za-z ]+) quality" gidentify_i5 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
106 /set idc_quality=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
107 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
108 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"worth ([0-9]+)" gidentify_i6 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
109 /set idc_worth=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
110 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
111 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"made of,? ?(.+?), (feather|worth)" gidentify_i7 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
112 /set idc_material=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
113 |
975
1a2e40de61f9
Bugfix the weight getting code.
Matti Hamalainen <ccr@tnsp.org>
parents:
974
diff
changeset
|
114 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"featherweighted for (.+), worth" gidentify_i8 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
115 /set idc_fwd=%{P1} |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
116 |
1515
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
117 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t", (sheds light|emits darkness)," gidentify_i9 =\ |
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
118 /test gidentify_idc_add(strcat("It ",{P1})) |
af2791caa104
Add support for few things in the identify beautifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
1514
diff
changeset
|
119 |
1514
f5e70fe84829
The format of worn/wielded fields for identify have changed slightly, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1472
diff
changeset
|
120 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It (has|hasn't) been (worn|wielded) by (.+)\.$" gidentify_worn1 =\ |
f5e70fe84829
The format of worn/wielded fields for identify have changed slightly, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1472
diff
changeset
|
121 /if ({P1}=~"has") /set idc_%{P2}=%{P3}%;/endif%;\ |
f5e70fe84829
The format of worn/wielded fields for identify have changed slightly, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1472
diff
changeset
|
122 |
f5e70fe84829
The format of worn/wielded fields for identify have changed slightly, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1472
diff
changeset
|
123 /def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It (has|hasn't) been mostly (worn|wielded) by (.+)\.$" gidentify_worn2 =\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
124 /if ({P1}=~"has") /set idc_%{P2}=%{P3}%;/endif%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
125 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
126 /def -i gidentify_list =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
127 /while ({#})\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
128 /let _tmp=$[replace("_"," ",{1})]%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
129 /msw | $[prsubipad(_tmp,idc_width)] |%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
130 /shift%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
131 /done |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 /def -i gidentify_output =\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 /set idc_width=74%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 /gidentify_sep2 General %;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 /msw | Item....: $[prsubipad(idc_item,idc_width-10)] |%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
137 /msw | Name....: $[prsubipad(idc_name,idc_width-10)] |%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
138 /gidentify_print Handles %{idc_handles}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
139 /gidentify_print Names %{idc_names}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
140 /gidentify_print Slots %{idc_slots}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 /gidentify_print Material %{idc_material}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
142 /gidentify_sep%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 /msw | In game.: @{BCwhite}$[prsubipad(idc_age, 30)]@{n} | Condition: @{BCwhite}$[prsubipad(idc_cond,20)]@{n} |%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 /msw | Size....: @{BCwhite}$[prsubipad(idc_size, 30)]@{n} | Maxcond..: @{BCwhite}$[prsubipad(idc_maxcond,20)]@{n} |%;\ |
974
0c1fc48bd056
Use merchant belt's "weigh" command, if belt option has been enabled, to measure accurate weight.
Matti Hamalainen <ccr@tnsp.org>
parents:
970
diff
changeset
|
145 /msw | Worth...: @{BCwhite}$[prsubipad(idc_worth, 30)]@{n} | Quality..: @{BCwhite}$[prsubipad(idc_quality,20)]@{n} |%;\ |
0c1fc48bd056
Use merchant belt's "weigh" command, if belt option has been enabled, to measure accurate weight.
Matti Hamalainen <ccr@tnsp.org>
parents:
970
diff
changeset
|
146 /msw | Weight..: @{BCwhite}$[prsubipad(idc_weight,30)]@{n} | Weight/kg: @{BCwhite}$[prsubipad(idc_kgw,20)]@{n} |%;\ |
967
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
147 /if (idc_imp!~"")\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
148 /gidentify_sep2 Stats%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
149 /gidentify_list %{idc_imp}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 /endif%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 /gidentify_sep2 Misc%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 /gidentify_print Worn %{idc_worn}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
153 /gidentify_print Wielded %{idc_wielded}%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
154 /if (idc_fwd!~"") /gidentify_print FW'd %{idc_fwd}%;/endif%;\ |
b37e9f0f4910
Added module for mangling 'identify' spell output. It's not perfect and will never be, because of the numerous special cases that cannot be sanely handled, but should be "interesting" for basic use.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
155 /gidentify_sep |