Wizard - fix parameters
This commit is contained in:
parent
eb3f0d1cc2
commit
4d3c3051df
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -140,19 +140,13 @@ public class DungeonManager : MonoBehaviour
|
|||||||
public void BuildWizard()
|
public void BuildWizard()
|
||||||
{
|
{
|
||||||
Vector3 teleportCoords;
|
Vector3 teleportCoords;
|
||||||
Debug.Log("creating wizard!!!!!!!!!!!");
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
teleportCoords = GameObject.FindObjectOfType<TileMapGenerator>().gameObject.GetComponent<TileMapGenerator>().randomCoordsForStanding();
|
teleportCoords = GameObject.FindObjectOfType<TileMapGenerator>().gameObject.GetComponent<TileMapGenerator>().randomCoordsForStanding();
|
||||||
Debug.Log(Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position));
|
|
||||||
Debug.Log("player position: " + GameObject.FindGameObjectWithTag("Player").gameObject.transform.position);
|
|
||||||
|
|
||||||
} while (!(Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position) > 6 &&
|
} while (!(Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position) > 6 &&
|
||||||
Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position) < 9));
|
Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position) < 9));
|
||||||
|
|
||||||
Debug.Log(teleportCoords);
|
|
||||||
Debug.Log(Vector2.Distance(teleportCoords, GameObject.FindGameObjectWithTag("Player").gameObject.transform.position));
|
|
||||||
|
|
||||||
var newWizard = Instantiate(Wizard, teleportCoords, Quaternion.identity);
|
var newWizard = Instantiate(Wizard, teleportCoords, Quaternion.identity);
|
||||||
//newWizard.transform.localPosition = teleportCoords;
|
//newWizard.transform.localPosition = teleportCoords;
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ class BattleWizard : MonoBehaviour
|
|||||||
{
|
{
|
||||||
enemy.isKinematic = false;
|
enemy.isKinematic = false;
|
||||||
Vector2 difference = enemy.transform.position - player.transform.position;
|
Vector2 difference = enemy.transform.position - player.transform.position;
|
||||||
difference = difference.normalized * 5; // thrust
|
difference = difference.normalized * 10; // thrust
|
||||||
enemy.AddForce(difference, ForceMode2D.Impulse);
|
enemy.AddForce(difference, ForceMode2D.Impulse);
|
||||||
//StartCoroutine(KnockCo(enemy));
|
//StartCoroutine(KnockCo(enemy));
|
||||||
}
|
}
|
||||||
@ -525,23 +525,23 @@ class BattleWizard : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (currentHealth > maxHealth * 0.75f)
|
if (currentHealth > maxHealth * 0.75f)
|
||||||
{
|
{
|
||||||
gameObject.GetComponent<AStarPathfindingAgent>().speed = 1f;
|
gameObject.GetComponent<AStarPathfindingAgent>().speed = 2f;
|
||||||
timeToWaitBeforeNextAttack = 1f;
|
timeToWaitBeforeNextAttack = 1f;
|
||||||
}
|
}
|
||||||
else if (currentHealth <= maxHealth * 0.75f && currentHealth > maxHealth * 0.50f)
|
else if (currentHealth <= maxHealth * 0.75f && currentHealth > maxHealth * 0.50f)
|
||||||
{
|
{
|
||||||
gameObject.GetComponent<AStarPathfindingAgent>().speed = 1.15f;
|
gameObject.GetComponent<AStarPathfindingAgent>().speed = 2.55f;
|
||||||
timeToWaitBeforeNextAttack = 0.8f;
|
timeToWaitBeforeNextAttack = 0.8f;
|
||||||
}
|
}
|
||||||
else if (currentHealth <= maxHealth * 0.50f && currentHealth > maxHealth * 0.25f)
|
else if (currentHealth <= maxHealth * 0.50f && currentHealth > maxHealth * 0.25f)
|
||||||
{
|
{
|
||||||
gameObject.GetComponent<AStarPathfindingAgent>().speed = 1.30f;
|
gameObject.GetComponent<AStarPathfindingAgent>().speed = 3;
|
||||||
timeToWaitBeforeNextAttack = 0.7f;
|
timeToWaitBeforeNextAttack = 0.7f;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (currentHealth <= maxHealth * 0.25f && currentHealth > maxHealth * 0.10f)
|
else if (currentHealth <= maxHealth * 0.25f && currentHealth > maxHealth * 0.10f)
|
||||||
{
|
{
|
||||||
gameObject.GetComponent<AStarPathfindingAgent>().speed = 1.45f;
|
gameObject.GetComponent<AStarPathfindingAgent>().speed = 3.25f;
|
||||||
timeToWaitBeforeNextAttack = 0.6f;
|
timeToWaitBeforeNextAttack = 0.6f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,9 +74,11 @@ class EscapingWizard : MonoBehaviour
|
|||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
//anim.SetBool("isRunning", false);
|
StopAllCoroutines();
|
||||||
|
|
||||||
gameObject.GetComponent<NPC>().State = NPCStateEnum.Pending;
|
gameObject.GetComponent<NPC>().State = NPCStateEnum.Pending;
|
||||||
|
|
||||||
|
anim.SetBool("isRunning", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user