コード例 #1
0
    public bool Applies(Unit target, Tile source, Tile targetLocation)
    {
        distance         = TileGrid.GetDelta(startPosition, target);
        _stats.critBonus = (float)distance / 20f;

        return(true);
    }
コード例 #2
0
 public void NotifyHealth(Unit unit, int change)
 {
     if (change < 0)
     {
         if (!UnitManager.Instance.IsItMyTurn(user) && TileGrid.GetDelta(unit, user) <= Distance)
         {
             Particle.ExlamationPoint(new Vector3(transform.position.x, transform.position.y + 0.3f));
             stacks++;
         }
     }
 }
コード例 #3
0
 public void Animate(Unit source, Tile target, Action <Tile> tile, bool hit = true)
 {
     if (TileGrid.GetDelta(source, target) == 2)
     {
         arrow.Animate(source, target, tile, hit);
     }
     else
     {
         tackle.Animate(source, target, tile, hit);
     }
 }
コード例 #4
0
ファイル: Thrown.cs プロジェクト: McPalm/FEPonies
 void FinishedAttackSequence(Unit u)
 {
     if (active && UnitManager.Instance.IsItMyTurn(owner) & !threw)
     {
         if (TileGrid.GetDelta(this, u) == 2)
         {
             storedRetaliations = owner.Retaliations;
             owner.Retaliations = 0;
             threw = true;
         }
     }
 }
コード例 #5
0
    public bool Includes(Unit u, Tile t)
    {
        if (!Active)
        {
            return(false);
        }
        if (_user != null && !_affectsEnemies && _user.isHostile(u))
        {
            return(false);
        }

        return(TileGrid.GetDelta(t, this) <= radius);
    }
コード例 #6
0
ファイル: Wormhole.cs プロジェクト: McPalm/FEPonies
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> ret = new HashSet <Tile>();

        foreach (Unit u in UnitManager.Instance.GetUnits())
        {
            int d = TileGrid.GetDelta(this, u);
            if (d > 0 && d <= range)
            {
                ret.Add(u.Tile);
            }
        }
        return(ret);
    }
コード例 #7
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        Unit           u     = GetComponent <Unit>();
        HashSet <Unit> units = UnitManager.Instance.GetUnitsByHostility(u);
        HashSet <Tile> ret   = new HashSet <Tile>();

        foreach (Unit e in units)
        {
            if (TileGrid.GetDelta(u, e) < 5)
            {
                ret.Add(e.Tile);
            }
        }

        return(ret);
    }
コード例 #8
0
ファイル: Backflip.cs プロジェクト: McPalm/FEPonies
    void OnDodgeAttack(Unit attacker)
    {
//		Debug.Log("I dodged!");

        if (TileGrid.GetDelta(this, attacker) == 1)
        {
//			Debug.Log("And were in melee!");
            Unit user   = GetComponent <Unit>();
            Tile moveTo = null;
            if (user.Tile.North && user.Tile.North.Unit == attacker)
            {
                moveTo = user.Tile.South;
            }
            else if (user.Tile.South && user.Tile.South.Unit == attacker)
            {
                moveTo = user.Tile.North;
            }
            else if (user.Tile.West && user.Tile.West.Unit == attacker)
            {
                moveTo = user.Tile.East;
            }
            else if (user.Tile.East && user.Tile.East.Unit == attacker)
            {
                moveTo = user.Tile.West;
            }
            Vector3 pos = transform.position;
            if (moveTo && moveTo.Type != TileType.wall && user.MoveTo(moveTo))
            {
//				Debug.Log("We has dodged!");
                tweento            = transform.position;
                transform.position = pos;
                tweenfrom          = pos;
                tween         = true;
                tweenduration = 0f;
                //StateManager.Instance.DebugPush(GameState.unitAttack);
            }
        }
    }
コード例 #9
0
ファイル: SingBuff.cs プロジェクト: McPalm/FEPonies
 bool WithinRange(Component location)
 {
     return(TileGrid.GetDelta(location, artist) < 4);
 }