Beispiel #1
0
    public override bool Execute()
    {
        if (!CheckTarget() || !CheckCost(actionCost))
        {
            return(false);
        }

        Pawn tPawn = target.GetComponent <Pawn>();

        if (owner.weapon.range == 1)
        {
            AttackCommand.Attack(owner, target);
        }

        LinkPositions pushDirection;

        pushDirection = owner.currentNode.GetRelativePositionInLinks(tPawn.currentNode);
        for (int i = 0; i < distance; i++)
        {
            NodeBehaviour tmpNode = tPawn.currentNode.GetLinkInDirection(pushDirection);
            if (!tmpNode.isOccupied)
            {
                tPawn.GetComponent <GridNavMeshWrapper>().currentNode = tmpNode;
            }
        }
        return(true);
    }
Beispiel #2
0
    public override bool Execute()
    {
        if (!CheckTarget() || !CheckCost(actionCost))
        {
            return(false);
        }

        Pawn tPawn = target.GetComponent <Pawn> ();

        tPawn.EffectList.Add(Factory.GetEffect(Effects.FinishingAttackTemporary, tPawn));

        AttackCommand.Attack(owner, target);

        Debug.Log(owner + " Executes " + name);

        return(true);
    }
Beispiel #3
0
    public override bool Execute()
    {
        if (!CheckTarget() || !CheckCost(actionCost))
        {
            return(false);
        }

        Pawn tPawn = target.GetComponent <Pawn> ();

        for (int c = 0; c < 3; c++)
        {
            owner.EffectList.Add(new HalfAccuracyTemporaryEffect(owner));
            AttackCommand.Attack(owner, target);
        }

        Debug.Log(owner + " Executes " + name);

        return(true);
    }
Beispiel #4
0
    public override bool Execute()
    {
        if (validTargets.Count == 0)
        {
            Debug.Log("There are no valid targets");
            return(false);
        }

        if (!CheckCost(actionCost))
        {
            return(false);
        }

        if (weapon.range == 1)
        {
            foreach (Targetable t in validTargets)
            {
                AttackCommand.Attack(owner, t);
            }
        }
        else
        {
            Debug.Log("Melee Weapon Not Equiped");
            foreach (Targetable t in validTargets)
            {
                LinkPositions pushDirection;
                pushDirection = owner.currentNode.GetRelativePositionInLinks(t.GetComponent <Pawn>().currentNode);
                NodeBehaviour tmpNode = t.GetComponent <Pawn>().currentNode.GetLinkInDirection(pushDirection);
                if (!tmpNode.isOccupied)
                {
                    t.GetComponent <GridNavMeshWrapper>().SetPath(Pathfinder.GetPath(t.GetComponent <GridNavMeshWrapper>().currentNode, tmpNode));
                }
            }
        }

        Debug.Log(owner + " Executes " + name);

        return(true);
    }