{ "strange object", NULL, NULL, 1, 0,
		ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
	{ "amulet of Yendor", NULL, NULL, 1, 0,
		AMULET_SYM, 100, 0, 2, 0, 0, 0 },

#define	FOOD(name,prob,delay,weight,nutrition)	{ name, NULL, NULL, 1, 1,\
		FOOD_SYM, prob, delay, weight, 0, 0, nutrition }

/* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
/* food 4 can be read */
/* food 5 improves your vision */
/* food 6 makes you stronger (like Popeye) */
/* foods CORPSE up to CORPSE+52 are cadavers */

	FOOD("food ration", 	50, 5, 4, 800),
	FOOD("tripe ration",	20, 1, 2, 200),
	FOOD("pancake",		3, 1, 1, 200),
	FOOD("dead lizard",	3, 0, 1, 40),
	FOOD("fortune cookie",	7, 0, 1, 40),
	FOOD("carrot",		2, 0, 1, 50),
	FOOD("tin",		7, 0, 1, 0),
	FOOD("orange",		1, 0, 1, 80),
	FOOD("apple",		1, 0, 1, 50),
	FOOD("pear",		1, 0, 1, 50),
	FOOD("melon",		1, 0, 1, 100),
	FOOD("banana",		1, 0, 1, 80),
	FOOD("candy bar",	1, 0, 1, 100),
	FOOD("egg",		1, 0, 1, 80),
	FOOD("clove of garlic",	1, 0, 1, 40),
	FOOD("lump of royal jelly", 0, 0, 1, 200),
		BITS(0,0,1,0,1,1,1,1,0,0,0,P_NONE,SILVER), 0,
		TOOL_CLASS, 0, 0,10, 5000, 0, 0, 0, 0, 50, HI_SILVER),

/* Comestibles ... */
/* all types of food (except tins & corpses) must have a delay of at least 1. */
/* delay on corpses is computed and is weight dependant */
/* dog eats foods 0-4 but prefers tripe rations above all others */
/* fortune cookies can be read */
/* carrots improve your vision */
/* +0 tins contain monster meat */
/* +1 tins (of spinach) make you stronger (like Popeye) */
/* food CORPSE is a cadaver of some type */
/* meatballs/sticks/rings are only created from objects via stone to flesh */

/* meat */
FOOD("tripe ration",       140, 2, 10, 0, FLESH, 200, CLR_BROWN),
FOOD("corpse",               0, 1,  0, 0, FLESH,   0, CLR_BROWN),
FOOD("egg",                 85, 1,  1, 1, FLESH,  80, CLR_WHITE),
FOOD("meatball",             0, 1,  1, 0, FLESH,   5, CLR_BROWN),
FOOD("meat stick",           0, 1,  1, 0, FLESH,   5, CLR_BROWN),
FOOD("huge chunk of meat",   0,20,400, 0, FLESH,2000, CLR_BROWN),
/* special case because it's not mergable */
OBJECT(OBJ("meat ring", (char *)0),
    BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH),
    0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN),

/* fruits & veggies */
FOOD("kelp frond",           0, 1,  1, 0, VEGGY,  30, CLR_GREEN),
FOOD("eucalyptus leaf",      3, 1,  1, 0, VEGGY,  30, CLR_GREEN),
FOOD("apple",               15, 1,  2, 0, VEGGY,  50, CLR_RED),
FOOD("orange",              10, 1,  2, 0, VEGGY,  80, CLR_ORANGE),
Exemple #3
0
/* comestibles ... */
#define FOOD(name,prob,delay,wt,uk,tin,nutrition,color) OBJECT( \
		OBJ(name,NULL), BITS(1,1,uk,0,0,0,0,0,0,0,tin), 0, \
		FOOD_CLASS, prob, delay, \
		wt, nutrition/20 + 5, 0, 0, 0, 0, nutrition, color )
/* all types of food (except tins & corpses) must have a delay of at least 1. */
/* delay on corpses is computed and is weight dependant */
/* dog eats foods 0-4 but prefers tripe rations above all others */
/* fortune cookies can be read */
/* carrots improve your vision */
/* +0 tins contain monster meat */
/* +1 tins (of spinach) make you stronger (like Popeye) */
/* food CORPSE is a cadaver of some type */

	/* meat */
	FOOD("tripe ration",       142, 2, 10, 0, FLESH, 200, BROWN),
	FOOD("corpse",               0, 1,  0, 0, FLESH,   0, BROWN),
	FOOD("egg",                 85, 1,  1, 1, FLESH,  80, WHITE),
	/* fruits & veggies */
	FOOD("apple",               15, 1,  2, 0, VEGGY,  50, RED),
	FOOD("orange",              10, 1,  2, 0, VEGGY,  80, ORANGE_COLORED),
	FOOD("pear",                10, 1,  2, 0, VEGGY,  50, BRIGHT_GREEN),
	FOOD("melon",               10, 1,  5, 0, VEGGY, 100, BRIGHT_GREEN),
	FOOD("banana",              10, 1,  2, 0, VEGGY,  80, YELLOW),
	FOOD("carrot",              15, 1,  2, 0, VEGGY,  50, ORANGE_COLORED),
	FOOD("sprig of wolfsbane",   7, 1,  1, 0, VEGGY,  40, GREEN),
	FOOD("clove of garlic",      7, 1,  1, 0, VEGGY,  40, WHITE),
#ifdef TUTTI_FRUTTI
	FOOD("slime mold",          75, 1,  5, 0, VEGGY, 250, HI_ORGANIC),
#else
	FOOD("slice of pizza",      75, 1,  3, 0, VEGGY, 250, RED),
Exemple #4
0
// TODO: break each type of patch into its own method.
void MapDraw::drawPatch(float x, float y, Patch *p)
{
  float s = boxSide;
  // make it take up all the space.
  s = MODEL_SCALE;

  // default to top-right (white)
  tm->nextTexture(1);

  // WARNING: this optomization makes it so picking only works from one side of the X/Y plane.
  // (when cam location z > 0)
  if (pickMode)
  {
    StaticDraw::drawRect(x, y, s, s, s, tm);
    // if in pick mode, draw a simple rectangle simply for identifying the location.
    return;
  }

// this is getting in the way for now.
  // If this box is also picked, make a visible highlight in addition to whatever is below..
  if (p->picked)
  {
    // TODO: set alpha level
    // if the box was picked, identify it by coloring red..
    material(31,31,1);
    StaticDraw::drawBox(x, y, 0.1, s, s, 0.1, tm);
  }


// glColor can't work with glNormal, so use materials.
  if (p->TYPE == PATCH_DIRT)
  {
    // dirt texture, top-left
    tm->nextTexture(0);
    // texture "brightness"
    material(31,31,31);
    // Draw filled dirt.

    // if it is completely enclosed.... only draw the front.
    // THIS FIXES THE WEIRD BOXY PROBLEM, WHEN I IMPLEMENT THE EMPTY
    // CODE STUFF I WILL BE ABLE TO ONLY DRAW THE RECTANGLE ALL THE TIME
    // WHICH WILL FIX THE GRAPHICAL ERROR ALL THE TIME.
    if (p->top->TYPE == PATCH_DIRT)
    if (p->left->TYPE == PATCH_DIRT)
    if (p->right->TYPE == PATCH_DIRT)
    if (p->bottom->TYPE == PATCH_DIRT)
    {
      // this assumes I'm going to be looking at it from the wrong side...
      StaticDraw::drawRect(x, y, s, s, s, tm);
      return;
    }

    // Otherwise we need to do a whole cube
    StaticDraw::drawBox(x, y, 0, s, s, s, tm);
    return;
  }
  else if (EGG(p))
  {
    drawEggPatch(x, y, p);
    return;
  }
  else if (FOOD(p))
  {
    drawFoodPatch(x, y, p);
    return;
  }
  else if (EMPTY(p))
  {
    drawGroundPatch(x, y, p);
    // special drawing for this now....
    return;
  }
  else if (p->TYPE == PATCH_ENTRANCE)
  {
    // If the spot isn't empty, this is a dormant hole...
    // this will probably get confusing at some point, will need to always check
    // if portal->TYPE is empty or not.
    if (WALKABLE(p->portal))
    {
      material(1,1,1);
      StaticDraw::drawRect(x, y, 0, s, s, tm);
      // special drawing for this now....
      return;
    }
    else
    {
      drawGroundPatch(x, y, p);
      return;
    }
  }
  else if (p->TYPE == PATCH_BARRIER)
  {
    material(30,30,0);
    // Draw a barrier, rock, root, whateva, I may need to break
    // barrier into several different things, but we'll see.
    // This may also need something like the empty, where barriers
    // mold into a bigger thing instead of a bunch of little ones
  }
  else if (p->TYPE == PATCH_TOP)
  {
    // this rectangle is assuming I will go with the looking-at-wrong-side approach.

    material(1,31,1); // Greenish
    StaticDraw::drawRect(x, y, 0, s, s, tm);
    material(1,1,28); // Bluish
    StaticDraw::drawRect(x, y+MODEL_SCALE, 0, s, s, tm);
    StaticDraw::drawRect(x, y+2*MODEL_SCALE, 0, s, s, tm);
    StaticDraw::drawRect(x, y+2*MODEL_SCALE, 0, s, s, tm);

    // special drawing for this now...
    return;
  }
  else
  {
    // if its unidentified, draw a random red box.
    material(31,1,1);
    //drawBox(x, y, 0, s, s, s);
  }

  // for now, draw a box upon completion. each clause above will return early
  // if it does its business.
  StaticDraw::drawBox(x, y, 0, s*0.5, s*0.5, s*0.5, tm);
}