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--; }
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); }
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); }