|
|
|
@ -17,7 +17,7 @@ public class Thief : Enemy |
|
|
|
enemyNode = GetComponent<EnemyNode>(); |
|
|
|
enemyNode.sufferAbnormalCondition(AbnormalCondition.Buff_Thief, 1); |
|
|
|
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);
|
|
|
|
GameManager.Instance.PlayerMove += SettleRangeAttack; |
|
|
|
} |
|
|
|
@ -36,8 +36,58 @@ public class Thief : Enemy |
|
|
|
case EnemyAction_ShootAndPollute: |
|
|
|
enemyNode.enemyUIBar.outAttackRange.SetActive(!enemyNode.rangePool.Contains(GameManager.Instance.playerOn)); |
|
|
|
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() |
|
|
|
{ |
|
|
|
aliveCount++; |
|
|
|
@ -61,10 +111,10 @@ public class Thief : Enemy |
|
|
|
|
|
|
|
public override void enemyTurnBegin() |
|
|
|
{ |
|
|
|
if (aliveCount == 3) |
|
|
|
/*if (aliveCount >= 3) |
|
|
|
{ |
|
|
|
enemyNode.RunAway(); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
public override IEnumerator JudgeActionCoroutine()//等移动到位置就判断是否还能走
|
|
|
|
{ |
|
|
|
@ -74,13 +124,16 @@ public class Thief : Enemy |
|
|
|
case EnemyActionAction_Attack: |
|
|
|
yield return StartCoroutine(MeleeAttackAction()); |
|
|
|
break; |
|
|
|
case EnemyAction_ShootAndPollute: |
|
|
|
yield return StartCoroutine(TeleportAction(enemyNode.EnemyState.damage,1,20)); |
|
|
|
case EnemyAction_Spell: |
|
|
|
yield return StartCoroutine(TeleportAction(enemyNode.currentActionScript.colA, 1, enemyNode.currentActionScript.colB)); |
|
|
|
break; |
|
|
|
case EnemyAction_Nothing: |
|
|
|
yield return StartCoroutine(RunAwayAction()); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override IEnumerator MeleeAttackAction() |
|
|
|
{ |
|
|
|
MapUnity currentNode = getNodeTools.LocationToGetNode(enemyNode.positionX, enemyNode.positionY); |
|
|
|
@ -93,7 +146,7 @@ public class Thief : Enemy |
|
|
|
yield return StartCoroutine(enemyNode.MeleeAttackAim()); |
|
|
|
// enemyNode.anim.SetTrigger("MeleeAttack");
|
|
|
|
// yield return new WaitForSeconds(0.5f);
|
|
|
|
AttackDamage(enemyNode.EnemyState.damage, 1); |
|
|
|
AttackDamage(enemyNode.currentActionScript.colA, 1); |
|
|
|
if (currentNode.whoColour == Name.NodeColor.Black) |
|
|
|
{ |
|
|
|
stolenForgingPointCount += stealForgingPoint(4); |
|
|
|
@ -112,7 +165,7 @@ public class Thief : Enemy |
|
|
|
yield return StartCoroutine(enemyNode.MeleeAttackAim()); |
|
|
|
// enemyNode.anim.SetTrigger("MeleeAttack");
|
|
|
|
// yield return new WaitForSeconds(0.5f);
|
|
|
|
AttackDamage(enemyNode.EnemyState.damage, 1); |
|
|
|
AttackDamage(enemyNode.currentActionScript.colA, 1); |
|
|
|
if (currentNode.whoColour == Name.NodeColor.Black) |
|
|
|
{ |
|
|
|
stolenForgingPointCount += stealForgingPoint(4); |
|
|
|
@ -126,11 +179,22 @@ public class Thief : Enemy |
|
|
|
{ |
|
|
|
|
|
|
|
HashSet<MapUnity> targets = new HashSet<MapUnity> { GameManager.Instance.playerOn }; |
|
|
|
getNodeTools.getCircleNode(targets, 1); |
|
|
|
HashSet<MapUnity> targetNode = MathTool.GetRandomElements(targets, 1); |
|
|
|
yield return StartCoroutine(moveOneStep(targetNode.ElementAt(0))); |
|
|
|
AttackDamage(damage, damageCount); |
|
|
|
stolenMoney += stealMoney(15); |
|
|
|
getNodeTools.getCircleNodeForEnemy(targets, 1); |
|
|
|
targets.Remove(GameManager.Instance.playerOn); |
|
|
|
if (targets.Count > 0) |
|
|
|
{ |
|
|
|
HashSet<MapUnity> targetNode = MathTool.GetRandomElements(targets, 1); |
|
|
|
yield return StartCoroutine(moveOneStep(targetNode.ElementAt(0))); |
|
|
|
AttackDamage(damage, damageCount); |
|
|
|
stolenMoney += stealMoney(stealMoneyCount); |
|
|
|
} |
|
|
|
yield return null; |
|
|
|
} |
|
|
|
|
|
|
|
public IEnumerator RunAwayAction() |
|
|
|
{ |
|
|
|
EnemyManager.Instance.enemyTurnState = EnemyManager.EnemyTurnState.runing; |
|
|
|
enemyNode.RunAway(); |
|
|
|
yield return null; |
|
|
|
} |
|
|
|
|
|
|
|
|