public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
        {
            foreach (Effect debuff in user.activeEffects)
            {
                if (!debuff.AllowedDiceAbilities()[2])
                {
                    usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
                    return;
                }
            }
            int            hitsCount = Constant.a_multishotHits;
            List <Diceman> diceHit   = new List <Diceman>();

            if (target.isAlive && BattleBoard.GetBlockDistanceBetweenDice(user, target) <= range)
            {
                float damageDealt = user.strength * damage;
                usageDescription = target.DamageDice(damageDealt);
                hitsCount--;
                diceHit.Add(target);
            }
            for (int i = -range; i <= range; i++)
            {
                for (int j = -range; j <= range; j++)
                {
                    if (BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j) != null && hitsCount > 0)
                    {
                        target = BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j).occupyingDiceman;
                        foreach (Diceman dice in diceHit)
                        {
                            if (dice == target)
                            {
                                target = null;
                            }
                        }
                        if (target != null && target.isAlive && target.ownedByPlayer != user.ownedByPlayer &&
                            BattleBoard.GetBlockDistanceBetweenDice(user, target) <= range)
                        {
                            float damageDealt = user.strength * damage;
                            if (hitsCount == Constant.a_multishotHits)
                            {
                                usageDescription = "";
                            }
                            usageDescription += target.DamageDice(damageDealt);
                            hitsCount--;
                        }
                    }
                }
            }
            if (hitsCount == Constant.a_multishotHits)
            {
                usageDescription = name + " failed as no enemies \nwere in range.";
            }
            else
            {
                usageDescription += ".";
            }
        }
Beispiel #2
0
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     foreach (Effect debuff in user.activeEffects)
     {
         if (!debuff.AllowedDiceAbilities()[2])
         {
             usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
             return;
         }
     }
     if (target.isAlive)
     {
         float  damageDealt         = user.strength * damage;
         String damageDealtDescript = target.DamageDice(damageDealt);
         if (target.isAlive)
         {
             BattleBoard.AddEffect(new AbilityInput(
                                       user,
                                       new Stunned(0, Constant.e_stunDuration, 0, Constant.e_stunSpeed, Constant.e_stunIcon),
                                       target,
                                       Vector2.Zero));
             usageDescription = damageDealtDescript + " and is STUNNED.";
         }
         else
         {
             usageDescription = damageDealtDescript + ".";
         }
     }
     else
     {
         usageDescription = "Target is already dead.";
     }
 }
Beispiel #3
0
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     foreach (Effect debuff in user.activeEffects)
     {
         if (!debuff.AllowedDiceAbilities()[2])
         {
             usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
             return;
         }
     }
     for (int i = -range; i <= range; i++)
     {
         for (int j = -range; j <= range; j++)
         {
             if (BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j) != null)
             {
                 target = BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j).occupyingDiceman;
                 if (target != null && target.isAlive && target.ownedByPlayer != user.ownedByPlayer)
                 {
                     float damageDealt = user.strength * damage;
                     usageDescription = target.DamageDice(damageDealt);
                     user.Move(firedBoardLocation);
                     usageDescription += " and \n" + user.ownedByPlayer.playerName + "'s " + user.name + " vaulted away.";
                     return;
                 }
             }
         }
     }
     usageDescription = name + " failed as no enemies \nwere in range.";
 }
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     foreach (Effect debuff in user.activeEffects)
     {
         if (!debuff.AllowedDiceAbilities()[1])
         {
             usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
             return;
         }
     }
     if (target.isAlive)
     {
         float damageDealt = user.strength * damage;
         usageDescription  = target.DamageDice(damageDealt);
         usageDescription += ".";
     }
     else
     {
         usageDescription = "Target is already dead.";
     }
 }
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     remainingDuration = Math.Max(0, remainingDuration - 1);
     if (remainingDuration > 0 && target.isAlive)
     {
         float damageDealt = user.strength * damage;
         usageDescription = target.DamageDice(damageDealt);
         if (target.isAlive)
         {
             usageDescription += " and is still " + Constant.e_poisonPastName + ".";
         }
     }
     if (remainingDuration == 0 && target.isAlive)
     {
         usageDescription += " and is no longer " + Constant.e_poisonPastName + ".";
     }
     if (!target.isAlive)
     {
         usageDescription += ".";
     }
 }
Beispiel #6
0
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     foreach (Effect debuff in user.activeEffects)
     {
         if (!debuff.AllowedDiceAbilities()[2])
         {
             usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
             return;
         }
     }
     if (target.isAlive)
     {
         Vector2        moveToLoc      = Vector2.Zero;
         List <Vector2> locsNearTarget = new List <Vector2>();
         for (int i = -1; i <= 1; i++)
         {
             for (int j = -1; j <= 1; j++)
             {
                 if (!(i == 0 && j == 0))
                 {
                     locsNearTarget.Add(new Vector2(target.BoardLocX + i, target.BoardLocY + j));
                 }
             }
         }
         float minDist = BattleBoard.GetRealDistanceBetweenTileLocations(new Vector2(0, 0), new Vector2(BattleBoard.board.GetLength(0), BattleBoard.board.GetLength(1)));
         for (int i = 0; i < locsNearTarget.Count; i++)
         {
             if (BattleBoard.GetRealDistanceBetweenTileLocations(user.BoardLocation, locsNearTarget[i]) < minDist)
             {
                 minDist   = BattleBoard.GetRealDistanceBetweenTileLocations(user.BoardLocation, locsNearTarget[i]);
                 moveToLoc = locsNearTarget[i];
             }
         }
         locsNearTarget.Remove(moveToLoc);
         while (user.BoardLocation != moveToLoc && !user.Move(moveToLoc))
         {
             if (locsNearTarget.Count != 0)
             {
                 minDist = BattleBoard.board.Length;
                 for (int i = 0; i < locsNearTarget.Count; i++)
                 {
                     if (BattleBoard.GetRealDistanceBetweenTileLocations(user.BoardLocation, locsNearTarget[i]) < minDist)
                     {
                         minDist   = BattleBoard.GetRealDistanceBetweenTileLocations(user.BoardLocation, locsNearTarget[i]);
                         moveToLoc = locsNearTarget[i];
                     }
                 }
                 locsNearTarget.Remove(moveToLoc);
             }
             else
             {
                 usageDescription = Constant.a_chargeTargetSurrounded;
                 return;
             }
         }
         float damageDealt = user.strength * damage;
         usageDescription  = user.ownedByPlayer.playerName + "'s " + user.name + " charged and\n";
         usageDescription += target.DamageDice(damageDealt);
         usageDescription += ".";
     }
     else
     {
         usageDescription = "Target is already dead.";
     }
 }