Stun, slow 방식 수정, 코뿔소 SkyFallSmash 스킬 버그 수정

This commit is contained in:
Nam Tae Gun 2024-06-24 22:14:14 +09:00
parent 467935b95d
commit 042c015bd1
12 changed files with 37 additions and 16 deletions

View File

@ -42,8 +42,6 @@ namespace BlueWater.Enemies.Bosses.SandMole
public void Stun(float duration) public void Stun(float duration)
{ {
if (!CanStun()) return;
_spineController.SetSkin(SandMoleSkin.Normal.ToString()); _spineController.SetSkin(SandMoleSkin.Normal.ToString());
_spineController.PlayAnimation(SandMoleAnimation.Stun.ToString(), false); _spineController.PlayAnimation(SandMoleAnimation.Stun.ToString(), false);
IsStunned = true; IsStunned = true;
@ -54,6 +52,13 @@ namespace BlueWater.Enemies.Bosses.SandMole
Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun)); Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun));
} }
public void TryStun(float duration)
{
if (!CanStun()) return;
Stun(duration);
}
public void EndStun() public void EndStun()
{ {

View File

@ -164,6 +164,10 @@ namespace BlueWater.Players.Combat
var isActivatingSkill = _skillHandler?.IsActivatingSkill ?? false; var isActivatingSkill = _skillHandler?.IsActivatingSkill ?? false;
var isStunned = _stunnable?.IsStunned ?? false; var isStunned = _stunnable?.IsStunned ?? false;
if (isStunned)
{
IsMoving = false;
}
var isAttacking = _comboAttackable?.CurrentComboAttackCount > 0; var isAttacking = _comboAttackable?.CurrentComboAttackCount > 0;
return !isActivatingSkill && !isStunned && !isAttacking; return !isActivatingSkill && !isStunned && !isAttacking;

View File

@ -87,13 +87,18 @@ namespace BlueWater.Players.Combat
public void Stun(float duration) public void Stun(float duration)
{ {
if (!IsStunEnabled) return;
_stunParticle.Play(); _stunParticle.Play();
IsStunned = true; IsStunned = true;
Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun)); Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun));
} }
public void TryStun(float duration)
{
if (!CanStun()) return;
Stun(duration);
}
public void EndStun() public void EndStun()
{ {
@ -117,8 +122,6 @@ namespace BlueWater.Players.Combat
public void SlowMoveSpeed(float duration, float moveSpeedCoefficient) public void SlowMoveSpeed(float duration, float moveSpeedCoefficient)
{ {
if (!IsSlowMoveEnabled) return;
_spriteRenderer.material.SetColor(_colorHash, _slowEffectColor); _spriteRenderer.material.SetColor(_colorHash, _slowEffectColor);
_physicMovable?.SetMoveSpeedCoefficient(moveSpeedCoefficient); _physicMovable?.SetMoveSpeedCoefficient(moveSpeedCoefficient);
@ -126,6 +129,13 @@ namespace BlueWater.Players.Combat
Utils.StartUniqueCoroutine(this, ref _slowMoveSpeedCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndSlowMoveSpeed)); Utils.StartUniqueCoroutine(this, ref _slowMoveSpeedCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndSlowMoveSpeed));
} }
public void TrySlowMoveSpeed(float duration, float moveSpeedCoefficient)
{
if (!CanSlowMove()) return;
SlowMoveSpeed(duration, moveSpeedCoefficient);
}
public void EndSlowMoveSpeed() public void EndSlowMoveSpeed()
{ {
IsSlowedMoveSpeed = false; IsSlowedMoveSpeed = false;

View File

@ -7,6 +7,7 @@
bool CanSlowMove(); bool CanSlowMove();
void SlowMoveSpeed(float duration, float moveSpeedCoefficient); void SlowMoveSpeed(float duration, float moveSpeedCoefficient);
void TrySlowMoveSpeed(float duration, float moveSpeedCoefficient);
void EndSlowMoveSpeed(); void EndSlowMoveSpeed();
} }
} }

View File

@ -7,6 +7,7 @@
bool CanStun(); bool CanStun();
void Stun(float duration); void Stun(float duration);
void TryStun(float duration);
void EndStun(); void EndStun();
} }
} }

View File

@ -24,7 +24,7 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
m_Bits: 2048 m_Bits: 2048
<JumpTime>k__BackingField: 0.1 <JumpTime>k__BackingField: 0.1
<JumpHeight>k__BackingField: 15 <JumpHeight>k__BackingField: 30
<WaitTime>k__BackingField: 2 <WaitTime>k__BackingField: 2
<FallTime>k__BackingField: 0.1 <FallTime>k__BackingField: 0.1
<StunRadiusCoefficient>k__BackingField: 2 <StunRadiusCoefficient>k__BackingField: 2

View File

@ -125,7 +125,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
isAttacked = true; isAttacked = true;
var iStunnable = raycastHit.transform.GetComponentInParent<IStunnable>(); var iStunnable = raycastHit.transform.GetComponentInParent<IStunnable>();
iStunnable?.Stun(_bullChargeData.StunDuration); iStunnable?.TryStun(_bullChargeData.StunDuration);
var iPhysicMovable = raycastHit.transform.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = raycastHit.transform.GetComponentInParent<IPhysicMovable>();
if (iPhysicMovable == null) continue; if (iPhysicMovable == null) continue;

View File

@ -112,7 +112,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
iDamageable.TakeDamage(SkillData.Damage); iDamageable.TakeDamage(SkillData.Damage);
var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>(); var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>();
iStunnable?.Stun(_hammerSlamData.StunDuration); iStunnable?.TryStun(_hammerSlamData.StunDuration);
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
if (iPhysicMovable == null) continue; if (iPhysicMovable == null) continue;

View File

@ -127,7 +127,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
iDamageable.TakeDamage(SkillData.Damage); iDamageable.TakeDamage(SkillData.Damage);
var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>(); var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>();
iStunnable?.Stun(_meteorSwingData.StunDuration); iStunnable?.TryStun(_meteorSwingData.StunDuration);
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
iPhysicMovable?.AddForce(attackDirection * _meteorSwingData.PushPower, ForceMode.Impulse); iPhysicMovable?.AddForce(attackDirection * _meteorSwingData.PushPower, ForceMode.Impulse);

View File

@ -109,10 +109,10 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
iDamageable.TakeDamage(SkillData.Damage); iDamageable.TakeDamage(SkillData.Damage);
var iStunnable = raycastHit.transform.GetComponentInParent<IStunnable>(); var iStunnable = raycastHit.transform.GetComponentInParent<IStunnable>();
iStunnable?.Stun(_seismicThrustData.StunDuration); iStunnable?.TryStun(_seismicThrustData.StunDuration);
var iSlowable = raycastHit.transform.GetComponentInParent<ISlowable>(); var iSlowable = raycastHit.transform.GetComponentInParent<ISlowable>();
iSlowable?.SlowMoveSpeed(_seismicThrustData.SlowDuration, _seismicThrustData.SlowCoefficient); iSlowable?.TrySlowMoveSpeed(_seismicThrustData.SlowDuration, _seismicThrustData.SlowCoefficient);
var iPhysicMovable = raycastHit.transform.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = raycastHit.transform.GetComponentInParent<IPhysicMovable>();
iPhysicMovable?.AddForce(transform.forward * _seismicThrustData.PushPower, ForceMode.Impulse); iPhysicMovable?.AddForce(transform.forward * _seismicThrustData.PushPower, ForceMode.Impulse);

View File

@ -109,7 +109,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
yield break; yield break;
} }
_rhinoceros.Rigidbody.useGravity = false; _rhinoceros.Rigidbody.isKinematic = true;
while (_animationController.IsComparingCurrentAnimation("SkyFallJump") while (_animationController.IsComparingCurrentAnimation("SkyFallJump")
&& _animationController.GetCurrentAnimationNormalizedTime() <= 1f) && _animationController.GetCurrentAnimationNormalizedTime() <= 1f)
@ -178,7 +178,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
HideIndicator(); HideIndicator();
SkillUser.transform.position = endPosition; SkillUser.transform.position = endPosition;
_rhinoceros.Rigidbody.useGravity = true; _rhinoceros.Rigidbody.isKinematic = false;
AudioManager.Instance.PlaySfx("SkyFallSmash"); AudioManager.Instance.PlaySfx("SkyFallSmash");
VisualFeedbackManager.Instance.CameraShake(CombatCameraManager.Instance.BaseCombatCamera, VisualFeedbackManager.Instance.CameraShake(CombatCameraManager.Instance.BaseCombatCamera,
_skyFallSmashData.CameraShakingPower, _skyFallSmashData.CameraShakingDuration); _skyFallSmashData.CameraShakingPower, _skyFallSmashData.CameraShakingDuration);
@ -200,7 +200,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>(); var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>();
if (iStunnable != null) if (iStunnable != null)
{ {
iStunnable.Stun(_skyFallSmashData.StunDuration); iStunnable.TryStun(_skyFallSmashData.StunDuration);
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
var hitVector = hitCollider.transform.position - transform.position; var hitVector = hitCollider.transform.position - transform.position;

View File

@ -259,7 +259,7 @@ namespace BlueWater.Enemies.Bosses.TitanSlime.Skills
iDamageable.TakeDamage(_jumpSlamData.Damage); iDamageable.TakeDamage(_jumpSlamData.Damage);
var iSlowable = hitCollider.transform.GetComponentInParent<ISlowable>(); var iSlowable = hitCollider.transform.GetComponentInParent<ISlowable>();
iSlowable?.SlowMoveSpeed(_jumpSlamData.SlowDuration, _jumpSlamData.SlowCoefficient); iSlowable?.TrySlowMoveSpeed(_jumpSlamData.SlowDuration, _jumpSlamData.SlowCoefficient);
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>(); var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
iPhysicMovable?.AddForce(targetDirection * _jumpSlamData.PushPower, ForceMode.Impulse); iPhysicMovable?.AddForce(targetDirection * _jumpSlamData.PushPower, ForceMode.Impulse);