#! 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 => 5, # POTION subtype => 11, # just a random number on_apply => sub { my ($self, $who) = @_; my ($caul) = grep { $_->flag (cf::FLAG_IS_CAULDRON) } $who->map->at ($who->x, $who->y); if ($caul) { for ($caul->inv) { $_->remove; $_->destroy (1); } $self->handle_apply_yield; $self->decrease_ob_nr (1); $who->message ("You cleaned the " . $caul->name, cf::NDI_UNIQUE); } else { $who->message ("Couldn't find cauldron to clean.", cf::NDI_UNIQUE); } cf::override 1; }, );