health_potion_lesser.c

skylib_mudos_v1/mudlib/obj/potions/health_potion_lesser.c · 1009 B

From the archive skylib_mudos_v1.tar.gz

Download the archive   « Back to the archive contents

inherit LIQUID_OBJ;

#define HEAL_EFFECT "/std/effects/ingested/potion_healing"
#define STRENGTH 1.0

void drink_func(object ob, object drinker);

void setup() {
  set_food_type("disease_free");
  set_weight_unit(({1, 10}));
  set_eat_func("drink_func");
  set_name("potion");
  set_short("clear potion");
  set_long("Small bands envelope the rare glitters emanating "
           "from deep within the translucent surface of this "
           "liquid.  A greenish tinge dances along the edges "
           "of the bands, flowing outwards towards the light.\n");
  set_medium_alias("HeAlThPoTiOnLeSsEr");
  add_property("healing_potion", 1);
}

int do_drink() {
  TCRE("shiannar", TO->query_amount()+" amount in do_drink");
  return ::do_drink();
}

void drink_func(object ob, object drinker) {
  if(!ob->query_property("healing_potion")) return;
  TCRE("shiannar", ob->query_amount()+" amount in drink_func");
  drinker->add_effect(HEAL_EFFECT,
                      to_int(STRENGTH * ob->query_amount()));
}

Site Stats

Snippets: 1791
Codebases: 571