Esempio n. 1
0
        public static void Transpose(Fight fight, Fighter caster, List<Fighter> targets, int cellID, Engines.Spells.SpellEffect effect)
        {
            if (caster.CellID != cellID)
            {
                foreach (Fighter transposed in targets)
                {
                    int casterCell = caster.CellID;
                    int transposedCell = transposed.CellID;

                    caster.CellID = transposedCell;
                    transposed.CellID = casterCell;

                    fight.Send("GA0;4;" + caster.ID + ";" + caster.ID + "," + caster.CellID);
                    fight.Send("GA0;4;" + transposed.ID + ";" + transposed.ID + "," + transposed.CellID);
                }
            }
        }
Esempio n. 2
0
 public static void Teleport(Fight fight, Fighter caster, int cell)
 {
     if (fight.GetFighterOnCell(cell) == null)
     {
         fight.Send("GA0;4;" + caster.ID + ";" + caster.ID + "," + cell);
         caster.CellID = cell;
     }
 }
Esempio n. 3
0
 public static void SubMPBuff(Fight fight, Fighter caster, Engines.Spells.SpellEffect effect, List<Fighter> targets, bool canEsquiv)
 {
     int subMP = 0;
     if (effect.Value2 > 0 && effect.Value3 > 0)
     {
         subMP = Utilities.Basic.Rand(effect.Value + effect.Value3, effect.Value2 + effect.Value3);
     }
     else
     {
         subMP = effect.Value;
     }
     foreach (Fighter target in targets)
     {
         int toRemove = subMP;
         int esquivedAp = 0;
         if (canEsquiv)
         {
             for (int i = 0; i <= subMP - 1; i++)
             {
                 bool esquiv = TryEsquiv(caster, target);
                 if (esquiv)
                 {
                     esquivedAp++;
                     toRemove--;
                 }
             }
         }
         if (esquivedAp > 0)
         {
             fight.Send("GA;308;" + caster.ID + ";" + target.ID + "," + esquivedAp);
         }
         target.AddBuff(caster.ID, new Spells.Buffs.SubPMBuff(subMP, effect.Turn, target), (int)effect.Effect, -toRemove, true, effect);
     }
 }
Esempio n. 4
0
 public static void LaunchWeared(Fight fight, Fighter caster, Engines.Spells.SpellEffect effect, List<Fighter> targets, int cellID)
 {
     if (fight.GetFighterOnCell(cellID) == null)
     {
         if (caster.WearedFighter != null)
         {
             caster.WearedFighter.CellID = cellID;
             caster.WearedFighter.UnWear();
             fight.Send("GA0;51;" + caster.ID + ";" + cellID);
         }
         else
         {
             fight.Send("GA;950;" + caster.ID + ";" + caster.ID + "," + (int)FighterState.Porteur + ",0");
             caster.WearedFighter = null;
             fight.Send("GA0;51;" + caster.ID + ";" + cellID);
         }
     }
 }
Esempio n. 5
0
 public static void DeleteAllBonus(Fight fight, Fighter caster, Engines.Spells.SpellEffect effect, List<Fighter> targets)
 {
     foreach (Fighter target in targets)
     {
         target.RemoveAllBuffs();
         fight.Send("GA0;132;" + caster.ID + ";" + target.ID);
     }
 }
Esempio n. 6
0
 public static void ChangeSkin(Fight fight, Fighter caster, Engines.Spells.SpellEffect effect, List<Fighter> targets, int cellID)
 {
     int skin = effect.Value3;
     foreach (Fighter target in targets)
     {
         if (effect.Value3 != -1)
         {
             target.AddBuff(caster.ID, new Spells.Buffs.ChangeSkinBuff(skin, effect.Turn, target), (int)effect.Effect, 0, false, effect);
             fight.Send("GA;149;" + caster.ID + ";" + target.ID + "," + skin + "," + skin + "," + effect.Turn);
         }
         else
         {
             fight.Send("GA;149;" + caster.ID + ";" + target.ID +
                         "," + target.Look + "," + target.Look + ",-1");
         }
     }
 }