feat(battle-engine): full View/VFX/UI/Touch/Story type closure (4254->3916, unmasked)
Generate no-op shells for the entire stop-listed View/Vfx/UI/Touch/Story missing- type closure (~180 types) + 5 copyable engine files. Net-new shells emitted base-less, so override members are stripped via the new --no-override generator flag. SDK/BCL over-reach (Adjust/GZipStream/Socket*) and non-battle Story-world clusters reduced to minimal/empty stubs instead of full-surface. Nested-type closure (BuildInfo/BattleDialog/ ROOM_URI/FuncGetCantAttackText) placed top-level in their decomp namespaces. Clearing the last View CS0115 unmasked the true member-level frontier: 3916 errors, 0 generated/structural errors, now dominated by Unity-type + god-object members. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
851
SVSim.BattleEngine/Engine/BattleLogTextBuilderAttachSkill.cs
Normal file
851
SVSim.BattleEngine/Engine/BattleLogTextBuilderAttachSkill.cs
Normal file
@@ -0,0 +1,851 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public abstract class BattleLogTextBuilderAttachSkill
|
||||
{
|
||||
private static readonly string COST_MAX = "cost.max";
|
||||
|
||||
private const string OP_INPLAY_UNIT_COUNT = "op.inplay.unit.count";
|
||||
|
||||
private const string ME_INPLAY = "me.inplay";
|
||||
|
||||
private const string ME_HAND = "me.hand";
|
||||
|
||||
private const string ME_INPLAY_UNIT = "me.inplay.unit";
|
||||
|
||||
private const string ME_INPLAY_CLASS_EP = "me.inplay.class.ep";
|
||||
|
||||
private const string ME_HAND_COUNT = "me.hand.count";
|
||||
|
||||
private const string PLAYED_CARD = "played_card";
|
||||
|
||||
private const string ME_INPLAY_SELF = "me.inplay_self.count";
|
||||
|
||||
private const string ME_INPLAY_CLASS_PP = "me.inplay.class.pp";
|
||||
|
||||
private const string ME_TURN_COUNT = "{me.inplay.class.turn}";
|
||||
|
||||
private const string ME_DECK_NOT_DUPLICATION = "me.deck.unique_base_card_id_card";
|
||||
|
||||
public abstract string BuildTextAttachSkill(SkillBase attachedSkill, bool isBuffText, bool isNow);
|
||||
|
||||
public static string _GetSpecificCardCostInformation(SkillBase skill, bool isTarget)
|
||||
{
|
||||
if (isTarget)
|
||||
{
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterCostFilter))
|
||||
{
|
||||
SkillParameterCostFilter skillParameterCostFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterCostFilter) as SkillParameterCostFilter;
|
||||
if (skillParameterCostFilter.GetParameterText().Contains(COST_MAX))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0165");
|
||||
}
|
||||
if (skillParameterCostFilter.GetParameterOptionText() == ">=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0182", skillParameterCostFilter.GetParameterText());
|
||||
}
|
||||
if (skillParameterCostFilter.GetParameterOptionText() == "<=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0230", skillParameterCostFilter.GetParameterText());
|
||||
}
|
||||
}
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterBaseCostFilter))
|
||||
{
|
||||
SkillParameterBaseCostFilter skillParameterBaseCostFilter = skill.ApplyCardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillParameterBaseCostFilter) as SkillParameterBaseCostFilter;
|
||||
if (skillParameterBaseCostFilter.GetParameterOptionText() == "<=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0164", skillParameterBaseCostFilter.GetParameterText());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (skill.ConditionFilterCollection.VariableCompareFilter.Count > 0)
|
||||
{
|
||||
string text = skill.ConditionFilterCollection.VariableCompareFilter.First().Lhs.Trim('{', '}');
|
||||
VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection();
|
||||
SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text, skill.SkillPrm.ownerCard, skill);
|
||||
if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillParameterBaseCostFilter))
|
||||
{
|
||||
SkillParameterBaseCostFilter skillParameterBaseCostFilter2 = variableSkillFilterCollection.CardFilterList.First((ISkillCardFilter f) => f is SkillParameterBaseCostFilter) as SkillParameterBaseCostFilter;
|
||||
if (skillParameterBaseCostFilter2.GetParameterOptionText() == "<=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0164", skillParameterBaseCostFilter2.GetParameterText());
|
||||
}
|
||||
if (skillParameterBaseCostFilter2.GetParameterOptionText() == "=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0194", skillParameterBaseCostFilter2.GetParameterText());
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string _GetCardTypeByFilterList(List<ISkillCardFilter> filters)
|
||||
{
|
||||
if (filters.Any((ISkillCardFilter f) => f is SkillUnitFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0172");
|
||||
}
|
||||
if (filters.Any((ISkillCardFilter f) => f is SkillSpellFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0173");
|
||||
}
|
||||
if (filters.Any((ISkillCardFilter f) => f is SkillChantFieldFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0176");
|
||||
}
|
||||
if (filters.Any((ISkillCardFilter f) => f is SkillFieldFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0175");
|
||||
}
|
||||
if (filters.Any((ISkillCardFilter f) => f is SkillSpellAndFieldFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0183");
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static string _GetSpecificCardType(SkillBase skill, bool isTarget)
|
||||
{
|
||||
if (isTarget)
|
||||
{
|
||||
string text = _GetCardTypeByFilterList(skill.ApplyCardFilterList);
|
||||
if (text != string.Empty)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skill.ConditionCardFilterList.Count > 0)
|
||||
{
|
||||
string text = _GetCardTypeByFilterList(skill.ConditionCardFilterList);
|
||||
if (text != string.Empty)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
if (skill.ConditionFilterCollection.VariableCompareFilter.Count > 0)
|
||||
{
|
||||
string text2 = skill.ConditionFilterCollection.VariableCompareFilter.First().Lhs.Trim('{', '}');
|
||||
VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection();
|
||||
SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text2, skill.SkillPrm.ownerCard, skill);
|
||||
if (variableSkillFilterCollection.CardFilterList.Count > 0)
|
||||
{
|
||||
string text = _GetCardTypeByFilterList(variableSkillFilterCollection.CardFilterList);
|
||||
if (text != string.Empty)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0174");
|
||||
}
|
||||
|
||||
public static string _GetSpecificCardTribeClan(SkillBase skill, bool isTarget)
|
||||
{
|
||||
if (isTarget)
|
||||
{
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillClanFilter))
|
||||
{
|
||||
SkillClanFilter skillClanFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillClanFilter) as SkillClanFilter;
|
||||
string clanNameByKey = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)skillClanFilter._clan);
|
||||
string text = ((skillClanFilter.OptionText == SkillFilterCreator.NOTEQUAL) ? Data.SystemText.Get("BattleLog_0238") : "");
|
||||
return Data.SystemText.Get("BattleLog_0234", clanNameByKey, text);
|
||||
}
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter))
|
||||
{
|
||||
return DataMgr.GetTribeNameByKey((int)(skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillTribeFilter) as SkillTribeFilter)._type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillClanFilter))
|
||||
{
|
||||
SkillClanFilter skillClanFilter2 = skill.ConditionCardFilterList.First((ISkillCardFilter f) => f is SkillClanFilter) as SkillClanFilter;
|
||||
return GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)skillClanFilter2._clan);
|
||||
}
|
||||
if (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter))
|
||||
{
|
||||
return DataMgr.GetTribeNameByKey((int)(skill.ConditionCardFilterList.First((ISkillCardFilter f) => f is SkillTribeFilter) as SkillTribeFilter)._type);
|
||||
}
|
||||
if (skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString())))
|
||||
{
|
||||
string text2 = skill.ConditionFilterCollection.VariableCompareFilter.FirstOrDefault((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString())).Lhs.Trim('{', '}');
|
||||
VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection();
|
||||
SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text2, skill.SkillPrm.ownerCard, skill);
|
||||
ISkillCardFilter skillCardFilter = variableSkillFilterCollection.CardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillTribeFilter);
|
||||
if (skillCardFilter != null)
|
||||
{
|
||||
return DataMgr.GetTribeNameByKey((int)(skillCardFilter as SkillTribeFilter)._type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string _GetSpecificCardException(SkillBase skill)
|
||||
{
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter))
|
||||
{
|
||||
SkillParameterIdFilter skillParameterIdFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter;
|
||||
if (skillParameterIdFilter.GetOptionText() == "!=")
|
||||
{
|
||||
CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First()));
|
||||
return Data.SystemText.Get("BattleLog_0166", cardParameterFromId.CardName);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string _GetSpecificCardTargetCount(SkillBase skill, bool isTarget)
|
||||
{
|
||||
if (!isTarget)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.ApplySelectFilter is SkillRandomSelectFilter)
|
||||
{
|
||||
SkillRandomSelectFilter skillRandomSelectFilter = skill.ApplySelectFilter as SkillRandomSelectFilter;
|
||||
if (!skillRandomSelectFilter.IsContainVariableValue())
|
||||
{
|
||||
int num = int.Parse(skillRandomSelectFilter.Context);
|
||||
if (num >= 1)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0163", num.ToString());
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
if (skill.ApplySelectFilter is SkillUserSelectFilter)
|
||||
{
|
||||
SkillUserSelectFilter skillUserSelectFilter = skill.ApplySelectFilter as SkillUserSelectFilter;
|
||||
return Data.SystemText.Get("BattleLog_0163", skillUserSelectFilter.CalcCount(skill.OptionValue).ToString());
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetLastTargetFilter)
|
||||
{
|
||||
int num2 = skill.SkillPrm.selfBattlePlayer.SkillInfoLastTargets.Count();
|
||||
return Data.SystemText.Get("BattleLog_0163", num2.ToString());
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter)
|
||||
{
|
||||
int num3 = skill.GetDrewCardInHand().Count();
|
||||
return Data.SystemText.Get("BattleLog_0163", num3.ToString());
|
||||
}
|
||||
if (skill.ConditionTargetFilter is SkillTargetPlayedCardFilter)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0171");
|
||||
}
|
||||
|
||||
public static string _GetSpecificCard(SkillBase skill, bool isBuffText, bool isTarget)
|
||||
{
|
||||
string text = _GetSpecificCardCostInformation(skill, isTarget);
|
||||
string text2 = _GetSpecificCardTribeClan(skill, isTarget);
|
||||
string text3 = _GetSpecificCardType(skill, isTarget);
|
||||
if (skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter))
|
||||
{
|
||||
SkillParameterIdFilter skillParameterIdFilter = skill.ApplyCardFilterList.First((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter;
|
||||
if (skillParameterIdFilter.GetOptionText() == SkillFilterCreator.EQUAL)
|
||||
{
|
||||
CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First()));
|
||||
text2 = "";
|
||||
text3 = cardParameterFromId.CardName;
|
||||
}
|
||||
}
|
||||
string text4 = _GetSpecificCardException(skill);
|
||||
string text5 = _GetSpecificCardTargetCount(skill, isTarget);
|
||||
if (isBuffText)
|
||||
{
|
||||
string text6 = string.Empty;
|
||||
if ((isTarget && skill.ApplyCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter)) || (!isTarget && (skill.ConditionCardFilterList.Any((ISkillCardFilter f) => f is SkillTribeFilter) || skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains(SkillFilterCreator.ContentKeyword.tribe.ToString())))))
|
||||
{
|
||||
text6 = Data.SystemText.Get("BattleLog_0252");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0156", text, text2, text3, text4, text5, text6);
|
||||
}
|
||||
string text7 = Data.SystemText.Get("BattleLog_0225");
|
||||
if (text == string.Empty && text2 == string.Empty && text3 == Data.SystemText.Get("BattleLog_0174") && text4 == string.Empty)
|
||||
{
|
||||
text7 = string.Empty;
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0161", text5, text7);
|
||||
}
|
||||
|
||||
public static string _GetSkillTarget(SkillBase skill, bool isBuffText)
|
||||
{
|
||||
if (skill.ApplyFilterCollection.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is OpponentBattlePlayerFilter && f.CardFilterList.Any((ISkillCardFilter c) => c is SkillUnitFilter)) && skill.ApplyFilterCollection.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.BattlePlayerFilter is SelfBattlePlayerFilter && f.CardFilterList.Any((ISkillCardFilter c) => c is SkillClassFilter)))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0147");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetBeAttackedFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0063");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetAttackerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0101");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetFightTargetFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0103");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetSelfFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0064");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetSkillDrewCardFilter)
|
||||
{
|
||||
if (isBuffText)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0118");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0065");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetHandOtherSelfFilter || skill.ApplyingTargetFilter is SkillTargetHandFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0082", _GetSpecificCard(skill, isBuffText, isTarget: true));
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetDeckFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0083", _GetSpecificCard(skill, isBuffText, isTarget: true));
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetSummonedCardFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0093");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetPlayedCardFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0118");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetInPlayFilter)
|
||||
{
|
||||
int num = 0;
|
||||
for (int count = skill.ApplyCardFilterList.Count; num < count; num++)
|
||||
{
|
||||
if (skill.ApplyCardFilterList[num] is SkillClassFilter)
|
||||
{
|
||||
if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0115");
|
||||
}
|
||||
if (skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0004");
|
||||
}
|
||||
}
|
||||
else if (skill.ApplyCardFilterList[num] is SkillUnitAndClassFilter)
|
||||
{
|
||||
if (skill.ApplySelectFilter != null)
|
||||
{
|
||||
if (!(skill.ApplySelectFilter is SkillSelectAllFilter) && !(skill.ApplySelectFilter is SkillSelectNullFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0120");
|
||||
}
|
||||
if (skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0112");
|
||||
}
|
||||
if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0190");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("ApplySelectFilter is not allowed null!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(skill.ApplyCardFilterList[num] is SkillUnitFilter))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (skill.ApplySelectFilter != null)
|
||||
{
|
||||
string text = _ConvertSkillConditionCharacter((skill.ApplyBattlePlayerFilter is OpponentBattlePlayerFilter) ? SkillFilterCreator.ContentKeyword.op.ToStringCustom() : SkillFilterCreator.ContentKeyword.me.ToStringCustom());
|
||||
if (!(skill.ApplySelectFilter is SkillSelectAllFilter) && !(skill.ApplySelectFilter is SkillSelectNullFilter))
|
||||
{
|
||||
string text2 = _GetSkillTargetCount(skill);
|
||||
int result = -1;
|
||||
int.TryParse(text2, out result);
|
||||
return Data.SystemText.Get("BattleLog_0133", text2, text);
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0124", text);
|
||||
}
|
||||
Debug.LogError("ApplySelectFilter is not allowed null!");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetInPlayOtherSelfFilter)
|
||||
{
|
||||
if (skill.ApplySelectFilter is SkillRandomSelectFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0146");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0121");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetLastTargetFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0118");
|
||||
}
|
||||
if (skill.ApplyingTargetFilter is SkillTargetInplaySelfAndClassFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0214");
|
||||
}
|
||||
if (!(skill.ApplyingTargetFilter is SkillTargetTokenDrawCardFilter))
|
||||
{
|
||||
_ = skill.ApplyingTargetFilter is SkillTargetReturnCardFilter;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string _GetSkillPeriod(SkillBase skill, bool isNow)
|
||||
{
|
||||
if (skill.PreprocessList.FirstOrDefault((SkillPreprocessBase pre) => pre is SkillPreprocessInPlayPeriodOfTime) is SkillPreprocessInPlayPeriodOfTime)
|
||||
{
|
||||
if (isNow)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0091");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0159");
|
||||
}
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillPreprocessTurnStartStop && (a as SkillPreprocessTurnStartStop).Target == "op"))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0189");
|
||||
}
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillConditionTurn && (a as SkillConditionTurn).judgeFlg))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0126");
|
||||
}
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillPreprocessTurnEndStop))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0215");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _GetSkillTiming(SkillBase skill, bool isBuffText)
|
||||
{
|
||||
if (skill.IsWhenPlaySkill)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.IsWhenDestroySkill)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0066");
|
||||
}
|
||||
if (skill.IsBeforAttackSkill || skill.IsBeforeAttackSelfAndOtherSkill)
|
||||
{
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionAttackerIsOther))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0192");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0067");
|
||||
}
|
||||
if (skill.OnAfterAttackStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0254");
|
||||
}
|
||||
if (skill.IsWhenFightSkill)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0102");
|
||||
}
|
||||
if (skill.OnSelfTurnStartStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0068");
|
||||
}
|
||||
if (skill.OnSelfTurnEndStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0069");
|
||||
}
|
||||
if (skill.OnWhenSummonOtherStart != 0)
|
||||
{
|
||||
if (skill.ApplyBattlePlayerFilter is SelfBattlePlayerFilter)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0092", _GetSpecificCard(skill, isBuffText, isTarget: false));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
if (skill.OnWhenPlayOtherStart != 0)
|
||||
{
|
||||
if (skill.ConditionTargetFilter is SkillTargetPlayedCardFilter && skill.ConditionCardFilterList.Any((ISkillCardFilter c) => c is SkillSpellFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0108");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0117", _GetSpecificCard(skill, isBuffText, isTarget: false));
|
||||
}
|
||||
if (skill.OnWhenDamageStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0127");
|
||||
}
|
||||
if (skill.OnWhenDestroyOtherStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0257", _GetSpecificCard(skill, isBuffText, isTarget: false));
|
||||
}
|
||||
if (skill.OnWhenDamageStart != 0 && skill.ConditionCheckerList.Any((ISkillConditionChecker c) => c is SkillConditionTurn))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.OnWhenDrawOtherStart != 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.OnWhenPpHealStart != 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.OnOpponentTurnEndStart != 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.OnWhenReturnOtherStart != 0)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0264");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _GetSkillTargetCount(SkillBase skill)
|
||||
{
|
||||
if (skill.ApplySelectFilter != null)
|
||||
{
|
||||
return skill.ApplySelectFilter.CalcCount(skill.OptionValue).ToString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _GetSkillPreProcessText(SkillBase skill)
|
||||
{
|
||||
SkillPreprocessBase skillPreprocessBase = skill.PreprocessList.FirstOrDefault((SkillPreprocessBase s) => s is SkillPreprocessUsePp);
|
||||
if (skillPreprocessBase != null)
|
||||
{
|
||||
int consumeValue = (skillPreprocessBase as SkillPreprocessUsePp).ConsumeValue;
|
||||
return Data.SystemText.Get("BattleLog_0236", consumeValue.ToString());
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionSetCost(SkillBase skill)
|
||||
{
|
||||
int num = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.set, int.MinValue);
|
||||
int num2 = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add, int.MinValue);
|
||||
if (num != int.MinValue)
|
||||
{
|
||||
return num.ToString();
|
||||
}
|
||||
if (num2 != int.MinValue)
|
||||
{
|
||||
return num2.ToString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _GetSkillDetailCondition(SkillBase skill)
|
||||
{
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionResonance) && (skill.ConditionCheckerList.First((ISkillConditionChecker f) => f is SkillConditionResonance) as SkillConditionResonance).judgeFlg)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0169");
|
||||
}
|
||||
List<SkillVariableComareFilter> variableCompareFilter = skill.ConditionFilterCollection.VariableCompareFilter;
|
||||
if (variableCompareFilter.Count > 0)
|
||||
{
|
||||
SkillVariableComareFilter skillVariableComareFilter = variableCompareFilter.First();
|
||||
string compare = skillVariableComareFilter.Compare;
|
||||
string text = skillVariableComareFilter.Lhs.Trim('{', '}');
|
||||
VariableSkillFilterCollection variableSkillFilterCollection = new VariableSkillFilterCollection();
|
||||
SkillFilterCreator.SetupVariable(variableSkillFilterCollection, text, skill.SkillPrm.ownerCard, skill);
|
||||
if (text.Contains("me.deck.unique_base_card_id_card"))
|
||||
{
|
||||
if (compare == "=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0260");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0259");
|
||||
}
|
||||
if (text.Contains("op.inplay.unit.count"))
|
||||
{
|
||||
string rhs = skillVariableComareFilter.Rhs;
|
||||
if (compare == ">" && rhs == "0")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0158");
|
||||
}
|
||||
if (compare == "=" && rhs == "0")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0181");
|
||||
}
|
||||
}
|
||||
else if (variableSkillFilterCollection.CardCountFilter != null && variableSkillFilterCollection.BattlePlayerFilter is SelfBattlePlayerFilter)
|
||||
{
|
||||
string rhs2 = skillVariableComareFilter.Rhs;
|
||||
if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillParameterIdFilter))
|
||||
{
|
||||
SkillParameterIdFilter skillParameterIdFilter = variableSkillFilterCollection.CardFilterList.FirstOrDefault((ISkillCardFilter f) => f is SkillParameterIdFilter) as SkillParameterIdFilter;
|
||||
string cardName = CardMaster.GetInstanceForBattle().GetCardParameterFromId(int.Parse(skillParameterIdFilter.GetFilterId().First())).CardName;
|
||||
if (variableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains("me.inplay") && f.Rhs == "0") && variableCompareFilter.Any((SkillVariableComareFilter f) => f.Lhs.Contains("me.hand") && f.Rhs == "0"))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0193", cardName, Data.SystemText.Get("BattleLog_0177"));
|
||||
}
|
||||
if (compare == "=" && rhs2 == "0")
|
||||
{
|
||||
string text2 = Data.SystemText.Get("BattleLog_0205");
|
||||
if (variableSkillFilterCollection.TargetFilter is SkillTargetHandFilter)
|
||||
{
|
||||
text2 = Data.SystemText.Get("BattleLog_0206");
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0193", cardName, text2);
|
||||
}
|
||||
}
|
||||
if (compare == ">" && rhs2 == "0")
|
||||
{
|
||||
if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillFieldFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0149");
|
||||
}
|
||||
if (variableSkillFilterCollection.CardFilterList.Any((ISkillCardFilter f) => f is SkillUnitFilter))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0148");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (variableSkillFilterCollection.ParameterSelectFilter is SkillParameterTurnDamageValueFilter)
|
||||
{
|
||||
int num = int.Parse(skillVariableComareFilter.Rhs.ToString());
|
||||
if (compare == ">=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0197", num.ToString());
|
||||
}
|
||||
if (compare == "<")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0198", (num - 1).ToString());
|
||||
}
|
||||
}
|
||||
if (text.Contains("me.hand.count"))
|
||||
{
|
||||
string rhs3 = skillVariableComareFilter.Rhs;
|
||||
switch (compare)
|
||||
{
|
||||
case "<=":
|
||||
return Data.SystemText.Get("BattleLog_0187", rhs3);
|
||||
case "<":
|
||||
{
|
||||
int num3 = int.Parse(rhs3) - 1;
|
||||
return Data.SystemText.Get("BattleLog_0187", num3.ToString());
|
||||
}
|
||||
case ">=":
|
||||
return Data.SystemText.Get("BattleLog_0188", rhs3);
|
||||
case ">":
|
||||
{
|
||||
int num2 = int.Parse(rhs3) + 1;
|
||||
return Data.SystemText.Get("BattleLog_0188", num2.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text.Contains("me.inplay.class.ep"))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0177");
|
||||
}
|
||||
if (variableSkillFilterCollection.BattlePlayerFilter != null && variableSkillFilterCollection.TargetFilter is SkillTargetInPlayFilter && variableSkillFilterCollection.CardFilterList.Count > 0 && variableSkillFilterCollection.CardCountFilter != null)
|
||||
{
|
||||
string[] array = text.Split('.');
|
||||
string text3 = _ConvertSkillConditionCharacter(array[0]);
|
||||
string text4 = _ConvertSkillConditionTarget(array[1]);
|
||||
string text5 = _ConvertSkillConditionCardType(array[2]);
|
||||
string rhs4 = skillVariableComareFilter.Rhs;
|
||||
switch (compare)
|
||||
{
|
||||
case "=":
|
||||
return Data.SystemText.Get("BattleLog_0200", text3, text4, text5, rhs4);
|
||||
case ">=":
|
||||
return Data.SystemText.Get("BattleLog_0209", text3, text4, text5, rhs4);
|
||||
case "<=":
|
||||
return Data.SystemText.Get("BattleLog_0210", text3, text4, text5, rhs4);
|
||||
}
|
||||
}
|
||||
if (text.Contains("me.inplay.class.pp"))
|
||||
{
|
||||
string rhs5 = skillVariableComareFilter.Rhs;
|
||||
if (compare != null && compare == ">=")
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0235", rhs5);
|
||||
}
|
||||
}
|
||||
if (text.Contains(SkillFilterCreator.ContentKeyword.turn_play_cards.ToString()))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0191", skillVariableComareFilter.Rhs, _GetSpecificCard(skill, isBuffText: true, isTarget: false));
|
||||
}
|
||||
}
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionTurn) && (skill.ConditionCheckerList.First((ISkillConditionChecker f) => f is SkillConditionTurn) as SkillConditionTurn).judgeFlg)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0126");
|
||||
}
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker s) => s is SkillConditionPlayCount))
|
||||
{
|
||||
SkillConditionPlayCount skillConditionPlayCount = (SkillConditionPlayCount)skill.ConditionCheckerList.First((ISkillConditionChecker s) => s is SkillConditionPlayCount);
|
||||
return Data.SystemText.Get("BattleLog_0191", skillConditionPlayCount.GetCount().ToString(), _GetSpecificCard(skill, isBuffText: true, isTarget: false));
|
||||
}
|
||||
if (skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessTimesPerTurn && (p as SkillPreprocessTimesPerTurn).GetLimitCount() == 1))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0196");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _CombineSkillCondition(SkillBase skill, string condition)
|
||||
{
|
||||
if (skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessDestroyTribe && (p as SkillPreprocessDestroyTribe).IsWhiteRitual))
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0178", condition);
|
||||
}
|
||||
SkillVariableComareFilter skillVariableComareFilter = skill.ConditionFilterCollection.VariableCompareFilter.FirstOrDefault((SkillVariableComareFilter f) => f.Lhs == "{me.inplay.class.turn}");
|
||||
if (skillVariableComareFilter != null)
|
||||
{
|
||||
int num = int.Parse(skillVariableComareFilter.Rhs);
|
||||
return Data.SystemText.Get("BattleLog_0150", num.ToString(), condition);
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
||||
protected static string _GetSkillCondition(SkillBase skill, bool isBuffText)
|
||||
{
|
||||
if (skill.ConditionCheckerList.Any((ISkillConditionChecker a) => a is SkillConditionTurn && (a as SkillConditionTurn).judgeFlg))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (skill.ConditionCardFilterList.Any((ISkillCardFilter s) => s is SkillAllCardFilter || s is SkillUnitFilter || s is SkillClassFilter || s is SkillFieldFilter || s is SkillChantFieldFilter || s is SkillNotChantFieldFilter || s is SkillSpellFilter || s is SkillUnitAndClassFilter || s is SkillUnitAndAllFieldFilter || s is SkillSpellAndFieldFilter) && !skill.ConditionFilterCollection.VariableCompareFilter.Any((SkillVariableComareFilter f) => !f.Lhs.Contains("played_card") && !f.Lhs.Contains("me.inplay_self.count")) && !skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessTimesPerTurn && (p as SkillPreprocessTimesPerTurn).GetLimitCount() == 1) && !skill.ConditionCheckerList.Any((ISkillConditionChecker f) => f is SkillConditionResonance || f is SkillConditionHalfLife || f is SkillConditionTurn || f is SkillPreprocessDestroyTribe || f is SkillConditionPlayCount))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (isBuffText)
|
||||
{
|
||||
return _CombineSkillCondition(skill, _GetSkillDetailCondition(skill));
|
||||
}
|
||||
return Data.SystemText.Get("BattleLog_0113");
|
||||
}
|
||||
|
||||
public static string _ConvertSkillConditionCharacter(string character)
|
||||
{
|
||||
if (!SkillFilterCreator.PLAYER_FILTER_NAMES.Contains(character))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return SkillFilterCreator.Str2ContentKeyword(character) switch
|
||||
{
|
||||
SkillFilterCreator.ContentKeyword.me => Data.SystemText.Get("BattleLog_0218"),
|
||||
SkillFilterCreator.ContentKeyword.op => Data.SystemText.Get("BattleLog_0219"),
|
||||
SkillFilterCreator.ContentKeyword.both => Data.SystemText.Get("BattleLog_0208"),
|
||||
_ => "",
|
||||
};
|
||||
}
|
||||
|
||||
protected static string _ConvertSkillConditionTarget(string target)
|
||||
{
|
||||
if (!SkillFilterCreator.PLAYER_TARGET_FILTER_NAMES.Contains(target))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return SkillFilterCreator.Str2ContentKeyword(target) switch
|
||||
{
|
||||
SkillFilterCreator.ContentKeyword.inplay => Data.SystemText.Get("BattleLog_0205"),
|
||||
SkillFilterCreator.ContentKeyword.hand => Data.SystemText.Get("BattleLog_0206"),
|
||||
SkillFilterCreator.ContentKeyword.deck => Data.SystemText.Get("BattleLog_0207"),
|
||||
_ => "",
|
||||
};
|
||||
}
|
||||
|
||||
protected static string _ConvertSkillConditionCardType(string cardType)
|
||||
{
|
||||
if (!SkillFilterCreator.CARD_TYPE_FILTER_NAMES.Contains(cardType))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return SkillFilterCreator.Str2ContentKeyword(cardType) switch
|
||||
{
|
||||
SkillFilterCreator.ContentKeyword.unit => Data.SystemText.Get("BattleLog_0172"),
|
||||
SkillFilterCreator.ContentKeyword.spell => Data.SystemText.Get("BattleLog_0173"),
|
||||
SkillFilterCreator.ContentKeyword.field => Data.SystemText.Get("BattleLog_0175"),
|
||||
SkillFilterCreator.ContentKeyword.chant_field => Data.SystemText.Get("BattleLog_0176"),
|
||||
_ => "",
|
||||
};
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionDamage(SkillBase skill)
|
||||
{
|
||||
return Mathf.Max(0, skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.damage, 0)).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionAddDamage(SkillBase skill)
|
||||
{
|
||||
int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_damage, 0);
|
||||
return Mathf.Max(0, b).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionDamageCut(SkillBase skill)
|
||||
{
|
||||
int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.cut_amount, 0);
|
||||
return Mathf.Max(0, b).ToString();
|
||||
}
|
||||
|
||||
protected static int _GetSkillOptionDamageClipping(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.cut_clipping, int.MaxValue);
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionHealing(SkillBase skill)
|
||||
{
|
||||
int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.healing, 0);
|
||||
return Mathf.Max(0, b).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionAddPp(SkillBase skill)
|
||||
{
|
||||
int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_pp, 0);
|
||||
return Mathf.Max(0, b).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionAddOffense(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_offense, 0).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionAddLife(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_life, 0).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionMultiplyOffense(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.multiply_offense, 1).ToString();
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionMultiplyLife(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.multiply_life, 1).ToString();
|
||||
}
|
||||
|
||||
protected static int _GetSkillOptionLifeLowerLimit(SkillBase skill)
|
||||
{
|
||||
return skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.life_lower_limit, 0);
|
||||
}
|
||||
|
||||
protected static string _GetSkillCallCount(SkillBase skill)
|
||||
{
|
||||
int callCount = skill.CallCount;
|
||||
if (callCount >= 2)
|
||||
{
|
||||
return Data.SystemText.Get("BattleLog_0114", callCount.ToString());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static string _GetSkillOptionAddEp(SkillBase skill)
|
||||
{
|
||||
int b = skill.OptionValue.GetInt(SkillFilterCreator.ContentKeyword.add_ep, 0);
|
||||
return Mathf.Max(0, b).ToString();
|
||||
}
|
||||
}
|
||||
129
SVSim.BattleEngine/Engine/EnemyChoiceBraveButtonUI.cs
Normal file
129
SVSim.BattleEngine/Engine/EnemyChoiceBraveButtonUI.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class EnemyChoiceBraveButtonUI : UIBase
|
||||
{
|
||||
private const int CHOICE_BRAVE_BUTTON_HEIGHT = 135;
|
||||
|
||||
private const int CHOICE_BRAVE_BUTTON_WEIGHT = 135;
|
||||
|
||||
private const string CHOICE_BRAVE_BUTTON_ON_SPRITE_NAME = "battle_icon_hero_enemy_on";
|
||||
|
||||
private const string CHOICE_BRAVE_BUTTON_OFF_SPRITE_NAME = "battle_icon_hero_enemy_off";
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _choiceBraveButtonSprite;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _bpLabel;
|
||||
|
||||
private const float HIDE_OFFSET = 450f;
|
||||
|
||||
private const float SHOW_OFFSET = 350f;
|
||||
|
||||
public Vector3 BPLabelPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(_bpLabel != null))
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
return _bpLabel.transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowButton(bool isNewReplay)
|
||||
{
|
||||
if (isNewReplay)
|
||||
{
|
||||
MoveHbpButtonAnchor(Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y);
|
||||
return;
|
||||
}
|
||||
MoveHbpButtonAnchor(200f);
|
||||
base.gameObject.SetActive(value: true);
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", 200, "to", Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y, "time", 0.5f, "delay", 0.1f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo));
|
||||
}
|
||||
|
||||
public void HideButton()
|
||||
{
|
||||
UpdateSprite();
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", Global.ENEMY_CHOICE_BRAVE_BUTTON_POSITION.y, "to", 200, "time", 0.5f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo));
|
||||
}
|
||||
|
||||
public void UpdateSprite()
|
||||
{
|
||||
if (BattleManagerBase.GetIns().BattleEnemy.CanChoiceBraveThisTurn)
|
||||
{
|
||||
EnablePulsateEffectAndSprite();
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_enemy_on";
|
||||
}
|
||||
else
|
||||
{
|
||||
DisablePulsateEffectAndSprite();
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_enemy_off";
|
||||
}
|
||||
}
|
||||
|
||||
public void EnablePulsateEffectAndSprite()
|
||||
{
|
||||
GameMgr ins = GameMgr.GetIns();
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_on";
|
||||
if (!ins.IsAdminWatch || !BattleManagerBase.GetIns().BattleEnemy.CanChoiceBrave)
|
||||
{
|
||||
ins.GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1);
|
||||
return;
|
||||
}
|
||||
Effect effect = ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_1, base.transform.position, base.gameObject);
|
||||
if (effect != null)
|
||||
{
|
||||
effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisablePulsateEffectAndSprite()
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1);
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_off";
|
||||
}
|
||||
|
||||
private int SetYtoBottomAnchor(int posY)
|
||||
{
|
||||
int num = Mathf.FloorToInt(67f);
|
||||
return posY - num;
|
||||
}
|
||||
|
||||
private int SetYtoTopAnchor(int posY)
|
||||
{
|
||||
int num = 67;
|
||||
return posY + num;
|
||||
}
|
||||
|
||||
public void SetHbpButtonAnchor(float posX, float posY, float posZ, GameObject container)
|
||||
{
|
||||
base.transform.localPosition = new Vector3(posX, posY, posZ);
|
||||
UIWidget component = GetComponent<UIWidget>();
|
||||
component.bottomAnchor.target = container.transform;
|
||||
component.topAnchor.target = container.transform;
|
||||
component.bottomAnchor.relative = 1f;
|
||||
component.bottomAnchor.absolute = SetYtoBottomAnchor((int)posY);
|
||||
component.topAnchor.relative = 1f;
|
||||
component.topAnchor.absolute = SetYtoTopAnchor((int)posY);
|
||||
component.UpdateAnchors();
|
||||
}
|
||||
|
||||
public void MoveHbpButtonAnchor(float posY)
|
||||
{
|
||||
UIWidget component = GetComponent<UIWidget>();
|
||||
int num = (int)posY;
|
||||
component.bottomAnchor.relative = 1f;
|
||||
component.bottomAnchor.absolute = SetYtoBottomAnchor(num);
|
||||
component.topAnchor.relative = 1f;
|
||||
component.topAnchor.absolute = SetYtoTopAnchor(num);
|
||||
component.UpdateAnchors();
|
||||
}
|
||||
|
||||
public void SetBp(int num)
|
||||
{
|
||||
_bpLabel.text = num.ToString();
|
||||
}
|
||||
}
|
||||
180
SVSim.BattleEngine/Engine/PlayerChoiceBraveButtonUI.cs
Normal file
180
SVSim.BattleEngine/Engine/PlayerChoiceBraveButtonUI.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerChoiceBraveButtonUI : UIBase
|
||||
{
|
||||
private const int CHOICE_BRAVE_BUTTON_HEIGHT = 155;
|
||||
|
||||
private const int CHOICE_BRAVE_BUTTON_WEIGHT = 155;
|
||||
|
||||
private const string CHOICE_BRAVE_BUTTON_ON_SPRITE_NAME = "battle_icon_hero_player_on";
|
||||
|
||||
private const string CHOICE_BRAVE_BUTTON_OFF_SPRITE_NAME = "battle_icon_hero_player_off";
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _choiceBraveButtonSprite;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _bpLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIWidget _choiceBraveButtonWidget;
|
||||
|
||||
private bool isFocus;
|
||||
|
||||
private const float HIDE_OFFSET = 450f;
|
||||
|
||||
private const float SHOW_OFFSET_DOWN = 400f;
|
||||
|
||||
private const float SHOW_OFFSET_FORWARD = 50f;
|
||||
|
||||
public Vector3 BPLabelPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!(_bpLabel != null))
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
return _bpLabel.transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowButton(bool isNewReplay)
|
||||
{
|
||||
if (isNewReplay)
|
||||
{
|
||||
MoveHbpButtonAnchor(isFocus ? Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM.y : Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION.y);
|
||||
return;
|
||||
}
|
||||
MoveHbpButtonAnchor(-200f);
|
||||
base.gameObject.SetActive(value: true);
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", -200, "to", Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION.y, "time", 0.5f, "delay", 0.1f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo));
|
||||
}
|
||||
|
||||
public void HideButton()
|
||||
{
|
||||
Vector3 vector = (isFocus ? Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM : Global.PLAYER_CHOICE_BRAVE_BUTTON_POSITION);
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", vector.y, "to", -200, "time", 0.5f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeInOutExpo));
|
||||
}
|
||||
|
||||
public Transform GetButtonTransform()
|
||||
{
|
||||
return base.transform;
|
||||
}
|
||||
|
||||
public void EnablePulsateEffect()
|
||||
{
|
||||
GameMgr ins = GameMgr.GetIns();
|
||||
if (!BattleManagerBase.GetIns().BattlePlayer.CanChoiceBrave)
|
||||
{
|
||||
ins.GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1);
|
||||
return;
|
||||
}
|
||||
Effect effect = ins.GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_1, GetButtonTransform().position, base.gameObject);
|
||||
if (effect != null)
|
||||
{
|
||||
effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisablePulsateEffect()
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_1);
|
||||
}
|
||||
|
||||
public void UpdatePulsateEffectAndSprite()
|
||||
{
|
||||
if (BattleManagerBase.GetIns().BattlePlayer.CanChoiceBraveThisTurn)
|
||||
{
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_on";
|
||||
EnablePulsateEffect();
|
||||
}
|
||||
else
|
||||
{
|
||||
_choiceBraveButtonSprite.spriteName = "battle_icon_hero_player_off";
|
||||
DisablePulsateEffect();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateActivatingEffect(bool isActivating)
|
||||
{
|
||||
if (isActivating)
|
||||
{
|
||||
Effect effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_HEROSKILL_2, GetButtonTransform().position, base.gameObject);
|
||||
if (effect != null)
|
||||
{
|
||||
effect.gameObject.SetLayer(base.gameObject.layer, isSetChildren: true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_UI_HEROSKILL_2);
|
||||
}
|
||||
}
|
||||
|
||||
private int SetYtoBottomAnchor(int posY)
|
||||
{
|
||||
int num = Mathf.FloorToInt(77f);
|
||||
return posY - num;
|
||||
}
|
||||
|
||||
private int SetYtoTopAnchor(int posY)
|
||||
{
|
||||
int num = 77;
|
||||
return posY + num;
|
||||
}
|
||||
|
||||
private float GetCenterAnchorPosY()
|
||||
{
|
||||
float num = 77f;
|
||||
return (float)_choiceBraveButtonWidget.bottomAnchor.absolute + num;
|
||||
}
|
||||
|
||||
public void MoveFocus(float beforePosY, float afterPosY)
|
||||
{
|
||||
if (beforePosY < afterPosY)
|
||||
{
|
||||
if (isFocus)
|
||||
{
|
||||
return;
|
||||
}
|
||||
isFocus = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isFocus)
|
||||
{
|
||||
return;
|
||||
}
|
||||
isFocus = false;
|
||||
}
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", GetCenterAnchorPosY(), "to", afterPosY, "time", 0.2f, "onupdate", "MoveHbpButtonAnchor", "easetype", iTween.EaseType.easeOutQuad));
|
||||
}
|
||||
|
||||
public void SetHbpButtonAnchor(float posX, float posY, float posZ, GameObject container)
|
||||
{
|
||||
base.transform.localPosition = new Vector3(posX, posY, posZ);
|
||||
_choiceBraveButtonWidget.bottomAnchor.target = container.transform;
|
||||
_choiceBraveButtonWidget.topAnchor.target = container.transform;
|
||||
_choiceBraveButtonWidget.bottomAnchor.relative = 0f;
|
||||
_choiceBraveButtonWidget.bottomAnchor.absolute = SetYtoBottomAnchor((int)posY);
|
||||
_choiceBraveButtonWidget.topAnchor.relative = 0f;
|
||||
_choiceBraveButtonWidget.topAnchor.absolute = SetYtoTopAnchor((int)posY);
|
||||
_choiceBraveButtonWidget.UpdateAnchors();
|
||||
}
|
||||
|
||||
public void MoveHbpButtonAnchor(float posY)
|
||||
{
|
||||
int num = (int)posY;
|
||||
_choiceBraveButtonWidget.bottomAnchor.relative = 0f;
|
||||
_choiceBraveButtonWidget.bottomAnchor.absolute = SetYtoBottomAnchor(num);
|
||||
_choiceBraveButtonWidget.topAnchor.relative = 0f;
|
||||
_choiceBraveButtonWidget.topAnchor.absolute = SetYtoTopAnchor(num);
|
||||
_choiceBraveButtonWidget.UpdateAnchors();
|
||||
}
|
||||
|
||||
public void SetBp(int num)
|
||||
{
|
||||
_bpLabel.text = num.ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
namespace Wizard.Battle.Player.ClassCharacter;
|
||||
|
||||
public class PlayerClassCharacter
|
||||
{
|
||||
public ClassCharacterBase _class { get; protected set; }
|
||||
|
||||
public PlayerClassCharacter(bool isPlayer)
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
if (isPlayer)
|
||||
{
|
||||
if (dataMgr.Is3DSkin(isPlayer))
|
||||
{
|
||||
_class = new Player3dClassCharacter(dataMgr.GetPlayerSkinId());
|
||||
}
|
||||
else if (dataMgr.IsHighRankSkinPlayer())
|
||||
{
|
||||
_class = new PlayerHighRankSpineClassCharacter();
|
||||
}
|
||||
else
|
||||
{
|
||||
_class = new PlayerSpineClassCharacter();
|
||||
}
|
||||
}
|
||||
else if (dataMgr.Is3DSkin(isPlayer))
|
||||
{
|
||||
_class = new Enemy3dClassCharacter(dataMgr.GetEnemySkinId());
|
||||
}
|
||||
else if (dataMgr.IsHighRankSkinEnemy())
|
||||
{
|
||||
_class = new EnemyHighRankSpineClassCharacter();
|
||||
}
|
||||
else
|
||||
{
|
||||
_class = new EnemySpineClassCharacter();
|
||||
}
|
||||
}
|
||||
|
||||
public void OutFrame()
|
||||
{
|
||||
_class.OutFrame();
|
||||
}
|
||||
|
||||
public void IntoFrame()
|
||||
{
|
||||
_class.IntoFrame();
|
||||
}
|
||||
|
||||
public float GetCurrentClipTime()
|
||||
{
|
||||
return _class.GetCurrentClipTime();
|
||||
}
|
||||
|
||||
public bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType)
|
||||
{
|
||||
return _class.GetCurrentClipIsName(motionType);
|
||||
}
|
||||
|
||||
public void ClearSpineObject()
|
||||
{
|
||||
_class.ClearResourceObject();
|
||||
}
|
||||
}
|
||||
98
SVSim.BattleEngine/Engine/Wizard/LoadTask.cs
Normal file
98
SVSim.BattleEngine/Engine/Wizard/LoadTask.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class LoadTask : BaseTask
|
||||
{
|
||||
public enum AccountDeleteStatus
|
||||
{
|
||||
NONE,
|
||||
CAN_RESET_RESERVE,
|
||||
CAN_NOT_RESET_RESERVE
|
||||
}
|
||||
|
||||
public class LoadTaskParam : BaseParam
|
||||
{
|
||||
public string carrier = "";
|
||||
|
||||
public string card_master_hash = "";
|
||||
}
|
||||
|
||||
public LoadDetail LoadDetailInstance { get; private set; }
|
||||
|
||||
public AccountDeleteStatus DeleteStatus { get; private set; }
|
||||
|
||||
public string DeleteLimitDate { get; private set; }
|
||||
|
||||
public LoadTask()
|
||||
{
|
||||
base.type = ApiType.Type.Load;
|
||||
}
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
LoadTaskParam loadTaskParam = new LoadTaskParam();
|
||||
loadTaskParam.carrier = Toolbox.DeviceManager.GetCarrier();
|
||||
loadTaskParam.card_master_hash = CardMasterLocalFileUtility.GetCardMasterHash();
|
||||
base.Params = loadTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
if (jsonData.Keys.Contains("account_delete_reservation_status"))
|
||||
{
|
||||
DeleteStatus = (AccountDeleteStatus)jsonData["account_delete_reservation_status"].ToInt();
|
||||
double timeLimitUnixTime = ConvertTime.DateTimeToUnixTime(DateTime.Parse(jsonData["account_delete_reservation_cancelable_deadline"].ToString()));
|
||||
double nowUnixTime = base.ResponseData["data_headers"]["servertime"].ToDouble();
|
||||
DeleteLimitDate = GetLateTime(timeLimitUnixTime, nowUnixTime);
|
||||
return num;
|
||||
}
|
||||
LoadDetailInstance = new LoadDetail();
|
||||
Data.Load.data = LoadDetailInstance;
|
||||
Data.Load.data.ConvertJsonData(base.ResponseData);
|
||||
return num;
|
||||
}
|
||||
|
||||
private static string GetLateTime(double timeLimitUnixTime, double nowUnixTime)
|
||||
{
|
||||
double num = timeLimitUnixTime - nowUnixTime;
|
||||
if (num < 0.0)
|
||||
{
|
||||
num = 0.0;
|
||||
}
|
||||
int num2 = 0;
|
||||
if (num >= 86400.0)
|
||||
{
|
||||
num2 = (int)(num / 86400.0);
|
||||
}
|
||||
int num3 = 0;
|
||||
if (num >= 3600.0)
|
||||
{
|
||||
num3 = (int)(num / 3600.0);
|
||||
num3 %= 24;
|
||||
}
|
||||
int num4 = 0;
|
||||
if (num >= 60.0)
|
||||
{
|
||||
num4 = (int)(num / 60.0);
|
||||
num4 %= 60;
|
||||
}
|
||||
if (num >= 86400.0)
|
||||
{
|
||||
return Data.SystemText.Get("System_0065", num2.ToString(), num3.ToString(), num4.ToString());
|
||||
}
|
||||
if (num >= 3600.0)
|
||||
{
|
||||
return Data.SystemText.Get("System_0066", num3.ToString(), num4.ToString());
|
||||
}
|
||||
return Data.SystemText.Get("System_0067", num4.ToString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user