… | |
… | |
120 | You got royalties there! Wanna have! |
120 | You got royalties there! Wanna have! |
121 | |
121 | |
122 | You may want to change the C<name> method there to something like C<title>, |
122 | You may want to change the C<name> method there to something like C<title>, |
123 | C<slaying> or any other method that is allowed to be called on a |
123 | C<slaying> or any other method that is allowed to be called on a |
124 | C<cf::object> here. |
124 | C<cf::object> here. |
|
|
125 | |
|
|
126 | =item B<matching for an item name and removing the matched item> |
|
|
127 | |
|
|
128 | @match found earhorn |
|
|
129 | @cond grep $_->slaying =~ /Gramp's walking stick/, $who->inv |
|
|
130 | @eval my @g = grep { $_->slaying =~ /Gramp's walking stick/ } $who->inv; $g[0]->decrease_ob_nr (1); |
|
|
131 | Thanks for the earhorn! |
|
|
132 | |
|
|
133 | This example is a bit more complex. The C<@eval> statement will search |
|
|
134 | the players inventory for the same term as the C<@cond> and then |
|
|
135 | decreases the number of objects used there. |
|
|
136 | |
|
|
137 | (See also the map: C<scorn/houses/cornerbrook.map> for an example how this is |
|
|
138 | used in the real world :-) |
125 | |
139 | |
126 | =back |
140 | =back |
127 | |
141 | |
128 | =item @eval perl |
142 | =item @eval perl |
129 | |
143 | |