[CODE][RELESE]Advantages

From: Demond LaZaro (demond@TOLKIEN.REALMS.ORG)
Date: 12/09/97


Structs.h

/* Anywhere */
/* Advantage Flags by Demond LaZaro*/
#define ADV_INFARED     (1 << 0)
#define ADV_STRONG      (1 << 1)
#define ADV_HARD        (1 << 2)
#define ADV_SMART       (1 << 3)
#define ADV_FAST_REGEN  (1 << 4)

Find:
   long act;
Add:
   long advantage;

Limits.c: (in hit_gain)

    /* Advantage calculations */
    if (ADV_FLAGGED(ch, ADV_FAST_REGEN))
      gain += 2;

Act.informative.c: (do_score)
  sprintf(buf, "%sAdvantages: ", buf);
  if (ADV_FLAGGED(ch, ADV_HARD))
    strcat(buf, "Hard Skin   ");
  strcat(buf, "\r\n");

Utils.h:
Find:
#define PLR_FLAGS(ch) ((ch)->char_specials.saved.act)
Add:
#define ADV_FLAGS(ch) ((ch)->char_specials.saved.advantage)
#define ADV_FLAGGED(ch, flag) (!IS_NPC(ch) && IS_SET(ADV_FLAGS(ch), (flag)))

Spec_procs.c:
SPECIAL(advant)
{
  char adv_type[256] = {"     "};
  long adv_karma = 0;

  if (CMD_IS("buy")) {
    argument = one_argument(argument, adv_type);

      if (strcmp(adv_type,"infrared")==0) {
        adv_karma = 400;
      }
      if (strcmp(adv_type,"hard")==0) {
        adv_karma = 500;
      }
      /* Check to see if they have the karma */
      if ((GET_KARMA(ch) < adv_karma)) {
          send_to_char("You haven't the karma!\r\n", ch);
          return (TRUE);}

      /* Take the payment */
      GET_KARMA(ch) -= adv_karma;

      /* Set Bits */
      if (strcmp(adv_type,"infrared")==0) {
        SET_BIT(AFF_FLAGS(ch), AFF_INFRAVISION);
        send_to_char("Your seem to be able to see in the dark!\r\n",ch);
      return 1;}
      if (strcmp(adv_type,"hard")==0) {
        SET_BIT(ADV_FLAGS(ch), ADV_HARD);
        send_to_char("You feel your skin hardening!\r\n",ch);
      return 1;}

     /* If it gets this far, show them the menu */

      send_to_char("Select an operation from the following...\r\n",ch);
      send_to_char("______________________ \r\n",ch);
      send_to_char("Advantage        Karma \r\n",ch);
      send_to_char("______________________ \r\n",ch);
      send_to_char("infrared          400  \r\n",ch);
      send_to_char("hard skin         500  \r\n",ch);
      send_to_char("______________________ \r\n",ch);
      return 1; }
      return 0;
}

I think thats it :)
Thanx,
Demond


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name: Demond LaZaro the Implementor     Phone: 1-505-776-8866
Mud: Master's Realm Mud                 Code Base: CircleMud
Addy: realms.org 6969                   Addy2: 206.185.32.8 6969
Fax: None (yet :\)                      E-mail: demond@realms.org
Web Page: http://master.bevy.com/mrealm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST