529 lines
26 KiB
C#
529 lines
26 KiB
C#
using System.Collections.Generic;
|
||
using Logic.Achievement;
|
||
using Logic.Action;
|
||
using NUnit.Framework.Constraints;
|
||
using NUnit.Framework.Internal.Commands;
|
||
using UnityEngine;
|
||
using RuntimeData;
|
||
using UnityEditor;
|
||
|
||
|
||
public enum TerrainType { None,Land, ShallowSea, DeepSea } // 海陆层
|
||
public enum TerrainFeature { None, Mountain,Road } // 地形层
|
||
public enum Vegetation { None, Trees } // 植被层
|
||
public enum ResourceType { None, Fish, Starfish, Metal, Animal, Fruit, Crop, CityCenter, Treasure, Farm, Mine, LumberHut,Port,Sawmill,Forge,Windmill, Wonder,Bridge,Market,Temple,ForestTemple,MountainTemple,WaterTemple,Tower } // 资源层+建筑层
|
||
public enum AttackAnimType {None,Melee,Arrow,Bomb}
|
||
public enum MainObjectType { None,Grid,City,Unit,Player}
|
||
|
||
public enum LandType { None,LandAndPort,WaterAndAshore,LandOnly,WaterOnly,LandAndWater,Fly}
|
||
|
||
public enum MoveAttackType { None,Move,Attack,MoveToPort,MoveAshore}
|
||
|
||
public enum UnitActionType { None,Upgrade,Recover,Heal,Examine,Gather,Capture,Disband,ROYALFLAMES}
|
||
|
||
public enum CityLevelUpActionType{None,Explorer,Workshop,CityWall,CityWealth,Expand,Population,Park,BigGuy}
|
||
|
||
public enum SkillType
|
||
{
|
||
NONE,
|
||
PEACE,
|
||
DASH,
|
||
ESCAPE,
|
||
PERSIST,
|
||
SPLASH,
|
||
SNEAK,
|
||
STIFF,
|
||
FORTIFY,
|
||
HEAL,
|
||
CONVERT,
|
||
CARRY,
|
||
SCOUT,
|
||
STATIC,
|
||
HIDE,
|
||
CREEP,
|
||
INFILTRATE,
|
||
BOOST,
|
||
EXPLODE,
|
||
STOMP,
|
||
ATTACKUP,
|
||
SPEEDUP,
|
||
FORESTDEFENSE,
|
||
WATERDEFENSE,
|
||
OCEANDEFENSE,
|
||
MOUNTAINDEFENSE,
|
||
MOUNTAINMOVE,
|
||
WATERMOVE,
|
||
OCEANMOVE,
|
||
SURPRISE,
|
||
POISON,
|
||
POISONED,
|
||
UNIQUE,
|
||
SWAP,
|
||
AUTOHEAL,
|
||
CITYTRANSPORT,
|
||
ALLYCOUNTER,
|
||
POWERUP,
|
||
ALLYTRANSPORT,
|
||
QUARTER,
|
||
TAICHI,
|
||
POORHEALTH,
|
||
ROYALFLAMES,
|
||
VAMPIRE,
|
||
SUPERDASH,
|
||
PHOENIX,
|
||
PHOENIXEGG,
|
||
ILLUSION,
|
||
LUCK,
|
||
CRITICAL,
|
||
MOONPRINCESS,
|
||
ETERNITY,
|
||
GALAXYARROW,
|
||
WINDGOD,
|
||
WINDPRIESTESS,
|
||
MOUNTAINGOD,
|
||
CURSEGOD,
|
||
NUCLEAR,
|
||
NUCLEARFUSION,
|
||
CATCART,
|
||
RECYCLE,
|
||
THIRDEYE,
|
||
SUPERHIDE,
|
||
|
||
|
||
// 文明技能
|
||
RemiliaForcesSkill1,
|
||
EgyptCivSkill1,
|
||
Max
|
||
}
|
||
|
||
public enum MoveType
|
||
{
|
||
ActiveMove,
|
||
PassiveMove,
|
||
AttackMove,
|
||
SkillMove,
|
||
PatrolMove
|
||
}
|
||
|
||
public class Table
|
||
{
|
||
//最大地图尺寸
|
||
public int MaxMapSize = 30;
|
||
//最大阵营数量
|
||
public int MaxForceCount = 8;
|
||
|
||
public TechDataAssets TechDataAssets;
|
||
public ActionDataAssets ActionDataAssets;
|
||
public UnitTypeDataAssets UnitTypeDataAssets;
|
||
public GridAndResourceDataAssets GridAndResourceDataAssets;
|
||
public AnimDataAssets AnimDataAssets;
|
||
public UICenterMessageDataAssets UICenterMessageDataAssets;
|
||
public PlayerDataAssets PlayerDataAssets;
|
||
public CivDataAssets CivDataAssets;
|
||
public SkillDataAssets SkillDataAssets;
|
||
public HintDataAssets HintDataAssets;
|
||
public LibraryDataAssets LibraryDataAssets;
|
||
|
||
public ColorDataAssets ColorDataAssets;
|
||
public TextDataAssets TextDataAssets;
|
||
|
||
//public AchievementAsset AchievementAsset;
|
||
|
||
|
||
//TH1Resource路径相关
|
||
public string[] TH1HousePath = new string[16] { "RemiliaForces", "KaguyaForces", "KanakoForces", "SatoriForces", "ReimuForces", "ByakurenForces", "MikoForces", "ZanmuForces", "Zebasi", "Ai-Mo", "Aquarion", "Quetzali", "Elyrion", "Yadakk", "Polaris", "Cymanti" };
|
||
//Forces名称list
|
||
string[] TH1ForcesNameList = new string[16] {"RemiliaForces", "KaguyaForces", "KanakoForces", "SatoriForces", "ReimuForces", "ByakurenForces", "MikoForces", "ZanmuForces", "Zebasi", "Ai-Mo", "Aquarion", "Quetzali", "Elyrion", "Yadakk", "Polaris", "Cymanti" };
|
||
//Civ名称list
|
||
string[] TH1CivsNameList = new string[16] { "Egyptian", "French", "Germany", "Indian", "Norway", "British", "Persian", "Byzantine", "Zebasi", "Aimo", "Aquarion", "Quetzali", "Elyrion", "Yadakk", "Polaris", "Cymanti" };
|
||
|
||
//------------ citybuilding相关 -----------------//
|
||
//不同等级城市拥有的房屋数量
|
||
public int[] cityLevel2HouseNumber = new int[21] { 0, 0, 4, 14, 26, 35, 55, 75, 95, 115, 135, 155, 175, 195, 215, 235, 255, 275, 295, 315, 335 };
|
||
|
||
//不同等级城市的房屋边长
|
||
public int[] cityLevel2HouseEdge = new int[21] { 0, 0, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 };
|
||
|
||
//不同等级城市的高度限制
|
||
public int[] cityLevel2HouseHeight = new int[]
|
||
{ 0, 0, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
|
||
|
||
//不同等级城市可以使用的房屋类型
|
||
public int[] cityLevel2HouseType = new int[]
|
||
{ 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
|
||
|
||
public string[] civNameList = new string[] { "埃及帝国-斯卡雷特王朝", "法兰西帝国-蓬莱山王朝", "德意志帝国-八坂王朝", "印度帝国-古明地王朝" ,"北海帝国-博丽王朝","大不列颠帝国-白莲王朝","萨珊帝国-丰聪耳王朝","拜占庭帝国-日白王朝"};
|
||
public int[] cityNameLibraryHat = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||
|
||
//查询ForcesName
|
||
public string QueryForcesName(uint t) { return TH1ForcesNameList[t]; }
|
||
|
||
//查询CivsName
|
||
public string QueryCivsName(uint t) { return TH1CivsNameList[t]; }
|
||
|
||
public static Table Instance { get; private set; }
|
||
// Start is called before the first frame update
|
||
public Table()//创建单例
|
||
{
|
||
Instance = this;
|
||
//加载assetsData
|
||
|
||
//多语言导表
|
||
TechDataAssets = Resources.Load<TechDataAssets>("Export/TechDataAssets");
|
||
ActionDataAssets = Resources.Load<ActionDataAssets>("Export/ActionDataAssets");
|
||
UnitTypeDataAssets = Resources.Load<UnitTypeDataAssets>("Export/UnitTypeDataAssets");
|
||
GridAndResourceDataAssets = Resources.Load<GridAndResourceDataAssets>("Export/GridAndResourceDataAssets");
|
||
GridAndResourceDataAssets.Init();
|
||
UICenterMessageDataAssets = Resources.Load<UICenterMessageDataAssets>("Export/UICenterMessageDataAssets");
|
||
PlayerDataAssets = Resources.Load<PlayerDataAssets>("Export/PlayerDataAssets");
|
||
CivDataAssets = Resources.Load<CivDataAssets>("Export/CivDataAssets");
|
||
SkillDataAssets = Resources.Load<SkillDataAssets>("Export/SkillDataAssets");
|
||
HintDataAssets = Resources.Load<HintDataAssets>("Export/HintDataAssets");
|
||
LibraryDataAssets = Resources.Load<LibraryDataAssets>("Export/LibraryDataAssets");
|
||
|
||
//不用导表
|
||
AnimDataAssets = Resources.Load<AnimDataAssets>("DataAssets/AnimDataAssets");
|
||
ColorDataAssets = Resources.Load<ColorDataAssets>("DataAssets/ColorDataAssets");
|
||
TextDataAssets = Resources.Load<TextDataAssets>("DataAssets/TextDataAssets");
|
||
|
||
//AchievementAsset = Resources.Load<AchievementAsset>("Export/AchievementAsset");
|
||
}
|
||
|
||
public Vector2Int WorldToGrid(Vector3 worldPos,string mark = "")
|
||
{
|
||
|
||
worldPos.y -= 4.2f;
|
||
if (mark == "isUnit") worldPos.y += 1f;
|
||
float a = 5.16f;
|
||
float b = 3.05f;
|
||
|
||
float x = (worldPos.y / b + worldPos.x / a) / 2f;
|
||
float y = (worldPos.y / b - worldPos.x / a) / 2f;
|
||
|
||
// 取整以定位到哪个格子(你可以用 Mathf.Round、Floor、Ceil 视实际需求)
|
||
int gridX = Mathf.FloorToInt(x);
|
||
int gridY = Mathf.FloorToInt(y);
|
||
|
||
return new Vector2Int(gridX, gridY);
|
||
}
|
||
|
||
public Vector3 GridToWorld(GridData gridData, string mark = "")
|
||
{
|
||
Vector2Int gridPos = new Vector2Int(gridData.Pos.X, gridData.Pos.Y);
|
||
if(mark == "isUnit")
|
||
return new Vector3(-5.16f * (gridPos.y - gridPos.x), 3.05f * (gridPos.x + gridPos.y) + 8f, gridPos.x + gridPos.y + 0.06f);
|
||
if(mark == "isCityInfo")
|
||
return new Vector3(-5.16f * (gridPos.y - gridPos.x), 3.05f * (gridPos.x + gridPos.y) + 0.7f, gridPos.x + gridPos.y);
|
||
return new Vector3(-5.16f * (gridPos.y - gridPos.x), 3.05f * (gridPos.x + gridPos.y) + 9.7f, gridPos.x + gridPos.y);
|
||
}
|
||
|
||
public Sprite QueryActionIconSprite(CommonActionId commonActionId, PlayerData playerData = null)
|
||
{
|
||
foreach (var actionData in ActionDataAssets.ActionList)
|
||
if (actionData.ActionId == commonActionId)
|
||
{
|
||
if (!actionData.VarientIcon)
|
||
return actionData.Icon;
|
||
if (playerData == null)
|
||
break;
|
||
foreach (var iconInfo in actionData.IconList)
|
||
{
|
||
if ((iconInfo.IgnoreCivId || iconInfo.CivId == playerData.PlayerCivId)
|
||
&& (iconInfo.IgnoreForceId || iconInfo.ForceId == playerData.PlayerForceId))
|
||
return iconInfo.Sprite;
|
||
}
|
||
break;
|
||
}
|
||
return null;
|
||
}
|
||
|
||
//计算距离
|
||
public int CalcDistance(Vector2Int A, Vector2Int B){return Mathf.Max(Mathf.Abs(A.x - B.x),Mathf.Abs(A.y - B.y));}
|
||
public int CalcDistance(GridData A, GridData B){return Mathf.Max(Mathf.Abs(A.Pos.X - B.Pos.X),Mathf.Abs(A.Pos.Y - B.Pos.Y));}
|
||
|
||
public int CalcDistance(MapData map, UnitData A, UnitData B)
|
||
{
|
||
if(!map.GetGridDataByUnitId(A.Id, out var g1))return 0;
|
||
if(!map.GetGridDataByUnitId(B.Id, out var g2))return 0;
|
||
|
||
return CalcDistance(g1,g2);
|
||
}
|
||
|
||
//计算攻防 TODO 增加damagePara和暴击的判断
|
||
public int CalcDamage(MapData map, UnitData A, UnitData B, bool counter = false, float damagePara = 1f)
|
||
{
|
||
int Ano = QueryUnitTypeToNo(A.UnitType);
|
||
float AVeteran = A.Veteran ? 5f : 0f;
|
||
float BVeteran = B.Veteran ? 5f : 0f;
|
||
|
||
int Bno = QueryUnitTypeToNo(B.UnitType);
|
||
float attackA = UnitTypeDataAssets.GetUnitTypeInfo(A.UnitType,A.GiantType,out var AInfo)?AInfo.Attack:0;
|
||
attackA *= damagePara;
|
||
float defenseB = UnitTypeDataAssets.GetUnitTypeInfo(B.UnitType,B.GiantType,out var BInfo)?BInfo.Defense:0;
|
||
float attackForce = attackA * (1f * A.Health / (A.GetMaxHealth() + AVeteran));
|
||
float defenseForce = defenseB * (1f * B.Health / (B.GetMaxHealth() + BVeteran)) * B.GetExtraDefense(map);
|
||
//Debug.Log(attackForce + " - " + defenseForce);
|
||
float totalDamage = attackForce + defenseForce;
|
||
int attackResult = (int)((attackForce / totalDamage) * attackA * 4.5f + 0.5f);
|
||
int defenseResult = (int)((defenseForce / totalDamage) * defenseB * 4.5f + 0.5f);
|
||
//Debug.Log((attackForce / totalDamage) * TH1UnitAttackList[Ano] * 4.5f);
|
||
if (counter) return defenseResult;
|
||
else return attackResult;
|
||
}
|
||
|
||
|
||
//UI显示文字相关
|
||
public string[] tileInfo(GridData t)//返回tile的名称,用于bottomInfoUI
|
||
{
|
||
string[] ret = new string[3];
|
||
ret[0] = t.Terrain switch
|
||
{
|
||
TerrainType.DeepSea => "深海",
|
||
TerrainType.ShallowSea => "浅海",
|
||
_ => "平原"
|
||
};
|
||
if (t.Feature == TerrainFeature.Mountain)
|
||
ret[0] = "山脉";
|
||
if (t.Vegetation == Vegetation.Trees)
|
||
ret[0] = "森林";
|
||
if (t.Resource == ResourceType.Animal)
|
||
ret[0] = "森林(动物)";
|
||
if (t.Resource == ResourceType.Fruit)
|
||
ret[0] = "蔬果";
|
||
if (t.Resource == ResourceType.Fish)
|
||
ret[0] = "浅海(鱼群)";
|
||
if (t.Resource == ResourceType.Treasure)
|
||
ret[0] = "遗迹";
|
||
if (t.Resource == ResourceType.Starfish)
|
||
ret[0] = "鲸鱼";
|
||
if (t.Resource == ResourceType.CityCenter)
|
||
ret[0] = "村庄";
|
||
if (t.Resource == ResourceType.Metal)
|
||
ret[0] = "山脉";
|
||
if (t.Resource == ResourceType.Crop)
|
||
ret[0] = "庄稼";
|
||
if (t.Resource == ResourceType.Mine)
|
||
ret[0] = "采矿场";
|
||
if (t.Resource == ResourceType.LumberHut)
|
||
ret[0] = "伐木场";
|
||
if (t.Resource == ResourceType.Farm)
|
||
ret[0] = "农田";
|
||
if (t.Resource == ResourceType.Windmill)
|
||
ret[0] = "谷仓";
|
||
if (t.Resource == ResourceType.Sawmill)
|
||
ret[0] = "锯木厂";
|
||
if (t.Resource == ResourceType.Forge)
|
||
ret[0] = "冶炼厂";
|
||
if (t.Resource == ResourceType.Market)
|
||
ret[0] = "市场";
|
||
if (t.Resource == ResourceType.Temple)
|
||
ret[0] = "英雄神像[马]";
|
||
if (t.Resource == ResourceType.ForestTemple)
|
||
ret[0] = "英雄神像[后]";
|
||
if (t.Resource == ResourceType.WaterTemple)
|
||
ret[0] = "英雄神像[相]";
|
||
if (t.Resource == ResourceType.MountainTemple)
|
||
ret[0] = "英雄神像[车]";
|
||
if (t.Resource == ResourceType.Tower)
|
||
ret[0] = "结界塔";
|
||
ret[1] = ret[0] switch
|
||
{
|
||
"深海" => "可建造神庙。需<color=yellow>帆船</color>、<color=yellow>海洋学</color>等科技。",
|
||
"浅海" => "可建造港口、桥梁和神庙。需<color=yellow>捕鱼</color>、<color=yellow>海洋学</color>、<color=yellow>道路</color>等科技。",
|
||
"山脉" => "可采矿或建造神庙。需<color=yellow>爬山</color>、<color=yellow>冥想</color>等科技。",
|
||
"港口" => "可改造船只或建立贸易路线。",
|
||
"浅海(鱼群)" => "可收获渔产。需<color=yellow>捕鱼</color>科技。",
|
||
"森林(动物)" => "可狩猎。需<color=yellow>狩猎</color>等科技。",
|
||
"森林" => "可伐木、焚林或建木材厂。需<color=yellow>伐木</color>、<color=yellow>建造</color>等科技。",
|
||
"蔬果" => "可采集蔬果。需<color=yellow>采集</color>科技。",
|
||
"庄稼" => "可建设农田。需<color=yellow>耕种</color>科技。",
|
||
"山脉(矿石)" => "可建设矿山。需<color=yellow>采矿</color>科技。",
|
||
"村庄" => "可占领并建立属于你的城市。",
|
||
"遗迹" => "可挖掘遗迹获得随机奖励。",
|
||
"鲸鱼" => "可捕获鲸鱼获得金钱。需<color=yellow>战舰</color>科技。",
|
||
"伐木场" => "需<color=yellow>数学</color>科技。可在伐木场周围1格建设锯木厂获得更多城市经验。",
|
||
"农田" => "需<color=yellow>建造</color>科技。可在农田周围1格建设谷仓获得更多城市经验",
|
||
"谷仓" => "周围的每片农田可以提供1点城市经验。每座城市仅能拥有一个谷仓。",
|
||
"锯木厂" => "周围的每座<color=yellow>伐木场</color>可以提供1点城市经验。每座城市仅能拥有一个锯木厂。",
|
||
"采矿场" => "需<color=yellow>采矿</color>科技。可在采矿场周围1格建设冶炼厂获得更多城市经验。",
|
||
"冶炼厂" => "周围的每座伐木场可以提供2点城市经验。每座城市仅能拥有一个冶炼厂。",
|
||
"市场" => "每回合提供周围<color=yellow>锯木厂</color>、<color=yellow>采矿场</color>、<color=yellow>冶炼厂</color>等级总和的额外金币(不超过8)。",
|
||
"英雄神像[马]" => "建设时提供100得分,每两回合额外提供50分,上限250分。",
|
||
"英雄神像[相]" => "建设时提供100得分,每两回合额外提供50分,上限250分。",
|
||
"英雄神像[车]" => "建设时提供100得分,每两回合额外提供50分,上限250分。",
|
||
"英雄神像[后]" => "建设时提供100得分,每两回合额外提供50分,上限250分。",
|
||
"结界塔" => "每当发现一座结界塔,首都将获得一点城市经验。发现所有结界塔后,即可建造一个奇观建筑。",
|
||
_ => "这是一片平原区域。解锁高阶科技完成更多建设活动。"
|
||
};
|
||
|
||
ret[2] = ret[0] switch
|
||
{
|
||
"深海" => "游戏前期可在深海地区遗迹或者捕鲸。后期则可在深海建设海洋神像获得信仰分。",
|
||
"浅海" => "游戏前期可在浅海捕鱼获取城市经验,中期可以建设港口发展海军,或连通城市贸易,也可以建设桥梁。",
|
||
"山脉" => "前期山脉是非常重要的防守屏障。后期则可以建设山脉神像获得信仰分。",
|
||
"港口" => "港口可以通过海路连通城市贸易获得城市经验,也是发展海军的基础。",
|
||
"浅海(鱼群)" => "拥有鱼群的浅海是前期获得城市经验的绝佳来源,别犹豫,快来捕鱼吧!",
|
||
"森林(动物)" => "拥有动物的树林是前期获得城市经验的绝佳来源,别犹豫,快来狩猎吧!",
|
||
"森林" => "在森林生产士兵,是专属于红魔馆妖精女仆的特色效果哦~",
|
||
"蔬果" => "拥有蔬果的平原是前期获得城市经验的绝佳来源,别犹豫,快来采集吧!",
|
||
"庄稼" => "将庄稼改造为农田后能为城市较多经验,是平原型城市快速发展的主要手段。",
|
||
"山脉(矿石)" => "拥有矿石的山脉能够为城市提供较多经验,借助冶炼科技快速发展起来吧!",
|
||
"村庄" => "占领村庄是帝国发展的基石,但是更多的村庄也会让科技的学习更贵。",
|
||
"遗迹" => "遗迹会提供随机科技、金钱或者战斗单位,就看你的手气了。",
|
||
"鲸鱼" => "捕获鲸鱼将会获得大量金钱,在别人没有发现他之前,快来捕鲸吧。",
|
||
"伐木场" => "在附近建设锯木厂,能够为城市提供更多的经验。",
|
||
"农田" => "在附近建设谷仓,能够为城市提供更多的经验。",
|
||
"谷仓" => "如果在谷仓附件建设市场,将会获得更多的每回合金钱。",
|
||
"锯木厂" => "如果在锯木厂附件建设市场,将会获得更多的每回合金钱。",
|
||
"采矿场" => "如果在采矿场附件建设冶炼厂,能够为城市提供更多的经验。",
|
||
"冶炼厂" => "如果在冶炼厂附件建设市场,将会获得更多的每回合金钱。",
|
||
"市场" => "提升市场周围锯木厂、采矿场和谷仓的等级,将会获得更多的每回合金钱!",
|
||
"英雄神像[马]" => "越早建立神像,能够获得越多的得分。请把握好你的建设时间。",
|
||
"英雄神像[相]" => "越早建立神像,能够获得越多的得分。请把握好你的建设时间。",
|
||
"英雄神像[车]" => "越早建立神像,能够获得越多的得分。请把握好你的建设时间。",
|
||
"英雄神像[后]" => "英雄神像[后]是造价最低的神像,运用好森林资源,可能会获得意想不到的成功。",
|
||
"结界塔" => "分配兵力去探索结界塔,也能为前期的城市建设提供意想不到的助力!",
|
||
_ => "提升科技是提升发展效率的关键。"
|
||
};
|
||
return ret;
|
||
}
|
||
|
||
|
||
public string civName(int civId) { return civNameList[civId]; }
|
||
public string[] unitInfo(UnitData u, GiantType g = GiantType.None)//返回tile的名称,用于bottomInfoUI
|
||
{
|
||
string[] ret = new string[3];
|
||
ret[0] = u.UnitType switch
|
||
{
|
||
UnitType.Warrior => "步兵",
|
||
UnitType.Rider => "游骑兵",
|
||
UnitType.Defender => "盾兵",
|
||
UnitType.Archer => "弓兵",
|
||
UnitType.Knights => "骑士",
|
||
UnitType.Catapult => "炮手",
|
||
UnitType.Swordsman => "剑士",
|
||
UnitType.Boat => "帆船",
|
||
UnitType.Ship => "克拉克",
|
||
UnitType.RammerShip => "突击艇",
|
||
UnitType.BomberShip => "战舰",
|
||
UnitType.BigGuy => "巨人",
|
||
_ => ""
|
||
};
|
||
if (u.UnitType == UnitType.Giant)
|
||
{
|
||
ret[0] = u.GiantType switch
|
||
{
|
||
GiantType.EgyptianFlandre => "芙兰朵露·斯卡雷特",
|
||
GiantType.EgyptianMeiling => "红美铃",
|
||
GiantType.EgyptianPatchouli => "帕秋莉·诺蕾姬",
|
||
GiantType.EgyptianRemilia => "蕾米莉亚·斯卡雷特",
|
||
GiantType.EgyptianSakuya => "十六夜咲夜",
|
||
_ => ""
|
||
};
|
||
}
|
||
|
||
ret[1] = ret[0] switch
|
||
{
|
||
"步兵" => "基础单位。拥有<color=yellow>冲锋</color>和<color=yellow>城防</color>技能。",
|
||
"游骑兵" => "高机动性单位。拥有2移动力和<color=yellow>冲刺</color>、<color=yellow>城防</color>、<color=yellow>遁走</color>技能。",
|
||
"弓兵" => "远程单位,拥有2射程和<color=yellow>冲刺</color>、<color=yellow>城防</color>技能。",
|
||
"盾兵" => "防御单位。拥有3防御力和<color=yellow>城防</color>技能。",
|
||
"骑士" => "强力机动单位。拥有3移动力3.5攻击力和<color=yellow>冲锋</color>、<color=yellow>连续杀敌</color>技能。",
|
||
"炮兵" => "强力远程单位。拥有3射程4攻击力和<color=yellow>城防</color>技能。无法反击。",
|
||
"剑士" => "强力综合单位。拥有3防御力3攻击力和<color=yellow>冲锋</color>技能。",
|
||
"巨人" => "超强力综合单位。拥有40血量和4攻击力。",
|
||
"帆船" => "基础海上单位。拥有2移动力,无法攻击。",
|
||
"克拉克" => "海上远程单位。拥有3移动力2射程和<color=yellow>巡洋</color>、<color=yellow>冲锋</color>技能。",
|
||
"突击艇" => "海上强力近战。拥有3移动力3攻击力3防御力和<color=yellow>冲锋</color>技能。",
|
||
"战舰" => "海上超强远程。拥有2移动力3.5攻击力3射程和<color=yellow>溅射</color>技能。无法反击。",
|
||
"芙兰朵露·斯卡雷特" => "<color=yellow>马</color>职阶英雄,破局型英雄。拥有<color=yellow>四重存在</color>等技能。",
|
||
"红美铃" => "<color=yellow>车</color>职阶英雄,战士型英雄。拥有<color=yellow>虹色太极拳</color>等技能。",
|
||
"帕秋莉·诺蕾姬" => "<color=yellow>相</color>职阶英雄,辅助型英雄。拥有<color=yellow>皇家烈焰</color>技能。",
|
||
"蕾米莉亚·斯卡雷特" => "<color=yellow>王</color>职阶英雄,防御型英雄。拥有<color=yellow>绯红之击</color>技能。",
|
||
"十六夜咲夜" => "<color=yellow>车</color>职阶英雄,刺客型英雄,拥有<color=yellow>银之跳跃</color>等技能。",
|
||
_ => ""
|
||
};
|
||
|
||
ret[2] = ret[0] switch
|
||
{
|
||
"步兵" => "攻防兼备,最高性价比的基础单位。当没有别的选择的时候,就训练她们吧!",
|
||
"游骑兵" => "移动力强,攻击后还能再次移动,非常灵活,但是也很脆弱!",
|
||
"弓兵" => "前期具备极大优势的远程单位,但是较为脆弱,好好利用站在树林时的额外防御吧!",
|
||
"盾兵" => "造价低廉而强大的防守单位。当你面对威胁时,就选择她吧!",
|
||
"骑士" => "击杀敌方后可继续杀敌。一人就能杀穿一整支脆皮军团。",
|
||
"炮兵" => "极远的射程,极高的攻击,暴力攻城或是后排防守,都是极好的选择。",
|
||
"剑士" => "六边形战士,高防御高攻击,如果配合道路的移动加成将会是无敌的存在。",
|
||
"巨人" => "超规格的强大单位,在防守中逆转战局或是进攻中势如破竹,她一定是绝对主角。",
|
||
"帆船" => "海洋单位的基础,在没有考虑好升级什么舰种之前,不妨就保持这个状态吧。",
|
||
"克拉克" => "极高的移动力,2格视野与2格射程,攻防兼备的帆船将令敌军头疼不已。",
|
||
"突击艇" => "极高的移动力,高防御高攻击,还可以直接登录陆地,是海洋攻城战的绝对主力。",
|
||
"战舰" => "极远的射程,极高的攻击,叠加恐怖的溅射伤害,战舰是后期海战的核心力量。",
|
||
"芙兰朵露·斯卡雷特" => "作为<color=yellow>马</color>职阶英雄,<color=yellow>四重存在</color>技能让芙兰朵露成为出乎意料的破局者。",
|
||
"红美铃" => "作为<color=yellow>车</color>职阶英雄,<color=yellow>太极</color>技能让美铃面对近战敌人展现出近乎辗轧的强大力量。",
|
||
"帕秋莉·诺蕾姬" => "作为<color=yellow>后</color>职阶英雄,<color=yellow>皇家烈焰</color>技能让帕秋莉成为最强火力。",
|
||
"蕾米莉亚·斯卡雷特" => "作为<color=yellow>王</color>职阶英雄,<color=yellow>吸血盛宴</color>技能让蕾米莉亚具备超强的续航守城能力。",
|
||
"十六夜咲夜" => "作为<color=yellow>相</color>职阶英雄,咲夜拥有非常强的机动性和连续杀敌能力。",
|
||
_ => ""
|
||
};
|
||
|
||
return ret;
|
||
}
|
||
|
||
public int QueryUnitTypeToNo(UnitType unitType)
|
||
{
|
||
return unitType switch
|
||
{
|
||
UnitType.Warrior => 0,
|
||
UnitType.Rider => 1,
|
||
UnitType.Archer => 2,
|
||
UnitType.Defender => 3,
|
||
UnitType.Knights => 4,
|
||
UnitType.Catapult => 5,
|
||
UnitType.Swordsman => 6,
|
||
UnitType.Cloak => 7,
|
||
UnitType.Minder => 8,
|
||
UnitType.Boat => 9,
|
||
UnitType.Ship => 10,
|
||
UnitType.RammerShip => 11,
|
||
UnitType.BomberShip => 12,
|
||
_ => -1
|
||
};
|
||
}
|
||
|
||
|
||
public int QueryActionExp(CommonActionId actionId)
|
||
{
|
||
//Debug.Log();
|
||
ActionDataAssets.GetActionInfo(actionId, out var actionInfo);
|
||
//Debug.Log(actionInfo.CityExp);
|
||
return actionInfo.CityExp;
|
||
}
|
||
|
||
public int GiantToInt(GiantType g)
|
||
{
|
||
return g switch
|
||
{
|
||
GiantType.EgyptianRemilia => 0,
|
||
GiantType.EgyptianPatchouli => 1,
|
||
GiantType.EgyptianSakuya => 2,
|
||
GiantType.EgyptianFlandre => 3,
|
||
GiantType.EgyptianMeiling => 4,
|
||
_ => -1
|
||
};
|
||
}
|
||
|
||
public int TempleToInt(ResourceType r)
|
||
{
|
||
return r switch
|
||
{
|
||
ResourceType.ForestTemple => 1,
|
||
ResourceType.WaterTemple => 2,
|
||
ResourceType.Temple => 3,
|
||
ResourceType.MountainTemple => 4,
|
||
_ => -1
|
||
};
|
||
}
|
||
}
|
||
|
||
|