Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Hey there! Quick comment to explain some weirdness you'll see below. Here are two
- things
- ", QT_NAME(t), " - notice the commas
- " +HE(t)+ " - notice the +'s
- This is because the QT_NAME macros are constructed by making statements into arrays.
- Effectively, let's look at this:
- ({"You lunge, and try to hook ", QT_NAME(t), " but "+HE(t)+" steps out of the way. You fall flat on your face!.\n"})
- The first thing you see in the code below. ;) QT_NAME will depend based on who is
- actually doing the looking. This is why it's an array. These messages are sent to each
- character individually. The HE() there is a macro which gives a gendered pronoun
- (with HIM() and HIS() giving objective and possessive, respectively), so it's unnecessary
- to make it into an actual entry. Just concatenate that stuff right into the string there. ;)
- Sorry if this is weird. To make it short, always make sure you surround QT_NAME() and
- similar macros with commas. Always surround HE() and similar macros with plus signs. :)
- -WW
- QT_NAME(t) target full description or remembered name), join with commas
- QCT_NAME(f) attacker full description or remembered name), join with commas
- HE(t) target pronoun, join with +
- HIS(f) attacker possessive pronoun, join with +
- capitalize() useful for capitalising pronouns
- */
- #include "../cfs_defs.h"
- #define T_ENV(s,obs) tell_objects(all_inventory(environment(obs[0]),2)-obs,s);
- #define T(o,s) o->catch_msg(s)
- inherit STD_STYLE;
- string query_author() { return "Bokitja"; }
- int style_check(object f, string sp) {
- switch(f->query_race()) {
- case "dwarf":
- return 1;
- break;
- case "human":
- case "areede":
- case "northman":
- if (f->query_height() is-more-than("short") ) { // FIXME how to get, and compare?
- f->catch_msg("You are too tall to use this style.\n");
- return 0;
- break;
- }
- else if (f->query_strength() is-less-than("forceful")) { // FIXME how to get, and compare?
- f->catch_msg("You lack the raw power of a Dwarf to use this fighting style.\n");
- return 0;
- break;
- }
- else {
- return 1;
- break;
- }
- case "gnome":
- case "brookling":
- case "hillgnome":
- if (f->query_strength() is-less-than("epic")) { // FIXME how to get, and compare?
- f->catch_msg("You lack the raw power of a Dwarf to use this fighting style.\n");
- return 0;
- break;
- }
- else {
- return 1;
- break;
- }
- return 1;
- break;
- default:
- f->catch_msg("You lack the necessary strength and compactness of a Dwarf to use this fighting style.\n");
- return 0;
- break;
- }
- }
- public void get_messages(object f, object t, string sp, int success, mixed
- additional) {
- string wp;
- string deity;
- string self_output, target_output, room_output;
- object * wielded;
- int wielded_size, wielded_count; // for scream
- if(additional&&objectp(additional))
- wp = additional->short();
- else
- wp = "clenched fist";
- deity = f->query_deity();
- switch(sp) {
- case CFS_S_PUNCH:
- switch(success) {
- case 0: // critical failure
- self_output = "You lunge at ", QT_NAME(t), " and try to hook " +HIM(t)+ ", but " + HE(t)+ " steps out of the way. You crash to the floor, landing on your outstretched arm!.\n";
- target_output = QCT_NAME(f), " lunges at you with an outsretched arm, but you step out of the way. ", QCT_NAME(f), " crashes to the floor!\n";
- room_output = QCT_NAME(f), " lunges at ",QT_NAME(t), " with an outstretched arm, but " +HE(t)+ " steps out of the way. ", QCT_NAME(f), " crashes to the floor!\n";
- break;
- case 1: // failure
- self_output = "You lunge at ", QT_NAME(t), " and manage to hook " +HIM(t)+ ", but " + HE(t)+ " breaks free and pushes you away.\n";
- target_output = QCT_NAME(f), " lunges at you and hooks an arm around you, but you manage to break free.\n";
- room_output = QCT_NAME(f), " lunges at ",QT_NAME(t), " and hooks an arm around " +HIM(t)+ ", but ", QT_NAME(t), " manages to break free from the attack.\n";
- break;
- case 2: // success
- self_output = "You lunge at ", QT_NAME(t), " and manage to hook " +HIM(t)+ " long enough to land a heavy punch.\n";
- target_output = QCT_NAME(f), " lunges at you, and hooks you long enough to land a heavy punch.\n";
- room_output = QCT_NAME(f), " lunges at ", QT_NAME(t), ", and hooks " +HIM(t)+ " long enough to land a heavy punch.\n";
- break;
- case 3: // critical success
- self_output = "You lunge at ", QT_NAME(t), " and manage to hook " +HIM(t)+ " long enough to land a heavy punch. Your fist bores deep into muscle!\n " + QCT_NAME(t), " howls in pain!\n";
- target_output = QCT_NAME(f), " lunges at you, and hooks you long enough to land a heavy punch. ", QCT_NAME(f), "'s fist bores deep into your muscle!\n You howl in pain!\n";
- room_output = QCT_NAME(f), " lunges at ", QT_NAME(t), " and hooks " +HIM(t)+ " long enough to land a heavy punch. ", QCT_NAME(f), "'s fist bores deep into muscle!\n", QCT_NAME(t), " howls in pain!\n";
- break;
- }
- break;
- case CFS_S_KICK:
- switch(success) {
- case 0: // critical failure
- self_output = "You barge in close to ", QT_NAME(t), " and raise your foot, but you lose your balance and fall to the ground.\n";
- target_output = QCT_NAME(f), " barges in close to you and raises a foot, but " + HE(f)+ " overbalances and falls to the ground.\n";
- room_output = QCT_NAME(f), " barges in close to " ,QT_NAME(t), " and raises " + HIS(f)+ " foot, but overbalances and falls to the ground.\n";
- break;
- case 1: // failure
- self_output = "You barge towards ", QT_NAME(t), " and raise your foot, but " + HE(t)+ " doesn't let you get close enough for an attack.\n";
- target_output = QCT_NAME(f), " barges towards you and raises a foot, but you are able to keep your distance.\n";
- room_output = QCT_NAME(f), " barges towards ", QT_NAME(t), " and raises a foot, but ", QT_NAME(t), " is able to keep " +HIM(f)+ " at a distance.\n";
- break;
- case 2: // success
- self_output = "You barge in close to ", QT_NAME(t), ", raise your foot and drive it into "+HIS(t)+" leg.\n";
- target_output = QCT_NAME(f), " barges in close to you, raises a foot and drives it into your leg.\n";
- room_output = QCT_NAME(f), " barges in close to ", QT_NAME(t), ", raises a foot and drives it into " +HIS(t)+ " leg.\n";
- break;
- case 3: // critical success
- self_output = "You barge in close to ", QT_NAME(t), ", raise your foot and drive it HARD into "+HIS(t)+" knee!\n";
- target_output = QCT_NAME(f), " barges in close to you, raises a foot and drives it HARD into your knee!\n";
- room_output = QCT_NAME(f), " barges in close to ", QT_NAME(t), ", raises a foot and drives it HARD into " +HIS(t)+ " knee!\n";
- if (!t->query_prop(LIVE_I_AT_GROUND)) {
- self_output += QCT_NAME(t), "'s knee buckles and " +HE(t)+ " falls to the ground.\n";
- target_output += "Your knee buckles and you fall to the ground.\n";
- room_output += QCT_NAME(t), "'s knee buckles and " +HE(t)+ " falls to the ground.\n";
- }
- break;
- }
- break;
- case CFS_S_CLEAVE:
- if(!success) {
- self_output = "You lumber toward ", QT_NAME(t), " with your " +wp+ " held high. At the last moment you leap into the air and furiously swing your " +wp+ ", but " +HE(t)+ " steps out of the way.\n";
- target_output = QCT_NAME(f), " lumbers toward you with " +HIS(f)+ " " +wp+ " held high. " +capitalize(HE(t))+ " leaps into the air and swings " +HIS(f)+ " " +wp+ " at you, but you are able to step away in time.\n";
- room_output = QCT_NAME(f), " lumbers towards ", QT_NAME(t), " with " +HIS(f)+ " " +wp+ " held high. " +capitalize(HE(t))+ " leaps and swings, but ", QT_NAME(t), " steps out of the way.\n";
- }
- else {
- self_output = "You lumber toward ", QT_NAME(t), " leading the way with your " +wp+ " held high. ", QCT_NAME(t), " hesitates long enough for you to leap up and bring your " +wp+ " down in a furious *SMASH*, splattering blood everywhere!\n";
- target_output = QCT_NAME(f), " lumbers towards you, leading the way with " +HIS(f)+ " " +wp+ " held high. You hesitate just long enough for " +HIM(f)+ " to leap up and bring " +HIS(f)+ " " +wp+ " down upon you in a furious *SMASH*, and you see your blood splatter!\n";
- room_output = QCT_NAME(f), " lumbers towards ", QT_NAME(t), " leading the way with " +HIS(f)+ " " +wp+ " held high. ", QCT_NAME(t), " hesitates long enough for ", QT_NAME(f), " to leap up and bring " +HIS(f)+ " " +wp+ " down in a furious *SMASH*. You are hit with splattering blood!\n";
- }
- break;
- case CFS_S_SPIN:
- if(!success) {
- self_output = "You charge at ", QT_NAME(t), " swinging your " +wp+ " wildly, but you clumsily hit nothing but air!\n";
- target_output = QCT_NAME(f), " charges at you, swinging " +HIS(f)+ " " +wp+ " wildly. You avoid the attack.\n";
- room_output = QCT_NAME(f), " charges at ", QT_NAME(t), " swinging " +HIS(f)+ " " +wp+ " wildly, but " +HE(f)+ " clumsily hits nothing but air!\n";
- }
- else {
- self_output = "You charge at ", QT_NAME(t), ", swinging your " +wp+ " in a wild frenzy! You explode through ", QT_NAME(t), "'s feeble guard and land a *SOLID* blow!\n";
- target_output = QCT_NAME(f), " charges at you, swinging " +HIS(f)+ " " +wp+ " in a wild frenzy! " +capitalize(HE(f))+ " crashes through your guard and lands a *SOLID* blow!\n";
- room_output = QCT_NAME(f), " charges at ", QT_NAME(t), ", swinging " +HIS(f)+ " " +wp+ " in a wild frenzy! " +capitalize(HE(f))+ " explodes through ", QT_NAME(t), "'s feeble guard and lands a *SOLID* blow!\n";
- }
- break;
- case CFS_S_DISARM:
- if(!success) {
- self_output = "You lunge and try to grab hold of ", QT_NAME(t), "'s arm, but fail.\n";
- target_output = QCT_NAME(f), " lunges and tries to grab your arm but fails.\n";
- room_output = QCT_NAME(f), " lunges and tries to grab ", QT_NAME(t), + "'s arm, but fails.\n";
- }
- else {
- self_output = "You lunge, grab hold of ", QT_NAME(t), "'s arm, pull it close to your chest and *CHOMP* down hard on " +HIS(t)+ " hand. Blood spurts from the wound, and " +HIS(t)+ " weapon clatters to the ground!\n";
- target_output = QCT_NAME(f), " lunges, grabs hold of your arm, pulls it close to " + HIS(f)+ " chest and *CHOMPS* down hard on your hand. Blood spurts from the wound and you lose hold of your weapon!\n";
- // FIXME target's weapon? not wp
- room_output = QCT_NAME(f), " lunges, grabs hold of ", QT_NAME(t), "'s arm, pulls it in close to " +HIS(f)+ " chest and *CHOMPS* down hard on ", QT_NAME(t), "'s hand. Blood spurts from the wound, and ", QT_NAME(t), "'s weapon falls to the ground!\n";
- }
- break;
- case CFS_S_STAND:
- if(!success) {
- self_output = "You plant your " +wp+ " into the ground and try to propel yourself up, but it gives way and you fall back to the ground.\n";
- target_output = QCT_NAME(f), " tries to propel " +HIM(f)+ "self up off the ground but fails.\n";
- room_output = target_output;
- }
- else {
- self_output = "You plant your " +wp+ " into the ground and propel yourself up onto your feet.\n";
- target_output = QCT_NAME(f), " propels " +HIM(f)+ "self up onto " +HIS(f)+ " feet.\n";
- room_output = target_output;
- }
- break;
- case CFS_S_RESCUE:
- if(!success) {
- self_output = "You hurtle toward ", QT_NAME(t), ", preparing to bump " +HIM(t)+ " out of harm's way. Your timing is off and you succeed only in attacking from a different angle.\n";
- target_output = QCT_NAME(f), " hurtles past you, making no appreciable difference to the fight.\n";
- room_output = QCT_NAME(f), " hurtles past ", QT_NAME(t), ", making no appreciable difference to the fight.\n";
- }
- else {
- self_output = "With a running start you barrel into ", QT_NAME(t), ", knocking " + HIM(t)+ " out of harm's way.\n";
- target_output = QCT_NAME(f), " barrels into you, knocking you out of harm's way.\n";
- room_output = "With a running start ", QCT_NAME(f), " barrels into ", QT_NAME(t), ", knocking " +HIM(t)+ " out of harm's way.\n";
- }
- break;
- case CFS_S_FOCUS:
- switch(success) {
- case -1: // message when it wears off
- self_output = "A jumble of thoughts return to your mind.\n";
- target_output = QCT_NAME(f), " flinches and for a brief moment a scowl crosses " +HIS(f)+ " face.\n";
- break;
- case 0: // initial message (at time when command is given)
- self_output = "You utter a prayer to " +deity+ " and focus your thoughts on " + additional+ ".\n";
- target_output = QCT_NAME(f), " murmurs something quietly to " +HIM(f)+ "self.\n";
- break;
- case 1: // failure
- self_output = "You seem to have recited the prayer wrong. You grit your teeth in frustration.\n";
- target_output = QCT_NAME(f), " grits " +HIS(f)+ " teeth and looks frustrated.\n";
- break;
- case 2: // success
- self_output = "Your prayer is answered. You feel you will be able to use " + additional+ " more effectively now.\n";
- target_output = QCT_NAME(f), " appears satisfied with " +HIS(f)+ " prayer.\n";
- break;
- case 3: // critical success
- self_output = "Adrenaline courses through your body as your prayer is answered. You feel like you cannot fail!\n";
- target_output = QCT_NAME(f), "'s eyes glimmer, " +HIS(f)+ " muscles ripple, and " + HE(f)+ " appears very satisfied with " +HIS(f)+ " prayer.\n";
- break;
- }
- room_output = target_output;
- break;
- case CFS_S_SCREAM:
- // FIXME int wielded_count = 0 or 1 or 2;
- // unarmed: 0
- // unarmed + shield: 0
- // one 2hander: 1
- // one 1hander + shield: 1
- // one 1hander: 1
- // two 1handers: 2
- wielded = f->query_wielded();
- wielded_size = sizeof(wielded),
- wielded_count = 0;
- for (int i = 0; i < wielded_size; i++) {
- if (wielded[i]->query_type() != SHIELD) {
- wielded_count++;
- }
- }
- switch(wielded_count) {
- case 0:
- self_output = "Fists held wide, ";
- target_output = self_output;
- break;
- case 1:
- self_output = "Brandishing your " +wp+ " above your head, ";
- target_output = "Brandishing " +HIS(t)+ " " +wp+ " above " +HIS(t)+ " head, ";
- break;
- case 2:
- self_output = "Brandishing your weapons wide, ";
- target_output = "Brandishing " +HIS(t)+ " weapons wide, ";
- break;
- }
- room_output = target_output;
- self_output += "you shout an ancient battle hymn to " +deity+ " and charge into battle!\n";
- target_output += HE(f)+ " shouts in an unfamiliar tongue and charges towards you!\n";
- room_output += HE(f)+ " shouts in an unfamiliar tongue and charges towards ", QT_NAME(t), "!\n";
- switch(success) {
- case 0: // critical failure
- self_output += QCT_NAME(t), " holds " +HIS(t)+ " ground and laughs in your face!\n";
- target_output += "You hold your ground and laugh in ", QT_NAME(f), "'s face!\n";
- room_output += QCT_NAME(t), " holds " +HIS(t)+ " ground and laughs loudly.\n";
- break;
- case 1: // failure
- self_output += QCT_NAME(t), " holds " +HIS(t)+ " ground and stares you down.\n";
- target_output += "You hold your ground and lock gaze with ", QT_NAME(f), ".\n";
- room_output += QCT_NAME(t), " holds " +HIS(t)+ " ground, glaring at ", QT_NAME(f), ".\n";
- break;
- case 2: // success
- self_output += QCT_NAME(t), " looks a bit fearful.\n";
- target_output += "A feeling of dread overcomes you!\n";
- room_output += QCT_NAME(t), " looks a bit fearful.\n";
- break;
- case 3: // critical success 1
- self_output += QCT_NAME(t), " looks terrified! " +capitalize(HE(t))+ " tries to back up, but stumbles and falls to the ground.\n";
- target_output += "Fear takes hold of you! You begin to backpedal, but stumble and fall!\n";
- room_output += QCT_NAME(t), " looks terrified! " +capitalize(HE(t))+ " tries to back up, but stumbles and falls to the ground.\n";
- break;
- case 4: // critical success 2
- self_output += QCT_NAME(t), " looks terrified, and stands frozen on the spot!\n";
- target_output += "Fear takes hold of you. You tense up and feel unable to move!\n";
- room_output += QCT_NAME(t), " looks terrified, and stands frozen on the spot!\n";
- break;
- }
- break;
- case CFS_S_BASH:
- if(!success) {
- self_output = "You snap your " +wp+ " out with a fierce backhand, but miss.\n";
- target_output = QCT_NAME(f), " snaps " +HIS(f)+ " " +wp+ " with a fierce backhand, but misses.\n";
- room_output = target_output;
- }
- else {
- self_output = "You *SNAP* your " +wp+ " out with a fierce backhand, walloping ", QT_NAME(t), ".\n";
- target_output = QCT_NAME(f), " *SNAPS* " +HIS(f)+ " " +wp+ " out with a fierce backhand. You move to block, but you are too late as it slams into you!\n";
- room_output = QCT_NAME(f), " *SNAPS* " +HIS(f)+ " " +wp+ " out with a fierce backhand, giving ", QT_NAME(t), " a good wallop!\n";
- }
- break;
- case CFS_S_IRONWILL:
- if(!success) {
- self_output = "You search for " +(deity == "no god") ? "courage" : deity+ " in your heart but fail!\n";
- target_output = "";
- room_output = target_output;
- }
- else {
- if (deity == "no god")
- deity = "all that I stand for";
- self_output = "Your knuckles turn white as you grip your " +wp+ " firmly. You plant your feet firmly and shout: By da name of " +deity+ ", I shall not fail!!\n";
- target_output = QCT_NAME(f), " grips " +HIS(f)+ " " +wp+ " firmly, knuckles turning white. " +capitalize(HE(f))+ " plants " +HIS(f)+ " feet firmly, and shouts: By da name of " +deity+ ", I shall not fail!!\n";
- room_output = target_output;
- }
- break;
- case CFS_S_REST:
- target_output = "";
- switch (success) {
- case -1: // messsage when command given
- self_output = "You quietly hum a prayer to " +deity+ ".\n";
- target_output = QCT_NAME(f), " seems to be quietly humming.\n";
- break;
- case 0: // message after call-out: failure
- self_output = "You falter and lose your rhythm. How annoying!\n";
- target_output = QCT_NAME(f), " stops humming, then swears loudly!\n";
- break;
- case 1: // message after call-out: success
- self_output = "You hum a song of prayer, feeling your faith wash your fatigue away.\n";
- target_output = QCT_NAME(f), " seems to be refreshed.\n";
- break;
- }
- room_output = target_output;
- break;
- case CFS_S_BLIND:
- switch(success) {
- case 0:
- self_output = "You bend over to grasp some " +additional+ " and prepare to throw it at ", QT_NAME(t), ", but it slips through your fingers as you try to hurl it. Instead of hitting ", QT_NAME(t), ", it flicks back in your face!\n";
- target_output = QCT_NAME(f), " fumbles while trying to throw something, and hits " +HIM(f)+ "self in the face, looking quite stupid in the process.\n";
- room_output = target_output;
- break;
- case 1:
- self_output = "You bend over to grasp some " +additional+ " and prepare to throw it at ", QT_NAME(t), ", but it slips through your fingers as you try to hurl it.\n";
- target_output = QCT_NAME(f), " fumbles while trying to throw something, and swings an empty hand toward you.\n";
- room_output = QCT_NAME(f), " fumbles while trying to throw something, and swings an empty hand toward ", QT_NAME(t), ".\n";
- break;
- case 2:
- self_output = "You squat to grasp some " +additional+ ", and hurl it at ", QT_NAME(t), ". It was a good throw, and " +additional+ " lands in " +HIS(t)+ " eyes even though " +HE(t)+ " turned " +HIS(t)+ " head at the last possible moment. " +HE(t)+ " seems temporarily blinded. You rise up and return to your fighting stance.\n";
- target_output = "You notice ", QT_NAME(f), " squatting to grasp some " +additional+ ", and hurling it in your direction. You turn your head aside in time to partly avoid it, so you are blinded, but you are sure it could have been worse.\n";
- room_output = QCT_NAME(f), " hurls some " +additional+ " at ", QT_NAME(t), ", and even though ", QT_NAME(t), " turns " +HIS(t)+ " head at the last possible moment, " +HE(t)+ " is hit by it and left blind for a moment. ", QCT_NAME(f), " resumes " +HIS(f)+ " fighting stance.\n";
- break;
- case 3:
- self_output = "You deftly grasp some " +additional+ " as you step low towards ", QT_NAME(t), ". You hurl it in the same motion, and " +additional+ " lands squarely in " +HIS(t)+ " face. That should blind "+HIM(t)+ " for a while.\n";
- target_output = QCT_NAME(f), " steps low towards you, grasping at something. " +capitalize(HE(f))+ " hurls it in the same motion, and you are hit squarely in the face with " +additional+ ". You're blinded and it hurts like hell.\n";
- room_output = QCT_NAME(f), " steps low towards ", QT_NAME(t), ", grasping at something. " +capitalize(HE(f))+ " hurls it in the same motion, and ", QT_NAME(t), " is hit squarely in the face with " +additional+ ". " +capitalize(HE(t))+ " seems to be blinded and in pain.\n";
- break;
- }
- break;
- default: T(f,"YOU ENCOUNTERED A BUG. CONTACT PINCER!\n");
- break;
- }
- T(f, self_output);
- T(t, target_output);
- T_ENV(({room_output}), ({f,t}));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement