#! perl # this module implements slag ex(tm): # when it is applied by a player the cauldron below it will # be cleaned (all items in it will be removed) cf::object->attach ( type => cf::MISC_OBJECT, subtype => 1, on_apply => sub { my ($self, $who) = @_; my ($caul) = grep { $_->flag (cf::FLAG_IS_CAULDRON) } $who->map->at ($who->x, $who->y); if ($caul) { $_->destroy for $caul->inv; $self->handle_apply_yield; $self->decrease; $who->message ("You cleaned the " . $caul->name, cf::NDI_UNIQUE); } else { $who->message ("Couldn't find cauldron to clean on the ground.", cf::NDI_UNIQUE); } cf::override 1; }, );