You fix some, you brake some
This commit is contained in:
1 parent
d810ea00b6
commit
1a75cf8461
778 files changed
+203405
-86541
No files matched your search
@@ -89,6 +89,16 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
return new AttackBattleActionData() { TotalFrames = _attackData.TotalFrames };
|
||||
}
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
var entityAnimator = entity.animator;
|
||||
|
||||
entity.SyncRootMotionToMotor();
|
||||
|
||||
entityAnimator.Play(EntryStateHash, 0, 0f);
|
||||
entityAnimator.Update(0f);
|
||||
}
|
||||
|
||||
private void OnEnemyHit(Collider enemyCollider)
|
||||
{
|
||||
var originEntityId = enemyCollider.GetComponentInParent<EntityProperties>().GetEntityId();
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
public abstract BattleActionType ActionType { get; }
|
||||
public abstract DeciderType DeciderType { get; }
|
||||
public abstract BattleActionData MountAndGetFrames(EntityProperties entity, BattleActionDecisionResult result);
|
||||
public abstract void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result);
|
||||
|
||||
protected BattleTimeline battleTimeline;
|
||||
public void SetBattleTimeline(BattleTimeline battleTimeline) => this.battleTimeline = battleTimeline;
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
data.Corners = new[] { startPos, validTarget };
|
||||
data.CurrentCornerIndex = 1;
|
||||
data.TotalFrames = CalculatePathFrames(data.Corners, entity.MovementController);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -95,6 +96,17 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
return data;
|
||||
}
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
entity.KinematicCharacterMotor.BaseVelocity = Vector3.zero;
|
||||
|
||||
entity.MovementController.Freeze = true;
|
||||
entity.MovementController.InternalVelocityAdd = Vector3.zero;
|
||||
entity.MovementController.MoveInputVector = Vector3.zero;
|
||||
|
||||
Debug.Log($"{entity.GetEntityId()} is frozen");
|
||||
}
|
||||
|
||||
public override void Tick(
|
||||
float tickDelta,
|
||||
EntityProperties entity,
|
||||
@@ -110,6 +122,8 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
var movementController = entity.MovementController;
|
||||
|
||||
movementController.Freeze = false;
|
||||
|
||||
if (movementActionData.IsRotateOnly)
|
||||
{
|
||||
movementActionData.CurrentFrame++;
|
||||
@@ -131,7 +145,6 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
entity.KinematicCharacterMotor.SetRotation(positionDecisionResult.Rotation);
|
||||
battleActionData.Finished = true;
|
||||
Debug.Log("Rotated");
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -142,7 +155,6 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
entity.KinematicCharacterMotor.SetRotation(positionDecisionResult.Rotation);
|
||||
StopMovementAndFinish(movementController);
|
||||
battleActionData.Finished = true;
|
||||
Debug.Log($"Corners {movementActionData.Corners == null} || Wrong index {movementActionData.CurrentCornerIndex >= movementActionData.Corners?.Length}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,7 +184,6 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
StopMovementAndFinish(movementController);
|
||||
|
||||
battleActionData.Finished = true;
|
||||
Debug.Log("Last corner");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,7 +225,6 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
entity.KinematicCharacterMotor.SetRotation(positionDecisionResult.Rotation);
|
||||
StopMovementAndFinish(movementController);
|
||||
Debug.Log("Very Last corner");
|
||||
battleActionData.Finished = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,10 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
return new NoneBattleActionData();
|
||||
}
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Code.Game.Entities;
|
||||
using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.Actions.Deciders;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
@@ -22,7 +23,12 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
public override DeciderType DeciderType => DeciderType.AsIs;
|
||||
public override BattleActionData MountAndGetFrames(EntityProperties entity, BattleActionDecisionResult result)
|
||||
{
|
||||
return new StuggerActionData { TotalFrames = _actionParameters.TotalFrames};
|
||||
return new StuggerActionData { TotalFrames = _actionParameters.TotalFrames, Finished = false};
|
||||
}
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Tick(float tickDelta,
|
||||
@@ -32,6 +38,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
if (battleActionData is not StuggerActionData stuggerActionData)
|
||||
{
|
||||
Debug.Log("WrongData");
|
||||
battleActionData.Finished = true;
|
||||
return;
|
||||
}
|
||||
@@ -39,7 +46,9 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
if (stuggerActionData.CurrentFrame == 0)
|
||||
{
|
||||
var transitionTime = stuggerActionData.TransitionFrames * BattleTimeline.TickDelta;
|
||||
entity.animator.ResetAnimatorPosition();
|
||||
|
||||
entity.SyncRootMotionToMotor();
|
||||
|
||||
entity.animator.CrossFadeInFixedTime(StuggerStateHash, transitionTime);
|
||||
}
|
||||
|
||||
@@ -47,6 +56,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
if (stuggerActionData.CurrentFrame >= _actionParameters.TotalFrames)
|
||||
{
|
||||
Debug.Log("Frame last");
|
||||
battleActionData.Finished = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,5 +55,10 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
return actionData;
|
||||
}
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user