Added char information in creation, fixed tooltips, v.1.1.1

This commit is contained in:
Nicola Sovic 2022-03-13 14:18:44 +01:00
parent 2effcd1208
commit 220ec2eadc
5 changed files with 767 additions and 65 deletions

File diff suppressed because it is too large Load Diff

View File

@ -96,11 +96,15 @@ public class AudioHandler : MonoBehaviour
public void changeVolumeMusic() public void changeVolumeMusic()
{ {
cameraAudio.volume = GameObject.Find("slideMusic").GetComponent<Slider>().value; cameraAudio.volume = GameObject.Find("slideMusic").GetComponent<Slider>().value;
int volume = (int)(cameraAudio.volume * 100);
GameObject.Find("txtMusic").GetComponent<Text>().text = "Music (" + volume + "%)";
} }
public void changeVolumeEffects() public void changeVolumeEffects()
{ {
playerAudio.volume = GameObject.Find("slideEffects").GetComponent<Slider>().value; playerAudio.volume = GameObject.Find("slideEffects").GetComponent<Slider>().value;
int volume = (int)(playerAudio.volume * 100);
GameObject.Find("txtEffects").GetComponent<Text>().text = "Effects (" + volume + "%)";
} }
public void setSlider() public void setSlider()

View File

@ -22,7 +22,7 @@ namespace Assets.Scripts
public void startGame() public void startGame()
{ {
audioHandler.playButtonClick(); audioHandler.playButtonClick();
uihandler.openTutorial(); uihandler.openIntroduction();
} }
public void closeGame() public void closeGame()
@ -114,6 +114,12 @@ namespace Assets.Scripts
uihandler.closeOptions(); uihandler.closeOptions();
} }
public void closeIntroduction()
{
audioHandler.playButtonClick();
uihandler.openTutorial();
}
public void closeTutorial() public void closeTutorial()
{ {
audioHandler.playButtonClick(); audioHandler.playButtonClick();

View File

@ -158,6 +158,10 @@ namespace Assets.Scripts
private void healPlayer() private void healPlayer()
{ {
health = health + 30 / (difficulty + 1); health = health + 30 / (difficulty + 1);
if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S))
{
health = health + 5;
}
if (health >= maxHealth) if (health >= maxHealth)
{ {
health = maxHealth; health = maxHealth;

View File

@ -23,8 +23,9 @@ namespace Assets.Scripts
public GameObject pauseMenu; public GameObject pauseMenu;
public GameObject playerHUD; public GameObject playerHUD;
public GameObject questlog; public GameObject questlog;
public GameObject tutorial; public GameObject introduction;
public GameObject tooltip; public GameObject tooltip;
public GameObject tutorial;
public UIState state; public UIState state;
@ -566,10 +567,30 @@ namespace Assets.Scripts
bar.GetComponent<RectTransform>().offsetMax = new Vector2(-change, bar.GetComponent<RectTransform>().offsetMax.y); bar.GetComponent<RectTransform>().offsetMax = new Vector2(-change, bar.GetComponent<RectTransform>().offsetMax.y);
} }
public void openIntroduction()
{
hideOtherElements(introduction);
state = UIState.TUTORIAL;
}
public void openTutorial() public void openTutorial()
{ {
hideOtherElements(tutorial); hideOtherElements(tutorial);
state = UIState.TUTORIAL; }
public void updateCreationInformation()
{
setPlayerInformation();
// health, maxHealth, secondary, maxSecondary, strength, dexterity, intelligence, level, experience, maxExperience, points
int[] playerstats = GameObject.Find("Player").GetComponent<Player>().getStats();
GameObject.Find("txtStrength_Creation").GetComponent<Text>().text = "Strength: " + playerstats[4];
GameObject.Find("txtDexterity_Creation").GetComponent<Text>().text = "Dexterity: " + playerstats[5];
GameObject.Find("txtIntelligence_Creation").GetComponent<Text>().text = "Intelligence: " + playerstats[4];
GameObject.Find("txtHealth_Creation").GetComponent<Text>().text = "Health: " + playerstats[1];
GameObject.Find("txtSecondary_Creation").GetComponent<Text>().text = "Mana: " + playerstats[3];
} }
} }
} }