/******************************************************** * * * Consider command improvements * * ----------------------------- * * * * This is designed to improve the basic consider * * command so that it not only compares levels but * * also hitpoints and damage (both in pecentage terms) * * I have only included a minimum of messages, so that * * you can add your own and be inventive. * * * * This should be added to do_consider in act_info.c * * * * It is designed to work with Rom 2.4b although it * * may also work on other code bases (not guaranteed) * * * * Written by Adrian Meredith (Ichike) January 2009 * * Come visit us at http://www.wonmud.com/ or * * connect to telnet://wonmud.com:9000 * * * ********************************************************/ /* Add after * act (msg, ch, NULL, victim, TO_CHAR); * and before return; */ /* now add a bit for hps */ diff = (victim->max_hit / ch->max_hit) * 100; /* i.e. diff now is a percentage of your hps */ if (diff <= 20) msg = "$N{y would die if you breathed on them{x"; else if (diff <= 50) msg = "$N{Y couldn't handle many blows{x"; else if (diff <= 80) msg = "$N{c has less health than you{x"; else if (diff <= 120) msg = "$N{C has about the same health as you{x"; else if (diff <= 150) msg = "$N{g is healthier than you{x"; else if (diff <= 200) msg = "$N{G is a lot healthier than you{x"; else if (diff <= 300) msg = "$N{r is considerably healthier than you{x"; else if (diff <= 500) msg = "$N{W makes you look like a weakling{x"; else msg = "{RIt looks like $N will never die{x"; act (msg, ch, NULL, victim, TO_CHAR); /* This bit is quite long and involved, for working out damage dealt */ int theirdam = (ch->level/4) * (ch->level/8) + ch->level + 2; OBJ_DATA * wield = get_eq_char (ch, WEAR_WIELD); if (IS_NPC (victim)) theirdam = dice (victim->damage[DICE_NUMBER], victim->damage[DICE_TYPE]); else { wield = get_eq_char (victim, WEAR_WIELD); if (wield == NULL) { /* unarmed */ theirdam = number_range (victim->level / 2, victim->level * 3 / 2); } else { /* armed */ theirdam = dice (wield->value[1], wield->value[2]); } if (get_skill (victim, gsn_enhanced_damage) > 0) theirdam *= 2; } int yourdam = (ch->level/4) * (ch->level/8) + ch->level + 2;; if (IS_NPC (ch)) yourdam = dice (ch->damage[DICE_NUMBER], ch->damage[DICE_TYPE]); else { wield = get_eq_char (ch, WEAR_WIELD); if (wield == NULL) { /* unarmed */ yourdam = number_range (ch->level / 2, ch->level * 3 / 2); } else { /* armed */ yourdam = dice (wield->value[1], wield->value[2]); } if (get_skill (ch, gsn_enhanced_damage) > 0) theirdam *= 2; } /* All of the above was setting it up. It should be noted that even after all of that, * It doesn't take into account number of attacks, mana and a variety of other things. * Now for the damage messages: */ diff = (theirdam / yourdam) * 100; /* i.e. diff now is a percentage of your damage comparison */ if (diff <= 20) msg = "$N{y would be slaughtered by you{x"; else if (diff <= 50) msg = "$N{Y has no hope against your strength{x"; else if (diff <= 80) msg = "$N{c has less strength than you{x"; else if (diff <= 120) msg = "$N{C has about the same strength as you{x"; else if (diff <= 150) msg = "$N{g is stronger than you{x"; else if (diff <= 200) msg = "$N{G is a lot stronger than you{x"; else if (diff <= 300) msg = "$N{r is considerably stronger than you{x"; else if (diff <= 500) msg = "$N{W would slaughter you{x"; else msg = "{RAttacking $N would be suicide{x"; act (msg, ch, NULL, victim, TO_CHAR); /* End of code snippet */ /* Don't forget to keep in the last bit of the function, i.e. return; } * / /* The damage comparison part could possibly be improved, but looking at how complex that was, * I wonder if anyone really has the energy to do even more... */