ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf/match.pm
(Generate patch)

Comparing deliantra/server/lib/cf/match.pm (file contents):
Revision 1.22 by root, Sat Oct 24 11:45:40 2009 UTC vs.
Revision 1.26 by root, Fri Mar 26 01:04:44 2010 UTC

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
3cf::match - object matching language 25cf::match - object matching language
4 26
5=head1 DESCRIPTION 27=head1 DESCRIPTION
92Not that C<not> only negates a condition and not the whole match 114Not that C<not> only negates a condition and not the whole match
93expressions, thus 115expressions, thus
94 116
95 not applied in inv 117 not applied in inv
96 118
97is true if there is I<any> non-object in the inventory. To negate a whole 119is true if there is I<any> non-applied object in the inventory. To negate
98match, you have to use a sub-match. To check whether there is I<no> 120a whole match, you have to use a sub-match: To check whether there is
99applied object in someones inventory, write this: 121I<no> applied object in someones inventory, write this:
100 122
101 not (applied in inv) 123 not (applied in inv)
102 124
103Example: match applied weapons. 125Example: match applied weapons.
104 126
105 applied type=WEAPON 127 applied type=WEAPON
106 128
107Example: match horns or rods. 129Example: match horns or rods.
108 130
109 type=HORN or type=ROD 131 type=HORN or type=ROD
132
133Example: see if the originator is a player.
134
135 type=PLAYER of originator
110 136
111=item in ... 137=item in ...
112 138
113The in operator takes the context set and modifies it in various ways. As 139The in operator takes the context set and modifies it in various ways. As
114a less technical description, think of the C<in> as being a I<look into> 140a 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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines