#! 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::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) { $_->destroy (1) for @$caul; $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 on the ground.", cf::NDI_UNIQUE); } cf::override 1; }, );