added font, updated ui, fixed some code

This commit is contained in:
TAASONI3
2023-12-13 12:49:38 +01:00
parent 10ad860d3e
commit 17a0a22dd4
65 changed files with 1697 additions and 5019 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using Assets.Scripts.Player;
public class Fight : MonoBehaviour
{
@@ -18,7 +19,7 @@ public class Fight : MonoBehaviour
this.tile = tile;
this.enemy = enemy;
this.player = player;
enemy.GetComponent<Enemy>().scaleEnemy(player.GetComponent<Player>());
enemy.GetComponent<Enemy>().scaleEnemy(player.GetComponent<PlayerGameObject>());
enemy.transform.rotation = Quaternion.Euler(0,GameObject.Find("Main Camera").transform.rotation.y + 180f,0);
uihandler = GameObject.Find("UIHandler").GetComponent<UIHandler>();
@@ -46,7 +47,7 @@ public class Fight : MonoBehaviour
//User waits
break;
case 3:
playerDamage = player.GetComponent<Player>().calculateDamage();
playerDamage = player.GetComponent<PlayerGameObject>().calculateDamage();
break;
case 4:
skillnumber = 0;
@@ -60,10 +61,10 @@ public class Fight : MonoBehaviour
}
if (skillnumber != -1)
{
playerDamage = player.GetComponent<Player>().castSkill(skillnumber);
playerDamage = player.GetComponent<PlayerGameObject>().castSkill(skillnumber);
}
player.GetComponent<Player>().reduceCooldown(skillnumber);
player.GetComponent<Player>().regainSecondary();
player.GetComponent<PlayerGameObject>().reduceCooldown(skillnumber);
player.GetComponent<PlayerGameObject>().regainSecondary();
bool isDead = enemy.GetComponent<Enemy>().takeDamage(playerDamage);
if (isDead)
{
@@ -73,8 +74,8 @@ public class Fight : MonoBehaviour
}
endFight();
tile.GetComponent<Tile>().enemyKilled(enemy);
player.GetComponent<Player>().enemyKilled();
player.GetComponent<Player>().gainExperience(enemy.GetComponent<Enemy>().getExperience());
player.GetComponent<PlayerGameObject>().enemyKilled();
player.GetComponent<PlayerGameObject>().gainExperience(enemy.GetComponent<Enemy>().getExperience());
GameObject.Find("Inventory").GetComponent<Inventory>().addItem(enemy.GetComponent<Enemy>().getItem());
GameObject.Find("QuestLog").GetComponent<QuestLog>().updateQuests("kill", enemy, 1);
}
@@ -110,7 +111,7 @@ public class Fight : MonoBehaviour
break;
}
if (player.GetComponent<Player>().takeDamage(enemyDamage))
if (player.GetComponent<PlayerGameObject>().takeDamage(enemyDamage))
{
SteamWorksHandler.getStandardAchievement("DeathAchievement");
uihandler.showDeathScreen();