初始资源优化
This commit is contained in:
parent
df15a9d3e9
commit
efdef5869f
@ -189,5 +189,102 @@ MonoBehaviour:
|
||||
- "\u2026\u2026\u8001\u8EAB\u5C0F\u77A7\u4F60\u4E86\u3002"
|
||||
- "\u4E0D\u6789\u6B64\u6218\uFF0C\u6765\u65E5\u5B9A\u8BA8\u56DE\u6765\u3002"
|
||||
- "\u4E5F\u7F62\u2026\u2026"
|
||||
CivLandformList:
|
||||
- civ: 1
|
||||
LandformParamList:
|
||||
- LandformType: 2
|
||||
ParamPackDesc: "\u6781\u5C11\u6811"
|
||||
TerrainType: 0
|
||||
ResourceType: 0
|
||||
Rate: 0.2
|
||||
InnerOuterCity: 0
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6781\u5C11\u52A8\u7269"
|
||||
TerrainType: 0
|
||||
ResourceType: 4
|
||||
Rate: 0.2
|
||||
InnerOuterCity: 0
|
||||
- LandformType: 1
|
||||
ParamPackDesc: "\u5C11\u5C71"
|
||||
TerrainType: 0
|
||||
ResourceType: 0
|
||||
Rate: 0.5
|
||||
InnerOuterCity: 0
|
||||
- civ: 2
|
||||
LandformParamList:
|
||||
- LandformType: 2
|
||||
ParamPackDesc: "\u6781\u5C11\u6811"
|
||||
TerrainType: 0
|
||||
ResourceType: 0
|
||||
Rate: 0.2
|
||||
InnerOuterCity: 0
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u591A\u7530"
|
||||
TerrainType: 0
|
||||
ResourceType: 6
|
||||
Rate: 1.5
|
||||
InnerOuterCity: 0
|
||||
CommonLandform:
|
||||
LandformParamList:
|
||||
- LandformType: 1
|
||||
ParamPackDesc: "\u6807\u51C6\u5C71\u8109"
|
||||
TerrainType: 0
|
||||
ResourceType: 0
|
||||
Rate: 0.14
|
||||
InnerOuterCity: 0
|
||||
- LandformType: 2
|
||||
ParamPackDesc: "\u6807\u51C6\u6811\u6797"
|
||||
TerrainType: 0
|
||||
ResourceType: 0
|
||||
Rate: 0.38
|
||||
InnerOuterCity: 0
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5185\u6C34\u679C"
|
||||
TerrainType: 0
|
||||
ResourceType: 5
|
||||
Rate: 0.375
|
||||
InnerOuterCity: 1
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5916\u6C34\u679C"
|
||||
TerrainType: 0
|
||||
ResourceType: 5
|
||||
Rate: 0.125
|
||||
InnerOuterCity: 2
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5185\u5E84\u7A3C"
|
||||
TerrainType: 0
|
||||
ResourceType: 6
|
||||
Rate: 0.375
|
||||
InnerOuterCity: 1
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5916\u5E84\u7A3C"
|
||||
TerrainType: 0
|
||||
ResourceType: 6
|
||||
Rate: 0.125
|
||||
InnerOuterCity: 2
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5185\u52A8\u7269"
|
||||
TerrainType: 0
|
||||
ResourceType: 4
|
||||
Rate: 0.5
|
||||
InnerOuterCity: 1
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5916\u52A8\u7269"
|
||||
TerrainType: 0
|
||||
ResourceType: 4
|
||||
Rate: 0.158
|
||||
InnerOuterCity: 2
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5185\u77FF\u77F3"
|
||||
TerrainType: 0
|
||||
ResourceType: 4
|
||||
Rate: 0.785
|
||||
InnerOuterCity: 1
|
||||
- LandformType: 4
|
||||
ParamPackDesc: "\u6807\u51C6\u57CE\u5916\u77FF\u77F3"
|
||||
TerrainType: 0
|
||||
ResourceType: 4
|
||||
Rate: 0.214
|
||||
InnerOuterCity: 2
|
||||
CommonColor: {r: 0.28627452, g: 0.76862746, b: 0.11764706, a: 1}
|
||||
CommonPlayerAvatar: {fileID: 21300000, guid: 27c14bbfb04f5554d9e68f2ce3ffb487, type: 3}
|
||||
|
||||
@ -99214,7 +99214,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 4c0a91e9c554c694791fbd5691165798, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
NoAI: 1
|
||||
NoAI: 0
|
||||
FullSight: 0
|
||||
AIActionTime: 0.5
|
||||
AIAllTech: 0
|
||||
|
||||
@ -469,8 +469,8 @@ namespace RuntimeData
|
||||
{
|
||||
//Step #1 处理海军点 TODO 将来要并入skill去
|
||||
NavalBasePoint = 1;
|
||||
//Step #2 处理kaguyaFrenchAnimal TODO 将来用并入skill去
|
||||
if (Resource == ResourceType.KaguyaFrenchYard)
|
||||
//Step #2 处理kaguyaFrenchAnimal(必须是该grid玩家的回合) TODO 将来用并入skill去
|
||||
if (Resource == ResourceType.KaguyaFrenchYard && map.CheckIfGidBelongPid(Id,Main.Instance.GameLogic.CurPlayer.Id))
|
||||
{
|
||||
KaguyaFrenchAnimalTime++;
|
||||
if (KaguyaFrenchAnimalTime >= 2)
|
||||
|
||||
@ -445,7 +445,7 @@ namespace RuntimeData
|
||||
if(!Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(UnitType, GiantType,UnitLevel, out var info)) return 0;
|
||||
if (IsCriticalHitRate(map)) return info.Attack * GetExtraAttack(map) * 2;
|
||||
var value = info.Attack * GetExtraAttack(map);
|
||||
if (target != null) value *= target.GetAttackerValueOffset(map);
|
||||
if (target != null) value += this.GetAttackerValueOffset(map,target);
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -464,7 +464,7 @@ namespace RuntimeData
|
||||
{
|
||||
if(!Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(UnitType, GiantType,UnitLevel, out var info)) return 0;
|
||||
var value = info.Defense * GetExtraDefense(map);
|
||||
if (origin != null) value *= origin.GetDefenderValueOffset(map);
|
||||
if (origin != null) value += origin.GetDefenderValueOffset(map,origin);
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -513,18 +513,18 @@ namespace RuntimeData
|
||||
}
|
||||
|
||||
// 受攻击时给对方的攻击力偏移
|
||||
public int GetAttackerValueOffset(MapData mapData)
|
||||
public float GetAttackerValueOffset(MapData mapData,UnitData target)
|
||||
{
|
||||
var value = 0;
|
||||
foreach (var skill in Skills) value += skill.GetAttackerValueOffset(mapData);
|
||||
var value = 0f;
|
||||
foreach (var skill in Skills) value += skill.GetAttackerValueOffset(mapData,target);
|
||||
return value;
|
||||
}
|
||||
|
||||
// 攻击时给对方的防御力偏移
|
||||
public int GetDefenderValueOffset(MapData mapData)
|
||||
public float GetDefenderValueOffset(MapData mapData,UnitData origin)
|
||||
{
|
||||
var value = 0;
|
||||
foreach (var skill in Skills) value += skill.GetDefenderValueOffset(mapData);
|
||||
var value = 0f;
|
||||
foreach (var skill in Skills) value += skill.GetDefenderValueOffset(mapData,origin);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@ -5,11 +5,37 @@ using UnityEngine;
|
||||
using RuntimeData;
|
||||
using Logic.Multilingual;
|
||||
|
||||
public enum CivEnum
|
||||
{
|
||||
Common,
|
||||
Egyptian,
|
||||
French,
|
||||
Germany,
|
||||
Indian,
|
||||
Norway,
|
||||
Britain,
|
||||
Persian,
|
||||
Byzantine,
|
||||
Max
|
||||
}
|
||||
|
||||
public enum LandformType
|
||||
{
|
||||
Terrain,
|
||||
Mountain,
|
||||
Tree,
|
||||
Road,
|
||||
Resource,
|
||||
Max
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[CreateAssetMenu(fileName = "PlayerDataAssets", menuName = "TH1 Game Data/Player Data Asset")]
|
||||
public class PlayerDataAssets : ScriptableObject
|
||||
{
|
||||
public List<PlayerInfo> PlayerDataList = new List<PlayerInfo>();
|
||||
public List<CivLandformPack> CivLandformList = new List<CivLandformPack>();
|
||||
public CommonLandformPack CommonLandform;
|
||||
public Color CommonColor;
|
||||
public Sprite CommonPlayerAvatar;
|
||||
private Dictionary<UnitType,UnitTypeInfo> _unitTypeDict = new Dictionary<UnitType, UnitTypeInfo>();
|
||||
@ -63,6 +89,53 @@ public class PlayerDataAssets : ScriptableObject
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------- 处理初始资源参数的模块 -------------------------------------
|
||||
|
||||
public bool GetCivLandformPack(CivEnum civ, out CivLandformPack info)
|
||||
{
|
||||
foreach(var t in CivLandformList)
|
||||
if (t.civ == civ)
|
||||
{
|
||||
info = t;
|
||||
return true;
|
||||
}
|
||||
|
||||
info = null;
|
||||
return false;
|
||||
}
|
||||
//terrain重载
|
||||
public float GetLandformRate(TerrainType terrain, CivEnum civ)
|
||||
{
|
||||
var ret = 1f;
|
||||
//if (tree != Vegetation.Trees) return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
//tree重载(树占平地的比例)
|
||||
public float GetLandformRate(Vegetation tree, CivEnum civ = CivEnum.Common,InnerOuterCity innerOuterCity = InnerOuterCity.All)
|
||||
{
|
||||
var ret = 1f;
|
||||
if (tree != Vegetation.Trees) return ret;
|
||||
//return CommonLandform.
|
||||
return ret;
|
||||
}
|
||||
|
||||
//mountain重载 (山占所有陆地的比例)
|
||||
public float GetLandformRate(TerrainFeature mountain, CivEnum civ = CivEnum.Common,InnerOuterCity innerOuterCity = InnerOuterCity.All)
|
||||
{
|
||||
var ret = 1f;
|
||||
if (mountain != TerrainFeature.Mountain) return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
//animal/fruit/crop/metal重载(animal占森林的比例)
|
||||
public float GetLandformRate(ResourceType resource, CivEnum civ = CivEnum.Common,InnerOuterCity innerOuterCity = InnerOuterCity.All)
|
||||
{
|
||||
var ret = 1f;
|
||||
if (!(resource is ResourceType.Metal or ResourceType.Crop or ResourceType.Farm or ResourceType.Fruit)) return ret;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@ -116,4 +189,43 @@ public class PlayerInfo
|
||||
else return "0";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class CivLandformPack
|
||||
{
|
||||
public CivEnum civ;
|
||||
public List<LandformParamItem> LandformParamList;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CommonLandformPack
|
||||
{
|
||||
public CivEnum civ;
|
||||
public List<LandformParamItem> LandformParamList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum InnerOuterCity
|
||||
{
|
||||
All,
|
||||
InnerCity,
|
||||
OuterCity,
|
||||
Max
|
||||
}
|
||||
|
||||
//单个的地貌数据参数,例如“少山的”“多山的”“多海的”之类的
|
||||
[Serializable]
|
||||
public class LandformParamItem
|
||||
{
|
||||
|
||||
public LandformType LandformType;
|
||||
public string ParamPackDesc;//这个parampack的描述信息
|
||||
public TerrainType TerrainType;
|
||||
public ResourceType ResourceType;
|
||||
public float Rate;
|
||||
public InnerOuterCity InnerOuterCity;
|
||||
|
||||
}
|
||||
@ -185,6 +185,9 @@ namespace Logic
|
||||
//增加保护区的金钱
|
||||
if (GetBuildingLevelByCity(mapData, cityData, ResourceType.Preserve, out var preserveLevel))
|
||||
ret += preserveLevel;
|
||||
//增加kaguyaYard的金钱
|
||||
if (GetBuildingLevelByCity(mapData, cityData, ResourceType.KaguyaFrenchYard, out var kaguyaYardLevel))
|
||||
ret += kaguyaYardLevel;
|
||||
|
||||
if (ret < 0)
|
||||
ret = 0;
|
||||
|
||||
@ -30,12 +30,6 @@ namespace Logic.Skill
|
||||
|
||||
public override void OnDamaged(MapData mapData, SettlementInfo info)
|
||||
{
|
||||
if (info.DamageOrigin == null || info.DamageTarget == null) return;
|
||||
if (info.DamageType != DamageType.ActiveAttack) return;
|
||||
if (info.IsKill) return;
|
||||
if (!info.DamageOrigin.GetSkill(SkillType.KAGUYAFRENCHSYNERGY, out _)) return;
|
||||
//info.DamageValue = Table.Instance.CalcDamage(mapData,info.DamageOrigin,info.DamageOrigin,false,0.5f,true);
|
||||
//Main.UnitLogic.DamageSettlement(mapData,info.DamageOrigin, info.DamageTarget,2 * Level, DamageType.FollowAttack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,12 +36,16 @@ namespace Logic.Skill
|
||||
if (!info.DamageTarget.GetSkill(SkillType.KAGUYAFRENCHSYNERGYDEBUFF, out var skill))
|
||||
{
|
||||
info.DamageTarget.AddSkill(SkillType.KAGUYAFRENCHSYNERGYDEBUFF);
|
||||
info.DamageTarget.GetSkill(SkillType.KAGUYAFRENCHSYNERGYDEBUFF, out skill);
|
||||
}
|
||||
var targetSkill = skill as KaguyaFrenchSynergyDebuffSkill;
|
||||
if (targetSkill == null) return;
|
||||
//if (targetSkill.Level >= 4) return;
|
||||
targetSkill.AddLevel(mapData, info.DamageOrigin, 1);
|
||||
//info.DamageValue = Table.Instance.CalcDamage(mapData,info.DamageOrigin,info.DamageTarget,false,0.5f,true);
|
||||
if (skill == null) return;
|
||||
skill.AddLevel(mapData, info.DamageOrigin, 1);
|
||||
}
|
||||
|
||||
public override float GetAttackerValueOffset(MapData mapData,UnitData target)
|
||||
{
|
||||
if (!target.GetSkill(SkillType.KAGUYAFRENCHSYNERGYDEBUFF, out var skill)) return 0;
|
||||
return skill.Level * 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -109,11 +109,11 @@ namespace Logic.Skill
|
||||
// 获取暴击率
|
||||
public float GetCriticalHitRate(UnitData self, MapData mapData);
|
||||
|
||||
// 受攻击时给对方的攻击力偏移
|
||||
public int GetAttackerValueOffset(MapData mapData);
|
||||
// 攻击对方时给自己的攻击力偏移
|
||||
public float GetAttackerValueOffset(MapData mapData,UnitData target);
|
||||
|
||||
// 攻击时给对方的防御力偏移
|
||||
public int GetDefenderValueOffset(MapData mapData);
|
||||
// 防御对方时对方给自己的防御力偏移
|
||||
public float GetDefenderValueOffset(MapData mapData,UnitData target);
|
||||
|
||||
// 全局技能
|
||||
// 当有单位受伤结算时
|
||||
@ -370,12 +370,12 @@ namespace Logic.Skill
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int GetAttackerValueOffset(MapData mapData)
|
||||
public virtual float GetAttackerValueOffset(MapData mapData, UnitData target)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int GetDefenderValueOffset(MapData mapData)
|
||||
public virtual float GetDefenderValueOffset(MapData mapData, UnitData origin)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -191,8 +191,8 @@ public class ChooseUI
|
||||
NeedShow = false;
|
||||
|
||||
//传递玩家选择的阵营civ和force
|
||||
uint civ = _civ[_currentPanelIndex];
|
||||
uint force = _force[_currentPanelIndex];
|
||||
uint civ = _civ[_currentPanelIndex < 0 ? 0 :_currentPanelIndex];
|
||||
uint force = _force[_currentPanelIndex < 0 ? 0:_currentPanelIndex];
|
||||
|
||||
//Debug.Log($"mapSize ={mapSize}, playerCount = {playerCount} civ = {civ}, force = {force}");
|
||||
|
||||
@ -220,14 +220,16 @@ public class ChooseUI
|
||||
if (_isShowing || _isAnimating) return;
|
||||
|
||||
//设置默认点开的
|
||||
_currentPanelIndex = -1;
|
||||
_currentPanelIndex = 1;
|
||||
|
||||
|
||||
_isShowing = true;
|
||||
_isAnimating = true;
|
||||
ROChooseUI.SetActive(true);
|
||||
_secondChoosePanel.SetActive(false);
|
||||
|
||||
_buttons[1].onClick.Invoke();
|
||||
_buttons[1].GetComponent<TribeHoverEffect>().HandleButtonClick();
|
||||
_buttons[_currentPanelIndex].onClick.Invoke();
|
||||
_buttons[_currentPanelIndex].GetComponent<TribeHoverEffect>().HandleButtonClick();
|
||||
//AudioManager.Instance.PlayMusic("RemiliaEgyptian",1f,1f,true);
|
||||
AnimancerComponent animancer = ROChooseUI.GetComponent<AnimancerComponent>();
|
||||
animancer.Play(ResourceCache.Instance.AnimCache.UICommonPanelFadeIn);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user