diff --git a/ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset b/ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset index bd469c69..19cd846d 100644 --- a/ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset +++ b/ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset @@ -749,4 +749,4 @@ MonoBehaviour: column: 4 fatherLevelNodes: [] nextLevelNodes: [] - fightEenemyPool: weak + fightEenemyPool: Boss diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BlackSheep.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BlackSheep.cs index 9b9d3220..a2b7c26a 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BlackSheep.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BlackSheep.cs @@ -70,7 +70,7 @@ public class BlackSheep : MonoBehaviour case EnemyActionAction_Attack: yield return StartCoroutine(MeleeAttackAction()); break; - case EnemyActionAction_Shield: + case EnemyAction_AttackAndShield: yield return StartCoroutine(ShieldAction()); break; case EnemyAction_ShootAndPollute: diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/DarkCloud.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/DarkCloud.cs index e93256d1..84bd5c8d 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/DarkCloud.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/DarkCloud.cs @@ -120,6 +120,8 @@ public class DarkCloud : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(enemyNode.EnemyState.damage); } @@ -143,6 +145,8 @@ public class DarkCloud : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(enemyNode.EnemyState.damage); GameManager.Instance.playerOn.switchColor(Name.NodeColor.Black); @@ -162,6 +166,8 @@ public class DarkCloud : MonoBehaviour MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; HashSet targetNodes=new HashSet { currentNode }; getNodeTools.getCircleNodeForEnemy(targetNodes,1); + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); foreach (MapUnity node in targetNodes) { node.switchColor(Name.NodeColor.Black); diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Grinfiend.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Grinfiend.cs index ed23840c..2b13839f 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Grinfiend.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Grinfiend.cs @@ -107,6 +107,8 @@ public class Grinfiend : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(enemyNode.EnemyState.damage); } @@ -182,6 +184,8 @@ public class Grinfiend : MonoBehaviour MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); switch (action) { case "para": diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Mushroom.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Mushroom.cs index 804f8b96..bb1e4a4b 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Mushroom.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Mushroom.cs @@ -84,6 +84,8 @@ public class Mushroom : MonoBehaviour MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; HashSet targetNodes = new HashSet { currentNode }; getNodeTools.getCircleNode(targetNodes, 1); + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); foreach (MapUnity node in targetNodes) { node.switchColor(Name.NodeColor.Black); @@ -104,6 +106,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(enemyNode.EnemyState.damage); } } @@ -116,6 +120,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(enemyNode.EnemyState.damage); } } @@ -129,6 +135,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.weak, 1); AttackDamage(enemyNode.EnemyState.damage); } @@ -142,6 +150,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.weak, 1); AttackDamage(enemyNode.EnemyState.damage); } @@ -156,6 +166,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.downSpeed, 1); AttackDamage(enemyNode.EnemyState.damage); } @@ -169,6 +181,8 @@ public class Mushroom : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.downSpeed, 1); AttackDamage(enemyNode.EnemyState.damage); } diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Polymaw.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Polymaw.cs index c64d0652..57c2a897 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Polymaw.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Polymaw.cs @@ -145,6 +145,8 @@ public class Polymaw : MonoBehaviour Debug.Log("if成功"); if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); } } @@ -158,6 +160,8 @@ public class Polymaw : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); } } @@ -177,6 +181,8 @@ public class Polymaw : MonoBehaviour Debug.Log("attackRange是"+ enemyNode.EnemyState.attackRange); if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); foreach (MapUnity node in targetNodes) { @@ -190,10 +196,12 @@ public class Polymaw : MonoBehaviour yield return StartCoroutine(moveTowardsPlayer()); yield return new WaitForSeconds(1); currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; - if (getNodeTools.canRemoteAttack(currentNode, enemyNode.EnemyState.attackRange)) + if (getNodeTools.canRemoteAttack(enemyOn, enemyNode.EnemyState.attackRange)) { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); foreach (MapUnity node in targetNodes) { @@ -212,6 +220,8 @@ public class Polymaw : MonoBehaviour Debug.Log("if成功"); if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); } @@ -226,6 +236,8 @@ public class Polymaw : MonoBehaviour { if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) { + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); AttackDamage(); } } @@ -239,6 +251,8 @@ public class Polymaw : MonoBehaviour MapUnity currentNode = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; HashSet targetNodes = new HashSet { currentNode }; getNodeTools.getCircleNode(targetNodes, 2); + enemyNode.anim.SetTrigger("Action"); + yield return new WaitForSeconds(0.5f); foreach (MapUnity node in targetNodes) { node.switchColor(Name.NodeColor.Black); diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Legacy/LegacyManager.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Legacy/LegacyManager.cs index 169c75f9..cec5f3e6 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Legacy/LegacyManager.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Legacy/LegacyManager.cs @@ -15,6 +15,18 @@ public class LegacyManager : Singleton //遗物字典(读表) public Dictionary> relicsDictionary = new Dictionary>(); + public HashSet shopRelicsSet = new HashSet + {Name.Legacy.LegacyNode_VulcanHammer,Name.Legacy.LegacyNode_Starfish, + Name.Legacy.LegacyNode_SuspiciousMushroom + } + ; + + public HashSet commonRelicsSet = new HashSet + {Name.Legacy.LegacyNode_EnchantedConch,Name.Legacy.LegacyNode_GoldVines, + Name.Legacy.LegacyNode_SnakeGall,Name.Legacy.LegacyNode_AgnisTorch + } + ; + [Header("从玩家数据读过来的遗物类名表")] public List relicClassNameList = new List(); @@ -48,6 +60,33 @@ public class LegacyManager : Singleton relicClassNameList.Add(className); } + + public HashSet getRandomRelicForShop(int count) + { + HashSet trueSet = new HashSet(shopRelicsSet); + foreach (string relic in relicClassNameList) + { + if (trueSet.Contains(relic)) + { + trueSet.Remove(relic); + } + } + return MathTool.GetRandomElements(trueSet, count); + } + + public HashSet getRandomRelicForCommon(int count) + { + HashSet trueSet = new HashSet(commonRelicsSet); + foreach (string relic in relicClassNameList) + { + if (trueSet.Contains(relic)) + { + trueSet.Remove(relic); + } + } + return MathTool.GetRandomElements(trueSet, count); + } + public void ShowLegacyClassAsOwned() { for(int i=0;i(set.OrderBy(x => rand.Next()).Take(a)); } + + public static HashSet GetRandomElements(HashSet set, int a) + { + System.Random rand = new System.Random(); + if (a >= set.Count) + { + return new HashSet(set); + } + return new HashSet(set.OrderBy(x => rand.Next()).Take(a)); + } }