Added water, added EasterEggs, fixed city count, added hud button functions, v1.2.0

This commit is contained in:
Nicola Sovic
2022-04-11 16:21:17 +02:00
parent 8266248281
commit cb7541ce85
353 changed files with 11866 additions and 19 deletions

View File

@@ -121,6 +121,24 @@ namespace Assets.Scripts
EventSystem.current.SetSelectedGameObject(null);
}
public void switchCharactersheet()
{
audioHandler.playButtonClick();
uihandler.switchCharactersheet();
}
public void switchQuestlog()
{
audioHandler.playButtonClick();
uihandler.switchQuestLog();
}
public void switchOptions()
{
audioHandler.playButtonClick();
uihandler.switchPauseMenu();
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts
{
class EasterEggHandler
{
public static void applyEasterEgg(Player player)
{
applyNameEasterEgg(player);
}
private static void applyNameEasterEgg(Player player)
{
//maxHealth, maxSecondary, strength, dexterity, intelligence
int[] result = new int[5];
switch (player.getPlayerName().ToLower())
{
case "threetimes8":
result[0] = 240;
result[1] = 240;
result[2] = 24;
result[3] = 24;
result[4] = 24;
break;
case "finnchen123":
result[0] = 1230;
result[1] = 1230;
result[2] = 123;
result[3] = 123;
result[4] = 123;
break;
case "thefluffeypanda":
result[0] = 470;
result[1] = 470;
result[2] = 47;
result[3] = 47;
result[4] = 47;
break;
}
player.setStats(result);
}
}
}

View File

@@ -250,6 +250,15 @@ namespace Assets.Scripts
return result;
}
public void setStats(int[] stats)
{
maxHealth = stats[0];
maxSecondary = stats[1];
strength = stats[2];
dexterity = stats[3];
intelligence = stats[4];
}
public void displayAction(int index, GameObject image, GameObject desc)
{
skills[index].display(image, desc, secondary);
@@ -470,5 +479,10 @@ namespace Assets.Scripts
skills[i-1].displaySkill(skill.transform.Find("imgAction").gameObject, skill.transform.Find("descAction").gameObject);
}
}
public string getPlayerName()
{
return playername;
}
}
}

View File

@@ -26,6 +26,7 @@ namespace Assets.Scripts
public GameObject tooltip;
public GameObject tutorial;
public GameObject buttonsHUD;
public GameObject waterLayer;
public UIState state;
@@ -43,6 +44,19 @@ namespace Assets.Scripts
if (state == UIState.GAME)
{
updatePlayerHUD();
switchWaterLayer();
}
}
private void switchWaterLayer()
{
if (GameObject.Find("Player").transform.position.y < -1)
{
waterLayer.transform.localScale = new Vector3(1, 1, 1);
}
else
{
waterLayer.transform.localScale = new Vector3(0, 0, 0);
}
}
@@ -354,6 +368,10 @@ namespace Assets.Scripts
{
obj.transform.localScale = new Vector3(1, 1, 1);
}
if (obj != fight && state != UIState.CHARACTERCREATION && state != UIState.MAINMENU)
{
showHUD();
}
}
public void displayInformation(string information)

View File

@@ -83,8 +83,19 @@ public class WorldGenerator : MonoBehaviour
Vector3 mapPos = new Vector3(pos.x * 100, 0, pos.z * 100);
if (chance == 1)
{
newTile = Instantiate(city, mapPos, Quaternion.identity);
name = city.name;
if (cityAmount > 0)
{
newTile = Instantiate(city, mapPos, Quaternion.identity);
name = city.name;
cityAmount--;
}
else
{
newTile = Instantiate(tile, mapPos, Quaternion.identity);
name = tile.name;
noise.applyNoise(newTile);
}
}
else
{