basic.c

final_realms_fluffos_v1/lib/std/effects/basic.c · 2.4 KB

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

#include "potion_attrs.h"

int x1, x2, y1, y2;

void set_boundaries(int *min, int *max)
{
   x1 = min[0];
   x2 = max[0];
   y1 = min[1];
   y2 = max[1];
}

int *query_coordinate()
/*
 * this is for setting up potions ... say a wizard wants to put a healing
 * potion on her monster, she would put the line
 * set_ps_coord_quantity("/std/effects/cure_wounds"->query_coordinate(), 1000)
 * on it ... this one is the dumb standard one which just averages them
 * to get the midpoint
 */
{
   return ({ (x1 + x2) / 2, (y1 + y2) / 2 });
}

mixed *query_attrs(int *coord)
/*
 * return attrs@coord.  attrs is an array with elements as defined in
 *  include/potion_attrs.h ... definitely to be masked
 */
{
   return ({ 0, 100, ({ }), ({ }), ({ }), ({ }) });
}

int query_pass_through(int *coord)
/*
 * how much of any 'masked' effects will be passed through?
 * returns percentage 
 */
{
   return 100;
}

/* 
backdrop(int *coord)
 * if this returns true if this effect is just a 'backdrop' 
 * if it _is_ then unless it is the first effect to be found, it 
 * will _not_ be called at all.  This is so that an area can have
 * a poison defined over it as a backdrop, then wherever useful potions
 * are placed on it the backdrop potion is not used, tho any given
 * healing/whatever potion will probably pass all or most through
 */

/*
void action_drunk(object ob, int *coord, int quantity)
 * this is called when a player drinks a potion @ relevant coordinate
 */

/*
void action_touch(object ob, int *coord, int quantity)
 * this is called when an object is splashed with a potion of this effect
 */

/*
void action_smell(object ob, int *coord, int quantity)
 * this is called when a player smells the potion.  The quantity is
 * a measure of the concentration of the potion ... basically
 * the potions ps_quantity * 100 / volume
 */

/*
void action_create(object ob, int *coord, int quantity)
 * this is called when a potion is assigned the coordinate appropriate.
 * This is intended for those effects that are spontaneous upon creation ...
 * eg.  Exploding spontaneously
 *      Turning into a sludge monster
 *      Such concentrated acid that it dissolves the container its in
 *      etc
 * 'ob' is the container with the liquid in it.
 */

void install_effect()
/*
 * install potion in potion space handler dbase
 */
{
   (void)POTION_SPACE_HANDLER->remove_effect(file_name(this_object()));
   (void)POTION_SPACE_HANDLER->add_effect(file_name(this_object()), x1, x2, y1, y2);
}

Site Stats

Snippets: 1791
Codebases: 571