Attack hitbox change

This commit is contained in:
maverickdgg 2023-03-25 17:29:03 +08:00
parent 2d9b7f3a5d
commit 6c1f0162e9
2 changed files with 17 additions and 3 deletions

View File

@ -18,7 +18,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
if (transform) if (transform)
{ {
transform.GlobalPosition = aiTransform.GlobalPosition; transform.GlobalPosition = aiTransform.GlobalPosition + aiTransform.Forward * 2.2f; ;
transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles; transform.GlobalEulerAngles = aiTransform.GlobalEulerAngles;
} }
} }

View File

@ -14,12 +14,14 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
float windupTime = 8.0f / 30.0f; float windupTime = 8.0f / 30.0f;
float holdTime = 0.3f; float holdTime = 0.3f;
float seqTime = 8.0f / 30.0f + 0.5f; float seqTime = 8.0f / 30.0f;
float endTime = 0.5f;
bool windUp = false; bool windUp = false;
bool hold = false; bool hold = false;
bool seq = false; bool seq = false;
bool end = false;
public AttackState(StateMachine machine): base(machine) public AttackState(StateMachine machine): base(machine)
{ {
@ -34,6 +36,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
windUp = true; windUp = true;
hold = false; hold = false;
seq = false; seq = false;
end = false;
timer = windupTime; timer = windupTime;
RotateToVelocity rotate = machine.GetScript<RotateToVelocity>(); RotateToVelocity rotate = machine.GetScript<RotateToVelocity>();
@ -106,7 +109,18 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
if(timer <= 0.0f) if(timer <= 0.0f)
{ {
seq = false; seq = false;
end = true;
animator.PlayOneShot(ai.atkSeqAnim);
timer = endTime;
}
}
else if(end)
{
if(timer <= 0.0f)
{
end = false;
AILineOfSight los = ai.GetScript<AILineOfSight>(); AILineOfSight los = ai.GetScript<AILineOfSight>();
if (los && los.withinSight) if (los && los.withinSight)
{ {