Exemple #1
0
    public override void AttackEvent()
    {
        int bonuses = 0;

        if (NextToEnemy)
        {
            bonuses = -1;
        }
        Result     hit     = AttackManager.AttackRoll(owner, currentTarget.unitTargeted.GetComponent <Unit>(), bonuses);
        GameObject missile = Instantiate(GameAssets.i.ArrowModel, owner.offHandSlot.position, owner.transform.rotation) as GameObject;

        missile.GetComponent <Missile>().target = currentTarget.unitTargeted.transform.position + new Vector3(0, currentTarget.unitTargeted.GetComponent <TacticsMovement>().halfHeight);

        //Debug.
        //GameObject marker = Instantiate(GameAssets.i.TargetMarker, currentTarget.unitTargeted.transform.position + new Vector3(0, currentTarget.unitTargeted.GetComponent<TacticsMovement>().halfHeight), Quaternion.identity);

        missile.GetComponent <Missile>().Launch(hit);
        missile.GetComponent <Missile>().targetUnit   = currentTarget.unitTargeted;
        missile.GetComponent <Missile>().firingWeapon = this;

        if (hit == Result.FAIL)
        {
            gameObject.GetComponent <UnitPopUpManager>().AddPopUpInfo("miss");
        }

        owner.aimingBow = false;
        NextToEnemy     = false;
        owner.FaceDirection(currentTarget.unitTargeted.gameObject.transform.position);
        rangedWeaponData.currentAmmo--;
    }
Exemple #2
0
    public override void AttackEvent()
    {
        int bonuses = 0;

        if (flanking)
        {
            bonuses += 1;
        }
        flanking = false;
        Result hit = AttackManager.AttackRoll(owner, currentTarget.unitTargeted.GetComponent <Unit>(), bonuses);

        MeleeAttackOutcome(hit);
    }
Exemple #3
0
    public override void AttackEvent()
    {
        int bonuses = 0;

        //This next bit is greatweapon specific for when they attack next to obstacles.
        owner.GetComponent <TacticsMovement>().GetCurrentTile();
        if (owner.currentTile.barrierCount > 0)
        {
            bonuses--;
            gameObject.GetComponent <UnitPopUpManager>().AddPopUpInfo("hindered");
            if (owner.currentTile.barrierCount > 5)
            {
                bonuses--;
            }
        }

        Result hit = AttackManager.AttackRoll(owner, currentTarget.unitTargeted.GetComponent <Unit>(), bonuses);

        MeleeAttackOutcome(hit);
    }