/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
inherit "/std/basic/print_object";
/* this handles the standard messages for the given weapon types
 * types = blunt, sharp, pierce, burn
 * subtypes =
 *  blunt - hands, feet
 *  sharp - (claws), (bite)
 *  pierce - beak
 *  fire
 *  (cold)
 */

mapping weapon_mess;

void    create()
{
    weapon_mess =
  ([ "blunt":
({ 
  10, ({ 
	    "You miss $hname$.\n",
	    "$mcname$ misses you.\n",
	    "$mcname$ misses $hname$.\n",
	     }),
  40, ({ 
	    "You bruise $hname$.\n",
	    "$mcname$ bruises you.\n",
	    "$mcname$ bruises $hname$.\n"
	     }),
  70, ({ 
	    "You hit $hname$.\n",
	    "$mcname$ hits you.\n",
	    "$mcname$ hits $hname$.\n",
	     }),
  100, ({ 
	     "You hit $hname$ hard.\n",
	     "$mcname$ hits you hard.\n",
	     "$mcname$ hits $hname$ hard.\n",
	      }),
  130, ({ 
	     "You thump $hname$.\n",
	     "$mcname$ thumps you.\n",
	     "$mcname$ thumps $hname$.\n",
	      }),
  160, ({ 
	     "You crush $hname$.\n",
	     "$mcname$ crushes you.\n",
	     "$mcname$ crushes $hname$.\n"
	      }),
  0, ({ 
	   "You mash $hname$ up.\n",
	   "$mcname$ mashes you up.\n",
	   "$mcname$ mashes $hname$ up.\n"
	    }),
   }),
  "blunt-hands":({ 
	10, ({ 
		  "You miss $hname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hname$.\n",
		   }),
	40, ({ 
		  "You brush $hname$ lightly.\n",
		  "$mcname$ brushes you lightly.\n",
		  "$mcname$ brushes $hname$ lightly.\n",
		   }),
	70, ({ 
		  "You punch $hname$.\n",
		  "$mcname$ punches you.\n",
		  "$mcname$ punches $hname$.\n",
		   }),
	100, ({ 
		   "You strike $hname$ a glancing blow.\n",
		   "$mcname$ stikes you a glancing blow.\n",
		   "$mcname$ strikes $hname$ a glancing blow.\n",
		    }),
	130, ({ 
		   "You jab $hname$ in the stomach.\n",
		   "$mcname$ jabs you in the stomach.\n",
		   "$mcname$ jabs $hname$ in the stomach.\n",
		    }),
	160, ({ 
		   "You deal $hname$ a hard uppercut.\n",
		   "$mcname$ deals you a hard uppercut.\n",
		   "$mcname$ deals $hname$ a hard uppercut.\n",
		    }),
	0, ({ 
		 "You pummel $hname$ viciously.\n",
		 "$mcname$ pummels you viciously.\n",
		 "$mcname$ pummels $hname$ viciously.\n",
		  }),
	 }),
  "blunt-feet":({ 
	10, ({ 
		  "You miss $hname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hname$.\n",
		   }),
	40, ({ 
		  "You knock $hname$ lightly with your foot.\n",
		  "$mcname$ knocks you lightly with $mposs$ foot.\n",
		  "$mcname$ knocks $hname$ lightly with $mposs$ foot.\n",
		   }),
	70, ({ 
		  "You kick $hname$.\n",
		  "$mcname$ kicks you.\n",
		  "$mcname$ kicks $hname$.\n",
		   }),
	100, ({ 
		   "You kick $hname$ hard.\n",
		   "$mcname$ kick you hard.\n",
		   "$mcname$ boots $hname$ hard.\n",
		    }),
	130, ({ 
		   "You kick $hcname$ in the face.\n",
		   "$mcname$ kicks you in the face.\n",
		   "$mcname$ kicks $hcname$ in the face.\n",
		    }),
	160, ({ 
		   "You karate kick $hcname$ in the chest.\n",
		   "$mcname$ karate kicks you in the chest.\n",
		   "$mcname$ karate kicks $hcname$ in the chest.\n",
		    }),
	0, ({ 
		 "You kick $hcname$ senseless.\n",
		 "$mcname$ kicks you senseless.\n",
		 "$mcname$ kicks $hcname$ senseless.\n",
		  }),
	 }),
  "sharp":({ 
	10, ({ 
		  "You narrowly miss $hname$.\n",
		  "$mcname$ narrowly misses you.\n",
		  "$mcname$ narrowly misses $hname$.\n",
		   }),
	40, ({ 
		  "You scratch $hname$.\n",
		  "$mcname$ scratches you.\n",
		  "$mcname$ scratches $hname$.\n"
		   }),
	70, ({ 
		  "You cut $hname$.\n",
		  "$mcname$ cuts you.\n",
		  "$mcname$ cuts $hname$.\n",
		   }),
	100, ({ 
		   "You cut $hname$ deeply.\n",
		   "$mcname$ cuts you deeply.\n",
		   "$mcname$ cuts $hname$ deeply.\n",
		    }),
	130, ({ 
		   "You slice into $hname$.\n",
		   "$mcname$ slices into you.\n",
		   "$mcname$ slices into $hname$.\n",
		    }),
	160, ({ 
		   "You hack at $hname$ viciously.\n",
		   "$mcname$ hacks at you viciously.\n",
		   "$mcname$ hacks at $hname$ viciously.\n",
		    }),
	0, ({ 
		 "You cut $hname$ to the bone.\n",
		 "$mcname$ cuts you to the bone.\n",
		 "$mcname$ cuts $hname$ to the bone.\n",
		  }),
	 }),
  "sharp-claws":({ 
	10, ({ 
		  "You miss $hname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hname$.\n",
		   }),
	40, ({ 
		  "You paw at $hname$.\n",
		  "$mcname$ paws at you.\n",
		  "$mcname$ paws at $hname$.\n"
		   }),
	70, ({ 
		  "You scratch $hname$.\n",
		  "$mcname$ scratches you.\n",
		  "$mcname$ scratches $hname$.\n",
		   }),
	100, ({ 
		   "You claw $hname$.\n",
		   "$mcname$ claw you.\n",
		   "$mcname$ claw $hname$.\n",
		    }),
	130, ({ 
		   "You gouge $hname$.\n",
		   "$mcname$ gouges you.\n",
		   "$mcname$ gouges $hname$.\n",
		    }),
	160, ({ 
		   "You maul $hname$.\n",
		   "$mcname$ mauls you.\n",
		   "$mcname$ mauls $hname$.\n",
		    }),
	0, ({ 
		 "You maim $hname$'s viciously.\n",
		 "$mcname$ maims you viciously.\n",
		 "$mcname$ maims $hname$ viciously.\n",
		  }),
	 }),
  "sharp-bite":({ 
	10, ({ 
		  "You miss $hname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hname$.\n",
		   }),
	40, ({ 
		  "You nip $hname$.\n",
		  "$mcname$ nips you.\n",
		  "$mcname$ nips $hname$.\n"
		   }),
	70, ({ 
		  "You bite $hname$.\n",
		  "$mcname$ bites you.\n",
		  "$mcname$ bites $hname$.\n",
		   }),
	100, ({ 
		   "You bite $hname$ hard.\n",
		   "$mcname$ bites you hard.\n",
		   "$mcname$ bites $hname$ hard.\n",
		    }),
	130, ({ 
		   "You rip flesh off $hname$.\n",
		   "$mcname$ rips flesh off of you.\n",
		   "$mcname$ rips flesh off of $hname$.\n",
		    }),
	160, ({ 
		   "You gore $hname$ deeply.\n",
		   "$mcname$ gores you deeply.\n",
		   "$mcname$ gores $hname$ deeply.\n",
		    }),
	0, ({ 
		 "You rip a mouthful of flesh from $hname$.\n",
		 "$mcname$ rips a mouthful of flesh from you.\n",
		 "$mcname$ rips a mouthful of flesh from $hname$.\n",
		  }),
	 }),
  "pierce":({ 
	10, ({ 
		  "You miss $hname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hname$.\n"
		   }),
	40, ({ 
		  "You jab at $hname$.\n",
		  "$mcname$ jabs at you.\n",
		  "$mcname$ jabs at $hname$.\n"
		   }),
	70, ({ 
		  "You stab $hname$.\n",
		  "$mcname$ stabs you.\n",
		  "$mcname$ stabs $hname$.\n"
		   }),
	100, ({ 
		   "You impale $hname$.\n",
		   "$mcname$ impales you.\n",
		   "$mcname$ impales $hname$.\n"
		    }),
	130, ({ 
		   "You pierce $hname$'s flesh deeply.\n",
		   "$mcname$ pierces your flesh deelpy.\n",
		   "$mcname$ pierces $hname$'s flesh deeply.\n",
		    }),
	160, ({ 
		   "You skewer $hname$.\n",
		   "$mcname$ skewers you.\n",
		   "$mcname$ skewers $hname$.\n"
		    }),
	0, ({ 
		 "You run $hname$ through.\n",
		 "$mcname$ runs you through.\n",
		 "$mcname$ runs $hname$ through.\n"
		  })
	 }),
  "pierce-beak":({ 
	10, ({ 
		  "You miss $hcname$.\n",
		  "$mcname$ misses you.\n",
		  "$mcname$ misses $hcname$.\n",
		   }),
	40, ({ 
		  "You peck at $hcname$ with your beak.\n",
		  "$mcname$ pecks at you with $mposs$ beak.\n",
		  "$mcname$ pecks at $hcname$ with $mposs$ beak.\n",
		   }),
	70, ({ 
		  "You peck $hcname$.\n",
		  "$mcname$ pecks you.\n",
		  "$mcname$ pecks $hcname$.\n",
		   }),
	100, ({ 
		   "You visciously peck $hcname$.\n",
		   "$mcname$ visciously pecks you.\n",
		   "$mcname$ visciously pecks $hcname$.\n",
		    }),
	130, ({ 
		   "You gouge a hole in $hcname$ with your beak.\n",
		   "$mcname$ gouges a hole in you with $mposs$ beak.\n",
		   "$mcname$ gouges a hole in $hcname$ with $mposs$ beak.\n",
		    }),
	160, ({ 
		   "You slice $hcname$ up with your beak.\n",
		   "$mcname$ slices you up with $mposs$ beak.\n",
		   "$mcname$ slices $hcname$ up with $mposs$ beak.\n",
		    }),
	0, ({ 
		 "You peck $hcname$'s eyes out.\n",
		 "$mcname$ pecks your eyes out.\n",
		 "$mcname$ pecks $hcname$'s eyes out.\n",
		  }),
	 }),
  "fire":({ 
	10, ({ 
		  "You singe $hcname$ with the smoke.\n",
		  "$mcname$ singes you with the smoke.\n",
		  "$mcname$ singes $hcname$ with the smoke.\n",
		   }),
	40, ({ 
		  "You singe $hcname$.\n",
		  "$mcname$ singes you.\n",
		  "$mcname$ singes $hcname$.\n",
		   }),
	70, ({ 
		  "You burn $hcname$.\n",
		  "$mcname$ burns you.\n",
		  "$mcname$ burns $hcname$.\n",
		   }),
	100, ({ 
		   "You toast $hcname$ lightly.\n",
		   "$mcname$ toasts you lightly.\n",
		   "$mcname$ toasts $hcname$ lightly.\n",
		    }),
	130, ({ 
		   "You fry $hcname$.\n",
		   "$mcname$ frys you.\n",
		   "$mcname$ frys $hcname$.\n",
		    }),
	160, ({ 
		   "You crisp $hcname$.\n",
		   "$mcname$ crisps $hcname$.\n",
		   "$mcname$ crisps $hcname$.\n",
		    }),
	0, ({ 
		 "You cremate $hcname$.\n",
		 "$mcname$ cremates you.\n",
		 "$mcname$ cremates $hcname$.\n",
		  }),
	 }),
   ]);
}

string  parse_string( string mess, object him, object me )
{
    string  s1, s2, s3, rest;

    rest = "";
    while( sscanf( mess, "%s$%s$%s", s1, s2, s3 ) == 3 )
	switch( s2 )
	{
	    case "hname":
		mess = s1 + him->query_name() + s3;
		break;
	    case "mname":
		mess = s1 + me->query_name() + s3;
		break;
	    case "hcname":
		mess = s1 + him->query_cap_name() + s3;
		break;
	    case "mcname":
		mess = s1 + me->query_cap_name() + s3;
		break;
	    case "mposs":
		mess = s1 + me->query_possessive() + s3;
		break;
	    case "hposs":
		mess = s1 + him->query_possessive() + s3;
		break;
	    default:
		rest = s1 + "$" + s2 + "$";
		mess = s3;
		break;
	}
    return rest + mess;
}

mixed   query_message( int dam, string type, object him, object me, string name )
{
    int     j;
    mixed * ind;

    if( !(ind = weapon_mess[ type + "-" + name ]) )
	if( !(ind = weapon_mess[ type ]) )
	    return 0;
    while( j < sizeof( ind ) && dam > ind[ j ] )
	j += 2;
    if( j >= sizeof( ind ) )
	j = sizeof( ind ) - 2;
    return({ parse_string( ind[ j + 1 ][ 0 ], him, me ),
	     parse_string( ind[ j + 1 ][ 1 ], him, me ),
	     parse_string( ind[ j + 1 ][ 2 ], him, me ) });
}

int     add_weapon_mess( string type, mixed arr )
{
    weapon_mess[ type ] = arr;
    return 1;
}

int     remove_weapon_mess( string type )
{
    weapon_mess = m_delete( weapon_mess, type );
    return 1;
}

mixed   query_weapon_mess( string type )
{
    return weapon_mess[ type ];
}

mapping query_all_weapon_mess()
{
    return weapon_mess + ([ ]);
}