New Spell/Item Affects

From Immortal Wiki
Revision as of 03:06, 10 November 2009 by Brazil (talk | contribs) (New page: // the goal: // create a generic way to treat both aff's and apply's as one thing // if a spell does an apply and an affect, they become multiple modifiers // if an object has a perm-a...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
// the goal:
// create a generic way to treat both aff's and apply's as one thing
// if a spell does an apply and an affect, they become multiple modifiers
// if an object has a perm-affect, it just looks like another apply
// Maybe- spells redesigned into a list of modifiers, and if an item
//     has a modifier that's just a spellnum with flag == -1, then it
//     applies that spell to who wears it!  genius!

class Affect {
  public:
      Affect();
      ~Affect();

      bitfield flags;


      Modif *modifiers;
};

class Modif {
   public:
      Modif();
      ~Modif();

      int location; // AFF_XXX or APPLY_XXX (those will get renamed into one
                    // thing)
      int amt;

      int level;
      int duration;
      int spellnum; // -1 for no spell

      // conditions
      int cond_type; // moon phase, class, race, etc, -1 for N/A
      int cond_value; // which class or race, etc
                      // for some:
                      // 0 = cond_type == false
                      // 1 = cond_type == true

      game_data *obj; // person its on, or object
      game_data *caster; // for who cast the spell (good for damage spells!)
      event_data *event; // event_obj points back to this
};
// sanc spell
Modifier:
  flag = AFF_SANCTUARY;
  level = 16;
  duration = 90; // seconds
  spellnum = SPELL_SANCTUARY;
  cond_type = -1;
  cond_value = 0;
  obj = ch;

// damroll apply from an item (no conditionals)
Modifier:
  flag = APPLY_DAMROLL;
  level = 0;
  duration = -1;
  spellnum = -1;
  cond_type = -1;
  cond_value = 0;

// damroll apply from an item, with full moon condition
Modifier:
  flag = APPLY_DAMROLL;
  level = 0;
  duration = -1;
  spellnum = -1;
  cond_type = APPLY_COND_MOON_FULL
  cond_value = 1; // 0 =