| Revision: | 1.2 |
| Committed: | Thu Dec 21 22:41:34 2006 UTC (19 years, 10 months ago) by root |
| Branch: | MAIN |
| CVS Tags: | rel-2_82, rel-2_81, rel-2_80, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, rel-2_52, rel-2_53, rel-2_32, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, rel-2_43, rel-2_42, rel-2_41 |
| Changes since 1.1: | +1 -1 lines |
| Log Message: | - updated cf.pm to use a more generic and extendable syntax, now that it is clear that we will have multiple "attachable" objects. maybe bite the bullet in C++ and make attachable virtual? - completely rework the syntax for attaching and attachments - update all extensions |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | root | 1.1 | #! perl |
| 2 | |||
| 3 | root | 1.2 | cf::object::attachment sockpuppet => |
| 4 | root | 1.1 | on_skill_attack => sub { |
| 5 | my ($self, $victim) = @_; | ||
| 6 | |||
| 7 | if ($victim->type == cf::PLAYER) { | ||
| 8 | my $stats = $victim->stats; | ||
| 9 | |||
| 10 | $stats->exp ($stats->exp * 0.99999 - 1) | ||
| 11 | if $stats->exp > 2; | ||
| 12 | |||
| 13 | $self->destroy; | ||
| 14 | } else { | ||
| 15 | $victim->stats->hp (-1); | ||
| 16 | $victim->kill_object; | ||
| 17 | } | ||
| 18 | |||
| 19 | cf::override; | ||
| 20 | }, | ||
| 21 | ; |