fixed bug regarding attack damage value switch
This commit is contained in:
parent
cf1f88f43a
commit
eb773a6806
@ -50,7 +50,7 @@ public class KnightOnHorse : Ally
|
|||||||
_detectionScript = _detection.GetComponent<Detection>();
|
_detectionScript = _detection.GetComponent<Detection>();
|
||||||
|
|
||||||
// keep originals to go back to them eventually
|
// keep originals to go back to them eventually
|
||||||
_originalAttackDamage = _chargeAttackDamage;
|
_originalAttackDamage = AttackDamage;
|
||||||
_originalPos = transform.position;
|
_originalPos = transform.position;
|
||||||
|
|
||||||
// makes sure the entity charges on creation
|
// makes sure the entity charges on creation
|
||||||
@ -59,6 +59,7 @@ public class KnightOnHorse : Ally
|
|||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
|
Debug.Log(AttackDamage);
|
||||||
// fade if charge done
|
// fade if charge done
|
||||||
if (_isFading)
|
if (_isFading)
|
||||||
{
|
{
|
||||||
@ -69,6 +70,8 @@ public class KnightOnHorse : Ally
|
|||||||
// check if charge is ready
|
// check if charge is ready
|
||||||
if (_timeSinceLastCharge > _chargeCooldown && !_isCharging)
|
if (_timeSinceLastCharge > _chargeCooldown && !_isCharging)
|
||||||
{
|
{
|
||||||
|
AttackDamage = _chargeAttackDamage;
|
||||||
|
|
||||||
SweepAttack();
|
SweepAttack();
|
||||||
|
|
||||||
_isCharging = true;
|
_isCharging = true;
|
||||||
@ -105,6 +108,9 @@ public class KnightOnHorse : Ally
|
|||||||
Enemy = null;
|
Enemy = null;
|
||||||
_chargeDetection.SetActive(false);
|
_chargeDetection.SetActive(false);
|
||||||
|
|
||||||
|
// attack damage
|
||||||
|
AttackDamage = _originalAttackDamage;
|
||||||
|
|
||||||
// start fading
|
// start fading
|
||||||
_isFading = true;
|
_isFading = true;
|
||||||
}
|
}
|
||||||
@ -133,7 +139,6 @@ public class KnightOnHorse : Ally
|
|||||||
//Attack Cooldown
|
//Attack Cooldown
|
||||||
if (AttackSpeedWait > AttackInterval)
|
if (AttackSpeedWait > AttackInterval)
|
||||||
{
|
{
|
||||||
AttackDamage = _originalAttackDamage;
|
|
||||||
Animation.PlayAttackAnim();
|
Animation.PlayAttackAnim();
|
||||||
|
|
||||||
AttackSpeedWait = 0f;
|
AttackSpeedWait = 0f;
|
||||||
@ -144,8 +149,6 @@ public class KnightOnHorse : Ally
|
|||||||
|
|
||||||
private void AttackEnemyRiding()
|
private void AttackEnemyRiding()
|
||||||
{
|
{
|
||||||
AttackDamage = _chargeAttackDamage;
|
|
||||||
|
|
||||||
// call root attack cause no specific animation
|
// call root attack cause no specific animation
|
||||||
_rootScript.Attack();
|
_rootScript.Attack();
|
||||||
_opponentsHit.Add(Enemy);
|
_opponentsHit.Add(Enemy);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user