feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
This commit is contained in:
166
SVSim.BattleEngine/Engine/AchievedInfo.cs
Normal file
166
SVSim.BattleEngine/Engine/AchievedInfo.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
using Wizard.Lottery;
|
||||
|
||||
public class AchievedInfo
|
||||
{
|
||||
private const string ACHIEVEMENT = "achieved_achievement_list";
|
||||
|
||||
private const string MISSION = "achieved_mission_list";
|
||||
|
||||
private const string REWARD = "achieved_mission_reward_list";
|
||||
|
||||
private const string VICTORY_REWARD = "win_reward_list";
|
||||
|
||||
private const string GRAND_MASTER_REWARD = "grand_master_reward_list";
|
||||
|
||||
private const string MISSION_START = "mission_start_data";
|
||||
|
||||
private const string BEGINNER_MISSION_REWARD = "achieved_beginner_mission_reward_list";
|
||||
|
||||
private const string BEGINNER_MISSION_REWARD_MESSAGE = "achieved_beginner_mission_list";
|
||||
|
||||
private const string BATTLE_PASS_REWARD_LIST = "battle_pass_reward_list";
|
||||
|
||||
private const string BATTLE_PASS_MESSAGE_LIST = "battle_pass_message_list";
|
||||
|
||||
private const long DONT_NOTIFY_IF_SMALLER_THAN_SECONDS = 10L;
|
||||
|
||||
public List<UserMission> _missions;
|
||||
|
||||
public List<UserAchievement> _achievements;
|
||||
|
||||
public List<ReceivedReward> _rewards;
|
||||
|
||||
public List<ReceivedReward> _victoryRewards;
|
||||
|
||||
public LotteryApplyData _lotteryData = LotteryApplyData.EmptyData();
|
||||
|
||||
public AchievedInfo()
|
||||
{
|
||||
_missions = new List<UserMission>();
|
||||
_achievements = new List<UserAchievement>();
|
||||
_rewards = new List<ReceivedReward>();
|
||||
_victoryRewards = new List<ReceivedReward>();
|
||||
}
|
||||
|
||||
public AchievedInfo(JsonData data)
|
||||
: this()
|
||||
{
|
||||
Read(data);
|
||||
}
|
||||
|
||||
public void Read(JsonData data)
|
||||
{
|
||||
if (data.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (data.Keys.Contains("achieved_mission_list"))
|
||||
{
|
||||
JsonData jsonData = data["achieved_mission_list"];
|
||||
if (jsonData != null)
|
||||
{
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
_missions.Add(UserMission.CreateAchievedMission(jsonData[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("achieved_achievement_list"))
|
||||
{
|
||||
JsonData jsonData2 = data["achieved_achievement_list"];
|
||||
if (jsonData2 != null)
|
||||
{
|
||||
for (int j = 0; j < jsonData2.Count; j++)
|
||||
{
|
||||
UserAchievement userAchievement = UserAchievement.CreateCompletedAchievement(jsonData2[j]);
|
||||
if (!string.IsNullOrEmpty(userAchievement.OsId))
|
||||
{
|
||||
AchievementImpl.instance.ReleaseAchievement(userAchievement.OsId);
|
||||
}
|
||||
_achievements.Add(userAchievement);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("grand_master_reward_list"))
|
||||
{
|
||||
JsonData jsonData3 = data["grand_master_reward_list"];
|
||||
if (jsonData3 != null)
|
||||
{
|
||||
for (int k = 0; k < jsonData3.Count; k++)
|
||||
{
|
||||
_rewards.Add(ReceivedReward.CreateFromBattleResultGrandMaster(jsonData3[k]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("achieved_mission_reward_list"))
|
||||
{
|
||||
JsonData jsonData4 = data["achieved_mission_reward_list"];
|
||||
if (jsonData4 != null)
|
||||
{
|
||||
for (int l = 0; l < jsonData4.Count; l++)
|
||||
{
|
||||
_rewards.Add(ReceivedReward.CreateFromBattleResult(jsonData4[l]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("win_reward_list"))
|
||||
{
|
||||
JsonData jsonData5 = data["win_reward_list"];
|
||||
if (jsonData5 != null)
|
||||
{
|
||||
for (int m = 0; m < jsonData5.Count; m++)
|
||||
{
|
||||
_victoryRewards.Add(ReceivedReward.CreateVictoryReward(jsonData5[m]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("achieved_beginner_mission_reward_list"))
|
||||
{
|
||||
JsonData jsonData6 = data["achieved_beginner_mission_reward_list"];
|
||||
if (jsonData6 != null)
|
||||
{
|
||||
for (int n = 0; n < jsonData6.Count; n++)
|
||||
{
|
||||
_rewards.Add(ReceivedReward.CreateFromBeginnerMissionReward(jsonData6[n]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("achieved_beginner_mission_list"))
|
||||
{
|
||||
JsonData jsonData7 = data["achieved_beginner_mission_list"];
|
||||
if (jsonData7 != null)
|
||||
{
|
||||
for (int num = 0; num < jsonData7.Count; num++)
|
||||
{
|
||||
_missions.Add(UserMission.CreateAchievedMission(jsonData7[num]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("battle_pass_reward_list"))
|
||||
{
|
||||
JsonData jsonData8 = data["battle_pass_reward_list"];
|
||||
if (jsonData8 != null)
|
||||
{
|
||||
for (int num2 = 0; num2 < jsonData8.Count; num2++)
|
||||
{
|
||||
_rewards.Add(ReceivedReward.CreateFromBattlePassReward(jsonData8[num2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.Keys.Contains("battle_pass_message_list"))
|
||||
{
|
||||
JsonData jsonData9 = data["battle_pass_message_list"];
|
||||
if (jsonData9 != null)
|
||||
{
|
||||
for (int num3 = 0; num3 < jsonData9.Count; num3++)
|
||||
{
|
||||
_missions.Add(UserMission.CreateAchievedMission(jsonData9[num3]));
|
||||
}
|
||||
}
|
||||
}
|
||||
_lotteryData = LotteryApplyData.Parse(data);
|
||||
}
|
||||
}
|
||||
106
SVSim.BattleEngine/Engine/AddTargetInfo.cs
Normal file
106
SVSim.BattleEngine/Engine/AddTargetInfo.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
|
||||
public class AddTargetInfo
|
||||
{
|
||||
private BattleCardBase _ownerCard;
|
||||
|
||||
private ConditionSkillFilterCollection _conditionFilter;
|
||||
|
||||
private ApplySkillTargetFilterCollection _targetFilter;
|
||||
|
||||
private Func<SkillBase, bool> typeCheck;
|
||||
|
||||
private string _conditionFilterText;
|
||||
|
||||
private string _targetFilterText;
|
||||
|
||||
private string _skillTypeText;
|
||||
|
||||
private string _ownerCardtype;
|
||||
|
||||
private SkillCreator _skillCreator;
|
||||
|
||||
public AddTargetInfo(BattleCardBase ownerCard, string conditionFilterText, string targetFilterText, string skillTypeText, string ownerCardType, SkillBase skill)
|
||||
{
|
||||
_ownerCard = ownerCard;
|
||||
_conditionFilterText = conditionFilterText;
|
||||
_targetFilterText = targetFilterText;
|
||||
_skillTypeText = skillTypeText;
|
||||
_ownerCardtype = ownerCardType;
|
||||
_conditionFilter = new ConditionSkillFilterCollection();
|
||||
_targetFilter = new ApplySkillTargetFilterCollection();
|
||||
typeCheck = SetTypeCheck(_skillTypeText, _ownerCardtype);
|
||||
_skillCreator = _ownerCard.CreateSkillCreator(_ownerCard.SelfBattlePlayer, _ownerCard.OpponentBattlePlayer, _ownerCard.ResourceMgr);
|
||||
string[] array = _conditionFilterText.Split('&');
|
||||
List<SkillFilterCreator.ContentInfo> list = new List<SkillFilterCreator.ContentInfo>();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
SkillFilterCreator.ParseContentInfo(array[i], out var retParsedInfo);
|
||||
list.Add(retParsedInfo);
|
||||
}
|
||||
SkillCreator.SetupSkillConditionOld(_conditionFilter, list, _ownerCard, skill);
|
||||
string[] array2 = _targetFilterText.Split('&');
|
||||
List<SkillFilterCreator.ContentInfo> list2 = new List<SkillFilterCreator.ContentInfo>();
|
||||
for (int j = 0; j < array2.Length; j++)
|
||||
{
|
||||
SkillFilterCreator.ParseContentInfo(array2[j], out var retParsedInfo2);
|
||||
list2.Add(retParsedInfo2);
|
||||
}
|
||||
_skillCreator.SetupSkillTargetOld(_targetFilter, _ownerCard, list2, skill);
|
||||
}
|
||||
|
||||
public List<BattleCardBase> GetAddTargetCard(SkillBase skill, BattlePlayerReadOnlyInfoPair pair, SkillConditionCheckerOption checkerOption, SkillOptionValue optionValue)
|
||||
{
|
||||
if (typeCheck(skill) && FilterComparison(skill.ApplyFilterCollection))
|
||||
{
|
||||
return _targetFilter.Filtering(pair, checkerOption, optionValue).Cast<BattleCardBase>().ToList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Func<SkillBase, bool> SetTypeCheck(string skillType, string ownerCardType)
|
||||
{
|
||||
if (skillType != null && skillType == "damage")
|
||||
{
|
||||
return (SkillBase skill) => CardTypeCheck(skill.SkillPrm.ownerCard, ownerCardType) && skill is Skill_damage;
|
||||
}
|
||||
return (SkillBase skill) => CardTypeCheck(skill.SkillPrm.ownerCard, ownerCardType) && skill is Skill_none;
|
||||
}
|
||||
|
||||
private bool CardTypeCheck(BattleCardBase card, string ownerCardType)
|
||||
{
|
||||
return ownerCardType switch
|
||||
{
|
||||
"all" => true,
|
||||
"unit" => card.IsUnit,
|
||||
"spell" => card.IsSpell,
|
||||
"field" => card.IsField,
|
||||
"chant_field" => card.IsChantField,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
private bool FilterComparison(ApplySkillTargetFilterCollection ownerSkillFilter)
|
||||
{
|
||||
if (_conditionFilter.BattlePlayerFilter.GetType() == ownerSkillFilter.BattlePlayerFilter.GetType() && _conditionFilter.TargetFilter.GetType() == ownerSkillFilter.TargetFilter.GetType())
|
||||
{
|
||||
foreach (ISkillCardFilter cardType in _conditionFilter.CardFilterList)
|
||||
{
|
||||
if (!ownerSkillFilter.CardFilterList.Any((ISkillCardFilter s) => s.GetType() == cardType.GetType()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public AddTargetInfo Clone(BattleCardBase ownerCard)
|
||||
{
|
||||
return new AddTargetInfo(ownerCard, _conditionFilterText, _targetFilterText, _skillTypeText, _ownerCardtype, null);
|
||||
}
|
||||
}
|
||||
2651
SVSim.BattleEngine/Engine/ApiType.cs
Normal file
2651
SVSim.BattleEngine/Engine/ApiType.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
using Wizard.Battle;
|
||||
|
||||
public class ApplySkillTargetFilterCollection : SkillFilterCollectionBase
|
||||
{
|
||||
public List<ISkillCustomSelectFilter> ApplyCustomSelectFilterList { get; set; }
|
||||
|
||||
public List<ISkillExclutionFilter> ApplyExclutionFilterList { get; private set; }
|
||||
|
||||
public ISkillSelectFilter ApplySelectFilter { get; set; }
|
||||
|
||||
public List<ApplySkillTargetFilterCollection> ApplyAndFilter { get; set; }
|
||||
|
||||
public ApplySkillTargetFilterCollection()
|
||||
{
|
||||
ApplyCustomSelectFilterList = new List<ISkillCustomSelectFilter>();
|
||||
ApplyExclutionFilterList = new List<ISkillExclutionFilter>();
|
||||
ApplyAndFilter = new List<ApplySkillTargetFilterCollection>();
|
||||
}
|
||||
|
||||
public List<IReadOnlyBattleCardInfo> Filtering(BattlePlayerReadOnlyInfoPair pair, SkillConditionCheckerOption checkerOption, SkillOptionValue optionValue)
|
||||
{
|
||||
List<IReadOnlyBattleCardInfo> list = new List<IReadOnlyBattleCardInfo>();
|
||||
List<IReadOnlyBattleCardInfo> AndFilterTargets = new List<IReadOnlyBattleCardInfo>();
|
||||
IEnumerable<IBattlePlayerReadOnlyInfo> battlePlayerInfos = null;
|
||||
if (ApplyAndFilter.Count <= 0)
|
||||
{
|
||||
if (base.BattlePlayerFilter != null)
|
||||
{
|
||||
battlePlayerInfos = base.BattlePlayerFilter.Filtering(pair);
|
||||
}
|
||||
if (base.TargetFilter != null)
|
||||
{
|
||||
list = base.TargetFilter.Filtering(battlePlayerInfos, checkerOption).ToList();
|
||||
if (BattleManagerBase.GetIns().XorShiftRandom(isSelf: true) != null && BattleManagerBase.GetIns().XorShiftRandom(isSelf: false) == null && !pair.ReadOnlySelf.IsPlayer && (base.TargetFilter is SkillTargetInHandCardFilter || base.TargetFilter is SkillTargetReturnCardFilter || base.TargetFilter is SkillTargetTokenDrawCardFilter))
|
||||
{
|
||||
return list;
|
||||
}
|
||||
}
|
||||
foreach (ISkillCardFilter cardFilter in base.CardFilterList)
|
||||
{
|
||||
list = cardFilter.Filtering(list, optionValue).ToList();
|
||||
}
|
||||
int i = 0;
|
||||
for (int count = ApplyCustomSelectFilterList.Count; i < count; i++)
|
||||
{
|
||||
list = ApplyCustomSelectFilterList[i].Filtering(list, battlePlayerInfos, checkerOption).ToList();
|
||||
}
|
||||
for (int j = 0; j < ApplyExclutionFilterList.Count; j++)
|
||||
{
|
||||
list = ApplyExclutionFilterList[j].Filtering(list, battlePlayerInfos, checkerOption, optionValue).ToList();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int k = 0; k < ApplyAndFilter.Count; k++)
|
||||
{
|
||||
List<BattleCardBase> cards = ApplyAndFilter[k].Filtering(pair, checkerOption, optionValue).Cast<BattleCardBase>().ToList();
|
||||
List<IReadOnlyBattleCardInfo> collection = (from IReadOnlyBattleCardInfo x in ApplyAndFilter[k].SelectFilter.Filtering(cards, optionValue, checkerOption)
|
||||
where !AndFilterTargets.Contains(x)
|
||||
select x).ToList();
|
||||
AndFilterTargets.AddRange(collection);
|
||||
}
|
||||
}
|
||||
List<IReadOnlyBattleCardInfo> list2 = list.ToList();
|
||||
list2.AddRange(AndFilterTargets);
|
||||
return list2;
|
||||
}
|
||||
|
||||
public bool SimpleFiltering(IReadOnlyBattleCardInfo targetCard, BattlePlayerReadOnlyInfoPair pair, SkillConditionCheckerOption checkerOption, SkillOptionValue optionValue)
|
||||
{
|
||||
List<IReadOnlyBattleCardInfo> list = new List<IReadOnlyBattleCardInfo> { targetCard };
|
||||
IEnumerable<IBattlePlayerReadOnlyInfo> battlePlayerInfos = base.BattlePlayerFilter.Filtering(pair);
|
||||
for (int i = 0; i < base.CardFilterList.Count; i++)
|
||||
{
|
||||
list = base.CardFilterList[i].Filtering(list, optionValue).ToList();
|
||||
}
|
||||
for (int j = 0; j < ApplyCustomSelectFilterList.Count; j++)
|
||||
{
|
||||
list = ApplyCustomSelectFilterList[j].Filtering(list, battlePlayerInfos, checkerOption).ToList();
|
||||
}
|
||||
for (int k = 0; k < ApplyExclutionFilterList.Count; k++)
|
||||
{
|
||||
list = ApplyExclutionFilterList[k].Filtering(list, battlePlayerInfos, checkerOption, optionValue).ToList();
|
||||
}
|
||||
return list.Count() > 0;
|
||||
}
|
||||
}
|
||||
117
SVSim.BattleEngine/Engine/ArrowControl.cs
Normal file
117
SVSim.BattleEngine/Engine/ArrowControl.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ArrowControl : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject ArrowHead;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject ArrowEfc;
|
||||
|
||||
[SerializeField]
|
||||
private int DivideCnt = 10;
|
||||
|
||||
[SerializeField]
|
||||
private bool isEvo;
|
||||
|
||||
private IList<GameObject> ArrowEfcList;
|
||||
|
||||
private GameObject FromObj;
|
||||
|
||||
private GameObject ToObj;
|
||||
|
||||
private bool isOn;
|
||||
|
||||
private bool _isTargettingEnemy;
|
||||
|
||||
private float ChangeTime;
|
||||
|
||||
private IList<int> ArrowTarList;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
ArrowEfcList = new List<GameObject>();
|
||||
ArrowEfcList.Add(ArrowEfc);
|
||||
for (int i = 1; i < DivideCnt; i++)
|
||||
{
|
||||
GameObject gameObject = Object.Instantiate(ArrowEfc);
|
||||
if (!(null == gameObject))
|
||||
{
|
||||
gameObject.transform.parent = base.transform;
|
||||
ArrowEfcList.Add(gameObject);
|
||||
}
|
||||
}
|
||||
ArrowTarList = new List<int>();
|
||||
for (int j = 0; j < DivideCnt; j++)
|
||||
{
|
||||
ArrowTarList.Add(j);
|
||||
}
|
||||
HideArrow();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (isOn)
|
||||
{
|
||||
SetArrowLine();
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowArrow(GameObject fromObj, GameObject toObj, bool isTargettingEnemy)
|
||||
{
|
||||
FromObj = fromObj;
|
||||
ToObj = toObj;
|
||||
_isTargettingEnemy = isTargettingEnemy;
|
||||
isOn = true;
|
||||
base.gameObject.SetActive(value: true);
|
||||
}
|
||||
|
||||
public void HideArrow()
|
||||
{
|
||||
isOn = false;
|
||||
for (int i = 0; i < DivideCnt; i++)
|
||||
{
|
||||
ArrowEfcList[i].SetActive(value: false);
|
||||
}
|
||||
base.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
private void SetArrowLine()
|
||||
{
|
||||
if (isEvo)
|
||||
{
|
||||
ChangeTime -= Time.deltaTime * 5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeTime -= Time.deltaTime;
|
||||
}
|
||||
if (ChangeTime <= 0f)
|
||||
{
|
||||
ChangeTime = 1f;
|
||||
ArrowTarList.Add(ArrowTarList[0]);
|
||||
ArrowTarList.RemoveAt(0);
|
||||
}
|
||||
ArrowHead.transform.position = ToObj.transform.position;
|
||||
Vector3 position = FromObj.transform.position;
|
||||
Vector3 position2 = ToObj.transform.position;
|
||||
Vector3 p = (_isTargettingEnemy ? position : position2) + Vector3.back * Vector3.Distance(position, position2) + Vector3.down * Vector3.Distance(position, position2) * -0.5f;
|
||||
Vector3[] array = new Vector3[DivideCnt];
|
||||
array = MotionUtils.GetBezierQuad(position, p, position2, DivideCnt);
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
float num = 1f - ChangeTime;
|
||||
if (ArrowTarList[i] != 0)
|
||||
{
|
||||
ArrowEfcList[i].SetActive(value: true);
|
||||
ArrowEfcList[i].transform.position = (array[ArrowTarList[i]] - array[ArrowTarList[i] - 1]) * num + array[ArrowTarList[i] - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
ArrowEfcList[i].SetActive(value: false);
|
||||
ArrowEfcList[i].transform.position = array[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
74
SVSim.BattleEngine/Engine/AttachedSkillInformation.cs
Normal file
74
SVSim.BattleEngine/Engine/AttachedSkillInformation.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.Battle;
|
||||
|
||||
public class AttachedSkillInformation
|
||||
{
|
||||
public SkillCollectionBase AttachedSkills { get; protected set; }
|
||||
|
||||
public List<string> OwnerCardNameList { get; protected set; }
|
||||
|
||||
public List<int> OwnerCardIdList { get; protected set; }
|
||||
|
||||
public List<long> DuplicateBanNum { get; protected set; }
|
||||
|
||||
public List<SkillBase> CreatorSkillList { get; protected set; }
|
||||
|
||||
public List<int> CreatorSkillIndexList { get; protected set; }
|
||||
|
||||
public AttachedSkillInformation(BattleCardBase card)
|
||||
{
|
||||
AttachedSkills = new SkillCollectionBase(card);
|
||||
OwnerCardNameList = new List<string>();
|
||||
OwnerCardIdList = new List<int>();
|
||||
DuplicateBanNum = new List<long>();
|
||||
CreatorSkillList = new List<SkillBase>();
|
||||
CreatorSkillIndexList = new List<int>();
|
||||
}
|
||||
|
||||
public AttachedSkillInformation(BattleCardBase card, SkillCollectionBase skills, List<string> nameList, List<int> idList, List<long> duplicateBanNum, List<SkillBase> createrList, List<int> creatorSkillIndexList)
|
||||
{
|
||||
AttachedSkills = skills.Clone(card);
|
||||
OwnerCardNameList = new List<string>(nameList);
|
||||
OwnerCardIdList = new List<int>(idList);
|
||||
DuplicateBanNum = new List<long>(duplicateBanNum);
|
||||
CreatorSkillList = new List<SkillBase>(createrList);
|
||||
CreatorSkillIndexList = new List<int>(creatorSkillIndexList);
|
||||
}
|
||||
|
||||
public void Add(SkillBase skill, string ownerCardName, int ownerCardID, long duplicateBanNum, SkillBase creatorSkill, int index)
|
||||
{
|
||||
AttachedSkills.Add(skill);
|
||||
OwnerCardNameList.Add(ownerCardName);
|
||||
OwnerCardIdList.Add(ownerCardID);
|
||||
DuplicateBanNum.Add(duplicateBanNum);
|
||||
CreatorSkillList.Add(creatorSkill);
|
||||
CreatorSkillIndexList.Add(index);
|
||||
}
|
||||
|
||||
public void Remove(SkillBase skill, BattleCardBase owner, long duplicateBanNum, SkillBase creatorSkill, int index)
|
||||
{
|
||||
string name = owner.GetName();
|
||||
int cardId = owner.CardId;
|
||||
Remove(skill, name, cardId, duplicateBanNum, creatorSkill, index);
|
||||
}
|
||||
|
||||
public void Remove(SkillBase skill, string ownerCardName, int ownerCardID, long duplicateBanNum, SkillBase creatorSkill, int index)
|
||||
{
|
||||
AttachedSkills.Remove(skill);
|
||||
OwnerCardNameList.Remove(ownerCardName);
|
||||
OwnerCardIdList.Remove(ownerCardID);
|
||||
DuplicateBanNum.Remove(duplicateBanNum);
|
||||
CreatorSkillList.Remove(creatorSkill);
|
||||
CreatorSkillIndexList.Remove(index);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
AttachedSkills.Clear();
|
||||
OwnerCardNameList.Clear();
|
||||
OwnerCardIdList.Clear();
|
||||
DuplicateBanNum.Clear();
|
||||
CreatorSkillList.Clear();
|
||||
CreatorSkillIndexList.Clear();
|
||||
}
|
||||
}
|
||||
15
SVSim.BattleEngine/Engine/AttachingAbilityInfo.cs
Normal file
15
SVSim.BattleEngine/Engine/AttachingAbilityInfo.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.Battle;
|
||||
|
||||
public class AttachingAbilityInfo
|
||||
{
|
||||
public SkillBase Skill { get; private set; }
|
||||
|
||||
public List<IReadOnlyBattleCardInfo> TargetCards { get; private set; }
|
||||
|
||||
public AttachingAbilityInfo(SkillBase skill, List<IReadOnlyBattleCardInfo> targetCards)
|
||||
{
|
||||
Skill = skill;
|
||||
TargetCards = targetCards;
|
||||
}
|
||||
}
|
||||
154
SVSim.BattleEngine/Engine/BMFont.cs
Normal file
154
SVSim.BattleEngine/Engine/BMFont.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class BMFont
|
||||
{
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private int mSize = 16;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private int mBase;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private int mWidth;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private int mHeight;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private string mSpriteName;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private List<BMGlyph> mSaved = new List<BMGlyph>();
|
||||
|
||||
private Dictionary<int, BMGlyph> mDict = new Dictionary<int, BMGlyph>();
|
||||
|
||||
public bool isValid => mSaved.Count > 0;
|
||||
|
||||
public int charSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return mSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
mSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int baseOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return mBase;
|
||||
}
|
||||
set
|
||||
{
|
||||
mBase = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int texWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
set
|
||||
{
|
||||
mWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int texHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
mHeight = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int glyphCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!isValid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return mSaved.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public string spriteName
|
||||
{
|
||||
get
|
||||
{
|
||||
return mSpriteName;
|
||||
}
|
||||
set
|
||||
{
|
||||
mSpriteName = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<BMGlyph> glyphs => mSaved;
|
||||
|
||||
public BMGlyph GetGlyph(int index, bool createIfMissing)
|
||||
{
|
||||
BMGlyph value = null;
|
||||
if (mDict.Count == 0)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = mSaved.Count; i < count; i++)
|
||||
{
|
||||
BMGlyph bMGlyph = mSaved[i];
|
||||
mDict.Add(bMGlyph.index, bMGlyph);
|
||||
}
|
||||
}
|
||||
if (!mDict.TryGetValue(index, out value) && createIfMissing)
|
||||
{
|
||||
value = new BMGlyph();
|
||||
value.index = index;
|
||||
mSaved.Add(value);
|
||||
mDict.Add(index, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public BMGlyph GetGlyph(int index)
|
||||
{
|
||||
return GetGlyph(index, createIfMissing: false);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
mDict.Clear();
|
||||
mSaved.Clear();
|
||||
}
|
||||
|
||||
public void Trim(int xMin, int yMin, int xMax, int yMax)
|
||||
{
|
||||
if (isValid)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = mSaved.Count; i < count; i++)
|
||||
{
|
||||
mSaved[i]?.Trim(xMin, yMin, xMax, yMax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
88
SVSim.BattleEngine/Engine/BMGlyph.cs
Normal file
88
SVSim.BattleEngine/Engine/BMGlyph.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[Serializable]
|
||||
public class BMGlyph
|
||||
{
|
||||
public int index;
|
||||
|
||||
public int x;
|
||||
|
||||
public int y;
|
||||
|
||||
public int width;
|
||||
|
||||
public int height;
|
||||
|
||||
public int offsetX;
|
||||
|
||||
public int offsetY;
|
||||
|
||||
public int advance;
|
||||
|
||||
public int channel;
|
||||
|
||||
public List<int> kerning;
|
||||
|
||||
public int GetKerning(int previousChar)
|
||||
{
|
||||
if (kerning != null && previousChar != 0)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = kerning.Count; i < count; i += 2)
|
||||
{
|
||||
if (kerning[i] == previousChar)
|
||||
{
|
||||
return kerning[i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void SetKerning(int previousChar, int amount)
|
||||
{
|
||||
if (kerning == null)
|
||||
{
|
||||
kerning = new List<int>();
|
||||
}
|
||||
for (int i = 0; i < kerning.Count; i += 2)
|
||||
{
|
||||
if (kerning[i] == previousChar)
|
||||
{
|
||||
kerning[i + 1] = amount;
|
||||
return;
|
||||
}
|
||||
}
|
||||
kerning.Add(previousChar);
|
||||
kerning.Add(amount);
|
||||
}
|
||||
|
||||
public void Trim(int xMin, int yMin, int xMax, int yMax)
|
||||
{
|
||||
int num = x + width;
|
||||
int num2 = y + height;
|
||||
if (x < xMin)
|
||||
{
|
||||
int num3 = xMin - x;
|
||||
x += num3;
|
||||
width -= num3;
|
||||
offsetX += num3;
|
||||
}
|
||||
if (y < yMin)
|
||||
{
|
||||
int num4 = yMin - y;
|
||||
y += num4;
|
||||
height -= num4;
|
||||
offsetY += num4;
|
||||
}
|
||||
if (num > xMax)
|
||||
{
|
||||
width -= num - xMax;
|
||||
}
|
||||
if (num2 > yMax)
|
||||
{
|
||||
height -= num2 - yMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
93
SVSim.BattleEngine/Engine/BMSymbol.cs
Normal file
93
SVSim.BattleEngine/Engine/BMSymbol.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class BMSymbol
|
||||
{
|
||||
public string sequence;
|
||||
|
||||
public string spriteName;
|
||||
|
||||
private UISpriteData mSprite;
|
||||
|
||||
private bool mIsValid;
|
||||
|
||||
private int mLength;
|
||||
|
||||
private int mOffsetX;
|
||||
|
||||
private int mOffsetY;
|
||||
|
||||
private int mWidth;
|
||||
|
||||
private int mHeight;
|
||||
|
||||
private int mAdvance;
|
||||
|
||||
private Rect mUV;
|
||||
|
||||
public int length
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mLength == 0)
|
||||
{
|
||||
mLength = sequence.Length;
|
||||
}
|
||||
return mLength;
|
||||
}
|
||||
}
|
||||
|
||||
public int offsetX => mOffsetX;
|
||||
|
||||
public int offsetY => mOffsetY;
|
||||
|
||||
public int width => mWidth;
|
||||
|
||||
public int height => mHeight;
|
||||
|
||||
public int advance => mAdvance;
|
||||
|
||||
public Rect uvRect => mUV;
|
||||
|
||||
public void MarkAsChanged()
|
||||
{
|
||||
mIsValid = false;
|
||||
}
|
||||
|
||||
public bool Validate(UIAtlas atlas)
|
||||
{
|
||||
if (atlas == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!mIsValid)
|
||||
{
|
||||
if (string.IsNullOrEmpty(spriteName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
mSprite = ((atlas != null) ? atlas.GetSprite(spriteName) : null);
|
||||
if (mSprite != null)
|
||||
{
|
||||
Texture texture = atlas.texture;
|
||||
if (texture == null)
|
||||
{
|
||||
mSprite = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
mUV = new Rect(mSprite.x, mSprite.y, mSprite.width, mSprite.height);
|
||||
mUV = NGUIMath.ConvertToTexCoords(mUV, texture.width, texture.height);
|
||||
mOffsetX = mSprite.paddingLeft;
|
||||
mOffsetY = mSprite.paddingTop;
|
||||
mWidth = mSprite.width;
|
||||
mHeight = mSprite.height;
|
||||
mAdvance = mSprite.width + (mSprite.paddingLeft + mSprite.paddingRight);
|
||||
mIsValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return mSprite != null;
|
||||
}
|
||||
}
|
||||
272
SVSim.BattleEngine/Engine/BackGroundBase.cs
Normal file
272
SVSim.BattleEngine/Engine/BackGroundBase.cs
Normal file
@@ -0,0 +1,272 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BackGroundBase
|
||||
{
|
||||
protected string _bgmId;
|
||||
|
||||
protected BattleCamera _battleCamera;
|
||||
|
||||
protected GameObject _fieldModel;
|
||||
|
||||
protected GameObject _fieldParticles;
|
||||
|
||||
protected IDictionary<string, Animation> m_FieldAnimationDictionary;
|
||||
|
||||
protected IDictionary<string, GameObject> _fieldObjDictionary;
|
||||
|
||||
protected IDictionary<string, Animator> m_FieldAnimatorDictionary;
|
||||
|
||||
protected IDictionary<string, ParticleSystem> _fieldParticleSystemDictionary;
|
||||
|
||||
protected IDictionary<string, int> _gimicCntDictionary;
|
||||
|
||||
public string[] GimicAudioList;
|
||||
|
||||
protected string _str3DFieldNo;
|
||||
|
||||
protected string _str3DFieldPath;
|
||||
|
||||
protected BattleManagerBase m_BtlMgrIns;
|
||||
|
||||
protected string m_FieldAssetPath;
|
||||
|
||||
protected List<string> m_SoundAssetPathList;
|
||||
|
||||
protected float m_RandomActionTime;
|
||||
|
||||
protected bool IsFieldRandom;
|
||||
|
||||
private Coroutine battleLoadCoroutine;
|
||||
|
||||
public virtual int FieldId => 1;
|
||||
|
||||
public virtual int FieldEffectId => FieldId;
|
||||
|
||||
public GameObject Field { get; protected set; }
|
||||
|
||||
public GameObject m_Battle3DContainer { get; protected set; }
|
||||
|
||||
public GameObject m_BattleCutInContainer { get; protected set; }
|
||||
|
||||
public SetShaderGlobalColorBG SetShaderGlobalColorBG { get; protected set; }
|
||||
|
||||
public bool IsLoadDone { get; protected set; }
|
||||
|
||||
public BackGroundBase(string bgmId = "NONE")
|
||||
{
|
||||
_battleCamera = null;
|
||||
m_Battle3DContainer = null;
|
||||
m_BattleCutInContainer = null;
|
||||
m_BtlMgrIns = BattleManagerBase.GetIns();
|
||||
IsLoadDone = false;
|
||||
_str3DFieldNo = "";
|
||||
_str3DFieldPath = "";
|
||||
m_FieldAssetPath = "";
|
||||
Field = null;
|
||||
_fieldModel = null;
|
||||
_fieldParticles = null;
|
||||
_bgmId = bgmId;
|
||||
m_RandomActionTime = 0f;
|
||||
IsFieldRandom = false;
|
||||
m_SoundAssetPathList = new List<string>();
|
||||
_fieldObjDictionary = new Dictionary<string, GameObject>();
|
||||
m_FieldAnimationDictionary = new Dictionary<string, Animation>();
|
||||
m_FieldAnimatorDictionary = new Dictionary<string, Animator>();
|
||||
_fieldParticleSystemDictionary = new Dictionary<string, ParticleSystem>();
|
||||
_gimicCntDictionary = new Dictionary<string, int>();
|
||||
SetShaderGlobalColorBG = null;
|
||||
Physics.gravity = new Vector3(0f, 0f, 9.8f);
|
||||
_str3DFieldNo = GetFieldIdString(FieldId);
|
||||
_gimicCntDictionary.Add("FieldGimic1", 0);
|
||||
_gimicCntDictionary.Add("FieldGimic2", 0);
|
||||
_gimicCntDictionary.Add("FieldGimic3", 0);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UnityEngine.Object.DestroyImmediate(Field);
|
||||
Field = null;
|
||||
_fieldModel = null;
|
||||
_fieldParticles = null;
|
||||
_fieldObjDictionary.Clear();
|
||||
m_FieldAnimationDictionary.Clear();
|
||||
m_FieldAnimatorDictionary.Clear();
|
||||
_fieldParticleSystemDictionary.Clear();
|
||||
m_SoundAssetPathList.Clear();
|
||||
_gimicCntDictionary.Clear();
|
||||
SetShaderGlobalColorBG = null;
|
||||
BattleCoroutine.GetInstance().StopCoroutine(battleLoadCoroutine);
|
||||
}
|
||||
|
||||
public void CreateField(BattleCamera battleCamera, GameObject battle3DContainer, GameObject cutInContainer)
|
||||
{
|
||||
_battleCamera = battleCamera;
|
||||
m_Battle3DContainer = battle3DContainer;
|
||||
m_BattleCutInContainer = cutInContainer;
|
||||
Camera componentInChildren = m_Battle3DContainer.GetComponentInChildren<Camera>();
|
||||
Camera component = componentInChildren.transform.Find("Camera 3DGround").GetComponent<Camera>();
|
||||
_battleCamera.SetUp(componentInChildren, m_BattleCutInContainer.transform.Find("Camera").GetComponent<UICamera>(), component);
|
||||
LoadField();
|
||||
}
|
||||
|
||||
protected void LoadField()
|
||||
{
|
||||
IsLoadDone = false;
|
||||
m_BtlMgrIns = BattleManagerBase.GetIns();
|
||||
_str3DFieldNo = GetFieldIdString(FieldEffectId);
|
||||
_str3DFieldPath = "3DField" + GetFieldIdString(FieldId);
|
||||
m_SoundAssetPathList.Add($"s/se_field_{_str3DFieldNo}.acb");
|
||||
m_SoundAssetPathList.Add(string.Format("b/bgm_field_{0}.acb", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo));
|
||||
m_SoundAssetPathList.Add(string.Format("b/bgm_field_{0}.awb", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo));
|
||||
m_FieldAssetPath = Toolbox.ResourcesManager.GetAssetTypePath(_str3DFieldPath, ResourcesManager.AssetLoadPathType.Field3D);
|
||||
List<string> additionalAssetList = CollectAdditionalAssets();
|
||||
GameMgr.GetIns().GetEffectMgr().InitCommonEffect(string.Format("Json/FIeld" + _str3DFieldNo + "EffectData", _str3DFieldNo), isBattle: true);
|
||||
battleLoadCoroutine = BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(m_SoundAssetPathList, delegate
|
||||
{
|
||||
BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(m_FieldAssetPath, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(m_SoundAssetPathList);
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(m_FieldAssetPath);
|
||||
(UnityEngine.Object.Instantiate(Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(_str3DFieldPath, ResourcesManager.AssetLoadPathType.Field3D, isfetch: true))) as GameObject).name = _str3DFieldPath;
|
||||
if (additionalAssetList.IsNotNullOrEmpty())
|
||||
{
|
||||
BattleCoroutine.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(additionalAssetList, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(additionalAssetList);
|
||||
BattleFieldBuild();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleFieldBuild();
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
private string GetFieldIdString(int fieldId)
|
||||
{
|
||||
return fieldId.ToString((fieldId < 100) ? "00" : "0000");
|
||||
}
|
||||
|
||||
private string GetFieldIdString(string fileldId)
|
||||
{
|
||||
if (int.TryParse(fileldId, out var result))
|
||||
{
|
||||
return result.ToString((result < 100) ? "00" : "0000");
|
||||
}
|
||||
return fileldId;
|
||||
}
|
||||
|
||||
protected virtual void BattleFieldBuild()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual List<string> CollectAdditionalAssets()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void StartFieldSetEffect(Vector3 pos)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void StartFieldTapEffect(int areaId, Vector3 pos)
|
||||
{
|
||||
BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.IsTouchable();
|
||||
}
|
||||
|
||||
public void StartFieldOpening()
|
||||
{
|
||||
PlayBgm();
|
||||
OpeningVfx.OpenningLogStep = "StartFieldOpening";
|
||||
IsFieldRandom = true;
|
||||
BattleCoroutine.GetInstance().StartCoroutine(RunFieldOpening());
|
||||
}
|
||||
|
||||
public void PlayBgm()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlayBGM(string.Format("bgm_field_{0}", (_bgmId != "NONE") ? GetFieldIdString(_bgmId) : _str3DFieldNo), 0f, 0L);
|
||||
}
|
||||
|
||||
protected virtual IEnumerator RunFieldOpening()
|
||||
{
|
||||
yield return new WaitForSeconds(0f);
|
||||
}
|
||||
|
||||
public static IEnumerator ObjectChecker(float fWaitSecs, string strObjectFind, Action callback)
|
||||
{
|
||||
while (GameObject.Find(strObjectFind) == null || !GameMgr.GetIns().GetEffectMgr().IsFieldEffectReady || !GameMgr.GetIns().GetEffectMgr().IsBattleUIEffectReady)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
public void StartFieldGimic(GameObject obj)
|
||||
{
|
||||
if (!GameMgr.GetIns().IsReplayBattle && BattleManagerBase.GetIns().BattlePlayer.PlayerBattleView.IsTouchable())
|
||||
{
|
||||
BattleCoroutine.GetInstance().StartCoroutine(RunFieldGimic(obj));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual IEnumerator RunFieldGimic(GameObject obj)
|
||||
{
|
||||
yield return new WaitForSeconds(0f);
|
||||
}
|
||||
|
||||
public void StartFieldShake()
|
||||
{
|
||||
BattleCoroutine.GetInstance().StartCoroutine(RunFieldShake());
|
||||
}
|
||||
|
||||
protected virtual IEnumerator RunFieldShake()
|
||||
{
|
||||
yield return new WaitForSeconds(0f);
|
||||
}
|
||||
|
||||
public virtual void UpdateFieldRandom()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddParticleToFieldObjDictionary(string targetPath)
|
||||
{
|
||||
string[] array = targetPath.Split('/');
|
||||
List<Transform> list = new List<Transform>();
|
||||
list.Add(_fieldParticles.transform);
|
||||
List<Transform> list2 = new List<Transform>();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
list2 = new List<Transform>();
|
||||
for (int j = 0; j < list.Count; j++)
|
||||
{
|
||||
list2.AddRange(FindAllChildByName(list[j], array[i]));
|
||||
}
|
||||
list = new List<Transform>(list2);
|
||||
}
|
||||
for (int k = 0; k < list2.Count; k++)
|
||||
{
|
||||
_fieldObjDictionary.Add(targetPath + "_" + k, list2[k].gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Transform> FindAllChildByName(Transform parent, string name)
|
||||
{
|
||||
List<Transform> list = new List<Transform>();
|
||||
for (int i = 0; i < parent.childCount; i++)
|
||||
{
|
||||
Transform child = parent.GetChild(i);
|
||||
if (child.name == name)
|
||||
{
|
||||
list.Add(child);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
79
SVSim.BattleEngine/Engine/BattleCamera.cs
Normal file
79
SVSim.BattleEngine/Engine/BattleCamera.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattleCamera
|
||||
{
|
||||
public UICamera m_CutInCamera;
|
||||
|
||||
public Camera Camera;
|
||||
|
||||
public Camera _backgroundCamera;
|
||||
|
||||
public Vector3 BattleCameraPos { get; private set; }
|
||||
|
||||
public Vector3 BattleCameraRot { get; private set; }
|
||||
|
||||
public BattleCamera()
|
||||
{
|
||||
Camera = null;
|
||||
}
|
||||
|
||||
public void SetUp(Camera camera, UICamera cutInCamera, Camera backgroundCamera)
|
||||
{
|
||||
Camera = camera;
|
||||
m_CutInCamera = cutInCamera;
|
||||
_backgroundCamera = backgroundCamera;
|
||||
BattleCameraPos = Camera.transform.localPosition;
|
||||
BattleCameraRot = Camera.transform.eulerAngles;
|
||||
}
|
||||
|
||||
public VfxBase ShakeCamera(Vector3 amount, float time, float delay)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
parallelVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
iTween.ShakePosition(Camera.gameObject, iTween.Hash("amount", amount, "time", time, "delay", delay));
|
||||
}));
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public static VfxBase ShakeCameraGameObject(GameObject obj, Vector3 amount, float time, float delay)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
parallelVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
iTween.ShakePosition(obj, iTween.Hash("amount", amount, "time", time, "delay", delay));
|
||||
}));
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public VfxBase ShakeComplete()
|
||||
{
|
||||
return InstantVfx.Create(delegate
|
||||
{
|
||||
Camera.transform.localPosition = BattleCameraPos;
|
||||
Camera.transform.eulerAngles = BattleCameraRot;
|
||||
iTween.Stop(Camera.gameObject);
|
||||
});
|
||||
}
|
||||
|
||||
public static VfxBase ShakeCompleteGameObject(GameObject obj, Vector3 position, Vector3 euler)
|
||||
{
|
||||
return InstantVfx.Create(delegate
|
||||
{
|
||||
obj.transform.localPosition = position;
|
||||
obj.transform.eulerAngles = euler;
|
||||
iTween.Stop(obj);
|
||||
});
|
||||
}
|
||||
|
||||
public Camera Get3DCamera()
|
||||
{
|
||||
return Camera;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Camera = null;
|
||||
}
|
||||
}
|
||||
124
SVSim.BattleEngine/Engine/BattleControl.cs
Normal file
124
SVSim.BattleEngine/Engine/BattleControl.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattleControl : MonoBehaviour
|
||||
{
|
||||
private BattleManagerBase m_BtlMgrIns;
|
||||
|
||||
private int FirstAttack;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
m_BtlMgrIns = BattleManagerBase.GetIns();
|
||||
GameMgr.GetIns().GetInputMgr().SetLayerMask(512);
|
||||
LocalLog.AccumulateLastTraceLog("StartBattleCoroutine ");
|
||||
StartCoroutine(WaitLoadOpponentObjectToBattleStart(m_BtlMgrIns.LoadOpponentObjects()));
|
||||
}
|
||||
|
||||
private IEnumerator WaitLoadOpponentObjectToBattleStart(VfxBase vfx)
|
||||
{
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
FirstAttack = ToolboxGame.RealTimeNetworkAgent.GetIsFirstPlayer();
|
||||
}
|
||||
while (!vfx.IsEnd)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
LocalLog.AccumulateLastTraceLog("DecideFirstUser End ");
|
||||
m_BtlMgrIns.StartOpening(FirstAttack);
|
||||
}
|
||||
|
||||
public void BattleEnd(UIManager.ViewScene MoveTo, Action callback = null, Action<UIManager.ChangeViewSceneParam> paramCustomize = null, object sceneParam = null)
|
||||
{
|
||||
ToolboxGame.UIManager.gameObject.SetActive(value: true);
|
||||
UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam();
|
||||
changeViewSceneParam.OnBeforeChange = delegate
|
||||
{
|
||||
BattleManagerBase.GetIns().DisposeBattleGameObj();
|
||||
};
|
||||
changeViewSceneParam.OnChange = delegate
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().DestroyBattleEffectContainer();
|
||||
GameMgr.GetIns().GetDataMgr().ResetEnemyData();
|
||||
GameMgr.GetIns().DestroyBattleManagements();
|
||||
GameMgr.GetIns().GetGameObjMgr().GetUIContainer()
|
||||
.SetActive(value: false);
|
||||
if (callback != null)
|
||||
{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
paramCustomize.Call(changeViewSceneParam);
|
||||
StartCoroutine(UnloadAllResources(MoveTo, changeViewSceneParam, null, sceneParam));
|
||||
}
|
||||
|
||||
private IEnumerator UnloadAllResources(UIManager.ViewScene MoveTo = UIManager.ViewScene.None, UIManager.ChangeViewSceneParam param = null, Action callback = null, object sceneParam = null)
|
||||
{
|
||||
BattleLogManager.GetInstance().Clear();
|
||||
GameMgr.GetIns().GetEffectMgr().ClearLastCacheEffect();
|
||||
StopAllTweens();
|
||||
yield return Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
callback?.Invoke();
|
||||
if (MoveTo != UIManager.ViewScene.None)
|
||||
{
|
||||
UIManager.GetInstance().ChangeViewScene(MoveTo, param, sceneParam);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator BattleEnd(Action callback = null)
|
||||
{
|
||||
BattleRelease();
|
||||
yield return Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
callback?.Invoke();
|
||||
}
|
||||
|
||||
public void BattleRelease()
|
||||
{
|
||||
ToolboxGame.UIManager.gameObject.SetActive(value: true);
|
||||
GameMgr.GetIns().GetEffectMgr().DestroyBattleEffectContainer();
|
||||
GameMgr.GetIns().GetDataMgr().ResetEnemyData();
|
||||
if (BattleManagerBase.GetIns() != null)
|
||||
{
|
||||
BattleManagerBase.GetIns().DisposeBattleGameObj();
|
||||
}
|
||||
GameMgr.GetIns().DestroyBattleManagements();
|
||||
GameMgr.GetIns().GetGameObjMgr().GetUIContainer()
|
||||
.SetActive(value: false);
|
||||
BattleLogManager.GetInstance().Clear();
|
||||
GameMgr.GetIns().GetEffectMgr().ClearLastCacheEffect();
|
||||
StopAllTweens();
|
||||
}
|
||||
|
||||
private void StopAllTweens()
|
||||
{
|
||||
HashSet<GameObject> hashSet = new HashSet<GameObject>();
|
||||
for (int i = 0; i < iTween.tweens.Count; i++)
|
||||
{
|
||||
if (iTween.tweens[i] != null)
|
||||
{
|
||||
GameObject gameObject = (GameObject)iTween.tweens[i]["target"];
|
||||
if (gameObject != null)
|
||||
{
|
||||
hashSet.Add(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (GameObject item in hashSet)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
iTween.Stop(item);
|
||||
}
|
||||
}
|
||||
iTween.tweens.Clear();
|
||||
}
|
||||
}
|
||||
246
SVSim.BattleEngine/Engine/BattleEnemy.cs
Normal file
246
SVSim.BattleEngine/Engine/BattleEnemy.cs
Normal file
@@ -0,0 +1,246 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle;
|
||||
using Wizard.Battle.Player.Emotion;
|
||||
using Wizard.Battle.View;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattleEnemy : BattlePlayerBase
|
||||
{
|
||||
private readonly Vector3 OFFSET_THINK_ICON_FROM_CLASSVIEW = new Vector3(0.62f, 0.15f, 0f);
|
||||
|
||||
private IEmotion _emotion;
|
||||
|
||||
private readonly Vector3 FIELD_CENTER_POSITION = new Vector3(0f, 0.25f, 0f);
|
||||
|
||||
public override bool IsGameFirst => !base.BattleMgr.IsFirst;
|
||||
|
||||
public override bool IsPlayer => false;
|
||||
|
||||
public override IBattlePlayerView BattleView => BattleEnemyView;
|
||||
|
||||
public override IEmotion Emotion => _emotion;
|
||||
|
||||
public virtual IBattlePlayerView BattleEnemyView { get; protected set; }
|
||||
|
||||
public bool EnableEnemyAI { get; set; }
|
||||
|
||||
public override int Turn
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!base.BattleMgr.IsFirst)
|
||||
{
|
||||
return base.BattleMgr.FirstTurn;
|
||||
}
|
||||
return base.BattleMgr.SecondTurn;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (base.BattleMgr.IsFirst)
|
||||
{
|
||||
base.BattleMgr.SecondTurn = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.BattleMgr.FirstTurn = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<List<int>> OnMulliganEndForReplay;
|
||||
|
||||
public BattleEnemy(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround, IInnerOptionsBuilder innerOptionsBuilder)
|
||||
: base(battleMgr, battleCamera, backGround, innerOptionsBuilder)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
BattleEnemyView = new BattleEnemyView(this);
|
||||
}
|
||||
|
||||
protected override void CreateSelfBattleCard()
|
||||
{
|
||||
EnemyClassBattleCard item = new EnemyClassBattleCard(new ClassBattleCardBase.ClassBuildInfo(_isPlayer: false, 20, this, base.BattleMgr.BattlePlayer, base.BattleMgr, base.BattleMgr.BattleResourceMgr));
|
||||
base.ClassAndInPlayCardList.Add(item);
|
||||
}
|
||||
|
||||
public override void Setup(BattlePlayerBase opponentBattlePlayer)
|
||||
{
|
||||
_emotion = _innerOptionsBuilder.CreateEnemyEmotion((IClassBattleCardView)base.Class.BattleCardView);
|
||||
base.Setup(opponentBattlePlayer);
|
||||
}
|
||||
|
||||
public override void SetupClone(BattlePlayerBase sourceBattlePlayer, BattlePlayerBase virtualOpponentBattlePlayer, CloneActualFlags cloneFlags)
|
||||
{
|
||||
sourceBattlePlayer.CopyToVirtualBase(this, virtualOpponentBattlePlayer, cloneFlags);
|
||||
}
|
||||
|
||||
public override VfxBase StartTurnControl(string log = "")
|
||||
{
|
||||
if (GameMgr.GetIns().IsAdminWatch)
|
||||
{
|
||||
UpdateHandCardsPlayability();
|
||||
}
|
||||
Turn++;
|
||||
SequentialVfxPlayer sequentialVfxPlayer = TurnEvolveControl(BattleView.EpIcon);
|
||||
VfxBase vfx = TurnStart();
|
||||
sequentialVfxPlayer.Register(vfx);
|
||||
VfxBase vfx2 = BattleManagerBase.GetIns().JudgeBattleResult();
|
||||
sequentialVfxPlayer.Register(vfx2);
|
||||
sequentialVfxPlayer.Register(CreateThinkingVfx(base.BattleMgr));
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
public VfxBase CreateThinkingVfx(BattleManagerBase battleMgr)
|
||||
{
|
||||
if (GameMgr.GetIns().IsAdminWatch)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
return new DelaySetupVfx(() => new ThinkIconShowVfx(delegate
|
||||
{
|
||||
Vector3 position = base.BattleCamera.Get3DCamera().WorldToScreenPoint(base.Class.BattleCardView.Transform.position + OFFSET_THINK_ICON_FROM_CLASSVIEW);
|
||||
return UIManager.GetInstance().getCamera().ScreenToWorldPoint(position);
|
||||
}, battleMgr.BattleResourceMgr));
|
||||
}
|
||||
|
||||
public override VfxBase UsePp(int pp, bool isNewReplayMoveTurn = false)
|
||||
{
|
||||
base.UsePp(pp);
|
||||
int usedPp = base.Pp;
|
||||
int maxPp = base.PpTotal;
|
||||
Vector3 labelPosition = default(Vector3);
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
Vector3 position = base.BattleCamera.Get3DCamera().WorldToScreenPoint(StatusPanelControl.GetPPPanel().transform.Find("PPIcon/PPLabel").transform.position);
|
||||
labelPosition = UIManager.GetInstance().getCamera().ScreenToWorldPoint(position);
|
||||
}));
|
||||
sequentialVfxPlayer.Register(new DelaySetupVfx(() => m_vfxCreator.CreateUsePp(usedPp, maxPp, labelPosition, isNewReplayMoveTurn)));
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
protected override VfxBase TurnStartDrawCard(SkillProcessor skillProcessor)
|
||||
{
|
||||
NullVfx.GetInstance();
|
||||
int drawCount = ((IsGameFirst || Turn != 1) ? 1 : 2);
|
||||
VfxWith<IEnumerable<BattleCardBase>> vfxWith = RandomCardDraw(drawCount, skillProcessor);
|
||||
VfxBase vfxBase = CardDrawVfx(vfxWith.Value);
|
||||
SequentialVfxPlayer result = SequentialVfxPlayer.Create(vfxWith.Vfx, vfxBase);
|
||||
if (!base.Class.IsDead && EnableEnemyAI)
|
||||
{
|
||||
base.BattleMgr.EnemyAI.ExecuteEnemyAI(useWait: true);
|
||||
}
|
||||
_ = base.Class.IsDead;
|
||||
return result;
|
||||
}
|
||||
|
||||
public override VfxBase CardDrawVfx(IEnumerable<BattleCardBase> DrawList, bool skipShuffle = false, bool isOpenDrawSkill = false)
|
||||
{
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
if (GameMgr.GetIns().IsAdminWatch)
|
||||
{
|
||||
foreach (BattleCardBase card in DrawList)
|
||||
{
|
||||
if (card.BaseCost != card.Cost)
|
||||
{
|
||||
List<int> costList = card.BattleCardView.GetUseCostList(card.Cost);
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
card.BattleCardView.UpdateCost(costList);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
sequentialVfxPlayer.Register(new OpponentDrawCardVfx(DrawList, isOpenDrawSkill));
|
||||
sequentialVfxPlayer.Register(new OpponentDrawCardToHandVfx(DrawList.ToList(), 0.4f, isOpenDrawSkill, skipShuffle));
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
public override VfxBase TurnEnd()
|
||||
{
|
||||
ParallelVfxPlayer result = ParallelVfxPlayer.Create(base.TurnEnd(), new ThinkIconHideVfx(base.BattleMgr.BattleResourceMgr));
|
||||
if (GameMgr.GetIns().IsAdminWatch)
|
||||
{
|
||||
foreach (BattleCardBase handCard in base.HandCardList)
|
||||
{
|
||||
handCard.BattleCardView.HideCanPlayEffect();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected override void SetActive()
|
||||
{
|
||||
if (GameMgr.GetIns().IsAdminWatch)
|
||||
{
|
||||
UpdateHandCardsPlayability();
|
||||
}
|
||||
if (!IsGameFirst || Turn != 1)
|
||||
{
|
||||
base.IsChoiceBraveEffectTiming = true;
|
||||
BattleEnemyView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
|
||||
}
|
||||
}
|
||||
|
||||
public override BattlePlayerBase CreateVirtualPlayer()
|
||||
{
|
||||
return new VirtualBattleEnemy(base.BattleMgr, base.BattleCamera, base.BackGround);
|
||||
}
|
||||
|
||||
public override void UpdateHandCardsPlayability(bool areArrowsForcedOff = false)
|
||||
{
|
||||
foreach (BattleCardBase handCard in _opponentBattlePlayer.HandCardList)
|
||||
{
|
||||
handCard.BattleCardView.areArrowsForcedOff = areArrowsForcedOff;
|
||||
handCard.BattleCardView.UpdateMovability();
|
||||
}
|
||||
if (!GameMgr.GetIns().IsAdmin)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (BattleCardBase handCard2 in base.HandCardList)
|
||||
{
|
||||
handCard2.BattleCardView.areArrowsForcedOff = areArrowsForcedOff;
|
||||
handCard2.BattleCardView.UpdateMovability();
|
||||
}
|
||||
if (base.IsSelfTurn)
|
||||
{
|
||||
BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
|
||||
}
|
||||
}
|
||||
|
||||
public override VfxBase MoveToHand(List<BattleCardBase> cardsToMoveToHand)
|
||||
{
|
||||
return SequentialVfxPlayer.Create(new OpponentDrawCardToHandVfx(cardsToMoveToHand.ToList(), 0.3f), InstantVfx.Create(delegate
|
||||
{
|
||||
UpdateHandCardsPlayability();
|
||||
}));
|
||||
}
|
||||
|
||||
public override EffectBattle GetSkillEffect(string skillEffectPath)
|
||||
{
|
||||
return GameMgr.GetIns().GetEffectMgr().GetEnemyEffectBattle(skillEffectPath);
|
||||
}
|
||||
|
||||
public override Vector3 GetFieldCenterPosition()
|
||||
{
|
||||
return FIELD_CENTER_POSITION;
|
||||
}
|
||||
|
||||
public override VfxBase TurnStartDraw(SkillProcessor skillProcessor)
|
||||
{
|
||||
return base.TurnStartDraw(skillProcessor);
|
||||
}
|
||||
|
||||
public void CallRecordingMulliganEnd(List<int> cardIndexList)
|
||||
{
|
||||
this.OnMulliganEndForReplay.Call(cardIndexList);
|
||||
}
|
||||
}
|
||||
25
SVSim.BattleEngine/Engine/BattleFinishParam.cs
Normal file
25
SVSim.BattleEngine/Engine/BattleFinishParam.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard;
|
||||
|
||||
public class BattleFinishParam : BaseParam
|
||||
{
|
||||
public int class_id;
|
||||
|
||||
public int total_turn;
|
||||
|
||||
public int evolve_count;
|
||||
|
||||
public int enemy_evolve_count;
|
||||
|
||||
public int battle_result;
|
||||
|
||||
public int is_retire;
|
||||
|
||||
public Dictionary<string, int> mission;
|
||||
|
||||
public string recovery_data;
|
||||
|
||||
public int SDTRB;
|
||||
|
||||
public string[] prosessing_time_data;
|
||||
}
|
||||
29
SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs
Normal file
29
SVSim.BattleEngine/Engine/BattleLifeTimeSharedObject.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class BattleLifeTimeSharedObject
|
||||
{
|
||||
private Dictionary<string, SkillCreator.SkillBuildInfo> _skillBuildInfoSharedObject;
|
||||
|
||||
public BattleLifeTimeSharedObject()
|
||||
{
|
||||
_skillBuildInfoSharedObject = new Dictionary<string, SkillCreator.SkillBuildInfo>();
|
||||
}
|
||||
|
||||
~BattleLifeTimeSharedObject()
|
||||
{
|
||||
_skillBuildInfoSharedObject.Clear();
|
||||
}
|
||||
|
||||
public void SetSkillBuildInfo(string key, SkillCreator.SkillBuildInfo value)
|
||||
{
|
||||
if (!_skillBuildInfoSharedObject.ContainsKey(key))
|
||||
{
|
||||
_skillBuildInfoSharedObject.Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public SkillCreator.SkillBuildInfo GetSkillBuildInfo(string key)
|
||||
{
|
||||
return _skillBuildInfoSharedObject.GetValueOrDefault(key, null);
|
||||
}
|
||||
}
|
||||
609
SVSim.BattleEngine/Engine/BattleMenuMgr.cs
Normal file
609
SVSim.BattleEngine/Engine/BattleMenuMgr.cs
Normal file
@@ -0,0 +1,609 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.View;
|
||||
using Wizard.RoomMatch;
|
||||
|
||||
public class BattleMenuMgr : NonDialogPopup
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject UserPanel;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs UserPanelP;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs UserPanelE;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject CharPanelP;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject CharPanelE;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture CharTextureP;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture CharTextureE;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _roomIDRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _roomIDLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _winnerRewardRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _winnerRewardBox;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _winnerRewardNameLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _vsRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _ratingRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _backSpriteRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _backSpriteButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _defaultMenuRoot;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _titleLine;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _titleLineWithFormat;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _formatLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _formatIcon;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _tsRotaionFormatLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _retireButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _retireButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _settingButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _settingButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _backButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _backButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _questMenuRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _questRetireButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _questRetireButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _questSettingButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _questSettingButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _questBackButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _questBackButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _questMissionButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _questMissionButtonLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _questMissionDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoP;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoE;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoWithSubClassP;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoWithSubClassE;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _subClassGridP;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _subClassGridE;
|
||||
|
||||
[SerializeField]
|
||||
private MyRotationParts _myRotationInfoP;
|
||||
|
||||
[SerializeField]
|
||||
private MyRotationParts _myRotationInfoE;
|
||||
|
||||
private Dictionary<string, Vector3> defPosDict = new Dictionary<string, Vector3>();
|
||||
|
||||
public const float OPEN_DURATION_TIME = 0.3f;
|
||||
|
||||
private bool IsQuestBattle => GameMgr.GetIns().GetDataMgr().IsQuestBattleType();
|
||||
|
||||
public GameObject QuestMissionDialogPrefab => _questMissionDialogPrefab;
|
||||
|
||||
public void DisplayBattleMenu(Action retireAction, Action settingAction, Action backAction, Action questMissionAction)
|
||||
{
|
||||
InitializeBattleMenu();
|
||||
iTween.MoveTo(UserPanel, iTween.Hash("position", defPosDict["UserPanel"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CharPanelP, iTween.Hash("position", defPosDict["CharPanelP"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CharPanelE, iTween.Hash("position", defPosDict["CharPanelE"], "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenAlpha.Begin(UserPanel, 0f, 0f);
|
||||
TweenAlpha.Begin(UserPanel, 0.3f, 1f);
|
||||
if (IsQuestBattle && !BattleManagerBase.GetIns().IsPuzzleMgr && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.BossRushQuest && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.SecretBossQuest)
|
||||
{
|
||||
SetupQuestButtonMenu(retireAction, settingAction, backAction, questMissionAction);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetupDefaultButtonMenu(retireAction, settingAction, backAction);
|
||||
}
|
||||
TweenAlpha.Begin(base.gameObject, 0f, 0f);
|
||||
TweenAlpha.Begin(base.gameObject, 0.3f, 1f);
|
||||
TweenAlpha.Begin(_backSpriteRoot.gameObject, 0f, 0f);
|
||||
TweenAlpha.Begin(_backSpriteRoot.gameObject, 0.3f, 1f);
|
||||
}
|
||||
|
||||
private void InitializeBattleMenu()
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData();
|
||||
PuzzleQuestData puzzleQuestData = null;
|
||||
bool isPuzzleMgr = BattleManagerBase.GetIns().IsPuzzleMgr;
|
||||
if (isPuzzleMgr)
|
||||
{
|
||||
puzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId);
|
||||
}
|
||||
string text = PlayerStaticData.UserName.ToString();
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
text = networkUserInfoData.GetSelfName();
|
||||
}
|
||||
UserPanelP.labels[0].text = text;
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UserPanelE.labels[0].text = VideoHostingUtil.GetUserNameHidden(networkUserInfoData.GetOpponentName().ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.labels[0].text = dataMgr.GetEnemyCharaData().chara_name;
|
||||
}
|
||||
if (dataMgr.m_BattleType == DataMgr.BattleType.RankBattle)
|
||||
{
|
||||
if (PlayerStaticData.IsMasterRankCurrentFormat())
|
||||
{
|
||||
UserPanelP.labels[1].text = PlayerStaticData.UserMasterPointCurrentFormat().ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = PlayerStaticData.UserBattlePointCurrentFormat();
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
num = networkUserInfoData.GetSelfBattlePoint();
|
||||
}
|
||||
UserPanelP.labels[1].text = num.ToString();
|
||||
}
|
||||
if (networkUserInfoData.GetOpponentIsMasterRank())
|
||||
{
|
||||
UserPanelE.labels[1].text = networkUserInfoData.GetOpponentMasterPoint().ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.labels[1].text = networkUserInfoData.GetOpponentBattlePoint().ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.labels[1].gameObject.SetActive(value: false);
|
||||
UserPanelE.labels[1].gameObject.SetActive(value: false);
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UserPanelP.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else if (isPuzzleMgr)
|
||||
{
|
||||
UserPanelP.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.PlayerEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerStaticData.AttachUserEmblemTexture(UserPanelP.textures[0], PlayerStaticData.EmblemTexSize.M);
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = 100000000;
|
||||
if (isPuzzleMgr)
|
||||
{
|
||||
num2 = puzzleQuestData.EnemyEmblemId;
|
||||
}
|
||||
else if (dataMgr.m_BattleType == DataMgr.BattleType.Quest)
|
||||
{
|
||||
num2 = dataMgr.QuestBattleData.EmblemId;
|
||||
}
|
||||
else if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest || dataMgr.m_BattleType == DataMgr.BattleType.SecretBossQuest)
|
||||
{
|
||||
num2 = dataMgr.BossRushBattleData.EmblemId;
|
||||
}
|
||||
string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M);
|
||||
if (Toolbox.ResourcesManager.IsLoadedAssetBundle(assetTypePath))
|
||||
{
|
||||
UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.textures[0].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(num2.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[1], networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.SMALL);
|
||||
}
|
||||
else if (isPuzzleMgr)
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[1], puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.MIDDLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[1], PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.SMALL);
|
||||
}
|
||||
int num3 = (GameMgr.GetIns().IsNetworkBattle ? networkUserInfoData.GetOpponentDegreeId() : (isPuzzleMgr ? puzzleQuestData.EnemyDegreeId : ((dataMgr.m_BattleType == DataMgr.BattleType.Quest) ? dataMgr.QuestBattleData.DegreeId : ((dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest) ? dataMgr.PracticeDifficultyDegreeId : dataMgr.BossRushBattleData.DegreeId))));
|
||||
if ((dataMgr.m_BattleType != DataMgr.BattleType.Practice || dataMgr.PracticeDifficultyDegreeId != -1 || isPuzzleMgr) && (!dataMgr.IsQuestBattleType() || num3 != -1) && dataMgr.m_BattleType != DataMgr.BattleType.Story)
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelE.textures[1], num3, DegreeHelper.DegreeType.SMALL);
|
||||
}
|
||||
UserPanelE.textures[1].gameObject.SetActive(value: true);
|
||||
if (dataMgr.m_BattleType != DataMgr.BattleType.Practice && dataMgr.m_BattleType != DataMgr.BattleType.Story && dataMgr.m_BattleType != DataMgr.BattleType.Quest && dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest)
|
||||
{
|
||||
if (GameMgr.GetIns().IsWatchBattle || UserPanelP.textures[2].mainTexture == null)
|
||||
{
|
||||
UserPanelP.textures[2].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerStaticData.AttachUserRankTexture(UserPanelP.textures[2], PlayerStaticData.RankTexSize.S);
|
||||
}
|
||||
UserPanelE.textures[2].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.textures[2].gameObject.SetActive(value: false);
|
||||
UserPanelE.textures[2].gameObject.SetActive(value: false);
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UIUtil.SetCountryTexture(UserPanelP.textures[3], networkUserInfoData.GetSelfCountryCode());
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag = !string.IsNullOrEmpty(PlayerStaticData.UserCountryCode);
|
||||
UserPanelP.textures[3].gameObject.SetActive(flag);
|
||||
if (flag)
|
||||
{
|
||||
PlayerStaticData.AttachUserCountryTexture(UserPanelP.textures[3], PlayerStaticData.CountryTexSize.M);
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.textures[3].mainTexture = null;
|
||||
}
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UIUtil.SetCountryTexture(UserPanelE.textures[3], networkUserInfoData.GetOpponentCountryCode());
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.textures[3].gameObject.SetActive(value: false);
|
||||
UserPanelE.textures[3].mainTexture = null;
|
||||
}
|
||||
_myRotationInfoP.gameObject.SetActive(value: false);
|
||||
if (dataMgr.TryGetPlayerSubClassId(out var subClassId))
|
||||
{
|
||||
SetClassInfoWithSubClass(dataMgr.GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId(), subClassId, _classInfoP, _classInfoWithSubClassP, _subClassGridP);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dataMgr.TryGetPlayerMyRotationInfo(out var myRotationInfo))
|
||||
{
|
||||
_myRotationInfoP.gameObject.SetActive(value: true);
|
||||
_myRotationInfoP.SetMyRotationInfo(myRotationInfo);
|
||||
_myRotationInfoP.Reposition();
|
||||
}
|
||||
_classInfoP.InitByCharaPrm(dataMgr.GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId());
|
||||
_classInfoWithSubClassP.gameObject.SetActive(value: false);
|
||||
}
|
||||
_myRotationInfoE.gameObject.SetActive(value: false);
|
||||
if (dataMgr.TryGetEnemySubClassId(out var subClassId2))
|
||||
{
|
||||
SetClassInfoWithSubClass(dataMgr.GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId(), subClassId2, _classInfoE, _classInfoWithSubClassE, _subClassGridE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dataMgr.TryGetEnemyMyRotationInfo(out var myRotationInfo2))
|
||||
{
|
||||
_myRotationInfoE.gameObject.SetActive(value: true);
|
||||
_myRotationInfoE.SetMyRotationInfo(myRotationInfo2);
|
||||
_myRotationInfoE.Reposition();
|
||||
}
|
||||
_classInfoE.InitByCharaPrm(dataMgr.GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId());
|
||||
_classInfoWithSubClassE.gameObject.SetActive(value: false);
|
||||
}
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
string playerSkinId = dataMgr.GetPlayerSkinId().ToString("00");
|
||||
ResourcesManager.AssetLoadPathType assetTypePlayer = (ins.BattlePlayer.IsSkinEvolved ? ResourcesManager.AssetLoadPathType.ClassCharaEvolve : ResourcesManager.AssetLoadPathType.ClassCharaBase);
|
||||
string playerClassAssetName = Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer);
|
||||
if (Toolbox.ResourcesManager.IsLoadedAssetBundle(playerClassAssetName))
|
||||
{
|
||||
CharTextureP.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(playerClassAssetName, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(playerClassAssetName);
|
||||
CharTextureP.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId, assetTypePlayer, isfetch: true));
|
||||
}));
|
||||
}
|
||||
string enemySkinId = dataMgr.GetEnemySkinId().ToString("00");
|
||||
ResourcesManager.AssetLoadPathType assetTypeEnemy = (ins.BattleEnemy.IsSkinEvolved ? ResourcesManager.AssetLoadPathType.ClassCharaEvolve : ResourcesManager.AssetLoadPathType.ClassCharaBase);
|
||||
string enemyClassAssetName = Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy);
|
||||
if (Toolbox.ResourcesManager.IsLoadedAssetBundle(enemyClassAssetName))
|
||||
{
|
||||
CharTextureE.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(Toolbox.ResourcesManager.LoadAssetAsync(enemyClassAssetName, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(enemyClassAssetName);
|
||||
CharTextureE.mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(enemySkinId, assetTypeEnemy, isfetch: true));
|
||||
}));
|
||||
}
|
||||
bool activeOfficialUserIconSprite = (GameMgr.GetIns().IsWatchBattle ? networkUserInfoData.GetSelfIsOfficialUser() : PlayerStaticData.IsOfficialUserDisplay);
|
||||
bool activeOfficialUserIconSprite2 = GameMgr.GetIns().IsNetworkBattle && networkUserInfoData.GetOpponentIsOfficialUser();
|
||||
UserPanelP.gameObject.GetComponent<BattleMenuUserPanel>().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite);
|
||||
UserPanelE.gameObject.GetComponent<BattleMenuUserPanel>().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite2);
|
||||
defPosDict["UserPanel"] = UserPanel.transform.localPosition + (IsQuestBattle ? new Vector3(0f, -7f, 0f) : Vector3.zero);
|
||||
defPosDict["CharPanelP"] = CharPanelP.transform.localPosition;
|
||||
defPosDict["CharPanelE"] = CharPanelE.transform.localPosition;
|
||||
UserPanel.transform.localPosition = defPosDict["UserPanel"] + Vector3.down * 50f;
|
||||
CharPanelP.transform.localPosition = defPosDict["CharPanelP"] + Vector3.left * 300f;
|
||||
CharPanelE.transform.localPosition = defPosDict["CharPanelE"] + Vector3.right * 300f;
|
||||
TweenAlpha.Begin(UserPanel, 0f, 0f);
|
||||
if (dataMgr.GetEnemyBattleSkillReverse() == 0)
|
||||
{
|
||||
CharTextureE.uvRect = new Rect(1f, 0f, -1f, 1f);
|
||||
}
|
||||
_SetupRoomIDObj();
|
||||
SetupRankWinnerReward();
|
||||
if (CustomPreference.GetTextLanguage() == Global.LANG_TYPE.Kor.ToString())
|
||||
{
|
||||
_ratingRoot.SetActive(value: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ratingRoot.SetActive(value: false);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetClassInfoWithSubClass(ClassCharacterMasterData charaData, int chaosId, int subClassId, ClassInfoParts defaultClassInfoParts, ClassInfoParts classInfoParts, FlexibleGrid grid)
|
||||
{
|
||||
classInfoParts.gameObject.SetActive(value: true);
|
||||
defaultClassInfoParts.ClassNameLabel.text = string.Empty;
|
||||
classInfoParts.InitByCharaPrm(charaData, chaosId);
|
||||
classInfoParts.SetSubClass((CardBasePrm.ClanType)subClassId);
|
||||
UIUtil.AdjustClassInfoPartsSize(classInfoParts, grid, defaultClassInfoParts.ClassNameLabel.width);
|
||||
}
|
||||
|
||||
private void _SetupRoomIDObj()
|
||||
{
|
||||
_roomIDRoot.SetActive(value: false);
|
||||
if (GameMgr.GetIns().IsReplayBattle || !GameMgr.GetIns().GetDataMgr().IsRoomBattleType())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (RoomBase.IsConnectControllerActive())
|
||||
{
|
||||
if (!RoomBase.ConnectController.IsGathering)
|
||||
{
|
||||
_roomIDRoot.SetActive(value: true);
|
||||
_roomIDLabel.text = $"{RoomBase.ConnectController.DisplayRoomID:00000}";
|
||||
}
|
||||
}
|
||||
else if (Data.BattleRecoveryInfo != null && !Data.BattleRecoveryInfo.IsGatheringRoom)
|
||||
{
|
||||
_roomIDRoot.SetActive(value: true);
|
||||
_roomIDLabel.text = $"{PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.ROOM_MATCH_DISPLAY_ID):00000}";
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupRankWinnerReward()
|
||||
{
|
||||
if (GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.RankBattle && GameMgr.GetIns().GetDataMgr().m_BattleType != DataMgr.BattleType.TwoPick)
|
||||
{
|
||||
return;
|
||||
}
|
||||
RankWinnerReward rankWinnerReward = GameMgr.GetIns()._rankWinnerReward;
|
||||
if (rankWinnerReward == null)
|
||||
{
|
||||
int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE);
|
||||
string value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING);
|
||||
if (value != 0 && value2 != "")
|
||||
{
|
||||
GameMgr.GetIns()._rankWinnerReward = UIManager.GetInstance().createRankWinnerReward();
|
||||
GameMgr.GetIns()._rankWinnerReward.SetInfomation(value, value2);
|
||||
GameMgr.GetIns()._rankWinnerReward.gameObject.SetActive(value: false);
|
||||
rankWinnerReward = GameMgr.GetIns()._rankWinnerReward;
|
||||
}
|
||||
else
|
||||
{
|
||||
_winnerRewardRoot.SetActive(value: false);
|
||||
}
|
||||
}
|
||||
if (rankWinnerReward != null)
|
||||
{
|
||||
UIManager.GetInstance().AttachAtlas(_winnerRewardRoot);
|
||||
_winnerRewardNameLabel.text = rankWinnerReward.RewardString;
|
||||
_winnerRewardBox.spriteName = rankWinnerReward.GetBoxSpriteName();
|
||||
_winnerRewardBox.transform.localPosition = rankWinnerReward.GetBattleMenuBoxPosition();
|
||||
_winnerRewardRoot.SetActive(value: true);
|
||||
_vsRoot.SetActive(value: false);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDefaultButtonMenu(Action retireAction, Action settingAction, Action backAction)
|
||||
{
|
||||
_defaultMenuRoot.SetActive(value: true);
|
||||
_questMenuRoot.SetActive(value: false);
|
||||
if (Data.CurrentFormat != Format.Max && DataMgr.IsEnableFormatIconBattleType(GameMgr.GetIns().GetDataMgr().m_BattleType))
|
||||
{
|
||||
_titleLine.SetActive(value: false);
|
||||
_titleLineWithFormat.SetActive(value: true);
|
||||
if (Data.CurrentFormat != Format.Rotation || CustomPreference.GetTextLanguage() != Global.LANG_TYPE.Jpn.ToString())
|
||||
{
|
||||
_formatLabel.gameObject.SetActive(value: true);
|
||||
_formatIcon.gameObject.SetActive(value: true);
|
||||
_tsRotaionFormatLabel.gameObject.SetActive(value: false);
|
||||
_formatLabel.text = UIUtil.GetFormatName(Data.CurrentFormat);
|
||||
_formatIcon.spriteName = UIUtil.GetFormatSmallSpriteName(Data.CurrentFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
_formatLabel.gameObject.SetActive(value: false);
|
||||
_formatIcon.gameObject.SetActive(value: false);
|
||||
_tsRotaionFormatLabel.gameObject.SetActive(value: true);
|
||||
_tsRotaionFormatLabel.text = UIUtil.GetFormatName(Data.CurrentFormat);
|
||||
}
|
||||
UIUtil.AddPositionY(_retireButton.transform, -5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_titleLine.SetActive(value: true);
|
||||
_titleLineWithFormat.SetActive(value: false);
|
||||
_formatLabel.gameObject.SetActive(value: false);
|
||||
_formatIcon.gameObject.SetActive(value: false);
|
||||
_tsRotaionFormatLabel.gameObject.SetActive(value: false);
|
||||
}
|
||||
SetButton(_retireButton, _retireButtonLabel, GetRetireButtonText(), delegate
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
retireAction();
|
||||
}, Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetButton(_settingButton, _settingButtonLabel, Data.SystemText.Get("Common_0209"), delegate
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
settingAction();
|
||||
}, Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetButton(_backButton, _backButtonLabel, Data.SystemText.Get("Battle_0406"), delegate
|
||||
{
|
||||
backAction();
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
}, Se.TYPE.SYS_BTN_CANCEL);
|
||||
_backSpriteButton.onClick.Add(new EventDelegate(Close));
|
||||
}
|
||||
|
||||
private void SetupQuestButtonMenu(Action retireAction, Action settingAction, Action backAction, Action questMissionAction)
|
||||
{
|
||||
_defaultMenuRoot.SetActive(value: false);
|
||||
_questMenuRoot.SetActive(value: true);
|
||||
SetButton(_questRetireButton, _questRetireButtonLabel, GetRetireButtonText(), delegate
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
retireAction();
|
||||
}, Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetButton(_questSettingButton, _questSettingButtonLabel, Data.SystemText.Get("Common_0209"), delegate
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
settingAction();
|
||||
}, Se.TYPE.SYS_BTN_DECIDE);
|
||||
SetButton(_questBackButton, _questBackButtonLabel, Data.SystemText.Get("Battle_0406"), delegate
|
||||
{
|
||||
backAction();
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
}, Se.TYPE.SYS_BTN_CANCEL);
|
||||
SetButton(_questMissionButton, _questMissionButtonLabel, Data.SystemText.Get("Quest_0013"), delegate
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
questMissionAction();
|
||||
}, Se.TYPE.SYS_BTN_DECIDE);
|
||||
_backSpriteButton.onClick.Add(new EventDelegate(Close));
|
||||
}
|
||||
|
||||
private string GetRetireButtonText()
|
||||
{
|
||||
string result = Data.SystemText.Get("Common_0051");
|
||||
if (GameMgr.GetIns().IsReplayBattle)
|
||||
{
|
||||
result = Data.SystemText.Get("Common_0149");
|
||||
}
|
||||
else if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
result = Data.SystemText.Get("Common_0147");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SetButton(UIButton button, UILabel label, string text, Action action, Se.TYPE se)
|
||||
{
|
||||
label.text = text;
|
||||
button.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(se);
|
||||
action();
|
||||
}));
|
||||
}
|
||||
|
||||
public void SetSettingButtonDisable()
|
||||
{
|
||||
UIManager.SetObjectToGrey(_settingButton.gameObject, b: true);
|
||||
UIManager.SetObjectToGrey(_questSettingButton.gameObject, b: true);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
if (_defaultMenuRoot.activeSelf)
|
||||
{
|
||||
EventDelegate.Execute(_backButton.onClick);
|
||||
}
|
||||
else if (_questMenuRoot.activeSelf)
|
||||
{
|
||||
EventDelegate.Execute(_questBackButton.onClick);
|
||||
}
|
||||
}
|
||||
}
|
||||
346
SVSim.BattleEngine/Engine/BattlePlayer.cs
Normal file
346
SVSim.BattleEngine/Engine/BattlePlayer.cs
Normal file
@@ -0,0 +1,346 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle;
|
||||
using Wizard.Battle.Player.Emotion;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattlePlayer : BattlePlayerBase
|
||||
{
|
||||
private readonly Vector3 FIELD_CENTER_POSITION = new Vector3(0f, -0.3f, 0f);
|
||||
|
||||
private BattleUIContainer _battleUIContainer;
|
||||
|
||||
protected CanNotTouchCardVfx _canNotTouchCardVfx;
|
||||
|
||||
public bool _isPlayerActive;
|
||||
|
||||
public int PlayCardTouchCount;
|
||||
|
||||
public bool IsTimeOverTurnEndProcessing;
|
||||
|
||||
public bool IsDuringChoiceBrave;
|
||||
|
||||
public override bool IsGameFirst => base.BattleMgr.IsFirst;
|
||||
|
||||
public override bool IsPlayer => true;
|
||||
|
||||
public override IBattlePlayerView BattleView => PlayerBattleView;
|
||||
|
||||
public virtual IPlayerView PlayerBattleView { get; protected set; }
|
||||
|
||||
public override IEmotion Emotion => PlayerEmotion;
|
||||
|
||||
public IPlayerEmotion PlayerEmotion { get; protected set; }
|
||||
|
||||
public bool IsTurnStartEffectNotFinished { get; set; }
|
||||
|
||||
public override bool CanChoiceBraveThisTurn
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!base.IsAlreadyChoiceBraveInThisTurn && !IsTimeOverTurnEndProcessing)
|
||||
{
|
||||
return base.IsChoiceBraveEffectTiming;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanChoiceBrave
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CanChoiceBraveThisTurn && base.CanPlayAnyChoiceBraveCard && BattleView.IsTouchable() && !BattleView.IsSelecting && !CantPlayChoiceBrave)
|
||||
{
|
||||
return !PlayerBattleView.IsMoving();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public event Func<VfxBase> OnAfterPlayerTurnStart;
|
||||
|
||||
public event Action OnPlayerActive;
|
||||
|
||||
public event Action<List<BattleCardBase>> OnMulliganEndForReplay;
|
||||
|
||||
public BattlePlayer(BattleManagerBase battleMgr, BattleCamera battleCamera, BackGroundBase backGround, IInnerOptionsBuilder innerOptionsBuilder)
|
||||
: base(battleMgr, battleCamera, backGround, innerOptionsBuilder)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
PlayerBattleView = new BattlePlayerView(this);
|
||||
}
|
||||
|
||||
protected override void CreateSelfBattleCard()
|
||||
{
|
||||
PlayerClassBattleCard item = new PlayerClassBattleCard(new ClassBattleCardBase.ClassBuildInfo(_isPlayer: true, 20, this, base.BattleMgr.BattleEnemy, base.BattleMgr, base.BattleMgr.BattleResourceMgr));
|
||||
base.ClassAndInPlayCardList.Add(item);
|
||||
}
|
||||
|
||||
public override void Setup(BattlePlayerBase opponentBattlePlayer)
|
||||
{
|
||||
if (_battleUIContainer == null && !(this is VirtualBattlePlayer) && (base.IsSelfTurn || IsTurnStartEffectNotFinished))
|
||||
{
|
||||
_battleUIContainer = base.BattleMgr.BattleUIContainer;
|
||||
_battleUIContainer.DisableMenu();
|
||||
}
|
||||
PlayerEmotion = _innerOptionsBuilder.CreatePlayerEmotion((IClassBattleCardView)base.Class.BattleCardView);
|
||||
base.OnTurnEnd += (SkillProcessor skill) => InstantVfx.Create(delegate
|
||||
{
|
||||
if (!GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
PlayerBattleView.TurnEndButtonUI.ChangeButtonView(base.IsSelfTurn);
|
||||
}
|
||||
});
|
||||
opponentBattlePlayer.OnTurnStartAfterDraw += () => InstantVfx.Create(delegate
|
||||
{
|
||||
EnableBattleMenu();
|
||||
ITurnEndButtonUI turnEndButtonUI = PlayerBattleView.TurnEndButtonUI;
|
||||
if (!turnEndButtonUI.GameObject.activeSelf)
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition());
|
||||
}
|
||||
turnEndButtonUI.GameObject.SetActive(value: true);
|
||||
turnEndButtonUI.EnableButton();
|
||||
turnEndButtonUI.HideBtn();
|
||||
turnEndButtonUI.ChangeButtonView(base.IsSelfTurn);
|
||||
});
|
||||
base.Setup(opponentBattlePlayer);
|
||||
}
|
||||
|
||||
public override void SetupClone(BattlePlayerBase sourceBattlePlayer, BattlePlayerBase virtualOpponentBattlePlayer, CloneActualFlags cloneFlags)
|
||||
{
|
||||
sourceBattlePlayer.CopyToVirtualBase(this, virtualOpponentBattlePlayer, cloneFlags);
|
||||
}
|
||||
|
||||
public override void SetupCardEvent(BattleCardBase card)
|
||||
{
|
||||
base.SetupCardEvent(card);
|
||||
card.OnPlay += delegate
|
||||
{
|
||||
foreach (BattleCardBase item in base.HandCardList.Where((BattleCardBase c) => c != card))
|
||||
{
|
||||
item.BattleCardView.UpdateMovability();
|
||||
}
|
||||
BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
|
||||
return NullVfx.GetInstance();
|
||||
};
|
||||
}
|
||||
|
||||
public override VfxBase TurnStart()
|
||||
{
|
||||
VfxBase vfxBase = base.TurnStart();
|
||||
if (base.BattleMgr.IsRecovery)
|
||||
{
|
||||
EnableBattleMenu();
|
||||
if (base.IsSelfTurn)
|
||||
{
|
||||
_isPlayerActive = true;
|
||||
}
|
||||
}
|
||||
return SequentialVfxPlayer.Create(vfxBase, InstantVfx.Create(PlayerBattleView.UpdateTurnEndPulseEffect));
|
||||
}
|
||||
|
||||
public void TurnStartEffectEnd()
|
||||
{
|
||||
IsTurnStartEffectNotFinished = false;
|
||||
}
|
||||
|
||||
private void EnableBattleMenu()
|
||||
{
|
||||
if (_battleUIContainer != null)
|
||||
{
|
||||
_battleUIContainer.EnableMenu();
|
||||
}
|
||||
}
|
||||
|
||||
public override VfxBase StartTurnControl(string log = "")
|
||||
{
|
||||
if (_canNotTouchCardVfx == null)
|
||||
{
|
||||
_canNotTouchCardVfx = new CanNotTouchCardVfx();
|
||||
BattleManagerBase.GetIns().VfxMgr.RegisterImmediateVfx(_canNotTouchCardVfx);
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
NetworkBattleManagerBase networkBattleManagerBase = BattleManagerBase.GetIns() as NetworkBattleManagerBase;
|
||||
if (networkBattleManagerBase.turnEndTimeController != null)
|
||||
{
|
||||
networkBattleManagerBase.turnEndTimeController.AddTurnEndTimerLog("TurnStart" + log);
|
||||
}
|
||||
}
|
||||
PlayerEmotion.ResetPlayCount();
|
||||
Turn++;
|
||||
SequentialVfxPlayer sequentialVfxPlayer = TurnEvolveControl(PlayerBattleView.EpIcon);
|
||||
VfxBase vfx = TurnStart();
|
||||
sequentialVfxPlayer.Register(vfx);
|
||||
VfxBase allFuncVfxResults = this.OnAfterPlayerTurnStart.GetAllFuncVfxResults();
|
||||
this.OnAfterPlayerTurnStart = null;
|
||||
sequentialVfxPlayer.Register(allFuncVfxResults);
|
||||
VfxBase vfx2 = base.BattleMgr.JudgeBattleResult();
|
||||
sequentialVfxPlayer.Register(vfx2);
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
public override VfxBase UsePp(int pp, bool isNewReplayMoveTurn = false)
|
||||
{
|
||||
base.UsePp(pp);
|
||||
if (BattleManagerBase.IsForecast)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
int pp2 = base.Pp;
|
||||
Vector3 zero = Vector3.zero;
|
||||
zero = BattleView.GetPPLabelPosition();
|
||||
return m_vfxCreator.CreateUsePp(pp2, base.PpTotal, zero, isNewReplayMoveTurn);
|
||||
}
|
||||
|
||||
protected override VfxBase TurnStartDrawCard(SkillProcessor skillProcessor)
|
||||
{
|
||||
int drawCount = ((IsGameFirst || Turn != 1) ? 1 : 2);
|
||||
VfxWith<IEnumerable<BattleCardBase>> vfxWith = RandomCardDraw(drawCount, skillProcessor);
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
sequentialVfxPlayer.Register(vfxWith.Vfx);
|
||||
sequentialVfxPlayer.Register(CardDrawVfx(vfxWith.Value));
|
||||
BattleLogManager.GetInstance().AddLogOverDrawCards(vfxWith.Value.Where((BattleCardBase s) => !s.IsInHand).ToList());
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
public override VfxBase TurnEnd()
|
||||
{
|
||||
bool flag = false;
|
||||
if (BattleManagerBase.GetIns().VfxMgr.IsEnd && IsTimeOverTurnEndProcessing)
|
||||
{
|
||||
base.HandControl.RearrangeHand(0.4f, base.HandCardList.ConvertToViewList());
|
||||
flag = true;
|
||||
}
|
||||
_isPlayerActive = false;
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(base.TurnEnd());
|
||||
foreach (BattleCardBase handCard in base.HandCardList)
|
||||
{
|
||||
handCard.BattleCardView.HideCanPlayEffect();
|
||||
}
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
base.NowTurnEvol = true;
|
||||
}));
|
||||
if (IsTimeOverTurnEndProcessing && !flag)
|
||||
{
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
base.HandControl.RearrangeHand(0.4f, base.HandCardList.ConvertToViewList());
|
||||
}));
|
||||
}
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
IsTimeOverTurnEndProcessing = false;
|
||||
}));
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
public override void HandCardToField(BattleCardBase targetCard, SkillBase skill = null)
|
||||
{
|
||||
base.HandCardToField(targetCard, skill);
|
||||
if (base.HandCardList.Count <= 0)
|
||||
{
|
||||
base.BattleMgr.VfxMgr.RegisterImmediateVfx(BattleView.HandUnfocus());
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetActive()
|
||||
{
|
||||
PlayerActive();
|
||||
this.OnPlayerActive.Call();
|
||||
_isPlayerActive = true;
|
||||
}
|
||||
|
||||
protected override void PlayerActive()
|
||||
{
|
||||
TurnStartEffectEnd();
|
||||
EnableBattleMenu();
|
||||
if (!GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle)
|
||||
{
|
||||
ITurnEndButtonUI turnEndButtonUI = PlayerBattleView.TurnEndButtonUI;
|
||||
turnEndButtonUI.StartTurnEndCountdown();
|
||||
turnEndButtonUI.ChangeButtonView(base.IsSelfTurn);
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_UI_TURN_1, turnEndButtonUI.GetBtnPosition());
|
||||
}
|
||||
_canNotTouchCardVfx.End();
|
||||
_canNotTouchCardVfx = null;
|
||||
if (!IsGameFirst || Turn != 1)
|
||||
{
|
||||
base.IsChoiceBraveEffectTiming = true;
|
||||
PlayerBattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
|
||||
}
|
||||
}
|
||||
|
||||
public override BattlePlayerBase CreateVirtualPlayer()
|
||||
{
|
||||
return new VirtualBattlePlayer(base.BattleMgr, base.BattleCamera, base.BackGround);
|
||||
}
|
||||
|
||||
public override void UpdateHandCardsPlayability(bool areArrowsForcedOff = false)
|
||||
{
|
||||
foreach (BattleCardBase handCard in base.HandCardList)
|
||||
{
|
||||
handCard.BattleCardView.areArrowsForcedOff = areArrowsForcedOff;
|
||||
handCard.BattleCardView.UpdateMovability();
|
||||
}
|
||||
if (base.IsSelfTurn && !GameMgr.GetIns().IsNewReplayBattle)
|
||||
{
|
||||
CantPlayChoiceBrave = areArrowsForcedOff;
|
||||
BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsDrawing()
|
||||
{
|
||||
if (base.HandCardList.Count != 0)
|
||||
{
|
||||
return base.HandCardList[0].IsOnDraw;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override VfxBase MoveToHand(List<BattleCardBase> cardsToMoveToHand)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
foreach (BattleCardBase item in cardsToMoveToHand)
|
||||
{
|
||||
parallelVfxPlayer.Register(item.CreateMoveToHandVfx());
|
||||
}
|
||||
return SequentialVfxPlayer.Create(parallelVfxPlayer, InstantVfx.Create(delegate
|
||||
{
|
||||
UpdateHandCardsPlayability();
|
||||
}));
|
||||
}
|
||||
|
||||
public override VfxBase CardDrawVfx(IEnumerable<BattleCardBase> cards, bool skipShuffle = false, bool isOpenDrawSkill = false)
|
||||
{
|
||||
return m_vfxCreator.CreateCardDraw(cards, isOpenDrawSkill);
|
||||
}
|
||||
|
||||
public override EffectBattle GetSkillEffect(string skillEffectPath)
|
||||
{
|
||||
return GameMgr.GetIns().GetEffectMgr().GetEffectBattle(skillEffectPath);
|
||||
}
|
||||
|
||||
public override Vector3 GetFieldCenterPosition()
|
||||
{
|
||||
return FIELD_CENTER_POSITION;
|
||||
}
|
||||
|
||||
public void CallRecordingMulliganEnd(List<BattleCardBase> cards)
|
||||
{
|
||||
this.OnMulliganEndForReplay.Call(cards);
|
||||
}
|
||||
}
|
||||
916
SVSim.BattleEngine/Engine/BattleResultUIController.cs
Normal file
916
SVSim.BattleEngine/Engine/BattleResultUIController.cs
Normal file
@@ -0,0 +1,916 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using LitJson;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Recovery;
|
||||
|
||||
public class BattleResultUIController : MonoBehaviour
|
||||
{
|
||||
private enum MenuDialogSelect
|
||||
{
|
||||
None = -1,
|
||||
Button1,
|
||||
ButtonClose
|
||||
}
|
||||
|
||||
public const string BattleResultObjectPass = "Prefab/UI/BattleResult/BattleResultUI";
|
||||
|
||||
public const string RankMatchBattleResultObjectPass = "Prefab/UI/BattleResult/RankMatchBattleResultUI";
|
||||
|
||||
public const string QuestBattleResultObjectPass = "Prefab/UI/BattleResult/QuestSpecialBattleResultUI";
|
||||
|
||||
public const string ColosseumBattleResultObjectPass = "Prefab/UI/BattleResult/ColosseumBattleResultUI";
|
||||
|
||||
public const string PLUS_STRING = "+";
|
||||
|
||||
public static readonly Color PLUS_START_COLOR = new Color32(byte.MaxValue, 192, 0, 0);
|
||||
|
||||
public static readonly Color PLUS_END_COLOR = new Color32(byte.MaxValue, 192, 0, byte.MaxValue);
|
||||
|
||||
public static readonly Color MINUS_START_COLOR = new Color32(128, 192, byte.MaxValue, 0);
|
||||
|
||||
public const float GAUGEUP_DURATION = 0.5f;
|
||||
|
||||
public const float GAUGEUP_DELAY = 0.5f;
|
||||
|
||||
public const float GAUGEUP_LABEL_DURATION = 0.3f;
|
||||
|
||||
public const float GAUGEUP_LABEL_MOVE_DISTANCE = 10f;
|
||||
|
||||
public const float GAUGEUP_LABEL_DISAPPEAR_DURATION = 0.5f;
|
||||
|
||||
public const float GAUGEUP_LABEL_DISAPPEAR_DELAY = 0.5f;
|
||||
|
||||
[SerializeField]
|
||||
public RankMatchBattleResult RankMatchBattleResultObject;
|
||||
|
||||
[SerializeField]
|
||||
public QuestSpecialBattleResult QuestBattleResultObject;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _battlePassResultPanel;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _acncorNoneRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _backGroundWithRank;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _backGroundNotNeedRank;
|
||||
|
||||
[Header("共通")]
|
||||
[SerializeField]
|
||||
public UIPanel MainPanel;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs ClassCharObj;
|
||||
|
||||
[SerializeField]
|
||||
public UITexture Bg;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite ArcaneIn;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite ArcaneOut;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite ResultTitle;
|
||||
|
||||
[Header("クラス情報")]
|
||||
[SerializeField]
|
||||
public GameObject ClassInfo;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoParts;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture ClassLvImg;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ClassLvLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIGauge ClassGaugeBar;
|
||||
|
||||
[SerializeField]
|
||||
private ParticleSystem ClassGaugeEfc;
|
||||
|
||||
[SerializeField]
|
||||
public UILabel ClassExpAddLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ClassExpNextTitle;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ClassExpNextLabel;
|
||||
|
||||
[Header("下部ボタン")]
|
||||
[SerializeField]
|
||||
public UIAnchor AnchorBottom;
|
||||
|
||||
[SerializeField]
|
||||
public UIGrid ButtonGrid;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs MissionBtnObj;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs HomeBtnObj;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs RetryBtnObj;
|
||||
|
||||
[SerializeField]
|
||||
public NguiObjs ReportBtnObj;
|
||||
|
||||
[Header("タイトル画像")]
|
||||
[SerializeField]
|
||||
private GameObject _titleRoot;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite TitleWin;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite TitleLose;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite TitleDraw;
|
||||
|
||||
[SerializeField]
|
||||
public UISprite TitleMatch;
|
||||
|
||||
[Header("通知表示")]
|
||||
[SerializeField]
|
||||
public NguiObjs ResultInfo;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _notificationAnimationParent;
|
||||
|
||||
[SerializeField]
|
||||
private NotificatonAnimation _notificationAnimationPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _battlePassBG;
|
||||
|
||||
private string _resultTypeMsg = "";
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_MissionBase;
|
||||
|
||||
public IDictionary<string, Vector3> DefaultPosDict = new Dictionary<string, Vector3>();
|
||||
|
||||
private int _classLv;
|
||||
|
||||
private int _classLvPrev;
|
||||
|
||||
private int _classLvMax;
|
||||
|
||||
private int _classExp;
|
||||
|
||||
private int _nowClassExp;
|
||||
|
||||
private int _nextClassExp;
|
||||
|
||||
private IList<NguiObjs> _missionLogList = new List<NguiObjs>();
|
||||
|
||||
private int _beforeClassExp;
|
||||
|
||||
private IList<int> _classExpList = new List<int>();
|
||||
|
||||
private bool _isResultTutorial;
|
||||
|
||||
private bool _isUsingSpecialDeck;
|
||||
|
||||
private int _usingSpecialDeckClassId;
|
||||
|
||||
private List<string> _resultAssetList = new List<string>();
|
||||
|
||||
private INextSceneSelector _nextSceneSelector;
|
||||
|
||||
[NonSerialized]
|
||||
public IBattleResultReporter resultReporter;
|
||||
|
||||
private IResultAnimationHandler resultAnimationHandler;
|
||||
|
||||
public const int MISSION_SPRITE_WIDTH = 800;
|
||||
|
||||
private const int MISSION_MARGIN = 24;
|
||||
|
||||
private const string MAINTENANCE_TIME_KEY = "maintenance_time";
|
||||
|
||||
private int _selectedClassId;
|
||||
|
||||
private NotificatonAnimation _notificationAnimation;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _missionSelect;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _retrySelect;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _homeSelect;
|
||||
|
||||
private const int MISSION_SELECT = 0;
|
||||
|
||||
private const int RETRY_SELECT = 1;
|
||||
|
||||
private const int HOME_SELECT = 2;
|
||||
|
||||
public DialogBase _missionDialog;
|
||||
|
||||
private MenuDialogSelect _menuDialogSelect = MenuDialogSelect.None;
|
||||
|
||||
[NonSerialized]
|
||||
public bool IsRewardWait;
|
||||
|
||||
public bool ResultMsgWindowFlag { get; private set; }
|
||||
|
||||
public bool ResultMsgReportBtnFlag { get; private set; }
|
||||
|
||||
public bool IsWin { get; set; }
|
||||
|
||||
public int AddClassExp { get; private set; }
|
||||
|
||||
public bool IsDraw { get; private set; }
|
||||
|
||||
public bool IsResultOn { get; private set; }
|
||||
|
||||
public bool AlreadyResultRecovery { get; set; }
|
||||
|
||||
public bool GreySpriteBGVisible
|
||||
{
|
||||
set
|
||||
{
|
||||
_battlePassBG.gameObject.SetActive(value);
|
||||
}
|
||||
}
|
||||
|
||||
public IBattleResultReporter ResultReporter => resultReporter;
|
||||
|
||||
public event Action OnResultFinish;
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
VideoHostingUtil.SetHUDScene(VideoHostingUtil.HUDScene.Home);
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_1);
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_2);
|
||||
GameMgr.GetIns().GetEffectMgr().Stop(EffectMgr.EffectType.CMN_RESULT_BACK_3);
|
||||
if (resultAnimationHandler != null)
|
||||
{
|
||||
resultAnimationHandler.Destroy();
|
||||
}
|
||||
if (GameMgr.GetIns()._rankWinnerReward != null)
|
||||
{
|
||||
GameMgr.GetIns()._rankWinnerReward.RemoveObject();
|
||||
GameMgr.GetIns()._rankWinnerReward = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_titleRoot.SetActive(value: true);
|
||||
IsResultOn = false;
|
||||
DefaultPosDict["ClassCharObj"] = ClassCharObj.transform.localPosition;
|
||||
DefaultPosDict["ResultTitle"] = ResultTitle.transform.localPosition;
|
||||
DefaultPosDict["ClassInfo"] = ClassInfo.transform.localPosition;
|
||||
DefaultPosDict["ButtonGrid"] = ButtonGrid.transform.localPosition;
|
||||
MainPanel.alpha = 0f;
|
||||
TitleMatch.alpha = 0f;
|
||||
Toolbox.AudioManager.AddCueSheet("bgm_btl_jingle", "bgm_btl_jingle.acb", "b/", "bgm_btl_jingle.awb");
|
||||
ButtonGrid.gameObject.SetActive(value: false);
|
||||
IsDraw = false;
|
||||
base.gameObject.SetActive(value: false);
|
||||
if (RankMatchBattleResultObject != null)
|
||||
{
|
||||
RankMatchBattleResultObject.Init();
|
||||
}
|
||||
if (QuestBattleResultObject != null)
|
||||
{
|
||||
QuestBattleResultObject.Init();
|
||||
}
|
||||
}
|
||||
|
||||
public void StartUI(bool win, BattleCamera battleCamera)
|
||||
{
|
||||
base.gameObject.SetActive(value: true);
|
||||
if (IsResultOn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IsResultOn = true;
|
||||
Toolbox.AudioManager.AddCueSheet("bgm_btl_jingle", "bgm_btl_jingle.acb", "b/", "bgm_btl_jingle.awb");
|
||||
VideoHostingUtil.SetHUDScene(VideoHostingUtil.HUDScene.BattleResult);
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
int skinId = dataMgr.GetPlayerSkinId();
|
||||
bool isEvolve = BattleManagerBase.GetIns().BattlePlayer.IsSkinEvolved;
|
||||
if (!BattleManagerBase.IsTutorial)
|
||||
{
|
||||
if (win)
|
||||
{
|
||||
_resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), isEvolve ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveWin : ResourcesManager.AssetLoadPathType.ClassCharaBaseWin));
|
||||
string text = dataMgr.GetPlayerEmotionData()[ClassCharaPrm.EmotionType.WIN].GetVoiceId(isEvolve);
|
||||
if (BattleManagerBase.GetIns().IsPuzzleMgr)
|
||||
{
|
||||
string clearVoiceId = (BattleManagerBase.GetIns() as PuzzleBattleManager).PuzzleQuestData.ClearVoiceId;
|
||||
if (!string.IsNullOrEmpty(clearVoiceId))
|
||||
{
|
||||
text = clearVoiceId;
|
||||
}
|
||||
}
|
||||
_ = isEvolve;
|
||||
_resultAssetList.Add("v/vo_" + text + ".acb");
|
||||
}
|
||||
else
|
||||
{
|
||||
_resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), isEvolve ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveLose : ResourcesManager.AssetLoadPathType.ClassCharaBaseLose));
|
||||
_resultAssetList.Add("v/vo_" + dataMgr.GetPlayerEmotionData()[ClassCharaPrm.EmotionType.LOSE].GetVoiceId(isEvolve) + ".acb");
|
||||
}
|
||||
}
|
||||
if (dataMgr.IsFormatEnableBattleType())
|
||||
{
|
||||
int num = PlayerStaticData.UserRankCurrentFormat();
|
||||
_resultAssetList.Add(Toolbox.ResourcesManager.GetAssetTypePath(num.ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_L));
|
||||
}
|
||||
List<GameObject> list = new List<GameObject>();
|
||||
list.Add(ClassGaugeEfc.gameObject);
|
||||
if (RankMatchBattleResultObject != null)
|
||||
{
|
||||
list.Add(RankMatchBattleResultObject.RankGaugeEfc.gameObject);
|
||||
}
|
||||
if (QuestBattleResultObject != null)
|
||||
{
|
||||
list.Add(QuestBattleResultObject.QuestPointGaugeEffect.gameObject);
|
||||
}
|
||||
GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(list, delegate
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().InitCommonEffect("Json/EffectResultData", isBattle: true, isField: false, isBattleEffect: true, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(_resultAssetList, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.AddRange(_resultAssetList);
|
||||
IsWin = win;
|
||||
DataMgr.BattleType battleType = dataMgr.m_BattleType;
|
||||
if (battleType == DataMgr.BattleType.Story && Data.SelectedStoryInfo.IsTutorialCategory)
|
||||
{
|
||||
_isResultTutorial = true;
|
||||
_nextSceneSelector = new TutorialNextSceneSelector(this);
|
||||
resultReporter = new TutorialResultReporter();
|
||||
resultAnimationHandler = new TutorialResultAnimationHandler(battleCamera);
|
||||
}
|
||||
else
|
||||
{
|
||||
ResourcesManager.AssetLoadPathType type = ((!isEvolve) ? (IsWin ? ResourcesManager.AssetLoadPathType.ClassCharaBaseWin : ResourcesManager.AssetLoadPathType.ClassCharaBaseLose) : (IsWin ? ResourcesManager.AssetLoadPathType.ClassCharaEvolveWin : ResourcesManager.AssetLoadPathType.ClassCharaEvolveLose));
|
||||
Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(skinId.ToString("00"), type, isfetch: true)) as Texture;
|
||||
ClassCharObj.textures[0].mainTexture = mainTexture;
|
||||
_classInfoParts.InitByCharaPrm(dataMgr.GetPlayerCharaData());
|
||||
ClassLvImg.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.GetPlayerClassId().ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaIconLevel, isfetch: true)) as Texture;
|
||||
if (battleType == DataMgr.BattleType.TwoPick)
|
||||
{
|
||||
_isUsingSpecialDeck = true;
|
||||
if (Data.TwoPickInfo.deckInfo != null)
|
||||
{
|
||||
_usingSpecialDeckClassId = Data.TwoPickInfo.deckInfo.classId;
|
||||
}
|
||||
else
|
||||
{
|
||||
_usingSpecialDeckClassId = Data.BattleRecoveryInfo.chara_id;
|
||||
}
|
||||
}
|
||||
SetResultFunc(battleCamera);
|
||||
}
|
||||
ResultSetupEnd();
|
||||
});
|
||||
});
|
||||
}, isBattle: true);
|
||||
}
|
||||
|
||||
private void SetResultFunc(BattleCamera battleCamera)
|
||||
{
|
||||
if (GameMgr.GetIns().IsReplayBattle)
|
||||
{
|
||||
_nextSceneSelector = new NullNextSceneSelector(this);
|
||||
resultReporter = new RoomMatchResultReporter();
|
||||
resultAnimationHandler = new RoomMatchResultAnimationHandler(battleCamera);
|
||||
return;
|
||||
}
|
||||
switch (GameMgr.GetIns().GetDataMgr().m_BattleType)
|
||||
{
|
||||
case DataMgr.BattleType.FreeBattle:
|
||||
_nextSceneSelector = new NetworkMatchNextSceneSelector(this);
|
||||
resultReporter = new FreeMatchResultReporter();
|
||||
resultAnimationHandler = new FreeMatchResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.RankBattle:
|
||||
_nextSceneSelector = new NetworkMatchNextSceneSelector(this);
|
||||
resultReporter = new RankMatchResultReporter();
|
||||
resultAnimationHandler = new RankMatchResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.Practice:
|
||||
if (GameMgr.GetIns().IsPuzzleQuest)
|
||||
{
|
||||
_nextSceneSelector = new PracticePuzzleNextSceneSelector(this);
|
||||
resultReporter = new PracticePuzzleResultReporter();
|
||||
resultAnimationHandler = new PracticeResultAnimationHandler(battleCamera);
|
||||
}
|
||||
else
|
||||
{
|
||||
_nextSceneSelector = new PracticeNextSceneSelector(this);
|
||||
resultReporter = new PracticeResultReporter();
|
||||
resultAnimationHandler = new PracticeResultAnimationHandler(battleCamera);
|
||||
}
|
||||
break;
|
||||
case DataMgr.BattleType.ColosseumNormal:
|
||||
case DataMgr.BattleType.ColosseumTwoPick:
|
||||
case DataMgr.BattleType.ColosseumHof:
|
||||
case DataMgr.BattleType.ColosseumWindFall:
|
||||
case DataMgr.BattleType.ColosseumAvatar:
|
||||
_nextSceneSelector = new ArenaNextSceneSelector(this);
|
||||
resultReporter = new ColosseumResultReporter();
|
||||
resultAnimationHandler = new ColosseumResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.CompetitionNormal:
|
||||
case DataMgr.BattleType.CompetitionTwoPick:
|
||||
_nextSceneSelector = new ArenaNextSceneSelector(this);
|
||||
resultReporter = new CompetitionResultReporter();
|
||||
resultAnimationHandler = new CompetitionResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.TwoPick:
|
||||
case DataMgr.BattleType.Sealed:
|
||||
_nextSceneSelector = new ArenaNextSceneSelector(this);
|
||||
resultReporter = new ArenaResultReporter();
|
||||
resultAnimationHandler = new ArenaResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.RoomBattle:
|
||||
case DataMgr.BattleType.RoomTwoPick:
|
||||
case DataMgr.BattleType.TwoPickBackdraft:
|
||||
_nextSceneSelector = new NullNextSceneSelector(this);
|
||||
resultReporter = new RoomMatchResultReporter();
|
||||
resultAnimationHandler = new RoomMatchResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.Story:
|
||||
_nextSceneSelector = new StoryNextSceneSelector(this);
|
||||
resultReporter = new StoryResultReporter();
|
||||
resultAnimationHandler = new StoryResultAnimationHandler(battleCamera);
|
||||
break;
|
||||
case DataMgr.BattleType.Quest:
|
||||
case DataMgr.BattleType.BossRushQuest:
|
||||
case DataMgr.BattleType.SecretBossQuest:
|
||||
_nextSceneSelector = new QuestNextSceneSelector(this);
|
||||
resultReporter = new QuestResultReporter();
|
||||
resultAnimationHandler = new QuestSpecialResultAnimationHandler(battleCamera, GetComponent<QuestSpecialBattleResult>());
|
||||
break;
|
||||
}
|
||||
if (BattleManagerBase.GetIns().IsPuzzleMgr && !IsWin)
|
||||
{
|
||||
_nextSceneSelector = new NullNextSceneSelector(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void ResultSetupEnd()
|
||||
{
|
||||
_nextSceneSelector.Setup(IsWin, base.gameObject);
|
||||
ClassCharObj.transform.localPosition = DefaultPosDict["ClassCharObj"] + Vector3.right * 1200f;
|
||||
ResultTitle.transform.localPosition = DefaultPosDict["ResultTitle"] + Vector3.up * 500f;
|
||||
ClassInfo.transform.localPosition = DefaultPosDict["ClassInfo"] + Vector3.left * 2000f;
|
||||
ButtonGrid.transform.localPosition = DefaultPosDict["ButtonGrid"] + Vector3.down * 200f;
|
||||
for (int i = 0; i < _missionLogList.Count; i++)
|
||||
{
|
||||
_missionLogList[i].gameObject.SetActive(value: false);
|
||||
}
|
||||
ClassCharObj.gameObject.SetActive(value: true);
|
||||
ResultTitle.gameObject.SetActive(value: true);
|
||||
ClassInfo.gameObject.SetActive(value: true);
|
||||
ButtonGrid.gameObject.SetActive(value: true);
|
||||
ArcaneIn.transform.localScale = Vector3.one * 0.01f;
|
||||
ArcaneOut.transform.localScale = Vector3.one * 0.01f;
|
||||
ArcaneIn.alpha = 0f;
|
||||
ArcaneOut.alpha = 0f;
|
||||
ClassExpAddLabel.alpha = 0f;
|
||||
ResultInfo.labels[0].alpha = 0f;
|
||||
ResultInfo.sprites[0].alpha = 0f;
|
||||
ButtonGrid.repositionNow = true;
|
||||
ClassExpNextTitle.text = Data.SystemText.Get("Battle_0205");
|
||||
Format format = Data.CurrentFormat;
|
||||
if (GameMgr.GetIns().GetDataMgr().IsDipslayHighRankFormat())
|
||||
{
|
||||
format = PlayerStaticData.HighRankFormat();
|
||||
}
|
||||
if (format == Format.PreRotation)
|
||||
{
|
||||
format = Format.Rotation;
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
resultReporter.Destroy();
|
||||
StartCoroutine(resultAnimationHandler.m_resultAnimationAgent.RunUI(this, _nextSceneSelector, IsWin));
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(GetServerData());
|
||||
}
|
||||
if (RankMatchBattleResultObject != null)
|
||||
{
|
||||
RankMatchBattleResultObject.ResultSetupEnd(format);
|
||||
}
|
||||
if (QuestBattleResultObject != null)
|
||||
{
|
||||
QuestBattleResultObject.ResultSetupEnd(format);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBattlePassGauge(Action completeAction)
|
||||
{
|
||||
if (_battlePassResultPanel == null || !PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.BATTLE_PASS_SHOW_RESULT) || !resultReporter.IsDataExist)
|
||||
{
|
||||
completeAction();
|
||||
return;
|
||||
}
|
||||
JsonData finishResponseData = resultReporter.GetFinishResponseData();
|
||||
if (finishResponseData != null && finishResponseData["data"].Keys.Contains("battle_pass_gauge_info"))
|
||||
{
|
||||
BattlePassGaugeInfo battlePassGaugeInfo = new BattlePassGaugeInfo(finishResponseData["data"]["battle_pass_gauge_info"]);
|
||||
if (battlePassGaugeInfo.IsMaxPoint && battlePassGaugeInfo.IsBeforeMaxPoint)
|
||||
{
|
||||
completeAction();
|
||||
return;
|
||||
}
|
||||
GreySpriteBGVisible = true;
|
||||
BattlePassResultPanel component = UnityEngine.Object.Instantiate(_battlePassResultPanel, _acncorNoneRoot).GetComponent<BattlePassResultPanel>();
|
||||
component.Initialize(battlePassGaugeInfo);
|
||||
component.SetPointupAnimation(completeAction);
|
||||
}
|
||||
else
|
||||
{
|
||||
completeAction();
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateMissionList()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(systemText.Get("Mission_0003"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.ScrollView.transform.DestroyChildren();
|
||||
dialogBase.ScrollView.panel.leftAnchor.absolute = 24;
|
||||
dialogBase.ScrollView.panel.rightAnchor.absolute = -24;
|
||||
GameObject gameObject = new GameObject("table");
|
||||
dialogBase.ScrollView.contentPivot = UIWidget.Pivot.Top;
|
||||
dialogBase.AttachToScrollView(gameObject.transform);
|
||||
UITable uITable = gameObject.AddComponent<UITable>();
|
||||
uITable.columns = 1;
|
||||
uITable.keepWithinPanel = true;
|
||||
uITable.cellAlignment = UIWidget.Pivot.Center;
|
||||
uITable.pivot = UIWidget.Pivot.Center;
|
||||
ResourceHandler resourceHandler = base.gameObject.AddMissingComponent<ResourceHandler>();
|
||||
int count = Data.MissionInfo.data.user_mission_list.Count;
|
||||
for (int i = 0; i < Data.MissionInfo.data.user_mission_list.Count; i++)
|
||||
{
|
||||
UserMission mission = Data.MissionInfo.data.user_mission_list[i];
|
||||
GameObject obj = UnityEngine.Object.Instantiate(m_MissionBase);
|
||||
obj.transform.parent = uITable.transform;
|
||||
obj.transform.localPosition = Vector3.zero;
|
||||
obj.transform.localScale = Vector3.one;
|
||||
obj.SetActive(value: true);
|
||||
obj.GetComponent<UISprite>().width = 800;
|
||||
obj.GetComponent<AchievementWindowBase>().SetMission(mission, resourceHandler, canChangeMissions: false, i != count - 1, displayChange: false);
|
||||
}
|
||||
_missionDialog = dialogBase;
|
||||
StartCoroutine(ResetMissionScrollPos(dialogBase.ScrollView));
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
}
|
||||
|
||||
private IEnumerator ResetMissionScrollPos(UIScrollView scroll)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
scroll.ResetPosition();
|
||||
}
|
||||
|
||||
private IEnumerator GetServerData()
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("GetServerData ");
|
||||
LocalLog.SendClientInfoTraceLog(delegate
|
||||
{
|
||||
resultReporter.Report(IsWin);
|
||||
});
|
||||
while (!resultReporter.IsEnd)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
LocalLog.AccumulateLastTraceLog("GetServerData ReporterEnd");
|
||||
if (!resultReporter.IsDataExist)
|
||||
{
|
||||
Toolbox.NetworkManager.NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_3502"), Data.SystemText.Get("Error_3502"), "");
|
||||
yield break;
|
||||
}
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
if (RankMatchBattleResultObject != null)
|
||||
{
|
||||
RankMatchBattleResultObject.GetServerData();
|
||||
}
|
||||
if (QuestBattleResultObject != null)
|
||||
{
|
||||
QuestBattleResultObject.GetServerData(resultReporter);
|
||||
}
|
||||
if (dataMgr.IsColosseumBattleType())
|
||||
{
|
||||
SetBackGroundNeedBattlePoint(needBattlePoint: false);
|
||||
}
|
||||
GameMgr.GetIns().GetDataMgr().CacheSingleRecovryData();
|
||||
RecoveryRecordManagerBase.DeleteRecoveryFile();
|
||||
AddClassExp = resultReporter.ClassExp;
|
||||
resultReporter.Destroy();
|
||||
if (!_isResultTutorial)
|
||||
{
|
||||
if (_isUsingSpecialDeck)
|
||||
{
|
||||
_selectedClassId = ((_usingSpecialDeckClassId != 0) ? _usingSpecialDeckClassId : dataMgr.GetPlayerClassId());
|
||||
}
|
||||
else
|
||||
{
|
||||
_selectedClassId = dataMgr.GetPlayerClassId();
|
||||
}
|
||||
_beforeClassExp = dataMgr.GetClassPrm(_selectedClassId).GetClassCharaExp();
|
||||
}
|
||||
_classExpList.Clear();
|
||||
for (int num = 0; num < Data.Load.data._classCharaExpList.Count; num++)
|
||||
{
|
||||
_classExpList.Add(Data.Load.data._classCharaExpList[num].necessary_exp);
|
||||
}
|
||||
_classLvMax = _classExpList.Count;
|
||||
SetClassExp(0, isLvUpCheck: false);
|
||||
_classLvPrev = _classLv;
|
||||
StartCoroutine(resultAnimationHandler.m_resultAnimationAgent.RunUI(this, _nextSceneSelector, IsWin));
|
||||
}
|
||||
|
||||
public void PrepareAchievementLog()
|
||||
{
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<NotificatonAnimation.Param> list = new List<NotificatonAnimation.Param>();
|
||||
JsonData finishResponseData = resultReporter.GetFinishResponseData();
|
||||
if (finishResponseData != null && finishResponseData["data"].Keys.Contains("maintenance_time"))
|
||||
{
|
||||
DateTime dateTime = DateTime.Parse(finishResponseData["data"]["maintenance_time"].ToString());
|
||||
list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.MaintenanceOnResult, Data.SystemText.Get("System_0044", ConvertTime.ToLocal(dateTime))));
|
||||
}
|
||||
if (finishResponseData != null && finishResponseData["data"].Keys.Contains("gathering_notification"))
|
||||
{
|
||||
string valueOrDefault = finishResponseData["data"]["gathering_notification"].GetValueOrDefault("matching_established_message", string.Empty);
|
||||
if (!string.IsNullOrEmpty(valueOrDefault))
|
||||
{
|
||||
list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.GatheringMatching, valueOrDefault));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < resultReporter.UserMission.Count; i++)
|
||||
{
|
||||
list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.Result, resultReporter.UserMission[i].achieved_message));
|
||||
}
|
||||
for (int j = 0; j < resultReporter.UserAchievement.Count; j++)
|
||||
{
|
||||
list.Add(new NotificatonAnimation.Param(NotificatonAnimation.Param.Type.Result, resultReporter.UserAchievement[j].achieved_message));
|
||||
}
|
||||
StartCoroutine(ShowAchieveLog(list));
|
||||
}
|
||||
|
||||
public void RewardCheck()
|
||||
{
|
||||
IsRewardWait = false;
|
||||
}
|
||||
|
||||
public void FinishResult()
|
||||
{
|
||||
this.OnResultFinish.Call();
|
||||
}
|
||||
|
||||
public void SettingAddClassExpTextAnimation()
|
||||
{
|
||||
iTween.ValueTo(base.gameObject, iTween.Hash("from", 0, "to", AddClassExp, "time", 0.5f, "delay", 0.5f, "onstart", "StartClassExp", "onupdate", "UpdateClassExp", "oncomplete", "CompleteClassExp", "easetype", iTween.EaseType.easeOutQuad));
|
||||
bool flag = AddClassExp >= 0;
|
||||
ClassExpAddLabel.text = (flag ? "+" : string.Empty) + AddClassExp;
|
||||
ClassExpAddLabel.color = (flag ? PLUS_START_COLOR : MINUS_START_COLOR);
|
||||
TweenAlpha.Begin(ClassExpAddLabel.gameObject, 0.3f, 1f);
|
||||
iTween.MoveFrom(ClassExpAddLabel.gameObject, iTween.Hash("y", ClassExpAddLabel.transform.localPosition.y - 10f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
}
|
||||
|
||||
private void StartClassExp()
|
||||
{
|
||||
ClassGaugeEfc.gameObject.SetActive(value: true);
|
||||
ClassGaugeEfc.Play();
|
||||
}
|
||||
|
||||
private void UpdateClassExp(int num)
|
||||
{
|
||||
SetClassExp(num, isLvUpCheck: true);
|
||||
}
|
||||
|
||||
public void SetClassExp(int num, bool isLvUpCheck)
|
||||
{
|
||||
_classExp = _beforeClassExp + num;
|
||||
_classLv = GetClassLv(_classExp);
|
||||
_nowClassExp = GetClassExpNow(_classExp);
|
||||
_nextClassExp = Mathf.Max(0, _classExpList[_classLv - 1] - _nowClassExp);
|
||||
ClassLvLabel.text = _classLv.ToString();
|
||||
ClassExpNextLabel.text = _nextClassExp.ToString();
|
||||
if (AddClassExp >= 0)
|
||||
{
|
||||
ClassExpAddLabel.text = ((AddClassExp - num >= 0) ? "+" : "") + (AddClassExp - num);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClassExpAddLabel.text = (AddClassExp - num).ToString();
|
||||
}
|
||||
ClassGaugeBar.Value = (((float)_classExpList[_classLv - 1] >= 0f) ? Mathf.Min((float)_nowClassExp / (float)_classExpList[_classLv - 1], 1f) : 1f);
|
||||
if (isLvUpCheck && _classLv > _classLvPrev)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP);
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_LVUP_1, ClassLvImg.transform.position);
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_1, ClassGaugeBar.GetTransformGaugeStartEdge().position);
|
||||
_classLvPrev = _classLv;
|
||||
}
|
||||
}
|
||||
|
||||
private void CompleteClassExp()
|
||||
{
|
||||
ClassGaugeEfc.Stop();
|
||||
TweenAlpha.Begin(ClassExpAddLabel.gameObject, 0.5f, 0f).delay = 0.5f;
|
||||
SetClassLvAndExp();
|
||||
}
|
||||
|
||||
public void SetClassLvAndExp()
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
switch (dataMgr.m_BattleType)
|
||||
{
|
||||
case DataMgr.BattleType.FreeBattle:
|
||||
_classLv = Data.FreeMatchFinish.data.class_chara_level;
|
||||
_classExp = Data.FreeMatchFinish.data.class_chara_experience;
|
||||
break;
|
||||
case DataMgr.BattleType.RankBattle:
|
||||
_classLv = Data.RankMatchFinish.data.class_chara_level;
|
||||
_classExp = Data.RankMatchFinish.data.class_chara_experience;
|
||||
break;
|
||||
case DataMgr.BattleType.Story:
|
||||
_classLv = Data.StoryFinish.data.class_chara_level;
|
||||
_classExp = Data.StoryFinish.data.class_chara_experience;
|
||||
break;
|
||||
case DataMgr.BattleType.Practice:
|
||||
_classLv = Data.PracticeFinish.data.class_chara_level;
|
||||
_classExp = Data.PracticeFinish.data.class_chara_experience;
|
||||
break;
|
||||
case DataMgr.BattleType.RoomBattle:
|
||||
_classLv = Data.FreeMatchFinish.data.class_chara_level;
|
||||
_classExp = Data.FreeMatchFinish.data.class_chara_experience;
|
||||
break;
|
||||
case DataMgr.BattleType.Quest:
|
||||
case DataMgr.BattleType.BossRushQuest:
|
||||
case DataMgr.BattleType.SecretBossQuest:
|
||||
_classLv = Data.QuestFinish.data.class_chara_level;
|
||||
_classExp = Data.QuestFinish.data.class_chara_experience;
|
||||
break;
|
||||
}
|
||||
ClassCharaPrm classPrm = dataMgr.GetClassPrm(_selectedClassId);
|
||||
classPrm.SetClassCharaLv(_classLv);
|
||||
classPrm.SetClassCharaExp(_classExp);
|
||||
}
|
||||
|
||||
private int GetClassLv(int num)
|
||||
{
|
||||
int num2 = 1;
|
||||
int num3 = 0;
|
||||
for (int i = 0; i < _classExpList.Count; i++)
|
||||
{
|
||||
num3 += _classExpList[i];
|
||||
if (num < num3)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num2++;
|
||||
}
|
||||
return Mathf.Min(num2, _classLvMax);
|
||||
}
|
||||
|
||||
private int GetClassExpNow(int num)
|
||||
{
|
||||
int num2 = num;
|
||||
for (int i = 0; i < _classExpList.Count && num2 >= _classExpList[i]; i++)
|
||||
{
|
||||
num2 -= _classExpList[i];
|
||||
}
|
||||
return num2;
|
||||
}
|
||||
|
||||
private IEnumerator ShowAchieveLog(List<NotificatonAnimation.Param> paramList)
|
||||
{
|
||||
if (_notificationAnimation != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(_notificationAnimation.gameObject);
|
||||
_notificationAnimation = null;
|
||||
}
|
||||
_notificationAnimation = NGUITools.AddChild(_notificationAnimationParent, _notificationAnimationPrefab.gameObject).GetComponent<NotificatonAnimation>();
|
||||
yield return StartCoroutine(_notificationAnimation.Exec(paramList));
|
||||
}
|
||||
|
||||
public void SetSpecialResultTypeText(string text)
|
||||
{
|
||||
_resultTypeMsg = text;
|
||||
ResultMsgWindowFlag = true;
|
||||
}
|
||||
|
||||
public void SetBattleFinishConsistency()
|
||||
{
|
||||
IsDraw = true;
|
||||
ResultMsgReportBtnFlag = true;
|
||||
}
|
||||
|
||||
public IEnumerator ShowSpecialResultInfo()
|
||||
{
|
||||
ResultInfo.labels[0].text = _resultTypeMsg;
|
||||
ResultInfo.labels[0].alpha = 0f;
|
||||
ResultInfo.sprites[0].alpha = 0f;
|
||||
ResultInfo.labels[0].transform.localPosition = Vector3.right * 200f;
|
||||
ResultInfo.sprites[0].transform.localScale = new Vector3(0.01f, 0.1f, 1f);
|
||||
TweenAlpha.Begin(ResultInfo.sprites[0].gameObject, 0.2f, 1f);
|
||||
iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", new Vector3(1f, 0.1f, 1f), "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad));
|
||||
iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", Vector3.one, "time", 0.5f, "delay", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeOutBack));
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
TweenAlpha.Begin(ResultInfo.labels[0].gameObject, 0.2f, 1f);
|
||||
iTween.MoveTo(ResultInfo.labels[0].gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
yield return new WaitForSeconds(2f);
|
||||
TweenAlpha.Begin(ResultInfo.sprites[0].gameObject, 0.1f, 0f).delay = 0.2f;
|
||||
TweenAlpha.Begin(ResultInfo.labels[0].gameObject, 0.1f, 0f).delay = 0.2f;
|
||||
iTween.ScaleTo(ResultInfo.sprites[0].gameObject, iTween.Hash("scale", new Vector3(1f, 0.1f, 1f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
iTween.MoveTo(ResultInfo.labels[0].gameObject, iTween.Hash("position", Vector3.left * 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
}
|
||||
|
||||
public void Recovery()
|
||||
{
|
||||
ClassInfo.SetActive(value: false);
|
||||
ClassInfo.SetActive(value: true);
|
||||
}
|
||||
|
||||
public IEnumerator RunMatch()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RANK_UP_MACH_BEGIN);
|
||||
TweenAlpha.Begin(TitleMatch.gameObject, 0.2f, 1f);
|
||||
TitleMatch.transform.localScale = Vector3.one * 10f;
|
||||
iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 0.8f, "time", 0.2f, "easetype", iTween.EaseType.easeInQuad));
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_MATCH_1, Vector3.back);
|
||||
TitleMatch.transform.localScale = Vector3.one;
|
||||
iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 3f, "easetype", iTween.EaseType.linear));
|
||||
yield return new WaitForSeconds(2.5f);
|
||||
TweenAlpha.Begin(TitleMatch.gameObject, 0.3f, 0f);
|
||||
iTween.ScaleTo(TitleMatch.gameObject, iTween.Hash("scale", Vector3.one * 10f, "time", 0.3f, "easetype", iTween.EaseType.easeInExpo));
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_missionDialog != null)
|
||||
{
|
||||
MenuDialogUpdate(_missionDialog);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuDialogUpdate(DialogBase dialog)
|
||||
{
|
||||
InputMgr inputMgr = GameMgr.GetIns().GetInputMgr();
|
||||
if (inputMgr.IsKeyboardCancel())
|
||||
{
|
||||
_missionDialog.CloseWithoutSelect();
|
||||
_menuDialogSelect = MenuDialogSelect.None;
|
||||
}
|
||||
bool flag = false;
|
||||
if (inputMgr.IsKeyboardLeftArrow() || inputMgr.IsKeyboardRightArrow())
|
||||
{
|
||||
_menuDialogSelect = ((_menuDialogSelect == MenuDialogSelect.Button1) ? MenuDialogSelect.ButtonClose : MenuDialogSelect.Button1);
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
dialog.KeyboardSelectButton(DialogBase.KeyboardDialogSelect.Button1, _menuDialogSelect == MenuDialogSelect.Button1);
|
||||
dialog.KeyboardSelectButton(DialogBase.KeyboardDialogSelect.CloseButton, _menuDialogSelect == MenuDialogSelect.ButtonClose);
|
||||
}
|
||||
if (inputMgr.IsKeyboardEnter() && _menuDialogSelect != MenuDialogSelect.None)
|
||||
{
|
||||
_missionDialog.CloseWithoutSelect();
|
||||
_menuDialogSelect = MenuDialogSelect.None;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBackGroundNeedBattlePoint(bool needBattlePoint)
|
||||
{
|
||||
_backGroundWithRank.gameObject.SetActive(needBattlePoint);
|
||||
_backGroundNotNeedRank.gameObject.SetActive(!needBattlePoint);
|
||||
}
|
||||
}
|
||||
584
SVSim.BattleEngine/Engine/BattleStartControl.cs
Normal file
584
SVSim.BattleEngine/Engine/BattleStartControl.cs
Normal file
@@ -0,0 +1,584 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattleStartControl : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIPanel MainPanel;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite BgBlack;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture CharP;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture CharE;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts ClassInfoP;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts ClassInfoE;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ClassNameP;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel ClassNameE;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel CharaNameP;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel CharaNameE;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoWithSubClassP;
|
||||
|
||||
[SerializeField]
|
||||
private ClassInfoParts _classInfoWithSubClassE;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _subClassGridP;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _subClassGridE;
|
||||
|
||||
[SerializeField]
|
||||
private MyRotationParts _myRotationInfoP;
|
||||
|
||||
[SerializeField]
|
||||
private MyRotationParts _myRotationInfoE;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs UserPanelP;
|
||||
|
||||
[SerializeField]
|
||||
private NguiObjs UserPanelE;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite VsArcane;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite VsLine;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite VsTitle;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite CardP;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite CardE;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel CardLabelP;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel CardLabelE;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel TurnLabel;
|
||||
|
||||
private IDictionary<string, Vector3> DefaultPosDict = new Dictionary<string, Vector3>();
|
||||
|
||||
private string CardFrontSpriteName = "battle_card_marigan_00";
|
||||
|
||||
private string CardBackSpriteName = "battle_card_marigan_03";
|
||||
|
||||
public bool IsReady { get; private set; }
|
||||
|
||||
public void SetUp(SBattleLoad battleLoad)
|
||||
{
|
||||
if (GameMgr.GetIns().IsNetworkBattle && !BattleManagerBase.GetIns().IsRecovery && !GameMgr.GetIns().IsWatchBattle && !GameMgr.GetIns().IsReplayBattle)
|
||||
{
|
||||
StartCoroutine(CheckAbleToInitialize(battleLoad));
|
||||
}
|
||||
else
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator CheckAbleToInitialize(SBattleLoad battleLoad)
|
||||
{
|
||||
while (GameMgr.GetIns().GetNetworkUserInfoData().SelfBattleStartInfo == null || GameMgr.GetIns().GetNetworkUserInfoData().OppoBattleStartInfo == null)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
battleLoad.LoadOpponentAssets(delegate
|
||||
{
|
||||
Initialize();
|
||||
});
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
MainPanel.alpha = 0f;
|
||||
InitBattleStartControl();
|
||||
base.gameObject.SetActive(value: false);
|
||||
IsReady = true;
|
||||
}
|
||||
|
||||
private void InitBattleStartControl()
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData();
|
||||
PuzzleQuestData puzzleQuestData = null;
|
||||
bool isPuzzleMgr = BattleManagerBase.GetIns().IsPuzzleMgr;
|
||||
if (isPuzzleMgr)
|
||||
{
|
||||
puzzleQuestData = Data.Master.PuzzleQuestDataList.First((PuzzleQuestData data) => data.Id == GameMgr.GetIns().GetDataMgr().PuzzleQuestId);
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[0], networkUserInfoData.GetSelfDegreeId(), DegreeHelper.DegreeType.MIDDLE);
|
||||
}
|
||||
else if (isPuzzleMgr)
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[0], puzzleQuestData.PlayerDegreeId, DegreeHelper.DegreeType.MIDDLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelP.textures[0], PlayerStaticData.UserDegreeID, DegreeHelper.DegreeType.MIDDLE);
|
||||
}
|
||||
int num = (GameMgr.GetIns().IsNetworkBattle ? networkUserInfoData.GetOpponentDegreeId() : (isPuzzleMgr ? puzzleQuestData.EnemyDegreeId : ((dataMgr.m_BattleType == DataMgr.BattleType.Quest) ? dataMgr.QuestBattleData.DegreeId : ((dataMgr.m_BattleType != DataMgr.BattleType.BossRushQuest && dataMgr.m_BattleType != DataMgr.BattleType.SecretBossQuest) ? dataMgr.PracticeDifficultyDegreeId : dataMgr.BossRushBattleData.DegreeId))));
|
||||
if (GameMgr.GetIns().IsNetworkBattle || (dataMgr.m_BattleType == DataMgr.BattleType.Practice && dataMgr.PracticeDifficultyDegreeId != -1) || (dataMgr.IsQuestBattleType() && num != -1))
|
||||
{
|
||||
DegreeHelper.InitializeDegree(UserPanelE.textures[0], num, DegreeHelper.DegreeType.MIDDLE);
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UserPanelP.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else if (isPuzzleMgr)
|
||||
{
|
||||
UserPanelP.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.PlayerEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerStaticData.AttachUserEmblemTexture(UserPanelP.textures[1], PlayerStaticData.EmblemTexSize.M);
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentEmblemId().ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else if (isPuzzleMgr)
|
||||
{
|
||||
UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(puzzleQuestData.EnemyEmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else if (dataMgr.m_BattleType == DataMgr.BattleType.Quest)
|
||||
{
|
||||
UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.QuestBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else if (dataMgr.m_BattleType == DataMgr.BattleType.BossRushQuest || dataMgr.m_BattleType == DataMgr.BattleType.SecretBossQuest)
|
||||
{
|
||||
UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(dataMgr.BossRushBattleData.EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.textures[1].mainTexture = Toolbox.ResourcesManager.LoadObject<Texture>(Toolbox.ResourcesManager.GetAssetTypePath(100000000.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M, isfetch: true));
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UIUtil.SetCountryTexture(UserPanelP.textures[2], networkUserInfoData.GetSelfCountryCode());
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag = !string.IsNullOrEmpty(PlayerStaticData.UserCountryCode);
|
||||
UserPanelP.textures[2].gameObject.SetActive(flag);
|
||||
if (flag)
|
||||
{
|
||||
PlayerStaticData.AttachUserCountryTexture(UserPanelP.textures[2], PlayerStaticData.CountryTexSize.M);
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.textures[2].mainTexture = null;
|
||||
}
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UIUtil.SetCountryTexture(UserPanelE.textures[2], networkUserInfoData.GetOpponentCountryCode());
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.textures[2].gameObject.SetActive(value: false);
|
||||
UserPanelE.textures[2].mainTexture = null;
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UserPanelP.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetSelfRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture;
|
||||
}
|
||||
else if (dataMgr.IsDipslayHighRankFormat())
|
||||
{
|
||||
PlayerStaticData.LoadUserRankTexture(PlayerStaticData.HighRankFormat());
|
||||
PlayerStaticData.AttachUserRankTexture(UserPanelP.textures[3], PlayerStaticData.RankTexSize.S);
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(PlayerStaticData.UserRankCurrentFormat().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture;
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UserPanelE.textures[3].mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(networkUserInfoData.GetOpponentRank().ToString("00"), ResourcesManager.AssetLoadPathType.RankIcon_S, isfetch: true)) as Texture;
|
||||
}
|
||||
if (GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
UserPanelP.labels[0].text = networkUserInfoData.GetSelfName();
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelP.labels[0].text = PlayerStaticData.UserName.ToString();
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
UserPanelE.labels[0].text = VideoHostingUtil.GetUserNameHidden(networkUserInfoData.GetOpponentName().ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
UserPanelE.labels[0].text = dataMgr.GetEnemyCharaData().chara_name;
|
||||
}
|
||||
Format inFormat = Data.CurrentFormat;
|
||||
if (dataMgr.IsDipslayHighRankFormat())
|
||||
{
|
||||
inFormat = PlayerStaticData.HighRankFormat();
|
||||
}
|
||||
bool flag2 = dataMgr.m_BattleType == DataMgr.BattleType.RankBattle;
|
||||
UILabel uILabel = UserPanelP.labels[1];
|
||||
UILabel uILabel2 = UserPanelE.labels[1];
|
||||
uILabel.gameObject.SetActive(flag2);
|
||||
uILabel2.gameObject.SetActive(flag2);
|
||||
if (flag2)
|
||||
{
|
||||
if (PlayerStaticData.IsMasterRank(inFormat))
|
||||
{
|
||||
uILabel.text = PlayerStaticData.UserMasterPoint(inFormat).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
uILabel.text = PlayerStaticData.UserBattlePoint(inFormat).ToString();
|
||||
}
|
||||
if (GameMgr.GetIns().IsNetworkBattle)
|
||||
{
|
||||
if (networkUserInfoData.GetOpponentIsMasterRank())
|
||||
{
|
||||
uILabel2.text = networkUserInfoData.GetOpponentMasterPoint().ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
uILabel2.text = networkUserInfoData.GetOpponentBattlePoint().ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uILabel2.text = "0";
|
||||
}
|
||||
}
|
||||
bool activeOfficialUserIconSprite = (GameMgr.GetIns().IsWatchBattle ? networkUserInfoData.GetSelfIsOfficialUser() : PlayerStaticData.IsOfficialUserDisplay);
|
||||
bool activeOfficialUserIconSprite2 = GameMgr.GetIns().IsNetworkBattle && networkUserInfoData.GetOpponentIsOfficialUser();
|
||||
UserPanelP.gameObject.GetComponent<BattleStartUserPanel>().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite);
|
||||
UserPanelE.gameObject.GetComponent<BattleStartUserPanel>().SetActiveOfficialUserIconSprite(activeOfficialUserIconSprite2);
|
||||
DefaultPosDict["UserPanelP"] = UserPanelP.transform.localPosition;
|
||||
DefaultPosDict["UserPanelE"] = UserPanelE.transform.localPosition;
|
||||
DefaultPosDict["CharP"] = CharP.transform.localPosition;
|
||||
DefaultPosDict["CharE"] = CharE.transform.localPosition;
|
||||
DefaultPosDict["ClassNameP"] = ClassNameP.transform.localPosition;
|
||||
DefaultPosDict["ClassNameE"] = ClassNameE.transform.localPosition;
|
||||
DefaultPosDict["CharaNameP"] = CharaNameP.transform.localPosition;
|
||||
DefaultPosDict["CharaNameE"] = CharaNameE.transform.localPosition;
|
||||
DefaultPosDict["CardP"] = CardP.transform.localPosition;
|
||||
DefaultPosDict["CardE"] = CardE.transform.localPosition;
|
||||
DefaultPosDict["TurnLabel"] = TurnLabel.transform.localPosition;
|
||||
}
|
||||
|
||||
public VfxBase CreateStartVfx(float waitTime)
|
||||
{
|
||||
if (BattleManagerBase.GetIns().IsRecovery)
|
||||
{
|
||||
return InstantVfx.Create(delegate
|
||||
{
|
||||
base.gameObject.SetActive(value: false);
|
||||
});
|
||||
}
|
||||
base.gameObject.SetActive(value: true);
|
||||
float rot;
|
||||
Vector3 p1;
|
||||
Vector3 p2;
|
||||
Vector3[] path;
|
||||
return SequentialVfxPlayer.Create(InstantVfx.Create(delegate
|
||||
{
|
||||
int playerSkinId = GameMgr.GetIns().GetDataMgr().GetPlayerSkinId();
|
||||
Texture mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(playerSkinId.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture;
|
||||
CharP.mainTexture = mainTexture;
|
||||
CharP.material = null;
|
||||
mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(GameMgr.GetIns().GetDataMgr().GetEnemySkinId()
|
||||
.ToString("00"), ResourcesManager.AssetLoadPathType.ClassCharaBase, isfetch: true)) as Texture;
|
||||
CharE.mainTexture = mainTexture;
|
||||
CharE.material = null;
|
||||
NetworkUserInfoData networkUserInfoData = GameMgr.GetIns().GetNetworkUserInfoData();
|
||||
_myRotationInfoP.gameObject.SetActive(value: false);
|
||||
if (GameMgr.GetIns().GetDataMgr().TryGetPlayerSubClassId(out var subClassId))
|
||||
{
|
||||
SetClassInfoWithSubClass(GameMgr.GetIns().GetDataMgr().GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId(), subClassId, ClassInfoP, _classInfoWithSubClassP, _subClassGridP);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameMgr.GetIns().GetDataMgr().TryGetPlayerMyRotationInfo(out var myRotationInfo))
|
||||
{
|
||||
_myRotationInfoP.gameObject.SetActive(value: true);
|
||||
_myRotationInfoP.SetMyRotationInfo(myRotationInfo);
|
||||
_myRotationInfoP.Reposition();
|
||||
}
|
||||
ClassInfoP.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetPlayerCharaData(), networkUserInfoData.GetSelfChaosId());
|
||||
_classInfoWithSubClassP.gameObject.SetActive(value: false);
|
||||
}
|
||||
_myRotationInfoE.gameObject.SetActive(value: false);
|
||||
if (GameMgr.GetIns().GetDataMgr().TryGetEnemySubClassId(out var subClassId2))
|
||||
{
|
||||
SetClassInfoWithSubClass(GameMgr.GetIns().GetDataMgr().GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId(), subClassId2, ClassInfoE, _classInfoWithSubClassE, _subClassGridE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameMgr.GetIns().GetDataMgr().TryGetEnemyMyRotationInfo(out var myRotationInfo2))
|
||||
{
|
||||
_myRotationInfoE.gameObject.SetActive(value: true);
|
||||
_myRotationInfoE.SetMyRotationInfo(myRotationInfo2);
|
||||
_myRotationInfoE.Reposition();
|
||||
}
|
||||
ClassInfoE.InitByCharaPrm(GameMgr.GetIns().GetDataMgr().GetEnemyCharaData(), networkUserInfoData.GetOpponentChaosId());
|
||||
_classInfoWithSubClassE.gameObject.SetActive(value: false);
|
||||
}
|
||||
UserPanelP.transform.localPosition = DefaultPosDict["UserPanelP"];
|
||||
UserPanelE.transform.localPosition = DefaultPosDict["UserPanelE"];
|
||||
CharP.transform.localPosition = DefaultPosDict["CharP"];
|
||||
CharE.transform.localPosition = DefaultPosDict["CharE"];
|
||||
ClassNameP.transform.localPosition = DefaultPosDict["ClassNameP"];
|
||||
ClassNameE.transform.localPosition = DefaultPosDict["ClassNameE"];
|
||||
CharaNameP.transform.localPosition = DefaultPosDict["CharaNameP"];
|
||||
CharaNameE.transform.localPosition = DefaultPosDict["CharaNameE"];
|
||||
CardP.transform.localPosition = DefaultPosDict["CardP"] + Vector3.down * 1000f;
|
||||
CardE.transform.localPosition = DefaultPosDict["CardE"] + Vector3.down * 1000f;
|
||||
TurnLabel.transform.localPosition = DefaultPosDict["TurnLabel"];
|
||||
BgBlack.alpha = 0f;
|
||||
CharP.alpha = 0f;
|
||||
CharE.alpha = 0f;
|
||||
ClassNameP.alpha = 0f;
|
||||
ClassNameE.alpha = 0f;
|
||||
CharaNameP.alpha = 0f;
|
||||
CharaNameE.alpha = 0f;
|
||||
VsArcane.alpha = 0f;
|
||||
VsLine.alpha = 0f;
|
||||
VsTitle.alpha = 0f;
|
||||
CardP.color = Color.white;
|
||||
CardE.color = Color.white;
|
||||
TurnLabel.alpha = 0f;
|
||||
TweenAlpha.Begin(UserPanelP.gameObject, 0f, 0f);
|
||||
TweenAlpha.Begin(UserPanelE.gameObject, 0f, 0f);
|
||||
VsArcane.transform.localScale = Vector3.one;
|
||||
CardLabelP.text = Data.SystemText.Get("Battle_0430");
|
||||
CardLabelE.text = Data.SystemText.Get("Battle_0431");
|
||||
MainPanel.alpha = 1f;
|
||||
}), InstantVfx.Create(delegate
|
||||
{
|
||||
TweenAlpha.Begin(VsTitle.gameObject, 0.3f, 1f);
|
||||
VsTitle.transform.localScale = Vector3.one * 10f;
|
||||
iTween.ScaleTo(VsTitle.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInCubic));
|
||||
}), WaitVfx.Create(0.3f), InstantVfx.Create(delegate
|
||||
{
|
||||
TweenAlpha.Begin(BgBlack.gameObject, 0.3f, 0.5f);
|
||||
EffectMgr.EffectType type = EffectMgr.EffectType.CMN_START_VS_1;
|
||||
Se.TYPE setype = Se.TYPE.BATTLE_START_VS;
|
||||
DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo;
|
||||
if (specialBattleSettingInfo != null && specialBattleSettingInfo.IsVsEffectOverride)
|
||||
{
|
||||
type = EffectMgr.EffectType.CMN_START_VS_ST2;
|
||||
setype = Se.TYPE.BATTLE_START_VS_ST2;
|
||||
}
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(setype);
|
||||
GameMgr.GetIns().GetEffectMgr().Start(type, Vector3.zero);
|
||||
TweenAlpha.Begin(VsLine.gameObject, 0.3f, 1f);
|
||||
VsLine.transform.localScale = new Vector3(0.1f, 1f, 1f);
|
||||
iTween.ScaleTo(VsLine.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad));
|
||||
TweenAlpha.Begin(VsArcane.gameObject, 0.3f, 1f);
|
||||
VsArcane.transform.localRotation = Quaternion.identity;
|
||||
VsArcane.transform.localScale = Vector3.one * 0.1f;
|
||||
iTween.ScaleTo(VsArcane.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutQuad));
|
||||
iTween.RotateAdd(VsArcane.gameObject, iTween.Hash("z", 360f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenAlpha.Begin(CharP.gameObject, 0.3f, 1f);
|
||||
TweenAlpha.Begin(CharE.gameObject, 0.3f, 1f);
|
||||
CharP.transform.localPosition = DefaultPosDict["CharP"] + Vector3.right * 500f;
|
||||
CharE.transform.localPosition = DefaultPosDict["CharE"] + Vector3.left * 500f;
|
||||
if (GameMgr.GetIns().GetDataMgr().GetEnemyBattleSkillReverse() == 0)
|
||||
{
|
||||
CharE.uvRect = new Rect(0f, 0f, 1f, 1f);
|
||||
}
|
||||
iTween.MoveTo(CharP.gameObject, iTween.Hash("position", DefaultPosDict["CharP"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CharE.gameObject, iTween.Hash("position", DefaultPosDict["CharE"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenAlpha.Begin(ClassNameP.gameObject, 0.3f, 1f).delay = 0.1f;
|
||||
TweenAlpha.Begin(ClassNameE.gameObject, 0.3f, 1f).delay = 0.1f;
|
||||
ClassNameP.transform.localPosition = DefaultPosDict["ClassNameP"] + Vector3.right * 200f;
|
||||
ClassNameE.transform.localPosition = DefaultPosDict["ClassNameE"] + Vector3.left * 200f;
|
||||
iTween.MoveTo(ClassNameP.gameObject, iTween.Hash("position", DefaultPosDict["ClassNameP"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(ClassNameE.gameObject, iTween.Hash("position", DefaultPosDict["ClassNameE"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenAlpha.Begin(CharaNameP.gameObject, 0.3f, 1f).delay = 0.1f;
|
||||
TweenAlpha.Begin(CharaNameE.gameObject, 0.3f, 1f).delay = 0.1f;
|
||||
CharaNameP.transform.localPosition = DefaultPosDict["CharaNameP"] + Vector3.right * 200f;
|
||||
CharaNameE.transform.localPosition = DefaultPosDict["CharaNameE"] + Vector3.left * 200f;
|
||||
iTween.MoveTo(CharaNameP.gameObject, iTween.Hash("position", DefaultPosDict["CharaNameP"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CharaNameE.gameObject, iTween.Hash("position", DefaultPosDict["CharaNameE"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenAlpha.Begin(UserPanelP.gameObject, 0.3f, 1f);
|
||||
TweenAlpha.Begin(UserPanelE.gameObject, 0.3f, 1f);
|
||||
UserPanelP.transform.localPosition = DefaultPosDict["UserPanelP"] + Vector3.left * 500f;
|
||||
UserPanelE.transform.localPosition = DefaultPosDict["UserPanelE"] + Vector3.right * 500f;
|
||||
iTween.MoveTo(UserPanelP.gameObject, iTween.Hash("position", DefaultPosDict["UserPanelP"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(UserPanelE.gameObject, iTween.Hash("position", DefaultPosDict["UserPanelE"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
}), WaitVfx.Create(waitTime), InstantVfx.Create(delegate
|
||||
{
|
||||
TweenAlpha.Begin(BgBlack.gameObject, 0.3f, 0.9f);
|
||||
TweenAlpha.Begin(VsTitle.gameObject, 0.3f, 0f);
|
||||
iTween.ScaleTo(VsTitle.gameObject, iTween.Hash("scale", Vector3.one * 2f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(VsArcane.gameObject, 0.3f, 0f);
|
||||
iTween.ScaleTo(VsArcane.gameObject, iTween.Hash("scale", Vector3.one * 5f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(ClassNameP.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(ClassNameP.gameObject, iTween.Hash("x", DefaultPosDict["ClassNameP"].x - 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(ClassNameE.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(ClassNameE.gameObject, iTween.Hash("x", DefaultPosDict["ClassNameE"].x + 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(CharaNameP.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(CharaNameP.gameObject, iTween.Hash("x", DefaultPosDict["CharaNameP"].x - 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(CharaNameE.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(CharaNameE.gameObject, iTween.Hash("x", DefaultPosDict["CharaNameE"].x + 200f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(UserPanelP.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(UserPanelP.gameObject, iTween.Hash("x", DefaultPosDict["UserPanelP"].x + 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
TweenAlpha.Begin(UserPanelE.gameObject, 0.3f, 0f);
|
||||
iTween.MoveTo(UserPanelE.gameObject, iTween.Hash("x", DefaultPosDict["UserPanelE"].x - 200f, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInExpo));
|
||||
}), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.DRAW);
|
||||
CardP.spriteName = CardFrontSpriteName;
|
||||
CardE.spriteName = CardFrontSpriteName;
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("position", DefaultPosDict["CardP"], "time", 0.4f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("position", DefaultPosDict["CardE"], "time", 0.4f, "delay", 0.05f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
}), WaitVfx.Create(0.5f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1);
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeInOutCubic));
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("position", Vector3.zero, "time", 0.3f, "delay", 0.05f, "islocal", true, "easetype", iTween.EaseType.easeInOutCubic));
|
||||
iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad));
|
||||
iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad));
|
||||
}), WaitVfx.Create(0.1f), InstantVfx.Create(delegate
|
||||
{
|
||||
CardP.depth = 0;
|
||||
CardE.depth = 2;
|
||||
CardLabelP.text = "";
|
||||
CardLabelE.text = "";
|
||||
CardP.spriteName = CardBackSpriteName;
|
||||
CardE.spriteName = CardBackSpriteName;
|
||||
iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad));
|
||||
iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad));
|
||||
}), WaitVfx.Create(0.2f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2);
|
||||
rot = Random.value * 30f - 15f;
|
||||
p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 400f;
|
||||
p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 100f;
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
}), WaitVfx.Create(0.1f), InstantVfx.Create(delegate
|
||||
{
|
||||
CardP.depth = 2;
|
||||
CardE.depth = 0;
|
||||
}), WaitVfx.Create(0.1f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2);
|
||||
rot = Random.value * 30f - 15f + 180f;
|
||||
p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 320f;
|
||||
p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 80f;
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.16f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.16f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
}), WaitVfx.Create(0.08f), InstantVfx.Create(delegate
|
||||
{
|
||||
CardP.depth = 0;
|
||||
CardE.depth = 2;
|
||||
}), WaitVfx.Create(0.08f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_2);
|
||||
rot = Random.value * 30f - 15f;
|
||||
p1 = (Vector3)MotionUtils.GetPositionByAngle(rot) * 320f;
|
||||
p2 = (Vector3)MotionUtils.GetPositionByAngle(rot + 180f) * 80f;
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1, p2, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.12f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
path = MotionUtils.GetBezierCubic(Vector3.zero, p1 * -1f, p2 * -1f, Vector3.zero, 20);
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("path", path, "movetopath", false, "time", 0.12f, "islocal", true, "easetype", iTween.EaseType.linear));
|
||||
}), WaitVfx.Create(0.06f), InstantVfx.Create(delegate
|
||||
{
|
||||
CardP.depth = 2;
|
||||
CardE.depth = 0;
|
||||
}), WaitVfx.Create(0.06f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1);
|
||||
iTween.MoveTo(CardP.gameObject, iTween.Hash("position", new Vector3(240f, -160f, 0f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
iTween.MoveTo(CardE.gameObject, iTween.Hash("position", new Vector3(-240f, 160f, 0f), "time", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
}), WaitVfx.Create(0.3f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_3);
|
||||
iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad));
|
||||
iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", new Vector3(0.01f, 1.2f, 1f), "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeInQuad));
|
||||
}), WaitVfx.Create(0.1f), InstantVfx.Create(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_START_CARD_1, CardP.transform.position);
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.DRAW_CARD_OPEN);
|
||||
CardP.spriteName = CardFrontSpriteName;
|
||||
CardE.spriteName = CardFrontSpriteName;
|
||||
if (BattleManagerBase.GetIns().IsFirst)
|
||||
{
|
||||
CardLabelP.text = Data.SystemText.Get("Battle_0430");
|
||||
CardLabelE.text = Data.SystemText.Get("Battle_0431");
|
||||
TurnLabel.text = Data.SystemText.Get("Battle_0432");
|
||||
}
|
||||
else
|
||||
{
|
||||
CardLabelP.text = Data.SystemText.Get("Battle_0431");
|
||||
CardLabelE.text = Data.SystemText.Get("Battle_0430");
|
||||
TurnLabel.text = Data.SystemText.Get("Battle_0433");
|
||||
}
|
||||
TweenAlpha.Begin(TurnLabel.gameObject, 0.3f, 1f);
|
||||
TurnLabel.transform.localPosition = DefaultPosDict["TurnLabel"] + Vector3.right * 50f;
|
||||
iTween.MoveTo(TurnLabel.gameObject, iTween.Hash("position", DefaultPosDict["TurnLabel"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo));
|
||||
TweenColor.Begin(CardE.gameObject, 0.1f, Color.gray);
|
||||
TweenColor.Begin(CardLabelE.gameObject, 0.1f, Color.gray);
|
||||
iTween.ScaleTo(CardP.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad));
|
||||
iTween.ScaleTo(CardE.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutQuad));
|
||||
}), WaitVfx.Create(1.5f), InstantVfx.Create(delegate
|
||||
{
|
||||
TweenAlpha.Begin(BgBlack.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(CardP.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(CardE.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(CharP.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(CharE.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(VsLine.gameObject, 0.1f, 0f);
|
||||
TweenAlpha.Begin(TurnLabel.gameObject, 0.1f, 0f);
|
||||
}), WaitVfx.Create(0.1f), InstantVfx.Create(delegate
|
||||
{
|
||||
base.gameObject.SetActive(value: false);
|
||||
}));
|
||||
}
|
||||
|
||||
private static void SetClassInfoWithSubClass(ClassCharacterMasterData charaData, int chaosId, int subClassId, ClassInfoParts defaultClassInfoParts, ClassInfoParts classInfoParts, FlexibleGrid grid)
|
||||
{
|
||||
classInfoParts.gameObject.SetActive(value: true);
|
||||
defaultClassInfoParts.ClassNameLabel.text = string.Empty;
|
||||
classInfoParts.InitByCharaPrm(charaData, chaosId);
|
||||
classInfoParts.SetSubClass((CardBasePrm.ClanType)subClassId);
|
||||
UIUtil.AdjustClassInfoPartsSize(classInfoParts, grid, 375);
|
||||
}
|
||||
}
|
||||
220
SVSim.BattleEngine/Engine/BattleUIContainer.cs
Normal file
220
SVSim.BattleEngine/Engine/BattleUIContainer.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class BattleUIContainer : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public BattleButtonControl ButtonControl;
|
||||
|
||||
[SerializeField]
|
||||
private WizardUIButton BattleMenuBtn;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton TurnEndBtn;
|
||||
|
||||
[SerializeField]
|
||||
public Transform EnemyChoiceBraveBtn;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _battery;
|
||||
|
||||
private const float LONG_PRESS_TIME = 0.2f;
|
||||
|
||||
private float? _predictionWaitTime;
|
||||
|
||||
public Action<bool> ShowPrediction;
|
||||
|
||||
private bool _enableMenuRequest;
|
||||
|
||||
private InputMgr _inputMgr;
|
||||
|
||||
public bool PlayerCardPlaying;
|
||||
|
||||
private bool _forceDisableMenu;
|
||||
|
||||
public GameObject Battery => _battery;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
BattleMenuBtn.onPress.Clear();
|
||||
BattleMenuBtn.onPress.Add(new EventDelegate(delegate
|
||||
{
|
||||
ButtonControl.OnPressMenuBtn();
|
||||
}));
|
||||
if (!GameMgr.GetIns().IsWatchBattle)
|
||||
{
|
||||
TurnEndBtn.onClick.Clear();
|
||||
TurnEndBtn.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
ButtonControl.OnPressTurnEnd();
|
||||
}));
|
||||
}
|
||||
_predictionWaitTime = null;
|
||||
UIEventListener.Get(TurnEndBtn.gameObject).onPress = delegate(GameObject obj, bool isPress)
|
||||
{
|
||||
if (isPress)
|
||||
{
|
||||
_predictionWaitTime = Time.realtimeSinceStartup;
|
||||
}
|
||||
else
|
||||
{
|
||||
_predictionWaitTime = null;
|
||||
if (ShowPrediction != null)
|
||||
{
|
||||
ShowPrediction(obj: false);
|
||||
}
|
||||
}
|
||||
};
|
||||
UIEventListener.Get(TurnEndBtn.gameObject).onHover = delegate(GameObject obj, bool isHover)
|
||||
{
|
||||
if (BattleManagerBase.UseCustomMouse && UIManager.GetInstance().ApplicationHasFocus)
|
||||
{
|
||||
if (isHover)
|
||||
{
|
||||
_predictionWaitTime = Time.realtimeSinceStartup;
|
||||
}
|
||||
else
|
||||
{
|
||||
_predictionWaitTime = null;
|
||||
if (ShowPrediction != null)
|
||||
{
|
||||
ShowPrediction(isHover);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
UIEventListener.Get(TurnEndBtn.gameObject).onDragOut = delegate
|
||||
{
|
||||
_predictionWaitTime = null;
|
||||
if (ShowPrediction != null)
|
||||
{
|
||||
ShowPrediction(obj: false);
|
||||
}
|
||||
};
|
||||
_inputMgr = GameMgr.GetIns().GetInputMgr();
|
||||
}
|
||||
|
||||
public void EnableMenu()
|
||||
{
|
||||
if (!PlayerCardPlaying && !_forceDisableMenu)
|
||||
{
|
||||
BattleMenuBtn.isEnabled = true;
|
||||
SetEnableReset(isEnable: true);
|
||||
SetEnableHint(isEnable: true);
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestEnableMenuWhenTouchable()
|
||||
{
|
||||
_enableMenuRequest = true;
|
||||
}
|
||||
|
||||
private void TryEnableMenu()
|
||||
{
|
||||
if (BattleManagerBase.GetIns().GetBattlePlayer(isPlayer: true).BattleView.IsTouchable())
|
||||
{
|
||||
EnableMenu();
|
||||
_enableMenuRequest = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void ForceEnableMenu()
|
||||
{
|
||||
_forceDisableMenu = false;
|
||||
EnableMenu();
|
||||
}
|
||||
|
||||
public void DisableMenu(bool isForceDisable = false)
|
||||
{
|
||||
if (isForceDisable || (!BattleManagerBase.GetIns().IsRecovery && !GameMgr.GetIns().IsReplayBattle && !GameMgr.GetIns().IsWatchBattle))
|
||||
{
|
||||
BattleMenuBtn.isEnabled = false;
|
||||
SetEnableReset(isEnable: false);
|
||||
SetEnableHint(isEnable: false);
|
||||
}
|
||||
}
|
||||
|
||||
public void ForceDisableMenu()
|
||||
{
|
||||
_forceDisableMenu = true;
|
||||
_enableMenuRequest = false;
|
||||
DisableMenu();
|
||||
}
|
||||
|
||||
public void SetEnableReset(bool isEnable)
|
||||
{
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
if (ins is PuzzleBattleManager)
|
||||
{
|
||||
(ins as PuzzleBattleManager).ResetButton.SetState((!isEnable) ? UIButtonColor.State.Disabled : UIButtonColor.State.Normal, immediate: false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetEnableHint(bool isEnable)
|
||||
{
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
if (ins is PuzzleBattleManager)
|
||||
{
|
||||
(ins as PuzzleBattleManager).HintButton.isEnabled = isEnable;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEnableMenu()
|
||||
{
|
||||
return BattleMenuBtn.isEnabled;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UIManager instance = UIManager.GetInstance();
|
||||
GameMgr ins = GameMgr.GetIns();
|
||||
BattleManagerBase ins2 = BattleManagerBase.GetIns();
|
||||
if (_enableMenuRequest)
|
||||
{
|
||||
if (BattleMenuBtn.isEnabled)
|
||||
{
|
||||
_enableMenuRequest = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
TryEnableMenu();
|
||||
}
|
||||
}
|
||||
if (!Input.GetMouseButton(0) && instance != null && instance.IsCurrentScene(UIManager.ViewScene.Battle) && !instance.isOpenLoading() && !instance.isFading() && ins.GetInputMgr().isBackKeyEnable && !BattleManagerBase.IsTutorial)
|
||||
{
|
||||
if (BattleMenuBtn.gameObject.activeInHierarchy && BattleMenuBtn.isActiveAndEnabled && !instance.isOpenDialog())
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape) && IsEnableMenu())
|
||||
{
|
||||
ButtonControl.OnPressMenuBtn();
|
||||
}
|
||||
if (BattleManagerBase.UseKeyboardTurnEndSpaceShortcut && _inputMgr.IsKeyboardSpace() && ins2.BattlePlayer.PlayerBattleView.TurnEndButtonUI.GameObject.activeInHierarchy && ins2.BattlePlayer.PlayerBattleView.TurnEndButtonUI.GetEnableLabel && ins2.BattlePlayer.IsSelfTurn && _inputMgr.KeyboardEnableControlSpace)
|
||||
{
|
||||
ButtonControl.OnPressTurnEnd();
|
||||
}
|
||||
}
|
||||
else if (instance.isOpenDialog() && !ButtonControl.IsSettingMenuOpen && !ButtonControl.IsRetireMenuOpen && !ButtonControl.IsQuestMissionOpen && Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
ins2.BattlePlayer.PlayerBattleView.IsMenuCloseEscape = true;
|
||||
ButtonControl.HideBattleMenu();
|
||||
}
|
||||
}
|
||||
if (TurnEndBtn.state == UIButtonColor.State.Pressed || BattleManagerBase.UseCustomMouse)
|
||||
{
|
||||
if (ShowPrediction != null && _predictionWaitTime.HasValue && _predictionWaitTime.Value + 0.2f < Time.realtimeSinceStartup)
|
||||
{
|
||||
ShowPrediction(obj: true);
|
||||
_predictionWaitTime = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_predictionWaitTime = null;
|
||||
}
|
||||
if (ins.IsWatchBattle && ins2.IsBattleEnd)
|
||||
{
|
||||
ButtonControl.HideAllMenu(isWithoutSE: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
219
SVSim.BattleEngine/Engine/Bgm.cs
Normal file
219
SVSim.BattleEngine/Engine/Bgm.cs
Normal file
@@ -0,0 +1,219 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CriWare;
|
||||
using Cute;
|
||||
using Wizard;
|
||||
|
||||
public class Bgm
|
||||
{
|
||||
public enum BGM_TYPE
|
||||
{
|
||||
NONE,
|
||||
TITLE,
|
||||
TITLE_SPECIAL_1,
|
||||
TITLE_SPECIAL_2,
|
||||
HOME,
|
||||
BATTLE_STANDBY,
|
||||
BATTLE,
|
||||
SYS_WIN_LOOP,
|
||||
SYS_LOSE_LOOP,
|
||||
COLOSSEUM_FINAL,
|
||||
GRANDPRIX_SPECIAL,
|
||||
GRANDPRIX_SPECIAL_FINAL,
|
||||
SEALED,
|
||||
QUEST,
|
||||
COMPETITION_LOBBY,
|
||||
BINGO,
|
||||
MAX
|
||||
}
|
||||
|
||||
private class BgmInfo
|
||||
{
|
||||
public string CueName { get; private set; }
|
||||
|
||||
public string CueSheet { get; private set; }
|
||||
|
||||
public BgmInfo(string cueName, string cueSheet)
|
||||
{
|
||||
CueName = cueName;
|
||||
CueSheet = cueSheet;
|
||||
}
|
||||
}
|
||||
|
||||
private const string CATEGORY_NAME = "BGM";
|
||||
|
||||
private Dictionary<BGM_TYPE, BgmInfo> m_AudioData;
|
||||
|
||||
private string m_PlayBgmCueName;
|
||||
|
||||
private int m_CurrentBgmIdx;
|
||||
|
||||
private int m_MaxBgmCount;
|
||||
|
||||
private float m_volume;
|
||||
|
||||
private bool m_isMuted;
|
||||
|
||||
public Bgm()
|
||||
{
|
||||
m_AudioData = new Dictionary<BGM_TYPE, BgmInfo>();
|
||||
m_PlayBgmCueName = null;
|
||||
m_CurrentBgmIdx = 0;
|
||||
m_MaxBgmCount = Toolbox.AudioManager.GetBgmMaxCount();
|
||||
SetVolume(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BGM_VOLUME));
|
||||
Mute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE));
|
||||
}
|
||||
|
||||
public void AddList(BGM_TYPE BgmType, string cueName, string cueSheet = null)
|
||||
{
|
||||
if (!m_AudioData.ContainsKey(BgmType))
|
||||
{
|
||||
m_AudioData.Add(BgmType, new BgmInfo(cueName, (cueSheet == null) ? cueName : cueSheet));
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveList(BGM_TYPE BgmType)
|
||||
{
|
||||
if (m_AudioData.ContainsKey(BgmType))
|
||||
{
|
||||
m_AudioData.Remove(BgmType);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Play(BGM_TYPE BgmType, float FadeTime = 0f, long startTime = 0L)
|
||||
{
|
||||
if (BgmType != BGM_TYPE.NONE)
|
||||
{
|
||||
BgmInfo bgmInfo = m_AudioData[BgmType];
|
||||
string cueSheet = bgmInfo.CueSheet;
|
||||
m_PlayBgmCueName = bgmInfo.CueName;
|
||||
Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, FadeTime, 0f, startTime);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void PlayCrossFade(BGM_TYPE BgmType, float fadeOutTime, float fadeInTime, long startTime)
|
||||
{
|
||||
if (BgmType != BGM_TYPE.NONE)
|
||||
{
|
||||
BgmInfo bgmInfo = m_AudioData[BgmType];
|
||||
string cueSheet = bgmInfo.CueSheet;
|
||||
m_PlayBgmCueName = bgmInfo.CueName;
|
||||
Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, fadeOutTime);
|
||||
m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount;
|
||||
Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void PlayFadeOut(BGM_TYPE BgmType, float FadeOutTime = 0f, float FadeInTime = 0f)
|
||||
{
|
||||
Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, FadeOutTime);
|
||||
if (BgmType != BGM_TYPE.NONE)
|
||||
{
|
||||
m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount;
|
||||
BgmInfo bgmInfo = m_AudioData[BgmType];
|
||||
string cueSheet = bgmInfo.CueSheet;
|
||||
m_PlayBgmCueName = bgmInfo.CueName;
|
||||
Toolbox.AudioManager.PlayBgmFromName(cueSheet, m_PlayBgmCueName, cueSheet, cueSheet, m_CurrentBgmIdx, loop: false, FadeInTime, FadeOutTime, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Play(string cuename, float fadeInTime, long startTime)
|
||||
{
|
||||
if (IsPreInstall(cuename, out var type))
|
||||
{
|
||||
Play(type, fadeInTime, startTime);
|
||||
return;
|
||||
}
|
||||
m_PlayBgmCueName = cuename;
|
||||
Toolbox.AudioManager.PlayBgmFromName(cuename, cuename, cuename, cuename, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime);
|
||||
}
|
||||
|
||||
public virtual void PlayCrossFade(string cuename, float fadeOutTime, float fadeInTime, long startTime)
|
||||
{
|
||||
if (IsPreInstall(cuename, out var type))
|
||||
{
|
||||
PlayCrossFade(type, fadeOutTime, fadeInTime, startTime);
|
||||
return;
|
||||
}
|
||||
m_PlayBgmCueName = cuename;
|
||||
Toolbox.AudioManager.StopFadeBgm(m_CurrentBgmIdx, fadeOutTime);
|
||||
m_CurrentBgmIdx = (m_CurrentBgmIdx + 1) % m_MaxBgmCount;
|
||||
Toolbox.AudioManager.PlayBgmFromName(cuename, cuename, cuename, cuename, m_CurrentBgmIdx, loop: false, fadeInTime, 0f, startTime);
|
||||
}
|
||||
|
||||
public virtual void Pause()
|
||||
{
|
||||
for (int i = 0; i < m_MaxBgmCount; i++)
|
||||
{
|
||||
Toolbox.AudioManager.PauseBgm(isPause: true, i);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Stop(float FadeTime, Action onStopped)
|
||||
{
|
||||
m_PlayBgmCueName = null;
|
||||
AudioManager audioManager = Toolbox.AudioManager;
|
||||
audioManager.StopFadeBgm(m_CurrentBgmIdx, FadeTime);
|
||||
audioManager.StartCoroutine_DelayMethod(FadeTime, onStopped);
|
||||
}
|
||||
|
||||
public virtual void StopAll(float FadeTime)
|
||||
{
|
||||
m_PlayBgmCueName = null;
|
||||
for (int i = 0; i < m_MaxBgmCount; i++)
|
||||
{
|
||||
Toolbox.AudioManager.StopFadeBgm(i, FadeTime);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlayBGM(BGM_TYPE bgmType)
|
||||
{
|
||||
if (bgmType != BGM_TYPE.NONE)
|
||||
{
|
||||
return m_AudioData[bgmType].CueName == m_PlayBgmCueName;
|
||||
}
|
||||
return m_PlayBgmCueName != null;
|
||||
}
|
||||
|
||||
public string GetCueSheet(BGM_TYPE bgmType)
|
||||
{
|
||||
return m_AudioData[bgmType].CueSheet;
|
||||
}
|
||||
|
||||
public bool IsPreInstall(string cuename, out BGM_TYPE type)
|
||||
{
|
||||
foreach (KeyValuePair<BGM_TYPE, BgmInfo> audioDatum in m_AudioData)
|
||||
{
|
||||
BgmInfo value = audioDatum.Value;
|
||||
if (value.CueName == cuename && value.CueSheet == SoundMgr.PREINSTALL_CUESHEET)
|
||||
{
|
||||
type = audioDatum.Key;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
type = BGM_TYPE.NONE;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SetVolume(float Prm)
|
||||
{
|
||||
CriAtomExCategory.SetVolume("BGM", Prm);
|
||||
m_volume = Prm;
|
||||
}
|
||||
|
||||
public void Mute(bool isMute)
|
||||
{
|
||||
CriAtomExCategory.Mute("BGM", isMute);
|
||||
m_isMuted = isMute;
|
||||
}
|
||||
|
||||
public float GetVolume()
|
||||
{
|
||||
return m_volume;
|
||||
}
|
||||
|
||||
public bool IsMuted()
|
||||
{
|
||||
return m_isMuted;
|
||||
}
|
||||
}
|
||||
7
SVSim.BattleEngine/Engine/BuffCountInfo.cs
Normal file
7
SVSim.BattleEngine/Engine/BuffCountInfo.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
public class BuffCountInfo : TurnAndIntValue
|
||||
{
|
||||
public BuffCountInfo(int turn, bool isSelfTurn)
|
||||
: base(-1, turn, isSelfTurn)
|
||||
{
|
||||
}
|
||||
}
|
||||
395
SVSim.BattleEngine/Engine/BuffDetailInfoUI.cs
Normal file
395
SVSim.BattleEngine/Engine/BuffDetailInfoUI.cs
Normal file
@@ -0,0 +1,395 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.UI;
|
||||
|
||||
public class BuffDetailInfoUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _titleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _buffLabel;
|
||||
|
||||
private const float TITLE_HEIGHT = 50f;
|
||||
|
||||
public const string NOT_SHOW_BUFF_DETAIL_STORY_SPECIAL_BATTLE_ID = "42";
|
||||
|
||||
public float Height => 50f + (float)_buffLabel.height;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_titleLabel.text = Data.SystemText.Get("BattleLog_0268");
|
||||
}
|
||||
|
||||
public void SetBuffDetailLabel(BattleCardBase cardBase)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<SkillBase> allBuffSkills = GetAllBuffSkills(cardBase, cardBase.BuffInfoList.Select((BuffInfo b) => b.SkillFrom).ToList());
|
||||
if (!cardBase.IsClass)
|
||||
{
|
||||
if (cardBase.Cost != cardBase.BaseCost)
|
||||
{
|
||||
int num = cardBase.Cost - cardBase.BaseCost;
|
||||
string text = ((num > 0) ? ("+" + num) : num.ToString());
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0273", text));
|
||||
}
|
||||
if (allBuffSkills.Any((SkillBase s) => s is Skill_powerup || s is Skill_power_down))
|
||||
{
|
||||
int currentAtkBuff = cardBase.GetCurrentAtkBuff();
|
||||
int currentLifeBuff = cardBase.GetCurrentLifeBuff();
|
||||
if (currentAtkBuff != 0 || currentLifeBuff != 0)
|
||||
{
|
||||
string retAttack = string.Empty;
|
||||
string retLife = string.Empty;
|
||||
BattleLogUtility.GetBuffValueStringFormatted(currentAtkBuff, currentLifeBuff, ref retAttack, ref retLife);
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0040", retAttack, retLife));
|
||||
}
|
||||
}
|
||||
bool flag = allBuffSkills.Any((SkillBase s) => s is Skill_quick && (!cardBase.IsInHand || s.OnWhenPlayStart == 0));
|
||||
bool flag2 = allBuffSkills.Any((SkillBase s) => s is Skill_rush && (!cardBase.IsInHand || s.OnWhenPlayStart == 0));
|
||||
bool flag3 = allBuffSkills.Any((SkillBase s) => s is Skill_killer && (!cardBase.IsInHand || s.OnWhenPlayStart == 0));
|
||||
bool flag4 = allBuffSkills.Any((SkillBase s) => s is Skill_drain && (!cardBase.IsInHand || s.OnWhenPlayStart == 0));
|
||||
if (ExistCopiedSkillNeedDetailText(cardBase))
|
||||
{
|
||||
IEnumerable<BuffInfo> source = cardBase.BuffInfoList.Where((BuffInfo b) => b.IsCopied);
|
||||
for (int num2 = 0; num2 < source.Count(); num2++)
|
||||
{
|
||||
if (source.ElementAt(num2).SkillFrom is SkillBaseCopy skillBaseCopy)
|
||||
{
|
||||
switch (skillBaseCopy.SkillType)
|
||||
{
|
||||
case "quick":
|
||||
flag = true;
|
||||
break;
|
||||
case "rush":
|
||||
flag2 = true;
|
||||
break;
|
||||
case "killer":
|
||||
flag3 = true;
|
||||
break;
|
||||
case "drain":
|
||||
flag4 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0011"));
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0012"));
|
||||
}
|
||||
if (flag3)
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0009"));
|
||||
}
|
||||
if (flag4)
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0006"));
|
||||
}
|
||||
if (allBuffSkills.Any((SkillBase s) => s is Skill_attack_count && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0018", cardBase.MaxAttackableCount.ToString()));
|
||||
}
|
||||
if (allBuffSkills.Any((SkillBase s) => s is Skill_ignore_guard && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0008"));
|
||||
}
|
||||
if (allBuffSkills.Any((SkillBase s) => s is Skill_consume_ep_modifier && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)) || NeedNoConsumeEpText(cardBase))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0201"));
|
||||
}
|
||||
}
|
||||
IEnumerable<Skill_shield> source2 = from s in allBuffSkills
|
||||
where s is Skill_shield && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)
|
||||
select (Skill_shield)s;
|
||||
if (source2.Any())
|
||||
{
|
||||
if (source2.Any((Skill_shield s) => s.IsAllDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0274"));
|
||||
}
|
||||
if (source2.Any((Skill_shield s) => s.IsNextDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0275"));
|
||||
}
|
||||
if (source2.Any((Skill_shield s) => s.IsSkillDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0276"));
|
||||
}
|
||||
if (source2.Any((Skill_shield s) => s.IsSpellDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0277"));
|
||||
}
|
||||
}
|
||||
List<Skill_damage_cut> source3 = (from s in allBuffSkills
|
||||
where s is Skill_damage_cut && (!cardBase.IsInHand || s.OnWhenPlayStart == 0)
|
||||
select (Skill_damage_cut)s).ToList();
|
||||
if (source3.Any())
|
||||
{
|
||||
if (source3.Any((Skill_damage_cut s) => s.IsAllDamageCut))
|
||||
{
|
||||
int num3 = -source3.Where((Skill_damage_cut s) => s.IsAllDamageCut).Sum((Skill_damage_cut s) => s.CutAmount);
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0278", num3.ToString()));
|
||||
}
|
||||
if (source3.Any((Skill_damage_cut s) => s.IsNextDamageCut))
|
||||
{
|
||||
int num4 = -source3.Where((Skill_damage_cut s) => s.IsNextDamageCut).Sum((Skill_damage_cut s) => s.CutAmount);
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0279", num4.ToString()));
|
||||
}
|
||||
if (source3.Any((Skill_damage_cut s) => s.IsSkillDamageCut))
|
||||
{
|
||||
int num5 = -source3.Where((Skill_damage_cut s) => s.IsSkillDamageCut).Sum((Skill_damage_cut s) => s.CutAmount);
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0280", num5.ToString()));
|
||||
}
|
||||
if (source3.Any((Skill_damage_cut s) => s.IsDamageClipping))
|
||||
{
|
||||
List<int> list = (from s in source3
|
||||
where s.ClippingMax != int.MaxValue
|
||||
select s.ClippingMax).ToList();
|
||||
if (source3.Any((Skill_damage_cut s) => !IsNotShowDamageCutLifeLowerLimitBuffDetail(s)))
|
||||
{
|
||||
list.AddRange(from s in source3
|
||||
where s.LifeLowerLimit != -1
|
||||
select (!(s.SkillPrm.ownerCard is UnitBattleCard)) ? (s.SkillPrm.ownerCard.SelfBattlePlayer.Class.Life - 1) : (s.SkillPrm.ownerCard.Life - 1));
|
||||
}
|
||||
if (list.Any())
|
||||
{
|
||||
int num6 = list.Min();
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0281", (num6 + 1).ToString(), num6.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
_buffLabel.text = stringBuilder.ToString();
|
||||
}
|
||||
|
||||
public void SetBuffDetailLabelInReplay(List<NetworkBattleReceiver.ReplayBuffInfoLabel> buffInfoTextTypeList, BattleCardBase card)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (!card.IsClass)
|
||||
{
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Cost))
|
||||
{
|
||||
int num = card.Cost - card.BaseCost;
|
||||
string text = ((num > 0) ? ("+" + num) : num.ToString());
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0273", text));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.StatusBuff))
|
||||
{
|
||||
string retAttack = string.Empty;
|
||||
string retLife = string.Empty;
|
||||
BattleLogUtility.GetBuffValueStringFormatted(card.GetCurrentAtkBuff(), card.GetCurrentLifeBuff(), ref retAttack, ref retLife);
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0040", retAttack, retLife));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Quick))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0011"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Rush))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0012"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Killer))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0009"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.Drain))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0006"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AttackCount))
|
||||
{
|
||||
int value = buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AttackCount).Value;
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0018", value.ToString()));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.IgnoreGuard))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0008"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.ConsumeEpModifier))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0201"));
|
||||
}
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0274"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0275"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0276"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SpellDamageShield))
|
||||
{
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0277"));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageCut))
|
||||
{
|
||||
int num2 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.AllDamageCut).Value;
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0278", num2.ToString()));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageCut))
|
||||
{
|
||||
int num3 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.NextDamageCut).Value;
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0279", num3.ToString()));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageCut))
|
||||
{
|
||||
int num4 = -buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.SkillDamageCut).Value;
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0280", num4.ToString()));
|
||||
}
|
||||
if (buffInfoTextTypeList.Any((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.DamageClipping))
|
||||
{
|
||||
int value2 = buffInfoTextTypeList.FirstOrDefault((NetworkBattleReceiver.ReplayBuffInfoLabel b) => b.Type == NetworkBattleReceiver.ReplayBuffInfoTextType.DamageClipping).Value;
|
||||
AppendBuffText(stringBuilder, Data.SystemText.Get("BattleLog_0281", (value2 + 1).ToString(), value2.ToString()));
|
||||
}
|
||||
_buffLabel.text = stringBuilder.ToString();
|
||||
}
|
||||
|
||||
public static List<SkillBase> GetAllBuffSkills(BattleCardBase cardBase, List<SkillBase> buffSkills)
|
||||
{
|
||||
List<SkillBase> list = new List<SkillBase>();
|
||||
foreach (SkillBase buffSkill in buffSkills)
|
||||
{
|
||||
if (buffSkill is Skill_attach_skill)
|
||||
{
|
||||
IEnumerable<SkillBase> source = from b in buffSkill.GetBuffInfoContainer()
|
||||
where cardBase == b._targetCard
|
||||
select b._attachSkill;
|
||||
list.AddRange(GetAllBuffSkills(cardBase, source.Where((SkillBase s) => !cardBase.IsClass || !ExistClassSkillNeedBuffDetailText(s)).ToList()));
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(buffSkill);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public void AppendBuffText(StringBuilder buffTextsStringBuilder, string buffText)
|
||||
{
|
||||
if (buffTextsStringBuilder.Length > 0)
|
||||
{
|
||||
buffTextsStringBuilder.Append("\r\n");
|
||||
}
|
||||
buffTextsStringBuilder.Append(buffText);
|
||||
}
|
||||
|
||||
public static bool NeedBuffDetailText(BattleCardBase cardBase)
|
||||
{
|
||||
if (cardBase is ClassBattleCardBase)
|
||||
{
|
||||
return cardBase.BuffInfoList.Any((BuffInfo s) => ExistClassSkillNeedBuffDetailText(s.SkillFrom));
|
||||
}
|
||||
if (!cardBase.BuffInfoList.Exists((BuffInfo b) => ExistSkillNeedBuffDetailText(cardBase, b.SkillFrom)))
|
||||
{
|
||||
return NeedNoConsumeEpText(cardBase);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsNotShowDamageCutLifeLowerLimitBuffDetail(SkillBase skill)
|
||||
{
|
||||
bool num = skill is Skill_damage_cut { IsDamageClipping: not false } skill_damage_cut && skill_damage_cut.LifeLowerLimit != -1;
|
||||
DataMgr.SpecialBattleSetting specialBattleSettingInfo = GameMgr.GetIns().GetDataMgr().SpecialBattleSettingInfo;
|
||||
if (num && specialBattleSettingInfo != null && specialBattleSettingInfo.Id == "42")
|
||||
{
|
||||
return skill.SkillPrm.ownerCard is EnemyClassBattleCard;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool ExistSkillNeedBuffDetailText(BattleCardBase cardBase, SkillBase skill)
|
||||
{
|
||||
if (cardBase.IsInHand && skill.Option.Contains("(timing:when_play)"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!(skill is Skill_quick) && !(skill is Skill_ignore_guard) && !(skill is Skill_attack_count) && !(skill is Skill_shield) && !(skill is Skill_damage_cut) && !(skill is Skill_rush) && !ExistSkillCostChangeNeedDetailText(cardBase, skill) && !(skill is Skill_consume_ep_modifier) && !(skill is Skill_killer) && !(skill is Skill_drain) && !ExistSKillPowerChangeNeedDetailText(cardBase, skill) && !ExistAttachSkillNeedDetailText(cardBase, skill))
|
||||
{
|
||||
return ExistCopiedSkillNeedDetailText(cardBase);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool ExistClassSkillNeedBuffDetailText(SkillBase skill)
|
||||
{
|
||||
if (!(skill is Skill_shield))
|
||||
{
|
||||
if (skill is Skill_damage_cut)
|
||||
{
|
||||
return !IsNotShowDamageCutLifeLowerLimitBuffDetail(skill);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool NeedNoConsumeEpText(BattleCardBase cardBase)
|
||||
{
|
||||
if (cardBase.BuffInfoList.Any((BuffInfo b) => b.SkillFrom is Skill_consume_ep_modifier))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (DetailPanelControl.IsNeedNoConsumeEp(cardBase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool ExistSKillPowerChangeNeedDetailText(BattleCardBase cardBase, SkillBase skill)
|
||||
{
|
||||
if (skill is Skill_powerup || skill is Skill_power_down)
|
||||
{
|
||||
int currentAtkBuff = cardBase.GetCurrentAtkBuff();
|
||||
int currentLifeBuff = cardBase.GetCurrentLifeBuff();
|
||||
if (currentAtkBuff == 0)
|
||||
{
|
||||
return currentLifeBuff != 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool ExistAttachSkillNeedDetailText(BattleCardBase cardBase, SkillBase skill)
|
||||
{
|
||||
if (skill is Skill_attach_skill)
|
||||
{
|
||||
return skill.GetBuffInfoContainer().Any((SkillBase.BuffInfoContainer b) => cardBase == b._targetCard && ExistSkillNeedBuffDetailText(cardBase, b._attachSkill));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ExistCopiedSkillNeedDetailText(BattleCardBase cardBase)
|
||||
{
|
||||
return cardBase.BuffInfoList.Any(delegate(BuffInfo b)
|
||||
{
|
||||
if (!b.IsCopied)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return b.SkillFrom is SkillBaseCopy skillBaseCopy && skillBaseCopy.IsNeedDetail;
|
||||
});
|
||||
}
|
||||
|
||||
private static bool ExistSkillCostChangeNeedDetailText(BattleCardBase cardBase, SkillBase skill)
|
||||
{
|
||||
if (skill is Skill_cost_change)
|
||||
{
|
||||
return cardBase.Cost != cardBase.BaseCost;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
119
SVSim.BattleEngine/Engine/BuffInfo.cs
Normal file
119
SVSim.BattleEngine/Engine/BuffInfo.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
|
||||
public class BuffInfo
|
||||
{
|
||||
public List<int> CopiedSkillDescriptionValueList = new List<int>();
|
||||
|
||||
public List<int> CopiedEvoSkillDescriptionValueList = new List<int>();
|
||||
|
||||
public int BaseCardIDFrom { get; private set; }
|
||||
|
||||
public int CardIDFrom { get; private set; }
|
||||
|
||||
public SkillBase SkillFrom { get; private set; }
|
||||
|
||||
public BattleCardBase OwnerCard { get; private set; }
|
||||
|
||||
public BattleCardBase PreviousOwner { get; private set; }
|
||||
|
||||
public BattleCardBase TargetCard { get; set; }
|
||||
|
||||
public bool IsCopied { get; set; }
|
||||
|
||||
public bool IsPlayer { get; set; }
|
||||
|
||||
public bool IsCopiedEvolutionSkill { get; set; }
|
||||
|
||||
public bool IsEvolutionSkill { get; set; }
|
||||
|
||||
public bool IsSaveBurialRiteSkill { get; set; }
|
||||
|
||||
public bool IsGetonSkill { get; set; }
|
||||
|
||||
public bool IsHiddenClassLogSkill { get; set; }
|
||||
|
||||
public string DivergenceId { get; set; }
|
||||
|
||||
public bool IsReserveTokenDrawSkill { get; set; }
|
||||
|
||||
public BossRushSpecialSkill SpecialSkillInfo { get; set; }
|
||||
|
||||
public BuffInfo(int fromBaseCardID, int fromCardID, SkillBase fromSkill, BattleCardBase ownerCard = null, bool isPlayer = false, string divergenceId = "")
|
||||
{
|
||||
BaseCardIDFrom = fromBaseCardID;
|
||||
CardIDFrom = fromCardID;
|
||||
SkillFrom = fromSkill;
|
||||
PreviousOwner = null;
|
||||
if (SkillFrom != null)
|
||||
{
|
||||
IsPlayer = SkillFrom.SkillPrm.ownerCard.IsPlayer;
|
||||
IsEvolutionSkill = SkillFrom.SkillPrm.ownerCard.EvolutionSkills != null && SkillFrom.SkillPrm.ownerCard.EvolutionSkills.Any((SkillBase skill) => skill == SkillFrom);
|
||||
DivergenceId = SkillFrom.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.divergence_id, "_OPT_NULL_");
|
||||
OwnerCard = SkillFrom.SkillPrm.ownerCard;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsPlayer = isPlayer;
|
||||
DivergenceId = divergenceId;
|
||||
OwnerCard = ownerCard;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetAttachFromCardName()
|
||||
{
|
||||
return CardMaster.GetInstanceForBattle().GetCardParameterFromId(BaseCardIDFrom).CardName;
|
||||
}
|
||||
|
||||
public void SetPreviousOwner(BattleCardBase card)
|
||||
{
|
||||
PreviousOwner = card;
|
||||
}
|
||||
|
||||
private BuffInfo(BuffInfo buff)
|
||||
{
|
||||
BaseCardIDFrom = buff.BaseCardIDFrom;
|
||||
CardIDFrom = buff.CardIDFrom;
|
||||
SkillFrom = buff.SkillFrom;
|
||||
OwnerCard = buff.OwnerCard;
|
||||
PreviousOwner = buff.PreviousOwner;
|
||||
IsCopied = buff.IsCopied;
|
||||
IsCopiedEvolutionSkill = buff.IsCopiedEvolutionSkill;
|
||||
IsPlayer = buff.IsPlayer;
|
||||
IsEvolutionSkill = buff.IsEvolutionSkill;
|
||||
IsSaveBurialRiteSkill = buff.IsSaveBurialRiteSkill;
|
||||
IsGetonSkill = buff.IsGetonSkill;
|
||||
IsHiddenClassLogSkill = buff.IsHiddenClassLogSkill;
|
||||
DivergenceId = buff.DivergenceId;
|
||||
IsReserveTokenDrawSkill = buff.IsReserveTokenDrawSkill;
|
||||
}
|
||||
|
||||
public BuffInfo Clone()
|
||||
{
|
||||
return new BuffInfo(this);
|
||||
}
|
||||
|
||||
public bool IsBuffGaveSkill(SkillBase skill)
|
||||
{
|
||||
if (SkillFrom is SkillBaseCopy skillBaseCopy && skillBaseCopy.CopiedSkillList.Any((SkillBase s) => skill.IsSameSkill(s)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return SkillFrom == skill;
|
||||
}
|
||||
|
||||
public BattleCardBase GetDisplayCard()
|
||||
{
|
||||
BattleCardBase result = OwnerCard;
|
||||
if (PreviousOwner != null)
|
||||
{
|
||||
result = PreviousOwner;
|
||||
}
|
||||
if (IsSaveBurialRiteSkill || IsGetonSkill || IsReserveTokenDrawSkill)
|
||||
{
|
||||
result = TargetCard;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
95
SVSim.BattleEngine/Engine/CantPlayCardFilterInfo.cs
Normal file
95
SVSim.BattleEngine/Engine/CantPlayCardFilterInfo.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
using Wizard.Battle;
|
||||
|
||||
public class CantPlayCardFilterInfo
|
||||
{
|
||||
private BattlePlayerPair _playerPair;
|
||||
|
||||
private SkillOptionValue _optionValue;
|
||||
|
||||
private SkillConditionCheckerOption _checkerOption;
|
||||
|
||||
private ISkillBattlePlayerFilter _playerFilter;
|
||||
|
||||
private ISkillTargetFilter _targetFilter;
|
||||
|
||||
private List<ISkillCardFilter> _cardFilterList;
|
||||
|
||||
private ValueWithOperator _cardId;
|
||||
|
||||
private bool _hasCardIdFilter;
|
||||
|
||||
public bool IsCantPlaySpell { get; private set; }
|
||||
|
||||
public bool IsCantPlayField { get; private set; }
|
||||
|
||||
public CantPlayCardFilterInfo(BattleCardBase owner, SkillBase skill)
|
||||
{
|
||||
_playerFilter = SkillFilterCreator.CreateBattlePlayerFilter(SkillFilterCreator.ContentKeyword.me);
|
||||
_targetFilter = new SkillTargetHandFilter();
|
||||
_cardFilterList = CreateCardFilterList(skill.OptionValue);
|
||||
_playerPair = new BattlePlayerPair(owner.SelfBattlePlayer, owner.OpponentBattlePlayer);
|
||||
_optionValue = skill.OptionValue;
|
||||
_checkerOption = new SkillConditionCheckerOption();
|
||||
_hasCardIdFilter = _cardFilterList.Any((ISkillCardFilter c) => c is SkillParameterBaseCardIdFilter);
|
||||
IsCantPlaySpell = _cardFilterList.Any((ISkillCardFilter c) => c is SkillSpellFilter);
|
||||
IsCantPlayField = _cardFilterList.Any((ISkillCardFilter c) => c is SkillFieldFilter);
|
||||
}
|
||||
|
||||
private List<ISkillCardFilter> CreateCardFilterList(SkillOptionValue option)
|
||||
{
|
||||
List<ISkillCardFilter> list = new List<ISkillCardFilter>();
|
||||
switch (option.GetString(SkillFilterCreator.ContentKeyword.card_type))
|
||||
{
|
||||
case "unit":
|
||||
list.Add(new SkillUnitFilter());
|
||||
break;
|
||||
case "class":
|
||||
list.Add(new SkillClassFilter());
|
||||
break;
|
||||
case "spell":
|
||||
list.Add(new SkillSpellFilter());
|
||||
break;
|
||||
case "field":
|
||||
list.Add(new SkillFieldFilter());
|
||||
break;
|
||||
case "all":
|
||||
list.Add(new SkillAllCardFilter());
|
||||
break;
|
||||
}
|
||||
ValueWithOperator valueWithOperator = option.GetValueWithOperator(SkillFilterCreator.ContentKeyword.base_card_id);
|
||||
if (valueWithOperator != null)
|
||||
{
|
||||
_cardId = new ValueWithOperator(option.ParseInt(valueWithOperator.Value).ToString(), valueWithOperator.Operator);
|
||||
list.Add(new SkillParameterBaseCardIdFilter(_cardId.Value, _cardId.Operator));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public bool CheckCantPlay(BattleCardBase targetCard)
|
||||
{
|
||||
IEnumerable<IBattlePlayerReadOnlyInfo> battlePlayerInfos = _playerFilter.Filtering(_playerPair);
|
||||
IEnumerable<IReadOnlyBattleCardInfo> enumerable = _targetFilter.Filtering(battlePlayerInfos, _checkerOption);
|
||||
for (int i = 0; i < _cardFilterList.Count; i++)
|
||||
{
|
||||
enumerable = _cardFilterList[i].Filtering(enumerable, _optionValue);
|
||||
}
|
||||
return enumerable.Any((IReadOnlyBattleCardInfo c) => c.IsPlayer == targetCard.IsPlayer && c.Index == targetCard.Index);
|
||||
}
|
||||
|
||||
public bool CheckCantPlayTransformId(BattleCardBase originalCard)
|
||||
{
|
||||
if (!_hasCardIdFilter || _cardId == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Skill_transform accelerateOrCrystallizeTransformSkill = originalCard.GetAccelerateOrCrystallizeTransformSkill();
|
||||
if (accelerateOrCrystallizeTransformSkill == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return SkillCompareFuncCreator.Create(_cardId.Operator)(_optionValue.ParseInt(_cardId.Value), accelerateOrCrystallizeTransformSkill.TransformId);
|
||||
}
|
||||
}
|
||||
317
SVSim.BattleEngine/Engine/CardBasePrm.cs
Normal file
317
SVSim.BattleEngine/Engine/CardBasePrm.cs
Normal file
@@ -0,0 +1,317 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Wizard;
|
||||
|
||||
public static class CardBasePrm
|
||||
{
|
||||
public enum CharaType
|
||||
{
|
||||
CLASS = 0,
|
||||
NORMAL = 1,
|
||||
FIELD = 2,
|
||||
CHANT_FIELD = 3,
|
||||
SPELL = 4,
|
||||
EVOLUTION = 5,
|
||||
MAX = 6,
|
||||
NONE = 6
|
||||
}
|
||||
|
||||
public enum ClanType
|
||||
{
|
||||
ALL = 0,
|
||||
MIN = 1,
|
||||
ELF = 1,
|
||||
ROYAL = 2,
|
||||
WITCH = 3,
|
||||
DRAGON = 4,
|
||||
NECRO = 5,
|
||||
VAMPIRE = 6,
|
||||
BISHOP = 7,
|
||||
NEMESIS = 8,
|
||||
MAX = 9,
|
||||
NONE = 10,
|
||||
SHADOW = 99
|
||||
}
|
||||
|
||||
public enum TribeType
|
||||
{
|
||||
ALL = 0,
|
||||
LORD = 1,
|
||||
LEGION = 2,
|
||||
WHITE_RITUAL = 3,
|
||||
MANARIA = 4,
|
||||
ARTIFACT = 5,
|
||||
LOOTING = 6,
|
||||
MACHINE = 7,
|
||||
FOOD = 8,
|
||||
LEVIN = 9,
|
||||
NATURE = 10,
|
||||
BANQUET = 11,
|
||||
HERO = 12,
|
||||
ARMED = 13,
|
||||
CHESS = 14,
|
||||
HELLBOUND = 15,
|
||||
SCHOOL = 16,
|
||||
MAX = 17,
|
||||
NONE = 17
|
||||
}
|
||||
|
||||
public enum TribeChangeType
|
||||
{
|
||||
CHANGE,
|
||||
ADD
|
||||
}
|
||||
|
||||
public class TribeInfo
|
||||
{
|
||||
public List<TribeType> TribeTypeList { get; private set; }
|
||||
|
||||
public TribeChangeType ChangeType { get; private set; }
|
||||
|
||||
public TribeInfo(List<TribeType> tribe, TribeChangeType type)
|
||||
{
|
||||
TribeTypeList = tribe;
|
||||
ChangeType = type;
|
||||
}
|
||||
}
|
||||
|
||||
public const int MAX_LIFE = 20;
|
||||
|
||||
public const int BERSERK_COUNT = 10;
|
||||
|
||||
public const int AVARICE_COUNT = 2;
|
||||
|
||||
public const int WRATH_COUNT = 7;
|
||||
|
||||
public const int AWAKE_PP = 7;
|
||||
|
||||
public const int MAX_DRAW_CARD = 8;
|
||||
|
||||
private static List<TribeType> _defaultType;
|
||||
|
||||
public static List<TribeType> DefaultType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_defaultType == null)
|
||||
{
|
||||
_defaultType = new List<TribeType> { TribeType.ALL };
|
||||
}
|
||||
return _defaultType;
|
||||
}
|
||||
}
|
||||
|
||||
public static CharaType ToStrCharaType(string str)
|
||||
{
|
||||
CharaType result = CharaType.MAX;
|
||||
try
|
||||
{
|
||||
result = (CharaType)Enum.Parse(typeof(CharaType), str);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool ToBoolIsFoil(string str)
|
||||
{
|
||||
int num = int.Parse(str);
|
||||
bool result = false;
|
||||
if (num == 1)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ClanType ToStrClanType(string str)
|
||||
{
|
||||
int value = int.Parse(str);
|
||||
ClanType result = ClanType.NONE;
|
||||
try
|
||||
{
|
||||
result = (ClanType)Enum.ToObject(typeof(ClanType), value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool ClanTypeIsUseable(ClanType type)
|
||||
{
|
||||
if (type >= ClanType.MIN)
|
||||
{
|
||||
return type < ClanType.MAX;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static TribeType ToStrTribeType(string str)
|
||||
{
|
||||
TribeType result = TribeType.MAX;
|
||||
try
|
||||
{
|
||||
result = (TribeType)Enum.Parse(typeof(TribeType), str);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ClanType GetClanType(string clan)
|
||||
{
|
||||
using (IEnumerator<string> enumerator = ((IEnumerable<string>)clan.Split('.', '=')).GetEnumerator())
|
||||
{
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
switch (enumerator.Current)
|
||||
{
|
||||
case "all":
|
||||
return ClanType.ALL;
|
||||
case "elf":
|
||||
return ClanType.MIN;
|
||||
case "royal":
|
||||
return ClanType.ROYAL;
|
||||
case "witch":
|
||||
return ClanType.WITCH;
|
||||
case "dragon":
|
||||
return ClanType.DRAGON;
|
||||
case "necro":
|
||||
return ClanType.NECRO;
|
||||
case "vampire":
|
||||
return ClanType.VAMPIRE;
|
||||
case "bishop":
|
||||
return ClanType.BISHOP;
|
||||
case "nemesis":
|
||||
return ClanType.NEMESIS;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ClanType.NONE;
|
||||
}
|
||||
|
||||
public static List<TribeType> CreateTribeTypeList(string tribe, bool isTribeCheck = false, bool notEqual = false)
|
||||
{
|
||||
string text = "";
|
||||
List<TribeType> list = new List<TribeType>();
|
||||
if (isTribeCheck)
|
||||
{
|
||||
text = (notEqual ? "tribe!=" : "tribe=");
|
||||
}
|
||||
if (tribe.Contains(text + "all"))
|
||||
{
|
||||
list.Add(TribeType.ALL);
|
||||
}
|
||||
if (tribe.Contains(text + "legion"))
|
||||
{
|
||||
list.Add(TribeType.LEGION);
|
||||
}
|
||||
if (tribe.Contains(text + "lord"))
|
||||
{
|
||||
list.Add(TribeType.LORD);
|
||||
}
|
||||
if (tribe.Contains(text + "white_ritual"))
|
||||
{
|
||||
list.Add(TribeType.WHITE_RITUAL);
|
||||
}
|
||||
if (tribe.Contains(text + "manaria"))
|
||||
{
|
||||
list.Add(TribeType.MANARIA);
|
||||
}
|
||||
if (tribe.Contains(text + "artifact"))
|
||||
{
|
||||
list.Add(TribeType.ARTIFACT);
|
||||
}
|
||||
if (tribe.Contains(text + "looting"))
|
||||
{
|
||||
list.Add(TribeType.LOOTING);
|
||||
}
|
||||
if (tribe.Contains(text + "machine"))
|
||||
{
|
||||
list.Add(TribeType.MACHINE);
|
||||
}
|
||||
if (tribe.Contains(text + "food"))
|
||||
{
|
||||
list.Add(TribeType.FOOD);
|
||||
}
|
||||
if (tribe.Contains(text + "levin"))
|
||||
{
|
||||
list.Add(TribeType.LEVIN);
|
||||
}
|
||||
if (tribe.Contains(text + "nature"))
|
||||
{
|
||||
list.Add(TribeType.NATURE);
|
||||
}
|
||||
if (tribe.Contains(text + "banquet"))
|
||||
{
|
||||
list.Add(TribeType.BANQUET);
|
||||
}
|
||||
if (tribe.Contains(text + "hero"))
|
||||
{
|
||||
list.Add(TribeType.HERO);
|
||||
}
|
||||
if (tribe.Contains(text + "armed"))
|
||||
{
|
||||
list.Add(TribeType.ARMED);
|
||||
}
|
||||
if (tribe.Contains(text + "chess"))
|
||||
{
|
||||
list.Add(TribeType.CHESS);
|
||||
}
|
||||
if (tribe.Contains(text + "hellbound"))
|
||||
{
|
||||
list.Add(TribeType.HELLBOUND);
|
||||
}
|
||||
if (tribe.Contains(text + "school"))
|
||||
{
|
||||
list.Add(TribeType.SCHOOL);
|
||||
}
|
||||
if (list.Count == 0)
|
||||
{
|
||||
list.Add(TribeType.MAX);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static bool IsFollowerCard(CharaType type)
|
||||
{
|
||||
return type == CharaType.NORMAL;
|
||||
}
|
||||
|
||||
public static bool IsSpellCard(CharaType type)
|
||||
{
|
||||
return type == CharaType.SPELL;
|
||||
}
|
||||
|
||||
public static bool IsAmuletCard(CharaType type)
|
||||
{
|
||||
if (type != CharaType.FIELD)
|
||||
{
|
||||
return type == CharaType.CHANT_FIELD;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string GetCardTypeName(CharaType type)
|
||||
{
|
||||
string result = string.Empty;
|
||||
switch (type)
|
||||
{
|
||||
case CharaType.NORMAL:
|
||||
case CharaType.EVOLUTION:
|
||||
result = Data.SystemText.Get("Card_0044");
|
||||
break;
|
||||
case CharaType.SPELL:
|
||||
result = Data.SystemText.Get("Card_0045");
|
||||
break;
|
||||
case CharaType.FIELD:
|
||||
case CharaType.CHANT_FIELD:
|
||||
result = Data.SystemText.Get("Card_0046");
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
104
SVSim.BattleEngine/Engine/CardDataModel.cs
Normal file
104
SVSim.BattleEngine/Engine/CardDataModel.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class CardDataModel
|
||||
{
|
||||
public int Index { get; set; }
|
||||
|
||||
public int CardId { get; set; }
|
||||
|
||||
public int RedrawCardPosition { get; set; }
|
||||
|
||||
public bool isOpponent { get; set; }
|
||||
|
||||
public NetworkBattleDefine.NetworkCardPlaceState fromState { get; set; }
|
||||
|
||||
public List<NetworkBattleDefine.NetworkCardPlaceState> ToStateList { get; set; }
|
||||
|
||||
public int skillCardIndex { get; set; }
|
||||
|
||||
public int publishedActiveSkillCount { get; set; }
|
||||
|
||||
public int skillMovementNum { get; set; }
|
||||
|
||||
public bool IsAttachSkill { get; set; }
|
||||
|
||||
public int skillAttachCardIndex { get; set; }
|
||||
|
||||
public int skillAttachSkillIndex { get; set; }
|
||||
|
||||
public List<int> skillKeyCardIdxList { get; set; }
|
||||
|
||||
public List<int> SkillKeyCardIdList { get; set; }
|
||||
|
||||
public int playCardCost { get; set; }
|
||||
|
||||
public int? AddLife { get; set; }
|
||||
|
||||
public int? SetLife { get; set; }
|
||||
|
||||
public int? AddAtk { get; set; }
|
||||
|
||||
public int? SetAtk { get; set; }
|
||||
|
||||
public int Clan { get; set; }
|
||||
|
||||
public string Tribe { get; set; }
|
||||
|
||||
public bool IsOpen { get; set; }
|
||||
|
||||
public int Spellboost { get; set; } = -1;
|
||||
|
||||
public int? AddChantCount { get; set; }
|
||||
|
||||
public int? SetChantCount { get; set; }
|
||||
|
||||
public int UnionBurstCount { get; set; }
|
||||
|
||||
public int SkyboundArtCount { get; set; }
|
||||
|
||||
public int SkillIndex { get; set; }
|
||||
|
||||
public string AttachTarget { get; private set; }
|
||||
|
||||
public int RandomTargetIndex { get; set; } = -1;
|
||||
|
||||
public List<int> FusionIngredientList { get; set; }
|
||||
|
||||
public bool IsInvoked { get; set; }
|
||||
|
||||
public bool IsGotUnapproved { get; set; }
|
||||
|
||||
public int SkillCallCount { get; set; }
|
||||
|
||||
public int SkillValueCount { get; set; }
|
||||
|
||||
public int? SkillValueParameter { get; set; }
|
||||
|
||||
public int activate { get; set; }
|
||||
|
||||
public bool IsHighlander { get; set; }
|
||||
|
||||
public CardDataModel()
|
||||
{
|
||||
Clan = -1;
|
||||
Tribe = "NONE";
|
||||
playCardCost = -1;
|
||||
publishedActiveSkillCount = -1;
|
||||
SkillCallCount = -1;
|
||||
SkillValueCount = -1;
|
||||
SkillValueParameter = null;
|
||||
activate = -1;
|
||||
SkillIndex = -1;
|
||||
IsHighlander = false;
|
||||
ToStateList = new List<NetworkBattleDefine.NetworkCardPlaceState>();
|
||||
skillKeyCardIdxList = new List<int>();
|
||||
SkillKeyCardIdList = new List<int>();
|
||||
UnionBurstCount = -1;
|
||||
SkyboundArtCount = -1;
|
||||
}
|
||||
|
||||
public void SetAttachTarget(string attach)
|
||||
{
|
||||
AttachTarget = attach;
|
||||
}
|
||||
}
|
||||
188
SVSim.BattleEngine/Engine/CardDetailBase.cs
Normal file
188
SVSim.BattleEngine/Engine/CardDetailBase.cs
Normal file
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.View;
|
||||
|
||||
public class CardDetailBase : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public class BgSizeInfo
|
||||
{
|
||||
public int Line;
|
||||
|
||||
public int BgSize;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class DetailPanelInfo
|
||||
{
|
||||
public GameObject _root;
|
||||
|
||||
public UILabel _nameLabel;
|
||||
|
||||
public UITexture _logImage;
|
||||
|
||||
public UIScrollView _scrollView;
|
||||
|
||||
public UISprite _bg;
|
||||
|
||||
public int _maxLine;
|
||||
|
||||
public UIPanel DiscPanelObject;
|
||||
|
||||
public UILabel DiscLabel;
|
||||
|
||||
public BoxCollider DiscCollider;
|
||||
|
||||
public UIScrollBar DiscScrollBar;
|
||||
|
||||
public int DefaultBgHeight;
|
||||
|
||||
public UILabel _costLabel;
|
||||
|
||||
public UILabel _signLabel;
|
||||
|
||||
public UILabel _zeroCostLabel;
|
||||
|
||||
public UILabel _signedCostLabel;
|
||||
|
||||
public UISprite _costSprite;
|
||||
|
||||
public UILabel _classLabel;
|
||||
|
||||
public UISprite _classBG;
|
||||
|
||||
public GameObject _myRotationInfo;
|
||||
|
||||
public UILabel _myRotationClassLabel;
|
||||
|
||||
public GameObject _myRotationBonusIconOriginal;
|
||||
|
||||
public UIGrid _myRotationBonusIconGrid;
|
||||
|
||||
public FlexibleGrid _myRotationInfoGrid;
|
||||
|
||||
public UIRect RootAnchor;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private const int EVO_OR_FUSION_BUTTON_OFFSET = 65;
|
||||
|
||||
private const int CLASS_LABEL_HEIGHT = 89;
|
||||
|
||||
private const int PANEL_BOTTOM__ANCHOR = 4;
|
||||
|
||||
private const int PANEL_BOTTOM__ANCHOR_SCROLL = 16;
|
||||
|
||||
[SerializeField]
|
||||
protected DetailPanelInfo _followerPanel;
|
||||
|
||||
[SerializeField]
|
||||
protected DetailPanelInfo _followerEvoPanel;
|
||||
|
||||
[SerializeField]
|
||||
protected DetailPanelInfo _nonFollowerPanel;
|
||||
|
||||
protected void SetFollowerDetailLabel(string skillDisc, string evoSkillDisc, bool needEvolutionOrFusionButton, bool resetScrollPosition = true)
|
||||
{
|
||||
_nonFollowerPanel._root.SetActive(value: false);
|
||||
_followerPanel._root.SetActive(value: true);
|
||||
_followerEvoPanel._root.SetActive(value: true);
|
||||
int num = CheckTextLineCount(_followerPanel.DiscLabel, skillDisc);
|
||||
int num2 = CheckTextLineCount(_followerEvoPanel.DiscLabel, evoSkillDisc);
|
||||
if (num >= _followerPanel._maxLine && num2 < _followerEvoPanel._maxLine)
|
||||
{
|
||||
num = Mathf.Min(9 - num2, num);
|
||||
}
|
||||
else if (num < _followerPanel._maxLine && num2 >= _followerEvoPanel._maxLine)
|
||||
{
|
||||
num2 = Mathf.Min(9 - num, num2);
|
||||
}
|
||||
else if (num >= _followerPanel._maxLine && num2 >= _followerEvoPanel._maxLine)
|
||||
{
|
||||
num = _followerPanel._maxLine;
|
||||
num2 = _followerEvoPanel._maxLine;
|
||||
}
|
||||
SetDescLabelText(_followerPanel, skillDisc, num, needEvolutionOrFusionButton: false, resetScrollPosition);
|
||||
SetDescLabelText(_followerEvoPanel, evoSkillDisc, num2, needEvolutionOrFusionButton, resetScrollPosition);
|
||||
_followerEvoPanel.RootAnchor.UpdateAnchors();
|
||||
}
|
||||
|
||||
protected void SetDescLabelText(DetailPanelInfo panel, string discText, bool needEvolutionOrFusionButton = false, bool resetScrollPosition = true, bool isClass = false)
|
||||
{
|
||||
SetDescLabelText(panel, discText, panel._maxLine, needEvolutionOrFusionButton, resetScrollPosition, isClass);
|
||||
}
|
||||
|
||||
protected void SetDescLabelText(DetailPanelInfo panel, string discText, int maxLine, bool needEvolutionOrFusionButton = false, bool resetScrollPosition = true, bool isClass = false)
|
||||
{
|
||||
UILabel discLabel = panel.DiscLabel;
|
||||
UIScrollView scrollView = panel._scrollView;
|
||||
UISprite bg = panel._bg;
|
||||
discLabel.text = Global.GetConvertWrapText(discLabel, discText);
|
||||
discLabel.ProcessText();
|
||||
int textLineCount = Global.GetTextLineCount(discLabel.processedText);
|
||||
bool flag = textLineCount > maxLine;
|
||||
if (bg != null)
|
||||
{
|
||||
bg.height = panel.DefaultBgHeight + Mathf.Min(textLineCount, maxLine) * (panel.DiscLabel.fontSize + panel.DiscLabel.spacingY);
|
||||
if (needEvolutionOrFusionButton)
|
||||
{
|
||||
bg.height += 65;
|
||||
}
|
||||
if (isClass)
|
||||
{
|
||||
bg.height = 89;
|
||||
}
|
||||
bg.gameObject.SetActive(value: false);
|
||||
bg.gameObject.SetActive(value: true);
|
||||
bg.ResetAndUpdateAnchors();
|
||||
}
|
||||
panel.DiscPanelObject.bottomAnchor.absolute = (flag ? 16 : 4) + (needEvolutionOrFusionButton ? 65 : 0);
|
||||
panel.DiscPanelObject.gameObject.SetActive(value: false);
|
||||
panel.DiscPanelObject.gameObject.SetActive(value: true);
|
||||
panel.DiscPanelObject.UpdateAnchors();
|
||||
scrollView.enabled = flag;
|
||||
panel.DiscScrollBar.gameObject.SetActive(flag);
|
||||
if (resetScrollPosition)
|
||||
{
|
||||
scrollView.ResetPosition();
|
||||
}
|
||||
scrollView.UpdateScrollbars();
|
||||
}
|
||||
|
||||
private int CheckTextLineCount(UILabel label, string discText)
|
||||
{
|
||||
label.text = Global.GetConvertWrapText(label, discText);
|
||||
label.ProcessText();
|
||||
return Global.GetTextLineCount(label.processedText);
|
||||
}
|
||||
|
||||
protected void SetDetailKeywordEvents(Action<BattleCardBase, GameObject, CardParameter> onClick, BattleCardBase card, CardParameter baseParameter, DetailPanelControl control)
|
||||
{
|
||||
SetDetailKeywordEvent(_followerPanel, onClick, card, baseParameter, control);
|
||||
SetDetailKeywordEvent(_followerEvoPanel, onClick, card, baseParameter, control);
|
||||
SetDetailKeywordEvent(_nonFollowerPanel, onClick, card, baseParameter, control);
|
||||
}
|
||||
|
||||
private void SetDetailKeywordEvent(DetailPanelInfo panelInfo, Action<BattleCardBase, GameObject, CardParameter> onClick, BattleCardBase card, CardParameter baseParameter, DetailPanelControl control)
|
||||
{
|
||||
UILabel label = panelInfo.DiscLabel;
|
||||
BoxCollider discCollider = panelInfo.DiscCollider;
|
||||
if (label.text != " ")
|
||||
{
|
||||
UIEventListener.Get(discCollider.gameObject).onClick = delegate
|
||||
{
|
||||
onClick.Call(card, label.gameObject, baseParameter);
|
||||
};
|
||||
BattlePlayerView.SetKeyWordColor(discCollider.gameObject, label, control);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIEventListener.Get(discCollider.gameObject).onClick = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
SVSim.BattleEngine/Engine/CardDetailFilterCategory.cs
Normal file
39
SVSim.BattleEngine/Engine/CardDetailFilterCategory.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CardDetailFilterCategory : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _categoryName;
|
||||
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
public List<CardDetailFilterKeyWord> AllKeyWord { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
AllKeyWord = new List<CardDetailFilterKeyWord>();
|
||||
}
|
||||
|
||||
public void Initialize(string name)
|
||||
{
|
||||
_categoryName.text = name;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
foreach (CardDetailFilterKeyWord item in AllKeyWord)
|
||||
{
|
||||
item.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddChild(CardDetailFilterKeyWord keyword)
|
||||
{
|
||||
keyword.transform.parent = _grid.transform;
|
||||
keyword.transform.localScale = Vector3.one;
|
||||
_grid.Reposition();
|
||||
AllKeyWord.Add(keyword);
|
||||
}
|
||||
}
|
||||
193
SVSim.BattleEngine/Engine/CardDetailFilterDialog.cs
Normal file
193
SVSim.BattleEngine/Engine/CardDetailFilterDialog.cs
Normal file
@@ -0,0 +1,193 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class CardDetailFilterDialog : MonoBehaviour
|
||||
{
|
||||
private const int DIALOG_PANEL_DEPTH = 15;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailFilterCategory _categoryOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private CardDetailFilterKeyWord _keywordOriginal;
|
||||
|
||||
[SerializeField]
|
||||
private FlexibleGrid _grid;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _resetButton;
|
||||
|
||||
private List<CardDetailFilterCategory> _allCategory = new List<CardDetailFilterCategory>();
|
||||
|
||||
private List<string> _saveList;
|
||||
|
||||
private bool _initializeFinish;
|
||||
|
||||
private bool _isChanged;
|
||||
|
||||
private Dictionary<string, bool> _existKeyWordDictionary;
|
||||
|
||||
public Action OnChange { get; set; }
|
||||
|
||||
public DialogBase Dialog { get; private set; }
|
||||
|
||||
public static CardDetailFilterDialog Create(GameObject prefab, List<string> saveList, Dictionary<string, bool> existKeyWordDictionary)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0227"));
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialogBase.SetPanelDepth(15);
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(prefab);
|
||||
dialogBase.SetObj(gameObject);
|
||||
CardDetailFilterDialog component = gameObject.GetComponent<CardDetailFilterDialog>();
|
||||
component.Dialog = dialogBase;
|
||||
component._saveList = saveList;
|
||||
component._existKeyWordDictionary = existKeyWordDictionary;
|
||||
return component;
|
||||
}
|
||||
|
||||
private bool IsCheckedInSaveList(string keyword)
|
||||
{
|
||||
if (_saveList != null)
|
||||
{
|
||||
return _saveList.Contains(keyword);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_categoryOriginal.gameObject.SetActive(value: false);
|
||||
_keywordOriginal.gameObject.SetActive(value: false);
|
||||
foreach (string category in Data.Master.CardFilterKeyWord.CategoryList)
|
||||
{
|
||||
AddCategory(Data.SystemText.Get(category), Data.Master.CardFilterKeyWord.GetCategory(category));
|
||||
}
|
||||
_grid.Reposition();
|
||||
UIEventListener.Get(_resetButton.gameObject).onClick = delegate
|
||||
{
|
||||
OnClickResetButton();
|
||||
};
|
||||
_initializeFinish = true;
|
||||
}
|
||||
|
||||
private void AddCategory(string categoryName, List<string> keyList)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (string key2 in keyList)
|
||||
{
|
||||
string key = Data.Master.BattleKeyWordTitleDic[key2];
|
||||
if (_existKeyWordDictionary == null || _existKeyWordDictionary.ContainsKey(key))
|
||||
{
|
||||
list.Add(key2);
|
||||
}
|
||||
}
|
||||
if (list.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CardDetailFilterCategory component = NGUITools.AddChild(_grid.gameObject, _categoryOriginal.gameObject).GetComponent<CardDetailFilterCategory>();
|
||||
_allCategory.Add(component);
|
||||
component.name = "category_" + categoryName;
|
||||
component.gameObject.SetActive(value: true);
|
||||
component.Initialize(categoryName);
|
||||
foreach (string item in list)
|
||||
{
|
||||
string keyword = Data.Master.BattleKeyWordTitleDic[item];
|
||||
CardDetailFilterKeyWord component2 = UnityEngine.Object.Instantiate(_keywordOriginal.gameObject).GetComponent<CardDetailFilterKeyWord>();
|
||||
component2.gameObject.SetActive(value: true);
|
||||
component2.Initialize(keyword);
|
||||
component2.OnValueChange = delegate
|
||||
{
|
||||
if (_initializeFinish)
|
||||
{
|
||||
_isChanged = true;
|
||||
}
|
||||
};
|
||||
component.AddChild(component2);
|
||||
if (IsCheckedInSaveList(keyword))
|
||||
{
|
||||
component2.SetChecked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_isChanged)
|
||||
{
|
||||
_isChanged = false;
|
||||
List<string> filterList = GetFilterList();
|
||||
if (!IsSameList(_saveList, filterList))
|
||||
{
|
||||
_saveList = filterList;
|
||||
OnChange.Call();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int GetListCount(List<string> list)
|
||||
{
|
||||
return list?.Count ?? 0;
|
||||
}
|
||||
|
||||
private bool IsSameList(List<string> list1, List<string> list2)
|
||||
{
|
||||
if (GetListCount(list1) == 0 && GetListCount(list2) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (GetListCount(list1) != GetListCount(list2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
foreach (string item in list1)
|
||||
{
|
||||
if (!list2.Contains(item))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
foreach (string item2 in list2)
|
||||
{
|
||||
if (!list1.Contains(item2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnClickResetButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
foreach (CardDetailFilterCategory item in _allCategory)
|
||||
{
|
||||
item.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetFilterList()
|
||||
{
|
||||
List<string> list = null;
|
||||
foreach (CardDetailFilterCategory item in _allCategory)
|
||||
{
|
||||
foreach (CardDetailFilterKeyWord item2 in item.AllKeyWord)
|
||||
{
|
||||
if (item2.IsEnableKeyWord)
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
list = new List<string>();
|
||||
}
|
||||
list.Add(item2.KeyWord);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
51
SVSim.BattleEngine/Engine/CardDetailFilterKeyWord.cs
Normal file
51
SVSim.BattleEngine/Engine/CardDetailFilterKeyWord.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
public class CardDetailFilterKeyWord : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIToggle _toggle;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _label;
|
||||
|
||||
private bool _checkedCache;
|
||||
|
||||
public bool IsEnableKeyWord => _toggle.value;
|
||||
|
||||
public string KeyWord { get; private set; }
|
||||
|
||||
public Action OnValueChange { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_checkedCache = false;
|
||||
_toggle.value = false;
|
||||
}
|
||||
|
||||
public void SetChecked()
|
||||
{
|
||||
_checkedCache = true;
|
||||
_toggle.value = true;
|
||||
}
|
||||
|
||||
public void Initialize(string keyword)
|
||||
{
|
||||
EventDelegate.Add(_toggle.onChange, delegate
|
||||
{
|
||||
if (_toggle.value != _checkedCache)
|
||||
{
|
||||
_checkedCache = _toggle.value;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
}
|
||||
OnValueChange.Call();
|
||||
});
|
||||
_label.text = keyword;
|
||||
KeyWord = keyword;
|
||||
}
|
||||
}
|
||||
36
SVSim.BattleEngine/Engine/CardDetailFilterOffButton.cs
Normal file
36
SVSim.BattleEngine/Engine/CardDetailFilterOffButton.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
public class CardDetailFilterOffButton : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _label;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _button;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _backGround;
|
||||
|
||||
private string _keyword;
|
||||
|
||||
public Action<string> OnClick { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
EventDelegate.Add(_button.onClick, delegate
|
||||
{
|
||||
OnClick.Call(_keyword);
|
||||
});
|
||||
}
|
||||
|
||||
public void Initialize(string text)
|
||||
{
|
||||
_keyword = text;
|
||||
_label.text = text;
|
||||
_label.InitializeFont();
|
||||
_label.ProcessText();
|
||||
_backGround.ResetAndUpdateAnchors();
|
||||
}
|
||||
}
|
||||
2620
SVSim.BattleEngine/Engine/CardDetailUI.cs
Normal file
2620
SVSim.BattleEngine/Engine/CardDetailUI.cs
Normal file
File diff suppressed because it is too large
Load Diff
30
SVSim.BattleEngine/Engine/CardFilterKeyWordMaster.cs
Normal file
30
SVSim.BattleEngine/Engine/CardFilterKeyWordMaster.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class CardFilterKeyWordMaster
|
||||
{
|
||||
private Dictionary<string, List<string>> _allData = new Dictionary<string, List<string>>();
|
||||
|
||||
public List<string> CategoryList { get; private set; }
|
||||
|
||||
public CardFilterKeyWordMaster()
|
||||
{
|
||||
CategoryList = new List<string>();
|
||||
}
|
||||
|
||||
public void Add(string[] line)
|
||||
{
|
||||
string item = line[0];
|
||||
string text = line[1];
|
||||
if (!CategoryList.Contains(text))
|
||||
{
|
||||
CategoryList.Add(text);
|
||||
_allData[text] = new List<string>();
|
||||
}
|
||||
_allData[text].Add(item);
|
||||
}
|
||||
|
||||
public List<string> GetCategory(string category)
|
||||
{
|
||||
return _allData[category];
|
||||
}
|
||||
}
|
||||
68
SVSim.BattleEngine/Engine/CardKeyWordCache.cs
Normal file
68
SVSim.BattleEngine/Engine/CardKeyWordCache.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Wizard;
|
||||
|
||||
public class CardKeyWordCache
|
||||
{
|
||||
public enum Option
|
||||
{
|
||||
None,
|
||||
OnlyCardNames,
|
||||
OnlyCardNamesHiranaga
|
||||
}
|
||||
|
||||
private Dictionary<int, IList<string>> _cache = new Dictionary<int, IList<string>>();
|
||||
|
||||
private Option _option;
|
||||
|
||||
public CardKeyWordCache(Option option = Option.None)
|
||||
{
|
||||
_option = option;
|
||||
}
|
||||
|
||||
public IList<string> Get(CardParameter param, CardKeyWordCommonCache commonCache)
|
||||
{
|
||||
if (_cache.TryGetValue(param.CardId, out var value))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
IList<string> cloneList = commonCache.GetCloneList(param);
|
||||
if (_option == Option.OnlyCardNames)
|
||||
{
|
||||
foreach (string item in new List<string>(cloneList))
|
||||
{
|
||||
if (Data.Master.BattleKeyWordDic.ContainsKey(item) && commonCache.GetCardListFromKeyWord(item).Count == 0)
|
||||
{
|
||||
cloneList.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_option == Option.OnlyCardNamesHiranaga)
|
||||
{
|
||||
foreach (string item2 in new List<string>(cloneList))
|
||||
{
|
||||
if (!Data.Master.BattleKeyWordDic.ContainsKey(item2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (commonCache.GetCardListFromKeyWord(item2).Count == 0)
|
||||
{
|
||||
cloneList.Remove(item2);
|
||||
continue;
|
||||
}
|
||||
cloneList.Remove(item2);
|
||||
foreach (int item3 in commonCache.GetCardListFromKeyWord(item2))
|
||||
{
|
||||
CardParameter cardParameterFromId = CardMaster.GetInstance(CardMaster.CardMasterId.Default).GetCardParameterFromId(item3);
|
||||
if (Regex.Replace(cardParameterFromId.CardName, "(\\[[a-zA-Z0-9\\/\\-]*(rub\\<[^\\>]*\\>)*\\])", "") == item2)
|
||||
{
|
||||
cloneList.Add(cardParameterFromId.CardHiragana);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_cache[param.CardId] = cloneList;
|
||||
return cloneList;
|
||||
}
|
||||
}
|
||||
22
SVSim.BattleEngine/Engine/CardPack.cs
Normal file
22
SVSim.BattleEngine/Engine/CardPack.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
public class CardPack : HeaderData
|
||||
{
|
||||
public int card_id;
|
||||
|
||||
public int base_card_id;
|
||||
|
||||
public int rarity;
|
||||
|
||||
public string create_time;
|
||||
|
||||
public string update_time;
|
||||
|
||||
public string delete_time;
|
||||
|
||||
public string affected_rows;
|
||||
|
||||
public int SleeveId { get; set; } = 3000011;
|
||||
|
||||
public bool IsSpecialCard { get; set; }
|
||||
|
||||
public bool IsFreePackLeaderSkin { get; set; }
|
||||
}
|
||||
1179
SVSim.BattleEngine/Engine/CardPackManager.cs
Normal file
1179
SVSim.BattleEngine/Engine/CardPackManager.cs
Normal file
File diff suppressed because it is too large
Load Diff
319
SVSim.BattleEngine/Engine/CardTemplate.cs
Normal file
319
SVSim.BattleEngine/Engine/CardTemplate.cs
Normal file
@@ -0,0 +1,319 @@
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Resource;
|
||||
|
||||
public class CardTemplate : MonoBehaviour
|
||||
{
|
||||
public GameObject CardWrapObjTemp;
|
||||
|
||||
public Transform CardNormalTemp;
|
||||
|
||||
public LODGroup CardNormalLodGroup;
|
||||
|
||||
public MeshRenderer FieldNormalMeshTemp;
|
||||
|
||||
public MeshRenderer FieldEvolMeshTemp;
|
||||
|
||||
public MeshRenderer NormalCardBaseMeshTemp;
|
||||
|
||||
public MeshRenderer EvolCardBaseMeshTemp;
|
||||
|
||||
public UISprite SkillIconTemp;
|
||||
|
||||
public UILabel SkillIconLabelTemp;
|
||||
|
||||
public UILabel LifeLabelTemp;
|
||||
|
||||
public UILabel AtkLabelTemp;
|
||||
|
||||
public UILabel NormalCostLabelTemp;
|
||||
|
||||
public UILabel NormalZeroCostLabelTemp;
|
||||
|
||||
public UILabel NormalSignLabelTemp;
|
||||
|
||||
public UILabel NormalSignedCostLabelTemp;
|
||||
|
||||
public UILabel NormalLifeLabelTemp;
|
||||
|
||||
public UILabel NormalAtkLabelTemp;
|
||||
|
||||
public UILabel NormalNameLabelTemp;
|
||||
|
||||
public UILabel NormalChoiceBraveNameLabelTemp;
|
||||
|
||||
public GameObject FrameEffectNormal;
|
||||
|
||||
public GameObject FrameEffectEvolve;
|
||||
|
||||
public GameObject FrameEffectHandCard;
|
||||
|
||||
public ParticleSystemRenderer[] FrameEffectHandRenderer;
|
||||
|
||||
public GameObject _spellBoostFrameEffect;
|
||||
|
||||
public BoxCollider Collider;
|
||||
|
||||
public BoxCollider NotCancelCollider;
|
||||
|
||||
private bool isPlayer = true;
|
||||
|
||||
private bool _isChoiceBrave;
|
||||
|
||||
public void DynamicSetupMaterials(BattleCardBase card, IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
isPlayer = card.IsPlayer;
|
||||
if (card.IsUnit)
|
||||
{
|
||||
DynamicSetupNormalObjMaterials(card.BaseParameter, resourceMgr);
|
||||
}
|
||||
else if (card.IsSpell)
|
||||
{
|
||||
DynamicSetupSpellObjMaterials(card.BaseParameter, resourceMgr);
|
||||
}
|
||||
else if (card.IsField)
|
||||
{
|
||||
DynamicSetupFieldObjMaterials(card.BaseParameter, resourceMgr);
|
||||
}
|
||||
}
|
||||
|
||||
public void DynamicSetupNormalObjMaterials(CardParameter cardParameter, IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
Material CTexNormal = null;
|
||||
try
|
||||
{
|
||||
CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardParameter.NormalCardId);
|
||||
string materialPath = Toolbox.ResourcesManager.GetAssetTypePath(cardParameterFromId.ResourceCardId.ToString(), ResourcesManager.AssetLoadPathType.UnitCardMaterial);
|
||||
Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(materialPath, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(materialPath);
|
||||
if (!(CardWrapObjTemp == null))
|
||||
{
|
||||
CTexNormal = Toolbox.ResourcesManager.FindCardMaterial(cardParameter.ResourceCardId, ResourcesManager.AssetLoadPathType.UnitCardMaterial);
|
||||
CardShaderDefine.ReplaceShader(CTexNormal);
|
||||
UnitCardCreator.SetupUnitCardMaterialToCardMesh(CardWrapObjTemp.transform, cardParameter, CTexNormal);
|
||||
}
|
||||
});
|
||||
NormalCardBaseMeshTemp.sharedMaterial = resourceMgr.GetSleeveMaterial(isPlayer);
|
||||
EvolCardBaseMeshTemp.sharedMaterial = resourceMgr.GetSleeveMaterial(isPlayer);
|
||||
AtkLabelTemp.text = cardParameter.Atk.ToString();
|
||||
NormalAtkLabelTemp.text = cardParameter.Atk.ToString();
|
||||
LifeLabelTemp.text = cardParameter.Life.ToString();
|
||||
NormalLifeLabelTemp.text = cardParameter.Life.ToString();
|
||||
NormalCostLabelTemp.text = cardParameter.Cost.ToString();
|
||||
NormalNameLabelTemp.text = cardParameter.CardName;
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(NormalCostLabelTemp, cardParameter.IsFoil);
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(NormalNameLabelTemp, cardParameter.IsFoil);
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(NormalAtkLabelTemp, cardParameter.IsFoil);
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(NormalLifeLabelTemp, cardParameter.IsFoil);
|
||||
Global.SetRepositionNameLabel(NormalNameLabelTemp, cardParameter.CardName, is2D: false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
CTexNormal = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void DynamicSetupSpellObjMaterials(CardParameter cardParameter, IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
CardMaster cardMaster = CardMaster.GetInstanceForBattle();
|
||||
Material[] MaterialArrayNormal = new Material[3];
|
||||
Material CTexNormal = null;
|
||||
try
|
||||
{
|
||||
string materialPath = Toolbox.ResourcesManager.GetAssetTypePath(cardMaster.GetCardParameterFromId(cardParameter.NormalCardId).ResourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial);
|
||||
Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(materialPath, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(materialPath);
|
||||
if (!(CardWrapObjTemp == null))
|
||||
{
|
||||
bool flag2 = CardMaster.IsChoiceBraveCardCheck(cardParameter.BaseCardId);
|
||||
CTexNormal = Toolbox.ResourcesManager.FindCardMaterial(cardParameter.ResourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(cardParameter.BaseCardId), cardMaster.GetCardParameterFromId((cardParameter.ResourceCardId / 1000000000 == 1) ? (cardParameter.ResourceCardId / 10) : cardParameter.ResourceCardId).CharType, flag2);
|
||||
CardShaderDefine.ReplaceShader(CTexNormal);
|
||||
UIManager.GetInstance().SetLayerRecursive(CardNormalTemp, 10);
|
||||
if (flag2)
|
||||
{
|
||||
BattleManagerBase.GetIns().BattleResourceMgr.LoadChoiceBraveCardMesh();
|
||||
MeshFilter[] componentsInChildren = CardNormalTemp.GetComponentsInChildren<MeshFilter>();
|
||||
componentsInChildren[0].sharedMesh = resourceMgr.GetChoiceBraveCardMesh(isLow: false);
|
||||
componentsInChildren[1].sharedMesh = resourceMgr.GetChoiceBraveCardMesh(isLow: true);
|
||||
}
|
||||
Material rerityMaterial = resourceMgr.GetRerityMaterial(isHand: true, isSpell: true, cardParameter.Rarity, flag2);
|
||||
if (rerityMaterial != null)
|
||||
{
|
||||
rerityMaterial.shader = Shader.Find(rerityMaterial.shader.name);
|
||||
}
|
||||
MaterialArrayNormal[0] = rerityMaterial;
|
||||
MaterialArrayNormal[1] = CTexNormal;
|
||||
MaterialArrayNormal[2] = CardCreatorBase.GetSharedClassIconMaterial(cardParameter.Clan);
|
||||
LOD[] lODs = CardNormalLodGroup.GetLODs();
|
||||
for (int i = 0; i < lODs.Length; i++)
|
||||
{
|
||||
lODs[i].renderers[0].sharedMaterials = MaterialArrayNormal;
|
||||
}
|
||||
}
|
||||
});
|
||||
NormalCardBaseMeshTemp.sharedMaterial = resourceMgr.GetSleeveMaterial(isPlayer);
|
||||
if (CardMaster.IsChoiceBraveCardCheck(cardParameter.NormalCardId))
|
||||
{
|
||||
SetEffectColor(Global.CARD_HBP_LABEL_COST_COLOR);
|
||||
}
|
||||
bool flag = cardParameter.NormalCardId / 1000000 == 930;
|
||||
if (cardParameter.IsVariableCost)
|
||||
{
|
||||
NormalSignLabelTemp.text = "-";
|
||||
NormalSignedCostLabelTemp.text = "X";
|
||||
ShowSignedCostLabel();
|
||||
NormalChoiceBraveNameLabelTemp.text = cardParameter.CardName;
|
||||
ShowChoiceBraveNameLabel();
|
||||
}
|
||||
else if (flag)
|
||||
{
|
||||
if (cardParameter.Cost != 0)
|
||||
{
|
||||
NormalSignLabelTemp.text = ((cardParameter.Cost > 0) ? "-" : "+");
|
||||
NormalSignedCostLabelTemp.text = Mathf.Abs(cardParameter.Cost).ToString();
|
||||
ShowSignedCostLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalZeroCostLabelTemp.text = "0";
|
||||
ShowZeroCostLabel();
|
||||
}
|
||||
NormalChoiceBraveNameLabelTemp.text = cardParameter.CardName;
|
||||
ShowChoiceBraveNameLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalCostLabelTemp.text = cardParameter.Cost.ToString();
|
||||
NormalNameLabelTemp.text = cardParameter.CardName;
|
||||
}
|
||||
SetNumberLabelStyle(cardParameter.IsFoil);
|
||||
SetNameLabelStyle(cardParameter.IsFoil, flag);
|
||||
SetRepositionNameLabel(cardParameter.CardName, flag);
|
||||
}
|
||||
catch
|
||||
{
|
||||
CTexNormal = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void DynamicSetupFieldObjMaterials(CardParameter cardParameter, IBattleResourceMgr resourceMgr)
|
||||
{
|
||||
CardMaster cardMaster = CardMaster.GetInstanceForBattle();
|
||||
Material CTexNormal = null;
|
||||
try
|
||||
{
|
||||
string materialPath = Toolbox.ResourcesManager.GetAssetTypePath(CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardParameter.NormalCardId).ResourceCardId.ToString(), ResourcesManager.AssetLoadPathType.SpellCardMaterial);
|
||||
Toolbox.ResourcesManager.StartCoroutine_LoadAssetGroupAsync(materialPath, delegate
|
||||
{
|
||||
Toolbox.ResourcesManager.BattleListAssetPathList.Add(materialPath);
|
||||
if (!(CardWrapObjTemp == null))
|
||||
{
|
||||
CTexNormal = Toolbox.ResourcesManager.FindCardMaterial(cardParameter.ResourceCardId, ResourcesManager.AssetLoadPathType.SpellCardMaterial, isEvol: false, CardMaster.IsMutationCardCheck(cardParameter.BaseCardId), cardMaster.GetCardParameterFromId(cardParameter.ResourceCardId).CharType);
|
||||
CardShaderDefine.ReplaceShader(CTexNormal);
|
||||
FieldCardCreator.SetupFieldCardMaterialToCardMesh(CardWrapObjTemp.transform, cardParameter, CTexNormal);
|
||||
}
|
||||
});
|
||||
NormalCardBaseMeshTemp.sharedMaterial = resourceMgr.GetSleeveMaterial(isPlayer);
|
||||
NormalCostLabelTemp.text = cardParameter.Cost.ToString();
|
||||
NormalNameLabelTemp.text = cardParameter.CardName;
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNumberLabelStyle(NormalCostLabelTemp, cardParameter.IsFoil);
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(NormalNameLabelTemp, cardParameter.IsFoil);
|
||||
Global.SetRepositionNameLabel(NormalNameLabelTemp, cardParameter.CardName, is2D: false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
CTexNormal = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowNameLabel()
|
||||
{
|
||||
if (_isChoiceBrave)
|
||||
{
|
||||
NormalChoiceBraveNameLabelTemp.alpha = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalNameLabelTemp.alpha = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public void HideNameLabel()
|
||||
{
|
||||
if (_isChoiceBrave)
|
||||
{
|
||||
NormalChoiceBraveNameLabelTemp.alpha = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalNameLabelTemp.alpha = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetEffectStyle(UILabel.Effect effectStyle)
|
||||
{
|
||||
NormalCostLabelTemp.effectStyle = effectStyle;
|
||||
NormalZeroCostLabelTemp.effectStyle = effectStyle;
|
||||
NormalSignLabelTemp.effectStyle = effectStyle;
|
||||
NormalSignedCostLabelTemp.effectStyle = effectStyle;
|
||||
}
|
||||
|
||||
public void SetEffectColor(Color color)
|
||||
{
|
||||
NormalCostLabelTemp.effectColor = color;
|
||||
NormalZeroCostLabelTemp.effectColor = color;
|
||||
NormalSignLabelTemp.effectColor = color;
|
||||
NormalSignedCostLabelTemp.effectColor = color;
|
||||
}
|
||||
|
||||
public void ShowZeroCostLabel()
|
||||
{
|
||||
NormalZeroCostLabelTemp.gameObject.SetActive(value: true);
|
||||
NormalCostLabelTemp.gameObject.SetActive(value: false);
|
||||
NormalSignLabelTemp.gameObject.SetActive(value: false);
|
||||
NormalSignedCostLabelTemp.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void ShowSignedCostLabel()
|
||||
{
|
||||
NormalSignLabelTemp.gameObject.SetActive(value: true);
|
||||
NormalSignedCostLabelTemp.gameObject.SetActive(value: true);
|
||||
NormalCostLabelTemp.gameObject.SetActive(value: false);
|
||||
NormalZeroCostLabelTemp.gameObject.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void SetNumberLabelStyle(bool isFoil)
|
||||
{
|
||||
UIBase_CardManager uIBase_CardManager = UIManager.GetInstance().getUIBase_CardManager();
|
||||
uIBase_CardManager.SetNumberLabelStyle(NormalCostLabelTemp, isFoil);
|
||||
uIBase_CardManager.SetNumberLabelStyle(NormalZeroCostLabelTemp, isFoil);
|
||||
uIBase_CardManager.SetNumberLabelStyle(NormalSignLabelTemp, isFoil);
|
||||
uIBase_CardManager.SetNumberLabelStyle(NormalSignedCostLabelTemp, isFoil);
|
||||
}
|
||||
|
||||
public void ShowChoiceBraveNameLabel()
|
||||
{
|
||||
NormalNameLabelTemp.gameObject.SetActive(value: false);
|
||||
NormalChoiceBraveNameLabelTemp.gameObject.SetActive(value: true);
|
||||
_isChoiceBrave = true;
|
||||
}
|
||||
|
||||
public void SetNameLabelStyle(bool isFoil, bool isChoiceBrave)
|
||||
{
|
||||
UIManager.GetInstance().getUIBase_CardManager().SetNameLabelStyle(isChoiceBrave ? NormalChoiceBraveNameLabelTemp : NormalNameLabelTemp, isFoil);
|
||||
}
|
||||
|
||||
public void SetRepositionNameLabel(string cardName, bool isChoiceBrave)
|
||||
{
|
||||
Global.SetRepositionNameLabel(isChoiceBrave ? NormalChoiceBraveNameLabelTemp : NormalNameLabelTemp, cardName, is2D: false);
|
||||
}
|
||||
|
||||
public void SetNormalLabelEnable(bool isEnable)
|
||||
{
|
||||
NormalNameLabelTemp.enabled = isEnable;
|
||||
NormalChoiceBraveNameLabelTemp.enabled = isEnable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class CausedDamageCardParameterModifier : TurnAndIntValue
|
||||
{
|
||||
public int Damage => base.Value;
|
||||
|
||||
public CausedDamageCardParameterModifier(int damage, int turn, bool isSelfTurn)
|
||||
: base(damage, turn, isSelfTurn)
|
||||
{
|
||||
}
|
||||
}
|
||||
332
SVSim.BattleEngine/Engine/ClassCharaPrm.cs
Normal file
332
SVSim.BattleEngine/Engine/ClassCharaPrm.cs
Normal file
@@ -0,0 +1,332 @@
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using LitJson;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class ClassCharaPrm
|
||||
{
|
||||
public enum MotionType
|
||||
{
|
||||
idle = 1,
|
||||
positive,
|
||||
negative,
|
||||
extra,
|
||||
damage,
|
||||
think,
|
||||
greet,
|
||||
shock,
|
||||
positive_2,
|
||||
negative_2,
|
||||
extra_2,
|
||||
extra_3,
|
||||
negative_2_a,
|
||||
damege_a,
|
||||
extra_1_a,
|
||||
extra_1_b,
|
||||
extra_1_c,
|
||||
extra_2_a,
|
||||
extra_2_b,
|
||||
extra_2_c,
|
||||
z_extra_2,
|
||||
z_damage,
|
||||
z_greet,
|
||||
z_idle,
|
||||
z_negative,
|
||||
z_negative_2,
|
||||
z_negative_2_a,
|
||||
z_positive,
|
||||
z_positive_2,
|
||||
z_shock,
|
||||
z_think
|
||||
}
|
||||
|
||||
public enum FaceType
|
||||
{
|
||||
skin_01 = 1,
|
||||
skin_02,
|
||||
skin_03,
|
||||
skin_04,
|
||||
skin_05,
|
||||
skin_06,
|
||||
skin_07,
|
||||
skin_08,
|
||||
skin_09,
|
||||
skin_10
|
||||
}
|
||||
|
||||
public enum EmotionType
|
||||
{
|
||||
NULL,
|
||||
GREET,
|
||||
THANK,
|
||||
APOLOGY,
|
||||
PRAISE,
|
||||
SURPRISE,
|
||||
CONFUSE,
|
||||
WORRY,
|
||||
PROVOCATION,
|
||||
EXTRA1,
|
||||
EXTRA2,
|
||||
EXTRA3,
|
||||
BATTLESTART_DIFF,
|
||||
BATTLESTART_SAME,
|
||||
WIN,
|
||||
LOSE,
|
||||
SURRENDER_LOSE,
|
||||
EVOLUTION_1,
|
||||
EVOLUTION_2,
|
||||
EVOLUTION_3,
|
||||
DAMAGE_S_1,
|
||||
DAMAGE_S_2,
|
||||
DAMAGE_S_3,
|
||||
DAMAGE_L_1,
|
||||
DAMAGE_L_2,
|
||||
IDLE_1,
|
||||
IDLE_2,
|
||||
IDLE_3,
|
||||
SELECT,
|
||||
STORY_LOSE,
|
||||
LEADER_SELECT,
|
||||
NEGOTIATION_1,
|
||||
NEGOTIATION_2,
|
||||
NEGOTIATION_3,
|
||||
PLAYER_TURN_START_1
|
||||
}
|
||||
|
||||
private static readonly Dictionary<CardBasePrm.ClanType, eColorCodeId> OUTLINE_COLOR = new Dictionary<CardBasePrm.ClanType, eColorCodeId>
|
||||
{
|
||||
{
|
||||
CardBasePrm.ClanType.MIN,
|
||||
eColorCodeId.CLASS_ELF_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.ROYAL,
|
||||
eColorCodeId.CLASS_ROYAL_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.WITCH,
|
||||
eColorCodeId.CLASS_WITCH_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.DRAGON,
|
||||
eColorCodeId.CLASS_DRAGON_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.NECRO,
|
||||
eColorCodeId.CLASS_NECROMANCER_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.VAMPIRE,
|
||||
eColorCodeId.CLASS_VANPIRE_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.BISHOP,
|
||||
eColorCodeId.CLASS_BISHOP_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.NEMESIS,
|
||||
eColorCodeId.CLASS_NEMESIS_OUTLINE
|
||||
},
|
||||
{
|
||||
CardBasePrm.ClanType.SHADOW,
|
||||
eColorCodeId.CLASS_SHADOW_OUTLINE
|
||||
}
|
||||
};
|
||||
|
||||
private int _defaultCharaId;
|
||||
|
||||
private int _currentCharaId;
|
||||
|
||||
private int ClassCharaLv;
|
||||
|
||||
private int ClassCharaExp;
|
||||
|
||||
private int ClassCharaBattleCount;
|
||||
|
||||
private int ClassCharaWin;
|
||||
|
||||
public ClassCharacterMasterData DefaultCharaData => GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_defaultCharaId);
|
||||
|
||||
public ClassCharacterMasterData CurrentCharaData
|
||||
{
|
||||
get
|
||||
{
|
||||
ClassCharacterMasterData classCharacterMasterData = GameMgr.GetIns().GetDataMgr().GetCharaPrmByCharaId(_currentCharaId);
|
||||
if (classCharacterMasterData == null)
|
||||
{
|
||||
classCharacterMasterData = DefaultCharaData;
|
||||
}
|
||||
return classCharacterMasterData;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsRandomLeaderSkin { get; set; }
|
||||
|
||||
public List<int> LeaderSkinIdList { get; private set; } = new List<int>();
|
||||
|
||||
public string EmoteNameGreet { get; set; }
|
||||
|
||||
public string TextIdGreet { get; set; }
|
||||
|
||||
public string VoiceIdGreet { get; set; }
|
||||
|
||||
public string EmoteNameThank { get; set; }
|
||||
|
||||
public string TextIdThank { get; set; }
|
||||
|
||||
public string VoiceIdThank { get; set; }
|
||||
|
||||
public string EmoteNameApology { get; set; }
|
||||
|
||||
public string TextIdApology { get; set; }
|
||||
|
||||
public string VoiceIdApology { get; set; }
|
||||
|
||||
public string EmoteNamePraise { get; set; }
|
||||
|
||||
public string TextIdPraise { get; set; }
|
||||
|
||||
public string VoiceIdPraise { get; set; }
|
||||
|
||||
public string EmoteNameSurprise { get; set; }
|
||||
|
||||
public string TextIdSurprise { get; set; }
|
||||
|
||||
public string VoiceIdSurprise { get; set; }
|
||||
|
||||
public string EmoteNameConfuse { get; set; }
|
||||
|
||||
public string TextIdConfuse { get; set; }
|
||||
|
||||
public string VoiceIdConfuse { get; set; }
|
||||
|
||||
public string EmoteNameWorry { get; set; }
|
||||
|
||||
public string TextIdWorry { get; set; }
|
||||
|
||||
public string VoiceIdWorry { get; set; }
|
||||
|
||||
public string EmoteNameProvocation { get; set; }
|
||||
|
||||
public string TextIdProvocation { get; set; }
|
||||
|
||||
public string VoiceIdProvocation { get; set; }
|
||||
|
||||
public void SetDefaultCharaId(int charaId)
|
||||
{
|
||||
_defaultCharaId = charaId;
|
||||
}
|
||||
|
||||
public void SetCurrentCharaId(int charaId)
|
||||
{
|
||||
_currentCharaId = charaId;
|
||||
}
|
||||
|
||||
public void SetClassCharaLv(int classlv)
|
||||
{
|
||||
ClassCharaLv = classlv;
|
||||
}
|
||||
|
||||
public void SetClassCharaExp(int classexp)
|
||||
{
|
||||
ClassCharaExp = classexp;
|
||||
}
|
||||
|
||||
public void SetClassCharaBattleCount(int classbattlecnt)
|
||||
{
|
||||
ClassCharaBattleCount = classbattlecnt;
|
||||
}
|
||||
|
||||
public void AddClassCharaBattleCount()
|
||||
{
|
||||
ClassCharaBattleCount++;
|
||||
}
|
||||
|
||||
public void SetClassCharaWin(int classwin)
|
||||
{
|
||||
ClassCharaWin = classwin;
|
||||
}
|
||||
|
||||
public void AddClassCharaWin()
|
||||
{
|
||||
ClassCharaWin++;
|
||||
}
|
||||
|
||||
public void SetLeaderRandomSkinIdList(JsonData skinIdList)
|
||||
{
|
||||
LeaderSkinIdList.Clear();
|
||||
for (int i = 0; i < skinIdList.Count; i++)
|
||||
{
|
||||
LeaderSkinIdList.Add(skinIdList[i].ToInt());
|
||||
}
|
||||
}
|
||||
|
||||
public int GetClassCharaLv()
|
||||
{
|
||||
return ClassCharaLv;
|
||||
}
|
||||
|
||||
public int GetClassCharaExp()
|
||||
{
|
||||
return ClassCharaExp;
|
||||
}
|
||||
|
||||
public int GetClassCharaBattleCount()
|
||||
{
|
||||
return ClassCharaBattleCount;
|
||||
}
|
||||
|
||||
public int GetClassCharaWin()
|
||||
{
|
||||
return ClassCharaWin;
|
||||
}
|
||||
|
||||
public static Texture GetClassIconTexture(int clan_id)
|
||||
{
|
||||
return Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath("class_card_" + clan_id.ToString("00"), ResourcesManager.AssetLoadPathType.CardFrameClassIcon, isfetch: true)) as Texture;
|
||||
}
|
||||
|
||||
public static bool IsEvolutionEmotionType(EmotionType type)
|
||||
{
|
||||
if ((uint)(type - 17) <= 2u)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetIconSpriteName(CardBasePrm.ClanType inClassId)
|
||||
{
|
||||
int num = (int)inClassId;
|
||||
return "icon_class_color_" + num.ToString("00");
|
||||
}
|
||||
|
||||
public static string GetLargeIconSpriteName(CardBasePrm.ClanType inClassId)
|
||||
{
|
||||
int num = (int)inClassId;
|
||||
return "icon_class_color_large_" + num.ToString("00");
|
||||
}
|
||||
|
||||
public static string GetNameText(CardBasePrm.ClanType inClassId)
|
||||
{
|
||||
return Data.SystemText.Get("Common_" + ((int)(104 + inClassId)).ToString("0000"));
|
||||
}
|
||||
|
||||
public static void SetClassLabelSetting(UILabel inLabel, CardBasePrm.ClanType inClassId)
|
||||
{
|
||||
inLabel.effectStyle = LabelDefine.OUTLINE_STYLE_CLASS_NAME;
|
||||
inLabel.effectDistance = LabelDefine.OUTLINE_DISTANCE_CLASS_NAME;
|
||||
inLabel.effectColor = ColorCode.Get(OUTLINE_COLOR[inClassId]);
|
||||
}
|
||||
|
||||
public void SetParamWithUserClassJson(JsonData classJson)
|
||||
{
|
||||
IsRandomLeaderSkin = classJson["is_random_leader_skin"].ToBoolean();
|
||||
SetClassCharaLv(classJson["level"].ToInt());
|
||||
SetClassCharaExp(classJson["exp"].ToInt());
|
||||
SetCurrentCharaId(classJson["leader_skin_id"].ToInt());
|
||||
SetDefaultCharaId(classJson["default_leader_skin_id"].ToInt());
|
||||
SetLeaderRandomSkinIdList(classJson["leader_skin_id_list"]);
|
||||
}
|
||||
}
|
||||
226
SVSim.BattleEngine/Engine/ClassInformationUIController.cs
Normal file
226
SVSim.BattleEngine/Engine/ClassInformationUIController.cs
Normal file
@@ -0,0 +1,226 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class ClassInformationUIController
|
||||
{
|
||||
private List<IClassInfomationUI> _classInformationUIList;
|
||||
|
||||
public ClassInformationUIController(List<IClassInfomationUI> classInformationUIList)
|
||||
{
|
||||
_classInformationUIList = classInformationUIList;
|
||||
}
|
||||
|
||||
public void SetUpEvent(BattlePlayerBase player)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].SetUpEvent(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public VfxBase LoadResources(Transform parent, bool isPlayer)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
parallelVfxPlayer.Register(_classInformationUIList[i].LoadResources(parent, isPlayer));
|
||||
}
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public void ShowInfomation(bool playEffect = true)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].ShowInfomation(playEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void NewReplayUpdateInfomation(NetworkBattleReceiver.ClassInfoUiInfo classInfo)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].NewReplayUpdateInfomation(classInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool HaveSpecificClassInformationUi(CardBasePrm.ClanType clanType)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
switch (clanType)
|
||||
{
|
||||
case CardBasePrm.ClanType.MIN:
|
||||
if (_classInformationUIList[i] is ElfInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.ROYAL:
|
||||
if (_classInformationUIList[i] is RoyalInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.WITCH:
|
||||
if (_classInformationUIList[i] is WitchInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.DRAGON:
|
||||
if (_classInformationUIList[i] is DragonInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.NECRO:
|
||||
if (_classInformationUIList[i] is NecromanceInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.VAMPIRE:
|
||||
if (_classInformationUIList[i] is VampireInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.BISHOP:
|
||||
if (_classInformationUIList[i] is BishopInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case CardBasePrm.ClanType.NEMESIS:
|
||||
if (_classInformationUIList[i] is NemesisInfomationUI)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void HideInfomation()
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].HideInfomation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HideOtherInfomation()
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].HideOtherInfomation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HideAllInfomation()
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].HideAllInfomation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Recovery()
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].Recovery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIsSelect(bool isSelect)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].SetIsSelect(isSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetInCardFocus(bool inCardFocus)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].SetInCardFocus(inCardFocus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTouchable(bool isTouchable)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
_classInformationUIList[i].SetTouchable(isTouchable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetClassInformationUiPosition(bool isPlayer)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
(_classInformationUIList[i] as ClassInfomationUIBase).SetClassInformationUiPosition(isPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateStatusPanelOnBattle(bool isPlayer)
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
(_classInformationUIList[i] as ClassInfomationUIBase).UpdateStatusPanelOnBattle(isPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateInfomation()
|
||||
{
|
||||
for (int i = 0; i < _classInformationUIList.Count; i++)
|
||||
{
|
||||
if (_classInformationUIList[i] != null)
|
||||
{
|
||||
(_classInformationUIList[i] as ClassInfomationUIBase).UpdateInfomation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs
Normal file
63
SVSim.BattleEngine/Engine/ConditionSkillFilterCollection.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
|
||||
public class ConditionSkillFilterCollection : SkillFilterCollectionBase
|
||||
{
|
||||
private const int CAP_CONDITION = 8;
|
||||
|
||||
public List<ISkillConditionChecker> ConditionCheckerFilterList { get; set; }
|
||||
|
||||
public List<SkillVariableComareFilter> VariableCompareFilter { get; set; }
|
||||
|
||||
public List<SkillAnyConditionFilter> AnyConditionFilter { get; set; }
|
||||
|
||||
public ConditionSkillFilterCollection()
|
||||
{
|
||||
ConditionCheckerFilterList = new List<ISkillConditionChecker>(8);
|
||||
VariableCompareFilter = new List<SkillVariableComareFilter>();
|
||||
AnyConditionFilter = new List<SkillAnyConditionFilter>();
|
||||
}
|
||||
|
||||
public bool Filtering(BattlePlayerReadOnlyInfoPair playerInfoPair, BattleCardBase ownerCard, SkillConditionCheckerOption checkerOption, SkillOptionValue optionValue, bool isPrePlay, SkillBase skill, bool isSkipTargetAiSelect = false)
|
||||
{
|
||||
SkillCollectionBase.SetupOptionValue(optionValue, playerInfoPair, ownerCard, skill, checkerOption, isPrePlay);
|
||||
bool flag = true;
|
||||
bool flag2 = true;
|
||||
bool flag3 = true;
|
||||
bool flag4 = true;
|
||||
if (VariableCompareFilter.Count() != 0)
|
||||
{
|
||||
bool flag5 = VariableCompareFilter.All((SkillVariableComareFilter s) => s.Filtering(optionValue));
|
||||
if (isSkipTargetAiSelect && VariableCompareFilter.FirstOrDefault().Lhs.Contains("hand_other_self") && ownerCard.SelfBattlePlayer.HandCardList.Count > 0)
|
||||
{
|
||||
flag5 = true;
|
||||
}
|
||||
bool flag6 = ConditionCheckerFilterList.Where((ISkillConditionChecker f) => f is SkillPreprocessBase).All((ISkillConditionChecker f) => f.IsRight(playerInfoPair, checkerOption));
|
||||
flag = flag5 && flag6;
|
||||
}
|
||||
Func<ISkillConditionChecker, Func<BattlePlayerReadOnlyInfoPair, SkillConditionCheckerOption, bool, bool>> checkRightFunc;
|
||||
if (isPrePlay)
|
||||
{
|
||||
checkRightFunc = (ISkillConditionChecker f) => f.IsRightPrePlay;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkRightFunc = (ISkillConditionChecker f) => f.IsRight;
|
||||
}
|
||||
if (ConditionCheckerFilterList.Count() != 0)
|
||||
{
|
||||
flag2 = ConditionCheckerFilterList.All((ISkillConditionChecker c) => checkRightFunc(c)(playerInfoPair, checkerOption, arg3: false));
|
||||
}
|
||||
if (AnyConditionFilter.Count > 0)
|
||||
{
|
||||
flag3 = AnyConditionFilter.All((SkillAnyConditionFilter c) => c.Filtering(playerInfoPair, ownerCard, checkerOption, optionValue, isPrePlay, skill, isSkipTargetAiSelect));
|
||||
}
|
||||
if (base.BattlePlayerFilter != null)
|
||||
{
|
||||
flag4 = FilteringBase(playerInfoPair, checkerOption, optionValue, isSkipTargetAiSelect).Any();
|
||||
}
|
||||
return flag && flag2 && flag4 && flag3;
|
||||
}
|
||||
}
|
||||
41
SVSim.BattleEngine/Engine/ConventionInfo.cs
Normal file
41
SVSim.BattleEngine/Engine/ConventionInfo.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
|
||||
public class ConventionInfo
|
||||
{
|
||||
public enum ConventionStatus
|
||||
{
|
||||
DeckEntry = 1,
|
||||
GameStart
|
||||
}
|
||||
|
||||
public ConventionStatus Status { get; private set; }
|
||||
|
||||
public string Id { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string DeckEntryLimitText { get; private set; }
|
||||
|
||||
public string StartTime { get; private set; }
|
||||
|
||||
public BattleParameter BattleParameterInstance { get; set; }
|
||||
|
||||
public bool IsSelectableTurn { get; private set; }
|
||||
|
||||
public ConventionInfo(JsonData data)
|
||||
{
|
||||
Id = data["tournament_id"].ToString();
|
||||
Name = data["name"].ToString();
|
||||
BattleParameterInstance = BattleParameter.JsonToBattleParameter(data);
|
||||
Status = (ConventionStatus)data["status"].ToInt();
|
||||
DeckEntryLimitText = ConvertTime.ToLocal(DateTime.Parse(data["tournament_start_date"].ToString())).ToString();
|
||||
IsSelectableTurn = data["is_selectable_turn"].ToInt() == 1;
|
||||
}
|
||||
|
||||
public ConventionInfo(string id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
}
|
||||
93
SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs
Normal file
93
SVSim.BattleEngine/Engine/Cute/AssetErrorState.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class AssetErrorState
|
||||
{
|
||||
public enum Code
|
||||
{
|
||||
NONE = 0,
|
||||
SERVER_TIMEOUT = 1,
|
||||
SERVER_UNDEFINED_ERROR = 2,
|
||||
LOCAL_CAPACITY_OVER = 4,
|
||||
CANCELED = 8,
|
||||
FILE_READ_ERROR = 0x10,
|
||||
SERVER_NOT_FOUND_ERROR = 0x20
|
||||
}
|
||||
|
||||
public enum DialogDecision
|
||||
{
|
||||
UNDECIDED,
|
||||
RETRY,
|
||||
TERMINATE
|
||||
}
|
||||
|
||||
private Dictionary<string, Code> errors = new Dictionary<string, Code>();
|
||||
|
||||
public DialogDecision lastDialogDecision;
|
||||
|
||||
public int errorFlag { get; private set; }
|
||||
|
||||
public bool canceled { get; private set; }
|
||||
|
||||
public bool HasError()
|
||||
{
|
||||
return errorFlag != 0;
|
||||
}
|
||||
|
||||
public bool HasError(Code code)
|
||||
{
|
||||
return ((uint)errorFlag & (uint)code) != 0;
|
||||
}
|
||||
|
||||
public void SetCanceled()
|
||||
{
|
||||
canceled = true;
|
||||
}
|
||||
|
||||
public int ErrorCount()
|
||||
{
|
||||
return errors.Count;
|
||||
}
|
||||
|
||||
public AssetErrorState()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Report(string filename, Code errorCode)
|
||||
{
|
||||
if (errorCode != Code.NONE)
|
||||
{
|
||||
errorFlag |= (int)errorCode;
|
||||
errors[filename] = errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
public Code Query(string filename)
|
||||
{
|
||||
if (!errors.TryGetValue(filename, out var value))
|
||||
{
|
||||
return Code.NONE;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
errorFlag = 0;
|
||||
lastDialogDecision = DialogDecision.UNDECIDED;
|
||||
errors.Clear();
|
||||
canceled = false;
|
||||
}
|
||||
|
||||
public List<string> GatherErrorFilenames()
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (KeyValuePair<string, Code> error in errors)
|
||||
{
|
||||
list.Add(error.Key);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
1231
SVSim.BattleEngine/Engine/Cute/AssetHandle.cs
Normal file
1231
SVSim.BattleEngine/Engine/Cute/AssetHandle.cs
Normal file
File diff suppressed because it is too large
Load Diff
22
SVSim.BattleEngine/Engine/Cute/AssetRequestContext.cs
Normal file
22
SVSim.BattleEngine/Engine/Cute/AssetRequestContext.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class AssetRequestContext
|
||||
{
|
||||
public Action<AssetHandle> callback { get; set; }
|
||||
|
||||
public AssetErrorState errorState { get; set; }
|
||||
|
||||
public Utility.LeanSemaphore semaphore { get; set; }
|
||||
|
||||
public bool preferSynchronousLoad { get; set; }
|
||||
|
||||
public AssetRequestContext(Action<AssetHandle> callback = null, Utility.LeanSemaphore semaphore = null, AssetErrorState errorState = null, bool preferSynchronousLoad = false)
|
||||
{
|
||||
this.callback = callback;
|
||||
this.semaphore = semaphore;
|
||||
this.errorState = errorState;
|
||||
this.preferSynchronousLoad = preferSynchronousLoad;
|
||||
}
|
||||
}
|
||||
375
SVSim.BattleEngine/Engine/Cute/Certification.cs
Normal file
375
SVSim.BattleEngine/Engine/Cute/Certification.cs
Normal file
@@ -0,0 +1,375 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Steamworks;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Title;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class Certification : MonoBehaviour
|
||||
{
|
||||
public static bool CheckUrlScheme;
|
||||
|
||||
private const int ERROR_CODE_ACCOUNT_REMOVED = 5607;
|
||||
|
||||
private static string udid;
|
||||
|
||||
private static int viewer_id;
|
||||
|
||||
private static int short_udid;
|
||||
|
||||
private static string sessionId;
|
||||
|
||||
private const float DELAY_TIME = 0.02f;
|
||||
|
||||
protected Callback<GetAuthSessionTicketResponse_t> m_GetAuthSessionTicketResponse;
|
||||
|
||||
public static string Udid
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(udid))
|
||||
{
|
||||
udid = Cryptographer.decode(Toolbox.SavedataManager.GetString("UDID"));
|
||||
}
|
||||
return udid;
|
||||
}
|
||||
}
|
||||
|
||||
public static int ViewerId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (viewer_id == 0)
|
||||
{
|
||||
viewer_id = Toolbox.SavedataManager.GetInt("VIEWER_ID");
|
||||
}
|
||||
return viewer_id;
|
||||
}
|
||||
set
|
||||
{
|
||||
Toolbox.SavedataManager.SetInt("VIEWER_ID", value);
|
||||
Toolbox.SavedataManager.Save();
|
||||
viewer_id = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static int ShortUdid
|
||||
{
|
||||
get
|
||||
{
|
||||
if (short_udid == 0)
|
||||
{
|
||||
short_udid = Toolbox.SavedataManager.GetInt("SHORT_UDID");
|
||||
}
|
||||
return short_udid;
|
||||
}
|
||||
set
|
||||
{
|
||||
Toolbox.SavedataManager.SetInt("SHORT_UDID", value);
|
||||
short_udid = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string SessionId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(sessionId))
|
||||
{
|
||||
sessionId = ViewerId + Udid;
|
||||
}
|
||||
return Cryptographer.MakeMd5(sessionId);
|
||||
}
|
||||
set
|
||||
{
|
||||
sessionId = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string dmmViewerId { get; private set; }
|
||||
|
||||
public static string dmmOnetimeToken { get; private set; }
|
||||
|
||||
public static ulong SteamID { get; private set; }
|
||||
|
||||
public static string SteamSessionTicket { get; private set; }
|
||||
|
||||
public static bool IsExistsViewerId()
|
||||
{
|
||||
if (ViewerId != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetEncodedViewerId()
|
||||
{
|
||||
string s = CryptAES.encrypt(ViewerId.ToString());
|
||||
return Convert.ToBase64String(Encoding.UTF8.GetBytes(s));
|
||||
}
|
||||
|
||||
public static string GetEncodedSessionId()
|
||||
{
|
||||
return Convert.ToBase64String(Encoding.UTF8.GetBytes(SessionId));
|
||||
}
|
||||
|
||||
public static string GetEncodedShortUdid()
|
||||
{
|
||||
return Convert.ToBase64String(Encoding.UTF8.GetBytes(ShortUdid.ToString()));
|
||||
}
|
||||
|
||||
public static string GetKeyChainViewerId()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string GetIDFA()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void SetKeyChainViewerId(string viewerId)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DeleteKeyChainViewerId()
|
||||
{
|
||||
}
|
||||
|
||||
public static void InitializeFileds()
|
||||
{
|
||||
sessionId = null;
|
||||
udid = null;
|
||||
viewer_id = 0;
|
||||
short_udid = 0;
|
||||
Toolbox.SavedataManager.SetInt("VIEWER_ID", 0);
|
||||
Toolbox.SavedataManager.SetInt("SHORT_UDID", 0);
|
||||
Toolbox.SavedataManager.SetString("UDID", "");
|
||||
}
|
||||
|
||||
public IEnumerator Login()
|
||||
{
|
||||
if (ViewerId == 0)
|
||||
{
|
||||
GenerateUdid();
|
||||
SignUpTask signUpTask = new SignUpTask();
|
||||
signUpTask.SetParameter();
|
||||
yield return StartCoroutine(Toolbox.NetworkManager.Connect(signUpTask, delegate
|
||||
{
|
||||
StartCoroutine(GameStartCheckTaskExec());
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
OutOfService.ShowServiceEndedDialogIfNeeded();
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return StartCoroutine(GameStartCheckTaskExec());
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsiCloudAvailable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SetiCloudUser()
|
||||
{
|
||||
}
|
||||
|
||||
public static void EraseiCloudUser()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetiCloudUser()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public void CheckiCloudUserData(Action<NetworkTask.ResultCode> callback)
|
||||
{
|
||||
GetiCloudUserDataTask.VerifiediCloudUserData.Reset();
|
||||
string text = GetiCloudUser();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
callback(NetworkTask.ResultCode.Success);
|
||||
return;
|
||||
}
|
||||
GenerateUdid();
|
||||
GetiCloudUserDataTask getiCloudUserDataTask = new GetiCloudUserDataTask();
|
||||
getiCloudUserDataTask.SetParameter(text);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(getiCloudUserDataTask, callback));
|
||||
}
|
||||
|
||||
public void MigrateiCloudUserData(Action<NetworkTask.ResultCode> callback)
|
||||
{
|
||||
string parameter = GetiCloudUser();
|
||||
UpdateiCloudUserDataTask updateiCloudUserDataTask = new UpdateiCloudUserDataTask();
|
||||
updateiCloudUserDataTask.SetParameter(parameter);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(updateiCloudUserDataTask, callback));
|
||||
}
|
||||
|
||||
public void FirstTimeSaveiCloudUserData()
|
||||
{
|
||||
if (IsiCloudAvailable() && string.IsNullOrEmpty(GetiCloudUser()))
|
||||
{
|
||||
SetiCloudUser();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator GameStartCheckTaskExec()
|
||||
{
|
||||
GameStartCheckTask gameStartCheckTask = new GameStartCheckTask();
|
||||
gameStartCheckTask.AddSkipCuteCheckResultCode(5607);
|
||||
gameStartCheckTask.SetParameter();
|
||||
bool isRemoveAccount = false;
|
||||
yield return StartCoroutine(Toolbox.NetworkManager.Connect(gameStartCheckTask, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = true;
|
||||
}
|
||||
URLScheme.ClearCampaignData();
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
OutOfService.ShowServiceEndedDialogIfNeeded();
|
||||
}, delegate(int resultCode)
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
URLScheme.ClearCampaignData();
|
||||
if (resultCode == 5607)
|
||||
{
|
||||
isRemoveAccount = true;
|
||||
OnRemoveAccount();
|
||||
}
|
||||
}));
|
||||
if (isRemoveAccount)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRemoveAccount()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("MyPage_0097"));
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("ErrorHeader_0001"));
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
UserInfoRequest.DeleteUserData();
|
||||
};
|
||||
}
|
||||
|
||||
public void GenerateUdid()
|
||||
{
|
||||
udid = Cryptographer.decode(Toolbox.SavedataManager.GetString("UDID"));
|
||||
if (string.IsNullOrEmpty(udid))
|
||||
{
|
||||
Toolbox.SavedataManager.SetString("UDID", Cryptographer.encode(Guid.NewGuid().ToString()));
|
||||
Toolbox.SavedataManager.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsLogined()
|
||||
{
|
||||
return !string.IsNullOrEmpty(sessionId);
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
while (Toolbox.BootSystem == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
SessionId = "";
|
||||
setDmmPlatformData();
|
||||
setSTEAMPlatformData();
|
||||
URLSchemeStart();
|
||||
}
|
||||
|
||||
private void OnApplicationFocus(bool focus)
|
||||
{
|
||||
if (focus)
|
||||
{
|
||||
URLSchemeStart();
|
||||
}
|
||||
}
|
||||
|
||||
private void URLSchemeStart()
|
||||
{
|
||||
if (CheckUrlScheme)
|
||||
{
|
||||
StartCoroutine(Delay(0.02f, delegate
|
||||
{
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Delay(float waitTime, Action action)
|
||||
{
|
||||
yield return new WaitForSeconds(waitTime);
|
||||
action();
|
||||
}
|
||||
|
||||
private void setSTEAMPlatformData()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamID = SteamUser.GetSteamID().m_SteamID;
|
||||
m_GetAuthSessionTicketResponse = Callback<GetAuthSessionTicketResponse_t>.Create(OnGetAuthSessionTicketResponse);
|
||||
byte[] array = new byte[1024];
|
||||
SteamNetworkingIdentity pSteamNetworkingIdentity = default(SteamNetworkingIdentity);
|
||||
SteamUser.GetAuthSessionTicket(array, array.Length, out var pcbTicket, ref pSteamNetworkingIdentity);
|
||||
Array.Resize(ref array, (int)pcbTicket);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = 0; i < pcbTicket; i++)
|
||||
{
|
||||
stringBuilder.AppendFormat("{0:x2}", array[i]);
|
||||
}
|
||||
SteamSessionTicket = stringBuilder.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError("<color=aqua>steam client が起動していない。steamの機能を使えません。</color>");
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError(ex.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGetAuthSessionTicketResponse(GetAuthSessionTicketResponse_t pCallback)
|
||||
{
|
||||
}
|
||||
|
||||
private void setDmmPlatformData()
|
||||
{
|
||||
}
|
||||
|
||||
public void URLSchemeStartiOS(string message)
|
||||
{
|
||||
URLScheme.URLSchemeStartiOS(message);
|
||||
}
|
||||
}
|
||||
54
SVSim.BattleEngine/Engine/Cute/INetworkUI.cs
Normal file
54
SVSim.BattleEngine/Engine/Cute/INetworkUI.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
namespace Cute;
|
||||
|
||||
public interface INetworkUI
|
||||
{
|
||||
string GetText(string code);
|
||||
|
||||
void StartLoading(bool notEditor = false);
|
||||
|
||||
void StopLoading();
|
||||
|
||||
void GoToMypage();
|
||||
|
||||
void SoftwareRest();
|
||||
|
||||
bool IsKeepLastRequest();
|
||||
|
||||
void SetKeepLastRequest(bool flag);
|
||||
|
||||
void OpenRetryAndToTitleErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGoToMypageErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGoToTitleErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGotoStoreErrorPopup();
|
||||
|
||||
void OpenRetryFailErrorPopup();
|
||||
|
||||
void OpenTimeOutErrorPopUp();
|
||||
|
||||
void OpenHttpStatusErrorPopUp();
|
||||
|
||||
void OpenResourceVersionUpPopUp();
|
||||
|
||||
void OpenSessionErrorPopUp();
|
||||
|
||||
bool isCloseDialogGroupError(int resultCode);
|
||||
|
||||
void OpenCloseOnlyErrorPopUp(int resultCode);
|
||||
|
||||
void OpenStrictServerErrorPopUp(int resultCode);
|
||||
|
||||
void OpenAccountBlockErrorPopUp(int resultCode);
|
||||
|
||||
void OpenAccountLimitedBlockErrorPopUp(int resultCode, string endTimeText);
|
||||
|
||||
void OpenAllMaintenancePopUp(int resultCode, string endTime);
|
||||
|
||||
void OpenEachFunctionMaintenancePopUp(int resultCode);
|
||||
|
||||
void OpenOtherServerErrorPopUp(int resultCode);
|
||||
|
||||
void OpenSocialServiceNoResponseErrorPopup();
|
||||
}
|
||||
406
SVSim.BattleEngine/Engine/Cute/NetworkManager.cs
Normal file
406
SVSim.BattleEngine/Engine/Cute/NetworkManager.cs
Normal file
@@ -0,0 +1,406 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
using MessagePack;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Phase;
|
||||
using Wizard.Bingo;
|
||||
using Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
using Wizard.Scripts.Network.Data.TaskData.ItemPurchase;
|
||||
using Wizard.Scripts.Network.Data.TaskData.SkinPurchase;
|
||||
using Wizard.Scripts.Network.Data.TaskData.SpotCardExchange;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class NetworkManager : MonoBehaviour, IManager
|
||||
{
|
||||
public const float TimeOut = 30f;
|
||||
|
||||
public const float TimeOutShort = 2f;
|
||||
|
||||
protected NetworkTask lastRequestTask;
|
||||
|
||||
public bool isConnect;
|
||||
|
||||
public bool isTimeOut;
|
||||
|
||||
public bool isError;
|
||||
|
||||
private bool isEncrypt = true;
|
||||
|
||||
private bool isUseJson;
|
||||
|
||||
private bool _showLoadingIcon = true;
|
||||
|
||||
private IEnumerator connectCoroutine;
|
||||
|
||||
[SerializeField]
|
||||
public Certification _certification;
|
||||
|
||||
public INetworkUI NetworkUI { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Toolbox.NetworkManager = this;
|
||||
}
|
||||
|
||||
public bool IsReachability()
|
||||
{
|
||||
if (Application.internetReachability != NetworkReachability.NotReachable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IEnumerator Connect(NetworkTask task, Action<NetworkTask.ResultCode> callbackOnSuccess = null, Action<NetworkTask.ResultCode> callbackOnFailure = null, Action<int> callbackOnResultCodeError = null, bool encrypt = true, bool useJson = false, bool showLoadingIcon = true, bool showErrorDialog = true)
|
||||
{
|
||||
while (isConnect)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
isEncrypt = encrypt;
|
||||
isUseJson = useJson;
|
||||
_showLoadingIcon = showLoadingIcon;
|
||||
if (true)
|
||||
{
|
||||
if (IsBattle())
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("taskStart " + task);
|
||||
}
|
||||
lastRequestTask = task;
|
||||
lastRequestTask.Initialize();
|
||||
lastRequestTask.CallbackOnSuccess = callbackOnSuccess;
|
||||
lastRequestTask.CallbackOnFailure = callbackOnFailure;
|
||||
lastRequestTask.CallbackOnResultCodeError = callbackOnResultCodeError;
|
||||
lastRequestTask.PrepareHeaders();
|
||||
lastRequestTask.PreparePostData(isEncrypt, isUseJson);
|
||||
connectCoroutine = Connect(showErrorDialog);
|
||||
yield return StartCoroutine(connectCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Connect(bool showErrorDialog)
|
||||
{
|
||||
while (isConnect)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
isConnect = true;
|
||||
isTimeOut = false;
|
||||
isError = false;
|
||||
if (NetworkUI != null && _showLoadingIcon)
|
||||
{
|
||||
NetworkUI.StartLoading();
|
||||
}
|
||||
bool isLogTraceCheckUri = false;
|
||||
if (lastRequestTask is DoMatchingBase || lastRequestTask is FinishTaskBase)
|
||||
{
|
||||
isLogTraceCheckUri = true;
|
||||
}
|
||||
string url = lastRequestTask.Url;
|
||||
_ = lastRequestTask;
|
||||
if (isLogTraceCheckUri)
|
||||
{
|
||||
LogTraceCheck("1");
|
||||
}
|
||||
using UnityWebRequest unityWebRequest = GetUnityWebRequestInstance(url);
|
||||
yield return unityWebRequest.SendWebRequest();
|
||||
if (isLogTraceCheckUri)
|
||||
{
|
||||
LogTraceCheck("2");
|
||||
}
|
||||
float endTime = Time.realtimeSinceStartup + 30f;
|
||||
if (lastRequestTask.GetType().Equals(typeof(CheckSpecialTitleTask)))
|
||||
{
|
||||
endTime = Time.realtimeSinceStartup + 2f;
|
||||
}
|
||||
while (!unityWebRequest.isDone && Time.realtimeSinceStartup < endTime)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
if (isLogTraceCheckUri)
|
||||
{
|
||||
LogTraceCheck("3");
|
||||
}
|
||||
if (NetworkUI != null)
|
||||
{
|
||||
NetworkUI.StopLoading();
|
||||
}
|
||||
if (!unityWebRequest.isDone)
|
||||
{
|
||||
isTimeOut = true;
|
||||
LocalLog.AccumulateTraceLog("Connect is TimeOut");
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
if (!lastRequestTask.isSkipCommonTimeOutPopUp())
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(BuildDeckBuyTask)) || lastRequestTask.GetType().Equals(typeof(SleeveBuyTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiRewardTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuySingleTask)) || lastRequestTask.GetType().Equals(typeof(ItemPurchaseBuyTask)) || lastRequestTask.GetType().Equals(typeof(SpotCardExchangeTask)) || lastRequestTask.GetType().Equals(typeof(CardCreateTask)) || lastRequestTask.GetType().Equals(typeof(CardDestructTask)) || lastRequestTask.GetType().Equals(typeof(StoryFinishTask)) || lastRequestTask.GetType().Equals(typeof(PracticeFinishTask)) || lastRequestTask.GetType().Equals(typeof(BingoDrawTask)) || lastRequestTask.GetType().Equals(typeof(MypageTreasureBoxCpOpenTask)) || lastRequestTask.GetType().Equals(typeof(MypageReceiveSpecialTreasureTask)) || lastRequestTask.GetType().Equals(typeof(FreeCardPackCampaignFinishTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkUI.OpenTimeOutErrorPopUp();
|
||||
}
|
||||
}
|
||||
if (lastRequestTask.CallbackOnFailure != null)
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.TimeOut);
|
||||
}
|
||||
}
|
||||
Toolbox.DeviceManager.ClearIpAddress();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(unityWebRequest.error))
|
||||
{
|
||||
LocalLog.AccumulateTraceLog("Connect is Error!" + unityWebRequest.error + " responseCode:" + unityWebRequest.responseCode);
|
||||
isError = true;
|
||||
if (showErrorDialog && !lastRequestTask.isSkipCommonHttpStatusErrorPopUp())
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkUI.OpenHttpStatusErrorPopUp();
|
||||
}
|
||||
}
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
if (lastRequestTask.CallbackOnFailure != null)
|
||||
{
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.Error);
|
||||
}
|
||||
Toolbox.DeviceManager.ClearIpAddress();
|
||||
}
|
||||
else if (unityWebRequest.isDone)
|
||||
{
|
||||
if (lastRequestTask.CallbackOnUnityWebRequestDone != null)
|
||||
{
|
||||
lastRequestTask.CallbackOnUnityWebRequestDone(unityWebRequest);
|
||||
}
|
||||
else if (unityWebRequest.downloadHandler.text != null && unityWebRequest.downloadHandler.text != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] bytes = ((!isEncrypt) ? Convert.FromBase64String(unityWebRequest.downloadHandler.text) : CryptAES.decrypt(unityWebRequest.downloadHandler.text));
|
||||
string json = (isUseJson ? MessagePackSerializer.ToJson(bytes) : MessagePackSerializer.ToJson(bytes));
|
||||
lastRequestTask.SetResponseData(JsonMapper.ToObject(json));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string text = unityWebRequest.downloadHandler.text;
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
if (!lastRequestTask.GetType().Equals(typeof(CheckSpecialTitleTask)))
|
||||
{
|
||||
if (!isEncrypt)
|
||||
{
|
||||
LocalLog.AccumulateTraceLog(ex.ToString());
|
||||
throw ex;
|
||||
}
|
||||
Debug.LogError(text);
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError(ex.StackTrace);
|
||||
if (text.Contains("php"))
|
||||
{
|
||||
if (text.Length > 1800)
|
||||
{
|
||||
throw new Exception(text.Substring(1, 1800));
|
||||
}
|
||||
throw new Exception(text);
|
||||
}
|
||||
HandleDeserializeException(ex);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
if (lastRequestTask != null)
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(CheckSpecialTitleTask)))
|
||||
{
|
||||
((CheckSpecialTitleTask)lastRequestTask).ParseTitleCheckData();
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkTask.ERROR_CODE_STATUS num = lastRequestTask.CheckResultCodeToPopupCreate_ReturnStatus();
|
||||
if (num == NetworkTask.ERROR_CODE_STATUS.ERROR)
|
||||
{
|
||||
isError = true;
|
||||
}
|
||||
if (num == NetworkTask.ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP && lastRequestTask.CallbackOnFailure != null)
|
||||
{
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.Maintenance);
|
||||
}
|
||||
if (num == NetworkTask.ERROR_CODE_STATUS.ERROR && lastRequestTask.CallbackOnFailure != null)
|
||||
{
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.Title);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
if (!lastRequestTask.GetType().Equals(typeof(CheckSpecialTitleTask)))
|
||||
{
|
||||
LocalLog.AccumulateTraceLog("NetworkManager Connect Error 2:" + ex2);
|
||||
throw ex2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalLog.AccumulateTraceLog("NetworkManager Connect Error 3");
|
||||
}
|
||||
}
|
||||
ClearLastRequestTask();
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
isConnect = false;
|
||||
}
|
||||
|
||||
private void LogTraceCheck(string logMsg)
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("NetworkTrace msg " + logMsg);
|
||||
LocalLog.SubmitAccumulateLastTraceLog();
|
||||
}
|
||||
|
||||
private bool IsBattle()
|
||||
{
|
||||
if (ToolboxGame.RealTimeNetworkAgent != null && BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().GetCurrentPhase() is MainPhase)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private UnityWebRequest GetUnityWebRequestInstance(string serverUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
UnityWebRequest unityWebRequest = new UnityWebRequest(serverUrl, "POST");
|
||||
unityWebRequest.uploadHandler = new UploadHandlerRaw(lastRequestTask.Body);
|
||||
unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
foreach (KeyValuePair<string, string> item in lastRequestTask.Header)
|
||||
{
|
||||
unityWebRequest.SetRequestHeader(item.Key, item.Value);
|
||||
}
|
||||
return unityWebRequest;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string text = "";
|
||||
foreach (KeyValuePair<string, string> item2 in lastRequestTask.Header)
|
||||
{
|
||||
text += string.Format("header==={0} : {1}" + Environment.NewLine, item2.Key, item2.Value);
|
||||
}
|
||||
Debug.LogError(ex?.ToString() + ":" + text);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleDeserializeException(Exception e)
|
||||
{
|
||||
SoftwareReset.exec();
|
||||
throw new Exception("復号化に失敗しました。" + e);
|
||||
}
|
||||
|
||||
public void ClearLastRequestTask()
|
||||
{
|
||||
if ((NetworkUI != null && !NetworkUI.IsKeepLastRequest()) || lastRequestTask.isServerResultCodeOK())
|
||||
{
|
||||
if (IsBattle())
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("ClearLastRequestTask " + lastRequestTask);
|
||||
}
|
||||
lastRequestTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator Retry()
|
||||
{
|
||||
if (lastRequestTask == null)
|
||||
{
|
||||
NetworkUI.OpenRetryFailErrorPopup();
|
||||
yield break;
|
||||
}
|
||||
if (connectCoroutine != null)
|
||||
{
|
||||
StopConnectCoroutine();
|
||||
}
|
||||
connectCoroutine = Connect(showErrorDialog: true);
|
||||
yield return StartCoroutine(connectCoroutine);
|
||||
}
|
||||
|
||||
public void Certification()
|
||||
{
|
||||
_certification.GenerateUdid();
|
||||
}
|
||||
|
||||
public void ReturnToTitle()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.SoftwareRest();
|
||||
}
|
||||
|
||||
public void GoToMypage()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.GoToMypage();
|
||||
}
|
||||
|
||||
public void GoToStore()
|
||||
{
|
||||
lastRequestTask.GotoStore();
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.SoftwareRest();
|
||||
}
|
||||
|
||||
public void QuitApplication()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
if (Toolbox.mute != null)
|
||||
{
|
||||
Toolbox.mute.Close();
|
||||
Toolbox.mute = null;
|
||||
}
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
private void disposeUnityWebRequest(UnityWebRequest unityWebRequest)
|
||||
{
|
||||
unityWebRequest.Dispose();
|
||||
}
|
||||
|
||||
public void StopConnectCoroutine()
|
||||
{
|
||||
if (connectCoroutine != null)
|
||||
{
|
||||
if (RealTimeNetworkAgent.IsNormalNetworkBattle())
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("NetworkManager_StopConnectCoroutine " + StackTraceUtility.ExtractStackTrace());
|
||||
}
|
||||
StopCoroutine(connectCoroutine);
|
||||
isConnect = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (RealTimeNetworkAgent.IsNormalNetworkBattle())
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("NetworkManager_Destroy");
|
||||
}
|
||||
}
|
||||
}
|
||||
570
SVSim.BattleEngine/Engine/Cute/NetworkTask.cs
Normal file
570
SVSim.BattleEngine/Engine/Cute/NetworkTask.cs
Normal file
@@ -0,0 +1,570 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LitJson;
|
||||
using MessagePack;
|
||||
using UnityEngine.Networking;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Recovery;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class NetworkTask
|
||||
{
|
||||
public enum ResultCode
|
||||
{
|
||||
Success,
|
||||
Error,
|
||||
TimeOut,
|
||||
Title,
|
||||
Maintenance
|
||||
}
|
||||
|
||||
public enum ERROR_CODE_STATUS
|
||||
{
|
||||
NONE,
|
||||
ERROR,
|
||||
ERROR_TO_MAINTENANCE_POPUP
|
||||
}
|
||||
|
||||
protected Dictionary<string, string> header = new Dictionary<string, string>();
|
||||
|
||||
protected byte[] body;
|
||||
|
||||
protected int resultCode;
|
||||
|
||||
private SkipCuteCheckResultCodes skipCuteCheckResultCodes;
|
||||
|
||||
private bool skipCommonTimeOutPopUp;
|
||||
|
||||
private bool skipCommonHttpStatusErrorPopUp;
|
||||
|
||||
public virtual string Url { get; set; }
|
||||
|
||||
public Action<ResultCode> CallbackOnSuccess { get; set; }
|
||||
|
||||
public Action<ResultCode> CallbackOnFailure { get; set; }
|
||||
|
||||
public Action<int> CallbackOnResultCodeError { get; set; }
|
||||
|
||||
public Action<UnityWebRequest> CallbackOnUnityWebRequestDone { get; set; }
|
||||
|
||||
public Dictionary<string, string> Header => header;
|
||||
|
||||
public byte[] Body => body;
|
||||
|
||||
public PostParams Params { get; set; }
|
||||
|
||||
public JsonData ResponseData { get; private set; }
|
||||
|
||||
public bool IsResourceVersionUpError { get; private set; }
|
||||
|
||||
public bool IsResultSuccess => resultCode == 1;
|
||||
|
||||
public NetworkTask()
|
||||
{
|
||||
skipCuteCheckResultCodes = new SkipCuteCheckResultCodes();
|
||||
Params = new PostParams();
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
ResponseData = null;
|
||||
resultCode = 0;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> PrepareHeaders()
|
||||
{
|
||||
AddHeaderUdid();
|
||||
AddHeaderShortUdid();
|
||||
AddHeaderSessionId();
|
||||
AddHeaderParam();
|
||||
AddHeaderDevice();
|
||||
AddHeaderAppVersion();
|
||||
AddHeaderResVersion();
|
||||
AddHeaderDeviceId();
|
||||
AddHeaderDeviceName();
|
||||
AddHeaderGraphicsDeviceName();
|
||||
AddHeaderIpAddress();
|
||||
AddHeaderPlatformOsVersion();
|
||||
AddHeaderKeyChain();
|
||||
AddHeaderIDFA();
|
||||
AddHeaderLocale();
|
||||
AddHeaderLanguage();
|
||||
AddHeaderCountryCode();
|
||||
AddHeaderPlatform();
|
||||
AddHeaderIsWSS();
|
||||
AddHeaderIsIpv6();
|
||||
AddHeaderDevAccessSecretKey();
|
||||
AddCardMasterHash();
|
||||
return header;
|
||||
}
|
||||
|
||||
public byte[] PreparePostData(bool encrypt = true, bool isUseJson = false)
|
||||
{
|
||||
return CreateBody(encrypt, isUseJson);
|
||||
}
|
||||
|
||||
public void SetResponseData(JsonData data)
|
||||
{
|
||||
ResponseData = data;
|
||||
resultCode = getDataHeader()["result_code"].ToInt();
|
||||
}
|
||||
|
||||
public int GetResultCode()
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
public ERROR_CODE_STATUS CheckResultCodeToPopupCreate_ReturnStatus(int rc = 0)
|
||||
{
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
if (isAppVersionUP())
|
||||
{
|
||||
RecoveryRecordManagerBase.DeleteRecoveryFile();
|
||||
networkUI.OpenGotoStoreErrorPopup();
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isResourceVersionUp())
|
||||
{
|
||||
IsResourceVersionUpError = true;
|
||||
setResourceVersion();
|
||||
if (!Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.GameStartCheck]))
|
||||
{
|
||||
RecoveryRecordManagerBase.DeleteRecoveryFile();
|
||||
networkUI.OpenResourceVersionUpPopUp();
|
||||
Parse();
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
}
|
||||
if (isSessionError())
|
||||
{
|
||||
networkUI.OpenSessionErrorPopUp();
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
setSession();
|
||||
if (isUnknownServerError() || isServerProcessedError() || isServerDataBaseError())
|
||||
{
|
||||
networkUI.OpenStrictServerErrorPopUp(resultCode);
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isAccountBlockError())
|
||||
{
|
||||
networkUI.OpenAccountBlockErrorPopUp(resultCode);
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isNeteaseAccountBlockError())
|
||||
{
|
||||
NtDataTranslateManager.GetInstance().ShowRejectLogin();
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isAccountLimitedBlockError())
|
||||
{
|
||||
string accountLimitedBlockEndTime = getAccountLimitedBlockEndTime();
|
||||
networkUI.OpenAccountLimitedBlockErrorPopUp(resultCode, accountLimitedBlockEndTime);
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (IsAllMaintenanceError())
|
||||
{
|
||||
string maintenanceEndTime = getMaintenanceEndTime();
|
||||
networkUI.OpenAllMaintenancePopUp(resultCode, maintenanceEndTime);
|
||||
return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP;
|
||||
}
|
||||
if (IsEachFunctionMaintenanceError())
|
||||
{
|
||||
networkUI.OpenEachFunctionMaintenancePopUp(resultCode);
|
||||
return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP;
|
||||
}
|
||||
if (IsCardMaintenanceError())
|
||||
{
|
||||
if (CallbackOnResultCodeError != null)
|
||||
{
|
||||
CallbackOnResultCodeError(resultCode);
|
||||
}
|
||||
return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP;
|
||||
}
|
||||
if (!skipCuteCheckResultCodes.isSkipAll() && !skipCuteCheckResultCodes.Contains(resultCode))
|
||||
{
|
||||
cuteCheckResultCode();
|
||||
}
|
||||
Parse();
|
||||
if (isServerResultCodeOK())
|
||||
{
|
||||
if (CallbackOnSuccess != null)
|
||||
{
|
||||
CallbackOnSuccess(ResultCode.Success);
|
||||
}
|
||||
return ERROR_CODE_STATUS.NONE;
|
||||
}
|
||||
if (CallbackOnResultCodeError != null)
|
||||
{
|
||||
CallbackOnResultCodeError(resultCode);
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
return ERROR_CODE_STATUS.NONE;
|
||||
}
|
||||
|
||||
private void cuteCheckResultCode()
|
||||
{
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
if (networkUI.isCloseDialogGroupError(resultCode))
|
||||
{
|
||||
networkUI.OpenCloseOnlyErrorPopUp(resultCode);
|
||||
}
|
||||
else if (!isServerResultCodeOK())
|
||||
{
|
||||
networkUI.OpenOtherServerErrorPopUp(resultCode);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual string getAccountLimitedBlockEndTime()
|
||||
{
|
||||
return ResponseData["data"]["account_block_end_time"].ToString();
|
||||
}
|
||||
|
||||
protected virtual string getMaintenanceEndTime()
|
||||
{
|
||||
if (ResponseData["data"].Count > 0 && ResponseData["data"].Keys.Contains("maintenance_end_time") && ResponseData["data"]["maintenance_end_time"].ToString().Length > 0)
|
||||
{
|
||||
return ResponseData["data"]["maintenance_end_time"].ToString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected virtual string getUdid()
|
||||
{
|
||||
return Certification.Udid;
|
||||
}
|
||||
|
||||
protected virtual byte[] CreateBody(bool encrypt = true, bool isUseJson = false)
|
||||
{
|
||||
if (isUseJson)
|
||||
{
|
||||
body = _createBodyJson(Params, encrypt);
|
||||
}
|
||||
else
|
||||
{
|
||||
body = _createBodyMsgpack(Params, encrypt);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
protected byte[] _createBodyJson(PostParams Params, bool encrypt = true)
|
||||
{
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(JsonMapper.ToJson(Params));
|
||||
if (!encrypt)
|
||||
{
|
||||
return bytes;
|
||||
}
|
||||
return CryptAES.encrypt(bytes);
|
||||
}
|
||||
|
||||
protected byte[] _createBodyMsgpack(PostParams Params, bool encrypt = true)
|
||||
{
|
||||
byte[] array = MessagePackSerializer.FromJson(JsonMapper.ToJson(Params));
|
||||
if (!encrypt)
|
||||
{
|
||||
return array;
|
||||
}
|
||||
return CryptAES.encrypt(array);
|
||||
}
|
||||
|
||||
protected virtual int Parse()
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
private void AddHeaderUdid()
|
||||
{
|
||||
if (Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.SignUp]) || Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.CheckSpecialTitle]) || Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.CheckiCloudUser]) || Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.MigrateiCloudUser]))
|
||||
{
|
||||
string value = Cryptographer.encode(getUdid());
|
||||
header["UDID"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddHeaderShortUdid()
|
||||
{
|
||||
string value = Cryptographer.encode(Certification.ShortUdid.ToString());
|
||||
header["SHORT_UDID"] = value;
|
||||
}
|
||||
|
||||
private void AddHeaderSessionId()
|
||||
{
|
||||
header["SID"] = Certification.SessionId;
|
||||
}
|
||||
|
||||
private void AddHeaderParam()
|
||||
{
|
||||
string udid = getUdid();
|
||||
string viewer_id = CryptAES.encrypt(Certification.ViewerId.ToString());
|
||||
Params.viewer_id = viewer_id;
|
||||
Params.steam_id = Certification.SteamID;
|
||||
Params.steam_session_ticket = Certification.SteamSessionTicket;
|
||||
string text = Convert.ToBase64String(MessagePackSerializer.FromJson(JsonMapper.ToJson(Params)));
|
||||
Uri uri = new Uri(Url.Trim());
|
||||
string text2 = udid + uri.AbsolutePath + text;
|
||||
if (Certification.ViewerId != 0)
|
||||
{
|
||||
text2 += Certification.ViewerId;
|
||||
}
|
||||
string value = Cryptographer.ComputeHash(text2);
|
||||
header["PARAM"] = value;
|
||||
}
|
||||
|
||||
private void AddHeaderDevice()
|
||||
{
|
||||
header["DEVICE"] = Toolbox.DeviceManager.GetDeviceType().ToString();
|
||||
}
|
||||
|
||||
private void AddHeaderAppVersion()
|
||||
{
|
||||
header["APP_VER"] = Toolbox.DeviceManager.GetAppVersionName();
|
||||
}
|
||||
|
||||
private void AddHeaderResVersion()
|
||||
{
|
||||
header["RES_VER"] = Toolbox.SavedataManager.GetResourceVersion();
|
||||
}
|
||||
|
||||
private void AddHeaderDeviceId()
|
||||
{
|
||||
header["DEVICE_ID"] = Toolbox.DeviceManager.GetDeviceUniqueIdentifier();
|
||||
}
|
||||
|
||||
private void AddHeaderDeviceName()
|
||||
{
|
||||
header["DEVICE_NAME"] = Uri.EscapeDataString(Toolbox.DeviceManager.GetDeviceName());
|
||||
}
|
||||
|
||||
private void AddHeaderGraphicsDeviceName()
|
||||
{
|
||||
header["GRAPHICS_DEVICE_NAME"] = Uri.EscapeDataString(Toolbox.DeviceManager.GetGraphicsDeviceName(textureCheck: true));
|
||||
}
|
||||
|
||||
private void AddHeaderIpAddress()
|
||||
{
|
||||
header["IP_ADDRESS"] = Toolbox.DeviceManager.GetIpAddress();
|
||||
}
|
||||
|
||||
private void AddHeaderPlatformOsVersion()
|
||||
{
|
||||
header["PLATFORM_OS_VERSION"] = Uri.EscapeDataString(Toolbox.DeviceManager.GetOsVersion());
|
||||
}
|
||||
|
||||
private void AddHeaderPlatform()
|
||||
{
|
||||
header["PLATFORM"] = CustomPreference.GetPlatform().ToString();
|
||||
}
|
||||
|
||||
private void AddHeaderIsWSS()
|
||||
{
|
||||
header["WSS"] = (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_WSS) ? "1" : "0");
|
||||
}
|
||||
|
||||
private void AddHeaderIsIpv6()
|
||||
{
|
||||
header["IPV6_CONNECTION"] = (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_IPV6) ? "1" : "0");
|
||||
}
|
||||
|
||||
private void AddCardMasterHash()
|
||||
{
|
||||
string cardMasterHash = CardMasterLocalFileUtility.GetCardMasterHash();
|
||||
if (!string.IsNullOrEmpty(cardMasterHash))
|
||||
{
|
||||
header["CARD_MASTER_HASH"] = cardMasterHash;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddHeaderDevAccessSecretKey()
|
||||
{
|
||||
}
|
||||
|
||||
private void AddHeaderCarrier()
|
||||
{
|
||||
header["CARRIER"] = Toolbox.DeviceManager.GetCarrier();
|
||||
}
|
||||
|
||||
private void AddHeaderKeyChain()
|
||||
{
|
||||
header["KEYCHAIN"] = Certification.GetKeyChainViewerId();
|
||||
}
|
||||
|
||||
private void AddHeaderIDFA()
|
||||
{
|
||||
header["IDFA"] = Certification.GetIDFA();
|
||||
}
|
||||
|
||||
private void AddHeaderLocale()
|
||||
{
|
||||
header["LOCALE"] = Toolbox.DeviceManager.GetLocale();
|
||||
}
|
||||
|
||||
private void AddHeaderLanguage()
|
||||
{
|
||||
string textLanguage = CustomPreference.GetTextLanguage();
|
||||
header["LANGUAGE"] = textLanguage;
|
||||
}
|
||||
|
||||
private void AddHeaderCountryCode()
|
||||
{
|
||||
header["REGION_CODE"] = PlayerStaticData.UserRegionCode;
|
||||
}
|
||||
|
||||
private bool isSessionError()
|
||||
{
|
||||
return resultCode == 201;
|
||||
}
|
||||
|
||||
private bool isUnknownServerError()
|
||||
{
|
||||
return resultCode == 102;
|
||||
}
|
||||
|
||||
private bool isAccountBlockError()
|
||||
{
|
||||
return resultCode == 203;
|
||||
}
|
||||
|
||||
private bool isNeteaseAccountBlockError()
|
||||
{
|
||||
return resultCode == 330;
|
||||
}
|
||||
|
||||
private bool isAccountLimitedBlockError()
|
||||
{
|
||||
return resultCode == 217;
|
||||
}
|
||||
|
||||
private bool isServerProcessedError()
|
||||
{
|
||||
return resultCode == 213;
|
||||
}
|
||||
|
||||
private bool isServerDataBaseError()
|
||||
{
|
||||
return resultCode == 100;
|
||||
}
|
||||
|
||||
public bool isServerResultCodeOK()
|
||||
{
|
||||
if (resultCode != 1 && resultCode != 3502)
|
||||
{
|
||||
return resultCode == 1768;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsAllMaintenanceError()
|
||||
{
|
||||
return resultCode == 101;
|
||||
}
|
||||
|
||||
private bool IsEachFunctionMaintenanceError()
|
||||
{
|
||||
if (resultCode >= 2000)
|
||||
{
|
||||
return resultCode <= 2999;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsCardMaintenanceError()
|
||||
{
|
||||
if (resultCode != 1710)
|
||||
{
|
||||
return resultCode == 5013;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setSession()
|
||||
{
|
||||
JsonData dataHeader = getDataHeader();
|
||||
if (dataHeader.Keys.Contains("sid") && dataHeader["sid"] != null && !string.IsNullOrEmpty(dataHeader["sid"].ToString()))
|
||||
{
|
||||
Certification.SessionId = dataHeader["sid"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private bool isAppVersionUP()
|
||||
{
|
||||
if (resultCode == 204)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void GotoStore()
|
||||
{
|
||||
BrowserURL.Open(getDataHeader()["store_url"].ToString());
|
||||
}
|
||||
|
||||
private bool isResourceVersionUp()
|
||||
{
|
||||
if (getDataHeader().Keys.Contains("required_res_ver"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private JsonData getDataHeader()
|
||||
{
|
||||
return ResponseData["data_headers"];
|
||||
}
|
||||
|
||||
private void setResourceVersion()
|
||||
{
|
||||
string resourceVersion = getDataHeader()["required_res_ver"].ToString();
|
||||
Toolbox.SavedataManager.SetResourceVersion(resourceVersion);
|
||||
}
|
||||
|
||||
public void AddSkipCuteCheckResultCode(int resultCode)
|
||||
{
|
||||
skipCuteCheckResultCodes.Add(resultCode);
|
||||
}
|
||||
|
||||
public void AddSkipCuteCheckResultCode(List<int> resultCodes)
|
||||
{
|
||||
skipCuteCheckResultCodes.Add(resultCodes);
|
||||
}
|
||||
|
||||
public void SkipAllCuteResultCodeCheckErrorPopup()
|
||||
{
|
||||
skipCuteCheckResultCodes.setSkipAll(pSkipAll: true);
|
||||
}
|
||||
|
||||
public void SkipCuteTimeOutPopup()
|
||||
{
|
||||
skipCommonTimeOutPopUp = true;
|
||||
}
|
||||
|
||||
public bool isSkipCommonTimeOutPopUp()
|
||||
{
|
||||
return skipCommonTimeOutPopUp;
|
||||
}
|
||||
|
||||
public void SkipCuteHttpStatusErrorPopup()
|
||||
{
|
||||
skipCommonHttpStatusErrorPopUp = true;
|
||||
}
|
||||
|
||||
public bool isSkipCommonHttpStatusErrorPopUp()
|
||||
{
|
||||
return skipCommonHttpStatusErrorPopUp;
|
||||
}
|
||||
|
||||
public void ClearSkipCuteCheckResultCode()
|
||||
{
|
||||
skipCuteCheckResultCodes.Clear();
|
||||
}
|
||||
|
||||
public void SkipAllNetworkChecks()
|
||||
{
|
||||
SkipAllCuteResultCodeCheckErrorPopup();
|
||||
SkipCuteTimeOutPopup();
|
||||
SkipCuteHttpStatusErrorPopup();
|
||||
}
|
||||
}
|
||||
10
SVSim.BattleEngine/Engine/Cute/PostParams.cs
Normal file
10
SVSim.BattleEngine/Engine/Cute/PostParams.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PostParams
|
||||
{
|
||||
public string viewer_id = "";
|
||||
|
||||
public ulong steam_id;
|
||||
|
||||
public string steam_session_ticket;
|
||||
}
|
||||
1707
SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs
Normal file
1707
SVSim.BattleEngine/Engine/Cute/ResourcesManager.cs
Normal file
File diff suppressed because it is too large
Load Diff
40
SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs
Normal file
40
SVSim.BattleEngine/Engine/Cute/SkipCuteCheckResultCodes.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
internal class SkipCuteCheckResultCodes
|
||||
{
|
||||
private List<int> resultCodes = new List<int>();
|
||||
|
||||
private bool skipAll;
|
||||
|
||||
public void setSkipAll(bool pSkipAll)
|
||||
{
|
||||
skipAll = pSkipAll;
|
||||
}
|
||||
|
||||
public bool isSkipAll()
|
||||
{
|
||||
return skipAll;
|
||||
}
|
||||
|
||||
public void Add(int resultCode)
|
||||
{
|
||||
resultCodes.Add(resultCode);
|
||||
}
|
||||
|
||||
public void Add(List<int> pResultCodes)
|
||||
{
|
||||
resultCodes.AddRange(pResultCodes);
|
||||
}
|
||||
|
||||
public bool Contains(int resultCode)
|
||||
{
|
||||
return resultCodes.Contains(resultCode);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
resultCodes.Clear();
|
||||
}
|
||||
}
|
||||
731
SVSim.BattleEngine/Engine/Cute/Utility.cs
Normal file
731
SVSim.BattleEngine/Engine/Cute/Utility.cs
Normal file
File diff suppressed because one or more lines are too long
23
SVSim.BattleEngine/Engine/DamageCardParameterModifier.cs
Normal file
23
SVSim.BattleEngine/Engine/DamageCardParameterModifier.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
public class DamageCardParameterModifier : TurnAndIntValue, ICardLifeModifier
|
||||
{
|
||||
public int Damage => base.Value;
|
||||
|
||||
public bool IsClearBeforeModifier => false;
|
||||
|
||||
public bool IsChangeMaxLife => false;
|
||||
|
||||
public DamageCardParameterModifier(int damage, int turn, bool isSelfTurn)
|
||||
: base(damage, turn, isSelfTurn)
|
||||
{
|
||||
}
|
||||
|
||||
public int CalcLife(int baseLife)
|
||||
{
|
||||
return baseLife - Damage;
|
||||
}
|
||||
|
||||
public int CalcMaxLife(int baseMaxLife)
|
||||
{
|
||||
return baseMaxLife;
|
||||
}
|
||||
}
|
||||
105
SVSim.BattleEngine/Engine/DamageClippingInfo.cs
Normal file
105
SVSim.BattleEngine/Engine/DamageClippingInfo.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class DamageClippingInfo
|
||||
{
|
||||
private ISkillParameterSelectFilter _maxFilter;
|
||||
|
||||
private ISkillParameterSelectFilter _minFilter;
|
||||
|
||||
private int _clippingMaxRange = -1;
|
||||
|
||||
private int _clippingMinRange = -1;
|
||||
|
||||
public int ClippingMax { get; private set; }
|
||||
|
||||
public int LifeLowerLimit { get; private set; } = -1;
|
||||
|
||||
public int ClippingRangeMax(List<BattleCardBase> cards)
|
||||
{
|
||||
if (_maxFilter != null)
|
||||
{
|
||||
return _maxFilter.Filtering(cards).FirstOrDefault();
|
||||
}
|
||||
return _clippingMaxRange;
|
||||
}
|
||||
|
||||
public int ClippingRangeMin(List<BattleCardBase> cards)
|
||||
{
|
||||
if (_minFilter != null)
|
||||
{
|
||||
return _minFilter.Filtering(cards).FirstOrDefault();
|
||||
}
|
||||
return _clippingMaxRange;
|
||||
}
|
||||
|
||||
public bool IsClipping(BattleCardBase card, int value)
|
||||
{
|
||||
bool flag = _maxFilter != null || _clippingMaxRange != -1;
|
||||
bool flag2 = _minFilter != null || _clippingMinRange != -1;
|
||||
if (!flag && !flag2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
List<BattleCardBase> cards = new List<BattleCardBase> { card };
|
||||
if (!flag || value <= ClippingRangeMax(cards))
|
||||
{
|
||||
if (flag2)
|
||||
{
|
||||
return ClippingRangeMin(cards) <= value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public DamageClippingInfo(int clippingMax, string maxRange, string minRange, int lifeLowerLimit)
|
||||
{
|
||||
ClippingMax = clippingMax;
|
||||
LifeLowerLimit = lifeLowerLimit;
|
||||
if (maxRange == null)
|
||||
{
|
||||
goto IL_0054;
|
||||
}
|
||||
if (!(maxRange == "self_life"))
|
||||
{
|
||||
if (maxRange == null || maxRange.Length != 0)
|
||||
{
|
||||
goto IL_0054;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_maxFilter = new SkillParameterSelectLifeFilter();
|
||||
}
|
||||
goto IL_0060;
|
||||
IL_0060:
|
||||
if (minRange != null)
|
||||
{
|
||||
if (minRange == "self_life")
|
||||
{
|
||||
_minFilter = new SkillParameterSelectLifeFilter();
|
||||
return;
|
||||
}
|
||||
if (minRange != null && minRange.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
_clippingMinRange = int.Parse(minRange);
|
||||
return;
|
||||
IL_0054:
|
||||
_clippingMaxRange = int.Parse(maxRange);
|
||||
goto IL_0060;
|
||||
}
|
||||
|
||||
public bool CheckMaxFilter(Type filterType)
|
||||
{
|
||||
if (_maxFilter != null)
|
||||
{
|
||||
return filterType == _maxFilter.GetType();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
24
SVSim.BattleEngine/Engine/DamageCutInfo.cs
Normal file
24
SVSim.BattleEngine/Engine/DamageCutInfo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
public class DamageCutInfo
|
||||
{
|
||||
public enum DamageType
|
||||
{
|
||||
ALL,
|
||||
SKILL
|
||||
}
|
||||
|
||||
public int CutAmount { get; private set; }
|
||||
|
||||
public DamageType Type { get; private set; }
|
||||
|
||||
public BattleCardBase OwnerCard { get; private set; }
|
||||
|
||||
public string DuplicateBanSkillNum { get; private set; }
|
||||
|
||||
public DamageCutInfo(int amount, DamageType type, BattleCardBase ownerCard, string _duplicateBanSkillNum)
|
||||
{
|
||||
CutAmount = amount;
|
||||
Type = type;
|
||||
OwnerCard = ownerCard;
|
||||
DuplicateBanSkillNum = _duplicateBanSkillNum;
|
||||
}
|
||||
}
|
||||
44
SVSim.BattleEngine/Engine/DamageInfo.cs
Normal file
44
SVSim.BattleEngine/Engine/DamageInfo.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
public class DamageInfo
|
||||
{
|
||||
public const string DAMAGE_BATTLE = "battle";
|
||||
|
||||
public const string DAMAGE_UNIT = "unit";
|
||||
|
||||
public const string DAMAGE_SPELL = "spell";
|
||||
|
||||
public const string DAMAGE_FIELD = "field";
|
||||
|
||||
public SkillBase Skill { get; private set; }
|
||||
|
||||
public int Damage { get; private set; }
|
||||
|
||||
public string DamageKind
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Skill == null)
|
||||
{
|
||||
return "battle";
|
||||
}
|
||||
if (Skill.SkillPrm.ownerCard.IsUnit)
|
||||
{
|
||||
return "unit";
|
||||
}
|
||||
if (Skill.SkillPrm.ownerCard.IsSpell)
|
||||
{
|
||||
return "spell";
|
||||
}
|
||||
if (Skill.SkillPrm.ownerCard.IsField)
|
||||
{
|
||||
return "field";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public DamageInfo(SkillBase skill, int damage)
|
||||
{
|
||||
Skill = skill;
|
||||
Damage = damage;
|
||||
}
|
||||
}
|
||||
38
SVSim.BattleEngine/Engine/DamageModifier.cs
Normal file
38
SVSim.BattleEngine/Engine/DamageModifier.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class DamageModifier
|
||||
{
|
||||
public List<string> DamageType { get; protected set; }
|
||||
|
||||
public List<CardBasePrm.ClanType> DamageClan { get; protected set; }
|
||||
|
||||
public bool IsUseClass { get; protected set; }
|
||||
|
||||
public int OrderCount { get; protected set; }
|
||||
|
||||
public virtual int Calc(int damage)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public bool IsEffective(string damageType, CardBasePrm.ClanType damageClan, bool isUseClass)
|
||||
{
|
||||
if (isUseClass != IsUseClass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (IsUseClass)
|
||||
{
|
||||
if (DamageType.Contains(damageType) || DamageType.Contains("_OPT_NULL_"))
|
||||
{
|
||||
if (!DamageClan.Contains(damageClan))
|
||||
{
|
||||
return DamageClan.Contains(CardBasePrm.ClanType.NONE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
1381
SVSim.BattleEngine/Engine/DataMgr.cs
Normal file
1381
SVSim.BattleEngine/Engine/DataMgr.cs
Normal file
File diff suppressed because it is too large
Load Diff
577
SVSim.BattleEngine/Engine/DeckData.cs
Normal file
577
SVSim.BattleEngine/Engine/DeckData.cs
Normal file
@@ -0,0 +1,577 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
|
||||
public class DeckData
|
||||
{
|
||||
public enum UnusableReason
|
||||
{
|
||||
None,
|
||||
MaintenanceCard,
|
||||
FormatRestrictCard,
|
||||
TooLittleCards,
|
||||
TooMuchCards,
|
||||
NonPossessionCard,
|
||||
ShortageMainClassCards,
|
||||
ShortageSubClassCards,
|
||||
ShortageBothClassCards,
|
||||
Unknown
|
||||
}
|
||||
|
||||
public const int DEFAULT_DECK_ID_OFFSET = 90;
|
||||
|
||||
private const string LEADER_SKIN_ID_KEY = "leader_skin_id";
|
||||
|
||||
public const string CARD_ID_ARRAY_KEY = "card_id_array";
|
||||
|
||||
public const int DEFAULT_SLEEVE_ID = 3000011;
|
||||
|
||||
public const int UNSET_SKIN_ID = 0;
|
||||
|
||||
private int _deckId;
|
||||
|
||||
private string _deckName;
|
||||
|
||||
private bool _isComplete;
|
||||
|
||||
private int _deckClassId;
|
||||
|
||||
private int _deckSubClassId = 10;
|
||||
|
||||
private long _sleeveId;
|
||||
|
||||
private int _skinId;
|
||||
|
||||
private List<int> _cardIdList;
|
||||
|
||||
public Format Format { get; private set; }
|
||||
|
||||
public bool IsFormatRestrictError { get; set; }
|
||||
|
||||
public bool IsMaintenanceDeck { get; set; }
|
||||
|
||||
public Format DeckCopyFormat { get; private set; }
|
||||
|
||||
public bool IsRecommend { get; private set; }
|
||||
|
||||
public bool IsContainsNonPossessionCard { get; private set; }
|
||||
|
||||
public bool IsSkinRandom { get; set; }
|
||||
|
||||
public List<int> SelectRandomSkinIdList { get; set; }
|
||||
|
||||
public bool IsReplaceDeckSkin { get; set; }
|
||||
|
||||
public DeckAttributeType DeckAttributeType { get; private set; }
|
||||
|
||||
public DateTime? CreatedTime { get; private set; }
|
||||
|
||||
public string MyRotationId { get; set; }
|
||||
|
||||
public string RotationId { get; set; }
|
||||
|
||||
public bool IsRentalDeck
|
||||
{
|
||||
get
|
||||
{
|
||||
DeckAttributeType deckAttributeType = DeckAttributeType;
|
||||
if ((uint)(deckAttributeType - 2) <= 3u)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsOutOfRotationFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Format == Format.Rotation || Format == Format.PreRotation)
|
||||
{
|
||||
return DeckCopyFormat == Format.Unlimited;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public DeckData(Format format = Format.Max, DeckAttributeType deckAttributeType = DeckAttributeType.Invalid)
|
||||
{
|
||||
_skinId = 0;
|
||||
Format = format;
|
||||
DeckCopyFormat = format;
|
||||
DeckAttributeType = deckAttributeType;
|
||||
}
|
||||
|
||||
public DeckData Clone()
|
||||
{
|
||||
return (DeckData)MemberwiseClone();
|
||||
}
|
||||
|
||||
public void SetDeckID(int deckId)
|
||||
{
|
||||
_deckId = deckId;
|
||||
}
|
||||
|
||||
public void SetDeckName(string deckName)
|
||||
{
|
||||
_deckName = deckName;
|
||||
}
|
||||
|
||||
public void SetDeckIsComplete(bool isComplete)
|
||||
{
|
||||
_isComplete = isComplete;
|
||||
}
|
||||
|
||||
public void SetDeckClassID(int deckClassId)
|
||||
{
|
||||
_deckClassId = deckClassId;
|
||||
}
|
||||
|
||||
public void SetDeckSubClassID(int deckSubClassId)
|
||||
{
|
||||
_deckSubClassId = deckSubClassId;
|
||||
}
|
||||
|
||||
public void SetDeckSleeveID(long sleeveId)
|
||||
{
|
||||
_sleeveId = DataMgr.GetAbleSleeveId(sleeveId);
|
||||
}
|
||||
|
||||
public void SetCardIdList(List<int> cardIdList)
|
||||
{
|
||||
_cardIdList = cardIdList;
|
||||
}
|
||||
|
||||
public void SetEmptyCardIdList()
|
||||
{
|
||||
_cardIdList = new List<int>();
|
||||
}
|
||||
|
||||
public void SetSkinId(int skinId)
|
||||
{
|
||||
_skinId = skinId;
|
||||
}
|
||||
|
||||
public int GetDeckID()
|
||||
{
|
||||
return _deckId;
|
||||
}
|
||||
|
||||
public string GetDeckName()
|
||||
{
|
||||
return _deckName;
|
||||
}
|
||||
|
||||
public bool GetDeckIsComplete()
|
||||
{
|
||||
return _isComplete;
|
||||
}
|
||||
|
||||
private UnusableReason GetUnusableReason()
|
||||
{
|
||||
if (IsMaintenanceDeck)
|
||||
{
|
||||
return UnusableReason.MaintenanceCard;
|
||||
}
|
||||
if (IsFormatRestrictError)
|
||||
{
|
||||
return UnusableReason.FormatRestrictCard;
|
||||
}
|
||||
if (!_isComplete)
|
||||
{
|
||||
int num = ((_cardIdList != null) ? _cardIdList.Count : 0);
|
||||
if (num < 40)
|
||||
{
|
||||
return UnusableReason.TooLittleCards;
|
||||
}
|
||||
if (num > 40)
|
||||
{
|
||||
return UnusableReason.TooMuchCards;
|
||||
}
|
||||
if (Format == Format.Crossover && _cardIdList != null)
|
||||
{
|
||||
CardMaster cardMaster = CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format).CardMasterId);
|
||||
CardBasePrm.ClanType mainClass = (CardBasePrm.ClanType)_deckClassId;
|
||||
CardBasePrm.ClanType subClass = (CardBasePrm.ClanType)_deckSubClassId;
|
||||
bool num2 = _cardIdList.Count((int cardId) => cardMaster.GetCardParameterFromId(cardId).Clan == mainClass) < 24;
|
||||
bool flag = _cardIdList.Count((int cardId) => cardMaster.GetCardParameterFromId(cardId).Clan == subClass) < 9;
|
||||
if (num2)
|
||||
{
|
||||
if (!flag)
|
||||
{
|
||||
return UnusableReason.ShortageMainClassCards;
|
||||
}
|
||||
return UnusableReason.ShortageBothClassCards;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
return UnusableReason.ShortageSubClassCards;
|
||||
}
|
||||
}
|
||||
return UnusableReason.Unknown;
|
||||
}
|
||||
if (IsContainsNonPossessionCard)
|
||||
{
|
||||
return UnusableReason.NonPossessionCard;
|
||||
}
|
||||
return UnusableReason.None;
|
||||
}
|
||||
|
||||
public static bool ContainsNonPossessionCard(IEnumerable<int> cardIdList, IFormatBehavior formatBehavior)
|
||||
{
|
||||
return cardIdList.Distinct().Any((int id) => cardIdList.Count((int i) => i == id) > formatBehavior.GetPossessionCardNum(id, isIncludingSpotCard: true));
|
||||
}
|
||||
|
||||
public bool IsUsable(out UnusableReason reason, bool canUseNonPossessionCard = false)
|
||||
{
|
||||
reason = GetUnusableReason();
|
||||
if (canUseNonPossessionCard && reason == UnusableReason.NonPossessionCard)
|
||||
{
|
||||
reason = UnusableReason.None;
|
||||
}
|
||||
return reason == UnusableReason.None;
|
||||
}
|
||||
|
||||
public bool IsUsable(bool canUseNonPossessionCard = false)
|
||||
{
|
||||
UnusableReason reason;
|
||||
return IsUsable(out reason, canUseNonPossessionCard);
|
||||
}
|
||||
|
||||
public bool IsDisplayable()
|
||||
{
|
||||
if (!IsUsable())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Dictionary<int, int> cardNumDict = GetCardNumDict();
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
foreach (KeyValuePair<int, int> item in cardNumDict)
|
||||
{
|
||||
int possessionCardNum = dataMgr.GetPossessionCardNum(item.Key, isIncludingSpotCard: true);
|
||||
if (possessionCardNum == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (item.Value > possessionCardNum)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HasResurgentCard()
|
||||
{
|
||||
foreach (int cardId in _cardIdList)
|
||||
{
|
||||
if (CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format).CardMasterId).GetCardParameterFromId(cardId).IsResurgentCard)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int GetDeckClassID()
|
||||
{
|
||||
return _deckClassId;
|
||||
}
|
||||
|
||||
public int GetDeckSubClassID()
|
||||
{
|
||||
return _deckSubClassId;
|
||||
}
|
||||
|
||||
public long GetDeckSleeveID()
|
||||
{
|
||||
return DataMgr.GetAbleSleeveId(_sleeveId);
|
||||
}
|
||||
|
||||
public List<int> GetCardIdList()
|
||||
{
|
||||
return _cardIdList;
|
||||
}
|
||||
|
||||
public void ExtractMainClassAndNeutralCards()
|
||||
{
|
||||
CardMaster instance = CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format).CardMasterId);
|
||||
CardBasePrm.ClanType deckClassId = (CardBasePrm.ClanType)_deckClassId;
|
||||
List<int> list = new List<int>();
|
||||
foreach (int cardId in _cardIdList)
|
||||
{
|
||||
CardBasePrm.ClanType clan = instance.GetCardParameterFromId(cardId).Clan;
|
||||
if (clan == deckClassId || clan == CardBasePrm.ClanType.ALL)
|
||||
{
|
||||
list.Add(cardId);
|
||||
}
|
||||
}
|
||||
_cardIdList = list;
|
||||
}
|
||||
|
||||
public Dictionary<int, int> GetCardNumDict()
|
||||
{
|
||||
Dictionary<int, int> dictionary = new Dictionary<int, int>();
|
||||
if (IsNoCard())
|
||||
{
|
||||
return dictionary;
|
||||
}
|
||||
for (int i = 0; i < _cardIdList.Count; i++)
|
||||
{
|
||||
int key = _cardIdList[i];
|
||||
if (dictionary.ContainsKey(key))
|
||||
{
|
||||
dictionary[key]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary.Add(key, 1);
|
||||
}
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
public bool IsNoCard()
|
||||
{
|
||||
return _cardIdList == null;
|
||||
}
|
||||
|
||||
public bool IsDefaultDeck()
|
||||
{
|
||||
return IsDeckAttributeMatch(DeckAttributeType.DefaultDeck);
|
||||
}
|
||||
|
||||
public bool IsDeckAttributeMatch(DeckAttributeType deckAttributeType)
|
||||
{
|
||||
return deckAttributeType == DeckAttributeType;
|
||||
}
|
||||
|
||||
public int GetRawSkinId()
|
||||
{
|
||||
return _skinId;
|
||||
}
|
||||
|
||||
public int GetSkinId(bool isDefaultSkin = false)
|
||||
{
|
||||
if (isDefaultSkin)
|
||||
{
|
||||
return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(GetDeckClassID(), isCurrentChara: false)
|
||||
.skin_id;
|
||||
}
|
||||
if (_skinId == 0)
|
||||
{
|
||||
return GameMgr.GetIns().GetDataMgr().GetCharaPrmByClassId(GetDeckClassID())
|
||||
.skin_id;
|
||||
}
|
||||
return _skinId;
|
||||
}
|
||||
|
||||
private int GetJsonInt(JsonData deckData, string key, int defaultValue)
|
||||
{
|
||||
if (deckData.Keys.Contains(key))
|
||||
{
|
||||
return deckData[key].ToInt();
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
private string GetJsonString(JsonData deckData, string key, string defaultValue)
|
||||
{
|
||||
if (deckData.Keys.Contains(key))
|
||||
{
|
||||
return deckData[key].ToString();
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
private bool GetJsonBool(JsonData deckData, string key, bool defaultValue)
|
||||
{
|
||||
if (deckData.Keys.Contains(key))
|
||||
{
|
||||
return deckData[key].ToBoolean();
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void Initialize(JsonData deckData)
|
||||
{
|
||||
SetDeckID(GetJsonInt(deckData, "deck_no", 0));
|
||||
if (deckData.Keys.Contains("format"))
|
||||
{
|
||||
Format = Data.ParseApiFormat(deckData["format"].ToInt());
|
||||
}
|
||||
SetDeckName(deckData["deck_name"].ToString());
|
||||
SetDeckIsComplete(GetJsonBool(deckData, "is_complete_deck", defaultValue: true));
|
||||
IsContainsNonPossessionCard = GetJsonBool(deckData, "is_include_un_possession_card", defaultValue: false);
|
||||
SetDeckClassID(deckData["class_id"].ToInt());
|
||||
if (FormatBehaviorManager.GetDefaultBehaviour(Format).UseSubClass)
|
||||
{
|
||||
int valueOrDefault = deckData.GetValueOrDefault("sub_class_id", 10);
|
||||
_deckSubClassId = ((valueOrDefault == 0) ? 10 : valueOrDefault);
|
||||
}
|
||||
if (deckData.TryGetValue("sleeve_id", out var value))
|
||||
{
|
||||
SetDeckSleeveID(value.ToLong());
|
||||
}
|
||||
else
|
||||
{
|
||||
_sleeveId = 3000011L;
|
||||
}
|
||||
if (deckData.Keys.Contains("leader_skin_id"))
|
||||
{
|
||||
SetSkinId(deckData["leader_skin_id"].ToInt());
|
||||
}
|
||||
if (deckData.Keys.Contains("restricted_card_exists"))
|
||||
{
|
||||
IsFormatRestrictError = deckData["restricted_card_exists"].ToBoolean();
|
||||
}
|
||||
if (deckData.Keys.Contains("current_format"))
|
||||
{
|
||||
DeckCopyFormat = Data.ParseApiFormat(deckData["current_format"].ToInt());
|
||||
}
|
||||
else
|
||||
{
|
||||
DeckCopyFormat = Format;
|
||||
}
|
||||
if (deckData.Keys.Contains("is_recommend"))
|
||||
{
|
||||
IsRecommend = deckData["is_recommend"].ToInt() == 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsRecommend = false;
|
||||
}
|
||||
if (deckData.TryGetValue("create_deck_time", out var value2) && value2 != null)
|
||||
{
|
||||
CreatedTime = DateTime.Parse($"{value2}");
|
||||
}
|
||||
ParseCardIdList(deckData);
|
||||
MyRotationId = deckData.GetValueOrDefault("rotation_id", null);
|
||||
RotationId = MyRotationId;
|
||||
if (Data.MyRotationAllInfo.Get(MyRotationId) == null)
|
||||
{
|
||||
MyRotationId = null;
|
||||
}
|
||||
IsSkinRandom = deckData.GetValueOrDefault("is_random_leader_skin", 0) == 1;
|
||||
SelectRandomSkinIdList = new List<int>();
|
||||
if (deckData.Keys.Contains("leader_skin_id_list"))
|
||||
{
|
||||
JsonData jsonData = deckData["leader_skin_id_list"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
SelectRandomSkinIdList.Add(jsonData[i].ToInt());
|
||||
}
|
||||
SelectRandomSkinIdList.Sort();
|
||||
}
|
||||
MaintenanceCardCheack();
|
||||
}
|
||||
|
||||
public void ParseCardIdList(JsonData deckData)
|
||||
{
|
||||
JsonData jsonData = deckData["card_id_array"];
|
||||
List<int> cardIdList = null;
|
||||
int count = jsonData.Count;
|
||||
if (count > 0)
|
||||
{
|
||||
cardIdList = new List<int>();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
cardIdList.Add(jsonData[i].ToInt());
|
||||
}
|
||||
cardIdList = UIManager.GetInstance().getUIBase_CardManager().SortIDList(cardIdList, FormatBehaviorManager.GetDefaultBehaviour(Format).CardMasterId);
|
||||
}
|
||||
SetCardIdList(cardIdList);
|
||||
}
|
||||
|
||||
public void MaintenanceCardCheack()
|
||||
{
|
||||
IsMaintenanceDeck = false;
|
||||
if (_cardIdList != null)
|
||||
{
|
||||
IsMaintenanceDeck = _cardIdList.Any((int c) => GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(c));
|
||||
}
|
||||
}
|
||||
|
||||
public string GetMyRotationClassName()
|
||||
{
|
||||
MyRotationInfo info = Data.MyRotationAllInfo.Get(MyRotationId);
|
||||
return CreateMyRotationClassName(_deckClassId, info);
|
||||
}
|
||||
|
||||
public static string GetClassName(int classType, string rotationId)
|
||||
{
|
||||
MyRotationInfo myRotationInfo = Data.MyRotationAllInfo.Get(rotationId);
|
||||
if (myRotationInfo != null)
|
||||
{
|
||||
return CreateMyRotationClassName(classType, myRotationInfo);
|
||||
}
|
||||
return GameMgr.GetIns().GetDataMgr().GetClanNameByKey(classType);
|
||||
}
|
||||
|
||||
public static string CreateMyRotationClassName(int classType, MyRotationInfo info)
|
||||
{
|
||||
return Data.SystemText.Get("MyRotation_ID_02", GameMgr.GetIns().GetDataMgr().GetClanNameByKey(classType), info.LastPackText);
|
||||
}
|
||||
|
||||
public bool IsVisibleRandomIcon()
|
||||
{
|
||||
if (IsReplaceDeckSkin)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (IsSkinRandom)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (GameMgr.GetIns().GetDataMgr().GetClassPrm(GetDeckClassID())
|
||||
.IsRandomLeaderSkin)
|
||||
{
|
||||
return _skinId == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public MyRotationInfo GetMyRotationInfoFromCardList()
|
||||
{
|
||||
int num = int.MinValue;
|
||||
MyRotationInfo result = null;
|
||||
CardMaster instance = CardMaster.GetInstance(FormatBehaviorManager.GetDefaultBehaviour(Format.MyRotation).CardMasterId);
|
||||
foreach (int cardId in GetCardIdList())
|
||||
{
|
||||
CardParameter cardParameterFromId = instance.GetCardParameterFromId(cardId);
|
||||
MyRotationInfo myRotationInfoFromPack = GetMyRotationInfoFromPack(cardParameterFromId.CardSetId);
|
||||
if (myRotationInfoFromPack != null && int.Parse(myRotationInfoFromPack.Id) >= num)
|
||||
{
|
||||
result = myRotationInfoFromPack;
|
||||
num = int.Parse(myRotationInfoFromPack.Id);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public MyRotationInfo GetMyRotationInfoFromPack(string packId)
|
||||
{
|
||||
int num = int.MinValue;
|
||||
MyRotationInfo myRotationInfo = null;
|
||||
foreach (MyRotationInfo myRotationInfo2 in Data.MyRotationAllInfo.MyRotationInfoList)
|
||||
{
|
||||
if (!(packId != myRotationInfo2.LastPackId) && int.Parse(myRotationInfo2.Id) >= num)
|
||||
{
|
||||
num = int.Parse(myRotationInfo2.Id);
|
||||
myRotationInfo = myRotationInfo2;
|
||||
}
|
||||
}
|
||||
if (myRotationInfo == null)
|
||||
{
|
||||
if (GetDeckClassID() != 8)
|
||||
{
|
||||
return Data.MyRotationAllInfo.FirstPackInfo;
|
||||
}
|
||||
return Data.MyRotationAllInfo.FirstPackInfoNemesis;
|
||||
}
|
||||
return myRotationInfo;
|
||||
}
|
||||
}
|
||||
105
SVSim.BattleEngine/Engine/DetailMgr.cs
Normal file
105
SVSim.BattleEngine/Engine/DetailMgr.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class DetailMgr
|
||||
{
|
||||
public GameObject DetailNormal;
|
||||
|
||||
public LODGroup DetailNormalLodGroup;
|
||||
|
||||
public MeshRenderer DetailNormalBaseMesh;
|
||||
|
||||
public UILabel DetailNormalCostLabel;
|
||||
|
||||
public UILabel DetailNormalAtkLabel;
|
||||
|
||||
public UILabel DetailNormalLifeLabel;
|
||||
|
||||
public UILabel DetailNormalNameLabel;
|
||||
|
||||
public GameObject DetailSkill;
|
||||
|
||||
public MeshRenderer DetailSkillBaseMesh;
|
||||
|
||||
public LODGroup DetailSkillLodGroup;
|
||||
|
||||
public UILabel DetailSkillCostLabel;
|
||||
|
||||
public UILabel DetailSkillNameLabel;
|
||||
|
||||
public GameObject DetailField;
|
||||
|
||||
public MeshRenderer DetailFieldBaseMesh;
|
||||
|
||||
public LODGroup DetailFieldLodGroup;
|
||||
|
||||
public UILabel DetailFieldCostLabel;
|
||||
|
||||
public UILabel DetailFieldNameLabel;
|
||||
|
||||
public GameObject DetailPanel;
|
||||
|
||||
public IDetailPanelControl DetailPanelControl;
|
||||
|
||||
public GameObject SubDetailPanel;
|
||||
|
||||
public DetailPanelControl SubDetailPanelControl;
|
||||
|
||||
public DetailMgr()
|
||||
{
|
||||
DetailNormal = null;
|
||||
DetailNormalLodGroup = null;
|
||||
DetailNormalBaseMesh = null;
|
||||
DetailNormalCostLabel = null;
|
||||
DetailNormalAtkLabel = null;
|
||||
DetailNormalLifeLabel = null;
|
||||
DetailNormalNameLabel = null;
|
||||
DetailSkill = null;
|
||||
DetailSkillBaseMesh = null;
|
||||
DetailSkillLodGroup = null;
|
||||
DetailSkillCostLabel = null;
|
||||
DetailSkillNameLabel = null;
|
||||
DetailField = null;
|
||||
DetailFieldBaseMesh = null;
|
||||
DetailFieldLodGroup = null;
|
||||
DetailFieldCostLabel = null;
|
||||
DetailFieldNameLabel = null;
|
||||
DetailPanel = null;
|
||||
DetailPanelControl = null;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DetailPanel = null;
|
||||
DetailPanelControl = null;
|
||||
}
|
||||
|
||||
public static Camera GetCamera()
|
||||
{
|
||||
return UIManager.GetInstance().UIRootLoadingCamera;
|
||||
}
|
||||
|
||||
public void HideDetailPanel(BattleCardBase card)
|
||||
{
|
||||
if (card.IsSpell)
|
||||
{
|
||||
DetailSkill.SetActive(value: false);
|
||||
}
|
||||
else if (card.IsField)
|
||||
{
|
||||
DetailField.SetActive(value: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DetailNormal.SetActive(value: false);
|
||||
}
|
||||
DetailPanelControl.Hide();
|
||||
DetailPanelControl.SetScreenPosition(right: false);
|
||||
card = null;
|
||||
}
|
||||
|
||||
public void HideSubDetailPanel(BattleCardBase card)
|
||||
{
|
||||
SubDetailPanelControl.Hide();
|
||||
SubDetailPanelControl.SetScreenPosition(right: false);
|
||||
}
|
||||
}
|
||||
2261
SVSim.BattleEngine/Engine/DetailPanelControl.cs
Normal file
2261
SVSim.BattleEngine/Engine/DetailPanelControl.cs
Normal file
File diff suppressed because it is too large
Load Diff
1689
SVSim.BattleEngine/Engine/DialogBase.cs
Normal file
1689
SVSim.BattleEngine/Engine/DialogBase.cs
Normal file
File diff suppressed because it is too large
Load Diff
48
SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs
Normal file
48
SVSim.BattleEngine/Engine/DisconnectToDispChecker.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Cute;
|
||||
|
||||
public class DisconnectToDispChecker : NetworkBattleIntervalCheckerBase
|
||||
{
|
||||
private const float DISP_DISCONNECT_INTERVAL = 16f;
|
||||
|
||||
public bool isDisp;
|
||||
|
||||
public event Action OnDisp;
|
||||
|
||||
public event Action OnErase;
|
||||
|
||||
public void EraseDisp()
|
||||
{
|
||||
if (isDisp)
|
||||
{
|
||||
this.OnErase.Call();
|
||||
isDisp = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void IntervalCheck()
|
||||
{
|
||||
base.IntervalCheck();
|
||||
if ((float)NetworkUtility.GetTimeSpanSecond(base.startTick) >= 16f)
|
||||
{
|
||||
DisconnectDisp();
|
||||
}
|
||||
}
|
||||
|
||||
private void DisconnectDisp()
|
||||
{
|
||||
this.OnDisp.Call();
|
||||
isDisp = true;
|
||||
StopChecker();
|
||||
}
|
||||
|
||||
public void DebugDisconnectDisp(int cardId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void FinishChecker()
|
||||
{
|
||||
base.FinishChecker();
|
||||
EraseDisp();
|
||||
}
|
||||
}
|
||||
114
SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs
Normal file
114
SVSim.BattleEngine/Engine/DisconnectToLoseChecker.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public class DisconnectToLoseChecker : NetworkBattleIntervalCheckerBase
|
||||
{
|
||||
private const float DISCONNECT_LOSE_INTERVAL = 125f;
|
||||
|
||||
private const float DISCONNECT_CHECK_INTERVAL = 65f;
|
||||
|
||||
private const float DISCONNECT_INTERVAL = 10f;
|
||||
|
||||
private const float SOCKET_REPLACE_INTERVAL = 50f;
|
||||
|
||||
private bool _isAlreadyTriedSocketReplace;
|
||||
|
||||
private bool _isSocketOpenDisconnectLog;
|
||||
|
||||
public event Action OnDisconnectLose;
|
||||
|
||||
public event Action OnBeforeDisconnectLose;
|
||||
|
||||
public event Action OnDisconnectCheck;
|
||||
|
||||
public bool IsDisconnect()
|
||||
{
|
||||
if (!base.isStop && ((float)GetDisconnectTime() >= 10f || Application.internetReachability == NetworkReachability.NotReachable))
|
||||
{
|
||||
LocalLog.SetDisconnectLog("IsDisconnect time" + GetDisconnectTime() + "internetReachability" + Application.internetReachability);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsSelfDisconnectLose()
|
||||
{
|
||||
if (IsSelfDisConnectOnTimeout() || ToolboxGame.RealTimeNetworkAgent.IsReceiveSelfDisconnect)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsSelfDisConnectOnTimeout()
|
||||
{
|
||||
if ((float)GetDisconnectTime() >= 125f)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsSelfDisconnectLoseCheck()
|
||||
{
|
||||
if ((float)GetDisconnectTime() >= 65f)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void StopChecker()
|
||||
{
|
||||
base.StopChecker();
|
||||
}
|
||||
|
||||
public override void StartChecker(string log = "")
|
||||
{
|
||||
if (!IsSelfDisconnectLose())
|
||||
{
|
||||
if (IsSelfDisconnectLoseCheck())
|
||||
{
|
||||
this.OnDisconnectCheck.Call();
|
||||
}
|
||||
base.StartChecker();
|
||||
}
|
||||
if (_isAlreadyTriedSocketReplace)
|
||||
{
|
||||
if (this.OnBeforeDisconnectLose != null)
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("SocketReplace Success");
|
||||
}
|
||||
_isAlreadyTriedSocketReplace = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void IntervalCheck()
|
||||
{
|
||||
base.IntervalCheck();
|
||||
if (!_isAlreadyTriedSocketReplace && (float)GetDisconnectTime() >= 50f)
|
||||
{
|
||||
if (!_isSocketOpenDisconnectLog && ToolboxGame.RealTimeNetworkAgent != null && ToolboxGame.RealTimeNetworkAgent.IsOpen())
|
||||
{
|
||||
_isSocketOpenDisconnectLog = true;
|
||||
}
|
||||
_isAlreadyTriedSocketReplace = true;
|
||||
if (this.OnBeforeDisconnectLose != null)
|
||||
{
|
||||
this.OnBeforeDisconnectLose.Call();
|
||||
}
|
||||
}
|
||||
if (IsSelfDisconnectLose())
|
||||
{
|
||||
this.OnDisconnectLose.Call();
|
||||
StopChecker();
|
||||
}
|
||||
}
|
||||
|
||||
public int GetDisconnectTime()
|
||||
{
|
||||
return NetworkUtility.GetTimeSpanSecond(base.startTick);
|
||||
}
|
||||
}
|
||||
34
SVSim.BattleEngine/Engine/EffectBattle.cs
Normal file
34
SVSim.BattleEngine/Engine/EffectBattle.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using CriWare;
|
||||
using UnityEngine;
|
||||
|
||||
public class EffectBattle : EffectIdx
|
||||
{
|
||||
[HideInInspector]
|
||||
public EffectMgr.MoveType moveType;
|
||||
|
||||
[HideInInspector]
|
||||
public CriAtomSource ECriAtomSource;
|
||||
|
||||
private Vector3 FromPos;
|
||||
|
||||
public Animation AnimationObj;
|
||||
|
||||
[HideInInspector]
|
||||
public EffectMgr.EngineType engineType { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
public void PlaySummon(BattleCardBase card, Vector3 p0)
|
||||
{
|
||||
FromPos = p0;
|
||||
base.gameObject.transform.position = FromPos;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (engineType == EffectMgr.EngineType.SOLID && AnimationObj == null)
|
||||
{
|
||||
AnimationObj = base.transform.GetComponentInChildren<Animation>();
|
||||
}
|
||||
}
|
||||
}
|
||||
5
SVSim.BattleEngine/Engine/EffectIdx.cs
Normal file
5
SVSim.BattleEngine/Engine/EffectIdx.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class EffectIdx : MonoBehaviour
|
||||
{
|
||||
}
|
||||
688
SVSim.BattleEngine/Engine/EventDelegate.cs
Normal file
688
SVSim.BattleEngine/Engine/EventDelegate.cs
Normal file
@@ -0,0 +1,688 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class EventDelegate
|
||||
{
|
||||
[Serializable]
|
||||
public class Parameter
|
||||
{
|
||||
public UnityEngine.Object obj;
|
||||
|
||||
public string field;
|
||||
|
||||
[NonSerialized]
|
||||
private object mValue;
|
||||
|
||||
[NonSerialized]
|
||||
public Type expectedType = typeof(void);
|
||||
|
||||
[NonSerialized]
|
||||
public bool cached;
|
||||
|
||||
[NonSerialized]
|
||||
public PropertyInfo propInfo;
|
||||
|
||||
[NonSerialized]
|
||||
public FieldInfo fieldInfo;
|
||||
|
||||
public object value
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mValue != null)
|
||||
{
|
||||
return mValue;
|
||||
}
|
||||
if (!cached)
|
||||
{
|
||||
cached = true;
|
||||
fieldInfo = null;
|
||||
propInfo = null;
|
||||
if (obj != null && !string.IsNullOrEmpty(field))
|
||||
{
|
||||
Type type = obj.GetType();
|
||||
propInfo = type.GetProperty(field);
|
||||
if (propInfo == null)
|
||||
{
|
||||
fieldInfo = type.GetField(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (propInfo != null)
|
||||
{
|
||||
return propInfo.GetValue(obj, null);
|
||||
}
|
||||
if (fieldInfo != null)
|
||||
{
|
||||
return fieldInfo.GetValue(obj);
|
||||
}
|
||||
if (obj != null)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
if (expectedType != null && expectedType.IsValueType)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Convert.ChangeType(null, expectedType);
|
||||
}
|
||||
set
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Type type
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mValue != null)
|
||||
{
|
||||
return mValue.GetType();
|
||||
}
|
||||
if (obj == null)
|
||||
{
|
||||
return typeof(void);
|
||||
}
|
||||
return obj.GetType();
|
||||
}
|
||||
}
|
||||
|
||||
public Parameter()
|
||||
{
|
||||
}
|
||||
|
||||
public Parameter(UnityEngine.Object obj, string field)
|
||||
{
|
||||
this.obj = obj;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public Parameter(object val)
|
||||
{
|
||||
mValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void Callback();
|
||||
|
||||
[SerializeField]
|
||||
private MonoBehaviour mTarget;
|
||||
|
||||
[SerializeField]
|
||||
private string mMethodName;
|
||||
|
||||
[SerializeField]
|
||||
private Parameter[] mParameters;
|
||||
|
||||
public bool oneShot;
|
||||
|
||||
[NonSerialized]
|
||||
private Callback mCachedCallback;
|
||||
|
||||
[NonSerialized]
|
||||
private bool mRawDelegate;
|
||||
|
||||
[NonSerialized]
|
||||
private bool mCached;
|
||||
|
||||
[NonSerialized]
|
||||
private MethodInfo mMethod;
|
||||
|
||||
[NonSerialized]
|
||||
private ParameterInfo[] mParameterInfos;
|
||||
|
||||
[NonSerialized]
|
||||
private object[] mArgs;
|
||||
|
||||
private static int s_Hash = "EventDelegate".GetHashCode();
|
||||
|
||||
public MonoBehaviour target
|
||||
{
|
||||
get
|
||||
{
|
||||
return mTarget;
|
||||
}
|
||||
set
|
||||
{
|
||||
mTarget = value;
|
||||
mCachedCallback = null;
|
||||
mRawDelegate = false;
|
||||
mCached = false;
|
||||
mMethod = null;
|
||||
mParameterInfos = null;
|
||||
mParameters = null;
|
||||
}
|
||||
}
|
||||
|
||||
public string methodName
|
||||
{
|
||||
get
|
||||
{
|
||||
return mMethodName;
|
||||
}
|
||||
set
|
||||
{
|
||||
mMethodName = value;
|
||||
mCachedCallback = null;
|
||||
mRawDelegate = false;
|
||||
mCached = false;
|
||||
mMethod = null;
|
||||
mParameterInfos = null;
|
||||
mParameters = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Parameter[] parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!mCached)
|
||||
{
|
||||
Cache();
|
||||
}
|
||||
return mParameters;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isValid
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!mCached)
|
||||
{
|
||||
Cache();
|
||||
}
|
||||
if (!mRawDelegate || mCachedCallback == null)
|
||||
{
|
||||
if (mTarget != null)
|
||||
{
|
||||
return !string.IsNullOrEmpty(mMethodName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!mCached)
|
||||
{
|
||||
Cache();
|
||||
}
|
||||
if (mRawDelegate && mCachedCallback != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mTarget == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
MonoBehaviour monoBehaviour = mTarget;
|
||||
if (!(monoBehaviour == null))
|
||||
{
|
||||
return monoBehaviour.enabled;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public EventDelegate()
|
||||
{
|
||||
}
|
||||
|
||||
public EventDelegate(Callback call)
|
||||
{
|
||||
Set(call);
|
||||
}
|
||||
|
||||
public EventDelegate(MonoBehaviour target, string methodName)
|
||||
{
|
||||
Set(target, methodName);
|
||||
}
|
||||
|
||||
private static string GetMethodName(Callback callback)
|
||||
{
|
||||
return callback.Method.Name;
|
||||
}
|
||||
|
||||
private static bool IsValid(Callback callback)
|
||||
{
|
||||
if (callback != null)
|
||||
{
|
||||
return callback.Method != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return !isValid;
|
||||
}
|
||||
if (obj is Callback)
|
||||
{
|
||||
Callback callback = obj as Callback;
|
||||
if (callback.Equals(mCachedCallback))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
MonoBehaviour monoBehaviour = callback.Target as MonoBehaviour;
|
||||
if (mTarget == monoBehaviour)
|
||||
{
|
||||
return string.Equals(mMethodName, GetMethodName(callback));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (obj is EventDelegate)
|
||||
{
|
||||
EventDelegate eventDelegate = obj as EventDelegate;
|
||||
if (mTarget == eventDelegate.mTarget)
|
||||
{
|
||||
return string.Equals(mMethodName, eventDelegate.mMethodName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return s_Hash;
|
||||
}
|
||||
|
||||
private void Set(Callback call)
|
||||
{
|
||||
Clear();
|
||||
if (call != null && IsValid(call))
|
||||
{
|
||||
mTarget = call.Target as MonoBehaviour;
|
||||
if (mTarget == null)
|
||||
{
|
||||
mRawDelegate = true;
|
||||
mCachedCallback = call;
|
||||
mMethodName = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
mMethodName = GetMethodName(call);
|
||||
mRawDelegate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(MonoBehaviour target, string methodName)
|
||||
{
|
||||
Clear();
|
||||
mTarget = target;
|
||||
mMethodName = methodName;
|
||||
}
|
||||
|
||||
private void Cache()
|
||||
{
|
||||
mCached = true;
|
||||
if (mRawDelegate || (mCachedCallback != null && !(mCachedCallback.Target as MonoBehaviour != mTarget) && !(GetMethodName(mCachedCallback) != mMethodName)) || !(mTarget != null) || string.IsNullOrEmpty(mMethodName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Type type = mTarget.GetType();
|
||||
mMethod = null;
|
||||
while (type != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
mMethod = type.GetMethod(mMethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
if (mMethod != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
type = type.BaseType;
|
||||
}
|
||||
if (mMethod == null)
|
||||
{
|
||||
Debug.LogError("Could not find method '" + mMethodName + "' on " + mTarget.GetType(), mTarget);
|
||||
return;
|
||||
}
|
||||
if (mMethod.ReturnType != typeof(void))
|
||||
{
|
||||
Debug.LogError(mTarget.GetType()?.ToString() + "." + mMethodName + " must have a 'void' return type.", mTarget);
|
||||
return;
|
||||
}
|
||||
mParameterInfos = mMethod.GetParameters();
|
||||
if (mParameterInfos.Length == 0)
|
||||
{
|
||||
mCachedCallback = (Callback)Delegate.CreateDelegate(typeof(Callback), mTarget, mMethodName);
|
||||
mArgs = null;
|
||||
mParameters = null;
|
||||
return;
|
||||
}
|
||||
mCachedCallback = null;
|
||||
if (mParameters == null || mParameters.Length != mParameterInfos.Length)
|
||||
{
|
||||
mParameters = new Parameter[mParameterInfos.Length];
|
||||
int i = 0;
|
||||
for (int num = mParameters.Length; i < num; i++)
|
||||
{
|
||||
mParameters[i] = new Parameter();
|
||||
}
|
||||
}
|
||||
int j = 0;
|
||||
for (int num2 = mParameters.Length; j < num2; j++)
|
||||
{
|
||||
mParameters[j].expectedType = mParameterInfos[j].ParameterType;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Execute()
|
||||
{
|
||||
if (!mCached)
|
||||
{
|
||||
Cache();
|
||||
}
|
||||
if (mCachedCallback != null)
|
||||
{
|
||||
mCachedCallback();
|
||||
return true;
|
||||
}
|
||||
if (mMethod != null)
|
||||
{
|
||||
if (mParameters == null || mParameters.Length == 0)
|
||||
{
|
||||
mMethod.Invoke(mTarget, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mArgs == null || mArgs.Length != mParameters.Length)
|
||||
{
|
||||
mArgs = new object[mParameters.Length];
|
||||
}
|
||||
int i = 0;
|
||||
for (int num = mParameters.Length; i < num; i++)
|
||||
{
|
||||
mArgs[i] = mParameters[i].value;
|
||||
}
|
||||
try
|
||||
{
|
||||
mMethod.Invoke(mTarget, mArgs);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
string text = "Error calling ";
|
||||
text = ((!(mTarget == null)) ? (text + mTarget.GetType()?.ToString() + "." + mMethod.Name) : (text + mMethod.Name));
|
||||
text = text + ": " + ex.Message;
|
||||
text += "\n Expected: ";
|
||||
if (mParameterInfos.Length == 0)
|
||||
{
|
||||
text += "no arguments";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += mParameterInfos[0];
|
||||
for (int j = 1; j < mParameterInfos.Length; j++)
|
||||
{
|
||||
text = text + ", " + mParameterInfos[j].ParameterType;
|
||||
}
|
||||
}
|
||||
text += "\n Received: ";
|
||||
if (mParameters.Length == 0)
|
||||
{
|
||||
text += "no arguments";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += mParameters[0].type;
|
||||
for (int k = 1; k < mParameters.Length; k++)
|
||||
{
|
||||
text = text + ", " + mParameters[k].type;
|
||||
}
|
||||
}
|
||||
text += "\n";
|
||||
Debug.LogError(text);
|
||||
}
|
||||
int l = 0;
|
||||
for (int num2 = mArgs.Length; l < num2; l++)
|
||||
{
|
||||
if (mParameterInfos[l].IsIn || mParameterInfos[l].IsOut)
|
||||
{
|
||||
mParameters[l].value = mArgs[l];
|
||||
}
|
||||
mArgs[l] = null;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
mTarget = null;
|
||||
mMethodName = null;
|
||||
mRawDelegate = false;
|
||||
mCachedCallback = null;
|
||||
mParameters = null;
|
||||
mCached = false;
|
||||
mMethod = null;
|
||||
mParameterInfos = null;
|
||||
mArgs = null;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (mTarget != null)
|
||||
{
|
||||
string text = mTarget.GetType().ToString();
|
||||
int num = text.LastIndexOf('.');
|
||||
if (num > 0)
|
||||
{
|
||||
text = text.Substring(num + 1);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(methodName))
|
||||
{
|
||||
return text + "/" + methodName;
|
||||
}
|
||||
return text + "/[delegate]";
|
||||
}
|
||||
if (!mRawDelegate)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return "[delegate]";
|
||||
}
|
||||
|
||||
public static void Execute(List<EventDelegate> list)
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num = 0;
|
||||
while (num < list.Count)
|
||||
{
|
||||
EventDelegate eventDelegate = list[num];
|
||||
if (eventDelegate != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
eventDelegate.Execute();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
Debug.LogError(ex.InnerException.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(ex.Message);
|
||||
}
|
||||
}
|
||||
if (num >= list.Count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (list[num] != eventDelegate)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (eventDelegate.oneShot)
|
||||
{
|
||||
list.RemoveAt(num);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValid(List<EventDelegate> list)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = list.Count; i < count; i++)
|
||||
{
|
||||
EventDelegate eventDelegate = list[i];
|
||||
if (eventDelegate != null && eventDelegate.isValid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EventDelegate Set(List<EventDelegate> list, Callback callback)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
EventDelegate eventDelegate = new EventDelegate(callback);
|
||||
list.Clear();
|
||||
list.Add(eventDelegate);
|
||||
return eventDelegate;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void Set(List<EventDelegate> list, EventDelegate del)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
list.Clear();
|
||||
list.Add(del);
|
||||
}
|
||||
}
|
||||
|
||||
public static EventDelegate Add(List<EventDelegate> list, Callback callback)
|
||||
{
|
||||
return Add(list, callback, oneShot: false);
|
||||
}
|
||||
|
||||
public static EventDelegate Add(List<EventDelegate> list, Callback callback, bool oneShot)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = list.Count; i < count; i++)
|
||||
{
|
||||
EventDelegate eventDelegate = list[i];
|
||||
if (eventDelegate != null && eventDelegate.Equals(callback))
|
||||
{
|
||||
return eventDelegate;
|
||||
}
|
||||
}
|
||||
EventDelegate eventDelegate2 = new EventDelegate(callback);
|
||||
eventDelegate2.oneShot = oneShot;
|
||||
list.Add(eventDelegate2);
|
||||
return eventDelegate2;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void Add(List<EventDelegate> list, EventDelegate ev)
|
||||
{
|
||||
Add(list, ev, ev.oneShot);
|
||||
}
|
||||
|
||||
public static void Add(List<EventDelegate> list, EventDelegate ev, bool oneShot)
|
||||
{
|
||||
if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName))
|
||||
{
|
||||
Add(list, ev.mCachedCallback, oneShot);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int i = 0;
|
||||
for (int count = list.Count; i < count; i++)
|
||||
{
|
||||
EventDelegate eventDelegate = list[i];
|
||||
if (eventDelegate != null && eventDelegate.Equals(ev))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
EventDelegate eventDelegate2 = new EventDelegate(ev.target, ev.methodName);
|
||||
eventDelegate2.oneShot = oneShot;
|
||||
if (ev.mParameters != null && ev.mParameters.Length != 0)
|
||||
{
|
||||
eventDelegate2.mParameters = new Parameter[ev.mParameters.Length];
|
||||
for (int j = 0; j < ev.mParameters.Length; j++)
|
||||
{
|
||||
eventDelegate2.mParameters[j] = ev.mParameters[j];
|
||||
}
|
||||
}
|
||||
list.Add(eventDelegate2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Remove(List<EventDelegate> list, Callback callback)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = list.Count; i < count; i++)
|
||||
{
|
||||
EventDelegate eventDelegate = list[i];
|
||||
if (eventDelegate != null && eventDelegate.Equals(callback))
|
||||
{
|
||||
list.RemoveAt(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool Remove(List<EventDelegate> list, EventDelegate ev)
|
||||
{
|
||||
if (list != null)
|
||||
{
|
||||
int i = 0;
|
||||
for (int count = list.Count; i < count; i++)
|
||||
{
|
||||
EventDelegate eventDelegate = list[i];
|
||||
if (eventDelegate != null && eventDelegate.Equals(ev))
|
||||
{
|
||||
list.RemoveAt(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
182
SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs
Normal file
182
SVSim.BattleEngine/Engine/ExecutionInfoCreatorBase.cs
Normal file
@@ -0,0 +1,182 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
using Wizard.Battle;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class ExecutionInfoCreatorBase
|
||||
{
|
||||
protected SkillBase _skill;
|
||||
|
||||
public ExecutionInfoCreatorBase(SkillBase skill)
|
||||
{
|
||||
_skill = skill;
|
||||
}
|
||||
|
||||
public virtual bool IsSkipTargetAiSelect()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CheckCondition(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isPrePlay, bool isSkipTargetAiSelect = false)
|
||||
{
|
||||
return _skill.ConditionFilterCollection.Filtering(playerInfoPair, _skill.SkillPrm.ownerCard, option, _skill.OptionValue, isPrePlay, _skill, isSkipTargetAiSelect);
|
||||
}
|
||||
|
||||
public virtual bool CheckScanCondition(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isPrePlay)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool VisualCheckCondition(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isPrePlay)
|
||||
{
|
||||
return _skill.ConditionFilterCollection.Filtering(playerInfoPair, _skill.SkillPrm.ownerCard, option, _skill.OptionValue, isPrePlay, _skill);
|
||||
}
|
||||
|
||||
public virtual IEnumerable<BattleCardBase> CalcApplyTargets(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, ref int targetCount, bool isCheckInHand = false)
|
||||
{
|
||||
if (_skill.ApplySelectFilter is SkillRandomSelectFilter skillRandomSelectFilter)
|
||||
{
|
||||
targetCount = skillRandomSelectFilter.CalcCount(_skill.OptionValue);
|
||||
}
|
||||
if (option.SelectedCards.Count < 0 || !option.SelectedCards.Any((SkillConditionCheckerOption.SkillAndSelectTarget s) => s.SelectSkill == _skill && s.SelectCard != null))
|
||||
{
|
||||
IEnumerable<BattleCardBase> selectableCards = _skill.GetSelectableCards(playerInfoPair, option);
|
||||
return _skill.ApplySelectFilter.Filtering(selectableCards, _skill.OptionValue, option);
|
||||
}
|
||||
return IfNeededSelectCardCheck(playerInfoPair, option);
|
||||
}
|
||||
|
||||
protected List<BattleCardBase> IfNeededSelectCardCheck(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option)
|
||||
{
|
||||
List<IReadOnlyBattleCardInfo> target = _skill.FilteringByTargetFilter(playerInfoPair, option).ToList();
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
int i;
|
||||
for (i = 0; i < target.Count; i++)
|
||||
{
|
||||
if (option.SelectedCards.Count > 0 && option.SelectedCards.Any((SkillConditionCheckerOption.SkillAndSelectTarget s) => s.SelectSkill == _skill && s.SelectCard == target[i]))
|
||||
{
|
||||
list.Add((BattleCardBase)target[i]);
|
||||
}
|
||||
}
|
||||
if (option.SelectedCards.Count == 0)
|
||||
{
|
||||
return new List<BattleCardBase>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public virtual VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>> FixedSkillApplyTarget(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, ref int targetCount)
|
||||
{
|
||||
IEnumerable<BattleCardBase> source = CalcApplyTargets(playerInfoPair, option, ref targetCount);
|
||||
VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>> vfxWith = NotIndependentCardFiltering(source.ToList());
|
||||
return new VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>>(vfxWith.Vfx, SkillAllowTargetFiltering(vfxWith.Value_1), vfxWith.Value_2);
|
||||
}
|
||||
|
||||
public virtual List<BattleCardBase> GetSelectableCards(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool isSkipForceSelect = false, List<BattleCardBase> selectedCards = null)
|
||||
{
|
||||
if (_skill.IsWhenPlaySkill && ((_skill.SkillPrm.ownerCard.IsUnit && _skill.SkillPrm.selfBattlePlayer.Class.SkillApplyInformation.IsCantActivateFanfareUnit) || (_skill.SkillPrm.ownerCard.IsField && _skill.SkillPrm.selfBattlePlayer.Class.SkillApplyInformation.IsCantActivateFanfareField)))
|
||||
{
|
||||
return new List<BattleCardBase>();
|
||||
}
|
||||
if (_skill.IsChoiceType)
|
||||
{
|
||||
IEnumerable<int> enumerable = SkillOptionValue.ParseOptionTokenID(_skill.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.card_id, "_OPT_NULL_"));
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
int num = (_skill.SkillPrm.ownerCard.BaseParameter.IsFoil ? 1 : 0);
|
||||
{
|
||||
foreach (int item2 in enumerable)
|
||||
{
|
||||
BattleCardBase item = _skill.SkillPrm.selfBattlePlayer.CreateVirtualCard(item2 + num, item2 + num);
|
||||
list.Add(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
List<IReadOnlyBattleCardInfo> list2 = _skill.ApplyFilterCollection.Filtering(playerInfoPair, option, _skill.OptionValue);
|
||||
if (selectedCards != null && selectedCards.Count > 0)
|
||||
{
|
||||
list2 = list2.Where((IReadOnlyBattleCardInfo c) => !selectedCards.Contains(c)).ToList();
|
||||
}
|
||||
List<IReadOnlyBattleCardInfo> list3 = _skill.FilteringSneakTarget(list2).ToList();
|
||||
if (!isSkipForceSelect)
|
||||
{
|
||||
list3 = _skill.FilteringForceSelectTargets(list3).ToList();
|
||||
}
|
||||
return list3.Cast<BattleCardBase>().ToList();
|
||||
}
|
||||
|
||||
protected virtual VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>> NotIndependentCardFiltering(List<BattleCardBase> cards)
|
||||
{
|
||||
bool num = _skill is Skill_powerup || _skill is Skill_power_down || _skill is Skill_damage || _skill is Skill_summon_card || _skill is Skill_summon_token || _skill is Skill_token_draw || _skill is Skill_update_deck || _skill is Skill_invoke_skill;
|
||||
bool flag = _skill.IsAllResidentTiming && cards.Count == 1 && cards.Contains(_skill.SkillPrm.ownerCard);
|
||||
if (num || flag)
|
||||
{
|
||||
return new VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>>(NullVfx.GetInstance(), cards, new Dictionary<int, BattleCardBase>());
|
||||
}
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
Dictionary<int, BattleCardBase> dictionary = new Dictionary<int, BattleCardBase>();
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
if (cards[i].SkillApplyInformation.IsIndependent)
|
||||
{
|
||||
if (!(_skill is Skill_select) && !(_skill is Skill_copy_skill))
|
||||
{
|
||||
dictionary.Add(i, cards[i]);
|
||||
sequentialVfxPlayer.Register(new OneShotHeavenlyAegisPlayVfx(cards[i].BattleCardView));
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary.Add(i, cards[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(cards[i]);
|
||||
}
|
||||
}
|
||||
return new VfxWith<List<BattleCardBase>, Dictionary<int, BattleCardBase>>(sequentialVfxPlayer, list, dictionary);
|
||||
}
|
||||
|
||||
protected virtual List<BattleCardBase> SkillAllowTargetFiltering(List<BattleCardBase> cards)
|
||||
{
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
if (!_skill.IsAllowDestroyTarget)
|
||||
{
|
||||
for (int i = 0; i < cards.Count; i++)
|
||||
{
|
||||
if (!cards[i].IsDead)
|
||||
{
|
||||
list.Add(cards[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list = cards;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
protected bool IsSkipTargetSkill(SkillBase skill)
|
||||
{
|
||||
if (skill.SkillPrm.ownerCard.IsPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!(skill is Skill_powerup) && !(skill is Skill_cost_change))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!skill.IsUserSelectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!(skill.ApplyingTargetFilter is SkillTargetHandFilter) && !(skill.ApplyingTargetFilter is SkillTargetHandOtherSelfFilter) && !skill.ApplyAndFilter.Any((ApplySkillTargetFilterCollection f) => f.TargetFilter is SkillTargetHandFilter || f.TargetFilter is SkillTargetHandOtherSelfFilter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
1201
SVSim.BattleEngine/Engine/FilterController.cs
Normal file
1201
SVSim.BattleEngine/Engine/FilterController.cs
Normal file
File diff suppressed because it is too large
Load Diff
65
SVSim.BattleEngine/Engine/FinishTaskBase.cs
Normal file
65
SVSim.BattleEngine/Engine/FinishTaskBase.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
using Wizard.Battle.Recovery;
|
||||
|
||||
public class FinishTaskBase : BaseTask
|
||||
{
|
||||
protected int classId;
|
||||
|
||||
protected const string data_str = "data";
|
||||
|
||||
public bool IsResponseDataExist(JsonData response)
|
||||
{
|
||||
JsonData jsonData = response["data"];
|
||||
if (jsonData == null || jsonData.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public BattleFinishParam SettingFinishBattleParameter(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire)
|
||||
{
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
BattleManagerBase ins = BattleManagerBase.GetIns();
|
||||
classId = class_id;
|
||||
BattleFinishParam battleFinishParam = CreateBattleFinishParam(class_id, total_turn, evolve_count, enemy_evolve_count, battle_result, is_retire);
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SELF_DISCONNECT_OPEN_STATUS_TO_REPLACE_LOG, 0f);
|
||||
if (battle_result == 0 && dataMgr.RecoveryData == null && RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile())
|
||||
{
|
||||
dataMgr.SetRecoveryData(RecoveryOperationInfo.ReadRecoveryFile(OperationRecorderBase.RecordDirectoryPath + "recovery_ai_network.json"));
|
||||
}
|
||||
JsonData recoveryData = dataMgr.RecoveryData;
|
||||
if (recoveryData != null)
|
||||
{
|
||||
battleFinishParam.recovery_data = recoveryData.ToJson();
|
||||
}
|
||||
BattlePlayerPair battlePlayerPair = ins.GetBattlePlayerPair(isPlayer: true);
|
||||
BattleCardBase selfClass = ins.GetBattlePlayer(isPlayer: true).Class;
|
||||
battleFinishParam.mission = dataMgr.MissionNecessaryInformation.GetMissionNecessaryInfo(battlePlayerPair, selfClass);
|
||||
base.Params = battleFinishParam;
|
||||
return battleFinishParam;
|
||||
}
|
||||
|
||||
protected virtual BattleFinishParam CreateBattleFinishParam(int class_id, int total_turn, int evolve_count, int enemy_evolve_count, int battle_result, int is_retire)
|
||||
{
|
||||
return new BattleFinishParam
|
||||
{
|
||||
class_id = class_id,
|
||||
total_turn = total_turn,
|
||||
evolve_count = evolve_count,
|
||||
enemy_evolve_count = enemy_evolve_count,
|
||||
battle_result = battle_result,
|
||||
is_retire = is_retire
|
||||
};
|
||||
}
|
||||
|
||||
protected bool IsEffectiveErrorCode(int code)
|
||||
{
|
||||
if (resultCode != 1 && resultCode != 3502)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
148
SVSim.BattleEngine/Engine/FlexibleGrid.cs
Normal file
148
SVSim.BattleEngine/Engine/FlexibleGrid.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
|
||||
public class FlexibleGrid : MonoBehaviour
|
||||
{
|
||||
public enum Order
|
||||
{
|
||||
Horizontal,
|
||||
Vertical
|
||||
}
|
||||
|
||||
public enum PivotOption
|
||||
{
|
||||
NONE,
|
||||
CENTER
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private Vector2 _limitSize;
|
||||
|
||||
[SerializeField]
|
||||
private Vector2 _padding;
|
||||
|
||||
[SerializeField]
|
||||
private bool _hideInactive = true;
|
||||
|
||||
[SerializeField]
|
||||
private Order _order;
|
||||
|
||||
[SerializeField]
|
||||
private bool _reversel;
|
||||
|
||||
[SerializeField]
|
||||
private PivotOption _horizonPivotOption;
|
||||
|
||||
private bool _repositionCalled;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (!_repositionCalled)
|
||||
{
|
||||
Reposition();
|
||||
}
|
||||
}
|
||||
|
||||
[Conditional("ENABLE_FLEXIBLE_GRID_LOG")]
|
||||
private static void DebugLog(string log)
|
||||
{
|
||||
UnityEngine.Debug.Log(log);
|
||||
}
|
||||
|
||||
[ContextMenu("Execute")]
|
||||
public void Reposition()
|
||||
{
|
||||
_repositionCalled = true;
|
||||
List<Transform> childList = GetChildList();
|
||||
if (childList.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float num = 0f;
|
||||
float num2 = 0f;
|
||||
float num3 = 0f;
|
||||
int i = 0;
|
||||
for (int count = childList.Count; i < count; i++)
|
||||
{
|
||||
Transform transform = childList[i];
|
||||
Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(transform, !_hideInactive);
|
||||
Vector3 localScale = transform.localScale;
|
||||
bounds.min = Vector3.Scale(bounds.min, localScale);
|
||||
bounds.max = Vector3.Scale(bounds.max, localScale);
|
||||
if (bounds.min == bounds.max)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (_order == Order.Horizontal)
|
||||
{
|
||||
int num4 = ((!_reversel) ? 1 : (-1));
|
||||
num = Math.Max(num, bounds.size.y);
|
||||
if (num2 + bounds.size.x > _limitSize.x)
|
||||
{
|
||||
num2 = 0f;
|
||||
num3 -= num + _padding.y;
|
||||
num = 0f;
|
||||
}
|
||||
Vector3 localPosition = transform.localPosition;
|
||||
if (_horizonPivotOption == PivotOption.CENTER)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
localPosition.x = num2;
|
||||
}
|
||||
else
|
||||
{
|
||||
float num5 = (float)num4 * bounds.size.x * 0.5f;
|
||||
localPosition.x = num2 + num5;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
localPosition.x = num2 + (float)num4 * (bounds.extents.x - bounds.center.x);
|
||||
}
|
||||
localPosition.y = num3;
|
||||
transform.localPosition = localPosition;
|
||||
num2 = ((_horizonPivotOption != PivotOption.CENTER) ? (num2 + (float)num4 * (bounds.size.x + _padding.x)) : ((i != 0) ? (num2 + (float)num4 * (_padding.x + bounds.size.x)) : (num2 + (float)num4 * (_padding.x + bounds.size.x * 0.5f))));
|
||||
}
|
||||
else
|
||||
{
|
||||
num = Math.Max(num, bounds.size.x);
|
||||
if (num3 + bounds.size.y > _limitSize.y)
|
||||
{
|
||||
num3 = 0f;
|
||||
num2 += num + _padding.x;
|
||||
num = 0f;
|
||||
}
|
||||
Vector3 localPosition2 = transform.localPosition;
|
||||
localPosition2.x = num2;
|
||||
localPosition2.y = num3 - bounds.extents.y - bounds.center.y;
|
||||
transform.localPosition = localPosition2;
|
||||
num3 -= bounds.size.y + _padding.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Transform> GetChildList()
|
||||
{
|
||||
Transform transform = base.transform;
|
||||
List<Transform> list = new List<Transform>();
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
Transform child = transform.GetChild(i);
|
||||
if (!_hideInactive || ((bool)child && NGUITools.GetActive(child.gameObject)))
|
||||
{
|
||||
list.Add(child);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public IEnumerator RepositionNextFrame()
|
||||
{
|
||||
yield return null;
|
||||
Reposition();
|
||||
}
|
||||
}
|
||||
17
SVSim.BattleEngine/Engine/FusionIngredientInfo.cs
Normal file
17
SVSim.BattleEngine/Engine/FusionIngredientInfo.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
public class FusionIngredientInfo
|
||||
{
|
||||
public readonly int FusionTurn;
|
||||
|
||||
public readonly BattleCardBase Card;
|
||||
|
||||
public FusionIngredientInfo(int turn, BattleCardBase card)
|
||||
{
|
||||
FusionTurn = turn;
|
||||
Card = card;
|
||||
}
|
||||
|
||||
public FusionIngredientInfo Clone()
|
||||
{
|
||||
return new FusionIngredientInfo(FusionTurn, Card);
|
||||
}
|
||||
}
|
||||
1509
SVSim.BattleEngine/Engine/GachaUI.cs
Normal file
1509
SVSim.BattleEngine/Engine/GachaUI.cs
Normal file
File diff suppressed because it is too large
Load Diff
797
SVSim.BattleEngine/Engine/Global.cs
Normal file
797
SVSim.BattleEngine/Engine/Global.cs
Normal file
@@ -0,0 +1,797 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
public static class Global
|
||||
{
|
||||
public enum CHAR_TYPE
|
||||
{
|
||||
PLAYER,
|
||||
ENEMY,
|
||||
NONE,
|
||||
MAX
|
||||
}
|
||||
|
||||
public enum CardRarity
|
||||
{
|
||||
MIN = 1,
|
||||
BRONZE = 1,
|
||||
SILVER = 2,
|
||||
GOLD = 3,
|
||||
LEGEND = 4,
|
||||
MAX = 5
|
||||
}
|
||||
|
||||
public enum LANG_TYPE
|
||||
{
|
||||
Jpn,
|
||||
Eng,
|
||||
Kor,
|
||||
Chs,
|
||||
Cht,
|
||||
Fre,
|
||||
Ita,
|
||||
Ger,
|
||||
Spa,
|
||||
Max
|
||||
}
|
||||
|
||||
public struct LanguageProps
|
||||
{
|
||||
public string LangType;
|
||||
|
||||
public string Name;
|
||||
|
||||
public string Font;
|
||||
|
||||
public string DisplayName;
|
||||
|
||||
public LanguageProps(string langType, string name, string font, string display)
|
||||
{
|
||||
LangType = langType;
|
||||
Name = name;
|
||||
Font = font;
|
||||
DisplayName = display;
|
||||
}
|
||||
}
|
||||
|
||||
public const int NONE = -1;
|
||||
|
||||
public const string NONE_TEXT = "NONE";
|
||||
|
||||
public const int GOBLIN_CARD_ID = 100011010;
|
||||
|
||||
public const int FIGHTER_CARD_ID = 100011020;
|
||||
|
||||
public const int EVOLVE_TO_OTHER_CARD_INITIAL_ID = 910;
|
||||
|
||||
public const int CHOICE_BRAVE_CARD_INITIAL_ID = 930;
|
||||
|
||||
public const int RITE_OF_THE_IGNORANT_ID = 900344060;
|
||||
|
||||
public const int GHIOS_SPARKLING_PRISM_ID = 120341020;
|
||||
|
||||
public const int ARAMIS_ID = 900241110;
|
||||
|
||||
public const int WIELDER_OF_THE_COSMOS_ID = 123841020;
|
||||
|
||||
public const int SLAUGHTERING_SAMURAI_ID = 130241030;
|
||||
|
||||
public const int GOBLIN_MAGE_ID = 125021010;
|
||||
|
||||
public const int ARCHANGEL_OF_EVOCATION_ID = 117031020;
|
||||
|
||||
public const int PEERLESS_WARRIOR_ID = 129241020;
|
||||
|
||||
public const int ELEANOR_TECHNIQUE_ID = 930344070;
|
||||
|
||||
public const int VAIDI_SECRET_ART_ID = 930444050;
|
||||
|
||||
public const int BRIARMAIDEN_ID = 132141010;
|
||||
|
||||
public const int THUNDER_GOD_OF_THE_TEMPEST_ID = 123031020;
|
||||
|
||||
public const int REAPER_CARD_IDX = -99;
|
||||
|
||||
public const long ONE_SECOND = 10000000L;
|
||||
|
||||
public const float BASE_SCREEN_WIDTH_SIZE = 1280f;
|
||||
|
||||
public const float BASE_SCREEN_HEIGHT_SIZE = 640f;
|
||||
|
||||
public const int STANDARD_DECK_CARD_NUM_MAX = 40;
|
||||
|
||||
public const int TWO_PICK_DECK_MAX_NUM = 30;
|
||||
|
||||
public const int WIND_FALL_DECK_MAX_NUM = 35;
|
||||
|
||||
public const int STANDARD_DECK_SAVABLE_CARD_NUM_MAX = 50;
|
||||
|
||||
public const int SAME_KIND_NUM_MAX_BASE = 3;
|
||||
|
||||
public const int CARD_RARITY_MIN = 1;
|
||||
|
||||
public const int CARD_RARITY_BRONZE = 1;
|
||||
|
||||
public const int CARD_RARITY_SILVER = 2;
|
||||
|
||||
public const int CARD_RARITY_GOLD = 3;
|
||||
|
||||
public const int CARD_RARITY_LEGEND = 4;
|
||||
|
||||
public const int CARD_RARITY_MAX = 5;
|
||||
|
||||
public const int DAMAGE_EFFECT_MAX_NUM = 12;
|
||||
|
||||
public const float MULLIGAN_TIME_LIMIT = 60f;
|
||||
|
||||
public const float TURN_TIME_LIMIT = 90f;
|
||||
|
||||
public const float TURN_TIME_EXTEND_ONPLAY = 3f;
|
||||
|
||||
public const float TURN_TIME_EXTEND_MAX = 15f;
|
||||
|
||||
public const float DRAG_DISTANCE = 40f;
|
||||
|
||||
public static Color CARD_SELECT_COLOR;
|
||||
|
||||
public static Color CARD_PASSIVE_COLOR;
|
||||
|
||||
public static Color CARD_DEFAULT_COLOR;
|
||||
|
||||
public static Color CARD_INACTIVE_COLOR;
|
||||
|
||||
public static Color CARD_BLESS_EFFECT_COLOR;
|
||||
|
||||
public static Color CARD_POWERDOWN_EFFECT_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_TEXT_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_TEXT_RED_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_COST_COLOR;
|
||||
|
||||
public static Color CARD_HBP_LABEL_COST_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_ATTACK_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_HEALTH_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_LESS_THAN_MAX_COLOR;
|
||||
|
||||
public static Color CARD_LABEL_FRAME_LESS_THAN_BASE_COLOR;
|
||||
|
||||
public static readonly Color FRAME_COLOR_CAN_ACT;
|
||||
|
||||
public static readonly Color FRAME_COLOR_CAN_ACT_RESTRICTED;
|
||||
|
||||
public static readonly Color FRAME_COLOR_SKILL_YELLOW;
|
||||
|
||||
public static readonly Color FRAME_COLOR_SKILL_PURPLE;
|
||||
|
||||
public static readonly Color FRAME_COLOR_SKILL_LIGHT_BLUE;
|
||||
|
||||
public static readonly Color FRAME_COLOR_SELECTABLE;
|
||||
|
||||
public static readonly Color FRAME_COLOR_FUSION_METAMORPHOSE;
|
||||
|
||||
public static readonly Color PROTECTION_COLOR_DAMAGE_CUT;
|
||||
|
||||
public static readonly Color PROTECTION_COLOR_INDESTRUCTIBLE;
|
||||
|
||||
public static readonly Color PROTECTION_COLOR_MULTI_INVALID;
|
||||
|
||||
public static readonly Color PROTECTION_COLOR_DAMAGE_REFLECTION;
|
||||
|
||||
public static readonly Color EVOLVE_TRAIL_COLOR_NORMAL;
|
||||
|
||||
public static readonly Color EVOLVE_TRAIL_COLOR_SKILL;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_ELF;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_ROYAL;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_WITCH_1;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_WITCH_2;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_DRAGON;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_NECROMANCER;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_VANPIRE;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_BISHOP;
|
||||
|
||||
public static readonly Color32 EFFECT_COLOR_NEMESIS;
|
||||
|
||||
public static readonly Rect CARD_2D_UV_RECT;
|
||||
|
||||
public static readonly Vector3 CARD_BASE_POS;
|
||||
|
||||
public static readonly Vector3 CARD_BASE_ROT;
|
||||
|
||||
public static readonly Vector3 CARD_BASE_SCALE;
|
||||
|
||||
public static readonly Vector3 CARD_BASE_STAY_SCALE;
|
||||
|
||||
public static readonly Vector3 CARD_BASE_SELECT_SCALE;
|
||||
|
||||
public static readonly Vector3 CARD_LIST_SCALE;
|
||||
|
||||
public static readonly Vector3 CARD_BATTLE_SCALE;
|
||||
|
||||
public static readonly Vector3 CARD_BATTLE_ROTATION;
|
||||
|
||||
public static readonly Vector3 CLASS_BATTLE_SCALE;
|
||||
|
||||
public static readonly Vector3 CLASS_BATTLE_POSITION_PLAYER;
|
||||
|
||||
public static readonly Vector3 CLASS_BATTLE_POSITION_ENEMY;
|
||||
|
||||
public const int BATTLE_LAYER = 10;
|
||||
|
||||
public const int SUB_PARTICLES_LAYER = 12;
|
||||
|
||||
public const int HIGH_RANK_EVOLVE_LAYER = 13;
|
||||
|
||||
public const int BATTLE_UNDER_LAYER = 15;
|
||||
|
||||
public const int FRONT_UI_LAYER = 24;
|
||||
|
||||
public const int SYSTEM_UI_LAYER = 22;
|
||||
|
||||
public const int CUT_IN_LAYER = 31;
|
||||
|
||||
public const int EMPTY_DECK_ID = -1;
|
||||
|
||||
public static readonly Vector3 EP_PANEL_POSITION_PLAYER;
|
||||
|
||||
public static readonly Vector3 PLAYER_CHOICE_BRAVE_BUTTON_POSITION;
|
||||
|
||||
public static readonly Vector3 ENEMY_CHOICE_BRAVE_BUTTON_POSITION;
|
||||
|
||||
public static readonly Vector3 PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM;
|
||||
|
||||
public const int DEFAULT_EMBLEM_ID = 100000000;
|
||||
|
||||
public const int DEFAULT_DEGREE_ID = 300003;
|
||||
|
||||
public static Vector2 WEBVIEW_NORMAL_SIZE;
|
||||
|
||||
public static Vector3 POSITION_COST_ICON;
|
||||
|
||||
public static Vector3 POSITION_ATK_ICON;
|
||||
|
||||
public static Vector3 POSITION_LIFE_ICON;
|
||||
|
||||
public static Vector3 POSITION_NAME_TEXT;
|
||||
|
||||
public static Vector3 POSITION_SKILL_TEXT;
|
||||
|
||||
public static Vector3 SCALE_CARD_ICON;
|
||||
|
||||
public static Vector3 SCALE_NAME_TEXT;
|
||||
|
||||
public static Vector3 SCALE_SKILL_TEXT;
|
||||
|
||||
public static bool IS_LOAD_ALLDONE;
|
||||
|
||||
public static int NormalFieldOfView;
|
||||
|
||||
public static int WideFieldOfView;
|
||||
|
||||
public const float WideFieldOfViewAspectRatioThreshold = 1.5f;
|
||||
|
||||
public const float ASPECT_RATIO_OVER_16_9 = 1.8f;
|
||||
|
||||
public const string BASE_GAME_FONT_NAME = "A-OTF-KaiminTuStd-Bold";
|
||||
|
||||
public const string BASE_BITMAP_FONT_NAME = "FOT-TsukuAOldMinPr6-E";
|
||||
|
||||
public static string GAME_FONT_NAME;
|
||||
|
||||
public static string[] fontFileNames;
|
||||
|
||||
public static List<int> PreLoadSkinId;
|
||||
|
||||
public static List<int> SeSysSummonLandingDuplicateCheckId;
|
||||
|
||||
public const int ROTATION_SEASON_CHANGE_ERROR_FOR_BUY = 110;
|
||||
|
||||
public const int ROTATION_SEASON_CHANGE_ERROR = 109;
|
||||
|
||||
private const int CHINESE_TAIWAN_ID = 1028;
|
||||
|
||||
private const int CHINESE_HONGKONG_ID = 3076;
|
||||
|
||||
private const int CHINESE_MAKAO_ID = 5124;
|
||||
|
||||
private const int CHINESE_SINGAPORE_ID = 4100;
|
||||
|
||||
private const int CHINESE_CHINA_ID = 2052;
|
||||
|
||||
public const int LANG_MAX = 9;
|
||||
|
||||
public static string jpn_font;
|
||||
|
||||
public const string CHS_FONT = "DFGBWB7-900";
|
||||
|
||||
public static LanguageProps[] LanguagePropList;
|
||||
|
||||
public static UnityEngine.Font GAME_FONT;
|
||||
|
||||
public const string CLONE_SUFFIX = "(Clone)";
|
||||
|
||||
private const string BBCodePattern = "(\\[[a-z0-9\\/\\-]*\\])";
|
||||
|
||||
public const string BBCodePatternName = "(\\[[a-z0-9\\/\\-]*(rub\\<[^\\>]*\\>)*\\])";
|
||||
|
||||
private static Vector2 CARD_NAME_POS_SHORT;
|
||||
|
||||
private static Vector2 CARD_NAME_POS_NORMAL;
|
||||
|
||||
private static Vector3 CARD_NAME_POSTION_ADD;
|
||||
|
||||
private static Vector2 CARD_NAME_POS_SHORT_2D;
|
||||
|
||||
private static Vector2 CARD_NAME_POS_NORMAL_2D;
|
||||
|
||||
private static float CARD_NAME_Z_ALPHABET_LANGUAGE;
|
||||
|
||||
private static int CARD_NAME_SIZE_ALPHABET_LANGUAGE;
|
||||
|
||||
public const int CARD_NAME_LIMIT_LENGTH_ENG = 11;
|
||||
|
||||
public const int CARD_NAME_LIMIT_LENGTH_JPN = 5;
|
||||
|
||||
private const char ZERO_WIDTH_MARKER = '\u200b';
|
||||
|
||||
private static readonly LANG_TYPE[] WordBreakLanguages;
|
||||
|
||||
private static readonly LANG_TYPE[] AlphabetLanguages;
|
||||
|
||||
private static readonly string[] WordBreakLanguageNames;
|
||||
|
||||
private static readonly string[] AlphabetLanguageNames;
|
||||
|
||||
public static bool IsSnCollabSkin(int skinId)
|
||||
{
|
||||
if (4300 <= skinId)
|
||||
{
|
||||
return skinId <= 4399;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern int GetUserDefaultLangID();
|
||||
|
||||
static Global()
|
||||
{
|
||||
CARD_SELECT_COLOR = Color.cyan;
|
||||
CARD_PASSIVE_COLOR = Color.red;
|
||||
CARD_DEFAULT_COLOR = Color.white;
|
||||
CARD_INACTIVE_COLOR = new Color(0.2f, 0.2f, 0.2f);
|
||||
CARD_BLESS_EFFECT_COLOR = new Color(0.7f, 1f, 0f, 1f);
|
||||
CARD_POWERDOWN_EFFECT_COLOR = new Color(1f, 0.8f, 0.4f);
|
||||
CARD_LABEL_FRAME_TEXT_COLOR = new Color(1f, 0.992f, 0.922f);
|
||||
CARD_LABEL_FRAME_TEXT_RED_COLOR = new Color(1f, 0.7f, 0.7f);
|
||||
CARD_LABEL_FRAME_COST_COLOR = new Color(0f, 0.2f, 0f);
|
||||
CARD_HBP_LABEL_COST_COLOR = new Color(0.27f, 0.207f, 0.176f, 1f);
|
||||
CARD_LABEL_FRAME_ATTACK_COLOR = new Color(0.2f, 0.2f, 0.4f);
|
||||
CARD_LABEL_FRAME_HEALTH_COLOR = new Color(0.4f, 0.2f, 0.2f);
|
||||
CARD_LABEL_FRAME_LESS_THAN_MAX_COLOR = new Color(0.9f, 0.75f, 0.7f);
|
||||
CARD_LABEL_FRAME_LESS_THAN_BASE_COLOR = new Color(32f / 51f, 26f / 51f, 14f / 51f);
|
||||
FRAME_COLOR_CAN_ACT = new Color(0f, 1f, 32f / 51f);
|
||||
FRAME_COLOR_CAN_ACT_RESTRICTED = new Color(1f, 1f, 0f);
|
||||
FRAME_COLOR_SKILL_YELLOW = new Color(64f / 85f, 1f, 0f);
|
||||
FRAME_COLOR_SKILL_PURPLE = new Color(0.5019608f, 0.4392157f, 1f);
|
||||
FRAME_COLOR_SKILL_LIGHT_BLUE = new Color(0f, 0.7921569f, 1f, 1f);
|
||||
FRAME_COLOR_SELECTABLE = new Color(1f, 32f / 51f, 0f);
|
||||
FRAME_COLOR_FUSION_METAMORPHOSE = new Color(64f / 85f, 1f, 0f);
|
||||
PROTECTION_COLOR_DAMAGE_CUT = new Color(0f, 0.2509804f, 1f);
|
||||
PROTECTION_COLOR_INDESTRUCTIBLE = new Color(1f, 0.5019608f, 0f);
|
||||
PROTECTION_COLOR_MULTI_INVALID = new Color(0f, 1f, 0.6901961f);
|
||||
PROTECTION_COLOR_DAMAGE_REFLECTION = new Color(1f, 0.1254902f, 0.1254902f);
|
||||
EVOLVE_TRAIL_COLOR_NORMAL = new Color(1f, 0.8f, 0.2f, 1f);
|
||||
EVOLVE_TRAIL_COLOR_SKILL = new Color(0f, 0.2f, 0.4f, 1f);
|
||||
EFFECT_COLOR_ELF = new Color32(64, byte.MaxValue, 128, byte.MaxValue);
|
||||
EFFECT_COLOR_ROYAL = new Color32(byte.MaxValue, 224, 64, byte.MaxValue);
|
||||
EFFECT_COLOR_WITCH_1 = new Color32(224, 64, byte.MaxValue, byte.MaxValue);
|
||||
EFFECT_COLOR_WITCH_2 = new Color32(67, 82, 155, byte.MaxValue);
|
||||
EFFECT_COLOR_DRAGON = new Color32(byte.MaxValue, 128, 32, byte.MaxValue);
|
||||
EFFECT_COLOR_NECROMANCER = new Color32(128, 64, byte.MaxValue, byte.MaxValue);
|
||||
EFFECT_COLOR_VANPIRE = new Color32(byte.MaxValue, 64, 64, byte.MaxValue);
|
||||
EFFECT_COLOR_BISHOP = new Color32(byte.MaxValue, 240, 160, byte.MaxValue);
|
||||
EFFECT_COLOR_NEMESIS = new Color32(64, 128, byte.MaxValue, byte.MaxValue);
|
||||
CARD_2D_UV_RECT = new Rect(0f, 0f, 1f, 1.1f);
|
||||
CARD_BASE_POS = new Vector3(0f, 0f, 0f);
|
||||
CARD_BASE_ROT = new Vector3(0f, -180f, 0f);
|
||||
CARD_BASE_SCALE = new Vector3(1f, 1f, 1f);
|
||||
CARD_BASE_STAY_SCALE = new Vector3(18f, 18f, 18f);
|
||||
CARD_BASE_SELECT_SCALE = new Vector3(2.42f, 1f, 3.2f);
|
||||
CARD_LIST_SCALE = new Vector3(170f, 226f, 1f);
|
||||
CARD_BATTLE_SCALE = Vector3.one;
|
||||
CARD_BATTLE_ROTATION = new Vector3(-10f, 0f, 0f);
|
||||
CLASS_BATTLE_SCALE = Vector3.one;
|
||||
CLASS_BATTLE_POSITION_PLAYER = new Vector3(0f, 0f, 0f);
|
||||
CLASS_BATTLE_POSITION_ENEMY = new Vector3(0f, 0f, 0f);
|
||||
EP_PANEL_POSITION_PLAYER = new Vector3(-229f, -11.29f, 0f);
|
||||
PLAYER_CHOICE_BRAVE_BUTTON_POSITION = new Vector3(-440f, 200f, 15f);
|
||||
ENEMY_CHOICE_BRAVE_BUTTON_POSITION = new Vector3(390f, -126f, 10f);
|
||||
PLAYER_CHOICE_BRAVE_BUTTON_POSITION_ZOOM = new Vector3(PLAYER_CHOICE_BRAVE_BUTTON_POSITION.x, PLAYER_CHOICE_BRAVE_BUTTON_POSITION.y + 25f, PLAYER_CHOICE_BRAVE_BUTTON_POSITION.z);
|
||||
WEBVIEW_NORMAL_SIZE = new Vector2(1100f, 440f);
|
||||
POSITION_COST_ICON = new Vector3(-1.68f, 2.1f, -0.2f);
|
||||
POSITION_ATK_ICON = new Vector3(-1.6f, -2.2f, -0.2f);
|
||||
POSITION_LIFE_ICON = new Vector3(1.6f, -2.2f, -0.2f);
|
||||
POSITION_NAME_TEXT = new Vector3(0f, 2f, -0.2f);
|
||||
POSITION_SKILL_TEXT = new Vector3(0f, -28f, -0.03f);
|
||||
SCALE_CARD_ICON = new Vector3(0.4f, 0.4f, 1f);
|
||||
SCALE_NAME_TEXT = new Vector3(0.0024f, 0.0024f, 1f);
|
||||
SCALE_SKILL_TEXT = new Vector3(1.25f, 1.25f, 0f);
|
||||
IS_LOAD_ALLDONE = false;
|
||||
NormalFieldOfView = 60;
|
||||
WideFieldOfView = 70;
|
||||
GAME_FONT_NAME = "A-OTF-KaiminTuStd-Bold";
|
||||
fontFileNames = new string[5] { "A-OTF-KaiminTuStd-Bold.otf", "TT0818M.TTF", "2002L.otf", "DFPT_W7_0.ttf", "DFGBWB7-900.ttf" };
|
||||
PreLoadSkinId = new List<int> { 3918, 3904 };
|
||||
SeSysSummonLandingDuplicateCheckId = new List<int> { 116024010, 130324010, 130514010 };
|
||||
jpn_font = "A-OTF-KaiminTuStd-Bold";
|
||||
LanguagePropList = new LanguageProps[8]
|
||||
{
|
||||
new LanguageProps(LANG_TYPE.Eng.ToString(), "English", "TT0818M", "English"),
|
||||
new LanguageProps(LANG_TYPE.Kor.ToString(), "Korean", "2002L", "한국어"),
|
||||
new LanguageProps(LANG_TYPE.Cht.ToString(), "ChineseTraditional", "DFPT_W7_0", "繁體中文"),
|
||||
new LanguageProps(LANG_TYPE.Fre.ToString(), "French", "TT0818M", "Français"),
|
||||
new LanguageProps(LANG_TYPE.Ita.ToString(), "Italian", "TT0818M", "Italiano"),
|
||||
new LanguageProps(LANG_TYPE.Ger.ToString(), "German", "TT0818M", "Deutsch"),
|
||||
new LanguageProps(LANG_TYPE.Spa.ToString(), "Spanish", "TT0818M", "Español"),
|
||||
new LanguageProps(LANG_TYPE.Chs.ToString(), "ChineseSimplified", "DFGBWB7-900", "简体中文")
|
||||
};
|
||||
GAME_FONT = null;
|
||||
CARD_NAME_POS_SHORT = new Vector2(0f, 0f);
|
||||
CARD_NAME_POS_NORMAL = new Vector2(75f, 0f);
|
||||
CARD_NAME_POSTION_ADD = new Vector3(0f, 10f, 0f);
|
||||
CARD_NAME_POS_SHORT_2D = new Vector2(0f, 109f);
|
||||
CARD_NAME_POS_NORMAL_2D = new Vector2(10f, 109f);
|
||||
CARD_NAME_Z_ALPHABET_LANGUAGE = -0.1f;
|
||||
CARD_NAME_SIZE_ALPHABET_LANGUAGE = 32;
|
||||
WordBreakLanguages = new LANG_TYPE[6]
|
||||
{
|
||||
LANG_TYPE.Eng,
|
||||
LANG_TYPE.Fre,
|
||||
LANG_TYPE.Ita,
|
||||
LANG_TYPE.Ger,
|
||||
LANG_TYPE.Spa,
|
||||
LANG_TYPE.Kor
|
||||
};
|
||||
AlphabetLanguages = new LANG_TYPE[5]
|
||||
{
|
||||
LANG_TYPE.Eng,
|
||||
LANG_TYPE.Fre,
|
||||
LANG_TYPE.Ita,
|
||||
LANG_TYPE.Ger,
|
||||
LANG_TYPE.Spa
|
||||
};
|
||||
WordBreakLanguageNames = null;
|
||||
AlphabetLanguageNames = null;
|
||||
WordBreakLanguageNames = new string[WordBreakLanguages.Length];
|
||||
for (int i = 0; i < WordBreakLanguageNames.Length; i++)
|
||||
{
|
||||
WordBreakLanguageNames[i] = WordBreakLanguages[i].ToString();
|
||||
}
|
||||
AlphabetLanguageNames = new string[AlphabetLanguages.Length];
|
||||
for (int j = 0; j < AlphabetLanguageNames.Length; j++)
|
||||
{
|
||||
AlphabetLanguageNames[j] = AlphabetLanguages[j].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetConvertWrapText(UILabel label, string orgText)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (label.bitmapFont == null && label.trueTypeFont != GAME_FONT)
|
||||
{
|
||||
label.trueTypeFont = GAME_FONT;
|
||||
}
|
||||
SystemText systemText = Data.SystemText;
|
||||
string text = systemText.Get("System_LineHeadWrap", enableDebugReturn: false);
|
||||
string text2 = systemText.Get("System_LineEndWrap", enableDebugReturn: false);
|
||||
label.text = orgText;
|
||||
string text3 = orgText;
|
||||
if (!string.IsNullOrEmpty(text3))
|
||||
{
|
||||
text3 = text3.Replace("\n", "\n\u200b");
|
||||
}
|
||||
string final = "";
|
||||
if (!label.Wrap(text3, out final))
|
||||
{
|
||||
final = label.text;
|
||||
}
|
||||
if (final.Equals(text3))
|
||||
{
|
||||
return final;
|
||||
}
|
||||
if (text == string.Empty && text2 == string.Empty)
|
||||
{
|
||||
return final;
|
||||
}
|
||||
string text4 = Regex.Escape(text);
|
||||
string text5 = Regex.Escape(text2);
|
||||
string pattern = "[" + text5 + "]+(\\[[a-z0-9\\/\\-]*\\])*$";
|
||||
string pattern2 = "^(\\[[a-z0-9\\/\\-]*\\])*[" + text4 + "]";
|
||||
string pattern3 = "[" + text5 + "]*.[" + text4 + "]*(\\[[a-z0-9\\/\\-]*\\])*$";
|
||||
List<string> list = new List<string>(final.Split('\n'));
|
||||
string text6 = string.Empty;
|
||||
for (int i = 0; i < list.Count && i <= final.Length; i++)
|
||||
{
|
||||
string text7 = list[i];
|
||||
string text8 = ((i + 1 < list.Count) ? list[i + 1] : string.Empty);
|
||||
Match match = Regex.Match(text7, pattern);
|
||||
if (match.Success && match.ToString() != text7)
|
||||
{
|
||||
string value = text7.Substring(match.Index, match.Length);
|
||||
if (text8 == string.Empty)
|
||||
{
|
||||
list.Add(text8 = "");
|
||||
}
|
||||
text8 = text8.Insert(0, value);
|
||||
text7 = text7.Substring(0, match.Index);
|
||||
}
|
||||
if (text6 != string.Empty)
|
||||
{
|
||||
if (Regex.Match(text7, pattern2).Success)
|
||||
{
|
||||
Match match2 = Regex.Match(text6, pattern3);
|
||||
if (match2.Success && match2.Index > 0)
|
||||
{
|
||||
text7 = text7.Insert(0, text6.Substring(match2.Index, match2.Length));
|
||||
text6 = text6.Substring(0, match2.Index);
|
||||
}
|
||||
}
|
||||
if (text7.Length > 1)
|
||||
{
|
||||
string text9 = text7.Replace('\u200b', '\n');
|
||||
if (!label.Wrap(text9, out var final2))
|
||||
{
|
||||
final2 = text9;
|
||||
}
|
||||
if (final2.Contains('\n'))
|
||||
{
|
||||
int num = final2.LastIndexOf('\n');
|
||||
if (num > 0)
|
||||
{
|
||||
if (text8 == string.Empty)
|
||||
{
|
||||
list.Add(text8 = "");
|
||||
}
|
||||
text8 = text8.Insert(0, final2.Substring(num + 1));
|
||||
text7 = final2.Substring(0, num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text6 != string.Empty)
|
||||
{
|
||||
list[i - 1] = text6;
|
||||
}
|
||||
if (text8 != string.Empty)
|
||||
{
|
||||
list[i + 1] = text8;
|
||||
}
|
||||
text6 = (list[i] = text7);
|
||||
}
|
||||
string text11 = "";
|
||||
int count = list.Count;
|
||||
for (int j = 0; j < count; j++)
|
||||
{
|
||||
text11 += list[j];
|
||||
if (j < count - 1)
|
||||
{
|
||||
text11 += "\n";
|
||||
}
|
||||
}
|
||||
return text11;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
label.text = orgText;
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetTextLineCount(string text)
|
||||
{
|
||||
int num = 1;
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
if (text[i] == '\n')
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public static string ConvertToWithoutBBCode(string text)
|
||||
{
|
||||
return Regex.Replace(text, "(\\[[a-z0-9\\/\\-]*(rub\\<[^\\>]*\\>)*\\])", "");
|
||||
}
|
||||
|
||||
public static void SetRepositionNameLabel(UILabel label, string orgText, bool is2D)
|
||||
{
|
||||
if (IsAlphabetLanguage())
|
||||
{
|
||||
if (orgText.Length <= 11)
|
||||
{
|
||||
label.transform.localPosition = (is2D ? CARD_NAME_POS_SHORT_2D : CARD_NAME_POS_SHORT);
|
||||
}
|
||||
else
|
||||
{
|
||||
label.transform.localPosition = (is2D ? CARD_NAME_POS_NORMAL_2D : CARD_NAME_POS_NORMAL);
|
||||
}
|
||||
}
|
||||
else if (ConvertToWithoutBBCode(orgText).Length <= 5)
|
||||
{
|
||||
label.transform.localPosition = (is2D ? CARD_NAME_POS_SHORT_2D : CARD_NAME_POS_SHORT);
|
||||
}
|
||||
else
|
||||
{
|
||||
label.transform.localPosition = (is2D ? CARD_NAME_POS_NORMAL_2D : CARD_NAME_POS_NORMAL);
|
||||
}
|
||||
if (!is2D && IsAlphabetLanguage())
|
||||
{
|
||||
Vector3 localPosition = label.transform.parent.localPosition;
|
||||
float num = CARD_NAME_Z_ALPHABET_LANGUAGE;
|
||||
if (label.transform.parent.localPosition.z > 0f)
|
||||
{
|
||||
num *= -1f;
|
||||
}
|
||||
localPosition.z = num;
|
||||
label.transform.localPosition += CARD_NAME_POSTION_ADD;
|
||||
label.transform.parent.localPosition = localPosition;
|
||||
label.fontSize = CARD_NAME_SIZE_ALPHABET_LANGUAGE;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> GetParentList(Transform t, bool isOwnContains)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
if (isOwnContains)
|
||||
{
|
||||
list.Add(t.name);
|
||||
}
|
||||
Transform transform = null;
|
||||
Transform transform2 = t;
|
||||
while ((transform = transform2.parent) != null)
|
||||
{
|
||||
list.Insert(0, transform.name);
|
||||
transform2 = transform;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static string GetParentListToString(Transform t, bool isOwnContains)
|
||||
{
|
||||
List<string> parentList = GetParentList(t, isOwnContains);
|
||||
string text = string.Empty;
|
||||
for (int i = 0; i < parentList.Count; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
text += ":";
|
||||
}
|
||||
text += parentList[i];
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public static bool IsAlphabetLanguage()
|
||||
{
|
||||
string textLanguage = CustomPreference.GetTextLanguage();
|
||||
return AlphabetLanguageNames.Contains(textLanguage);
|
||||
}
|
||||
|
||||
public static bool IsWordBreakLanguage()
|
||||
{
|
||||
string textLanguage = CustomPreference.GetTextLanguage();
|
||||
return WordBreakLanguageNames.Contains(textLanguage);
|
||||
}
|
||||
|
||||
public static LANG_TYPE CastToLangType(string type)
|
||||
{
|
||||
foreach (LANG_TYPE item in Enum.GetValues(typeof(LANG_TYPE)).Cast<LANG_TYPE>())
|
||||
{
|
||||
if (type == item.ToString())
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return LANG_TYPE.Max;
|
||||
}
|
||||
|
||||
public static bool IsSupportedLanguageType(string langType)
|
||||
{
|
||||
for (int i = 0; i < LanguagePropList.Count(); i++)
|
||||
{
|
||||
if (LanguagePropList[i].LangType == langType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsSupportedSystemLanguage(string sysLang)
|
||||
{
|
||||
for (int i = 0; i < LanguagePropList.Count(); i++)
|
||||
{
|
||||
if (LanguagePropList[i].Name == sysLang)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetDisplayLanguage(string type)
|
||||
{
|
||||
for (int i = 0; i < LanguagePropList.Count(); i++)
|
||||
{
|
||||
if (LanguagePropList[i].LangType == type)
|
||||
{
|
||||
return LanguagePropList[i].DisplayName;
|
||||
}
|
||||
}
|
||||
return LanguagePropList[0].DisplayName;
|
||||
}
|
||||
|
||||
public static string GetLanguageType(string sysLang)
|
||||
{
|
||||
for (int i = 0; i < LanguagePropList.Count(); i++)
|
||||
{
|
||||
if (LanguagePropList[i].Name == sysLang)
|
||||
{
|
||||
return LanguagePropList[i].LangType;
|
||||
}
|
||||
}
|
||||
return LanguagePropList[0].LangType;
|
||||
}
|
||||
|
||||
public static string GetFontLangType(string type)
|
||||
{
|
||||
for (int i = 0; i < LanguagePropList.Count(); i++)
|
||||
{
|
||||
if (LanguagePropList[i].LangType == type)
|
||||
{
|
||||
return LanguagePropList[i].Font;
|
||||
}
|
||||
}
|
||||
return LanguagePropList[0].Font;
|
||||
}
|
||||
|
||||
public static string GetSystemLanguage()
|
||||
{
|
||||
if (Application.systemLanguage == SystemLanguage.Chinese)
|
||||
{
|
||||
switch (GetUserDefaultLangID())
|
||||
{
|
||||
case 2052:
|
||||
case 4100:
|
||||
return SystemLanguage.ChineseSimplified.ToString();
|
||||
case 1028:
|
||||
case 3076:
|
||||
case 5124:
|
||||
return SystemLanguage.ChineseTraditional.ToString();
|
||||
}
|
||||
}
|
||||
return Application.systemLanguage.ToString();
|
||||
}
|
||||
}
|
||||
12
SVSim.BattleEngine/Engine/GuardInfo.cs
Normal file
12
SVSim.BattleEngine/Engine/GuardInfo.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
public class GuardInfo
|
||||
{
|
||||
public BattleCardBase OwnerCard { get; private set; }
|
||||
|
||||
public string DuplicateBanSkillNum { get; private set; }
|
||||
|
||||
public GuardInfo(BattleCardBase card, string _duplicateBanSkillNum)
|
||||
{
|
||||
OwnerCard = card;
|
||||
DuplicateBanSkillNum = _duplicateBanSkillNum;
|
||||
}
|
||||
}
|
||||
139
SVSim.BattleEngine/Engine/HandControl.cs
Normal file
139
SVSim.BattleEngine/Engine/HandControl.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.View;
|
||||
|
||||
public abstract class HandControl
|
||||
{
|
||||
public enum ArrangeType
|
||||
{
|
||||
Fan,
|
||||
Flat
|
||||
}
|
||||
|
||||
public enum HandState
|
||||
{
|
||||
Unfocus,
|
||||
Focus
|
||||
}
|
||||
|
||||
public enum HandVisible
|
||||
{
|
||||
Invisible,
|
||||
Visible
|
||||
}
|
||||
|
||||
protected readonly GameObject _gameObject;
|
||||
|
||||
protected HandState _handState;
|
||||
|
||||
protected HandVisible _handVisible;
|
||||
|
||||
protected Vector3[] _cardPos;
|
||||
|
||||
protected Vector3[] _cardRot;
|
||||
|
||||
protected Vector3[] _cardScale;
|
||||
|
||||
protected readonly BattleCamera _battleCamera;
|
||||
|
||||
private HandTRSCalculatorBase _TRSCalculator;
|
||||
|
||||
public Transform Transform { get; private set; }
|
||||
|
||||
public bool IsHandStateLocked { get; private set; }
|
||||
|
||||
public abstract Vector3 BaseHandPos { get; }
|
||||
|
||||
public HandControl(GameObject gameObject, BattleCamera battleCamera)
|
||||
{
|
||||
_gameObject = gameObject;
|
||||
Transform = _gameObject.transform;
|
||||
Transform.localPosition = BaseHandPos;
|
||||
_handState = HandState.Unfocus;
|
||||
_handVisible = HandVisible.Invisible;
|
||||
_battleCamera = battleCamera;
|
||||
_cardPos = new Vector3[9];
|
||||
_cardRot = new Vector3[9];
|
||||
_cardScale = new Vector3[9];
|
||||
_TRSCalculator = CreateHandCardTRSCalculator(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.FIXEDUSE_COST_INFO) ? ArrangeType.Flat : ArrangeType.Fan);
|
||||
}
|
||||
|
||||
public void AttachCardView(IBattleCardView cardView)
|
||||
{
|
||||
if (!(cardView is NullBattleCardView))
|
||||
{
|
||||
cardView.Transform.parent = Transform;
|
||||
cardView.GameObject.SetActive(value: false);
|
||||
cardView.GameObject.SetActive(value: true);
|
||||
}
|
||||
}
|
||||
|
||||
protected void RecalculateTRS(int cardNum)
|
||||
{
|
||||
for (int i = 0; i < cardNum; i++)
|
||||
{
|
||||
_TRSCalculator.CalcTRS(_handState, cardNum, i, ref _cardPos[i], ref _cardRot[i], ref _cardScale[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeArrangeType(ArrangeType type, float time, List<IBattleCardView> battleCardViewList)
|
||||
{
|
||||
_TRSCalculator = CreateHandCardTRSCalculator(type);
|
||||
RearrangeHand(time, battleCardViewList);
|
||||
}
|
||||
|
||||
protected abstract HandTRSCalculatorBase CreateHandCardTRSCalculator(ArrangeType type);
|
||||
|
||||
public abstract void RearrangeHand(float time, List<IBattleCardView> battleCardViewList, bool isNewReplayMoveTurn = false);
|
||||
|
||||
public abstract void HideHand(float time, List<IBattleCardView> battleCardViewList);
|
||||
|
||||
public void LockHandControlState()
|
||||
{
|
||||
IsHandStateLocked = true;
|
||||
}
|
||||
|
||||
public void SetHandState(HandState state)
|
||||
{
|
||||
if (!IsHandStateLocked)
|
||||
{
|
||||
_handState = state;
|
||||
}
|
||||
}
|
||||
|
||||
public HandState GetHandState()
|
||||
{
|
||||
return _handState;
|
||||
}
|
||||
|
||||
public bool IsHandStateFocus()
|
||||
{
|
||||
return _handState == HandState.Focus;
|
||||
}
|
||||
|
||||
public HandVisible GetHandVisible()
|
||||
{
|
||||
return _handVisible;
|
||||
}
|
||||
|
||||
public bool IsVisibleHand()
|
||||
{
|
||||
return _handVisible == HandVisible.Visible;
|
||||
}
|
||||
|
||||
public Vector3 GetHandCardPos(int idx)
|
||||
{
|
||||
return _cardPos[idx];
|
||||
}
|
||||
|
||||
public Vector3 GetHandCardRot(int idx)
|
||||
{
|
||||
return _cardRot[idx];
|
||||
}
|
||||
|
||||
public void SetHandPosition()
|
||||
{
|
||||
Transform.localPosition = BaseHandPos;
|
||||
}
|
||||
}
|
||||
22
SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs
Normal file
22
SVSim.BattleEngine/Engine/HandTRSCalculatorBase.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class HandTRSCalculatorBase
|
||||
{
|
||||
protected const float HAND_ALL_WIDTH = 700f;
|
||||
|
||||
protected const float CARD_WIDTH = 200f;
|
||||
|
||||
protected readonly Vector3 _handPos = Vector3.zero;
|
||||
|
||||
public HandTRSCalculatorBase(Vector3 handPos)
|
||||
{
|
||||
_handPos = handPos;
|
||||
}
|
||||
|
||||
public abstract void CalcTRS(HandControl.HandState state, int handMax, int handIndex, ref Vector3 retPos, ref Vector3 retRot, ref Vector3 retScale);
|
||||
|
||||
protected float CalHandAllWidth(int handMax)
|
||||
{
|
||||
return Mathf.Min(200f * (float)(handMax - 1), 700f);
|
||||
}
|
||||
}
|
||||
16
SVSim.BattleEngine/Engine/HeaderData.cs
Normal file
16
SVSim.BattleEngine/Engine/HeaderData.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
public class HeaderData
|
||||
{
|
||||
public int result_code;
|
||||
|
||||
public int resource_version;
|
||||
|
||||
public string parameter_version;
|
||||
|
||||
public int servertime;
|
||||
|
||||
public string udid;
|
||||
|
||||
public int viewer_id;
|
||||
|
||||
public string result_message;
|
||||
}
|
||||
23
SVSim.BattleEngine/Engine/HealCardParameterModifier.cs
Normal file
23
SVSim.BattleEngine/Engine/HealCardParameterModifier.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
public class HealCardParameterModifier : TurnAndIntValue, ICardLifeModifier
|
||||
{
|
||||
public int Heal => base.Value;
|
||||
|
||||
public bool IsClearBeforeModifier => false;
|
||||
|
||||
public bool IsChangeMaxLife => false;
|
||||
|
||||
public HealCardParameterModifier(int heal, int turn, bool isSelfTurn)
|
||||
: base(heal, turn, isSelfTurn)
|
||||
{
|
||||
}
|
||||
|
||||
public int CalcLife(int baseLife)
|
||||
{
|
||||
return baseLife + Heal;
|
||||
}
|
||||
|
||||
public int CalcMaxLife(int baseMaxLife)
|
||||
{
|
||||
return baseMaxLife;
|
||||
}
|
||||
}
|
||||
8
SVSim.BattleEngine/Engine/HealModifier.cs
Normal file
8
SVSim.BattleEngine/Engine/HealModifier.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
public abstract class HealModifier
|
||||
{
|
||||
protected BattleCardBase _owner;
|
||||
|
||||
public int OrderCount { get; protected set; }
|
||||
|
||||
public abstract int Calc(int healAmount, BattleCardBase healOwner, BattleCardBase target);
|
||||
}
|
||||
161
SVSim.BattleEngine/Engine/IBattlePlayerReadOnlyInfo.cs
Normal file
161
SVSim.BattleEngine/Engine/IBattlePlayerReadOnlyInfo.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.Battle;
|
||||
|
||||
public interface IBattlePlayerReadOnlyInfo
|
||||
{
|
||||
bool IsPlayer { get; }
|
||||
|
||||
bool IsSelfTurn { get; }
|
||||
|
||||
int Turn { get; }
|
||||
|
||||
bool IsGameFirst { get; }
|
||||
|
||||
int PpTotal { get; }
|
||||
|
||||
int Pp { get; }
|
||||
|
||||
int EpTotal { get; }
|
||||
|
||||
int CurrentEpCount { get; }
|
||||
|
||||
int Bp { get; }
|
||||
|
||||
int EvolveWaitTurnCount { get; }
|
||||
|
||||
int GameUsedEpCount { get; }
|
||||
|
||||
int TurnUsedEpCount { get; }
|
||||
|
||||
bool IsShortageDeckLose { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoDeckCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoBattleStartDeckCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoHandCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoClassAndInPlayCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoCemeterys { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoBanishCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoFusionIngredientList { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoTurnFusionCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoNecromanceZoneCards { get; }
|
||||
|
||||
IEnumerable<IEnumerable<IReadOnlyBattleCardInfo>> SkillInfoLastTargets { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoDiscards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoDiscardedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoFusionIngredientAndDiscardedCards { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.TurnAndCard> SkillInfoReturnedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoHealingCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoSkillSummonedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoEvolvedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoDestroyedWhenDestroyCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoTurnPlayCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoTurnDrawCards { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.CardAndId> SkillInfoTurnDrawTokenCardsWithId { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.TurnAndCard> SkillInfoGameSummonCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGamePlayCards { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.TurnAndCard> SkillInfoGameTurnPlayCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameCrystallizedPlayCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameSkillActivated { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoInplayMetamorphosedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameBurialRiteCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoTurnBurialRiteCards { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.TurnAndCard> SkillInfoGameReanimatedCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameDrawCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameDrawTokenCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameAddUpdateDeckCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameLeftCards { get; }
|
||||
|
||||
IEnumerable<BattlePlayerBase.TurnAndCard> SkillInfoGameTurnLeftCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameSuperSkyboundArtCards { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoGameQuickAttackCards { get; }
|
||||
|
||||
List<TurnAndIntValue> TurnPlayCardCountInfo { get; }
|
||||
|
||||
List<TurnAndIntValue> TurnFusionCountInfo { get; }
|
||||
|
||||
int TurnNecromanceCount { get; }
|
||||
|
||||
int GameNecromanceCount { get; }
|
||||
|
||||
int GameUsedPpCount { get; }
|
||||
|
||||
int RallyCount { get; }
|
||||
|
||||
int DeckBanishCount { get; }
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> SkillInfoInPlayCards { get; }
|
||||
|
||||
IReadOnlyBattleCardInfo SkillInfoClass { get; }
|
||||
|
||||
List<TurnAndIntValue> TurnStartLifeList { get; }
|
||||
|
||||
int GameResonanceStartCount { get; }
|
||||
|
||||
int TurnResonanceStartCount { get; }
|
||||
|
||||
int GameUsedWhiteRitualCount { get; }
|
||||
|
||||
int LastInplayWhiteRitualStack { get; }
|
||||
|
||||
List<TurnAndIntValue> GameSkillReturnCardCountList { get; }
|
||||
|
||||
List<TurnAndIntValue> GameSkillDiscardCountList { get; }
|
||||
|
||||
List<TurnAndIntValue> GameSkillBuffCountList { get; }
|
||||
|
||||
List<TurnAndIntValue> GameSkillMetamorphoseCountList { get; }
|
||||
|
||||
int GetCurrentTurnEvolveCount();
|
||||
|
||||
int GetSpecificTurnEvolveCount(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
IEnumerable<IReadOnlyBattleCardInfo> GetSpecificTurnDestroyCards(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnWhenHealingCount(TurnPlayerInfo turnPlayerInfo, bool isTextKeyword);
|
||||
|
||||
int GetSpecificTurnSkillReturnCardCount(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnSkillDiscardCount(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnEnhanceCardCount(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetAttachTurnBySkillId(string id);
|
||||
|
||||
int GetCurrentTurnPlayCount();
|
||||
|
||||
int GetSpecificTurnPlayCount(TurnPlayerInfo turnPlayerInfo);
|
||||
}
|
||||
8
SVSim.BattleEngine/Engine/IBattlePlayerSkill.cs
Normal file
8
SVSim.BattleEngine/Engine/IBattlePlayerSkill.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public interface IBattlePlayerSkill
|
||||
{
|
||||
VfxBase StartBattleHandCard(BattleCardBase card);
|
||||
|
||||
VfxBase StopBattleHandCard(BattleCardBase card);
|
||||
}
|
||||
15
SVSim.BattleEngine/Engine/IBattlePlayerVfxCreator.cs
Normal file
15
SVSim.BattleEngine/Engine/IBattlePlayerVfxCreator.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public interface IBattlePlayerVfxCreator
|
||||
{
|
||||
VfxBase CreateUsePp(int pp, int maxPp, Vector3 labelPosition, bool newReplayMoveTurn);
|
||||
|
||||
VfxBase CreateUseBp(int bp, int deltaBp, Func<Vector3> getPosition, bool isVariableCost, bool isSelf);
|
||||
|
||||
VfxBase CreateUpdateEp(int evolCount, int evolveWaitTurnCount);
|
||||
|
||||
VfxBase CreateCardDraw(IEnumerable<BattleCardBase> cards, bool isOpenDrawSkill = false);
|
||||
}
|
||||
31
SVSim.BattleEngine/Engine/IBattleResultReporter.cs
Normal file
31
SVSim.BattleEngine/Engine/IBattleResultReporter.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
using Wizard.Lottery;
|
||||
|
||||
public interface IBattleResultReporter
|
||||
{
|
||||
bool IsEnd { get; }
|
||||
|
||||
List<UserAchievement> UserAchievement { get; }
|
||||
|
||||
List<UserMission> UserMission { get; }
|
||||
|
||||
List<ReceivedReward> MissionRewards { get; }
|
||||
|
||||
List<ReceivedReward> VictoryRewards { get; }
|
||||
|
||||
int ClassExp { get; }
|
||||
|
||||
bool IsDataExist { get; }
|
||||
|
||||
LotteryApplyData LotteryData { get; }
|
||||
|
||||
MyPageHomeDialogData HomeDialogData { get; }
|
||||
|
||||
void Report(bool isWin);
|
||||
|
||||
void Destroy();
|
||||
|
||||
JsonData GetFinishResponseData();
|
||||
}
|
||||
8
SVSim.BattleEngine/Engine/ICardChantCountModifier.cs
Normal file
8
SVSim.BattleEngine/Engine/ICardChantCountModifier.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
public interface ICardChantCountModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcChantCount(int baseCost);
|
||||
|
||||
ICardChantCountModifier Clone();
|
||||
}
|
||||
12
SVSim.BattleEngine/Engine/ICardCostModifier.cs
Normal file
12
SVSim.BattleEngine/Engine/ICardCostModifier.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
public interface ICardCostModifier
|
||||
{
|
||||
int Cost { get; }
|
||||
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
bool IsResidentModifier { get; }
|
||||
|
||||
int CalcCost(int baseCost);
|
||||
|
||||
ICardCostModifier Clone();
|
||||
}
|
||||
6
SVSim.BattleEngine/Engine/ICardEpModifier.cs
Normal file
6
SVSim.BattleEngine/Engine/ICardEpModifier.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
public interface ICardEpModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcEp(int baseEp);
|
||||
}
|
||||
10
SVSim.BattleEngine/Engine/ICardLifeModifier.cs
Normal file
10
SVSim.BattleEngine/Engine/ICardLifeModifier.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
public interface ICardLifeModifier
|
||||
{
|
||||
bool IsChangeMaxLife { get; }
|
||||
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcLife(int baseLife);
|
||||
|
||||
int CalcMaxLife(int baseMaxLife);
|
||||
}
|
||||
6
SVSim.BattleEngine/Engine/ICardOffenseModifier.cs
Normal file
6
SVSim.BattleEngine/Engine/ICardOffenseModifier.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
public interface ICardOffenseModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcOffense(int offense);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public interface ICardSkyboundArtCountModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcSkyboundArtCount(int count);
|
||||
|
||||
ICardSkyboundArtCountModifier Clone();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public interface ICardSuperSkyboundArtCountModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcSuperSkyboundArtCount(int count);
|
||||
|
||||
ICardSuperSkyboundArtCountModifier Clone();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public interface ICardUnionBurstCountModifier
|
||||
{
|
||||
bool IsClearBeforeModifier { get; }
|
||||
|
||||
int CalcUnionBurstCount(int count);
|
||||
|
||||
ICardUnionBurstCountModifier Clone();
|
||||
}
|
||||
58
SVSim.BattleEngine/Engine/IDetailPanelControl.cs
Normal file
58
SVSim.BattleEngine/Engine/IDetailPanelControl.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public interface IDetailPanelControl
|
||||
{
|
||||
bool IsShow { get; }
|
||||
|
||||
BattleCardBase _card { get; }
|
||||
|
||||
bool forceEvolutionConfirm { get; set; }
|
||||
|
||||
UIButton EvolveButton { get; }
|
||||
|
||||
GameObject EvoTargetPanelColliderGameObject { get; }
|
||||
|
||||
DetailPanelControl.ShowRequest CurrentShowRequest { get; }
|
||||
|
||||
EvolutionConfirmation _evolutionConfirmation { get; }
|
||||
|
||||
event Action OnHideOneTime;
|
||||
|
||||
void UpdateCardDescriptionOnEvent();
|
||||
|
||||
void UpdateCardDescriptionOnEvolutionEvent();
|
||||
|
||||
void Show(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, DetailPanelControl.ShowRequest showRequest);
|
||||
|
||||
void ShowList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List<BattleCardBase> cards, DetailPanelControl.ShowRequest showRequest, BuffInfo buff, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, string divergenceId = "", int logTextureId = 0);
|
||||
|
||||
void Hide();
|
||||
|
||||
void SetSize(float percent);
|
||||
|
||||
void UpdateBuffInfo(BattleCardBase targetCard, List<BattlePlayerBase.MyRotationBonusCondition> otationBonusList);
|
||||
|
||||
void UpdateLogItemBuffInfo(BattleCardBase targetCard);
|
||||
|
||||
void SetScreenPosition(bool right);
|
||||
|
||||
VfxBase ShowEvolutionButton(BattleCardBase card);
|
||||
|
||||
void CreateNextPanel();
|
||||
|
||||
void SetKeyBtnActive(List<bool> hasKeyword);
|
||||
|
||||
void ShowKeySubPanel(int page);
|
||||
|
||||
void HideKeySubPanel();
|
||||
|
||||
bool IsDisplayedRight();
|
||||
|
||||
List<BuffInfo> GetDistinctBuffList(List<BuffInfo> buffInfoList);
|
||||
|
||||
List<NetworkBattleReceiver.ReplayBuffInfoLabel> GetBuffDetailLabel(BattleCardBase targetCard);
|
||||
}
|
||||
8
SVSim.BattleEngine/Engine/INextSceneSelector.cs
Normal file
8
SVSim.BattleEngine/Engine/INextSceneSelector.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
|
||||
public interface INextSceneSelector
|
||||
{
|
||||
void Setup(bool isWin, GameObject gameObject);
|
||||
|
||||
void Show();
|
||||
}
|
||||
3
SVSim.BattleEngine/Engine/IPpModifier.cs
Normal file
3
SVSim.BattleEngine/Engine/IPpModifier.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
public interface IPpModifier
|
||||
{
|
||||
}
|
||||
6
SVSim.BattleEngine/Engine/IResultAnimationHandler.cs
Normal file
6
SVSim.BattleEngine/Engine/IResultAnimationHandler.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
public interface IResultAnimationHandler
|
||||
{
|
||||
ResultAnimationAgent m_resultAnimationAgent { get; }
|
||||
|
||||
void Destroy();
|
||||
}
|
||||
765
SVSim.BattleEngine/Engine/ISkillApplyInformation.cs
Normal file
765
SVSim.BattleEngine/Engine/ISkillApplyInformation.cs
Normal file
@@ -0,0 +1,765 @@
|
||||
using System.Collections.Generic;
|
||||
using Wizard.Battle;
|
||||
using Wizard.Battle.Resource;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public interface ISkillApplyInformation
|
||||
{
|
||||
List<CantPlayCardFilterInfo> CantPlayFilterList { get; }
|
||||
|
||||
int BuffCount { get; }
|
||||
|
||||
int BuffLifeCount { get; }
|
||||
|
||||
List<BuffCountInfo> TurnBuffCountList { get; }
|
||||
|
||||
bool IsBuff { get; }
|
||||
|
||||
int DebuffCount { get; }
|
||||
|
||||
bool IsDebuff { get; }
|
||||
|
||||
List<GuardInfo> GuardInfo { get; }
|
||||
|
||||
bool IsGuard { get; }
|
||||
|
||||
int DrainCount { get; }
|
||||
|
||||
bool IsDrain { get; }
|
||||
|
||||
int KillerCount { get; }
|
||||
|
||||
bool IsKiller { get; }
|
||||
|
||||
List<ShieldInfo> ShieldInfos { get; }
|
||||
|
||||
bool IsShieldAll { get; }
|
||||
|
||||
bool IsShieldSkill { get; }
|
||||
|
||||
bool IsShieldSpell { get; }
|
||||
|
||||
bool IsShieldAttack { get; }
|
||||
|
||||
int QuickCount { get; }
|
||||
|
||||
bool IsQuick { get; }
|
||||
|
||||
List<RushInfo> RushInfo { get; }
|
||||
|
||||
bool IsRush { get; }
|
||||
|
||||
int SneakCount { get; }
|
||||
|
||||
bool IsSneak { get; }
|
||||
|
||||
int DamageCutCount { get; }
|
||||
|
||||
bool IsDamageCut { get; }
|
||||
|
||||
int NotBeAttackedCount { get; }
|
||||
|
||||
int UntouchableCount { get; }
|
||||
|
||||
bool IsUntouchable { get; }
|
||||
|
||||
bool IsUntouchableBySpell { get; }
|
||||
|
||||
int IgnoreGuardCount { get; }
|
||||
|
||||
bool IsIgnoreGuard { get; }
|
||||
|
||||
int AttackByLifeTypeAttackCount { get; }
|
||||
|
||||
bool IsAttackByLifeTypeAttack { get; }
|
||||
|
||||
int AttackByLifeTypeBeAttackedCount { get; }
|
||||
|
||||
bool IsAttackByLifeTypeBeAttacked { get; }
|
||||
|
||||
int SkillCantAtkClassCount { get; }
|
||||
|
||||
bool IsSkillCantAtkClass { get; }
|
||||
|
||||
int SkillCantAtkUnitCount { get; }
|
||||
|
||||
bool IsSkillCantAtkUnit { get; }
|
||||
|
||||
int SkillCantAtkUnitNotHasGuardCount { get; }
|
||||
|
||||
bool IsSkillCantAtkUnitNotHasGuard { get; }
|
||||
|
||||
int SkillCantAtkUnitBaseCardIdCount { get; }
|
||||
|
||||
bool IsSkillCantAtkUnitBaseCardId { get; }
|
||||
|
||||
List<int> CantAtkUnitBaseCardIdList { get; }
|
||||
|
||||
bool IsSkillCantAtkAll { get; }
|
||||
|
||||
int ReflectionClassCount { get; }
|
||||
|
||||
bool IsReflectionClass { get; }
|
||||
|
||||
int ReflectionDamageOwnerCount { get; }
|
||||
|
||||
bool IsReflectionDamageOwner { get; }
|
||||
|
||||
int InfiniteAttackCount { get; }
|
||||
|
||||
bool IsInfiniteAttack { get; }
|
||||
|
||||
int IndestructibleCount { get; }
|
||||
|
||||
bool IsIndestructible { get; }
|
||||
|
||||
int ForceBerserkCount { get; }
|
||||
|
||||
bool IsForceBerserk { get; }
|
||||
|
||||
int ForceAvariceCount { get; }
|
||||
|
||||
bool IsForceAvarice { get; }
|
||||
|
||||
int ForceWrathCount { get; }
|
||||
|
||||
bool IsForceWrath { get; }
|
||||
|
||||
int CantActivateFanfareUnitCount { get; }
|
||||
|
||||
bool IsCantActivateFanfareUnit { get; }
|
||||
|
||||
int CantActivateFanfareFieldCount { get; }
|
||||
|
||||
bool IsCantActivateFanfareField { get; }
|
||||
|
||||
int CantActivateShortageDeckWinCount { get; }
|
||||
|
||||
bool IsCantActivateShortageDeckWin { get; }
|
||||
|
||||
int ForceSkillTargetCount { get; }
|
||||
|
||||
bool IsForceSkillTarget { get; }
|
||||
|
||||
int AttractSkillTargetCount { get; }
|
||||
|
||||
bool IsAttractSkillTarget { get; }
|
||||
|
||||
int IndependentCount { get; }
|
||||
|
||||
bool IsIndependent { get; }
|
||||
|
||||
int NotBeDebuffedCount { get; }
|
||||
|
||||
bool IsNotBeDebuffed { get; }
|
||||
|
||||
int ForceAttackUnitCount { get; }
|
||||
|
||||
bool IsForceAttackUnit { get; }
|
||||
|
||||
int SkillRandomCount { get; }
|
||||
|
||||
int[] SkillRandomArray { get; }
|
||||
|
||||
List<DamageCutInfo> DamageCutList { get; }
|
||||
|
||||
List<ReflectionInfo> ReflectionInfoList { get; }
|
||||
|
||||
int TurnStartFixedPPCount { get; }
|
||||
|
||||
bool IsTurnStartFixedPP { get; }
|
||||
|
||||
int TriggerCount { get; }
|
||||
|
||||
bool IsTrigger { get; }
|
||||
|
||||
bool IsNotConsumeEp { get; }
|
||||
|
||||
int ShortageDeckWinCount { get; }
|
||||
|
||||
bool IsShortageDeckWin { get; }
|
||||
|
||||
int ReturnByBanishCount { get; }
|
||||
|
||||
bool IsReturnByBanish { get; }
|
||||
|
||||
int DestroyByBanishCount { get; }
|
||||
|
||||
bool IsDestroyByBanish { get; }
|
||||
|
||||
int BanishByDestroyCount { get; }
|
||||
|
||||
bool IsBanishByDestroy { get; }
|
||||
|
||||
bool CantBeFocusedSkill { get; }
|
||||
|
||||
bool CantBeFocusedSpell { get; }
|
||||
|
||||
int[] SkillGenericValueArray { get; }
|
||||
|
||||
Dictionary<string, int> SkillGenericKeyAndValue { get; }
|
||||
|
||||
int UnionBurstCount { get; }
|
||||
|
||||
int SkyboundArtCount { get; }
|
||||
|
||||
int SuperSkyboundArtCount { get; }
|
||||
|
||||
int WhiteRitualCount { get; }
|
||||
|
||||
int RandomAttackCount { get; }
|
||||
|
||||
int NotDecreasePPCounter { get; }
|
||||
|
||||
bool IsLifeZeroActivateLeonSkill { get; }
|
||||
|
||||
List<DamageClippingInfo> DamageMaxClippingInfo { get; }
|
||||
|
||||
List<CardBasePrm.ClanType> ClanSkinInfo { get; }
|
||||
|
||||
List<CardBasePrm.TribeInfo> TribeSkinInfo { get; }
|
||||
|
||||
List<ICardOffenseModifier> OffenseModifierList { get; }
|
||||
|
||||
List<ICardLifeModifier> LifeModifierList { get; }
|
||||
|
||||
List<ICardChantCountModifier> ChantCountModifierList { get; }
|
||||
|
||||
List<DamageCardParameterModifier> DamageList { get; }
|
||||
|
||||
List<HealCardParameterModifier> HealList { get; }
|
||||
|
||||
List<int> SkillHealList { get; }
|
||||
|
||||
List<ICardLifeModifier> LifeChangeList { get; }
|
||||
|
||||
List<ICardEpModifier> EpModifierList { get; }
|
||||
|
||||
List<NotBeAttackedInfo> NotBeAttackedInfoList { get; }
|
||||
|
||||
bool IsNotBeAttacked { get; }
|
||||
|
||||
List<NotConsumeEpModifierInfo> NotConsumeEpModifierInfoList { get; }
|
||||
|
||||
AttachedSkillInformation AttachedSkillsInfo { get; }
|
||||
|
||||
List<RepeatSkillInfo> RepeatSkillTimingList { get; }
|
||||
|
||||
List<DamageModifier> AddDamageList { get; }
|
||||
|
||||
List<HealModifier> HealModifierList { get; }
|
||||
|
||||
List<AddTargetInfo> AddTargetList { get; }
|
||||
|
||||
List<int> DecreaseTurnStartPPList { get; }
|
||||
|
||||
List<int> CantEvolutionList { get; }
|
||||
|
||||
List<Skill_cant_summon.CantSummonInfo> CantSummonList { get; }
|
||||
|
||||
bool IsDamageCutProtection { get; }
|
||||
|
||||
List<BattleCardBase> RandomSelectedCardList { get; }
|
||||
|
||||
List<BattleCardBase> SkillDrewCardList { get; }
|
||||
|
||||
List<BattleCardBase> LastBurialRiteCardList { get; }
|
||||
|
||||
List<TokenDrawModifier> TokenDrawModifiers { get; }
|
||||
|
||||
List<FusionIngredientInfo> FusionIngredients { get; }
|
||||
|
||||
List<BattleCardBase> GetOnCards { get; }
|
||||
|
||||
TokenDrawModifier GetTokenDrawModifier(int cardId);
|
||||
|
||||
void InitializeInformation(bool isReturnCard = false);
|
||||
|
||||
void InitializeInformationWithoutLifeOffenseModifier(bool isReturnCard = false);
|
||||
|
||||
void ReSetupVfxCreator(ICardVfxCreator vfxCreator);
|
||||
|
||||
SkillBase CloneAttachSkill(SkillApplyInformation cloneTarget, SkillBase skill);
|
||||
|
||||
SkillApplyInformation Clone(BattleCardBase card);
|
||||
|
||||
void Combine(ISkillApplyInformation info);
|
||||
|
||||
bool IsCantPlay(BattleCardBase card, BattleCardBase.CHECK_CONDITION_MUTATIONSKILL_TYPE type = BattleCardBase.CHECK_CONDITION_MUTATIONSKILL_TYPE.NONE);
|
||||
|
||||
bool HasCantPlaySpellFilter();
|
||||
|
||||
bool HasCantPlayFieldFilter();
|
||||
|
||||
bool CantPlayTransformId(BattleCardBase originalCard);
|
||||
|
||||
SkillBase AttachSkill(SkillCreator.SkillBuildInfo skillBuildInfo, IBattleResourceMgr resourceMgr, string ownerName, int ownerId, long duplicateBanNum, SkillBase originSkill, bool isAttachEvolveSkill = false);
|
||||
|
||||
void RemoveSkill(SkillBase skill, BattleCardBase skillOwnerCard, long duplicateBanNum, SkillBase originSkill, int creatorSkillIndex);
|
||||
|
||||
VfxBase GiveCombatValueModifier(ICardOffenseModifier offenseModifier, ICardLifeModifier lifeModifier, SkillProcessor skillProcessor);
|
||||
|
||||
VfxBase DepriveCombatValueModifire(ICardOffenseModifier offenseModifier, ICardLifeModifier lifeModifier);
|
||||
|
||||
VfxBase ForceDepriveCombatValueModifire();
|
||||
|
||||
void AddOffenseModifier(ICardOffenseModifier modifier);
|
||||
|
||||
void AddLifeModifier(ICardLifeModifier modifier);
|
||||
|
||||
void ClearParameterModifier();
|
||||
|
||||
void ClearUnionBurstAndSkyboundArtModifier();
|
||||
|
||||
void AddEpModifier(ICardEpModifier modifier);
|
||||
|
||||
void RemoveEpModifier(ICardEpModifier modifier);
|
||||
|
||||
int GetEp();
|
||||
|
||||
int GetAtk(bool ignoreLowerLimit = false);
|
||||
|
||||
int GetLife();
|
||||
|
||||
bool HasMoreDamageThan(ISkillApplyInformation other);
|
||||
|
||||
int GetMaxLife();
|
||||
|
||||
int GetLastLife();
|
||||
|
||||
int GetChangeMaxLifeCount();
|
||||
|
||||
int GetInitialWhiteRitualStack();
|
||||
|
||||
void DamageLife(int damage, int turn, bool isSelfTurn);
|
||||
|
||||
void CausedDamageLife(int damage, int turn, bool isSelfTurn);
|
||||
|
||||
void HealLife(int healAmount, int turn, bool isSelfTurn);
|
||||
|
||||
void AddPp(int addPp, int currentTurn, bool isSelfTurn);
|
||||
|
||||
int GetSpecificTurnDamageValue(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
List<DamageCardParameterModifier> GetSpecificTurnDamageValueList(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnCausedDamageValue(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
List<CausedDamageCardParameterModifier> GetSpecificTurnCausedDamageValueList(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnDamageCount(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnHealValue(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
List<HealCardParameterModifier> GetSpecificTurnHealValueList(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnHealCount(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnBuffCount(TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnHealCountOnlySelf(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnPpAddCount(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnAcceleratedCardCount(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnAcceleratedCardCountOnlySelf(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
List<TurnAndIntValue> GetSpecificTurnStartLifeList(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
int GetSpecificTurnFusionCount(IReadOnlyBattleCardInfo cardInfo, TurnPlayerInfo turnPlayerInfo);
|
||||
|
||||
void SetSkillGenericArray(int[] array);
|
||||
|
||||
void AddSkillGenericValue(int value, int index);
|
||||
|
||||
void SetSkillGenericKeyAndValue(string key, int value);
|
||||
|
||||
bool IsContainGenericValueKey(string key);
|
||||
|
||||
void GiveUnionBurstCount(ICardUnionBurstCountModifier unionBurstCountModifier);
|
||||
|
||||
void DepriveUnionBurstCount(ICardUnionBurstCountModifier unionBurstCountModifier);
|
||||
|
||||
void FourceDepriveUnionBurstCount();
|
||||
|
||||
void GiveSkyboundArtCount(ICardSkyboundArtCountModifier skyboundArtCountModifier);
|
||||
|
||||
void GiveSuperSkyboundArtCount(ICardSuperSkyboundArtCountModifier superSkyboundArtCountModifier);
|
||||
|
||||
void GiveWhiteRitualCount(int value);
|
||||
|
||||
void DepriveWhiteRitualCount(int value);
|
||||
|
||||
void FourceDepriveWhiteRitualCount();
|
||||
|
||||
void GiveBuff(bool isReplace = false);
|
||||
|
||||
void DepriveBuff();
|
||||
|
||||
void FourceDepriveBuff();
|
||||
|
||||
void GiveDebuff();
|
||||
|
||||
void DepriveDebuff();
|
||||
|
||||
void FourceDepriveDebuff();
|
||||
|
||||
void GiveBuffLife();
|
||||
|
||||
void DepriveBuffLife();
|
||||
|
||||
void ForceDepriveBuffLife();
|
||||
|
||||
VfxBase GiveGuard(GuardInfo info);
|
||||
|
||||
VfxBase DepriveGuard(GuardInfo info);
|
||||
|
||||
VfxBase ForceDepriveGuard();
|
||||
|
||||
VfxBase GiveDrain();
|
||||
|
||||
VfxBase DepriveDrain();
|
||||
|
||||
VfxBase FourceDepriveDrain();
|
||||
|
||||
VfxBase GiveKiller();
|
||||
|
||||
VfxBase DepriveKiller();
|
||||
|
||||
VfxBase FourceDepriveKiller();
|
||||
|
||||
VfxBase GiveShield(ShieldInfo shield);
|
||||
|
||||
VfxBase DepriveShield(ShieldInfo shield);
|
||||
|
||||
VfxBase FourceDepriveShield(ShieldInfo.ShieldType type);
|
||||
|
||||
VfxBase GiveQuick();
|
||||
|
||||
VfxBase DepriveQuick();
|
||||
|
||||
VfxBase ForceDepriveQuick();
|
||||
|
||||
VfxBase GiveRush(RushInfo info);
|
||||
|
||||
VfxBase DepriveRush(RushInfo info);
|
||||
|
||||
VfxBase ForceDepriveRush();
|
||||
|
||||
VfxBase GiveSneak();
|
||||
|
||||
VfxBase DepriveSneak();
|
||||
|
||||
VfxBase FourceDepriveSneak();
|
||||
|
||||
VfxBase GiveNotBeAttacked(NotBeAttackedInfo info);
|
||||
|
||||
VfxBase DepriveNotBeAttacked(NotBeAttackedInfo info);
|
||||
|
||||
VfxBase FourceDepriveNotBeAttacked();
|
||||
|
||||
VfxBase GiveUntouchable(string cardType);
|
||||
|
||||
VfxBase DepriveUntouchable(string cardType);
|
||||
|
||||
VfxBase FourceDepriveUntouchable(string cardType);
|
||||
|
||||
VfxBase GiveAttackByLife(string type);
|
||||
|
||||
VfxBase DepriveAttackByLife(string type);
|
||||
|
||||
VfxBase FourceDepriveAttackByLife(string type);
|
||||
|
||||
VfxBase GiveCantAttack(int bit_flag, int baseCardId);
|
||||
|
||||
VfxBase DepriveCantAttack(int bit_flag, int baseCardId);
|
||||
|
||||
VfxBase ForceDepriveCantAttack();
|
||||
|
||||
VfxBase ForceDepriveCantAttackAll();
|
||||
|
||||
VfxBase GiveCantPlay(CantPlayCardFilterInfo cantPlayCardFilter);
|
||||
|
||||
VfxBase DepriveCantPlay(CantPlayCardFilterInfo cantPlayCardFilter);
|
||||
|
||||
VfxBase ForceDepriveCantPlay();
|
||||
|
||||
VfxBase GiveCantSummon(Skill_cant_summon.CantSummonInfo info);
|
||||
|
||||
VfxBase DepriveCantSummon(Skill_cant_summon.CantSummonInfo info);
|
||||
|
||||
VfxBase ForceDepriveCantSummon();
|
||||
|
||||
VfxBase GiveIgnoreGuard();
|
||||
|
||||
VfxBase DepriveIgnoreGuard();
|
||||
|
||||
VfxBase FourceDepriveIgnoreGuard();
|
||||
|
||||
VfxBase GiveAttackCount(Skill_attack_count skill, int count);
|
||||
|
||||
VfxBase DepriveAttackCount(Skill_attack_count skill);
|
||||
|
||||
VfxBase ForceDepriveAttackCount();
|
||||
|
||||
VfxBase GiveInfiniteAttackCount();
|
||||
|
||||
VfxBase DepriveInfiniteAttackCount();
|
||||
|
||||
VfxBase ForceDepriveInfiniteAttackCount();
|
||||
|
||||
VfxBase GiveReflection(ReflectionInfo info);
|
||||
|
||||
VfxBase DepriveReflection(ReflectionInfo info);
|
||||
|
||||
VfxBase ForceDepriveReflection();
|
||||
|
||||
VfxBase GiveIndestructible();
|
||||
|
||||
VfxBase DepriveIndestructible();
|
||||
|
||||
VfxBase ForceDepriveIndestructible();
|
||||
|
||||
VfxBase GiveForceBerserk(SkillProcessor skillprocessor);
|
||||
|
||||
VfxBase DepriveForceBerserk(SkillProcessor skillprocessor);
|
||||
|
||||
VfxBase ForceDepriveForceBerserk(SkillProcessor skillprocessor);
|
||||
|
||||
VfxBase GiveForceAvarice(SkillProcessor skillprocessor);
|
||||
|
||||
VfxBase DepriveForceAvarice();
|
||||
|
||||
VfxBase ForceDepriveForceAvarice();
|
||||
|
||||
VfxBase GiveForceWrath(SkillProcessor skillprocessor);
|
||||
|
||||
VfxBase DepriveForceWrath();
|
||||
|
||||
VfxBase ForceDepriveForceWrath();
|
||||
|
||||
VfxBase GiveCantActivateFanfare(string type);
|
||||
|
||||
VfxBase SetCantActivateFanfareCount(int count);
|
||||
|
||||
VfxBase DepriveCantActivateFanfare(string type);
|
||||
|
||||
VfxBase ForceDepriveCantActivateFanfare(string type);
|
||||
|
||||
VfxBase GiveCantActivateShortageDeckWin();
|
||||
|
||||
VfxBase DepriveCantActivateShortageDeckWin();
|
||||
|
||||
VfxBase ForceDepriveCantActivateShortageDeckWin();
|
||||
|
||||
VfxBase GiveForceSkillTarget();
|
||||
|
||||
VfxBase DepriveForceSkillTarget();
|
||||
|
||||
VfxBase ForceDepriveForceSkillTarget();
|
||||
|
||||
VfxBase GiveAttractSkillTarget();
|
||||
|
||||
VfxBase DepriveAttractSkillTarget();
|
||||
|
||||
VfxBase ForceDepriveAttractSkillTarget();
|
||||
|
||||
VfxBase GiveIndependent();
|
||||
|
||||
VfxBase DepriveIndependent();
|
||||
|
||||
VfxBase ForceDepriveIndependent();
|
||||
|
||||
void GiveNotBeDebuffed();
|
||||
|
||||
void DepriveNotBeDebuffed();
|
||||
|
||||
void ForceDepriveNotBeDebuffed();
|
||||
|
||||
VfxBase GiveForceAttack(string target, string type);
|
||||
|
||||
VfxBase DepriveForceAttack(string target, string type);
|
||||
|
||||
VfxBase ForceDepriveForceAttack(string target, string type);
|
||||
|
||||
VfxBase GiveExtraTurn(int addTurn);
|
||||
|
||||
VfxBase GiveSkillRandomCount(int randomCount);
|
||||
|
||||
VfxBase GiveSkillRandomArray(int[] array);
|
||||
|
||||
int GetDamageCutAmount(DamageCutInfo.DamageType type);
|
||||
|
||||
VfxBase GiveDamageCut(DamageCutInfo info);
|
||||
|
||||
VfxBase DepriveDamageCut(DamageCutInfo info);
|
||||
|
||||
VfxBase FourceDepriveDamageCut();
|
||||
|
||||
int GetClippingDamage(int damage, ParallelVfxPlayer lifeLowerLimitEffectVfx);
|
||||
|
||||
VfxBase GiveDamageMaxClipping(DamageClippingInfo clipping);
|
||||
|
||||
VfxBase DepriveDamageMaxClipping(DamageClippingInfo clipping);
|
||||
|
||||
VfxBase ForceDepriveDamageMaxClipping();
|
||||
|
||||
VfxBase GiveTurnStartFixedPP();
|
||||
|
||||
VfxBase DepriveTurnStartFixedPP();
|
||||
|
||||
VfxBase FourceDepriveTurnStartFixedPP();
|
||||
|
||||
VfxBase GiveChangeAffiliation(CardBasePrm.ClanType clan, CardBasePrm.TribeInfo tribeInfo, bool showEffect);
|
||||
|
||||
VfxBase DepriveChangeAffiliation(CardBasePrm.ClanType clan, CardBasePrm.TribeInfo tribeInfo);
|
||||
|
||||
VfxBase ForceDepriveChangeAffiliation();
|
||||
|
||||
VfxBase GiveNotConsumeEpModifier(NotConsumeEpModifierInfo info);
|
||||
|
||||
VfxBase DepriveNotConsumeEpModifier(NotConsumeEpModifierInfo info);
|
||||
|
||||
VfxBase ForceDepriveNotConsumeEpModifier();
|
||||
|
||||
bool CheckNotConsumeEpCard(BattleCardBase card);
|
||||
|
||||
VfxBase GiveShortageDeckWin();
|
||||
|
||||
VfxBase DepriveShortageDeckWin();
|
||||
|
||||
VfxBase ForceDepriveShortageDeckWin();
|
||||
|
||||
VfxBase GiveRemoveByBanish();
|
||||
|
||||
VfxBase DepriveRemoveByBanish();
|
||||
|
||||
VfxBase ForceDepriveRemoveByBanish();
|
||||
|
||||
VfxBase GiveRemoveByDestroy();
|
||||
|
||||
VfxBase DepriveRemoveByDestroy();
|
||||
|
||||
VfxBase ForceDepriveRemoveByDestroy();
|
||||
|
||||
VfxBase GiveTriggerCount(SkillProcessor skillProcessor);
|
||||
|
||||
VfxBase DepriveTriggerCount();
|
||||
|
||||
VfxBase ForceDepriveTriggerCount();
|
||||
|
||||
VfxBase AllSkillEffectStop(bool isEvolve = false, bool isReturn = false, bool isBuffed = false, bool isDebuffed = false);
|
||||
|
||||
VfxBase GiveRepeatSkill(string repeatTiming, string repeatTarget, SkillBase skill);
|
||||
|
||||
VfxBase DepriveRepeatSkill(string repeatTiming, string repeatTarget, bool reservation, bool isProcess, SkillProcessor skillProcessor);
|
||||
|
||||
VfxBase ReservationAllDepriveRepeatSkill();
|
||||
|
||||
VfxBase ForceDepriveRepeatSkill();
|
||||
|
||||
VfxBase GiveAddDamage(DamageModifier info);
|
||||
|
||||
VfxBase DepriveAddDamage(DamageModifier info);
|
||||
|
||||
VfxBase ForceDepriveAddDamage();
|
||||
|
||||
VfxBase GiveHealModifier(HealModifier info);
|
||||
|
||||
VfxBase DepriveHealModifier(HealModifier info);
|
||||
|
||||
VfxBase ForceDepriveHealModifier();
|
||||
|
||||
VfxBase GiveAddTarget(AddTargetInfo info);
|
||||
|
||||
VfxBase DepriveAddTarget(AddTargetInfo info);
|
||||
|
||||
VfxBase ForceDepriveAddTarget();
|
||||
|
||||
VfxBase GiveDecreaseTurnStartPP(int value);
|
||||
|
||||
VfxBase DepriveDecreaseTurnStartPP(int value);
|
||||
|
||||
VfxBase ForceDepriveDecreaseTurnStartPP();
|
||||
|
||||
VfxBase GiveRandomAttack();
|
||||
|
||||
VfxBase DepriveRandomAttack();
|
||||
|
||||
VfxBase ForceDepriveRandomAttack();
|
||||
|
||||
VfxBase GiveCantEvolution(int type);
|
||||
|
||||
VfxBase DepriveCantEvolution(int type);
|
||||
|
||||
VfxBase ForceDepriveCantEvolution();
|
||||
|
||||
VfxBase AddRandomSelectedCard(BattleCardBase card);
|
||||
|
||||
VfxBase RemoveRandomSelectedCard(BattleCardBase card);
|
||||
|
||||
VfxBase ClearRandomSelectedCard();
|
||||
|
||||
VfxBase AddSkillDrewCard(BattleCardBase card);
|
||||
|
||||
VfxBase RemoveSkillDrewCard(BattleCardBase card);
|
||||
|
||||
VfxBase ClearSkillDrewCard();
|
||||
|
||||
VfxBase AllSkillEffectRestart();
|
||||
|
||||
VfxBase AllSkillEffectStartOnSummon();
|
||||
|
||||
VfxBase CreateVfxSkillProtection(bool isForceStop = false);
|
||||
|
||||
void AddTokenDrawModifier(TokenDrawModifier modifier);
|
||||
|
||||
void RemoveTokenDrawModifier(TokenDrawModifier modifier);
|
||||
|
||||
void SaveTargetList(List<BattleCardBase> targetList);
|
||||
|
||||
List<BattleCardBase> LoadTargetList();
|
||||
|
||||
void SaveTargetCardId(long id, List<int> targetIdList);
|
||||
|
||||
List<int> LoadTargetCardId(long id);
|
||||
|
||||
void SaveBurialRiteTargetList(List<BattleCardBase> targetList);
|
||||
|
||||
List<BattleCardBase> LoadBurialRiteTargetList();
|
||||
|
||||
VfxBase GiveChantCount(ICardChantCountModifier chantCountModifier);
|
||||
|
||||
VfxBase DepriveChantCount(ICardChantCountModifier chantCountModifier);
|
||||
|
||||
VfxBase ForceDepriveChantCount();
|
||||
|
||||
int GetChantCount(int baseChantCount);
|
||||
|
||||
void AddFusionIngredientCard(BattleCardBase card);
|
||||
|
||||
void AddFusionIngredients(List<FusionIngredientInfo> fusionIngredients);
|
||||
|
||||
int GetFusionCount();
|
||||
|
||||
void AddGetOnCard(BattleCardBase card);
|
||||
|
||||
void ClearGetOnCards();
|
||||
|
||||
void AddLastBurialRiteCardList(List<BattleCardBase> cards);
|
||||
|
||||
void ClearLastBurialRiteCardList();
|
||||
|
||||
void GiveNotDecreasePP();
|
||||
|
||||
void DepriveNotDecreasePP();
|
||||
|
||||
void GiveLifeZeroActivateLeonSkill();
|
||||
|
||||
void DepriveLifeZeroActivateLeonSkill();
|
||||
|
||||
void AddSkillHealValue(int healValue);
|
||||
|
||||
VfxBase UpdateAllSkillEffectInReplay(List<NetworkBattleReceiver.InplaySkillEffect> inplaySkillEffectList, int inductionNumber, bool isInitialize, bool isOnlyCantAtk = false);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user