diff --git a/ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta b/ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta new file mode 100644 index 00000000..17bba4e5 --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: a94cf6fef2879da4c91e5ef768aadf4e +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/PictureMapUnity.prefab b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/PictureMapUnity.prefab index 79a30c6a..2ac72607 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/PictureMapUnity.prefab +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/PictureMapUnity.prefab @@ -2211,9 +2211,9 @@ RectTransform: - {fileID: 7231599482135577161} - {fileID: 7733531765337128758} - {fileID: 4343181389262309683} - - {fileID: 1923089709642351595} - {fileID: 2939303564605795931} - {fileID: 7008995088658298980} + - {fileID: 1923089709642351595} m_Father: {fileID: 2919289406578669922} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} diff --git a/ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity b/ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity index 9c9651be..a44e212b 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity +++ b/ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity @@ -20975,6 +20975,9 @@ MonoBehaviour: extraAllNodeCount: 0 isIgnoreCondition: 0 isDoubleSettle: 0 + resultDescription: + conditionDescription: + gemImage: {fileID: 0} --- !u!114 &457398706 MonoBehaviour: m_ObjectHideFlags: 0 @@ -33777,7 +33780,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 851291880} m_Father: {fileID: 2109090871} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -35948,6 +35952,126 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 849144528} m_CullTransparentMesh: 1 +--- !u!1 &851291879 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 851291880} + - component: {fileID: 851291884} + - component: {fileID: 851291883} + - component: {fileID: 851291882} + - component: {fileID: 851291881} + m_Layer: 5 + m_Name: WeaponNode + m_TagString: WeaponDragPanel + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &851291880 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 851291879} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00003882618} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 801073709} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 87.999985} + m_SizeDelta: {x: -8, y: -8} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &851291881 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 851291879} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &851291882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 851291879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2fbc27b744afba46a8f18f6c09eed3f, type: 3} + m_Name: + m_EditorClassIdentifier: + score: 0 + scoreMul: 0 + condition: usedCard + result: isIgnoreCondition + conditionValue: 2 + resultValue: 3 + nodesMark: [] + nodesColor: [] + extraRedNodeCount: 0 + extraBlueNodeCount: 0 + extraYellowNodeCount: 0 + extraMostNodeCount: 0 + extraLeastNodeCount: 0 + extraAllNodeCount: 0 + isIgnoreCondition: 0 + isDoubleSettle: 0 + resultDescription: + conditionDescription: + gemImage: {fileID: 0} +--- !u!114 &851291883 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 851291879} + 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: 0.36209506, g: 0.5976993, b: 0.9716981, 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: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &851291884 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 851291879} + m_CullTransparentMesh: 1 --- !u!1 &854898562 GameObject: m_ObjectHideFlags: 0 @@ -40009,7 +40133,7 @@ MonoBehaviour: prepareHandCard: [] newPointList: [] drawMoveSpeed: 4 ---- !u!1 &962228241 +--- !u!1 &960521311 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -40017,37 +40141,101 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 962228244} - - component: {fileID: 962228243} - - component: {fileID: 962228242} + - component: {fileID: 960521312} + - component: {fileID: 960521316} + - component: {fileID: 960521315} + - component: {fileID: 960521314} + - component: {fileID: 960521313} m_Layer: 5 - m_Name: Down - m_TagString: Untagged + m_Name: WeaponNode + m_TagString: WeaponDragPanel m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!114 &962228242 + m_IsActive: 1 +--- !u!224 &960521312 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 960521311} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00003882618} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1429520562} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 181} + m_SizeDelta: {x: -8, y: -8} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &960521313 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 960521311} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &960521314 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 962228241} + m_GameObject: {fileID: 960521311} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2fbc27b744afba46a8f18f6c09eed3f, type: 3} + m_Name: + m_EditorClassIdentifier: + score: 0 + scoreMul: 0 + condition: red>100 + result: Volcano + conditionValue: + resultValue: 1 + nodesMark: [] + nodesColor: [] + extraRedNodeCount: 0 + extraBlueNodeCount: 0 + extraYellowNodeCount: 0 + extraMostNodeCount: 0 + extraLeastNodeCount: 0 + extraAllNodeCount: 0 + isIgnoreCondition: 0 + isDoubleSettle: 0 + resultDescription: + conditionDescription: + gemImage: {fileID: 0} +--- !u!114 &960521315 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 960521311} 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: 0, b: 0, a: 1} + m_Color: {r: 0.36209506, g: 0.5976993, b: 0.9716981, 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: 1760380913, guid: 6d779d4bfb58a7748853f39a1aea011a, type: 3} + m_Sprite: {fileID: 0} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -40057,7 +40245,7 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!222 &962228243 +--- !u!222 &960521316 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -47296,6 +47484,126 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1165267332} m_CullTransparentMesh: 1 +--- !u!1 &1165580013 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1165580014} + - component: {fileID: 1165580018} + - component: {fileID: 1165580017} + - component: {fileID: 1165580016} + - component: {fileID: 1165580015} + m_Layer: 5 + m_Name: WeaponNode + m_TagString: WeaponDragPanel + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1165580014 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165580013} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00003882618} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1328831582} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 272} + m_SizeDelta: {x: -8, y: -8} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &1165580015 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165580013} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &1165580016 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165580013} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2fbc27b744afba46a8f18f6c09eed3f, type: 3} + m_Name: + m_EditorClassIdentifier: + score: 0 + scoreMul: 0 + condition: red>100 + result: mulScore + conditionValue: + resultValue: 1.0 + nodesMark: [] + nodesColor: [] + extraRedNodeCount: 0 + extraBlueNodeCount: 0 + extraYellowNodeCount: 0 + extraMostNodeCount: 0 + extraLeastNodeCount: 0 + extraAllNodeCount: 0 + isIgnoreCondition: 0 + isDoubleSettle: 0 + resultDescription: + conditionDescription: + gemImage: {fileID: 0} +--- !u!114 &1165580017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165580013} + 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: 0.36209506, g: 0.5976993, b: 0.9716981, 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: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1165580018 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1165580013} + m_CullTransparentMesh: 1 --- !u!1 &1166023162 GameObject: m_ObjectHideFlags: 0 @@ -53238,7 +53546,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 1165580014} m_Father: {fileID: 2109090871} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -56925,7 +57234,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 960521312} m_Father: {fileID: 2109090871} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -73698,6 +74008,9 @@ MonoBehaviour: extraAllNodeCount: 0 isIgnoreCondition: 0 isDoubleSettle: 0 + resultDescription: + conditionDescription: + gemImage: {fileID: 0} --- !u!1 &1715971502 GameObject: m_ObjectHideFlags: 0 diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardPictureManager.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardPictureManager.cs index 99b82363..35003a3a 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardPictureManager.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardPictureManager.cs @@ -29,7 +29,7 @@ public class CardPictureManager : Singleton yield return StartCoroutine(TransformMapUnityForTool()); yield return StartCoroutine(SetUpMapUnityForTool()); yield return StartCoroutine(SetUpMapUnityForCubeForTool()); - createCameraAboveObject(ToolX[3].Y[3].gameObject, 10.0f, 0); + createCameraAboveObject(ToolX[5].Y[5].gameObject, 10.0f, 0); //CardManager.createCardImageMap(); } IEnumerator MapGenerateTest() diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs index f302da66..82098284 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs @@ -104,7 +104,7 @@ public class TurnMaster : Singleton //敌人动作如移动,涂色 //EnemyManager.Instance.EnemyTurn_Observer(); - + getNodeTools.RandomPollute(getNodeTools.getAllNotBlackNodes(), 8); turn = Turn.turnStop; turn = Turn.enemyTurnEnd; } @@ -241,7 +241,12 @@ public class TurnMaster : Singleton { LegacyManager.Instance.tryResetCount(Name.Legacy.LegacyNode_LightningBoots); } - + + public void RandomPollute() + { + + } + //老吊写的函数 public void restoreResource(int settleTurn) { diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs index 36dbb7f4..e32bc8f7 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; +using static UnityEngine.InputSystem.InputControlScheme.MatchResult; +using Match = System.Text.RegularExpressions.Match; public static class Name { @@ -522,6 +524,102 @@ public static class Name } } + public static string getGemConditionDescription(string condition, string conditionValue, string[] nodesMark, string[] nodesColor) + { + StringBuilder sb = new StringBuilder(); + Match match = System.Text.RegularExpressions.Regex.Match(condition, Name.Regex.cardConditionPattern); + if (match.Success) + { + string firstPart = match.Groups[1].Value; // 第一部分(red) + string op = match.Groups[2].Value; // 运算符部分 + string secondPart = match.Groups[3].Value; // 第二部分 + } + else + { + switch (condition) + { + case Name.WeaponNodeCondition.position: + sb.Append("在位置" + (int.Parse(conditionValue) + 1)); + break; + case Name.WeaponNodeCondition.positionUnused: + sb.Append("位置" + (int.Parse(conditionValue) + 1) + "的宝石没有激活"); + break; + case Name.WeaponNodeCondition.positionUsed: + sb.Append("位置" + (int.Parse(conditionValue) + 1) + "的宝石激活了"); + break; + case Name.WeaponNodeCondition.diffSettle: + sb.Append("与上次成功激活时位置不同"); + break; + case Name.WeaponNodeCondition.usedCard: + sb.Append("至少有" + int.Parse(conditionValue) + "个激活的宝石"); + break; + case Name.WeaponNodeCondition.node: + break; + case Name.none: + break; + } + } + + return sb.ToString(); + } + + public static string getGemResultDescription(string result, string resultValue, string[] nodesMark, string[] nodesColor) + { + StringBuilder sb = new StringBuilder(); + switch (result) + { + case Name.WeaponNodeFunction.addScore: + sb.Append("攻击力+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.mulScore: + sb.Append("攻击力*" + (1+float.Parse(resultValue))); + break; + case Name.WeaponNodeFunction.repetWeaponNode: + sb.Append("重复位置" + (int.Parse(resultValue) + 1) +"宝石的效果"); + break; + case Name.WeaponNodeFunction.doubleWeaponNode: + sb.Append("位置" + (int.Parse(resultValue) + 1) + "宝石的效果翻倍"); + break; + case Name.WeaponNodeFunction.redNodeCount: + sb.Append("红色地块的数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.blueNodeCount: + sb.Append("蓝色地块的数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.yellowNodeCount: + sb.Append("黄色地块的数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.mostNodeCount: + sb.Append("数量最多的玩家地块数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.leastNodeCount: + sb.Append("数量最少的玩家地块数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.allNodeCount: + sb.Append("所有玩家的地块的数量+" + int.Parse(resultValue)); + break; + case Name.WeaponNodeFunction.drawCard: + sb.Append("下回合多抽" + int.Parse(resultValue)+"张牌"); + break; + case Name.WeaponNodeFunction.everyRedNodeAddScore: + sb.Append("每有一个红色地块增加" + int.Parse(resultValue) + "点攻击力"); + break; + case Name.WeaponNodeFunction.everyYellowNodeAddScore: + sb.Append("每有一个黄色地块增加" + int.Parse(resultValue) + "点攻击力"); + break; + case Name.WeaponNodeFunction.everyBlueNodeAddScore: + sb.Append("每有一个蓝色地块增加" + int.Parse(resultValue) + "点攻击力"); + break; + case Name.NodeItem.Volcano: + sb.Append("回合结束在场上增加" + int.Parse(resultValue) + "个火山"); + break; + case Name.NodeItem.AcidRain: + sb.Append("回合结束在场上增加" + int.Parse(resultValue) + "个酸雨"); + break; + } + return sb.ToString(); + } + public static string getValForSwage(int cost, string fun, CardForgeRule data) { string result = ""; @@ -603,6 +701,8 @@ public static class Name public const string Throw = "Throw"; } + + public static readonly List BasicCardId = new() { "1001","1002","1003" }; diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs index 726e390a..ecdd8fa9 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs @@ -74,7 +74,7 @@ public class getNodeTools HashSet randomNodes = MathTool.GetRandomElements(set, num); foreach (var node in randomNodes) { - //node.whoColour = MapUnity.WhoColour.enemyColour; + node.switchColor(Name.NodeColor.Black); } GameManager.Instance.SyncColourCountUI(); } diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs index ad5d1780..7f84f1cd 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs @@ -7,6 +7,7 @@ using UnityEngine.EventSystems; using UnityEngine.UI; using UnityEngine.UIElements; using static UnityEngine.InputSystem.InputControlScheme.MatchResult; +using Image = UnityEngine.UI.Image; using Match = System.Text.RegularExpressions.Match; public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDragHandler @@ -34,11 +35,22 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra public int extraAllNodeCount = 0; public bool isIgnoreCondition=false; public bool isDoubleSettle = false; + public string resultDescription; + public string conditionDescription; + + public Sprite gemImage; private void Update() { //SettleScore(); } + + private void Start() + { + resultDescription = Name.getGemResultDescription(result, resultValue, nodesMark, nodesColor); + conditionDescription = Name.getGemConditionDescription(condition, conditionValue, nodesMark, nodesColor); + + } public virtual void SettleWeaponNode(int position) { Debug.Log("结算成功节点1"); diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/manager/CardManager.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/manager/CardManager.cs index 37c32455..a431b47e 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/manager/CardManager.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/manager/CardManager.cs @@ -446,6 +446,117 @@ public class CardManager : Singleton } + public Sprite createGemImageByToolX(string[] nodesMark, string[] nodesColor) + { + MapUnity currentNode = CardPictureManager.Instance.ToolX[4].Y[4]; + return CardManager.createGemImage(nodesMark, nodesColor, currentNode); + } + + public static Sprite createGemImage(string[] nodesMark, string[] nodesColor, MapUnity currentNode) + { + for (int i = 0; i < CardPictureManager.Instance.ToolX.Count; i++) + { + for (int j = 0; j < CardPictureManager.Instance.ToolX[i].Y.Count; j++) + { + CardPictureManager.Instance.ToolX[i].Y[j].switchColorWithoutFX(Name.NodeColor.White); + //CardPictureManager.Instance.ToolX[i].Y[j].gameObject.SetActive(false); + } + } + List<(int, int, int)> cubeList = new List<(int, int, int)>(); + int intEuler = (int)90; + Debug.Log("euler是" + intEuler); + for (int i = 0; i < nodesMark.Length; i++) + { + + try + { + string[] marks = nodesMark[i].Split("_"); + (int q, int s, int y) = MathTool.AxialToCube(int.Parse(marks[0]), int.Parse(marks[1])); + cubeList.Add((q, s, y)); + } + catch (Exception e) + { } + } + List<(int, int, int)> rotatedCubeList = new List<(int, int, int)>(); + for (int i = 0; i < cubeList.Count; i++) + { + Debug.Log("cubeList的Q是" + cubeList[i].Item1 + "cubeList的S是" + cubeList[i].Item2 + "cubeList的R是" + cubeList[i].Item3); + } + rotatedCubeList = MathTool.RotateCoordinates(cubeList, intEuler); + for (int i = 0; i < rotatedCubeList.Count; i++) + { + Debug.Log("rotatedCube的Q是" + rotatedCubeList[i].Item1 + "rotatedCube的S是" + rotatedCubeList[i].Item2 + "rotatedCube的R是" + rotatedCubeList[i].Item3); + } + List<(int, int, int)> trueCubeList = new List<(int, int, int)>(); + Debug.Log("坐标中心是X:" + currentNode.locationX + "Y:" + currentNode.locationY); + trueCubeList = MathTool.TranslateHexesToNewOrigin(rotatedCubeList, (currentNode.cubeQ, currentNode.cubeS, currentNode.cubeR)); + List endNodeList = new List(); + for (int i = 0; i < trueCubeList.Count; i++) + { + MapUnity endNode = new MapUnity(); + Debug.Log("endNode的Q是" + trueCubeList[i].Item1 + "endNode的S是" + trueCubeList[i].Item2 + "endNode的R是" + trueCubeList[i].Item3); + endNode = getNodeTools.getToolNodeWithCube(trueCubeList[i].Item1, trueCubeList[i].Item2, trueCubeList[i].Item3); + if (endNode != null) + { + Debug.Log("染色成功" + nodesColor[i]); + endNode.switchColorWithoutFX(Name.stringColorToint(nodesColor[i])); + endNode.gameObject.SetActive(true); + endNodeList.Add(endNode); + //endNode.influenced = true; + } + } + // 分别提取横纵坐标 + var xCoords = nodesMark.Select(coord => int.Parse(coord.Split('_')[0])).ToArray(); + var yCoords = nodesMark.Select(coord => int.Parse(coord.Split('_')[1])).ToArray(); + + // 计算横纵坐标的最大差值 + int maxXDiff = xCoords.Max() - xCoords.Min(); + int maxYDiff = yCoords.Max() - yCoords.Min(); + + //直接计算图形的几何中心 + Vector3 sum = Vector3.zero; + foreach (MapUnity mapUnity in endNodeList) + { + Vector3 targetPosition = mapUnity.transform.position; + sum += mapUnity.transform.position; + } + Vector3 target = sum / endNodeList.Count; + // 计算 q, r, s 坐标的平均值 + int count = trueCubeList.Count; + int sumQ = trueCubeList.Sum(p => p.Item1); + int sumS = trueCubeList.Sum(p => p.Item2); + int sumR = trueCubeList.Sum(p => p.Item3); + double divisionAveQ = sumQ / count; + double divisionAveS = sumS / count; + double divisionAveR = sumR / count; + int aveQ = (int)Math.Round(divisionAveQ); + int aveS = (int)Math.Round(divisionAveS); + int aveR = (int)Math.Round(divisionAveR); + Debug.Log("QSRCOUNT是" + count); + // 比较最大差值 + int maxDiff = Math.Max(maxXDiff, maxYDiff); + + RenderTexture renderTexture = new RenderTexture(512, 512, 24); + Camera renderCamera = CardPictureManager.Instance.cameraObject.GetComponent(); + renderCamera.targetTexture = renderTexture; + Texture2D texture = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.ARGB32, false); + Debug.Log("相机中心是Q:" + aveQ + "S:" + aveS + "R:" + aveR); + MapUnity camearNode = changeCameraCenter(aveQ, aveS, aveR); + //cameraAdjust(maxDiff, renderCamera, camearNode); + cameraAdjustTest(maxDiff, renderCamera, target); + RenderTexture.active = renderCamera.targetTexture; + renderCamera.Render(); + texture.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0); + texture.Apply(); + RenderTexture.active = null; + // Material material = new Material(Shader.Find("Standard")); + // material.mainTexture = renderTexture; + Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); + + return sprite; + + } + public static MapUnity changeCameraCenter(int q,int s,int r) { GameObject camera = CardPictureManager.Instance.cameraObject;