Example #1
0
    /// <summary>
    /// Applies a status effect to the entity on the specified tile.
    /// </summary>
    /// <param name="target">A Vector2Int specifying which tile to target</param>
    /// <param name="status">Enum located in BattleManager that corresponds to which status effect you want to apply</param>
    /// <param name="power">How much status to apply</param>
    /// <returns>True if there was something on this tile.</returns>
    public bool ApplyStatusEffectOnTile(Vector2Int target, BattleManager.StatusEffectEnum status, int power)
    {
        Debug.Log("Applying status effect " + status.ToString() + " on tile " + target + ", with power " + power);
        Roguelike.Tile targetTile  = map[target.x, target.y];
        TileCreature   tarCreature = targetTile.GetEntityOnTile() as TileCreature;

        if (tarCreature != null)
        {
            tarCreature.ApplyStatusEffect(status, power);
            return(true);
        }
        return(false);
    }
Example #2
0
 public int Activate(Vector2Int player, Vector2Int target)
 {
     if (SelfTar)
     {
         return(BattleManager.player.GetStatusEffectValue(StatusEffect));
     }
     else
     {
         TileCreature tc = BattleManager.instance.map.map[target.x, target.y].GetEntityOnTile() as TileCreature;
         if (tc != null)
         {
             return(tc.GetStatusEffectValue(StatusEffect));
         }
         else
         {
             return(0);
         }
     }
 }