新阵营山系科技树研发完成
This commit is contained in:
parent
4701d14e80
commit
2029a53fb3
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -46,7 +46,8 @@ public class TechToTechAtomDataAssetFiller
|
||||
|
||||
foreach (var techInfo in asset.TechList)
|
||||
{
|
||||
foreach (var action in techInfo.techActions)
|
||||
var actionList = techInfo.GetActionList();
|
||||
foreach (var action in actionList)
|
||||
{
|
||||
if (action.ActionType is CommonActionType.UnitSkill or CommonActionType.UnitAction
|
||||
or CommonActionType.TrainUnit or CommonActionType.BuildWonder or CommonActionType.StartWonder
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 173 KiB |
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85c7de509f00e3646959447e68d93cc6
|
||||
guid: 0c325aa1f49e7c54991c96435f64f373
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
@ -1459,7 +1459,7 @@ MonoBehaviour:
|
||||
TechDesc:
|
||||
NeedLockDesc: 0
|
||||
LockDesc:
|
||||
Icon: {fileID: 21300000, guid: a4042af1df783bb4d9966947c6e03a5b, type: 3}
|
||||
Icon: {fileID: 21300000, guid: c7d5777daf2acd44da39924ffc07ec92, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 3
|
||||
@ -6262,9 +6262,9 @@ MonoBehaviour:
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
- ActionId:
|
||||
ActionType: 0
|
||||
ActionType: 5
|
||||
WonderType: 0
|
||||
ResourceType: 3
|
||||
ResourceType: 0
|
||||
FeatureType: 0
|
||||
TerrainType: 0
|
||||
UnitType: 0
|
||||
@ -6273,12 +6273,12 @@ MonoBehaviour:
|
||||
Vegetation: 0
|
||||
UnitActionType: 0
|
||||
CityLevelUpActionType: 0
|
||||
GridMiscActionType: 0
|
||||
GridMiscActionType: 8
|
||||
SkillType: 0
|
||||
TechType: 0
|
||||
PlayerActionType: 0
|
||||
AIParamType: 0
|
||||
ActionName: "\u7D27\u6025\u63D0\u7EAF"
|
||||
ActionName: "\u539F\u77FF\u4EA4\u6613"
|
||||
Desc: "\u5141\u8BB8\u6536\u83B7<color=orange>\u77FF\u77F3</color>\uFF0C\u83B7\u5F972\u91D1\u5E01\u3002"
|
||||
NeedTechDesc: 0
|
||||
TechDesc:
|
||||
@ -6287,7 +6287,7 @@ MonoBehaviour:
|
||||
Icon: {fileID: 21300000, guid: 0c199a8506752b8498d1ebbf0effb9c0, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 0
|
||||
Cost: -2
|
||||
CityExp: 0
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
@ -6315,7 +6315,7 @@ MonoBehaviour:
|
||||
TechDesc:
|
||||
NeedLockDesc: 0
|
||||
LockDesc:
|
||||
Icon: {fileID: 21300000, guid: 3439a16df11af0143bf980e4bdb162f6, type: 3}
|
||||
Icon: {fileID: 21300000, guid: 0c325aa1f49e7c54991c96435f64f373, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 5
|
||||
@ -6416,3 +6416,34 @@ MonoBehaviour:
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
- ActionId:
|
||||
ActionType: 5
|
||||
WonderType: 0
|
||||
ResourceType: 0
|
||||
FeatureType: 0
|
||||
TerrainType: 0
|
||||
UnitType: 0
|
||||
GiantType: 0
|
||||
UnitLevel: 0
|
||||
Vegetation: 0
|
||||
UnitActionType: 0
|
||||
CityLevelUpActionType: 0
|
||||
GridMiscActionType: 7
|
||||
SkillType: 0
|
||||
TechType: 0
|
||||
PlayerActionType: 0
|
||||
AIParamType: 0
|
||||
ActionName: "\u521B\u9020\u5C71\u8109"
|
||||
Desc: "\u6D88\u80171\u9020\u5C71\u6B21\u6570\uFF0C\u5728\u5E1D\u56FD\u9886\u571F\u5185\u7684\u5E73\u539F\u4E0A\u521B\u9020\u5C71\u8109\u3002\u8BE5\u5730\u5757\u4E0D\u80FD\u62E5\u6709\u68EE\u6797\u6216\u5176\u4ED6\u5EFA\u7B51\u3002"
|
||||
NeedTechDesc: 0
|
||||
TechDesc:
|
||||
NeedLockDesc: 1
|
||||
LockDesc: "\u9020\u5C71\u6B21\u6570\u4E0D\u8DB3\uFF0C\u65E0\u6CD5\u521B\u9020\u5C71\u8109"
|
||||
Icon: {fileID: 21300000, guid: 49c36825d3b9e4d42bc413f376677ad3, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 5
|
||||
CityExp: 0
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
|
||||
@ -1803,7 +1803,7 @@ MonoBehaviour:
|
||||
SpriteList: []
|
||||
- Resource: 32
|
||||
ResourceSubType: 0
|
||||
Sprite: {fileID: 21300000, guid: 3439a16df11af0143bf980e4bdb162f6, type: 3}
|
||||
Sprite: {fileID: 21300000, guid: 0c325aa1f49e7c54991c96435f64f373, type: 3}
|
||||
ResourceName: "\u52D8\u63A2\u6240"
|
||||
ResourceDesc: "\u5FC5\u987B\u5EFA\u9020\u5728\u6CA1\u6709\u77FF\u77F3\u7684\u5C71\u8109\u4E0A\u30022\u56DE\u5408\u540E\uFF0C<color=orange>\u52D8\u63A2\u6240</color>\u5C06\u8F6C\u5316\u4E3A<color=orange>\u77FF\u77F3</color>\u8D44\u6E90\u3002"
|
||||
Exp: 0
|
||||
|
||||
@ -83,7 +83,7 @@ MonoBehaviour:
|
||||
LeaderAvatar: {fileID: 21300000, guid: 06c171d81e9c5654e91ee63782215264, type: 3}
|
||||
PopulationSprite: {fileID: 0}
|
||||
TechPool: 000000002d0000002e0000002f0000003000000031000000060000000700000008000000090000000a000000320000003300000034000000350000003600000010000000110000001200000013000000140000001500000016000000170000001800000037000000
|
||||
TechStart: 0000000010000000
|
||||
TechStart: 000000002d000000
|
||||
Color: {r: 0.4686918, g: 0.48300567, b: 0.51572317, a: 1}
|
||||
FlagIcon: {fileID: 21300000, guid: 0f4286fa2961ac94aa33b30065a4616c, type: 3}
|
||||
Diff: 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1459,7 +1459,7 @@ MonoBehaviour:
|
||||
TechDesc:
|
||||
NeedLockDesc: 0
|
||||
LockDesc:
|
||||
Icon: {fileID: 21300000, guid: a4042af1df783bb4d9966947c6e03a5b, type: 3}
|
||||
Icon: {fileID: 21300000, guid: c7d5777daf2acd44da39924ffc07ec92, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 3
|
||||
@ -6262,9 +6262,9 @@ MonoBehaviour:
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
- ActionId:
|
||||
ActionType: 0
|
||||
ActionType: 5
|
||||
WonderType: 0
|
||||
ResourceType: 3
|
||||
ResourceType: 0
|
||||
FeatureType: 0
|
||||
TerrainType: 0
|
||||
UnitType: 0
|
||||
@ -6273,12 +6273,12 @@ MonoBehaviour:
|
||||
Vegetation: 0
|
||||
UnitActionType: 0
|
||||
CityLevelUpActionType: 0
|
||||
GridMiscActionType: 0
|
||||
GridMiscActionType: 8
|
||||
SkillType: 0
|
||||
TechType: 0
|
||||
PlayerActionType: 0
|
||||
AIParamType: 0
|
||||
ActionName: 9640
|
||||
ActionName: 16625
|
||||
Desc: 9641
|
||||
NeedTechDesc: 0
|
||||
TechDesc:
|
||||
@ -6287,7 +6287,7 @@ MonoBehaviour:
|
||||
Icon: {fileID: 21300000, guid: 0c199a8506752b8498d1ebbf0effb9c0, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 0
|
||||
Cost: -2
|
||||
CityExp: 0
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
@ -6315,7 +6315,7 @@ MonoBehaviour:
|
||||
TechDesc:
|
||||
NeedLockDesc: 0
|
||||
LockDesc:
|
||||
Icon: {fileID: 21300000, guid: 3439a16df11af0143bf980e4bdb162f6, type: 3}
|
||||
Icon: {fileID: 21300000, guid: 0c325aa1f49e7c54991c96435f64f373, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 5
|
||||
@ -6416,3 +6416,34 @@ MonoBehaviour:
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
- ActionId:
|
||||
ActionType: 5
|
||||
WonderType: 0
|
||||
ResourceType: 0
|
||||
FeatureType: 0
|
||||
TerrainType: 0
|
||||
UnitType: 0
|
||||
GiantType: 0
|
||||
UnitLevel: 0
|
||||
Vegetation: 0
|
||||
UnitActionType: 0
|
||||
CityLevelUpActionType: 0
|
||||
GridMiscActionType: 7
|
||||
SkillType: 0
|
||||
TechType: 0
|
||||
PlayerActionType: 0
|
||||
AIParamType: 0
|
||||
ActionName: 16626
|
||||
Desc: 16627
|
||||
NeedTechDesc: 0
|
||||
TechDesc:
|
||||
NeedLockDesc: 1
|
||||
LockDesc: 16628
|
||||
Icon: {fileID: 21300000, guid: 49c36825d3b9e4d42bc413f376677ad3, type: 3}
|
||||
VarientIcon: 0
|
||||
IconList: []
|
||||
Cost: 5
|
||||
CityExp: 0
|
||||
NoNeedTech: 0
|
||||
SpriteSize: {x: 120, y: 120}
|
||||
SpritePos: {x: 0, y: 35}
|
||||
|
||||
@ -1803,7 +1803,7 @@ MonoBehaviour:
|
||||
SpriteList: []
|
||||
- Resource: 32
|
||||
ResourceSubType: 0
|
||||
Sprite: {fileID: 21300000, guid: 3439a16df11af0143bf980e4bdb162f6, type: 3}
|
||||
Sprite: {fileID: 21300000, guid: 0c325aa1f49e7c54991c96435f64f373, type: 3}
|
||||
ResourceName: 9642
|
||||
ResourceDesc: 9658
|
||||
Exp: 0
|
||||
|
||||
@ -101080,4 +101080,28 @@ MonoBehaviour:
|
||||
EN:
|
||||
JP:
|
||||
KR:
|
||||
- ID: 16625
|
||||
ZH: "\u539F\u77FF\u4EA4\u6613"
|
||||
TDZH:
|
||||
EN:
|
||||
JP:
|
||||
KR:
|
||||
- ID: 16626
|
||||
ZH: "\u521B\u9020\u5C71\u8109"
|
||||
TDZH:
|
||||
EN:
|
||||
JP:
|
||||
KR:
|
||||
- ID: 16627
|
||||
ZH: "\u6D88\u80171\u9020\u5C71\u6B21\u6570\uFF0C\u5728\u5E1D\u56FD\u9886\u571F\u5185\u7684\u5E73\u539F\u4E0A\u521B\u9020\u5C71\u8109\u3002\u8BE5\u5730\u5757\u4E0D\u80FD\u62E5\u6709\u68EE\u6797\u6216\u5176\u4ED6\u5EFA\u7B51\u3002"
|
||||
TDZH:
|
||||
EN:
|
||||
JP:
|
||||
KR:
|
||||
- ID: 16628
|
||||
ZH: "\u9020\u5C71\u6B21\u6570\u4E0D\u8DB3\uFF0C\u65E0\u6CD5\u521B\u9020\u5C71\u8109"
|
||||
TDZH:
|
||||
EN:
|
||||
JP:
|
||||
KR:
|
||||
TargetTypes: 0100000001000000010000000100000001000000
|
||||
|
||||
@ -81,7 +81,7 @@ MonoBehaviour:
|
||||
LeaderAvatar: {fileID: 21300000, guid: 06c171d81e9c5654e91ee63782215264, type: 3}
|
||||
PopulationSprite: {fileID: 0}
|
||||
TechPool: 000000002d0000002e0000002f0000003000000031000000060000000700000008000000090000000a000000320000003300000034000000350000003600000010000000110000001200000013000000140000001500000016000000170000001800000037000000
|
||||
TechStart: 0000000010000000
|
||||
TechStart: 000000002d000000
|
||||
Color: {r: 0.4686918, g: 0.48300567, b: 0.51572317, a: 1}
|
||||
FlagIcon: {fileID: 21300000, guid: 0f4286fa2961ac94aa33b30065a4616c, type: 3}
|
||||
Diff: 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -969,6 +969,81 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
viewType: 2
|
||||
IsNode: 1
|
||||
--- !u!1 &1104096862511553793
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2045015541810060848}
|
||||
- component: {fileID: 8801638179918257882}
|
||||
- component: {fileID: 3831023269661213590}
|
||||
m_Layer: 5
|
||||
m_Name: Icon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2045015541810060848
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1104096862511553793}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1150254605961467606}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -28.6, y: -5.5}
|
||||
m_SizeDelta: {x: 35, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8801638179918257882
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1104096862511553793}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3831023269661213590
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1104096862511553793}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 49c36825d3b9e4d42bc413f376677ad3, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &1268885161509648208
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3381,7 +3456,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 85.005, y: -17.777}
|
||||
m_SizeDelta: {x: 0, y: 35.554}
|
||||
m_SizeDelta: {x: 140.01, y: 35.554}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6687253023328197827
|
||||
CanvasRenderer:
|
||||
@ -5463,6 +5538,43 @@ MonoBehaviour:
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!1 &7085599554132675431
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1150254605961467606}
|
||||
m_Layer: 5
|
||||
m_Name: MountainPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1150254605961467606
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7085599554132675431}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2045015541810060848}
|
||||
- {fileID: 8644126376241480575}
|
||||
m_Father: {fileID: 6654619752447261519}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 585.6, y: -258}
|
||||
m_SizeDelta: {x: 327.3936, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &7366119083622336355
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -5914,6 +6026,11 @@ MonoBehaviour:
|
||||
_showAnimationClip: {fileID: 0}
|
||||
_hideAnimationClip: {fileID: 0}
|
||||
closeButton: {fileID: 848429688538716686}
|
||||
TechPoint: {fileID: 6107583055342722803}
|
||||
LeaderAvatar: {fileID: 8246224315020472871}
|
||||
ForceName: {fileID: 5684305502837278567}
|
||||
MountainPoint: {fileID: 7085599554132675431}
|
||||
MountainCount: {fileID: 585520483905432327}
|
||||
TechTreeCircleMonoList:
|
||||
- ViewType: 0
|
||||
CircleMono: {fileID: 8098403817417177794}
|
||||
@ -6140,6 +6257,157 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
viewType: 9
|
||||
IsNode: 0
|
||||
--- !u!1 &7890808414451230422
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8644126376241480575}
|
||||
- component: {fileID: 7085527239542448689}
|
||||
- component: {fileID: 585520483905432327}
|
||||
- component: {fileID: 7439507887495941757}
|
||||
m_Layer: 5
|
||||
m_Name: Point
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8644126376241480575
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7890808414451230422}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1150254605961467606}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 49, y: -4.3}
|
||||
m_SizeDelta: {x: 97.0928, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7085527239542448689
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7890808414451230422}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &585520483905432327
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7890808414451230422}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 0/0
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: f74d73acde897024090a352531df919f, type: 2}
|
||||
m_sharedMaterial: {fileID: -5194638153132371293, guid: f74d73acde897024090a352531df919f, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4284492837
|
||||
m_fontColor: {r: 0.14509805, g: 0.17254902, b: 0.37647063, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!114 &7439507887495941757
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7890808414451230422}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6b27f832d22e4a8d916272b644937774, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Ban: 0
|
||||
ID: 2498
|
||||
FontID: 0
|
||||
TextCfg: []
|
||||
--- !u!1 &8114175305712605084
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -7056,6 +7324,7 @@ RectTransform:
|
||||
- {fileID: 4507407238627746182}
|
||||
- {fileID: 8581185617257750748}
|
||||
- {fileID: 8838706179418109838}
|
||||
- {fileID: 1150254605961467606}
|
||||
- {fileID: 4923972111126380676}
|
||||
m_Father: {fileID: 6961690653480397463}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -9469,7 +9738,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1515226799700260099, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1937094061063432054, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
@ -9553,51 +9822,51 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2197623613075785583, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2197623613075785583, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2197623613075785583, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 646.7046
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2197623613075785583, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: -126.2547
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4562332310728412073, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4562332310728412073, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4562332310728412073, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 235.22397
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4562332310728412073, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: -126.2547
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8308733095821634438, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8308733095821634438, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8308733095821634438, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 440.96426
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8308733095821634438, guid: 62b144adf4273c74fac39e54036ea70e, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: -126.2547
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 100 KiB |
@ -1,114 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a396d90a9458c14994d15d50181d129
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 25
|
||||
textureCompression: 1
|
||||
compressionQuality: 100
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -42,8 +42,8 @@ namespace TH1_Core.Events
|
||||
EventManager.Subscribe<HideUIInfoHero>(HandleHideUIInfoHero);
|
||||
EventManager.Subscribe<ShowUIInfoTechTree>(HandleShowUIInfoTechTree);
|
||||
EventManager.Subscribe<HideUIInfoTechTree>(HandleHideUIInfoTechTree);
|
||||
|
||||
EventManager.Subscribe<ShowUIInfoGridInfo>(HandleShowUIInfoGridInfo);
|
||||
EventManager.Subscribe<ExecuteUIInfoGridInfo>(HandleExecuteUIInfoGridInfo);
|
||||
EventManager.Subscribe<HideUIInfoGridInfo>(HandleHideUIInfoGridInfo);
|
||||
|
||||
EventManager.Subscribe<ShowUINotifyCommon>(HandleShowUINotifyCommon);
|
||||
@ -78,8 +78,8 @@ namespace TH1_Core.Events
|
||||
EventManager.Unsubscribe<ShowUIInfoHero>(HandleShowUIInfoHero);
|
||||
EventManager.Unsubscribe<HideUIInfoHero>(HandleHideUIInfoHero);
|
||||
EventManager.Unsubscribe<ShowUIInfoGridInfo>(HandleShowUIInfoGridInfo);
|
||||
EventManager.Unsubscribe<ExecuteUIInfoGridInfo>(HandleExecuteUIInfoGridInfo);
|
||||
EventManager.Unsubscribe<HideUIInfoGridInfo>(HandleHideUIInfoGridInfo);
|
||||
|
||||
EventManager.Unsubscribe<ShowUINotifyCommon>(HandleShowUINotifyCommon);
|
||||
|
||||
EventManager.Unsubscribe<ShowUIOutsideMultiplay>(HandleShowUIOutsideMultiplay);
|
||||
@ -176,6 +176,13 @@ namespace TH1_Core.Events
|
||||
|
||||
}
|
||||
|
||||
private void HandleExecuteUIInfoGridInfo(ExecuteUIInfoGridInfo evt)
|
||||
{
|
||||
if (UIManager.Instance.UIInfoManager == null) return;
|
||||
UIManager.Instance.UIInfoManager.ExecuteGridInfo(evt);
|
||||
|
||||
}
|
||||
|
||||
private void HandleHideUIInfoGridInfo(HideUIInfoGridInfo evt)
|
||||
{
|
||||
if (UIManager.Instance.UIInfoManager == null) return;
|
||||
|
||||
@ -101,6 +101,7 @@ namespace TH1_Core.Events
|
||||
public UIGridInfoType type;
|
||||
public uint id;
|
||||
}
|
||||
public struct ExecuteUIInfoGridInfo { public uint idx; }
|
||||
|
||||
public struct HideUIInfoGridInfo { public uint non; }
|
||||
|
||||
|
||||
@ -410,7 +410,16 @@ namespace RuntimeData
|
||||
}
|
||||
|
||||
public Vector3 V3() => Table.Instance.GridToWorld(this,"");
|
||||
|
||||
|
||||
public bool HasBuilding()
|
||||
{
|
||||
return !(Resource == ResourceType.None ||
|
||||
Resource == ResourceType.Fruit ||
|
||||
Resource == ResourceType.Crop ||
|
||||
Resource == ResourceType.Starfish ||
|
||||
Resource == ResourceType.Treasure);
|
||||
|
||||
}
|
||||
public bool IsMainMap()
|
||||
{
|
||||
if (!Main.MapData.GridMap.GetGridDataByGid(Id, out var gridData)
|
||||
@ -512,12 +521,34 @@ namespace RuntimeData
|
||||
Renderer(map)?.InstantUpdateGrid();
|
||||
|
||||
}
|
||||
//Step #5 处理所有技能
|
||||
|
||||
//Step #5 处理MetalStation
|
||||
if (Resource == ResourceType.MetalStation && map.CheckIfGidBelongPid(Id,map.CurPlayer.Id))
|
||||
{
|
||||
CommonColdTime++;
|
||||
if (CommonColdTime > 2)
|
||||
{
|
||||
Resource = ResourceType.Metal;
|
||||
//如果有moriyaRoad科技,更新连通性
|
||||
if(map.CurPlayer.TechTree.CheckIfHasTechAtom(TechAtom.MoriyaRoad))
|
||||
Main.PlayerLogic.UpdateCityConnect(map,map.CurPlayer);
|
||||
//Step #3 播放雾效,更新画面
|
||||
if (InMainSight())
|
||||
{
|
||||
Renderer(map)?.InstantUpdateGrid(true);
|
||||
Renderer(map)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Step #6 处理所有技能
|
||||
OnSkillsTurnStart(map);
|
||||
}
|
||||
|
||||
public void OnTurnEnd(MapData map)
|
||||
{
|
||||
|
||||
//Step #2 处理所有技能
|
||||
OnSkillsTurnEnd(map);
|
||||
}
|
||||
|
||||
|
||||
@ -987,12 +987,12 @@ namespace RuntimeData
|
||||
return true;
|
||||
}
|
||||
|
||||
//给Unit增加skill ,通用类,TODO 将来给techlist 加入tech类,tech类再关联action类,会比较好
|
||||
//给Unit增加skill ,通用类,
|
||||
public void AddUnitSkill(UnitData unit)
|
||||
{
|
||||
if (!Table.Instance.UnitTypeDataAssets.GetUnitTypeInfo(unit.UnitType, unit.GiantType, unit.UnitLevel,out var unitInfo)) return;
|
||||
if (!GetPlayerDataByUnitId(unit.Id, out var player)) return;
|
||||
var common = new List<SkillType>() { SkillType.WATERDEFENSE ,SkillType.WATERMOVE,SkillType.OCEANDEFENSE,SkillType.OCEANMOVE,SkillType.MOUNTAINDEFENSE,SkillType.MOUNTAINMOVE,SkillType.FORESTDEFENSE};
|
||||
//var common = new List<SkillType>() { SkillType.WATERDEFENSE ,SkillType.WATERMOVE,SkillType.OCEANDEFENSE,SkillType.OCEANMOVE,SkillType.MOUNTAINDEFENSE,SkillType.MOUNTAINMOVE,SkillType.FORESTDEFENSE};
|
||||
|
||||
//Step #1先添加小兵在配表中自带的技能
|
||||
foreach (var skill in unitInfo.Skills)
|
||||
@ -1001,31 +1001,15 @@ namespace RuntimeData
|
||||
//Step #2再添加小兵在配表中自带的技能
|
||||
var t = new CommonActionId();
|
||||
t.ActionType = CommonActionType.UnitSkill;
|
||||
foreach (var s in common)
|
||||
{
|
||||
t.SkillType = s;
|
||||
if (!player.TechTree.CheckActionCan(t)) continue;
|
||||
unit.AddSkill(s, this);
|
||||
}
|
||||
|
||||
//遍历所有techAtom,将addSkill的techAtom处理了
|
||||
|
||||
//遍历所有techAtom
|
||||
foreach (var atom in player.TechTree.TechAtomCacheSet)
|
||||
{
|
||||
if(!Table.Instance.TechDataAssets.GetTechAtomInfo(atom,out var info))continue;
|
||||
if (!info.IsAddSkill) continue;
|
||||
if (!info.CheckCondition(unit.UnitFullType)) continue;
|
||||
unit.AddSkill(info.AddSkillType, this);
|
||||
|
||||
}
|
||||
//Step #3 最后处理特判情况 TODo 后续改为TechAtom后删除
|
||||
//先处理辉夜的KaguyaFrenchWarriorSynergy
|
||||
if (unit.UnitType == UnitType.Warrior && player.TechTree.CheckIfHasTech(TechType.KaguyaHunting))
|
||||
unit.AddSkill(SkillType.KAGUYAFRENCHSYNERGY, this);
|
||||
if (unit.UnitType == UnitType.Catapult && player.TechTree.CheckIfHasTech(TechType.KaguyaMath))
|
||||
unit.AddSkill(SkillType.KAGUYAFRENCHSYNERGY, this);
|
||||
//处理bambooMove
|
||||
if (player.TechTree.CheckIfHasTechAtom(TechAtom.KaguyaFrenchBambooMove))
|
||||
unit.AddSkill(SkillType.BAMBOOMOVE, this);
|
||||
}
|
||||
|
||||
// 移除小兵数据
|
||||
|
||||
@ -151,25 +151,6 @@ namespace RuntimeData
|
||||
civList.RemoveAt(idx);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var player in PlayerDataList)
|
||||
{
|
||||
//从player的初始科技树获取信息,为player设置初始skill
|
||||
if (Table.Instance.PlayerDataAssets.GetPlayerInfo(player, out var info))
|
||||
{
|
||||
foreach (var t in info.TechStart)
|
||||
{
|
||||
if(!Table.Instance.TechDataAssets.GetTechInfo(t, out var techInfo))continue;
|
||||
foreach(var a in techInfo.techActions)
|
||||
if (a.ActionType == CommonActionType.UnitSkill)
|
||||
{
|
||||
if(a.SkillType is SkillType.KaguyaFrenchNapoleonicCode or SkillType.CommonPlayerSkillIndustry or SkillType.RemiliaForcesSkill1)
|
||||
player.AddSkill(a.SkillType, map);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SelfPlayerId = PlayerDataList[0].Id;
|
||||
foreach (var self in PlayerDataList)
|
||||
@ -293,6 +274,9 @@ namespace RuntimeData
|
||||
public int PlayerWealth;
|
||||
|
||||
public int PlayerTechPoint;
|
||||
|
||||
//造山点(主要给守矢使用)
|
||||
public int PlayerMountainPointUsed;
|
||||
//分数
|
||||
public int PlayerScore;
|
||||
// 视野
|
||||
@ -382,6 +366,7 @@ namespace RuntimeData
|
||||
Alive = copyData.Alive;
|
||||
PlayerWealth = copyData.PlayerWealth;
|
||||
PlayerTechPoint = copyData.PlayerTechPoint;
|
||||
PlayerMountainPointUsed = copyData.PlayerMountainPointUsed;
|
||||
|
||||
Sight = new MapSightData(copyData.Sight);
|
||||
TechTree = new TechTreeData(copyData.TechTree);
|
||||
@ -421,6 +406,7 @@ namespace RuntimeData
|
||||
Alive = copyData.Alive;
|
||||
PlayerWealth = copyData.PlayerWealth;
|
||||
PlayerTechPoint = copyData.PlayerTechPoint;
|
||||
PlayerMountainPointUsed = copyData.PlayerMountainPointUsed;
|
||||
|
||||
Sight.DeepCopy(copyData.Sight);
|
||||
TechTree.DeepCopy(copyData.TechTree);
|
||||
@ -456,6 +442,7 @@ namespace RuntimeData
|
||||
PlayerCivId = civId;
|
||||
PlayerForceId = forceId;
|
||||
PlayerTechPoint = 0;
|
||||
PlayerMountainPointUsed = 0;
|
||||
TurnNoAttack = 0;
|
||||
TotalKill = 0;
|
||||
PlayerHeroData.Init(Table.Instance.TransCivIdToCivEnum(civId) ,Table.Instance.TransForceIdToForceEnum(forceId));
|
||||
@ -532,7 +519,11 @@ namespace RuntimeData
|
||||
MapRenderer.Instance.ProjectileManager.CreateProjectileMulti(startPos,endPos,ProjectileType.Coin,ProjectileMoveType.CoinParabola,coin,0.05f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SpendCoin(int coin, GridData grid = null)
|
||||
{
|
||||
PlayerWealth -= coin;
|
||||
}
|
||||
|
||||
//增加faith的动画目前处理了逻辑和动画 TODO 现在还是逻辑和动画没有分开,后续还是要分开
|
||||
public void AddFaith(int faith,GridData grid = null)
|
||||
@ -923,7 +914,7 @@ namespace RuntimeData
|
||||
public partial class TechTreeData
|
||||
{
|
||||
public HashSet<TechType> TechSet;
|
||||
[MemoryPackIgnore] public HashSet<uint> TechActionCacheSet;
|
||||
[MemoryPackIgnore] public HashSet<uint> TechAtomActionCacheSet;
|
||||
[MemoryPackIgnore] public HashSet<TechAtom> TechAtomCacheSet;
|
||||
|
||||
|
||||
@ -931,14 +922,14 @@ namespace RuntimeData
|
||||
public TechTreeData()
|
||||
{
|
||||
TechSet = new HashSet<TechType>();
|
||||
TechActionCacheSet = new HashSet<uint>();
|
||||
TechAtomActionCacheSet = new HashSet<uint>();
|
||||
TechAtomCacheSet = new HashSet<TechAtom>();
|
||||
}
|
||||
|
||||
public TechTreeData(List<TechType> startTechList = null)
|
||||
{
|
||||
TechSet = new HashSet<TechType>();
|
||||
TechActionCacheSet = new HashSet<uint>();
|
||||
TechAtomActionCacheSet = new HashSet<uint>();
|
||||
TechAtomCacheSet = new HashSet<TechAtom>();
|
||||
if (startTechList != null)
|
||||
{
|
||||
@ -949,7 +940,7 @@ namespace RuntimeData
|
||||
public TechTreeData(TechTreeData copyData)
|
||||
{
|
||||
TechSet = new HashSet<TechType>(copyData.TechSet);
|
||||
TechActionCacheSet = new HashSet<uint>(copyData.TechActionCacheSet);
|
||||
TechAtomActionCacheSet = new HashSet<uint>(copyData.TechAtomActionCacheSet);
|
||||
TechAtomCacheSet = new HashSet<TechAtom>(copyData.TechAtomCacheSet);
|
||||
}
|
||||
|
||||
@ -957,19 +948,17 @@ namespace RuntimeData
|
||||
[MemoryPackOnDeserialized]
|
||||
public void OnAfterMemoryPackDeserialize()
|
||||
{
|
||||
TechActionCacheSet ??= new HashSet<uint>();
|
||||
TechAtomActionCacheSet ??= new HashSet<uint>();
|
||||
foreach (var tech in TechSet)
|
||||
{
|
||||
var techInfo = Table.Instance.TechDataAssets.GetTechInfo(tech);
|
||||
foreach (var techItem in techInfo.techActions)
|
||||
TechActionCacheSet.Add(techItem.Id);
|
||||
foreach (var techAtom in techInfo.TechAtomList)
|
||||
{
|
||||
TechAtomCacheSet.Add(techAtom);
|
||||
if (!Table.Instance.TechDataAssets.GetTechAtomInfo(techAtom, out var info)) continue;
|
||||
if(info.EnableAction)
|
||||
foreach(var t in info.TechActions)
|
||||
TechActionCacheSet.Add(t.Id);
|
||||
TechAtomActionCacheSet.Add(t.Id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -978,9 +967,9 @@ namespace RuntimeData
|
||||
public void DeepCopy(TechTreeData copyData)
|
||||
{
|
||||
TechSet.Clear();
|
||||
TechActionCacheSet.Clear();
|
||||
TechAtomActionCacheSet.Clear();
|
||||
foreach (var tech in copyData.TechSet) TechSet.Add(tech);
|
||||
foreach (var act in copyData.TechActionCacheSet) TechActionCacheSet.Add(act);
|
||||
foreach (var act in copyData.TechAtomActionCacheSet) TechAtomActionCacheSet.Add(act);
|
||||
foreach (var atom in copyData.TechAtomCacheSet) TechAtomCacheSet.Add(atom);
|
||||
}
|
||||
|
||||
@ -988,14 +977,13 @@ namespace RuntimeData
|
||||
{
|
||||
TechSet.Add(techType);
|
||||
var techInfo = Table.Instance.TechDataAssets.GetTechInfo(techType);
|
||||
foreach (var act in techInfo.techActions) TechActionCacheSet.Add(act.Id);
|
||||
foreach (var techAtom in techInfo.TechAtomList)
|
||||
{
|
||||
TechAtomCacheSet.Add(techAtom);
|
||||
if (!Table.Instance.TechDataAssets.GetTechAtomInfo(techAtom, out var info)) continue;
|
||||
if(info.EnableAction)
|
||||
foreach(var t in info.TechActions)
|
||||
TechActionCacheSet.Add(t.Id);
|
||||
TechAtomActionCacheSet.Add(t.Id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1050,7 +1038,7 @@ namespace RuntimeData
|
||||
{
|
||||
if (!Table.Instance.ActionDataAssets.GetActionInfo(actionId, out var info)) return false;
|
||||
if (info.NoNeedTech) return true;
|
||||
return TechActionCacheSet.Contains(actionId.Id);
|
||||
return TechAtomActionCacheSet.Contains(actionId.Id);
|
||||
}
|
||||
|
||||
public bool CheckIfTechUnsee(TechType techType)
|
||||
|
||||
@ -102,7 +102,8 @@ public class PlayerDataAssets : ScriptableObject
|
||||
foreach (var t in info.TechPool)
|
||||
{
|
||||
if(!Table.Instance.TechDataAssets.GetTechInfo(t,out var techInfo))continue;
|
||||
foreach(var a in techInfo.techActions)
|
||||
var actionList = techInfo.GetActionList();
|
||||
foreach(var a in actionList)
|
||||
if (a == actionId)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -297,8 +297,8 @@ public class TechInfo
|
||||
public Sprite icon; // 图标
|
||||
public int CostLevel; // 消耗等级(1,2,3)
|
||||
public List<TechType> FatherTechList;
|
||||
public List<CommonActionId> techActions; // 解锁action
|
||||
public List<TechAtom> TechAtomList; // 解锁action
|
||||
//public List<CommonActionId> techActions; // 解锁action
|
||||
public List<TechAtom> TechAtomList; // 解锁actionAtom
|
||||
public TechTreeCircleViewType TechTreeCircleViewType;
|
||||
|
||||
public bool FatherInSet(HashSet<TechType> set)
|
||||
@ -316,9 +316,23 @@ public class TechInfo
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<CommonActionId> GetActionList()
|
||||
{
|
||||
var actionList = new List<CommonActionId>();
|
||||
foreach (var t in this.TechAtomList)
|
||||
{
|
||||
if (!Table.Instance.TechDataAssets.GetTechAtomInfo(t, out var info)) continue;
|
||||
if (info.EnableAction)
|
||||
foreach(var p in info.TechActions)
|
||||
actionList.Add(p);
|
||||
|
||||
}
|
||||
return actionList;
|
||||
}
|
||||
|
||||
public int GetTechAtomCount()
|
||||
{
|
||||
return techActions.Count + TechAtomList.Count;
|
||||
return TechAtomList.Count;
|
||||
}
|
||||
}
|
||||
@ -557,7 +557,18 @@ namespace Logic.AI
|
||||
//Debug.Log($"Wrong With Get Tech Info of {techType}");
|
||||
return 0;
|
||||
}
|
||||
foreach (var t in techInfo.techActions)
|
||||
|
||||
var actionList = new List<CommonActionId>();
|
||||
foreach (var t in techInfo.TechAtomList)
|
||||
{
|
||||
if (!Table.Instance.TechDataAssets.GetTechAtomInfo(t, out var info)) continue;
|
||||
if (info.EnableAction)
|
||||
foreach(var p in info.TechActions)
|
||||
actionList.Add(p);
|
||||
|
||||
}
|
||||
|
||||
foreach (var t in actionList)
|
||||
{
|
||||
if (t.ActionType == CommonActionType.Gain)
|
||||
{
|
||||
|
||||
@ -101,7 +101,8 @@ namespace Logic.AI
|
||||
//其他得分
|
||||
var other = 0f;
|
||||
|
||||
foreach(var action in techInfo.techActions)
|
||||
var techList = techInfo.GetActionList();
|
||||
foreach(var action in techList)
|
||||
{
|
||||
//常规单位 计算军事得分
|
||||
if (action.ActionType == CommonActionType.TrainUnit)
|
||||
|
||||
@ -25,18 +25,14 @@ using UnityEngine;
|
||||
using TH1Renderer;
|
||||
|
||||
|
||||
public enum GridMiscActionType
|
||||
//记录ActionCheckCan失败时的原因
|
||||
public enum ActionCantType
|
||||
{
|
||||
None,
|
||||
GrowForest,
|
||||
ClearForest,
|
||||
BurnForest,
|
||||
Destroy,
|
||||
UpgradeTemple,
|
||||
GrowForestOutside
|
||||
Locked,
|
||||
Cost,
|
||||
}
|
||||
|
||||
|
||||
namespace Logic.Action
|
||||
{
|
||||
// 行为类型枚举
|
||||
@ -499,23 +495,38 @@ namespace Logic.Action
|
||||
ActionType = CommonActionType.Build,
|
||||
ResourceType = resourceType,
|
||||
};
|
||||
if(resourceType is ResourceType.Sawmill or ResourceType.Windmill or ResourceType.Mine or ResourceType.Farm
|
||||
or ResourceType.Forge or ResourceType.LumberHut or ResourceType.Port or ResourceType.Bridge
|
||||
or ResourceType.Market or ResourceType.Academy or ResourceType.Military)
|
||||
ActionLogicDict[commonActionId] = new BuildAction(commonActionId);
|
||||
else if (resourceType is ResourceType.ForestTemple or ResourceType.WaterTemple
|
||||
or ResourceType.Temple or ResourceType.MountainTemple or ResourceType.KingTemple)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildTemple(commonActionId);
|
||||
else if (resourceType == ResourceType.Preserve)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildPreserve(commonActionId);
|
||||
else if (resourceType == ResourceType.NavalBase)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildNavalBase(commonActionId);
|
||||
else if (resourceType == ResourceType.KaguyaFrenchYard)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildKaguyaFrenchYard(commonActionId);
|
||||
else if(resourceType == ResourceType.EgyptianIrrigation)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildEgyptianIrrigation(commonActionId);
|
||||
else if(resourceType == ResourceType.RemiliaMilitary)
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildRemiliaMilitary(commonActionId);
|
||||
switch (resourceType)
|
||||
{
|
||||
|
||||
case ResourceType.ForestTemple:
|
||||
case ResourceType.WaterTemple:
|
||||
case ResourceType.Temple:
|
||||
case ResourceType.MountainTemple:
|
||||
case ResourceType.KingTemple:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildTemple(commonActionId);
|
||||
continue;
|
||||
case ResourceType.Preserve:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildPreserve(commonActionId);
|
||||
continue;
|
||||
case ResourceType.NavalBase:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildNavalBase(commonActionId);
|
||||
continue;
|
||||
case ResourceType.KaguyaFrenchYard:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildKaguyaFrenchYard(commonActionId);
|
||||
continue;
|
||||
case ResourceType.EgyptianIrrigation:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildEgyptianIrrigation(commonActionId);
|
||||
continue;
|
||||
case ResourceType.RemiliaMilitary:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildRemiliaMilitary(commonActionId);
|
||||
continue;
|
||||
case ResourceType.MetalStation:
|
||||
ActionLogicDict[commonActionId] = new BuildActionBuildMetalStation(commonActionId);
|
||||
continue;
|
||||
default:
|
||||
ActionLogicDict[commonActionId] = new BuildAction(commonActionId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//登记build road这种特殊情况
|
||||
@ -535,13 +546,26 @@ namespace Logic.Action
|
||||
ActionType = CommonActionType.GridMisc,
|
||||
GridMiscActionType = gridMiscActionType
|
||||
};
|
||||
if (gridMiscActionType == GridMiscActionType.UpgradeTemple)
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionUpgradeTemple(commonActionId);
|
||||
else if (gridMiscActionType == GridMiscActionType.GrowForestOutside)
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionGrowTreeOutside(commonActionId);
|
||||
else
|
||||
ActionLogicDict[commonActionId] = new GridMiscAction(commonActionId);
|
||||
|
||||
switch (gridMiscActionType)
|
||||
{
|
||||
case GridMiscActionType.UpgradeTemple:
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionUpgradeTemple(commonActionId);
|
||||
continue;
|
||||
case GridMiscActionType.GrowForestOutside:
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionGrowTreeOutside(commonActionId);
|
||||
continue;
|
||||
case GridMiscActionType.CreateMountain:
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionCreateMountain(commonActionId);
|
||||
continue;
|
||||
case GridMiscActionType.SellMetal:
|
||||
ActionLogicDict[commonActionId] = new GridMiscActionSellMetal(commonActionId);
|
||||
continue;
|
||||
default:
|
||||
ActionLogicDict[commonActionId] = new GridMiscAction(commonActionId);
|
||||
continue;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
//登记BuildWonder建造奇观的行为逻辑
|
||||
@ -850,15 +874,18 @@ namespace Logic.Action
|
||||
}
|
||||
|
||||
//返回一个主体能够显示的action(注意,并非能“做”的action,有些行为没钱或者没科技,他也可以显示)
|
||||
public static bool MainObjectCanShowAction(CommonActionParams param, out List<ActionLogicBase> actionList)
|
||||
public static bool MainObjectCanShowAction(CommonActionParams param, out List<ActionLogicBase> actionList,out List<ActionCantType> actionCantTypeList)
|
||||
{
|
||||
actionList = new List<ActionLogicBase>();
|
||||
actionCantTypeList = new List<ActionCantType>();
|
||||
var actionDict = GetActionLogicDict();
|
||||
foreach (var action in actionDict.Values)
|
||||
{
|
||||
|
||||
if (!action.CheckShow(param)) continue;
|
||||
if (!action.CheckShow(param,out var actionCantType)) continue;
|
||||
actionList.Add(action);
|
||||
actionCantTypeList.Add(actionCantType);
|
||||
|
||||
}
|
||||
return actionList.Count > 0;
|
||||
}
|
||||
@ -1024,7 +1051,11 @@ namespace Logic.Action
|
||||
|
||||
public abstract bool CheckCan(CommonActionParams actionParams);
|
||||
|
||||
public virtual bool CheckShow(CommonActionParams actionParams) { return CheckCan(actionParams); }
|
||||
public virtual bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParams);
|
||||
}
|
||||
|
||||
public virtual ActionShowState CheckShowState(CommonActionParams actionParams) { return ActionShowState.None; }
|
||||
|
||||
@ -1105,8 +1136,9 @@ namespace Logic.Action
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -1130,7 +1162,7 @@ namespace Logic.Action
|
||||
if (cityData == null)
|
||||
actionParams.MapData.GetCityDataByTerritoryGid(actionParams.GridData.Id,out cityData);
|
||||
|
||||
//Step #1 逻辑层 扣钱,消除水果
|
||||
//Step #1 逻辑层 扣钱,消除资源
|
||||
actionParams.PlayerData.PlayerWealth -= GetCost();
|
||||
actionParams.GridData.Resource = ResourceType.None;
|
||||
|
||||
@ -1169,8 +1201,9 @@ namespace Logic.Action
|
||||
return _actionId.ResourceType == actionParam.GridData.Resource;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
if (actionParam.MainObjectType != MainObjectType.Grid) return false;
|
||||
var grid = actionParam.GridData;
|
||||
var map = actionParam.MapData;
|
||||
@ -1266,7 +1299,7 @@ namespace Logic.Action
|
||||
Main.PlayerLogic.UpdateAllPlayerConnected(actionParams.MapData);
|
||||
|
||||
//更新特殊占领技能
|
||||
if(playerData.GetSkill(SkillType.KaguyaFrenchNapoleonicCode,out var _))
|
||||
if(playerData.TechTree.CheckIfHasTechAtom(TechAtom.KaguyaFrenchNapoleonicCode))
|
||||
Main.PlayerLogic.SetCityTerritoryGridSp(actionParams.MapData,actionParams.CityData,GridSpType.KaguyaGrid);
|
||||
|
||||
return true;
|
||||
@ -1331,8 +1364,9 @@ namespace Logic.Action
|
||||
return actionParams.CityData.Level > 5;
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
if (actionParams.CityData == null) return false;
|
||||
//如果没有升级行动的点数,退出
|
||||
if (actionParams.CityData.CityLevelUpPoint <= 0)
|
||||
@ -1446,8 +1480,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1520,8 +1555,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1618,8 +1654,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
public override ActionShowState CheckShowState(CommonActionParams actionParams) { return ActionShowState.None; }
|
||||
@ -1784,8 +1821,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
public override ActionShowState CheckShowState(CommonActionParams actionParams) { return ActionShowState.None; }
|
||||
@ -1815,8 +1853,9 @@ namespace Logic.Action
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1837,8 +1876,9 @@ namespace Logic.Action
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1891,8 +1931,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1920,8 +1961,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1951,8 +1993,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1998,8 +2041,9 @@ namespace Logic.Action
|
||||
return actionParams.UnitData != null;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -104,6 +104,11 @@ namespace Logic.Action
|
||||
//如果有人站在军营上,要更新他的renderMark
|
||||
if (actionParams.MapData.GetUnitDataByGid(actionParams.GridData.Id, out var unit))
|
||||
unit.Renderer(actionParams.MapData)?.InstantUpdateUnit(true);
|
||||
if (actionParams.GridData.InMainSight())
|
||||
{
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
}
|
||||
else if (_actionId.ResourceType == ResourceType.Academy)
|
||||
{
|
||||
@ -111,7 +116,11 @@ namespace Logic.Action
|
||||
actionParams.GridData.buildingLevel = buildingLevel;
|
||||
cityExp = Table.Instance.QueryActionExp(_actionId);
|
||||
actionParams.GridData.Resource = _actionId.ResourceType;
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
if (actionParams.GridData.InMainSight())
|
||||
{
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -282,8 +291,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//如果是unit或者city来执行build操作,直接return false
|
||||
if (actionParam.MainObjectType != MainObjectType.Grid)
|
||||
return false;
|
||||
@ -623,8 +633,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -702,8 +713,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -837,8 +849,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -909,8 +922,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -1046,8 +1060,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -1124,8 +1139,9 @@ namespace Logic.Action
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
@ -1151,4 +1167,57 @@ namespace Logic.Action
|
||||
|
||||
}
|
||||
|
||||
public class BuildActionBuildMetalStation : BuildAction
|
||||
{
|
||||
public BuildActionBuildMetalStation(CommonActionId id) : base(id)
|
||||
{
|
||||
|
||||
}
|
||||
protected override bool Execute(CommonActionParams actionParams)
|
||||
{
|
||||
|
||||
//Step #1 办事
|
||||
if (!BuildActionPayMoney(actionParams))
|
||||
return false;
|
||||
actionParams.GridData.Resource = ResourceType.MetalStation;
|
||||
|
||||
//Step #2 如果已经有MoriyaRoad 更新连通性
|
||||
if (actionParams.PlayerData.TechTree.CheckIfHasTechAtom(TechAtom.MoriyaRoad))
|
||||
Main.PlayerLogic.UpdateCityConnect(actionParams.MapData,actionParams.PlayerData);
|
||||
|
||||
//Step #3 播放雾效,更新画面
|
||||
if (actionParams.GridData.InMainSight())
|
||||
{
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override bool CheckCan(CommonActionParams actionParam)
|
||||
{
|
||||
//step #1 check基本信息
|
||||
if (!BuildActionCheckBaseInfo(actionParam)) return false;
|
||||
//step #2 check是否有科技
|
||||
if (!BuildActionCheckHasTech(actionParam)) return false;
|
||||
//step #3 check是否有钱
|
||||
if (!BuildActionCheckHasMoney(actionParam)) return false;
|
||||
//step #4 check是否在我方领土
|
||||
if (!BuildActionCheckInTerritory(actionParam)) return false;
|
||||
//step #5 check是否有敌人占领
|
||||
if (BuildActionCheckEnemyOccupy(actionParam)) return false;
|
||||
//step #6 check是否是资源为none的山脉
|
||||
if (actionParam.GridData.Resource != ResourceType.None || actionParam.GridData.Feature != TerrainFeature.Mountain) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,9 +20,23 @@ using TH1Renderer;
|
||||
using TH1Resource;
|
||||
|
||||
|
||||
public enum GridMiscActionType
|
||||
{
|
||||
None,
|
||||
GrowForest,
|
||||
ClearForest,
|
||||
BurnForest,
|
||||
Destroy,
|
||||
UpgradeTemple,
|
||||
GrowForestOutside,
|
||||
CreateMountain,
|
||||
SellMetal,
|
||||
}
|
||||
|
||||
//这里是所有BuildAction派生子类的实现模块
|
||||
namespace Logic.Action
|
||||
{
|
||||
|
||||
//GridMisc行为逻辑类,包括Destroy, ClearForest GrowForest BurnForest
|
||||
public class GridMiscAction : ActionLogicBase
|
||||
{
|
||||
@ -62,15 +76,22 @@ namespace Logic.Action
|
||||
//处理clear forest
|
||||
if (_actionId.GridMiscActionType == GridMiscActionType.ClearForest)
|
||||
{
|
||||
actionParams.PlayerData.PlayerWealth -= actionInfo.Cost;
|
||||
actionParams.PlayerData.AddCoin( - actionInfo.Cost,actionParams.GridData);
|
||||
actionParams.GridData.Resource = ResourceType.None;
|
||||
actionParams.GridData.Vegetation = Vegetation.None;
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
//处理因为树林变化带来的上方单位防御状态变化的情况
|
||||
if (actionParams.MapData.GetUnitDataByGid(actionParams.GridData.Id, out var unit))
|
||||
unit.Renderer(actionParams.MapData)?.InstantUpdateUnit(true);
|
||||
|
||||
//更新所有领土内的levelbuilding
|
||||
Main.PlayerLogic.UpdateTerritoryAllBuildingLevel(actionParams.MapData,actionParams.PlayerData.Id);
|
||||
if (actionParams.GridData.InMainSight())
|
||||
{
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -208,8 +229,9 @@ namespace Logic.Action
|
||||
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//如果是unit或者city来执行gridMisc操作,直接return false
|
||||
if (actionParams.MainObjectType != MainObjectType.Grid)
|
||||
return false;
|
||||
@ -415,8 +437,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!GridMiscActionCheckBaseInfo(actionParam)) return false;
|
||||
//Step #2 check是否是temple
|
||||
@ -486,8 +509,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!GridMiscActionCheckBaseInfo(actionParam)) return false;
|
||||
//Step #2 check是否是中立领土,且terrain必须是land,Vegetarion必须是none,feature 必须不是mountain,resource只能是none fruit crop
|
||||
@ -507,4 +531,150 @@ namespace Logic.Action
|
||||
|
||||
}
|
||||
|
||||
public class GridMiscActionCreateMountain : GridMiscAction
|
||||
{
|
||||
public GridMiscActionCreateMountain(CommonActionId id) : base(id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override bool Execute(CommonActionParams actionParams)
|
||||
{
|
||||
|
||||
//step #1 办事 造山
|
||||
var road = (actionParams.GridData.Feature == TerrainFeature.Road);
|
||||
if (actionParams.GridData.Terrain != TerrainType.Land)
|
||||
{
|
||||
actionParams.GridData.Terrain = TerrainType.Land;
|
||||
var dir4 = new List<Vector2>() { Vector2.up, Vector2.left, Vector2.down, Vector2.right };
|
||||
var cur = actionParams.GridData.Pos.V2();
|
||||
foreach (var dir in dir4)
|
||||
{
|
||||
if (!actionParams.MapData.GridMap.GetGridDataByV2(cur + dir, out var grid)) continue;
|
||||
if (grid.Terrain == TerrainType.DeepSea)
|
||||
{
|
||||
grid.Terrain = TerrainType.ShallowSea;
|
||||
grid.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
grid.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actionParams.GridData.Feature = TerrainFeature.Mountain;
|
||||
if (actionParams.GridData.Resource == ResourceType.Crop)
|
||||
actionParams.GridData.Resource = ResourceType.Metal;
|
||||
else
|
||||
{
|
||||
actionParams.GridData.Resource = ResourceType.None;
|
||||
var rd = actionParams.MapData.Net.GetRandom(actionParams.MapData).Next(0, 100);
|
||||
if(rd <= 18)
|
||||
actionParams.GridData.Resource = ResourceType.Metal;
|
||||
}
|
||||
|
||||
//Step #2 如果原本这里有road,更新连通性
|
||||
if (road)
|
||||
Main.PlayerLogic.UpdateCityConnect(actionParams.MapData,actionParams.PlayerData);
|
||||
|
||||
//Step #3 处理因为变成山脉后,防御情况
|
||||
if (actionParams.MapData.GetUnitDataByGid(actionParams.GridData.Id, out var unit))
|
||||
unit.Renderer(actionParams.MapData)?.InstantUpdateUnit(true);
|
||||
|
||||
//Step #4 更改视觉
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
//step #5 扣钱
|
||||
actionParams.PlayerData.PlayerWealth -= GetCost();
|
||||
actionParams.PlayerData.PlayerMountainPointUsed++;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckCan(CommonActionParams actionParam)
|
||||
{
|
||||
//step #1 check基本信息
|
||||
if (!GridMiscActionCheckBaseInfo(actionParam)) return false;
|
||||
//Step #2 check是否是我方领土,并且必须没有建筑,并且不能已经是山,不能有树
|
||||
if (actionParam.GridData.Player(actionParam.MapData) != actionParam.PlayerData) return false;
|
||||
if (actionParam.GridData.HasBuilding()) return false;
|
||||
if (actionParam.GridData.Feature == TerrainFeature.Mountain) return false;
|
||||
if (actionParam.GridData.Vegetation == Vegetation.Trees) return false;
|
||||
//Step #3 确认是否有科技
|
||||
if (!GridMiscActionCheckHasTech(actionParam)) return false;
|
||||
//step #4 check是否有造山点
|
||||
var mp =Main.PlayerLogic.GetPlayerMountainPoint(actionParam.MapData, actionParam.PlayerId);
|
||||
if (actionParam.PlayerData.PlayerMountainPointUsed >= mp) return false;
|
||||
//step #5 check是否有敌人占领
|
||||
if (GridMiscActionCheckEnemyOccupy(actionParam)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #1 check基本信息
|
||||
if (!GridMiscActionCheckBaseInfo(actionParam)) return false;
|
||||
//Step #2 check是否是我方领土,并且必须没有建筑,并且不能已经是山,不能有树
|
||||
if (actionParam.GridData.Player(actionParam.MapData) != actionParam.PlayerData) return false;
|
||||
if (actionParam.GridData.HasBuilding()) return false;
|
||||
if (actionParam.GridData.Feature == TerrainFeature.Mountain) return false;
|
||||
if (actionParam.GridData.Vegetation == Vegetation.Trees) return false;
|
||||
//Step #3 确认是否有科技
|
||||
if (!GridMiscActionCheckHasTech(actionParam)) return false;
|
||||
//step #4 check是否有造山点
|
||||
var mp =Main.PlayerLogic.GetPlayerMountainPoint(actionParam.MapData, actionParam.PlayerId);
|
||||
if (actionParam.PlayerData.PlayerMountainPointUsed >= mp) actionCantType = ActionCantType.Locked;
|
||||
//step #5 check是否有敌人占领
|
||||
if (GridMiscActionCheckEnemyOccupy(actionParam)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class GridMiscActionSellMetal : GridMiscAction
|
||||
{
|
||||
public GridMiscActionSellMetal(CommonActionId id) : base(id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override bool Execute(CommonActionParams actionParams)
|
||||
{
|
||||
|
||||
//step #1 办事 收矿
|
||||
actionParams.GridData.Resource = ResourceType.None;
|
||||
|
||||
//Step #2 更改视觉
|
||||
if (actionParams.GridData.InMainSight())
|
||||
{
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.InstantUpdateGrid(true);
|
||||
actionParams.GridData.Renderer(actionParams.MapData)?.PlayVFX(new GridVFXParams(GridVFXType.Fog));
|
||||
}
|
||||
|
||||
//step #3 加钱
|
||||
actionParams.PlayerData.AddCoin(-GetCost(),actionParams.GridData);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckCan(CommonActionParams actionParam)
|
||||
{
|
||||
//step #1 check基本信息
|
||||
if (!GridMiscActionCheckBaseInfo(actionParam)) return false;
|
||||
//Step #2 check是否是我方领土,并且必须是Metal
|
||||
if (actionParam.GridData.Player(actionParam.MapData) != actionParam.PlayerData) return false;
|
||||
if (actionParam.GridData.Resource != ResourceType.Metal) return false;
|
||||
//Step #3 确认是否有科技
|
||||
if (!GridMiscActionCheckHasTech(actionParam)) return false;
|
||||
//step #4 check是否有敌人占领
|
||||
if (GridMiscActionCheckEnemyOccupy(actionParam)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -57,8 +57,9 @@ namespace TH1_Logic.Action
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -361,8 +362,9 @@ namespace TH1_Logic.Action
|
||||
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//Step #1 鲁棒性判断
|
||||
if (actionParams.PlayerData == null) return false;
|
||||
if (actionParams.MainObjectType != MainObjectType.Player) return false;
|
||||
|
||||
@ -254,8 +254,9 @@ namespace Logic.Action
|
||||
return false;
|
||||
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
GridData gridData;
|
||||
PlayerData playerData;
|
||||
CityData cityData;
|
||||
@ -278,7 +279,7 @@ namespace Logic.Action
|
||||
//step #5确认是否是水生unit
|
||||
if (TrainUnitActionCheckWaterUnit()) return false;
|
||||
//step #6 确认城市是否满员
|
||||
//if (TrainUnitActionCheckCityFullPop(actionParam)) return false;
|
||||
if (TrainUnitActionCheckCityFullPop(actionParam)) actionCantType = ActionCantType.Locked;
|
||||
//step #7 如果城市上面有单位,不能生产,不显示
|
||||
if (TrainUnitActionCheckUnitOnCity(actionParam)) return false;
|
||||
//step #8 判断钱够不够
|
||||
@ -301,7 +302,7 @@ namespace Logic.Action
|
||||
//step #4 如果没科技,return
|
||||
if (!TrainUnitActionCheckHasTech(actionParam)) return false;
|
||||
//step #5 如果城市满员
|
||||
//if (TrainUnitActionCheckCityFullPop(actionParam)) return false;
|
||||
if (TrainUnitActionCheckCityFullPop(actionParam)) actionCantType = ActionCantType.Locked;
|
||||
//step #6如果格子上面有单位,不能生产,不显示
|
||||
if (TrainUnitActionCheckUnitOnGrid(actionParam)) return false;
|
||||
//step #7判断钱够不够
|
||||
@ -522,8 +523,9 @@ namespace Logic.Action
|
||||
return false;
|
||||
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #0 基础鲁棒性 (playerData不能为空 不是英雄则直接排除
|
||||
if(_actionId.UnitType != UnitType.Giant) return false;
|
||||
if (!TrainUnitActionCheckBaseData(actionParam)) return false;
|
||||
@ -546,7 +548,7 @@ namespace Logic.Action
|
||||
//step #4如果HeroList没有英雄
|
||||
if (!actionParam.PlayerData.PlayerHeroData.HasHero(_actionId.GiantType)) return false;
|
||||
//step #5 确认城市是否满员
|
||||
//if (TrainUnitActionCheckCityFullPop(actionParam)) return false;
|
||||
if (TrainUnitActionCheckCityFullPop(actionParam)) actionCantType = ActionCantType.Locked;
|
||||
//step #6 如果城市上面有单位,不能生产,不显示
|
||||
if (TrainUnitActionCheckUnitOnCity(actionParam)) return false;
|
||||
//step #7 如果英雄在冷却cd
|
||||
@ -570,7 +572,7 @@ namespace Logic.Action
|
||||
//step #4如果HeroList没有英雄
|
||||
if (!actionParam.PlayerData.PlayerHeroData.HasHero(_actionId.GiantType)) return false;
|
||||
//step #5 如果城市满员
|
||||
//if (TrainUnitActionCheckCityFullPop(actionParam)) return false;
|
||||
if (TrainUnitActionCheckCityFullPop(actionParam)) actionCantType = ActionCantType.Locked;
|
||||
//step #6如果格子上面有单位,不能生产,不显示
|
||||
if (TrainUnitActionCheckUnitOnGrid(actionParam)) return false;
|
||||
//step #7 如果英雄在冷却cd
|
||||
@ -711,8 +713,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//step #0 基础鲁棒性
|
||||
if(_actionId.UnitType != UnitType.KaguyaFrenchAnimalWarrior) return false;
|
||||
if (!TrainUnitActionCheckBaseData(actionParam)) return false;
|
||||
|
||||
@ -412,8 +412,9 @@ namespace Logic.Action
|
||||
|
||||
return false;
|
||||
}
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
//鲁棒性判断
|
||||
if (actionParams.UnitData == null) return false;
|
||||
if (actionParams.PlayerData == null) return false;
|
||||
@ -609,8 +610,9 @@ namespace Logic.Action
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -672,8 +674,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -732,8 +735,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -784,8 +788,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -855,8 +860,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -909,8 +915,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -1030,8 +1037,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParams);
|
||||
}
|
||||
|
||||
@ -1086,8 +1094,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParam)
|
||||
public override bool CheckShow(CommonActionParams actionParam,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParam);
|
||||
}
|
||||
|
||||
@ -1141,8 +1150,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParams);
|
||||
}
|
||||
|
||||
@ -1218,8 +1228,9 @@ namespace Logic.Action
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckShow(CommonActionParams actionParams)
|
||||
public override bool CheckShow(CommonActionParams actionParams,out ActionCantType actionCantType)
|
||||
{
|
||||
actionCantType = ActionCantType.None;
|
||||
return CheckCan(actionParams);
|
||||
}
|
||||
|
||||
|
||||
@ -12,9 +12,11 @@ using UnityEngine.EventSystems;
|
||||
using RuntimeData;
|
||||
using TMPro;
|
||||
using Logic.Multilingual;
|
||||
using NodeCanvas.Tasks.Actions;
|
||||
using TH1_Core.Events;
|
||||
using TH1_Core.Managers;
|
||||
using TH1_Logic.Core;
|
||||
using TH1_UI.Controller.Info;
|
||||
using UI;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@ -83,13 +85,14 @@ namespace Logic
|
||||
return;
|
||||
}
|
||||
// 检测数字键1-9的按下,执行对应的操作
|
||||
if (UIManager.Instance.BottomInfoUI.ROBottomInfoUI.activeSelf)
|
||||
if (UIManager.Instance.UIInfoManager.GetCurTaskType() == typeof(UIInfoGridInfoController))
|
||||
{
|
||||
for (int i = 1; i <= 9; i++)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Alpha1 + i - 1))
|
||||
{
|
||||
UIManager.Instance.BottomInfoUI.ExecuteActionButtonByIndex(i - 1);
|
||||
EventManager.Publish(new ExecuteUIInfoGridInfo(){idx = (uint)(i - 1)});
|
||||
//UIManager.Instance.BottomInfoUI.ExecuteActionButtonByIndex(i - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -933,7 +933,7 @@ namespace Logic
|
||||
//首先通过Tech 赋予玩家技能
|
||||
|
||||
//处理kaguya专属skill
|
||||
if (player.GetSkill(SkillType.KaguyaFrenchNapoleonicCode, out var _))
|
||||
if (player.TechTree.CheckIfHasTechAtom(TechAtom.KaguyaFrenchNapoleonicCode))
|
||||
{
|
||||
var cityList = new List<CityData>();
|
||||
mapData.GetCityDataListByPlayerId(player.Id,cityList);
|
||||
|
||||
@ -253,7 +253,7 @@ namespace Logic
|
||||
UpdateAllPlayerConnected(mapData);
|
||||
|
||||
//更新特殊占领技能
|
||||
if(playerData.GetSkill(SkillType.KaguyaFrenchNapoleonicCode,out var _))
|
||||
if(playerData.TechTree.CheckIfHasTechAtom(TechAtom.KaguyaFrenchNapoleonicCode))
|
||||
Main.PlayerLogic.SetCityTerritoryGridSp(mapData,cityData,GridSpType.KaguyaGrid);
|
||||
|
||||
return cityData;
|
||||
@ -344,7 +344,7 @@ namespace Logic
|
||||
UpdateAllPlayerConnected(mapData);
|
||||
|
||||
//Step #9 更新特殊占领技能
|
||||
if(playerData.GetSkill(SkillType.KaguyaFrenchNapoleonicCode,out var _))
|
||||
if(playerData.TechTree.CheckIfHasTechAtom(TechAtom.KaguyaFrenchNapoleonicCode))
|
||||
Main.PlayerLogic.SetCityTerritoryGridSp(mapData,cityData,GridSpType.KaguyaGrid);
|
||||
else
|
||||
Main.PlayerLogic.ClearCityTerritoryGridSp(mapData,cityData,GridSpType.KaguyaGrid);
|
||||
@ -891,21 +891,7 @@ namespace Logic
|
||||
if (techType == TechType.KaguyaRoad)
|
||||
Main.PlayerLogic.UpdateAllPlayerConnected(mapData);
|
||||
|
||||
//TODO 迭代一个 action 和techtree的中间节点 techAtom 正在进行中
|
||||
var techInfo = Table.Instance.TechDataAssets.GetTechInfo(techType);
|
||||
foreach(var action in techInfo.techActions)
|
||||
if (action.ActionType == CommonActionType.UnitSkill)
|
||||
{
|
||||
foreach (var unit in mapData.UnitMap.UnitList)
|
||||
{
|
||||
if (mapData.GetPlayerDataByUnitId(unit.Id, out var player1) && player1 == playerData)
|
||||
{
|
||||
unit.AddSkill(action.SkillType, mapData);
|
||||
unit.Renderer(mapData)?.InstantUpdateUnit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
//9月最新版方案,techAtom引入,根据techAtom来决定这次要不要给unit加skill
|
||||
foreach (var techAtom in techInfo.TechAtomList)
|
||||
{
|
||||
if (!Table.Instance.TechDataAssets.GetTechAtomInfo(techAtom, out var atomInfo)) continue;
|
||||
@ -942,6 +928,27 @@ namespace Logic
|
||||
ret += Main.CityLogic.GetCityTechPointPerTurn(mapData,cityData);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int GetPlayerMountainPoint(MapData mapData, uint playerId)
|
||||
{
|
||||
int ret = 0;
|
||||
if (!mapData.PlayerMap.GetPlayerDataByPlayerID(playerId, out var player)) return ret;
|
||||
if (!player.TechTree.CheckIfHasTechAtom(TechAtom.CreateMountain)) return ret;
|
||||
ret += 1;
|
||||
int aca = 0;
|
||||
int pro = 0;
|
||||
|
||||
foreach (var g in mapData.GridMap.GridList)
|
||||
{
|
||||
if (g.Player(mapData) != player) continue;
|
||||
if (g.Resource == ResourceType.Academy) aca++;
|
||||
if (g.Feature == TerrainFeature.Mountain) pro++;
|
||||
}
|
||||
|
||||
if (player.TechTree.CheckIfHasTechAtom(TechAtom.AcademyCreateMountain)) ret += aca;
|
||||
if(player.TechTree.CheckIfHasTechAtom(TechAtom.CreateMountainPro)) ret += pro / 3;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int GetPlayerStarsPerTurn(MapData mapData, uint playerId)
|
||||
{
|
||||
|
||||
@ -508,7 +508,7 @@ namespace Logic
|
||||
MoveInfoCostMap[i, j] = 1;
|
||||
}
|
||||
if (targetGridData.Feature == TerrainFeature.Mountain)
|
||||
MoveInfoCostMap[i, j] = playerData.TechTree.CheckIfHasTech(TechType.Climbing) ? 3 : -1;
|
||||
MoveInfoCostMap[i, j] = unitData.GetSkill(SkillType.MOUNTAINMOVE, out var _) ? 3 : -1;
|
||||
if (targetGridData.Terrain == TerrainType.ShallowSea)
|
||||
{
|
||||
if (targetGridData.Resource == ResourceType.Bridge)
|
||||
@ -517,7 +517,7 @@ namespace Logic
|
||||
else if (targetGridData.Resource == ResourceType.Port)
|
||||
{
|
||||
//如果没有port科技,不能去
|
||||
if (!playerData.TechTree.CheckIfHasTech(TechType.Fishing))
|
||||
if (!unitData.GetSkill(SkillType.WATERMOVE, out var _))
|
||||
MoveInfoCostMap[i, j] = -1;
|
||||
//如果是己方的port
|
||||
else if (mapData.GetPlayerDataByTerritoryGridId(targetGridData.Id, out var targetGridPlayer)
|
||||
@ -542,8 +542,9 @@ namespace Logic
|
||||
MoveInfoCostMap[i, j] = 1;
|
||||
}
|
||||
|
||||
if (targetGridData.Feature == TerrainFeature.Mountain)
|
||||
MoveInfoCostMap[i, j] = playerData.TechTree.CheckIfHasTech(TechType.Climbing) ? 3 : -1;
|
||||
if (targetGridData.Feature == TerrainFeature.Mountain){
|
||||
MoveInfoCostMap[i, j] = unitData.GetSkill(SkillType.MOUNTAINMOVE, out var _) ? 3 : -1;
|
||||
}
|
||||
if (targetGridData.Terrain == TerrainType.ShallowSea)
|
||||
{
|
||||
MoveInfoCostMap[i, j] = 1;
|
||||
@ -576,7 +577,7 @@ namespace Logic
|
||||
}
|
||||
|
||||
if (targetGridData.Feature == TerrainFeature.Mountain)
|
||||
MoveInfoCostMap[i, j] = playerData.TechTree.CheckIfHasTech(TechType.Climbing) ? 3 : -1;
|
||||
MoveInfoCostMap[i, j] = unitData.GetSkill(SkillType.MOUNTAINMOVE, out var _) ? 3 : -1;
|
||||
if (targetGridData.Terrain is TerrainType.ShallowSea or TerrainType.DeepSea)
|
||||
{
|
||||
if (targetGridData.Resource == ResourceType.Bridge)
|
||||
@ -592,14 +593,14 @@ namespace Logic
|
||||
else if (unitData.GetLandType() is LandType.WaterAndAshore or LandType.WaterOnly)
|
||||
{
|
||||
if (targetGridData.Terrain == TerrainType.DeepSea)
|
||||
MoveInfoCostMap[i, j] = playerData.TechTree.CheckIfHasTech(TechType.Sailing) ? 1 : -1;
|
||||
MoveInfoCostMap[i, j] = unitData.GetSkill(SkillType.OCEANMOVE, out var _) ? 1 : -1;
|
||||
else if (targetGridData.Terrain == TerrainType.ShallowSea)
|
||||
MoveInfoCostMap[i, j] = 1;
|
||||
else
|
||||
{
|
||||
MoveInfoCostMap[i, j] = 999;
|
||||
if (targetGridData.Feature == TerrainFeature.Mountain &&
|
||||
!playerData.TechTree.CheckIfHasTech(TechType.Climbing))
|
||||
!unitData.GetSkill(SkillType.MOUNTAINMOVE, out var _))
|
||||
MoveInfoCostMap[i, j] = -1;
|
||||
}
|
||||
}
|
||||
@ -1221,9 +1222,9 @@ namespace Logic
|
||||
//step #1 排除科技情况
|
||||
if (landType != LandType.Fly)
|
||||
{
|
||||
if (grid.Feature == TerrainFeature.Mountain && !self.TechTree.CheckIfHasTech(TechType.Climbing)) return false;
|
||||
if (grid.Terrain == TerrainType.ShallowSea && !self.TechTree.CheckIfHasTech(TechType.Fishing)) return false;
|
||||
if (grid.Terrain == TerrainType.DeepSea && !self.TechTree.CheckIfHasTech(TechType.Sailing)) return false;
|
||||
if (grid.Feature == TerrainFeature.Mountain && !self.TechTree.TechAtomCacheSet.Contains(TechAtom.UnitSkillMOUNTAINMOVE)) return false;
|
||||
if (grid.Terrain == TerrainType.ShallowSea && !self.TechTree.TechAtomCacheSet.Contains(TechAtom.UnitSkillOCEANMOVE)) return false;
|
||||
if (grid.Terrain == TerrainType.DeepSea && !self.TechTree.TechAtomCacheSet.Contains(TechAtom.UnitSkillWATERMOVE)) return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -478,16 +478,11 @@ namespace TH1Renderer
|
||||
forcesName = Table.Instance.QueryForcesName(_playerData.PlayerForceId);
|
||||
|
||||
bool glow = (!_freeland && _playerData.Id == _mapData.PlayerMap.SelfPlayerData.Id
|
||||
&& (_gridData.Resource == ResourceType.Fruit &&
|
||||
_playerData.TechTree.CheckIfHasTech(TechType.Organization)
|
||||
|| (_gridData.Resource == ResourceType.Animal &&
|
||||
(_playerData.TechTree.CheckIfHasTech(TechType.Hunting)||_playerData.TechTree.CheckIfHasTech(TechType.KaguyaHunting)))
|
||||
|| (_gridData.Resource == ResourceType.Fish &&
|
||||
_playerData.TechTree.CheckIfHasTech(TechType.Fishing))
|
||||
|| (_gridData.Resource == ResourceType.Crop &&
|
||||
(_playerData.TechTree.CheckIfHasTech(TechType.Farming)||_playerData.TechTree.CheckIfHasTech(TechType.RemiliaFarming)))
|
||||
|| (_gridData.Resource == ResourceType.Metal &&
|
||||
_playerData.TechTree.CheckIfHasTech(TechType.Mining))));
|
||||
&& ((_gridData.Resource == ResourceType.Fruit && _playerData.TechTree.CheckIfHasTechAtom(TechAtom.GainFruit))
|
||||
|| (_gridData.Resource == ResourceType.Animal && _playerData.TechTree.CheckIfHasTechAtom(TechAtom.GainAnimal))
|
||||
|| (_gridData.Resource == ResourceType.Fish && _playerData.TechTree.CheckIfHasTechAtom(TechAtom.GainFish))
|
||||
|| (_gridData.Resource == ResourceType.Crop && _playerData.TechTree.CheckIfHasTechAtom(TechAtom.BuildFarm))
|
||||
|| (_gridData.Resource == ResourceType.Metal && _playerData.TechTree.CheckIfHasTechAtom(TechAtom.BuildMine))));
|
||||
|
||||
|
||||
if (_gridData.Resource == ResourceType.Starfish &&
|
||||
@ -504,12 +499,12 @@ namespace TH1Renderer
|
||||
!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.Farming) && !_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.RemiliaFarming))
|
||||
skip = true;
|
||||
if (_gridData.Resource == ResourceType.Metal)
|
||||
if (!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.Mining) &&
|
||||
!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.Climbing))
|
||||
if (!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTechAtom(TechAtom.BuildMine) &&
|
||||
!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTechAtom(TechAtom.UnitSkillMOUNTAINMOVE))
|
||||
skip = true;
|
||||
if (_gridData.Resource == ResourceType.Starfish)
|
||||
if (!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.Navigation) &&
|
||||
!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTech(TechType.Sailing))
|
||||
if (!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTechAtom(TechAtom.UnitActionGather) &&
|
||||
!_mapData.PlayerMap.SelfPlayerData.TechTree.CheckIfHasTechAtom(TechAtom.UnitSkillOCEANMOVE))
|
||||
skip = true;
|
||||
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ namespace TH1Resource
|
||||
public Sprite BubbleActionTreasure;
|
||||
public Sprite BubbleActionStarfish;
|
||||
|
||||
public Sprite CommonBG_CircleGray;
|
||||
public Sprite CommonBG_CircleGrey;
|
||||
public Sprite CommonBG_CircleBlue;
|
||||
public Sprite CommonBG_CircleGreen;
|
||||
|
||||
@ -111,7 +111,7 @@ namespace TH1Resource
|
||||
BubbleActionTreasure = Resources.Load<Sprite>("TH1UI/Icon/Action/CircleAction256x256/TH1Icon_BubbleActionTreasure_256");
|
||||
BubbleActionStarfish = Resources.Load<Sprite>("TH1UI/Icon/Action/CircleAction256x256/TH1Icon_BubbleActionStarfish_256");
|
||||
|
||||
CommonBG_CircleGray = Resources.Load<Sprite>("TH1UI/Common/CommonBG/CommonCircleGray");
|
||||
CommonBG_CircleGrey = Resources.Load<Sprite>("TH1UI/Common/CommonBG/CommonCircleGrey");
|
||||
CommonBG_CircleBlue = Resources.Load<Sprite>("TH1UI/Common/CommonBG/CommonCircleBlue");
|
||||
CommonBG_CircleGreen = Resources.Load<Sprite>("TH1UI/Common/CommonBG/CommonCircleGreen");
|
||||
|
||||
|
||||
@ -815,7 +815,7 @@ public class BottomInfoUI// : MonoBehaviour
|
||||
showCity = true;
|
||||
showPlayer = true;
|
||||
var param = new CommonActionParams(mapData:Main.MapData,playerData:Main.MapData.PlayerMap.SelfPlayerData,cityData:city,mainObjectType:MainObjectType.City);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
//showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
}
|
||||
|
||||
//如果是grid
|
||||
@ -825,7 +825,7 @@ public class BottomInfoUI// : MonoBehaviour
|
||||
if (Main.MapData.GetPlayerDataByTerritoryGridId(grid.Id,out var _))
|
||||
showPlayer = true;
|
||||
var param = new CommonActionParams(mapData:Main.MapData,Main.MapData.PlayerMap.SelfPlayerData,gridData:grid,mainObjectType:MainObjectType.Grid);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
//showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -845,7 +845,7 @@ public class BottomInfoUI// : MonoBehaviour
|
||||
if (player.Id == Main.MapData.PlayerMap.SelfPlayerId)
|
||||
{
|
||||
var param = new CommonActionParams(mapData:Main.MapData,playerData:player,unitData:unit,mainObjectType:MainObjectType.Unit);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param, out actionList);
|
||||
//showAction = ActionLogicFactory.MainObjectCanShowAction(param, out actionList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
// 文件位置建议: Assets/Scripts/TH1_UI/Controller/UIAnnounceMajorEventController.cs
|
||||
|
||||
using Logic;
|
||||
using TH1_Core.Events;
|
||||
using TH1_Logic.Core;
|
||||
using TH1_UI.Controller.Base;
|
||||
using TH1_UI.View.Info;
|
||||
using UnityEngine;
|
||||
@ -67,10 +69,16 @@ namespace TH1_UI.Controller.Info
|
||||
WindowScript.CloseView();
|
||||
return base.Close();
|
||||
}
|
||||
|
||||
|
||||
//用于UI执行相关
|
||||
public void ExecuteAction(ExecuteUIInfoGridInfo evt)
|
||||
{
|
||||
WindowScript.ExecuteAction(evt);
|
||||
}
|
||||
|
||||
void _OnBtnCloseClick()
|
||||
{
|
||||
Main.Instance.MapInteractionLogic.CancelAllHighlight();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ namespace TH1_UI.Core
|
||||
private readonly object _data; // 用于传递给UI的数据,可以是任何类型
|
||||
private Action _onCompleteCallback; // 保存来自 PresentationManager 的完成回调
|
||||
private bool _callbackRegistered = false;
|
||||
|
||||
public IViewControllerInterface ViewController => _viewController;
|
||||
/// <summary>
|
||||
/// 创建一个UI显示任务。
|
||||
/// </summary>
|
||||
@ -126,6 +126,13 @@ namespace TH1_UI.Core
|
||||
{
|
||||
return _task?.GetControllerType() ?? null;
|
||||
}
|
||||
|
||||
public void ExecuteGridInfo(ExecuteUIInfoGridInfo evt)
|
||||
{
|
||||
if (GetCurTaskType() != typeof(UIInfoGridInfoController)) return;
|
||||
UIInfoGridInfoController controller = (UIInfoGridInfoController)_task.ViewController;
|
||||
controller.ExecuteAction(evt);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -190,9 +190,10 @@ public class TechTreeUI
|
||||
TextMeshProUGUI txt = techNode.Find("Text").GetComponent<TextMeshProUGUI>();
|
||||
int rk = 0;
|
||||
|
||||
//TODO 这里暂时还是TechAtom和TechAction混用,之后要全部更换为TechAtom
|
||||
|
||||
List<tmpPack> ShowList = new List<tmpPack>();
|
||||
foreach (var t in techInfo.techActions)
|
||||
var actionList = techInfo.GetActionList();
|
||||
foreach (var t in actionList)
|
||||
ShowList.Add(new tmpPack()
|
||||
{
|
||||
isAction = true,
|
||||
@ -428,7 +429,8 @@ public class TechTreeUI
|
||||
|
||||
//TODO 这里暂时还是TechAtom和TechAction混用,之后要全部更换为TechAtom
|
||||
List<tmpPack> ShowList = new List<tmpPack>();
|
||||
foreach (var t in techInfo.techActions)
|
||||
var actionList = techInfo.GetActionList();
|
||||
foreach (var t in actionList)
|
||||
ShowList.Add(new tmpPack()
|
||||
{
|
||||
isAction = true,
|
||||
|
||||
@ -50,7 +50,7 @@ namespace TH1_UI.View.Info
|
||||
public Sprite GrayBG;
|
||||
|
||||
|
||||
public void SetContent(CommonActionId actionId,CommonActionParams param, Action<CommonActionId,CommonActionParams> actionClickCallback)
|
||||
public void SetContent(CommonActionId actionId,ActionCantType cantType, CommonActionParams param, Action<CommonActionId,CommonActionParams> actionClickCallback)
|
||||
{
|
||||
|
||||
|
||||
@ -91,8 +91,7 @@ namespace TH1_UI.View.Info
|
||||
if (!action.CheckCan(param))
|
||||
{
|
||||
//如果是因为人口满了,灰圈 + 降低透明度
|
||||
if (param.CityData != null && Main.MapData.CheckIfCityFullPopulation(param.CityData) &&
|
||||
(actionId.ActionType is CommonActionType.TrainUnit))
|
||||
if (cantType == ActionCantType.Locked)
|
||||
{
|
||||
//BGCanvasGroup.alpha = 0.3f;
|
||||
CircleBG.color = CircleGray;
|
||||
|
||||
@ -136,7 +136,7 @@ namespace TH1_UI.View.Info
|
||||
var actLogic = ActionLogicFactory.GetActionLogic(act);
|
||||
//先设置是否显示按钮
|
||||
tr.gameObject.SetActive(false);
|
||||
if (actLogic.CheckShow(actionParams))
|
||||
if (actLogic.CheckShow(actionParams,out var actionCantType))
|
||||
{
|
||||
tr.gameObject.SetActive(true);
|
||||
|
||||
|
||||
@ -469,26 +469,27 @@ namespace TH1_UI.View.Info
|
||||
//Step #1 获取actionList
|
||||
//ResourceCache.Instance.SpriteCache.ActionBGAvailable
|
||||
var actionList = new List<ActionLogicBase>();
|
||||
var cantTypeList = new List<ActionCantType>();
|
||||
bool showAction = false;
|
||||
var subType = evt.type;
|
||||
CommonActionParams param = null;
|
||||
if (subType == UIGridInfoType.unit && Main.MapData.UnitMap.GetUnitDataByUnitId(evt.id,out var unit))
|
||||
{
|
||||
param = new CommonActionParams(mapData:Main.MapData,playerData:Main.MapData.PlayerMap.SelfPlayerData,unitData:unit,mainObjectType:MainObjectType.Unit);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param, out actionList);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param, out actionList,out cantTypeList);
|
||||
MultilingualManager.Instance.SetUIText(ActionHint,Table.Instance.TextDataAssets.GridInfoText_UnitInfoHint);
|
||||
|
||||
}
|
||||
else if (subType == UIGridInfoType.grid && Main.MapData.GetCityDataByGid(evt.id,out var city))
|
||||
{
|
||||
param = new CommonActionParams(mapData:Main.MapData,playerData:Main.MapData.PlayerMap.SelfPlayerData,cityData:city,mainObjectType:MainObjectType.City);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList,out cantTypeList);
|
||||
MultilingualManager.Instance.SetUIText(ActionHint,Table.Instance.TextDataAssets.GridInfoText_CityInfoHint);
|
||||
}
|
||||
else if (subType == UIGridInfoType.grid && Main.MapData.GridMap.GetGridDataByGid(evt.id,out var grid))
|
||||
{
|
||||
param = new CommonActionParams(mapData:Main.MapData,Main.MapData.PlayerMap.SelfPlayerData,gridData:grid,mainObjectType:MainObjectType.Grid);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList);
|
||||
showAction = ActionLogicFactory.MainObjectCanShowAction(param,out actionList,out cantTypeList);
|
||||
if(grid.Resource is ResourceType.Military or ResourceType.RemiliaMilitary)
|
||||
MultilingualManager.Instance.SetUIText(ActionHint,Table.Instance.TextDataAssets.GridInfoText_CityInfoHint);
|
||||
MultilingualManager.Instance.SetUIText(ActionHint,Table.Instance.TextDataAssets.GridInfoText_GridInfoHint);
|
||||
@ -514,13 +515,19 @@ namespace TH1_UI.View.Info
|
||||
{
|
||||
ActionCircleMonoList[i].gameObject.SetActive(i < actionList.Count);
|
||||
if (i >= actionList.Count) continue;
|
||||
ActionCircleMonoList[i].SetContent(actionList[i].ActionId,param,OnActionCircleClicked);
|
||||
ActionCircleMonoList[i].SetContent(actionList[i].ActionId,cantTypeList[i],param,OnActionCircleClicked);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void ExecuteAction(ExecuteUIInfoGridInfo evt)
|
||||
{
|
||||
if(evt.idx >= ActionCircleMonoList.Count) return;
|
||||
ActionCircleMonoList[(int)evt.idx].ClickButton.onClick.Invoke();
|
||||
}
|
||||
private void OnActionCircleClicked(CommonActionId actionId, CommonActionParams param)
|
||||
{
|
||||
var action = ActionLogicFactory.GetActionLogic(actionId);
|
||||
|
||||
@ -156,8 +156,8 @@ namespace TH1_UI.View.Info
|
||||
return;
|
||||
}
|
||||
|
||||
//Step #4 处理无法学习的清空
|
||||
BG.sprite = ResourceCache.Instance.SpriteCache.CommonBG_CircleGray;
|
||||
//Step #4 处理无法学习的情况
|
||||
BG.sprite = ResourceCache.Instance.SpriteCache.CommonBG_CircleGrey;
|
||||
BGCanvasGroup.alpha = 0.3f;
|
||||
CircleBG.color = CircleGray;
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ using TH1_UI.HintUI;
|
||||
using TH1Resource;
|
||||
using TMPro;
|
||||
using UI.HintUI;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@ -34,6 +35,14 @@ namespace TH1_UI.View.Info
|
||||
public UIInfoTechTreeCircleMono CircleMono;
|
||||
}
|
||||
|
||||
[Header("头像相关")]
|
||||
public TextMeshProUGUI TechPoint;
|
||||
public Image LeaderAvatar;
|
||||
public TextMeshProUGUI ForceName;
|
||||
public GameObject MountainPoint;
|
||||
public TextMeshProUGUI MountainCount;
|
||||
|
||||
[Header("TreeCircle相关")]
|
||||
public List< TechTreeCirclePair > TechTreeCircleMonoList;
|
||||
private CivEnum _showCivEnum = CivEnum.Common;
|
||||
private ForceEnum _showForceEnum = ForceEnum.Common;
|
||||
@ -43,7 +52,7 @@ namespace TH1_UI.View.Info
|
||||
public Color TreeLineColorGray;
|
||||
public Color TreeLineColorWhite;
|
||||
|
||||
[Header("子窗口相关")]
|
||||
[Header("子窗口CheckPanel相关")]
|
||||
public UIInfoTechTreeCheckPanelMono CheckPanel;
|
||||
protected override void InitStart()
|
||||
{
|
||||
@ -82,6 +91,7 @@ namespace TH1_UI.View.Info
|
||||
|
||||
public void RefreshStatus()
|
||||
{
|
||||
|
||||
//Step #1 获得当前player和playerInfo
|
||||
var viewPlayer = Main.MapData.PlayerMap.SelfPlayerData;
|
||||
if (viewPlayer == null || !Table.Instance.PlayerDataAssets.GetPlayerInfo(viewPlayer, out var playerInfo))
|
||||
@ -90,7 +100,22 @@ namespace TH1_UI.View.Info
|
||||
return;
|
||||
}
|
||||
|
||||
//Step #2 处理每个circle
|
||||
//Step #2 处理科技点 / 造山点
|
||||
TechPoint.text = viewPlayer.PlayerTechPoint + "<color=blue>+" + Main.PlayerLogic.GetPlayerTechPointPerTurn(Main.MapData,viewPlayer.Id) + "</color>";
|
||||
bool mountain = viewPlayer.TechTree.CheckIfHasTechAtom(TechAtom.CreateMountain);
|
||||
MountainPoint.SetActive(mountain);
|
||||
if (mountain)
|
||||
{
|
||||
var used = viewPlayer.PlayerMountainPointUsed;
|
||||
var all = Main.PlayerLogic.GetPlayerMountainPoint(Main.MapData,viewPlayer.Id);
|
||||
if (used >= all)
|
||||
MountainCount.text = "<color=red>"+ used +"</color>/" + all;
|
||||
else
|
||||
MountainCount.text = used + "/" + all;
|
||||
}
|
||||
|
||||
|
||||
//Step #3 处理每个circle
|
||||
foreach (var tech in playerInfo.TechPool)
|
||||
{
|
||||
if (!Table.Instance.TechDataAssets.GetTechInfo(tech, out var techInfo)) continue;
|
||||
@ -128,6 +153,14 @@ namespace TH1_UI.View.Info
|
||||
public void SetContent()
|
||||
{
|
||||
var player = Main.MapData.PlayerMap.SelfPlayerData;
|
||||
//Step #0 处理头像
|
||||
if (Table.Instance.PlayerDataAssets.GetPlayerInfo(player, out var playerInfo))
|
||||
{
|
||||
LeaderAvatar.sprite = playerInfo.LeaderAvatar;
|
||||
MultilingualManager.Instance.SetUIText(ForceName,playerInfo.ForceName);
|
||||
}
|
||||
MountainPoint.SetActive(player.TechTree.CheckIfHasTechAtom(TechAtom.CreateMountain));
|
||||
|
||||
//Step #1 开局初始化 如果目前科技树上的circle已经是上一局的老版本,或者这是第一次打开科技树
|
||||
if(_showCivEnum != player.CivEnum || _showForceEnum != player.ForceEnum)
|
||||
InitAllTechCircle();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user