|
|
1 | # |
|
|
2 | # This file is part of Deliantra, the Roguelike Realtime MMORPG. |
|
|
3 | # |
|
|
4 | # Copyright (©) 2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
|
|
5 | # |
|
|
6 | # Deliantra is free software: you can redistribute it and/or modify it under |
|
|
7 | # the terms of the Affero GNU General Public License as published by the |
|
|
8 | # Free Software Foundation, either version 3 of the License, or (at your |
|
|
9 | # option) any later version. |
|
|
10 | # |
|
|
11 | # This program is distributed in the hope that it will be useful, |
|
|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
14 | # GNU General Public License for more details. |
|
|
15 | # |
|
|
16 | # You should have received a copy of the Affero GNU General Public License |
|
|
17 | # and the GNU General Public License along with this program. If not, see |
|
|
18 | # <http://www.gnu.org/licenses/>. |
|
|
19 | # |
|
|
20 | # The authors can be reached via e-mail to <support@deliantra.net> |
|
|
21 | # |
|
|
22 | |
1 | =head1 NAME |
23 | =head1 NAME |
2 | |
24 | |
3 | cf::match - object matching language |
25 | cf::match - object matching language |
4 | |
26 | |
5 | =head1 DESCRIPTION |
27 | =head1 DESCRIPTION |
… | |
… | |
92 | Not that C<not> only negates a condition and not the whole match |
114 | Not that C<not> only negates a condition and not the whole match |
93 | expressions, thus |
115 | expressions, thus |
94 | |
116 | |
95 | not applied in inv |
117 | not applied in inv |
96 | |
118 | |
97 | is true if there is I<any> non-object in the inventory. To negate a whole |
119 | is true if there is I<any> non-applied object in the inventory. To negate |
98 | match, you have to use a sub-match. To check whether there is I<no> |
120 | a whole match, you have to use a sub-match: To check whether there is |
99 | applied object in someones inventory, write this: |
121 | I<no> applied object in someones inventory, write this: |
100 | |
122 | |
101 | not (applied in inv) |
123 | not (applied in inv) |
102 | |
124 | |
103 | Example: match applied weapons. |
125 | Example: match applied weapons. |
104 | |
126 | |
105 | applied type=WEAPON |
127 | applied type=WEAPON |
106 | |
128 | |
107 | Example: match horns or rods. |
129 | Example: match horns or rods. |
108 | |
130 | |
109 | type=HORN or type=ROD |
131 | type=HORN or type=ROD |
|
|
132 | |
|
|
133 | Example: see if the originator is a player. |
|
|
134 | |
|
|
135 | type=PLAYER of originator |
110 | |
136 | |
111 | =item in ... |
137 | =item in ... |
112 | |
138 | |
113 | The in operator takes the context set and modifies it in various ways. As |
139 | The in operator takes the context set and modifies it in various ways. As |
114 | a less technical description, think of the C<in> as being a I<look into> |
140 | a less technical description, think of the C<in> as being a I<look into> |
… | |
… | |
449 | die "number, string or uppercase constant name expected\n"; |
475 | die "number, string or uppercase constant name expected\n"; |
450 | } |
476 | } |
451 | |
477 | |
452 | our $flag = $cf::REFLECT{object}{flags}; |
478 | our $flag = $cf::REFLECT{object}{flags}; |
453 | our $sattr = $cf::REFLECT{object}{scalars}; |
479 | our $sattr = $cf::REFLECT{object}{scalars}; |
|
|
480 | # quick hack to support archname, untested |
|
|
481 | $sattr->{archname} = "W"; |
454 | our $aattr = $cf::REFLECT{object}{arrays}; |
482 | our $aattr = $cf::REFLECT{object}{arrays}; |
455 | our $lattr = $cf::REFLECT{living}{scalars}; |
483 | our $lattr = $cf::REFLECT{living}{scalars}; |
456 | |
484 | |
457 | sub expr { |
485 | sub expr { |
458 | # ws done by factor |
486 | # ws done by factor |