public override bool perform(GameObject agent) { Abigail currA = agent.GetComponent <Abigail> (); if (currA.stamina >= (500 - cost) && !isDashing) { currA.stamina -= (500 - cost); //to-do: magic number Animator currAnim = GetComponentInParent <Animator> (); currAnim.Play("abigailEvade"); currA.setSpeed(dashSpeed); Vector2 point = Random.insideUnitCircle * 5; Vector3 targetPoint = new Vector3(target.transform.position.x + point.x, target.transform.position.y + point.y, target.transform.position.z); isDashing = true; dashTarget = targetPoint; currAnim.SetTrigger("dashComplete"); moved = true; return(true); } else { return(false); } }
public override bool checkProceduralPrecondition(GameObject agent) { target = GameObject.Find("Player"); Abigail currA = agent.GetComponent <Abigail> (); if (target != null && currA.stamina >= (500 - cost) && !target.GetComponent <PlayerMovement2D>().isBlocking) { return(true); } return(false); }
public override bool perform(GameObject agent) { Abigail currA = agent.GetComponent <Abigail> (); currA.stamina -= (500 - cost); Animator currAnim = GetComponentInParent <Animator> (); //spellAnim.wrapMode = WrapMode.ClampForever; //done in inspector right now currAnim.Play("abigailSpell"); attacked = true; return(attacked); }
public override bool checkProceduralPrecondition(GameObject agent) { target = GameObject.Find("Player"); Abigail currA = agent.GetComponent <Abigail> (); if (target != null && target.GetComponent <PlayerMovement>().isBlocking&& currA.stamina >= (500 - cost)) //to-do: make scaling system instead of magic number) { return(true); } else { return(false); } }