Update
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Continentis.MainGame.Character;
|
||||
using DG.Tweening;
|
||||
using Lean.Pool;
|
||||
using SLSFramework.UModAssistance;
|
||||
using UnityEngine;
|
||||
@@ -67,8 +68,7 @@ namespace Continentis.MainGame.Combat
|
||||
combatCharacterViews.Add(view);
|
||||
}
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
SetViewPositions(0);
|
||||
|
||||
//ModManager.CreateInstance<CharacterCombatBuffBase>("Basic.Buffs.Weak", 2).Apply(enemies[0]);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace Continentis.MainGame.Combat
|
||||
npc.InitializeCards();
|
||||
|
||||
Vector3 eulerAngles = fraction == Fraction.Enemy ? new Vector3(0, 180, 0) : Vector3.zero;
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(new Vector3(0, -2, 0));
|
||||
CombatCharacterViewBase view = npc.GenerateCharacterView(new Vector3(0, -1, 0));
|
||||
view.mainView.transform.localEulerAngles = eulerAngles;
|
||||
|
||||
npcs[fraction].Add(npc);
|
||||
@@ -99,10 +99,9 @@ namespace Continentis.MainGame.Combat
|
||||
}
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
}
|
||||
|
||||
public void SetViewPositions()
|
||||
public void SetViewPositions(float transitionDuration = 0.25f)
|
||||
{
|
||||
float playerSideLeftBound = -7.5f;
|
||||
float playerSideRightBound = -1.5f;
|
||||
@@ -118,7 +117,19 @@ namespace Continentis.MainGame.Combat
|
||||
{
|
||||
float xPos = playerSideLeftBound + index * playerBaseInterval;
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
playerHeroes[index].characterView.transform.position = position;
|
||||
|
||||
if (transitionDuration > 0f)
|
||||
{
|
||||
playerHeroes[index].characterView.transform.DOMove(position, transitionDuration)
|
||||
.SetEase(Ease.InOutSine)
|
||||
.OnComplete(SetViewHUDs)
|
||||
.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
playerHeroes[index].characterView.transform.position = position;
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +147,18 @@ namespace Continentis.MainGame.Combat
|
||||
{
|
||||
float xPos = enemySideLeftBound + index * enemyBaseInterval;
|
||||
Vector3 position = new Vector3(xPos, -1, 0);
|
||||
enemies[index].characterView.transform.position = position;
|
||||
if (transitionDuration > 0f)
|
||||
{
|
||||
enemies[index].characterView.transform.DOMove(position, transitionDuration)
|
||||
.SetEase(Ease.InOutSine)
|
||||
.OnComplete(SetViewHUDs)
|
||||
.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
enemies[index].characterView.transform.position = position;
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log($"Enemy are sorted: {string.Join(", ", enemies.Select(e => e.data.displayName))}");
|
||||
@@ -207,7 +229,6 @@ namespace Continentis.MainGame.Combat
|
||||
Object.Destroy(character.characterView.gameObject);
|
||||
|
||||
SetViewPositions();
|
||||
SetViewHUDs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,14 +149,14 @@ namespace Continentis.MainGame.Combat
|
||||
currentCharacter = characterController.actionOrderList[0];
|
||||
|
||||
currentCharacter.eventSubmodule.onActionStart.Invoke();
|
||||
currentCharacter.combatBuffSubmodule.ActionStart();
|
||||
currentCharacter.recordSubmodule.SetAction(currentRound, ++currentActionIndex);
|
||||
|
||||
|
||||
if (currentCharacter is PlayerHero playerHero)
|
||||
{
|
||||
CombatMainPage combatMainPage = CombatUIManager.Instance.combatMainPage;
|
||||
|
||||
playerHero.deckSubmodule.SetUpHandCardViews();
|
||||
playerHero.combatBuffSubmodule.ActionStart();
|
||||
|
||||
combatMainPage.handPile.isUpdatingLayout = false;
|
||||
CommandQueueManager.Instance.AddCommand(playerHero.deckSubmodule.DrawCards(playerHero.GetAttribute("DrawCardAmountPerAction")));
|
||||
@@ -191,8 +191,14 @@ namespace Continentis.MainGame.Combat
|
||||
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0.25f, null));
|
||||
foreach (IntendedCard intendedCard in currentCharacter.intentionSubmodule.intendedCards)
|
||||
{
|
||||
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0.25f, () => intendedCard.cardInstance.DestroyIntentionCardView()));
|
||||
intendedCard.cardInstance.Play(intendedCard.targets, currentCharacter, false);
|
||||
//TODO: 临时的,刷新一次意图目标
|
||||
currentCharacter.CheckAvailabilityAndSetTargets(intendedCard.cardInstance, out intendedCard.targets);
|
||||
|
||||
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0.25f, () =>
|
||||
{
|
||||
intendedCard.cardInstance.Play(intendedCard.targets, currentCharacter);
|
||||
intendedCard.cardInstance.DestroyIntentionCardView();
|
||||
}));
|
||||
}
|
||||
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0f, EndAction));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user