using System.Collections.Generic; 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, 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; //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("Export/TechDataAssets"); ActionDataAssets = Resources.Load("Export/ActionDataAssets"); UnitTypeDataAssets = Resources.Load("Export/UnitTypeDataAssets"); GridAndResourceDataAssets = Resources.Load("Export/GridAndResourceDataAssets"); GridAndResourceDataAssets.Init(); AnimDataAssets = Resources.Load("Export/AnimDataAssets"); UICenterMessageDataAssets = Resources.Load("Export/UICenterMessageDataAssets"); PlayerDataAssets = Resources.Load("Export/PlayerDataAssets"); CivDataAssets = Resources.Load("Export/CivDataAssets"); SkillDataAssets = Resources.Load("Export/SkillDataAssets"); HintDataAssets = Resources.Load("Export/HintDataAssets"); } 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 bool QueryUnitHasSkill(UnitType unitType, SkillType skillType) { return unitType switch { UnitType.Warrior => skillType == SkillType.FORTIFY|| skillType == SkillType.DASH, UnitType.Rider => skillType == SkillType.DASH || skillType == SkillType.ESCAPE || skillType == SkillType.FORTIFY, UnitType.Archer => skillType == SkillType.DASH || skillType == SkillType.FORTIFY, UnitType.Defender => skillType == SkillType.FORTIFY, UnitType.Knights => skillType == SkillType.DASH || skillType == SkillType.PERSIST || skillType == SkillType.FORTIFY, UnitType.Catapult => skillType == SkillType.STIFF, UnitType.Swordsman => skillType == SkillType.DASH, UnitType.Cloak => false, UnitType.Minder => skillType == SkillType.HEAL || skillType == SkillType.CONVERT || skillType == SkillType.STIFF, UnitType.Boat => skillType == SkillType.CARRY || skillType == SkillType.STATIC || skillType == SkillType.STIFF, UnitType.Ship => skillType == SkillType.DASH || skillType == SkillType.CARRY || skillType == SkillType.STATIC || skillType == SkillType.SCOUT, UnitType.RammerShip => skillType == SkillType.DASH || skillType == SkillType.CARRY || skillType == SkillType.STATIC, UnitType.BomberShip => skillType == SkillType.CARRY || skillType == SkillType.STATIC || skillType == SkillType.STIFF || skillType == SkillType.SPLASH, _ => false }; } //public string QueryUnitSpritePath(uint civId, UnitType unitType) { return $"ArtResources/TH1Units/{TH1HousePath[civId]}/{TH1FirstSkinPath[civId]}/{TH1HousePath[civId]}_{TH1FirstSkinPath[civId]}_{UnitTypeToName(unitType)}"; } //public string QueryFruitSpritePath(uint pid) { return $"ArtResources/TH1Fruits/TH1Fruit_{TH1CivsNameList[pid]}"; } //public string QueryWonderSpritePath(uint pid, string wonderName) { return $"ArtResources/TH1Buildings/TH1Buildings{TH1ForcesNameList[pid]}/{TH1CivsNameList[pid]}/{TH1ForcesNameList[pid]}_{TH1CivsNameList[pid]}_{wonderName}"; } //public string QueryAnimalSpritePath(uint cid) { return $"ArtResources/TH1Animals/TH1Animal_{TH1CivsNameList[cid]}"; } //计算距离 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; } public float QueryDamage(int HP1,int HP2,int maxHP1,int maxHP2,int atk1,int atk2,int dfs1,int dfs2,bool counter = false) { return 5f; } //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 { "深海" => "可建造神庙。需帆船、海洋学等科技。", "浅海" => "可建造港口、桥梁和神庙。需捕鱼、海洋学、道路等科技。", "山脉" => "可采矿或建造神庙。需爬山、冥想等科技。", "港口" => "可改造船只或建立贸易路线。", "浅海(鱼群)" => "可收获渔产。需捕鱼科技。", "森林(动物)" => "可狩猎。需狩猎等科技。", "森林" => "可伐木、焚林或建木材厂。需伐木、建造等科技。", "蔬果" => "可采集蔬果。需采集科技。", "庄稼" => "可建设农田。需耕种科技。", "山脉(矿石)" => "可建设矿山。需采矿科技。", "村庄" => "可占领并建立属于你的城市。", "遗迹" => "可挖掘遗迹获得随机奖励。", "鲸鱼" => "可采集海星获得金钱。需远洋导航科技。", "伐木场" => "需数学科技。可在伐木场周围1格建设加工厂获得更多城市经验。", "农田" => "需建造科技。可在农田周围1格建设谷仓获得更多城市经验", "谷仓" => "周围的每片农田可以提供1点城市经验。每座城市仅能拥有一个谷仓。", "加工厂" => "周围的每座伐木场可以提供1点城市经验。每座城市仅能拥有一个加工厂。", "采矿场" => "需采矿科技。可在采矿场周围1格建设冶炼厂获得更多城市经验。", "冶炼厂" => "周围的每座伐木场可以提供2点城市经验。每座城市仅能拥有一个冶炼厂。", "市场" => "每回合提供周围加工厂、采矿场、冶炼厂等级总和的额外金币(不超过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 (g != GiantType.None) { ret[0] = u.GiantType switch { GiantType.EgyptianFlandre => "芙兰朵露·斯卡雷特", GiantType.EgyptianMeiling => "红美铃", GiantType.EgyptianPatchouli => "帕秋莉·诺蕾姬", GiantType.EgyptianRemilia => "蕾米莉亚·斯卡雷特", GiantType.EgyptianSakuya => "十六夜咲夜", _ => "" }; } ret[1] = ret[0] switch { "步兵" => "基础单位。拥有冲刺和城防技能。", "轻骑兵" => "高机动性单位。拥有2移动力和冲刺、城防、遁走技能。", "射手" => "远程单位,拥有2射程和冲刺、城防技能。", "盾兵" => "防御单位。拥有3防御力和城防技能。", "重骑兵" => "强力机动单位。拥有3移动力3.5攻击力和冲刺、连续杀敌技能。", "炮兵" => "强力远程单位。拥有3射程4攻击力和城防技能。无法反击。", "剑士" => "强力综合单位。拥有3防御力3攻击力和冲刺技能。", "巨人" => "超强力综合单位。拥有40血量和4攻击力。", "小船" => "基础海上单位。拥有2移动力,无法攻击。", "帆船" => "海上远程单位。拥有3移动力2射程和巡洋、冲刺技能。", "冲锋艇" => "海上强力近战。拥有3移动力3攻击力3防御力和冲刺技能。", "战舰" => "海上超强远程。拥有2移动力3.5攻击力3射程和溅射技能。无法反击。", "芙兰朵露·斯卡雷特" => "马职阶伟人,破局者。拥有四重存在技能。", "红美铃" => "车职阶伟人,狂战士。拥有太极技能。", "帕秋莉·诺蕾姬" => "相职阶伟人,强大辅助。拥有皇家烈焰技能。", "蕾米莉亚·斯卡雷特" => "王职阶伟人,铜墙铁壁。拥有吸血盛宴技能。", "十六夜咲夜" => "车职阶伟人,超高机动性刺客,拥有时间停止技能。", _ => "" }; ret[2] = ret[0] switch { "步兵" => "攻防兼备,最高性价比的基础单位。当没有别的选择的时候,就训练她们吧!", "轻骑兵" => "移动力强,攻击后还能再次移动,非常灵活,但是也很脆弱!", "射手" => "前期具备极大优势的远程单位,但是较为脆弱,好好利用站在树林时的额外防御吧!", "盾兵" => "造价低廉而强大的防守单位。当你面对威胁时,就选择她吧!", "重骑兵" => "击杀敌方后可继续杀敌。一人就能杀穿一整支脆皮军团。", "炮兵" => "极远的射程,极高的攻击,暴力攻城或是后排防守,都是极好的选择。", "剑士" => "六边形战士,高防御高攻击,如果配合道路的移动加成将会是无敌的存在。", "巨人" => "超规格的强大单位,在防守中逆转战局或是进攻中势如破竹,她一定是绝对主角。", "小船" => "海洋单位的基础,在没有考虑好升级什么舰种之前,不妨就保持这个状态吧。", "帆船" => "极高的移动力,2格视野与2格射程,攻防兼备的帆船将令敌军头疼不已。", "冲锋艇" => "极高的移动力,高防御高攻击,还可以直接登录陆地,是海洋攻城战的绝对主力。", "战舰" => "极远的射程,极高的攻击,叠加恐怖的溅射伤害,战舰是后期海战的核心力量。", "芙兰朵露·斯卡雷特" => "作为马职阶伟人,四重存在技能让芙兰朵露成为出乎意料的破局者。", "红美铃" => "作为车职阶伟人,太极技能让美铃面对近战敌人展现出近乎辗轧的强大力量。", "帕秋莉·诺蕾姬" => "作为后职阶伟人,皇家烈焰技能让帕秋莉成为最强火力。", "蕾米莉亚·斯卡雷特" => "作为王职阶伟人,吸血盛宴技能让蕾米莉亚具备超强的续航守城能力。", "十六夜咲夜" => "作为相职阶伟人,咲夜拥有非常强的机动性和连续杀敌能力。", _ => "" }; 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 }; } //返回每个action的cost public int QueryActionCost(CommonActionId actionId) { if (actionId.ActionType == CommonActionType.Build) { if (actionId.ResourceType == ResourceType.LumberHut) return 3; if (actionId.ResourceType == ResourceType.Temple || actionId.ResourceType == ResourceType.ForestTemple || actionId.ResourceType == ResourceType.WaterTemple || actionId.ResourceType == ResourceType.MountainTemple ) return 20; return 5; } else if (actionId.ActionType == CommonActionType.TrainUnit) { return UnitTypeDataAssets.GetUnitTypeInfo(actionId.UnitType,actionId.GiantType,out var Info)?Info.Cost:0; } else if (actionId.ActionType == CommonActionType.Gain) { return 2; } return 0; } public int QueryActionExp(CommonActionId actionId) { //Debug.Log(); ActionDataAssets.GetActionInfo(actionId, out var actionInfo); //Debug.Log(actionInfo.CityExp); return actionInfo.CityExp; } }