This commit is contained in:
SoulliesOfficial
2025-12-11 17:25:49 -05:00
parent f7cab3e784
commit b54c5f796b
17 changed files with 113 additions and 36 deletions

View File

@@ -10,15 +10,15 @@ namespace Continentis.Mods.Basic.Buffs
{
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
this.contentSubmodule = new ContentSubmodule(this, false)
this.contentSubmodule = new ContentSubmodule(this)
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
this.iconSubmodule = new IconSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true);
this.coreAttributeSubmodule = new CoreAttributeSubmodule(this);
this.coreAttributeSubmodule.numericChange.Add("PhysicsDamageDealtOffset", stack);
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
this.generalAttributeSubmodule.numericChange.Add("PhysicsDamageDealtOffset", stack);
this.eventSubmodule = new EventSubmodule(this);
this.eventSubmodule.onDealAttack.Add("Sharpness", new PrioritizedAction<AttackResult>(atkRes =>

View File

@@ -140,11 +140,11 @@ MonoBehaviour:
index: 20
isKeyDuplicated: 0
- Key: StaminaRecoverPerAction
Value: 0
Value: 3
index: 21
isKeyDuplicated: 0
- Key: ManaRecoverPerAction
Value: 0
Value: 3
index: 22
isKeyDuplicated: 0
- Key: Speed

View File

@@ -140,11 +140,11 @@ MonoBehaviour:
index: 20
isKeyDuplicated: 0
- Key: StaminaRecoverPerAction
Value: 0
Value: 3
index: 21
isKeyDuplicated: 0
- Key: ManaRecoverPerAction
Value: 0
Value: 3
index: 22
isKeyDuplicated: 0
- Key: Speed

View File

@@ -140,11 +140,11 @@ MonoBehaviour:
index: 20
isKeyDuplicated: 0
- Key: StaminaRecoverPerAction
Value: 0
Value: 3
index: 21
isKeyDuplicated: 0
- Key: ManaRecoverPerAction
Value: 0
Value: 3
index: 22
isKeyDuplicated: 0
- Key: Speed

View File

@@ -128,11 +128,11 @@ MonoBehaviour:
index: 17
isKeyDuplicated: 0
- Key: StaminaRecoverPerAction
Value: 0
Value: 3
index: 18
isKeyDuplicated: 0
- Key: ManaRecoverPerAction
Value: 0
Value: 3
index: 19
isKeyDuplicated: 0
- Key: Speed

View File

@@ -15,8 +15,8 @@ namespace Continentis.Mods.Basic.Rules
}
float level = core["Level"];
general["MaximumHealth"] += Mathf.FloorToInt(level * 3);
general["MaximumMana"] += Mathf.FloorToInt(level / 2);
//general["MaximumHealth"] += Mathf.FloorToInt(level * 3);
//general["MaximumMana"] += Mathf.FloorToInt(level / 2);
float strengthOffset = core["Strength"] - 12;
general["MaximumStamina"] += Mathf.FloorToInt(strengthOffset / 4); //最大行动点加成
@@ -33,11 +33,13 @@ namespace Continentis.Mods.Basic.Rules
float physiqueOffset = core["Physique"] - 12;
general["MaximumHealth"] += core["Physique"] * 6; //最大生命值加成
Debug.Log("Physique Offset: " + physiqueOffset);
general["StaminaRecoverPerAction"] += Mathf.FloorToInt(physiqueOffset / 6); //每回合恢复行动点
general["OffsetFromPhysique"] += Mathf.FloorToInt(physiqueOffset / 3); //来自核心属性(体质)的调整值
float perceptionOffset = core["Perception"] - 12;
general["DrawCardAmountPerAction"] += Mathf.FloorToInt(perceptionOffset / 6); //来自核心属性(感知)的每回合额外抽牌数量
general["DrawCardAmountPerAction"] += 10; //TODO: 临时的,后续会移除
general["Awareness"] += perceptionOffset; //增加感知
general["OffsetFromPerception"] += Mathf.FloorToInt(perceptionOffset / 3); //来自核心属性(感知)的调整值

View File

@@ -1505,6 +1505,8 @@ GameObject:
- component: {fileID: 368630473}
- component: {fileID: 368630475}
- component: {fileID: 368630476}
- component: {fileID: 368630477}
- component: {fileID: 368630478}
m_Layer: 5
m_Name: TeamSwitchButton
m_TagString: Untagged
@@ -1631,6 +1633,46 @@ MonoBehaviour:
button: {fileID: 368630475}
buttonText: {fileID: 1783939752}
teamPileText: {fileID: 833598973}
--- !u!223 &368630477
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 368630471}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 1
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 1
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 1876474179
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &368630478
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 368630471}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &373312357
GameObject:
m_ObjectHideFlags: 0

View File

@@ -37,7 +37,7 @@ namespace Continentis.MainGame
public static string Parse(Interpreter interpreter, string template)
{
try
//try
{
while (template.Contains("$"))
{
@@ -58,10 +58,10 @@ namespace Continentis.MainGame
template = template.Substring(0, startIndex) + resultAsLiteral + template.Substring(endIndex + 1);
}
}
catch (Exception ex)
/*catch (Exception ex)
{
throw new Exception($"解析模板时发生严重错误: {ex.Message}\nStackTrace: {ex.StackTrace}");
}
}*/
return template;
}

View File

@@ -191,11 +191,6 @@ namespace Continentis.MainGame.Card
this.user.ModifyStamina(-GetAttribute("StaminaCost"));
this.user.ModifyMana(-GetAttribute("ManaCost"));
if (this.user is PlayerHero)
{
CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons();
}
Debug.Log($"Starting to play card: {contentSubmodule.cardName}");
CommandQueueManager.Instance.AddCommand(new Cmd_Function(() =>

View File

@@ -33,9 +33,10 @@ namespace Continentis.MainGame.Card
/// </summary>
/// <param name="commandGroup">目标指令组</param>
/// <param name="title">选择卡牌的描述性标题</param>
/// <param name="includeTeam">是否包含队伍内的卡牌,如果不包含,则强制切换到角色手牌,且禁用切换按钮</param>
/// <param name="maxSelection">最大选择数量</param>
/// <param name="forceMax">是否强制选择最大数量</param>
public void AddSelectionCommands(ref CommandGroup commandGroup, string title, int maxSelection, bool forceMax = false)
public void AddSelectionCommands(ref CommandGroup commandGroup, string title, int maxSelection, bool forceMax = false, bool includeTeam = false)
{
selectedCards = new List<CardInstance>();
HandCardSelectionInterface handCardSelector = CombatUIManager.Instance.combatMainPage.handCardSelector;
@@ -43,12 +44,21 @@ namespace Continentis.MainGame.Card
commandGroup.AddCommand(new Cmd_Function(() =>
{
handCardSelector.Setup(title, mainLogic.card, maxSelection, selectCondition, forceMax);
if (!includeTeam)
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.SwitchToCurrentCharacter();
CombatUIManager.Instance.combatMainPage.teamSwitchButton.button.interactable = false;
}
}));
commandGroup.AddCommand(new Cmd_WaitForUI(handCardSelector));
commandGroup.AddCommand(new Cmd_Function(() =>
{
selectedCards = handCardSelector.selectedCards.ToList();
selectedCards.ForEach(selectEffect);
if (!includeTeam)
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.button.interactable = true;
}
}));
}

View File

@@ -39,7 +39,7 @@ namespace Continentis.MainGame.Character
modifiedAttributes.AddRange(numericChange.Select(kvp => kvp.Key));
modifiedAttributes.AddRange(percentageChangeOfAccumulation.Select(kvp => kvp.Key));
modifiedAttributes.AddRange(percentageChangeOfMultiplication.Select(kvp => kvp.Key));
modifiedAttributes.ForEach(attr => character.attributeSubmodule.RefreshCoreAttribute(attr));
character.attributeSubmodule.RefreshAllGeneralAttributes(); //刷新核心属性后,需要刷新通用属性

View File

@@ -46,6 +46,11 @@ namespace Continentis.MainGame.Character
{
ModifyAttribute("Stamina", staminaValue);
ClampAttribute("Stamina", 0, GetAttribute("MaximumStamina"));
if (this is PlayerHero)
{
CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons();
}
}
/// <summary>
@@ -63,6 +68,11 @@ namespace Continentis.MainGame.Character
{
ModifyAttribute("Mana", manaValue);
ClampAttribute("Stamina", 0, GetAttribute("MaximumStamina"));
if (this is PlayerHero)
{
CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons();
}
}
}

View File

@@ -93,6 +93,7 @@ namespace Continentis.MainGame.Character
new Cmd_DiscardCards(card.deck, new List<CardInstance>() { card }, initiative, interval),
new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 弃牌后的处理
}));
@@ -111,6 +112,7 @@ namespace Continentis.MainGame.Character
}
discardCardGroup.AddCommand(new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 弃牌后的处理
}));
@@ -124,9 +126,9 @@ namespace Continentis.MainGame.Character
new Cmd_ExhaustCards(owner is PlayerHero, card.deck, new List<CardInstance>() { card }, interval),
new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 消耗牌后的处理
}));
return discardCardGroup;
}
@@ -142,6 +144,7 @@ namespace Continentis.MainGame.Character
}
discardCardGroup.AddCommand(new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 弃牌后的处理
}));
@@ -155,6 +158,7 @@ namespace Continentis.MainGame.Character
new Cmd_UsePowerCards(owner is PlayerHero, card.deck, new List<CardInstance>() { card }, interval),
new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 消耗牌后的处理
}));
@@ -173,6 +177,7 @@ namespace Continentis.MainGame.Character
}
discardCardGroup.AddCommand(new Cmd_Function(0, () =>
{
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team);
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 弃牌后的处理
}));

View File

@@ -40,6 +40,12 @@ namespace Continentis.MainGame.UI
discardPile.cardViews.Clear();
exhaustPile.cardViews.Clear();
gravePile.cardViews.Clear();
drawPile.UpdateCountText();
handPile.UpdateCountText();
discardPile.UpdateCountText();
exhaustPile.UpdateCountText();
gravePile.UpdateCountText();
}
public PileBase Pile(string pileName)

View File

@@ -26,7 +26,7 @@ namespace Continentis.MainGame.UI
if (count == 0 || index < 0)
return Vector2.zero;
float cardSpacing = cardSpacingBase + cardSpacingFactor / count;
float cardSpacing = cardSpacingBase + Mathf.Max((cardSpacingFactor - (count * 20)), -200) / count;
// 计算中间索引,保证手牌居中排列
float midIndex = (count - 1) / 2f;

View File

@@ -15,7 +15,6 @@ namespace Continentis.MainGame.UI
{
base.Awake();
cardViews = new List<CardViewBase>();
UpdateCountText();
}
public virtual void AddCard(CardViewBase cardObject)
@@ -40,7 +39,7 @@ namespace Continentis.MainGame.UI
//Debug.Log($"Removed {cardObject.cardInstance.cardLogic.contentSubmodule.cardName} from {this.name}" );
}
private void UpdateCountText()
public void UpdateCountText()
{
if (cardCountText != null)
{

View File

@@ -21,24 +21,24 @@ namespace Continentis.MainGame.UI
button.onClick.AddListener(() =>
{
isTeam = !isTeam;
if (isTeam)
{
SwitchToTeam();
buttonText.text = "Team";
teamPileText.gameObject.SetActive(true);
SwitchToCurrentCharacter();
}
else
{
SwitchToCurrentCharacter();
buttonText.text = "Hero";
teamPileText.gameObject.SetActive(false);
SwitchToTeam();
}
});
}
private void SwitchToTeam()
public void SwitchToTeam()
{
if(isTeam) return;
isTeam = true;
Sequence seq = DOTween.Sequence();
seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(-300f, 0.2f)
.OnComplete(() =>
@@ -49,6 +49,8 @@ namespace Continentis.MainGame.UI
{
card.user = CombatMainManager.Instance.currentCharacter;
card.RefreshCardAttributes();
buttonText.text = "Team";
teamPileText.gameObject.SetActive(true);
});
}));
@@ -57,8 +59,10 @@ namespace Continentis.MainGame.UI
seq.Play();
}
private void SwitchToCurrentCharacter()
public void SwitchToCurrentCharacter()
{
if(!isTeam) return;
isTeam = false;
if (CombatMainManager.Instance.currentCharacter is PlayerHero playerHero)
{
Sequence seq = DOTween.Sequence();
@@ -67,6 +71,8 @@ namespace Continentis.MainGame.UI
{
CombatUIManager.Instance.combatMainPage.ClearAllCardViews();
playerHero.deckSubmodule.SetUpHandCardViews();
buttonText.text = "Hero";
teamPileText.gameObject.SetActive(false);
}));
seq.AppendInterval(0.1f);
seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(80f, 0.2f));
@@ -81,6 +87,8 @@ namespace Continentis.MainGame.UI
public void UpdateTeamPileText(CombatTeam team)
{
int currentCardCount = team.deckSubmodule.HandPile.Count;
Debug.Log($"Current team hand pile count: {currentCardCount}");
gameObject.SetActive(currentCardCount != 0);