푸쉬 로직 수정에 맞게 보스 스킬 데이터 수정
This commit is contained in:
parent
54582acbf4
commit
d878985662
@ -82,9 +82,15 @@ namespace BlueWater.Players.Combat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[field: SerializeField, DisableIf("@true")]
|
||||||
public Vector3 PushDirection { get; private set; }
|
public Vector3 PushDirection { get; private set; }
|
||||||
|
|
||||||
|
[field: SerializeField, DisableIf("@true")]
|
||||||
public float PushPower { get; private set; }
|
public float PushPower { get; private set; }
|
||||||
public float PushReductionCoefficient { get; private set; }
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float PushPowerReduction { get; private set; } = 20f;
|
||||||
|
|
||||||
private Vector3 _finalVelocity;
|
private Vector3 _finalVelocity;
|
||||||
|
|
||||||
// Dash
|
// Dash
|
||||||
@ -139,28 +145,9 @@ namespace BlueWater.Players.Combat
|
|||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
if (!IsMoveEnabled) return;
|
if (!CanMove()) return;
|
||||||
|
|
||||||
if (!_isDashing && _comboAttackable?.CurrentComboAttackCount <= 0 && _skillHandler?.IsActivatingSkill == false)
|
Move();
|
||||||
{
|
|
||||||
var velocityDirection = _inputDirection;
|
|
||||||
if (_stunnable?.IsStunned == true)
|
|
||||||
{
|
|
||||||
velocityDirection = Vector3.zero;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CurrentDirection = velocityDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
IsMoving = velocityDirection != Vector3.zero;
|
|
||||||
_finalVelocity = velocityDirection * (MoveSpeed * MoveSpeedCoefficient);
|
|
||||||
var pushVelocity = PushDirection * PushPower;
|
|
||||||
_finalVelocity += pushVelocity;
|
|
||||||
Rigidbody.linearVelocity = _finalVelocity;
|
|
||||||
}
|
|
||||||
|
|
||||||
PushPower = Mathf.Max(0, PushPower - PushReductionCoefficient * Time.deltaTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnApplicationQuit()
|
private void OnApplicationQuit()
|
||||||
@ -224,29 +211,63 @@ namespace BlueWater.Players.Combat
|
|||||||
// Move
|
// Move
|
||||||
public bool CanMove()
|
public bool CanMove()
|
||||||
{
|
{
|
||||||
if (!IsMoveEnabled || IsDashing) return false;
|
return IsMoveEnabled;
|
||||||
|
|
||||||
var isActivatingSkill = _skillHandler?.IsActivatingSkill ?? false;
|
// if (!IsMoveEnabled || IsDashing) return false;
|
||||||
var isStunned = _stunnable?.IsStunned ?? false;
|
//
|
||||||
// if (isStunned)
|
// var isActivatingSkill = _skillHandler?.IsActivatingSkill ?? false;
|
||||||
|
// var isStunned = _stunnable?.IsStunned ?? false;
|
||||||
|
// // if (isStunned)
|
||||||
|
// // {
|
||||||
|
// // IsMoving = false;
|
||||||
|
// // }
|
||||||
|
// var isAttacking = _comboAttackable?.CurrentComboAttackCount > 0;
|
||||||
|
//
|
||||||
|
// var canMove = !isActivatingSkill && !isStunned && !isAttacking;
|
||||||
|
// if (!canMove)
|
||||||
// {
|
// {
|
||||||
|
// if (!Rigidbody.isKinematic)
|
||||||
|
// {
|
||||||
|
// Rigidbody.linearVelocity = Vector3.zero;
|
||||||
|
// }
|
||||||
// IsMoving = false;
|
// IsMoving = false;
|
||||||
// }
|
// }
|
||||||
var isAttacking = _comboAttackable?.CurrentComboAttackCount > 0;
|
//
|
||||||
|
// return canMove;
|
||||||
var canMove = !isActivatingSkill && !isStunned && !isAttacking;
|
|
||||||
if (!canMove)
|
|
||||||
{
|
|
||||||
if (!Rigidbody.isKinematic)
|
|
||||||
{
|
|
||||||
Rigidbody.linearVelocity = Vector3.zero;
|
|
||||||
}
|
|
||||||
IsMoving = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return canMove;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Move()
|
||||||
|
{
|
||||||
|
if (!_isDashing && _comboAttackable?.CurrentComboAttackCount <= 0 && _skillHandler?.IsActivatingSkill == false)
|
||||||
|
{
|
||||||
|
var velocityDirection = _inputDirection;
|
||||||
|
if (_stunnable?.IsStunned == true)
|
||||||
|
{
|
||||||
|
velocityDirection = Vector3.zero;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurrentDirection = velocityDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsMoving = velocityDirection != Vector3.zero;
|
||||||
|
_finalVelocity = velocityDirection * (MoveSpeed * MoveSpeedCoefficient);
|
||||||
|
var pushVelocity = PushDirection * PushPower;
|
||||||
|
_finalVelocity += pushVelocity;
|
||||||
|
if (!Rigidbody.isKinematic)
|
||||||
|
{
|
||||||
|
Rigidbody.linearVelocity = _finalVelocity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PushPower = Mathf.Max(0, PushPower - PushPowerReduction * Time.deltaTime);
|
||||||
|
|
||||||
|
// CurrentDirection = _inputDirection;
|
||||||
|
// IsMoving = _inputDirection != Vector3.zero;
|
||||||
|
// var finalVelocity = _inputDirection * (MoveSpeed * MoveSpeedCoefficient);
|
||||||
|
// Rigidbody.linearVelocity = finalVelocity;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddForce(Vector3 force, ForceMode forceMode)
|
public void AddForce(Vector3 force, ForceMode forceMode)
|
||||||
{
|
{
|
||||||
if (IsDashing) return;
|
if (IsDashing) return;
|
||||||
@ -254,12 +275,10 @@ namespace BlueWater.Players.Combat
|
|||||||
Rigidbody.AddForce(force, forceMode);
|
Rigidbody.AddForce(force, forceMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Move()
|
public void SetPush(Vector3 pushDirection, float pushPower)
|
||||||
{
|
{
|
||||||
CurrentDirection = _inputDirection;
|
PushDirection = pushDirection;
|
||||||
IsMoving = _inputDirection != Vector3.zero;
|
PushPower = pushPower;
|
||||||
var finalVelocity = _inputDirection * (MoveSpeed * MoveSpeedCoefficient);
|
|
||||||
Rigidbody.linearVelocity = finalVelocity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dash
|
// Dash
|
||||||
|
@ -49,7 +49,11 @@ namespace BlueWater.Players.Tycoons
|
|||||||
_currentDirection = value;
|
_currentDirection = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector3 PushDirection { get; private set; }
|
||||||
|
public float PushPower { get; private set; }
|
||||||
|
public float PushPowerReduction { get; private set; }
|
||||||
|
|
||||||
private float _finalSpeed;
|
private float _finalSpeed;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -126,6 +130,11 @@ namespace BlueWater.Players.Tycoons
|
|||||||
Rigidbody.AddForce(force, forceMode);
|
Rigidbody.AddForce(force, forceMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPush(Vector3 pushDirection, float pushPower)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
public void Move()
|
public void Move()
|
||||||
{
|
{
|
||||||
CurrentDirection = _inputDirection;
|
CurrentDirection = _inputDirection;
|
||||||
|
@ -10,12 +10,16 @@ namespace BlueWater.Interfaces
|
|||||||
bool IsMoveEnabled { get; }
|
bool IsMoveEnabled { get; }
|
||||||
bool IsMoving { get; }
|
bool IsMoving { get; }
|
||||||
Vector3 CurrentDirection { get; }
|
Vector3 CurrentDirection { get; }
|
||||||
|
Vector3 PushDirection { get; }
|
||||||
|
float PushPower { get; }
|
||||||
|
float PushPowerReduction { get; }
|
||||||
|
|
||||||
void SetMoveSpeedCoefficient(float value);
|
void SetMoveSpeedCoefficient(float value);
|
||||||
void ResetMoveSpeedCoefficient();
|
void ResetMoveSpeedCoefficient();
|
||||||
void SetCurrentDirection(Vector3 normalDirection);
|
void SetCurrentDirection(Vector3 normalDirection);
|
||||||
bool CanMove();
|
bool CanMove();
|
||||||
void Move();
|
void Move();
|
||||||
void AddForce(Vector3 force, ForceMode forceMode);
|
void AddForce(Vector3 force, ForceMode forceMode);
|
||||||
|
void SetPush(Vector3 pushDirection, float pushPower);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -38,15 +38,37 @@ namespace BlueWater
|
|||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private LayerMask _targetLayer;
|
private LayerMask _targetLayer;
|
||||||
|
|
||||||
|
[Title("슬로우 설정")]
|
||||||
|
[SerializeField]
|
||||||
|
private bool _isSlowedMoveSpeed;
|
||||||
|
|
||||||
|
[SerializeField, ShowIf("@_isSlowedMoveSpeed")]
|
||||||
|
private float _slowDuration;
|
||||||
|
|
||||||
|
[SerializeField, ShowIf("@_isSlowedMoveSpeed")]
|
||||||
|
private float _moveSpeedCoefficient;
|
||||||
|
|
||||||
|
[Title("푸쉬 설정")]
|
||||||
|
[SerializeField]
|
||||||
|
private bool _isPushed;
|
||||||
|
|
||||||
|
[SerializeField, ShowIf("@_isPushed")]
|
||||||
|
private float _pushPower;
|
||||||
|
|
||||||
|
[Title("효과음 설정")]
|
||||||
|
[SerializeField]
|
||||||
|
private string _awakeSfxName;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private string _attackSfxName;
|
||||||
|
|
||||||
|
[Title("자동 파괴 옵션")]
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private bool _useAutoDestroy = true;
|
private bool _useAutoDestroy = true;
|
||||||
|
|
||||||
[SerializeField, ShowIf("@_useAutoDestroy")]
|
[SerializeField, ShowIf("@_useAutoDestroy")]
|
||||||
private float _autoDestroyTime = 10f;
|
private float _autoDestroyTime = 10f;
|
||||||
|
|
||||||
[SerializeField]
|
|
||||||
private string _awakeSfxName;
|
|
||||||
|
|
||||||
public float SphereRadius { get; private set; }
|
public float SphereRadius { get; private set; }
|
||||||
|
|
||||||
@ -120,7 +142,11 @@ namespace BlueWater
|
|||||||
element.transform.SetParent(null);
|
element.transform.SetParent(null);
|
||||||
Destroy(element.gameObject, 2f);
|
Destroy(element.gameObject, 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_attackSfxName))
|
||||||
|
{
|
||||||
|
AudioManager.Instance.PlaySfx(_attackSfxName);
|
||||||
|
}
|
||||||
var impactParticle = Instantiate(ImpactParticle, transform.position, Quaternion.identity);
|
var impactParticle = Instantiate(ImpactParticle, transform.position, Quaternion.identity);
|
||||||
// TODO : HitBox가 레이어로 설정되어있으도, 부모 객체 Player를 계속 가져오는 버그가 있음
|
// TODO : HitBox가 레이어로 설정되어있으도, 부모 객체 Player를 계속 가져오는 버그가 있음
|
||||||
var iDamageable = hitCollider.GetComponentInParent<IDamageable>();
|
var iDamageable = hitCollider.GetComponentInParent<IDamageable>();
|
||||||
@ -128,6 +154,22 @@ namespace BlueWater
|
|||||||
{
|
{
|
||||||
iDamageable.TakeDamage(_attackDamage);
|
iDamageable.TakeDamage(_attackDamage);
|
||||||
OnHitAction?.Invoke();
|
OnHitAction?.Invoke();
|
||||||
|
|
||||||
|
if (_isSlowedMoveSpeed)
|
||||||
|
{
|
||||||
|
var slowable = hitCollider.GetComponentInParent<ISlowable>();
|
||||||
|
slowable?.SlowMoveSpeed(_slowDuration, _moveSpeedCoefficient);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isPushed)
|
||||||
|
{
|
||||||
|
var physicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
|
||||||
|
if (physicMovable != null)
|
||||||
|
{
|
||||||
|
var pushDirection = hitCollider.transform.position - transform.position;
|
||||||
|
physicMovable.SetPush(pushDirection.normalized, _pushPower);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Destroy(_projectilePrefab, 3f);
|
Destroy(_projectilePrefab, 3f);
|
||||||
@ -161,8 +203,28 @@ namespace BlueWater
|
|||||||
|
|
||||||
iDamageable.TakeDamage(_attackDamage);
|
iDamageable.TakeDamage(_attackDamage);
|
||||||
OnHitAction?.Invoke();
|
OnHitAction?.Invoke();
|
||||||
|
|
||||||
|
if (_isSlowedMoveSpeed)
|
||||||
|
{
|
||||||
|
var slowable = _hitColliders[i].GetComponentInParent<ISlowable>();
|
||||||
|
slowable?.SlowMoveSpeed(_slowDuration, _moveSpeedCoefficient);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isPushed)
|
||||||
|
{
|
||||||
|
var physicMovable = _hitColliders[i].GetComponentInParent<IPhysicMovable>();
|
||||||
|
if (physicMovable != null)
|
||||||
|
{
|
||||||
|
var pushDirection = _hitColliders[i].transform.position - transform.position;
|
||||||
|
physicMovable.SetPush(pushDirection.normalized, _pushPower);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_attackSfxName))
|
||||||
|
{
|
||||||
|
AudioManager.Instance.PlaySfx(_attackSfxName);
|
||||||
|
}
|
||||||
var impactParticle = Instantiate(ImpactParticle, transform.position, Quaternion.identity);
|
var impactParticle = Instantiate(ImpactParticle, transform.position, Quaternion.identity);
|
||||||
|
|
||||||
Destroy(_projectilePrefab, 3f);
|
Destroy(_projectilePrefab, 3f);
|
||||||
@ -181,6 +243,28 @@ namespace BlueWater
|
|||||||
OnHitAction = onHitAction;
|
OnHitAction = onHitAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 파티클이 충돌할 때, 슬로우 효과를 적용할 때 사용
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="slowDuration">슬로우 효과 지속시간</param>
|
||||||
|
/// <param name="moveSpeedCoefficient">값이 1f일 때, 기본 이동속도\n0.3f라면, 70%감소 효과 (기존 속도의 30%)</param>
|
||||||
|
public void SetSlowMoveSpeed(float slowDuration, float moveSpeedCoefficient)
|
||||||
|
{
|
||||||
|
_isSlowedMoveSpeed = true;
|
||||||
|
_slowDuration = slowDuration;
|
||||||
|
_moveSpeedCoefficient = moveSpeedCoefficient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 파티클이 충돌할 때, 밀어내는 효과를 적용할 때 사용
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pushPower">hit되는 캐릭터의 moveSpeed를 고려해서 적용</param>
|
||||||
|
public void SetPush(float pushPower)
|
||||||
|
{
|
||||||
|
_isPushed = true;
|
||||||
|
_pushPower = pushPower;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddForce(Vector3 force, ForceMode forceMode) => _rigidbody.AddForce(force, forceMode);
|
public void AddForce(Vector3 force, ForceMode forceMode) => _rigidbody.AddForce(force, forceMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -25,5 +25,5 @@ MonoBehaviour:
|
|||||||
m_Bits: 67584
|
m_Bits: 67584
|
||||||
<ChargeSpeed>k__BackingField: 25
|
<ChargeSpeed>k__BackingField: 25
|
||||||
<ChargeOffset>k__BackingField: 3
|
<ChargeOffset>k__BackingField: 3
|
||||||
<PushPower>k__BackingField: 10
|
<PushPower>k__BackingField: 12
|
||||||
<StunDuration>k__BackingField: 0.05
|
<StunDuration>k__BackingField: 0.05
|
||||||
|
@ -24,5 +24,5 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 67584
|
m_Bits: 67584
|
||||||
<AttackOffset>k__BackingField: 3
|
<AttackOffset>k__BackingField: 3
|
||||||
<PushPower>k__BackingField: 5
|
<PushPower>k__BackingField: 10
|
||||||
<StunDuration>k__BackingField: 0.05
|
<StunDuration>k__BackingField: 0.05
|
||||||
|
@ -29,5 +29,5 @@ MonoBehaviour:
|
|||||||
<ProjectileDamage>k__BackingField: 1
|
<ProjectileDamage>k__BackingField: 1
|
||||||
<ProjectileAngle>k__BackingField: 90
|
<ProjectileAngle>k__BackingField: 90
|
||||||
<ProjectileSpeed>k__BackingField: 10
|
<ProjectileSpeed>k__BackingField: 10
|
||||||
<PushPower>k__BackingField: 5
|
<PushPower>k__BackingField: 15
|
||||||
<StunDuration>k__BackingField: 0.1
|
<StunDuration>k__BackingField: 0.1
|
||||||
|
@ -32,6 +32,6 @@ MonoBehaviour:
|
|||||||
<StunColor>k__BackingField:
|
<StunColor>k__BackingField:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4288949504
|
rgba: 4288949504
|
||||||
<PushPowerCoefficient>k__BackingField: 10
|
<PushPowerCoefficient>k__BackingField: 20
|
||||||
<CameraShakingPower>k__BackingField: 3
|
<CameraShakingPower>k__BackingField: 3
|
||||||
<CameraShakingDuration>k__BackingField: 1
|
<CameraShakingDuration>k__BackingField: 1
|
||||||
|
@ -30,7 +30,7 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 64
|
m_Bits: 64
|
||||||
<RollSpeed>k__BackingField: 40
|
<RollSpeed>k__BackingField: 40
|
||||||
<PushPower>k__BackingField: 8
|
<PushPower>k__BackingField: 12
|
||||||
<AirJumpForce>k__BackingField: 3
|
<AirJumpForce>k__BackingField: 3
|
||||||
<BounceBackForce>k__BackingField: 200
|
<BounceBackForce>k__BackingField: 200
|
||||||
<CameraShakingPower>k__BackingField: 5
|
<CameraShakingPower>k__BackingField: 5
|
||||||
|
@ -28,4 +28,4 @@ MonoBehaviour:
|
|||||||
<JumpHeight>k__BackingField: 2
|
<JumpHeight>k__BackingField: 2
|
||||||
<SlowDuration>k__BackingField: 3
|
<SlowDuration>k__BackingField: 3
|
||||||
<SlowCoefficient>k__BackingField: 0.5
|
<SlowCoefficient>k__BackingField: 0.5
|
||||||
<PushPower>k__BackingField: 3
|
<PushPower>k__BackingField: 10
|
||||||
|
@ -133,9 +133,10 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
var hitVector = raycastHit.transform.position - SkillUser.transform.position;
|
var hitVector = raycastHit.transform.position - SkillUser.transform.position;
|
||||||
hitVector.y = 0f;
|
hitVector.y = 0f;
|
||||||
var hitDirection = hitVector.normalized;
|
var hitDirection = hitVector.normalized;
|
||||||
var cross = Vector3.Cross(hitDirection, transform.forward);
|
iPhysicMovable.SetPush(hitDirection, _bullChargeData.PushPower);
|
||||||
var addForceDirection = cross.y >= 0f ? Quaternion.Euler(0, -90, 0) * transform.forward : Quaternion.Euler(0, 90, 0) * transform.forward;
|
// var cross = Vector3.Cross(hitDirection, transform.forward);
|
||||||
iPhysicMovable.AddForce(addForceDirection * _bullChargeData.PushPower, ForceMode.Impulse);
|
// var addForceDirection = cross.y >= 0f ? Quaternion.Euler(0, -90, 0) * transform.forward : Quaternion.Euler(0, 90, 0) * transform.forward;
|
||||||
|
// iPhysicMovable.AddForce(addForceDirection * _bullChargeData.PushPower, ForceMode.Impulse);
|
||||||
}
|
}
|
||||||
|
|
||||||
totalDistanceCovered += moveDistance;
|
totalDistanceCovered += moveDistance;
|
||||||
|
@ -11,9 +11,6 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
[field: SerializeField]
|
[field: SerializeField]
|
||||||
public GameObject SeismicThrustParticle { get; private set; }
|
public GameObject SeismicThrustParticle { get; private set; }
|
||||||
|
|
||||||
[field: SerializeField, Tooltip("공격했을 때, 타겟을 밀어내는 힘")]
|
|
||||||
public float PushPower { get; private set; } = 20f;
|
|
||||||
|
|
||||||
[field: SerializeField, Tooltip("공격했을 때, 타겟의 기절 지속시간")]
|
[field: SerializeField, Tooltip("공격했을 때, 타겟의 기절 지속시간")]
|
||||||
public float StunDuration { get; private set; } = 0.15f;
|
public float StunDuration { get; private set; } = 0.15f;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
var hitVector = hitCollider.transform.position - SkillUser.transform.position;
|
var hitVector = hitCollider.transform.position - SkillUser.transform.position;
|
||||||
hitVector.y = 0f;
|
hitVector.y = 0f;
|
||||||
var hitDirection = hitVector.normalized;
|
var hitDirection = hitVector.normalized;
|
||||||
iPhysicMovable.AddForce(hitDirection * _hammerSlamData.PushPower, ForceMode.Impulse);
|
iPhysicMovable.SetPush(hitDirection, _hammerSlamData.PushPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
HideIndicator();
|
HideIndicator();
|
||||||
|
@ -130,7 +130,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
iStunnable?.TryStun(_meteorSwingData.StunDuration);
|
iStunnable?.TryStun(_meteorSwingData.StunDuration);
|
||||||
|
|
||||||
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
|
var iPhysicMovable = hitCollider.GetComponentInParent<IPhysicMovable>();
|
||||||
iPhysicMovable?.AddForce(attackDirection * _meteorSwingData.PushPower, ForceMode.Impulse);
|
iPhysicMovable?.SetPush(attackDirection, _meteorSwingData.PushPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
HideIndicator();
|
HideIndicator();
|
||||||
|
@ -113,9 +113,6 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
|
|
||||||
var iSlowable = raycastHit.transform.GetComponentInParent<ISlowable>();
|
var iSlowable = raycastHit.transform.GetComponentInParent<ISlowable>();
|
||||||
iSlowable?.TrySlowMoveSpeed(_seismicThrustData.SlowDuration, _seismicThrustData.SlowCoefficient);
|
iSlowable?.TrySlowMoveSpeed(_seismicThrustData.SlowDuration, _seismicThrustData.SlowCoefficient);
|
||||||
|
|
||||||
var iPhysicMovable = raycastHit.transform.GetComponentInParent<IPhysicMovable>();
|
|
||||||
iPhysicMovable?.AddForce(transform.forward * _seismicThrustData.PushPower, ForceMode.Impulse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HideIndicator();
|
HideIndicator();
|
||||||
|
@ -198,9 +198,9 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
{
|
{
|
||||||
var hitCollider = HitColliders[i];
|
var hitCollider = HitColliders[i];
|
||||||
var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>();
|
var iStunnable = hitCollider.transform.GetComponentInParent<IStunnable>();
|
||||||
if (iStunnable != null)
|
if (iStunnable != null && iStunnable.CanStun())
|
||||||
{
|
{
|
||||||
iStunnable.TryStun(_skyFallSmashData.StunDuration);
|
iStunnable.Stun(_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;
|
||||||
@ -210,8 +210,7 @@ namespace BlueWater.Enemies.Bosses.Rhinoceros.Skills
|
|||||||
var hitDistance = hitVector.magnitude;
|
var hitDistance = hitVector.magnitude;
|
||||||
var powerCoefficient = stunRange - hitDistance;
|
var powerCoefficient = stunRange - hitDistance;
|
||||||
var addForcePower = powerCoefficient / stunRange * _skyFallSmashData.PushPowerCoefficient;
|
var addForcePower = powerCoefficient / stunRange * _skyFallSmashData.PushPowerCoefficient;
|
||||||
|
iPhysicMovable.SetPush(hitDirection, addForcePower);
|
||||||
iPhysicMovable.AddForce(hitDirection * addForcePower, ForceMode.Impulse);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,5 +16,14 @@ namespace BlueWater.Enemies.Bosses.SandMole.Skills
|
|||||||
|
|
||||||
[field: SerializeField]
|
[field: SerializeField]
|
||||||
public float ProjectileSpeed { get; private set; } = 25f;
|
public float ProjectileSpeed { get; private set; } = 25f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float PushPower { get; private set; } = 3.5f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float SlowDuration { get; private set; } = 3f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float MoveSpeedCoefficient { get; private set; } = 0.3f;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -28,5 +28,14 @@ namespace BlueWater.Enemies.Bosses.SandMole.Skills
|
|||||||
|
|
||||||
[field: SerializeField]
|
[field: SerializeField]
|
||||||
public float ProjectileSpeed { get; private set; } = 25f;
|
public float ProjectileSpeed { get; private set; } = 25f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float PushPower { get; private set; } = 3.5f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float SlowDuration { get; private set; } = 3f;
|
||||||
|
|
||||||
|
[field: SerializeField]
|
||||||
|
public float MoveSpeedCoefficient { get; private set; } = 0.3f;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -66,6 +66,8 @@ namespace BlueWater.Enemies.Bosses.SandMole.Skills
|
|||||||
var projectile = Instantiate(_multiThrowSpikesData.SpikePrefab, startPosition, rotation,
|
var projectile = Instantiate(_multiThrowSpikesData.SpikePrefab, startPosition, rotation,
|
||||||
_particleInstantiateLocation).GetComponent<ProjectileController>();
|
_particleInstantiateLocation).GetComponent<ProjectileController>();
|
||||||
projectile.Initialize(_multiThrowSpikesData.Damage, _multiThrowSpikesData.TargetLayer);
|
projectile.Initialize(_multiThrowSpikesData.Damage, _multiThrowSpikesData.TargetLayer);
|
||||||
|
projectile.SetPush(_multiThrowSpikesData.PushPower);
|
||||||
|
projectile.SetSlowMoveSpeed(_multiThrowSpikesData.SlowDuration, _multiThrowSpikesData.MoveSpeedCoefficient);
|
||||||
projectile.AddForce(projectile.transform.forward * _multiThrowSpikesData.ProjectileSpeed, ForceMode.Impulse);
|
projectile.AddForce(projectile.transform.forward * _multiThrowSpikesData.ProjectileSpeed, ForceMode.Impulse);
|
||||||
|
|
||||||
yield return waitForSeconds;
|
yield return waitForSeconds;
|
||||||
|
@ -165,11 +165,12 @@ namespace BlueWater.Enemies.Bosses.SandMole.Skills
|
|||||||
var hitVector = hitCollider.transform.position - SkillUser.transform.position;
|
var hitVector = hitCollider.transform.position - SkillUser.transform.position;
|
||||||
hitVector.y = 0f;
|
hitVector.y = 0f;
|
||||||
var hitDirection = hitVector.normalized;
|
var hitDirection = hitVector.normalized;
|
||||||
var cross = Vector3.Cross(hitDirection, transform.forward);
|
iPhysicMovable.SetPush(hitDirection, _singleRollData.PushPower);
|
||||||
var addForceDirection = cross.y >= 0f
|
// var cross = Vector3.Cross(hitDirection, transform.forward);
|
||||||
? Quaternion.Euler(0, -90, 0) * transform.forward
|
// var addForceDirection = cross.y >= 0f
|
||||||
: Quaternion.Euler(0, 90, 0) * transform.forward;
|
// ? Quaternion.Euler(0, -90, 0) * transform.forward
|
||||||
iPhysicMovable.AddForce(addForceDirection * _singleRollData.PushPower, ForceMode.Impulse);
|
// : Quaternion.Euler(0, 90, 0) * transform.forward;
|
||||||
|
// iPhysicMovable.AddForce(addForceDirection * _singleRollData.PushPower, ForceMode.Impulse);
|
||||||
}
|
}
|
||||||
|
|
||||||
_userRigidbody.MovePosition(skillUserPosition + targetDirection * moveDistance);
|
_userRigidbody.MovePosition(skillUserPosition + targetDirection * moveDistance);
|
||||||
|
@ -101,6 +101,8 @@ namespace BlueWater.Enemies.Bosses.SandMole.Skills
|
|||||||
var spike = Instantiate(_spikeBarrageData.SpikePrefab, spikeSpawnPosition, rotation,
|
var spike = Instantiate(_spikeBarrageData.SpikePrefab, spikeSpawnPosition, rotation,
|
||||||
_particleInstantiateLocation).GetComponent<ProjectileController>();
|
_particleInstantiateLocation).GetComponent<ProjectileController>();
|
||||||
spike.Initialize(_spikeBarrageData.Damage, _spikeBarrageData.TargetLayer);
|
spike.Initialize(_spikeBarrageData.Damage, _spikeBarrageData.TargetLayer);
|
||||||
|
spike.SetPush(_spikeBarrageData.PushPower);
|
||||||
|
spike.SetSlowMoveSpeed(_spikeBarrageData.SlowDuration, _spikeBarrageData.MoveSpeedCoefficient);
|
||||||
spike.AddForce(spike.transform.forward * _spikeBarrageData.ProjectileSpeed, ForceMode.Impulse);
|
spike.AddForce(spike.transform.forward * _spikeBarrageData.ProjectileSpeed, ForceMode.Impulse);
|
||||||
|
|
||||||
yield return spikeInterval;
|
yield return spikeInterval;
|
||||||
|
@ -262,7 +262,7 @@ namespace BlueWater.Enemies.Bosses.TitanSlime.Skills
|
|||||||
iSlowable?.TrySlowMoveSpeed(_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?.SetPush(targetDirection, _jumpSlamData.PushPower);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user