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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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