/**
* This handles the standard messages for attacks. I cannot be bothered
* rewriting the docs for this.
* This handles the standard messages for the given damage types:
* blunt, sharp, pierce, fire.
*
* There are also subtypes:
* blunt - hands, feet, tail, hoof, wrestle, pommel, pound.
* sharp - claws, chew, slice, chop.
* pierce - bite, beak, stab, horns, tusks.
* @author pinkfish
* @changed Changed to use the new format.
* - Sandoz, 04th August 2001.
*/
#define __MESSAGE_DATA_CLASS__
#include <combat.h>
mapping weapon_mess;
/** @ignore yes */
mapping query_weapon_mess() { return copy(weapon_mess); }
/** @ignore */
void create() {
weapon_mess = ([
"blunt" : ({
20, "$N tap$s $I with $D.\n",
60, "$N hit$s $I with $D.\n",
100, "$N bruise$s $I with $D.\n",
140, "$N hit$s $I hard with $D.\n",
180, "$N smash$s $D into $I.\n",
220, "$N crush$s $I with $D.\n",
0, "$N mash$s $I with $D.\n",
}),
"blunt-pound" : ({
20, "$N tap$s $I with $D.\n",
60, "$N hit$s $I with $D.\n",
100, "$N crunch$s $I with $D.\n",
140, "$N fracture$s $I with $D.\n",
180, "$N mangle$s $I with $D.\n",
220, "$N shatter$s $I with $D.\n",
0, "$N obliterate$s $I with $D.\n",
}),
"blunt-tail" : ({
20, "$N tap$s $I with $p tail.\n",
60, "$N slap$s $I with $p tail.\n",
100, "$N bruise$s $I with $p tail.\n",
140, "$N hit$s $I hard with $p tail.\n",
180, "$N bash$s $I with $p tail.\n",
220, "$N smash$s $p tail into $I.\n",
0, "$N send$s $I reeling with a powerful blow to the $P from $p tail.\n",
}),
"blunt-hoof" : ({
20, "$N tap$s $I with $p hoof.\n",
60, "$N kick$s $I with $p hoof.\n",
100, "$N bruise$s $I with $p hoof.\n",
140, "$N hit$s $I hard with $p hoof.\n",
180, "$N smash$s $I with $p hoof.\n",
220, "$N crush$s $I with $p hoof.\n",
0, "$N mash$s $I with $p hoof.\n",
}),
"blunt-wrestle" : ({ // These ones are broken.
25, "$N grapple$s with $I.\n",
50, "$N catch$s $I in an arm lock.\n",
75, "$N grab$s $I around the neck.\n",
100, "$N poke$s $I in the face.\n",
125, "$N throw$s $I to the ground.\n",
150, "$N fling$s $I over $p shoulder.\n",
175, "$N punch$s $I in the stomach.\n",
200, "$N twist$s $I's arm painfully.\n",
225, "$N thump$s $I's head hard.\n",
250, "$N kick$s $I in the back.\n",
275, "$N jump$s up and down on $I.\n",
0, "$N slam$s $I's head against the ground.\n",
}),
"blunt-hands" : ({
20, "$N poke$s $I.\n",
60, "$N tickle$s $I.\n",
100, "$N punch$s $I.\n",
140, "$N elbow$s $I.\n",
180, "$N jab$s $I.\n",
220, "$N viciously hook$s $I.\n",
0, "$N beat$s $I to a pulp.\n",
}),
"blunt-feet" : ({
20, "$N poke$s $I with $p toes.\n",
60, "$N tickle$s $I with $p toes.\n",
100, "$N kick$s $I lightly.\n",
140, "$N kick$s $I in the $P.\n",
180, "$N boot$s $I viciously.\n",
220, "$N viciously kick$s $I.\n",
0, "$N kick$s $I into a bloody mess.\n",
}),
"blunt-pommel": ({
20, "$N tap$s $I with the pommel of $D.\n",
60, "$N knock$s $I with the hilt of $D.\n",
100, "$N bruise$s $I with the pommel of $D.\n",
140, "$N bash$s $I with the hilt of $D.\n",
180, "$N beat$s $I with the pommel of $D.\n",
220, "$N smash$s the hilt of $D into $I.\n",
0, "$N mash$s $I with the pommel of $D.\n",
}),
"sharp" : ({
20, "$N snick$s $I with $D.\n",
60, "$N scratch$s $I with $D.\n",
100, "$N nick$s $I with $D.\n",
140, "$N cut$s $I with $D.\n",
180, "$N slice$s $I with $D.\n",
220, "$N hack$s $I with $D.\n",
0, "$N cut$s $I into small pieces with $D.\n",
}),
"sharp-slash" : ({
20, "$N snick$s $I with $D.\n",
60, "$N scratch$s $I with $D.\n",
100, "$N nick$s $I with $D.\n",
140, "$N cut$s $I with $D.\n",
180, "$N slash$s $I with $D.\n",
220, "$N slash$s a long wound into $I with $D.\n",
0, "$N decimate$s $I with a mighty slash from $D.\n",
}),
"sharp-slice": ({
20, "$N just manage$s to slice $I with $D.\n",
60, "$N slice$s $D across $I.\n",
100, "$N shred$s $I with $D.\n",
140, "$N slice$s $D into $I.\n",
180, "$N take$s a sliver off $I with $D.\n",
220, "$N slice$s $D deeply into $I.\n",
0, "$N neatly fillet$s $I with $D.\n",
}),
"sharp-chop": ({
20, "$N lightly hack$s into $I with $D.\n",
60, "$N chop$s $D lightly into $I.\n",
100, "$N hack$s into $I with $D.\n",
140, "$N chop$s $D into $I.\n",
180, "$N hack$s deeply into $I with $D.\n",
220, "$N chop$s $D deeply into $I.\n",
0, "$N chop$s $I into pieces with $D.\n",
}),
"sharp-claws" : ({
10, "$N snick$s $I with $p claws.\n",
40, "$N scratch$s $I with $p claws.\n",
70, "$N nick$s $I with $p claws.\n",
100, "$N claw$s $I.\n",
130, "$N slice$s $I up with $p claws.\n",
160, "$N hack$s $I up with $p claws.\n",
0, "$N cut$s $I into small pieces with $p claws.\n",
}),
"sharp-chew" : ({
10, "$N nip$s $I lightly.\n",
40, "$N bite$s $I.\n",
70, "$N gash$s $I with $p teeth.\n",
100, "$N rip$s flesh off of $I.\n",
130, "$N tear$s deep into $I with $p teeth.\n",
160, "$N rip$s $I to pieces with $p teeth.\n",
0, "$N crunch$s $I with $p teeth, splattering blood everywhere.\n",
}),
"pierce": ({
20, "$N barely hit$s $I with $D.\n",
60, "$N jab$s $D into $I.\n",
100, "$N pierce$s $I with $D.\n",
140, "$N impale$s $I on $D.\n",
180, "$N skewer$s $I with $D.\n",
220, "$N run$s $I through with $D.\n",
0, "$N make$s a kebab of $I with $D.\n",
}),
"pierce-beak" : ({
10, "$N snick$s $I.\n",
40, "$N scratch$s $I with $p beak.\n",
70, "$N peck$s $I.\n",
100, "$N viciously peck$s $I.\n",
130, "$N gouge$s a hole in $I with $p beak.\n",
160, "$N slice$s $I up with $p beak.\n",
0, "$N slice$s $I up into small bits with $p beak.\n",
}),
"pierce-stab": ({
20, "$N barely stab$s $I with $D.\n",
60, "$N stab$s $I with $D.\n",
100, "$N messily stab$s $I with $D.\n",
140, "$N stab$s $I deeply with $D.\n",
180, "$N perforate$s $I with $D.\n",
220, "$N stab$s $I again and again with $D.\n",
0, "$N stab$s $D right through $I.\n",
}),
"pierce-horns": ({
20, "$N prod$s $I with $p horns.\n",
60, "$N poke$s $I with $p horns.\n",
100, "$N butt$s $I with $p horns.\n",
140, "$N pierce$s $I deeply with $p horns.\n",
180, "$N ram$s $I with $p horns.\n",
220, "$N gore$s $I with $p horns.\n",
0, "$N impale$s $I on $p horns.\n",
}),
"pierce-tusks": ({
20, "$N prod$s $I with $p tusks.\n",
60, "$N poke$s $I with $p tusks.\n",
100, "$N jab$s $p tusks into $I.\n",
140, "$N pierce$s $I with $p tusks.\n",
180, "$N stab$s $p tusks deeply into $I.\n",
220, "$N gore$s $I with $p tusks.\n",
0, "$N impale$s $I on $p tusks.\n",
}),
"pierce-bite" : ({
10, "$N nip$s $I.\n",
40, "$N nibble$s at $I.\n",
70, "$N bite$s $I.\n",
100, "$N sink$s $p teeth into $I.\n",
130, "$N bite$s through $I.\n",
160, "$N sink$s $p teeth deep into $I.\n",
0, "$N bite$s deep into $I, splintering the bones.\n",
}),
"fire" : ({
20, "$N smoke$s $I.\n",
60, "$N toast$s $I.\n",
100, "$N scorch$s $I.\n",
140, "$N crisp$s $I.\n",
180, "$N singe$s $I.\n",
220, "$N fry$s $I.\n",
260, "$N roast$s $I.\n",
300, "$N melt$s $I.\n",
340, "$N char$s $I.\n",
380, "$N burn$s $I.\n",
420, "$N incinerate$s $I.\n",
460, "$N cremate$s $I.\n",
0, "$N vapourise$s $I.\n",
})
]);
} /* create() */
/** @ignore yes */
string parse_verb( string message, int me ) {
string stuff, part1, verb, part2;
stuff = "";
while( sscanf( message, "%s %s$s%s", part1, verb, part2 ) == 3 ) {
stuff += part1+" "+( me ? verb : pluralize( verb ) );
message = part2;
}
return stuff + message;
} /* parse_verb() */
/**
* This method gets the attack messages for the weapon attacks.
* If an attack with the specified name doesn't exist in the
* weapon, it will look for the message in the handler.
* @param dam the damage of the attack
* @param type the attack type ( either sharp, pierce or blunt )
* @param him the target of the attack
* @param me the attacker
* @param name the attack name
* @param wep the weapon attacked with
* @return a class of three elements - attacker, defender and others
*/
class message_data query_message( int dam, string type, object him, object me,
string name, object wep, string area ) {
int i, sz;
mixed ind;
class message_data ret;
if( !( ind = wep->query_attack_message( name, type ) ) &&
!( ind = weapon_mess[type+"-"+name] ) &&
!( ind = weapon_mess[type] ) )
return 0;
sz = sizeof(ind);
// Find the correct message.
while( i < sz && dam > ind[i] )
i += 2;
if( i >= sz )
i = sz - 2;
ind = ind[i+1];
ret = new( class message_data );
if( stringp(ind) ) {
string pre, post;
int flag;
// Right, if $P is used, then use just one/the_short() for $I, if not,
// then $I will be poss_short()+" "+area.
// Have to use sscanf here, methinks.
// Assume there is only one $P.
// - Sandoz.
if( sscanf( ind, "%s$P%s", pre, post ) == 2 ) {
ind = pre + area + post;
flag = 1;
} else {
area = him->poss_short()+" "+area;
}
ind = replace( ind, ({
"$N", me->one_short(),
"$D", wep->poss_short(),
}) );
ret->attacker = replace( parse_verb( ind, 1 ), ({
"$p ", "your ",
"$r", "you",
"$o ", "your ",
"$I", flag ? him->the_short() : area,
}) );
ret->defender = ret->others = replace( parse_verb( ind, 0 ), ({
"$p ", me->HIS+" ",
"$r", me->HE,
"$o ", me->HIM+" ",
"$I", flag ? him->one_short() : area,
}) );
return ret;
}
ret->attacker = ret->defender = ret->others = wep->poss_short()+" seems "
"to have bad attack messages, please report it.\n";
return ret;
} /* query_message() */