Ejemplo n.º 1
0
 public void removeSpell(SpellWrapper spell) {
   String duration = spell.getGameObject().getThisAttribute("duration");
   ArrayList list = getList(duration);
   if (list != null && list.contains(spell.getGameObject().getStringId())) {
     list = new ArrayList(list);
     list.remove(spell.getGameObject().getStringId());
     setList(duration, list);
   }
 }
Ejemplo n.º 2
0
 public void restoreBewitchingNullifiedSpells(GameObject target, SpellWrapper exclude) {
   for (SpellWrapper spell : getAffectingSpells(target)) {
     if (exclude == null || !exclude.getGameObject().equals(spell.getGameObject())) {
       if (spell.isNullified()) {
         spell.restoreSpell();
         // System.err.println(spell.getGameObject().getName()+" is restored after nullification");
       }
     }
   }
 }
Ejemplo n.º 3
0
 private void expireBewitchingSpells(GameObject target, SpellWrapper exclude, boolean nullify) {
   for (SpellWrapper spell : getAffectingSpells(target)) {
     if (exclude != null && exclude.getGameObject().equals(spell.getGameObject())) continue;
     if (!nullify) {
       spell.removeTarget(target);
       if (spell.getTargetCount() == 0) {
         spell.expireSpell();
         // System.err.println(spell.getGameObject().getName()+" is expired");
       }
     } else {
       spell.nullifySpell();
       // System.err.println(spell.getGameObject().getName()+" is nullified");
     }
   }
 }
Ejemplo n.º 4
0
 /**
  * Adds a spell to the master list. Organizes into three bins: permanent, day, combat. All other
  * spell duration types (instant,attack,phase,move) are ignored here.
  */
 public void addSpell(SpellWrapper spell) {
   String duration = spell.getGameObject().getThisAttribute("duration");
   if (PERMANENT_SPELLS.equals(duration)) {
     addPermanentSpell(spell);
   } else if (DAY_SPELLS.equals(duration)) {
     addDaySpell(spell);
   } else if (COMBAT_SPELLS.equals(duration)) {
     addCombatSpell(spell);
   } else if (PHASE_SPELLS.equals(duration)) {
     addPhaseSpell(spell);
   } else if (MOVE_SPELLS.equals(duration)) {
     addMoveSpell(spell);
   }
 }
Ejemplo n.º 5
0
 private void addPhaseSpell(SpellWrapper spell) {
   // only add a phase spell that has been activated (has a chit)
   if (spell.hasPhaseChit()) {
     addListItem(PHASE_SPELLS, spell.getGameObject().getStringId());
   }
 }
Ejemplo n.º 6
0
 private void addMoveSpell(SpellWrapper spell) {
   addListItem(MOVE_SPELLS, spell.getGameObject().getStringId());
 }
Ejemplo n.º 7
0
 private void addCombatSpell(SpellWrapper spell) {
   addListItem(COMBAT_SPELLS, spell.getGameObject().getStringId());
 }
Ejemplo n.º 8
0
 private void addDaySpell(SpellWrapper spell) {
   addListItem(DAY_SPELLS, spell.getGameObject().getStringId());
 }
Ejemplo n.º 9
0
 private void addPermanentSpell(SpellWrapper spell) {
   addListItem(PERMANENT_SPELLS, spell.getGameObject().getStringId());
 }