fixed chest, improved ui, improved difficulty
This commit is contained in:
@@ -20,7 +20,7 @@ public class Fight : MonoBehaviour
|
||||
this.enemy = enemy;
|
||||
this.player = player;
|
||||
enemy.GetComponent<Enemy>().scaleEnemy(player.GetComponent<PlayerGameObject>());
|
||||
enemy.transform.rotation = Quaternion.Euler(0,GameObject.Find("Main Camera").transform.rotation.y + 180f,0);
|
||||
enemy.transform.rotation = Quaternion.Euler(0, GameObject.Find("Main Camera").transform.rotation.y + 180f, 0);
|
||||
|
||||
uihandler = GameObject.Find("UIHandler").GetComponent<UIHandler>();
|
||||
uihandler.openFight();
|
||||
@@ -37,11 +37,20 @@ public class Fight : MonoBehaviour
|
||||
{
|
||||
int playerDamage = 0;
|
||||
int skillnumber = -1;
|
||||
bool escapedSuccesfully = false;
|
||||
switch (index)
|
||||
{
|
||||
case 1:
|
||||
endFight();
|
||||
uihandler.showMessage("INFORMATION;"+TextHandler.getText("escape"));
|
||||
if (rand.Next(1, 11) <= 3)
|
||||
{
|
||||
escapedSuccesfully = true;
|
||||
endFight();
|
||||
uihandler.showMessage("INFORMATION;" + TextHandler.getText("escape"));
|
||||
}
|
||||
else
|
||||
{
|
||||
uihandler.showMessage("ERROR;" + TextHandler.getText("escapeFail"));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//User waits
|
||||
@@ -81,7 +90,8 @@ public class Fight : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index != 1)
|
||||
int chance = escapedSuccesfully ? 3 : 10;
|
||||
if (rand.Next(1, 11) <= chance)
|
||||
{
|
||||
enemyAction();
|
||||
uihandler.updateFightInterface(enemy, player);
|
||||
@@ -94,7 +104,7 @@ public class Fight : MonoBehaviour
|
||||
int enemyDamage = -1;
|
||||
// { health, maxHealth, secondary, maxSecondary, strength, dexterity, intelligence };
|
||||
int[] enemyStats = enemy.GetComponent<Enemy>().getStats();
|
||||
int index = rand.Next(0,2);
|
||||
int index = rand.Next(0, 2);
|
||||
|
||||
if (index == 1 && enemyStats[2] <= 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user