|
@@ -9,8 +9,6 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
[Title("ESpirits_Assassin属性")]
|
|
[Title("ESpirits_Assassin属性")]
|
|
|
[Tooltip("X为锁定玩家次数Y为锁定肉盾次数")]
|
|
[Tooltip("X为锁定玩家次数Y为锁定肉盾次数")]
|
|
|
[LabelText("锁敌逻辑")] public Vector2 lockingLogic;
|
|
[LabelText("锁敌逻辑")] public Vector2 lockingLogic;
|
|
|
- [LabelText("连击间隔")] public float attackInterval;
|
|
|
|
|
- [LabelText("连击次数")] public float attackNum;
|
|
|
|
|
public bool targetIsPlayer;
|
|
public bool targetIsPlayer;
|
|
|
public int lockingNum;
|
|
public int lockingNum;
|
|
|
private PlayerController player;
|
|
private PlayerController player;
|
|
@@ -24,6 +22,17 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
ChooseLockingTarget();
|
|
ChooseLockingTarget();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public override void ChangeState(CharacterState newState)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (state)
|
|
|
|
|
+ {
|
|
|
|
|
+ case CharacterState.Attack:
|
|
|
|
|
+ ChooseLockingTarget();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ base.ChangeState(newState);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public override bool SearchTarget()
|
|
public override bool SearchTarget()
|
|
|
{
|
|
{
|
|
|
targetCharacter = lockCharacter;
|
|
targetCharacter = lockCharacter;
|
|
@@ -39,6 +48,7 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
{
|
|
{
|
|
|
targetIsPlayer = false;
|
|
targetIsPlayer = false;
|
|
|
lockingNum = 0;
|
|
lockingNum = 0;
|
|
|
|
|
+ ChooseLockingTarget();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -51,22 +61,23 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
{
|
|
{
|
|
|
targetIsPlayer = true;
|
|
targetIsPlayer = true;
|
|
|
lockingNum = 0;
|
|
lockingNum = 0;
|
|
|
|
|
+ lockCharacter = player;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- if (player.demonicDic[0].Count == 0)
|
|
|
|
|
|
|
+ if (player.demonicDic[1].Count == 0)
|
|
|
{
|
|
{
|
|
|
lockCharacter = player;
|
|
lockCharacter = player;
|
|
|
lockingNum--;
|
|
lockingNum--;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- lockCharacter = player.demonicDic[0][0];
|
|
|
|
|
|
|
+ lockCharacter = player.demonicDic[1][0];
|
|
|
Vector3 myPos = transform.position;
|
|
Vector3 myPos = transform.position;
|
|
|
float minDistance = Vector3.Distance(myPos, lockCharacter.transform.position);
|
|
float minDistance = Vector3.Distance(myPos, lockCharacter.transform.position);
|
|
|
- for (int i = 0; i < player.demonicDic[0].Count; i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < player.demonicDic[1].Count; i++)
|
|
|
{
|
|
{
|
|
|
- Demonic demonic = player.demonicDic[0][i];
|
|
|
|
|
|
|
+ Demonic demonic = player.demonicDic[1][i];
|
|
|
float distance = Vector3.Distance(myPos, demonic.transform.position);
|
|
float distance = Vector3.Distance(myPos, demonic.transform.position);
|
|
|
if (minDistance > distance)
|
|
if (minDistance > distance)
|
|
|
{
|
|
{
|
|
@@ -77,5 +88,6 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ targetCharacter = lockCharacter;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|