Skip to content
Snippets Groups Projects
Commit a837b29c authored by william's avatar william
Browse files

correcao na ativacao das skills, melhoria na IA de atk

parent c5ff3409
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,11 @@ public class CrossOverScript : MonoBehaviour
{
if (controller.getCrossOverInput() == 1)
{
if (controller.isMyturn() && !controller.isSkillUsing() && !usingAxis)
{
StopCoroutine("move");
StartCoroutine(crossOver());
animatorController.SetTrigger("CrossOver");
}
usingAxis = true;
}
......@@ -45,10 +46,8 @@ public class CrossOverScript : MonoBehaviour
private IEnumerator crossOver()
{
controller.updateMovementLockStates();
animatorController.SetTrigger("CrossOver");
while(isActive)
{
Debug.Log(rb.velocity);
rb.velocity = new Vector2(-1, controller.currentHand) * controller.getSpeed() * speedModifier;
yield return null;
}
......@@ -58,6 +57,7 @@ public class CrossOverScript : MonoBehaviour
private void updateState()
{
isActive = isActive == true? false : true;
StartCoroutine(crossOver());
}
public virtual void OnDisable()
......
......@@ -88,8 +88,7 @@ public class OpponentController : Controller
if (elapsedTime > 0.5f)
{
elapsedTime = 0;
yield return movement(6);
//yield return movement(Random.Range(0, 8));
yield return movement(Random.Range(0, 8));
}
yield return null;
}
......@@ -97,7 +96,6 @@ public class OpponentController : Controller
private IEnumerator movement(int choice)
{
Debug.Log(choice);
switch (choice)
{
//W - Move
......
......@@ -32,7 +32,7 @@ public class StepBackScript : MonoBehaviour
if (controller.isMyturn() && !controller.isSkillUsing() && !usingAxis)
{
StopCoroutine("move");
StartCoroutine(stepBack());
animatorController.SetTrigger("StepBack");
}
usingAxis = true;
}
......@@ -44,7 +44,6 @@ public class StepBackScript : MonoBehaviour
private IEnumerator stepBack()
{
controller.updateMovementLockStates();
animatorController.SetTrigger("StepBack");
while(isActive)
{
rb.velocity = new Vector2(1, controller.currentHand) * controller.getSpeed() * speedModifier;
......@@ -56,19 +55,16 @@ public class StepBackScript : MonoBehaviour
private void updateState()
{
isActive = isActive == true? false : true;
StartCoroutine(stepBack());
}
public virtual void OnDisable()
{
StepBackBehaviour.action -= updateState;
isActive = false;
usingAxis = false;
}
public virtual void OnEnable()
{
StepBackBehaviour.action += updateState;
isActive = false;
usingAxis = false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment