Don't screen shake when throwing minion
This commit is contained in:
parent
f4ee5d0de1
commit
8e0d1874dc
@ -78,12 +78,12 @@ public class AIEntity : Entity {
|
|||||||
return enemies.HasFlag(other.entityType) && other.IsAlive();
|
return enemies.HasFlag(other.entityType) && other.IsAlive();
|
||||||
}
|
}
|
||||||
|
|
||||||
override public bool TakeDamage(float amount, Entity other, bool sound=true) {
|
override public bool TakeDamage(float amount, Entity other, bool sound = true, bool intentional = false) {
|
||||||
//TODO Should we warn if target is null here?
|
//TODO Should we warn if target is null here?
|
||||||
if (target != null && target.GetComponent<VampireEntity>() is { })
|
if (target != null && target.GetComponent<VampireEntity>() is { })
|
||||||
target = other.transform;
|
target = other.transform;
|
||||||
|
|
||||||
return base.TakeDamage(amount, other, sound);
|
return base.TakeDamage(amount, other, sound, intentional);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Flip
|
#region Flip
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public class Entity : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Apply damage to the entity, returns true if it is still alive
|
//Apply damage to the entity, returns true if it is still alive
|
||||||
public virtual bool TakeDamage(float amount, Entity other, bool sound = true) {
|
public virtual bool TakeDamage(float amount, Entity other, bool sound = true, bool intentional = false) {
|
||||||
Health -= amount;
|
Health -= amount;
|
||||||
healthBar.SetHealthFraction(Health / initialHealth);
|
healthBar.SetHealthFraction(Health / initialHealth);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ public class MinionThrower : MonoBehaviour {
|
|||||||
if (minionHealthCost >= vampireEntity.Health) {
|
if (minionHealthCost >= vampireEntity.Health) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vampireEntity.TakeDamage(minionHealthCost, vampireEntity);
|
vampireEntity.TakeDamage(minionHealthCost, vampireEntity, intentional: true);
|
||||||
|
|
||||||
|
|
||||||
currentCooldownTimer = playerStats.currentInitialCooldown;
|
currentCooldownTimer = playerStats.currentInitialCooldown;
|
||||||
|
|||||||
@ -196,7 +196,7 @@ public class PlayerMovement : MonoBehaviour {
|
|||||||
// playerMovement.animator.SetBool("Jumping", true);
|
// playerMovement.animator.SetBool("Jumping", true);
|
||||||
playerMovement.animator.Play("Player_Jump");
|
playerMovement.animator.Play("Player_Jump");
|
||||||
playerMovement.soundManager.PlaySound(playerMovement.jumpSource, playerMovement.jumpSounds, randomPitch: true, createTempSourceIfBusy: true);
|
playerMovement.soundManager.PlaySound(playerMovement.jumpSource, playerMovement.jumpSounds, randomPitch: true, createTempSourceIfBusy: true);
|
||||||
playerMovement.screenShaker.Shake();
|
playerMovement.screenShaker.Shake(rumbleLowFreq:0f, rumbleHighFreq:0f);
|
||||||
}
|
}
|
||||||
public override void LeaveState() {
|
public override void LeaveState() {
|
||||||
// playerMovement.animator.SetBool("Jumping", false);
|
// playerMovement.animator.SetBool("Jumping", false);
|
||||||
|
|||||||
@ -30,12 +30,12 @@ public class VampireEntity : Entity {
|
|||||||
TakeDamage(playerStats.bloodLossRate * Time.deltaTime, this, sound: false);
|
TakeDamage(playerStats.bloodLossRate * Time.deltaTime, this, sound: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TakeDamage(float amount, Entity other, bool sound = true) {
|
public override bool TakeDamage(float amount, Entity other, bool sound = true, bool intentional = false) {
|
||||||
if (sound) {
|
if (sound && !intentional) {
|
||||||
screenShaker.Shake();
|
screenShaker.Shake();
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.TakeDamage(amount, other, sound);
|
return base.TakeDamage(amount, other, sound, intentional);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsInSafeZone() => playerMovement.IsInSafeZone;
|
public bool IsInSafeZone() => playerMovement.IsInSafeZone;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user