Skip to content
Snippets Groups Projects
Commit 2b40c1df authored by Graham Solie's avatar Graham Solie
Browse files

AI Tweaks

parent 47db5729
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 27 deletions
No preview for this file type
No preview for this file type
......@@ -131,29 +131,29 @@ public class ArenaCombatControl : MonoBehaviour {
//a few proposed weapon stats
private void SetWeaponStats()
{
weapons[1].damageMin = 1;
weapons[0].damageMin = 1;
weapons[0].damageMax = 5;
weapons[0].attackSpeed = 1;
weapons[1].damageMin = 2;
weapons[1].damageMax = 5;
weapons[1].attackSpeed = 1;
weapons[1].attackSpeed = 2;
weapons[2].damageMin = 2;
weapons[2].damageMax = 5;
weapons[2].damageMin = 3;
weapons[2].damageMax = 6;
weapons[2].attackSpeed = 2;
weapons[3].damageMin = 3;
weapons[3].damageMax = 6;
weapons[3].attackSpeed = 2;
weapons[4].damageMin = 3;
weapons[4].damageMax = 4;
weapons[4].attackSpeed = 4;
weapons[3].damageMax = 4;
weapons[3].attackSpeed = 4;
weapons[5].damageMin = 6;
weapons[5].damageMax = 12;
weapons[5].attackSpeed = 1;
weapons[4].damageMin = 6;
weapons[4].damageMax = 12;
weapons[4].attackSpeed = 1;
weapons[6].damageMin = 5;
weapons[6].damageMax = 10;
weapons[6].attackSpeed = 3;
weapons[5].damageMin = 5;
weapons[5].damageMax = 10;
weapons[5].attackSpeed = 3;
......
......@@ -19,21 +19,21 @@ public class EnemyAI : MonoBehaviour {
target = GameObject.Find("Player").transform; //look at the player
myAnimator = GetComponent<Animator>(); //required for animation *******
Enemy = GetComponent<Rigidbody2D>();
BuildDecisionTree();
}
void Update() {
BuildDecisionTree();
root.search(root);
}
public bool inAttackRange() {
if (Vector3.Distance(transform.position, target.position) < 1.5f) {
if (Vector3.Distance(transform.position, target.position) < 1.25f) {
myAnimator.SetBool("speed", false);
return true;
}
......@@ -75,15 +75,18 @@ public class EnemyAI : MonoBehaviour {
public void run() {
// float option = Random.Range(0, 2);
// if (option == 1) {
myAnimator.SetBool("block", true);
Enemy.velocity = Vector2.zero;
// }
float option = Random.Range(0, 3);
Debug.Log(option);
if (option == 1) {
myAnimator.SetBool("block", true);
Enemy.velocity = Vector2.zero;
Debug.Log("block");
}
//if (option == 2) {
// Enemy.AddForce(new Vector2(0, 500));
// }
if (option == 2) {
Enemy.AddForce(new Vector2(-50, 500));
}
}
......
No preview for this file type
No preview for this file type
No preview for this file type
0000.57c821ea.0000
0000.57c82212.0000
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
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