Browse Source

0402更新

pull/99/head
yjm484 12 months ago
parent
commit
4fb55f4ab7
  1. 6
      ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/BoundSoul.asset
  2. 4
      ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/ContaminatusImmortalis.asset
  3. 4
      ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/FailedSample.asset
  4. 4
      ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/Twinbee.asset
  5. 2
      ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset
  6. 2
      ColorlessWorld-2024-4-2/Assets/Prefab/EnemyPrefab/Pollutinel.prefab
  7. 11
      ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity
  8. 4
      ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs
  9. 36
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/AcidRainCloud.cs
  10. 33
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BoundSoul.cs
  11. 35
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Climavista.cs
  12. 21
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/ContaminatusImmortalis.cs
  13. 24
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Enemy.cs
  14. 1
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyNode.cs
  15. 3
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyUI/Enemy/EnemyUIBar.cs
  16. 17
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/FailedSample.cs
  17. 18
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Gravitus.cs
  18. 16
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Leviathan.cs
  19. 51
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/LivingArmor.cs
  20. 38
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Pharmacist.cs
  21. 24
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Pollutinel.cs
  22. 69
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/PollutionSpreader.cs
  23. 14
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/PrismReflector.cs
  24. 14
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/RatWarrior.cs
  25. 19
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/ReconnaissanceBee.cs
  26. 20
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/SoulMaker.cs
  27. 84
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Thief.cs
  28. 19
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Twinbee.cs
  29. 2
      ColorlessWorld-2024-4-2/Assets/Scripts/EnemyPlanFunction/EnemyAction.cs
  30. 10
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/MathTool.cs
  31. 2
      ColorlessWorld-2024-4-2/Assets/Scripts/manager/EnemyPlanUIManager.cs
  32. 19
      ColorlessWorld-2024-4-2/Assets/Scripts/manager/Usermanager.cs

6
ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/BoundSoul.asset

@ -21,14 +21,14 @@ MonoBehaviour:
currentMoveCoolDown: 0 currentMoveCoolDown: 0
shieldValue: 0 shieldValue: 0
upShieldValue: 0 upShieldValue: 0
maxHP: 2 maxHP: 22
currentHP: 2 currentHP: 22
sufferDamageMultiply: 1 sufferDamageMultiply: 1
colourType: 0 colourType: 0
maxSkillCoolDown: 3 maxSkillCoolDown: 3
currentSkillCoolDown: 3 currentSkillCoolDown: 3
damageMultiplier: 1 damageMultiplier: 1
damage: 8 damage: 4
attackRange: 1 attackRange: 1
aoeRange: 0 aoeRange: 0
maxNumberOfHits: 0 maxNumberOfHits: 0

4
ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/ContaminatusImmortalis.asset

@ -28,8 +28,8 @@ MonoBehaviour:
maxSkillCoolDown: 3 maxSkillCoolDown: 3
currentSkillCoolDown: 3 currentSkillCoolDown: 3
damageMultiplier: 1 damageMultiplier: 1
damage: 8 damage: 4
attackRange: 4 attackRange: 2
aoeRange: 2 aoeRange: 2
maxNumberOfHits: 0 maxNumberOfHits: 0
currentNumberOfHits: 0 currentNumberOfHits: 0

4
ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/FailedSample.asset

@ -21,8 +21,8 @@ MonoBehaviour:
currentMoveCoolDown: 0 currentMoveCoolDown: 0
shieldValue: 0 shieldValue: 0
upShieldValue: 0 upShieldValue: 0
maxHP: 20 maxHP: 40
currentHP: 20 currentHP: 40
sufferDamageMultiply: 1 sufferDamageMultiply: 1
colourType: 0 colourType: 0
maxSkillCoolDown: 3 maxSkillCoolDown: 3

4
ColorlessWorld-2024-4-2/Assets/GameDate/Enemy/Twinbee.asset

@ -21,8 +21,8 @@ MonoBehaviour:
currentMoveCoolDown: 0 currentMoveCoolDown: 0
shieldValue: 0 shieldValue: 0
upShieldValue: 0 upShieldValue: 0
maxHP: 30 maxHP: 50
currentHP: 30 currentHP: 50
sufferDamageMultiply: 1 sufferDamageMultiply: 1
colourType: 0 colourType: 0
maxSkillCoolDown: 3 maxSkillCoolDown: 3

2
ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 23280c7f867c4ca468ab73909d4f7707, type: 3} m_Script: {fileID: 11500000, guid: 23280c7f867c4ca468ab73909d4f7707, type: 3}
m_Name: LevelState_1 m_Name: LevelState_1
m_EditorClassIdentifier: m_EditorClassIdentifier:
levelStep: 1 levelStep: 3
mapLevel: 1 mapLevel: 1
currentPoint: {x: 6, y: 1} currentPoint: {x: 6, y: 1}
levelSaveMap: levelSaveMap:

2
ColorlessWorld-2024-4-2/Assets/Prefab/EnemyPrefab/Pollutinel.prefab

@ -119,7 +119,7 @@ MonoBehaviour:
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
enemyType: 0 enemyType: 0
enemyScript: 0 enemyScript: 14
lineAim: {fileID: 7509110568895175458} lineAim: {fileID: 7509110568895175458}
canLineAppre: 1 canLineAppre: 1
disableAttack: {fileID: 0} disableAttack: {fileID: 0}

11
ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity

@ -16465,6 +16465,7 @@ MonoBehaviour:
buffInforOnMouse: {fileID: 365854629} buffInforOnMouse: {fileID: 365854629}
buffInforOnMouseInStatus: {fileID: 14209053} buffInforOnMouseInStatus: {fileID: 14209053}
expectDamage: 0 expectDamage: 0
expectOnceDamage: 0
--- !u!1 &498711090 --- !u!1 &498711090
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -49006,15 +49007,7 @@ MonoBehaviour:
generatePoint: {fileID: 514899946} generatePoint: {fileID: 514899946}
lineOffSet: {x: 1.43, y: 0, z: 0} lineOffSet: {x: 1.43, y: 0, z: 0}
columnOffSet: {x: 0, y: 0, z: 0.86} columnOffSet: {x: 0, y: 0, z: 0.86}
enemyGenerateDataList: enemyGenerateDataList: []
- enemyPrefab: {fileID: 1253231568001379261, guid: 589ff9c9fe779f141b239dcae72b5b67,
type: 3}
locationX: 3
locationY: 3
- enemyPrefab: {fileID: 1253231568001379261, guid: 58d538ffd37498c4b945bf5571921770,
type: 3}
locationX: 4
locationY: 3
mapUnityFather: {fileID: 471426433} mapUnityFather: {fileID: 471426433}
playerNameText: {fileID: 742474145} playerNameText: {fileID: 742474145}
playerMoneyText: {fileID: 506890230} playerMoneyText: {fileID: 506890230}

4
ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs

@ -569,10 +569,10 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
private void setCastingRangePreview() private void setCastingRangePreview()
{ {
int castRange = GameManager.Instance.playerState.castRange; int castRange = GameManager.Instance.playerState.castRange;
if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Green)) /*if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Green))
{ {
castRange++; castRange++;
} }*/
if (Usermanager.playerAbnormalCondition.ContainsKey(AbnormalCondition.tempCastRange)) if (Usermanager.playerAbnormalCondition.ContainsKey(AbnormalCondition.tempCastRange))
{ {
castRange += Usermanager.playerAbnormalCondition[AbnormalCondition.tempCastRange].value; castRange += Usermanager.playerAbnormalCondition[AbnormalCondition.tempCastRange].value;

36
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/AcidRainCloud.cs

@ -18,10 +18,6 @@ public class AcidRainCloud : Enemy
enemyNode.sufferAbnormalCondition(AbnormalCondition.vulnerable, 3); enemyNode.sufferAbnormalCondition(AbnormalCondition.vulnerable, 3);
} }
private void Update()
{
}
private void OnEnable() private void OnEnable()
{ {
@ -43,6 +39,32 @@ public class AcidRainCloud : Enemy
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_ShootAndPollute:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(5, 0.2f);
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction)
{
switch (currentAction)
{
case EnemyAction_ShootAndPollute:
//改变文本
enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString(), "对全场造成" + enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString() + "点伤害,随机污染6格地块");
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString(), "造成"+ enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString() + "点伤害,使玩家手牌中随机一张牌变为消耗");
break;
}
}
public override IEnumerator MeleeAttackAction() public override IEnumerator MeleeAttackAction()
{ {
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
@ -55,7 +77,7 @@ public class AcidRainCloud : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.nextDrawCardisDisposable, 1); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.nextDrawCardisDisposable, 1);
//RandomTurnHandCardTempIsDisposable(1); //RandomTurnHandCardTempIsDisposable(1);
} }
@ -72,7 +94,7 @@ public class AcidRainCloud : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.nextDrawCardisDisposable, 1); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.nextDrawCardisDisposable, 1);
//RandomTurnHandCardTempIsDisposable(1); //RandomTurnHandCardTempIsDisposable(1);
} }
@ -109,7 +131,7 @@ public class AcidRainCloud : Enemy
public IEnumerator PolluteAction() public IEnumerator PolluteAction()
{ {
AttackDamage(5,1); AttackDamage(enemyNode.currentActionScript.colA, 1);
RandomPollute(getNodeTools.getAllNotBlackNodes(), 6); RandomPollute(getNodeTools.getAllNotBlackNodes(), 6);
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
} }

33
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/BoundSoul.cs

@ -34,15 +34,42 @@ public class BoundSoul : Enemy
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
enemyNode.currentActionScript.colB = 2;
break;
}
}
private void Update()
{
if (enemyNode!=null&&enemyNode.currentActionScript != null)
{
if (MapUnityManager.Instance.enemyNodeCount > 15)
{
enemyNode.currentActionScript.colB=3;
}
else
{
enemyNode.currentActionScript.colB =2;
}
enemyNode.enemy.SettlePlannText(enemyNode.enemy.enemyAction);
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
//¸Ä±äÎı¾ //¸Ä±äÎı¾
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode,attackText, "造成"+attackText +"点伤害并至多移动"+stepRangeText +"个格子"); enemyNode.currentActionScript.SettleText(enemyNode,attackText+"*"+ enemyNode.currentActionScript.colB.ToString(), "造成"+attackText +"点伤害"+ enemyNode.currentActionScript.colB+"次并至多移动" +stepRangeText +"个格子");
break; break;
} }
@ -74,7 +101,7 @@ public class BoundSoul : Enemy
{ {
damageCount++; damageCount++;
} }
AttackDamage(enemyNode.EnemyState.damage, damageCount); AttackDamage(enemyNode.currentActionScript.colA, enemyNode.currentActionScript.colB);
} }
} }
else else

35
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Climavista.cs

@ -13,16 +13,11 @@ public class Climavista : Enemy
private void Start() private void Start()
{ {
actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.shield), 0.7f); actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.shield), 0.7f);
actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.random), 0.3f); actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.summon), 0.3f);
enemyNode = GetComponent<EnemyNode>(); enemyNode = GetComponent<EnemyNode>();
enemyNode.sufferAbnormalCondition(AbnormalCondition.halfDamageInBlack, 1); enemyNode.sufferAbnormalCondition(AbnormalCondition.halfDamageInBlack, 1);
} }
private void Update()
{
}
private void OnEnable() private void OnEnable()
{ {
@ -36,13 +31,37 @@ public class Climavista : Enemy
case EnemyActionAction_Shield: case EnemyActionAction_Shield:
yield return StartCoroutine(ShieldAction()); yield return StartCoroutine(ShieldAction());
break; break;
case EnemyActionAction_Random: case EnemyAction_Summon:
yield return StartCoroutine(SummonAction()); yield return StartCoroutine(SummonAction());
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Shield:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(15, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction)
{
switch (currentAction)
{
case EnemyActionAction_Shield:
//改变文本
enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "对生命值最低的一个单位施加" + enemyNode.currentActionScript.colA.ToString() + "点护盾");
break;
case EnemyAction_Summon:
enemyNode.currentActionScript.SettleText(enemyNode, "", "复制一个当前状态的酸雨云");
break;
}
}
public override IEnumerator ShieldAction() public override IEnumerator ShieldAction()
{ {
int minHp = 100; int minHp = 100;
@ -55,7 +74,7 @@ public class Climavista : Enemy
index = i; index = i;
} }
} }
EnemyManager.Instance.enemySpeedSortingList[index].EnemyState.shieldValue += EnemyManager.Instance.enemySpeedSortingList[index].ShieldCalculation(15); EnemyManager.Instance.enemySpeedSortingList[index].EnemyState.shieldValue += EnemyManager.Instance.enemySpeedSortingList[index].ShieldCalculation(enemyNode.currentActionScript.colA);
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
} }

21
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/ContaminatusImmortalis.cs

@ -24,17 +24,30 @@ public class ContaminatusImmortalis : Enemy
{ {
enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn)); enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn));
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
case EnemyAction_ShootAndPollute:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(9, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "*4点伤害并"); enemyNode.currentActionScript.SettleText(enemyNode, attackText+ "*4", "造成" + attackText + "*4点伤害");
break; break;
case EnemyAction_ShootAndPollute: case EnemyAction_ShootAndPollute:
enemyNode.currentActionScript.SettleText(enemyNode, "9", "污染炮击:对场地随机14格地面造成9点伤害,污染地面"); enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "对场地随机14格地面造成"+ enemyNode.currentActionScript.colA+"点伤害,污染地面");
break; break;
} }
@ -61,7 +74,7 @@ public class ContaminatusImmortalis : Enemy
public IEnumerator PolluteAction() public IEnumerator PolluteAction()
{ {
HashSet<MapUnity> targets = MathTool.GetRandomElements(getNodeTools.getAllNotBlackNodes(), 14); HashSet<MapUnity> targets = MathTool.GetRandomElements(getNodeTools.getAllNotBlackNodes(), 14);
PolluteAndDamageNodes(targets,Name.NodeColor.Black,9,1); PolluteAndDamageNodes(targets,Name.NodeColor.Black, enemyNode.currentActionScript.colA, 1);
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
} }

24
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Enemy.cs

@ -46,8 +46,23 @@ public class Enemy : MonoBehaviour
enemyAction = enemyNode.GetRandomAction(actionPool); enemyAction = enemyNode.GetRandomAction(actionPool);
Debug.Log("Ðж¯ÊÇ:" + enemyAction); Debug.Log("Ðж¯ÊÇ:" + enemyAction);
enemyNode.enemyUIBar.SwitchIntention(enemyAction); enemyNode.enemyUIBar.SwitchIntention(enemyAction);
ActionValRandom();
enemyNode.enemy.SettlePlannText(enemyNode.enemy.enemyAction);
}
public void Update()
{
if (enemyNode != null && enemyNode.currentActionScript != null)
{
enemyNode.enemy.SettlePlannText(enemyNode.enemy.enemyAction);
}
}
public virtual void ActionValRandom()
{
} }
public virtual void SettlePlannText(EnemyAction currentAction) public virtual void SettlePlannText(EnemyAction currentAction)
{ {
@ -102,6 +117,7 @@ public class Enemy : MonoBehaviour
result = playCount; result = playCount;
GameManager.Instance.playerState.money = 0; GameManager.Instance.playerState.money = 0;
} }
PlayerStatsManager.Instance.BroadCastSyncMoneyText();//ͬ²½UI
return result; return result;
} }
@ -153,7 +169,7 @@ public class Enemy : MonoBehaviour
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage,1); AttackDamage(enemyNode.currentActionScript.colA, 1);
} }
} }
else else
@ -168,7 +184,7 @@ public class Enemy : MonoBehaviour
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
} }
} }
} }
@ -184,7 +200,7 @@ public class Enemy : MonoBehaviour
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, damageCount); AttackDamage(enemyNode.currentActionScript.colA, damageCount);
} }
} }
else else
@ -199,7 +215,7 @@ public class Enemy : MonoBehaviour
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, damageCount); AttackDamage(enemyNode.currentActionScript.colA, damageCount);
} }
} }
} }

1
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyNode.cs

@ -33,7 +33,6 @@ public class EnemyNode : MonoBehaviour,IEnemyObserver
public List<MapUnity> rangePool = new List<MapUnity>();//范围预览 public List<MapUnity> rangePool = new List<MapUnity>();//范围预览
public List<MapUnity> aoeRangePool = new List<MapUnity>();//范围预览 public List<MapUnity> aoeRangePool = new List<MapUnity>();//范围预览
public string stateText=new string(""); public string stateText=new string("");
[Header("走路参数")] [Header("走路参数")]

3
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyUI/Enemy/EnemyUIBar.cs

@ -49,6 +49,7 @@ public class EnemyUIBar : MonoBehaviour
HPBar.fillAmount = enemyNode .EnemyState .currentHP /enemyNode .EnemyState .maxHP; HPBar.fillAmount = enemyNode .EnemyState .currentHP /enemyNode .EnemyState .maxHP;
maxHPText.text = enemyNode.EnemyState.maxHP.ToString(); maxHPText.text = enemyNode.EnemyState.maxHP.ToString();
} }
//Çл»Òâͼ //Çл»Òâͼ
@ -59,7 +60,7 @@ public class EnemyUIBar : MonoBehaviour
enemyNode .currentActionScript = enemyPlanAction; enemyNode .currentActionScript = enemyPlanAction;
enemyNode.currentActionScript.AttackRange(enemyNode); enemyNode.currentActionScript.AttackRange(enemyNode);
enemyNode.enemy.SettlePlannText(enemyPlanAction); //enemyNode.enemy.SettlePlannText(enemyNode.enemy.enemyAction);
} }

17
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/FailedSample.cs

@ -23,6 +23,16 @@ public class FailedSample: Enemy
{ {
GameManager.Instance.PlayerMove -= SettleRangeAttack; GameManager.Instance.PlayerMove -= SettleRangeAttack;
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_AttackAndPollution:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
}
}
public override void SettleRangeAttack() public override void SettleRangeAttack()
{ {
switch (enemyNode.currentActionScript) switch (enemyNode.currentActionScript)
@ -39,8 +49,7 @@ public class FailedSample: Enemy
{ {
case EnemyAction_AttackAndPollution: case EnemyAction_AttackAndPollution:
//改变文本 //改变文本
//改变文本 string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并随机污染附近三个地块。至多移动" + stepRangeText + "个格子。移动时污染所站地块。"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并随机污染附近三个地块。至多移动" + stepRangeText + "个格子。移动时污染所站地块。");
break; break;
@ -82,7 +91,7 @@ public class FailedSample: Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage,1); AttackDamage(enemyNode.currentActionScript.colA, 1);
RandomPollute(targets, 3); RandomPollute(targets, 3);
RandomPollute(new HashSet<MapUnity> { currentNode }, 1); RandomPollute(new HashSet<MapUnity> { currentNode }, 1);
} }
@ -99,7 +108,7 @@ public class FailedSample: Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage,1); AttackDamage(enemyNode.currentActionScript.colA,1);
RandomPollute(targets, 3); RandomPollute(targets, 3);
RandomPollute(new HashSet<MapUnity> { currentNode }, 1); RandomPollute(new HashSet<MapUnity> { currentNode }, 1);
} }

18
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Gravitus.cs

@ -36,18 +36,28 @@ public class Gravitus : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_AttackAndPollution:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyAction_Spell: case EnemyAction_Spell:
enemyNode.currentActionScript.SettleText(enemyNode, " ", "重力领域:在玩家周围3圈释放重力领域,持续2回合(使玩家移动消耗+1)"); enemyNode.currentActionScript.SettleText(enemyNode, " ", "¶ÔÍæ¼ÒÊ©¼ÓÒ»²ãÖ²Ð");
break; break;
case EnemyAction_SpellAndShield: case EnemyAction_SpellAndShield:
enemyNode.currentActionScript.SettleText(enemyNode, " ", "吸收2范围内污染地块,获得吸收数量*2的护盾"); enemyNode.currentActionScript.SettleText(enemyNode, " ", "吸收2范围内污染地块,获得吸收数量*2的护盾");
break; break;
case EnemyAction_AttackAndPollution: case EnemyAction_AttackAndPollution:
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并污染其1范围地块"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并污染其1范围地块");
break; break;
@ -85,7 +95,7 @@ public class Gravitus : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
PolluteNodes(targetSet,Name.NodeColor.Black); PolluteNodes(targetSet,Name.NodeColor.Black);
} }
} }
@ -101,7 +111,7 @@ public class Gravitus : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
PolluteNodes(targetSet, Name.NodeColor.Black); PolluteNodes(targetSet, Name.NodeColor.Black);
} }
} }

16
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Leviathan.cs

@ -42,15 +42,25 @@ public class Leviathan : Enemy
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_AttackAndPollution:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.2f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyAction_AttackAndPollution: case EnemyAction_AttackAndPollution:
//改变文本 //改变文本
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并污染周围一格地块,至多移动" + stepRangeText + "个格子"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "以玩家为中心1格投射,造成" + attackText + "点伤害并污染周围一格地块,至多移动" + stepRangeText + "个格子");
break; break;
case EnemyAction_SpellAndAttack: case EnemyAction_SpellAndAttack:
enemyNode.currentActionScript.SettleText(enemyNode, "", "消耗所有污染地块,对全场造成伤害"); enemyNode.currentActionScript.SettleText(enemyNode, "", "消耗所有污染地块,对全场造成伤害");
@ -71,7 +81,7 @@ public class Leviathan : Enemy
yield return StartCoroutine(AoeAction()); yield return StartCoroutine(AoeAction());
break; break;
case EnemyAction_AttackAndPollution: case EnemyAction_AttackAndPollution:
yield return StartCoroutine(ThrowAttackAction(1, 25, 1, aimNode)); yield return StartCoroutine(ThrowAttackAction(1, enemyNode.currentActionScript.colA, 1, aimNode));
break; break;
case EnemyAction_Spell: case EnemyAction_Spell:
yield return StartCoroutine(HealAction()); yield return StartCoroutine(HealAction());

51
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/LivingArmor.cs

@ -15,7 +15,7 @@ public class LivingArmor : Enemy
enemyNode = GetComponent<EnemyNode>(); enemyNode = GetComponent<EnemyNode>();
enemyNode.sufferAbnormalCondition(AbnormalCondition.shedding, 1); enemyNode.sufferAbnormalCondition(AbnormalCondition.shedding, 1);
enemyNode.sufferAbnormalCondition(AbnormalCondition.Buff_LivingArmor, 1); enemyNode.sufferAbnormalCondition(AbnormalCondition.Buff_LivingArmor, 1);
actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.spell), 1.0f); actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.pollution), 1.0f);
GameManager.Instance.PlayerMove += SettleRangeAttack; GameManager.Instance.PlayerMove += SettleRangeAttack;
} }
@ -27,7 +27,7 @@ public class LivingArmor : Enemy
{ {
switch (enemyNode.currentActionScript) switch (enemyNode.currentActionScript)
{ {
case EnemyAction_Spell: case EnemyAction_Pollution:
enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn)); enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn));
break; break;
} }
@ -37,11 +37,30 @@ public class LivingArmor : Enemy
switch (currentAction) switch (currentAction)
{ {
case EnemyAction_Spell: case EnemyAction_Spell:
enemyNode.currentActionScript.SettleText(enemyNode, " ", "附身:获得等于活化铠甲生命值加值,获得脱落被动;脱落:被攻击时对周围随机产生一格污染"); enemyNode.currentActionScript.SettleText(enemyNode, " ", "附身旁边的怪物");
break;
case EnemyAction_Pollution:
enemyNode.currentActionScript.SettleText(enemyNode, " ", "脚下+随机污染周围四格地块");
break; break;
} }
} }
private void Update()
{
if (canPossession())
{
enemyNode.currentActionScript = new EnemyAction_Spell();
}
else
{
enemyNode.currentActionScript = new EnemyAction_Pollution();
}
if (enemyNode != null && enemyNode.currentActionScript != null)
{
enemyNode.enemy.SettlePlannText(enemyNode.currentActionScript);
}
}
public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走 public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
{ {
Debug.Log("真正行动是:" + enemyAction); Debug.Log("真正行动是:" + enemyAction);
@ -49,8 +68,8 @@ public class LivingArmor : Enemy
{ {
switch (enemyAction) switch (enemyAction)
{ {
case EnemyAction_Spell: case EnemyAction_Pollution:
yield return StartCoroutine(MeleeAttackAction()); yield return StartCoroutine(PollutionAction());
break; break;
} }
} }
@ -79,7 +98,27 @@ public class LivingArmor : Enemy
return isSuccessful; return isSuccessful;
} }
public override IEnumerator MeleeAttackAction()
public bool canPossession()
{
bool isSuccessful = false;
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
HashSet<MapUnity> targets = new HashSet<MapUnity> { currentNode };
getNodeTools.getCircleNode(targets, 1);
targets.Remove(currentNode);
foreach (MapUnity target in targets)
{
if (Name.NodeColor.EnemyColor.Contains(target.whoColour) && target.enemyNode != null && target.enemyNode.enemyType == EnemyNode.EnemyType.enemy)
{
Debug.Log("canPossession成功");
isSuccessful = true;
return isSuccessful;
}
}
return isSuccessful;
}
public IEnumerator PollutionAction()
{ {
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
HashSet<MapUnity> playerNode = new HashSet<MapUnity> { GameManager.Instance.playerOn }; HashSet<MapUnity> playerNode = new HashSet<MapUnity> { GameManager.Instance.playerOn };

38
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Pharmacist.cs

@ -8,7 +8,6 @@ public class Pharmacist : Enemy
{ {
public MapUnity aimMapunity=new MapUnity();
@ -41,21 +40,35 @@ public class Pharmacist : Enemy
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_ShootAndPollute:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
case EnemyAction_ShieldAndPollution:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(8, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
Debug.Log("currentAction是:" + currentAction);
switch (currentAction) switch (currentAction)
{ {
case EnemyAction_ShootAndPollute: case EnemyAction_ShootAndPollute:
Debug.Log("技能文本1"); Debug.Log("技能文本1");
//改变文本 //改变文本
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并将伤害作用范围内变为污染"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并将伤害作用范围内变为污染");
break; break;
case EnemyAction_ShieldAndPollution: case EnemyAction_ShieldAndPollution:
Debug.Log("技能文本2"); Debug.Log("技能文本2");
//改变文本 //改变文本
enemyNode.currentActionScript.SettleText(enemyNode, "8", "使生命最低的单位获得8点护盾,并将其周围7格变为污染"); enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "使生命最低的单位获得"+ enemyNode.currentActionScript.colA+"点护盾,并将其周围7格变为污染");
break; break;
} }
@ -64,21 +77,6 @@ public class Pharmacist : Enemy
{ {
RewardManager.Instance.AddRewardTips(RewardManager.RewardType.potion, 1.ToString()); RewardManager.Instance.AddRewardTips(RewardManager.RewardType.potion, 1.ToString());
} }
public override void ChooseAction()
{
aimMapunity = GameManager.Instance.playerOn;
enemyAction = new EnemyAction_Nothing();
Debug.Log("actionPool大小" + actionPool.Count());
if (enemyNode == null)
{
Debug.Log("enemyNode大小");
}
enemyAction = enemyNode.GetRandomAction(actionPool);
Debug.Log("行动是:" + enemyAction);
enemyNode.enemyUIBar.SwitchIntention(enemyAction);
}
public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走 public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
{ {
@ -138,9 +136,9 @@ public class Pharmacist : Enemy
public override IEnumerator MeleeAttackAction() public override IEnumerator MeleeAttackAction()
{ {
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
HashSet<MapUnity> targets = new HashSet<MapUnity> { aimMapunity }; HashSet<MapUnity> targets = new HashSet<MapUnity> { aimNode };
getNodeTools.getCircleNode(targets, 1); getNodeTools.getCircleNode(targets, 1);
if (getNodeTools.canRemoteAttackAboutTwoNode(currentNode, aimMapunity, enemyNode.EnemyState.attackRange)) if (getNodeTools.canRemoteAttackAboutTwoNode(currentNode, aimNode, enemyNode.EnemyState.attackRange))
{ {
if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm)) if (!enemyNode.EnemyState.abnormalCondition.ContainsKey(AbnormalCondition.disarm))
{ {

24
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Pollutinel.cs

@ -20,6 +20,22 @@ public class Pollutinel : Enemy
{ {
GameManager.Instance.PlayerMove -= SettleRangeAttack; GameManager.Instance.PlayerMove -= SettleRangeAttack;
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_DeBuff:
enemyNode.currentActionScript.colA=1;
break;
case EnemyAction_Spell:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage,0.1f);
break;
case EnemyActionAction_Shield:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(11, 0.1f);
break;
}
}
public override void SettleRangeAttack() public override void SettleRangeAttack()
{ {
switch (enemyNode.currentActionScript) switch (enemyNode.currentActionScript)
@ -41,13 +57,13 @@ public class Pollutinel : Enemy
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_DeBuff: case EnemyActionAction_DeBuff:
enemyNode.currentActionScript.SettleText(enemyNode, "", "展开2范围领域,使友方单位收到伤害-25%,可叠加。持续2回合"); enemyNode.currentActionScript.SettleText(enemyNode, "", "对玩家施加一层虚弱");
break; break;
case EnemyAction_Spell: case EnemyAction_Spell:
enemyNode.currentActionScript.SettleText(enemyNode, "", "和玩家之间连线,回合开始时对玩家造成8点伤害,污染其周围1范围地块超出4格范围连线断开,对双方造成7点伤害"); enemyNode.currentActionScript.SettleText(enemyNode, "", "开启监视,对踏入自身2格范围内的敌人造成" + enemyNode.currentActionScript.colA + "点伤害");
break; break;
case EnemyActionAction_Shield: case EnemyActionAction_Shield:
enemyNode.currentActionScript.SettleText(enemyNode,"10", "使全体友方获得10~13点护盾"); enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString(), "使全体友方获得" + enemyNode.currentActionScript.colA + "点护盾");
break; break;
} }
@ -64,7 +80,7 @@ public class Pollutinel : Enemy
yield return StartCoroutine(SurveillanceAction()); yield return StartCoroutine(SurveillanceAction());
break; break;
case EnemyActionAction_Shield: case EnemyActionAction_Shield:
yield return StartCoroutine(ShieldAction(12)); yield return StartCoroutine(ShieldAction(enemyNode.currentActionScript.colA));
break; break;
} }

69
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/PollutionSpreader.cs

@ -23,6 +23,47 @@ public class PollutionSpreader : Enemy
{ {
GameManager.Instance.PlayerMove -= SettleRangeAttack; GameManager.Instance.PlayerMove -= SettleRangeAttack;
} }
private void Update()
{
if (enemyNode != null && enemyNode.currentActionScript != null)
{
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
if (currentNode.whoColour == Name.NodeColor.Black)
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_SpellAndAttack:
enemyNode.currentActionScript.colA = 3;
break;
case EnemyAction_Pollution:
enemyNode.currentActionScript.colA = 3;
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = 5;
enemyNode.currentActionScript.colB = 3;
break;
}
}
else
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_SpellAndAttack:
enemyNode.currentActionScript.colA = 2;
break;
case EnemyAction_Pollution:
enemyNode.currentActionScript.colA = 2;
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = 4;
enemyNode.currentActionScript.colB = 2;
break;
}
}
enemyNode.enemy.SettlePlannText(enemyNode.currentActionScript);
}
}
public override void SettleRangeAttack() public override void SettleRangeAttack()
{ {
switch (enemyNode.currentActionScript) switch (enemyNode.currentActionScript)
@ -38,22 +79,38 @@ public class PollutionSpreader : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_SpellAndAttack:
enemyNode.currentActionScript.colA = 2;
break;
case EnemyAction_Pollution:
enemyNode.currentActionScript.colA = 2;
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = 4;
enemyNode.currentActionScript.colB = 2;
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
//¸Ä±äÎı¾ //¸Ä±äÎı¾
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string strongAttackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage+1).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "*2点伤害;强化:造成" + strongAttackText + "*2点伤害并至多移动"); enemyNode.currentActionScript.SettleText(enemyNode, attackText+"*"+ enemyNode.currentActionScript.colB.ToString(), "造成" + attackText + "*"+ enemyNode.currentActionScript.colB.ToString()+"点伤害");
break; break;
case EnemyAction_Pollution: case EnemyAction_Pollution:
enemyNode.currentActionScript.SettleText(enemyNode, "", "散播:随机选择2格污染地块使其扩散1范围;强化:(3格)"); enemyNode.currentActionScript.SettleText(enemyNode, "", "散播:随机选择"+ enemyNode.currentActionScript.colA.ToString()+"格污染地块使其扩散1范围");
break; break;
case EnemyAction_SpellAndAttack: case EnemyAction_SpellAndAttack:
enemyNode.currentActionScript.SettleText(enemyNode, "", "瞄准玩家周围2范围,造成当前污染地块数量的伤害;强化:(3范围)"); enemyNode.currentActionScript.SettleText(enemyNode, "", "瞄准玩家周围"+ enemyNode.currentActionScript.colA.ToString()+"范围,造成当前污染地块数量的伤害");
break; break;
} }
@ -94,7 +151,7 @@ public class PollutionSpreader : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(damage, count); AttackDamage(enemyNode.currentActionScript.colA, enemyNode.currentActionScript.colB);
} }
} }
else else

14
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/PrismReflector.cs

@ -34,12 +34,22 @@ public class PrismReflector : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_ShieldAndPollution:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(10, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyAction_ShieldAndPollution: case EnemyAction_ShieldAndPollution:
enemyNode.currentActionScript.SettleText(enemyNode, "10", "对生命值最低的单位施加10点护盾并随机污染三格地块"); enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "对生命值最低的单位施加"+ enemyNode.currentActionScript.colA + "点护盾并随机污染三格地块");
break; break;
case EnemyAction_Spell: case EnemyAction_Spell:
enemyNode.currentActionScript.SettleText(enemyNode, "", "吸收前方1范围的玩家颜色地块"); enemyNode.currentActionScript.SettleText(enemyNode, "", "吸收前方1范围的玩家颜色地块");
@ -84,7 +94,7 @@ public class PrismReflector : Enemy
index = i; index = i;
} }
} }
EnemyManager.Instance.enemySpeedSortingList[index].EnemyState.shieldValue += EnemyManager.Instance.enemySpeedSortingList[index].ShieldCalculation(10); EnemyManager.Instance.enemySpeedSortingList[index].EnemyState.shieldValue += EnemyManager.Instance.enemySpeedSortingList[index].ShieldCalculation(enemyNode.currentActionScript.colA);
HashSet<MapUnity> targets = getNodeTools.getAllNotBlackNodes(); HashSet<MapUnity> targets = getNodeTools.getAllNotBlackNodes();
RandomPollute(targets, 3); RandomPollute(targets, 3);
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);

14
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/RatWarrior.cs

@ -35,13 +35,23 @@ public class RatWarrior : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
//改变文本 //改变文本
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage + (int)enemyNode.EnemyState.currentHP / 5).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA + (int)enemyNode.EnemyState.currentHP / 5).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并至多移动" + stepRangeText + "个格子。生命越低造成的伤害越低"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并至多移动" + stepRangeText + "个格子。生命越低造成的伤害越低");
break; break;
@ -79,7 +89,7 @@ public class RatWarrior : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage+(int)enemyNode.EnemyState.currentHP/5, 1); AttackDamage(enemyNode.currentActionScript.colA + (int)enemyNode.EnemyState.currentHP/5, 1);
RandomPollute(playerNode, 1); RandomPollute(playerNode, 1);
} }
} }

19
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/ReconnaissanceBee.cs

@ -34,15 +34,26 @@ public class ReconnaissanceBee : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.2f);
enemyNode.currentActionScript.colB = 2;
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
//¸Ä±äÎı¾ //¸Ä±äÎı¾
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "Ôì³É" + attackText + "*2µãÉ˺¦"); enemyNode.currentActionScript.SettleText(enemyNode, attackText+"*"+ enemyNode.currentActionScript.colB.ToString(), "Ôì³É" + attackText + "*2µãÉ˺¦");
break; break;
case EnemyAction_ShootAndPollute: case EnemyAction_ShootAndPollute:
//¸Ä±äÎı¾ //¸Ä±äÎı¾
@ -77,7 +88,7 @@ public class ReconnaissanceBee : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 2); AttackDamage(enemyNode.currentActionScript.colA, 2);
if (currentNode.whoColour.Equals(Name.NodeColor.Black)) if (currentNode.whoColour.Equals(Name.NodeColor.Black))
{ {
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.disable,1); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.disable,1);
@ -96,7 +107,7 @@ public class ReconnaissanceBee : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 2); AttackDamage(enemyNode.currentActionScript.colA, 2);
if (currentNode.whoColour.Equals(Name.NodeColor.Black)) if (currentNode.whoColour.Equals(Name.NodeColor.Black))
{ {
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.disable,1); Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.disable,1);

20
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/SoulMaker.cs

@ -38,6 +38,16 @@ public class SoulMaker : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_Spell:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(10, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
@ -50,7 +60,7 @@ public class SoulMaker : Enemy
case EnemyAction_Spell: case EnemyAction_Spell:
Debug.Log("¼¼ÄÜÎı¾2"); Debug.Log("¼¼ÄÜÎı¾2");
//¸Ä±äÎı¾ //¸Ä±äÎı¾
enemyNode.currentActionScript.SettleText(enemyNode, "10", "全体敌人回复10点生命"); enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "全体敌人回复"+ enemyNode.currentActionScript.colA+"点生命");
break; break;
} }
@ -62,7 +72,7 @@ public class SoulMaker : Enemy
switch (enemyAction) switch (enemyAction)
{ {
case EnemyAction_Summon: case EnemyAction_Summon:
yield return StartCoroutine(MeleeAttackAction());//召唤 yield return StartCoroutine(SummonAction());//召唤
break; break;
case EnemyAction_Spell: case EnemyAction_Spell:
yield return StartCoroutine(HeallAction());//»ØÑª yield return StartCoroutine(HeallAction());//»ØÑª
@ -82,7 +92,7 @@ public class SoulMaker : Enemy
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
for (int i = 0; i < EnemyManager.Instance.enemySpeedSortingList.Count; i++) for (int i = 0; i < EnemyManager.Instance.enemySpeedSortingList.Count; i++)
{ {
EnemyManager.Instance.enemySpeedSortingList[i].enemy.RecoverHp(10); EnemyManager.Instance.enemySpeedSortingList[i].enemy.RecoverHp(enemyNode.currentActionScript.colA);
isSpeedUp = false; isSpeedUp = false;
} }
@ -98,7 +108,7 @@ public class SoulMaker : Enemy
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
for (int i = 0; i < EnemyManager.Instance.enemySpeedSortingList.Count; i++) for (int i = 0; i < EnemyManager.Instance.enemySpeedSortingList.Count; i++)
{ {
EnemyManager.Instance.enemySpeedSortingList[i].enemy.RecoverHp(10); EnemyManager.Instance.enemySpeedSortingList[i].enemy.RecoverHp(enemyNode.currentActionScript.colA);
isSpeedUp = false; isSpeedUp = false;
} }
@ -106,7 +116,7 @@ public class SoulMaker : Enemy
} }
} }
public override IEnumerator MeleeAttackAction() public IEnumerator SummonAction()
{ {
List<GameObject> enemyPrefabList = EnemyPool.getEnemyPrefab(enemyList); List<GameObject> enemyPrefabList = EnemyPool.getEnemyPrefab(enemyList);
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);

84
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Thief.cs

@ -17,7 +17,7 @@ public class Thief : Enemy
enemyNode = GetComponent<EnemyNode>(); enemyNode = GetComponent<EnemyNode>();
enemyNode.sufferAbnormalCondition(AbnormalCondition.Buff_Thief, 1); enemyNode.sufferAbnormalCondition(AbnormalCondition.Buff_Thief, 1);
actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.attack), 0.7f); actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.attack), 0.7f);
actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.shootAndPollute), 0.3f); actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.spell), 0.3f);
//actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.sleep), 0.4f); //actionPool.Add(EnemyPlanUIManager.Instance.NewAction(EnemyPlanUIFunction.sleep), 0.4f);
GameManager.Instance.PlayerMove += SettleRangeAttack; GameManager.Instance.PlayerMove += SettleRangeAttack;
} }
@ -36,7 +36,57 @@ public class Thief : Enemy
case EnemyAction_ShootAndPollute: case EnemyAction_ShootAndPollute:
enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn)); enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn));
break; break;
case EnemyAction_Nothing:
enemyNode.enemyUIBar.outAttackRange.SetActive(false);
break;
}
} }
private void Update()
{
if (enemyNode != null && enemyNode.currentActionScript != null)
{
if (aliveCount >= 3)
{
enemyNode.currentActionScript = EnemyPlanUIManager.enemyPlanUIIconDictionary[EnemyPlanUIFunction.nothing].NewAction();
enemyAction = EnemyPlanUIManager.enemyPlanUIIconDictionary[EnemyPlanUIFunction.nothing].NewAction();
enemyNode.enemyUIBar.SwitchIntention(enemyAction);
enemyNode.enemyUIBar.outAttackRange.SetActive(false);
}
SettlePlannText(enemyNode.currentActionScript);
}
}
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyAction_Spell:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(12, 0.1f);
enemyNode.currentActionScript.colB = MathTool.RandomTarget(22, 0.1f);
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction)
{
switch (currentAction)
{
case EnemyAction_Spell:
enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "瞬移至玩家周围随机一格,造成"+ enemyNode.currentActionScript.colA+"点伤害,偷取"+ enemyNode.currentActionScript.colB+"金币");
break;
case EnemyActionAction_Attack:
enemyNode.currentActionScript.SettleText(enemyNode, enemyNode.currentActionScript.colA.ToString(), "造成" + enemyNode.currentActionScript.colA + "点伤害");
break;
case EnemyAction_Nothing:
enemyNode.currentActionScript.SettleText(enemyNode, " ", "回合开始时撤离战场");
break;
}
} }
public override void enemyTurnEnd() public override void enemyTurnEnd()
{ {
@ -61,10 +111,10 @@ public class Thief : Enemy
public override void enemyTurnBegin() public override void enemyTurnBegin()
{ {
if (aliveCount == 3) /*if (aliveCount >= 3)
{ {
enemyNode.RunAway(); enemyNode.RunAway();
} }*/
} }
public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走 public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
{ {
@ -74,13 +124,16 @@ public class Thief : Enemy
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
yield return StartCoroutine(MeleeAttackAction()); yield return StartCoroutine(MeleeAttackAction());
break; break;
case EnemyAction_ShootAndPollute: case EnemyAction_Spell:
yield return StartCoroutine(TeleportAction(enemyNode.EnemyState.damage,1,20)); yield return StartCoroutine(TeleportAction(enemyNode.currentActionScript.colA, 1, enemyNode.currentActionScript.colB));
break;
case EnemyAction_Nothing:
yield return StartCoroutine(RunAwayAction());
break; break;
} }
} }
public override IEnumerator MeleeAttackAction() public override IEnumerator MeleeAttackAction()
{ {
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY);
@ -93,7 +146,7 @@ public class Thief : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
if (currentNode.whoColour == Name.NodeColor.Black) if (currentNode.whoColour == Name.NodeColor.Black)
{ {
stolenForgingPointCount += stealForgingPoint(4); stolenForgingPointCount += stealForgingPoint(4);
@ -112,7 +165,7 @@ public class Thief : Enemy
yield return StartCoroutine(enemyNode.MeleeAttackAim()); yield return StartCoroutine(enemyNode.MeleeAttackAim());
// enemyNode.anim.SetTrigger("MeleeAttack"); // enemyNode.anim.SetTrigger("MeleeAttack");
// yield return new WaitForSeconds(0.5f); // yield return new WaitForSeconds(0.5f);
AttackDamage(enemyNode.EnemyState.damage, 1); AttackDamage(enemyNode.currentActionScript.colA, 1);
if (currentNode.whoColour == Name.NodeColor.Black) if (currentNode.whoColour == Name.NodeColor.Black)
{ {
stolenForgingPointCount += stealForgingPoint(4); stolenForgingPointCount += stealForgingPoint(4);
@ -126,11 +179,22 @@ public class Thief : Enemy
{ {
HashSet<MapUnity> targets = new HashSet<MapUnity> { GameManager.Instance.playerOn }; HashSet<MapUnity> targets = new HashSet<MapUnity> { GameManager.Instance.playerOn };
getNodeTools.getCircleNode(targets, 1); getNodeTools.getCircleNodeForEnemy(targets, 1);
targets.Remove(GameManager.Instance.playerOn);
if (targets.Count > 0)
{
HashSet<MapUnity> targetNode = MathTool.GetRandomElements(targets, 1); HashSet<MapUnity> targetNode = MathTool.GetRandomElements(targets, 1);
yield return StartCoroutine(moveOneStep(targetNode.ElementAt(0))); yield return StartCoroutine(moveOneStep(targetNode.ElementAt(0)));
AttackDamage(damage, damageCount); AttackDamage(damage, damageCount);
stolenMoney += stealMoney(15); stolenMoney += stealMoney(stealMoneyCount);
}
yield return null;
}
public IEnumerator RunAwayAction()
{
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing;
enemyNode.RunAway();
yield return null; yield return null;
} }

19
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/Twinbee.cs

@ -34,18 +34,31 @@ public class Twinbee : Enemy
break; break;
} }
} }
public override void ActionValRandom()
{
switch (enemyNode.currentActionScript)
{
case EnemyActionAction_Attack:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(enemyNode.EnemyState.damage, 0.1f);
break;
case EnemyActionAction_Aoe:
enemyNode.currentActionScript.colA = MathTool.RandomTarget(24, 0.1f);
break;
}
}
public override void SettlePlannText(EnemyAction currentAction) public override void SettlePlannText(EnemyAction currentAction)
{ {
switch (currentAction) switch (currentAction)
{ {
case EnemyActionAction_Attack: case EnemyActionAction_Attack:
//改变文本 //改变文本
string attackText = enemyNode.DamageCalculation(enemyNode.EnemyState.damage).ToString(); string attackText = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
string stepRangeText = enemyNode.getStepRange().ToString(); string stepRangeText = enemyNode.getStepRange().ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并至多移动" + stepRangeText + "个格子"); enemyNode.currentActionScript.SettleText(enemyNode, attackText, "造成" + attackText + "点伤害并至多移动" + stepRangeText + "个格子");
break; break;
case EnemyActionAction_Aoe: case EnemyActionAction_Aoe:
string attackTextAoe = enemyNode.DamageCalculation(24).ToString(); string attackTextAoe = enemyNode.DamageCalculation(enemyNode.currentActionScript.colA).ToString();
enemyNode.currentActionScript.SettleText(enemyNode, attackTextAoe, "以玩家为中心2格投射,造成" + attackTextAoe + "点伤害"); enemyNode.currentActionScript.SettleText(enemyNode, attackTextAoe, "以玩家为中心2格投射,造成" + attackTextAoe + "点伤害");
break; break;
@ -80,7 +93,7 @@ public class Twinbee : Enemy
yield return StartCoroutine(MeleeAttackAction()); yield return StartCoroutine(MeleeAttackAction());
break; break;
case EnemyActionAction_Aoe: case EnemyActionAction_Aoe:
yield return StartCoroutine(ThrowAttackAction(2,24,1,aimNode)); yield return StartCoroutine(ThrowAttackAction(2, enemyNode.currentActionScript.colA, 1,aimNode));
break; break;
} }

2
ColorlessWorld-2024-4-2/Assets/Scripts/EnemyPlanFunction/EnemyAction.cs

@ -8,6 +8,8 @@ public class EnemyAction
{ {
public Sprite sprite; public Sprite sprite;
public bool isAiming =true ;//是否需要连线 public bool isAiming =true ;//是否需要连线
public int colA;
public int colB;
public virtual void SettleText(EnemyNode enemyNode ,string damageValue,string planInforText) public virtual void SettleText(EnemyNode enemyNode ,string damageValue,string planInforText)
{ {
Debug.Log("基本"); Debug.Log("基本");

10
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/MathTool.cs

@ -3,10 +3,12 @@ using System.Buffers.Text;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Unity.Mathematics;
using UnityEngine; using UnityEngine;
public class MathTool public class MathTool
{ {
private static readonly System.Random random = new System.Random();
// Start is called before the first frame update // Start is called before the first frame update
public static List<int> GetRandomNumbers(int max, int count) public static List<int> GetRandomNumbers(int max, int count)
{ {
@ -344,6 +346,14 @@ public class MathTool
return result; return result;
} }
public static int RandomTarget(int target, float percentage)
{
float deviation = target * percentage;
// 生成偏差值,范围在 -deviation 到 +deviation 之间
double offset = (random.NextDouble() * 2 - 1) * deviation;
return (int)Math.Round(target + offset);
}
} }

2
ColorlessWorld-2024-4-2/Assets/Scripts/manager/EnemyPlanUIManager.cs

@ -5,7 +5,7 @@ using UnityEngine.UI;
public class EnemyPlanUIManager : Singleton<EnemyPlanUIManager> public class EnemyPlanUIManager : Singleton<EnemyPlanUIManager>
{ {
public static Dictionary<string, EnemyAction> enemyPlanUIIconDictionary = new Dictionary<string, EnemyAction>();//Ò쳣״̬ public static Dictionary<string, EnemyAction> enemyPlanUIIconDictionary = new Dictionary<string, EnemyAction>();
[Header("Òâͼͼ±ê")] [Header("Òâͼͼ±ê")]
public Sprite attackIcon; public Sprite attackIcon;

19
ColorlessWorld-2024-4-2/Assets/Scripts/manager/Usermanager.cs

@ -318,6 +318,10 @@ public class Usermanager : Singleton<Usermanager>
AbnormalConditionEndCheck(); AbnormalConditionEndCheck();
RefreshPlayerBuffIcon(); RefreshPlayerBuffIcon();
} }
if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Blue))
{
Usermanager.Instance.Shield += Usermanager.Instance.ShieldCalculation(5);
}
} }
public void PlayerTurnBeginSettle() public void PlayerTurnBeginSettle()
@ -458,11 +462,11 @@ public class Usermanager : Singleton<Usermanager>
public void SufferDamage(int damage,EnemyNode enemyNode) public void SufferDamage(int damage,EnemyNode enemyNode)
{ {
if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Blue)) /* if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Blue))
{ {
damage -= 2; damage -= 2;
MathTool.keepNature(ref damage); MathTool.keepNature(ref damage);
} }*/
if (enemyNode != null) if (enemyNode != null)
{ {
thornCal(enemyNode); thornCal(enemyNode);
@ -472,6 +476,7 @@ public class Usermanager : Singleton<Usermanager>
{ {
enemyNode.sufferAbnormalCondition(AbnormalCondition.fireSeed, 2); enemyNode.sufferAbnormalCondition(AbnormalCondition.fireSeed, 2);
} }
MathTool.keepNature(ref damage);
SufferDamageCalculation(damage,enemyNode); SufferDamageCalculation(damage,enemyNode);
checkDeath(); checkDeath();
@ -586,6 +591,10 @@ public class Usermanager : Singleton<Usermanager>
{ {
int addStepRange =0; int addStepRange =0;
if (MapUnityManager.Instance.isPlayerOn(Name.NodeColor.Yellow))
{
addStepRange++;
}
if (playerAbnormalCondition.ContainsKey(AbnormalCondition.upSpeed)) if (playerAbnormalCondition.ContainsKey(AbnormalCondition.upSpeed))
{ {
addStepRange += 1; addStepRange += 1;
@ -606,9 +615,9 @@ public class Usermanager : Singleton<Usermanager>
{ {
stepRangeMultiply = 1f; stepRangeMultiply = 1f;
} }
stepRange = (int)((stepRange + addStepRange) *stepRangeMultiply); int trueStepRange = (int)((stepRange + addStepRange) *stepRangeMultiply);
MathTool.keepNature(ref stepRange); MathTool.keepNature(ref trueStepRange);
return stepRange; return trueStepRange;
} }
//ÊÜÉ˼ÆË㺯Êý //ÊÜÉ˼ÆË㺯Êý
public int SufferTrueDamageCalculation(int damage) public int SufferTrueDamageCalculation(int damage)

Loading…
Cancel
Save