From 61b81da607738e5632a1a3c3f0ffdc476c18438d Mon Sep 17 00:00:00 2001 From: Nicola Sovic Date: Thu, 24 Feb 2022 13:25:35 +0100 Subject: [PATCH] Added skills to char window, added house information --- Assets/IMG/Aseprite/Sign.aseprite | Bin 0 -> 1415 bytes Assets/IMG/Aseprite/Sign.aseprite.meta | 7 + Assets/IMG/Aseprite/Signpost.aseprite | Bin 0 -> 1929 bytes Assets/IMG/Aseprite/Signpost.aseprite.meta | 7 + Assets/IMG/Sign.png | Bin 0 -> 977 bytes Assets/IMG/Sign.png.meta | 120 ++++ Assets/IMG/Signpost.png | Bin 0 -> 784 bytes Assets/IMG/Signpost.png.meta | 120 ++++ Assets/Prefabs/HouseIdle.prefab | 2 +- Assets/Prefabs/Sign.prefab | 84 +++ Assets/Prefabs/Sign.prefab.meta | 7 + Assets/Prefabs/Signpost.prefab | 84 +++ Assets/Prefabs/Signpost.prefab.meta | 7 + Assets/Scenes/GameScene.unity | 793 ++++++++++++++++++++- Assets/Scripts/BasicSkill.cs | 12 + Assets/Scripts/Player.cs | 20 +- Assets/Scripts/PlayerCamera.cs | 3 + Assets/Scripts/UIHandler.cs | 7 +- ProjectSettings/TagManager.asset | 1 + 19 files changed, 1254 insertions(+), 20 deletions(-) create mode 100644 Assets/IMG/Aseprite/Sign.aseprite create mode 100644 Assets/IMG/Aseprite/Sign.aseprite.meta create mode 100644 Assets/IMG/Aseprite/Signpost.aseprite create mode 100644 Assets/IMG/Aseprite/Signpost.aseprite.meta create mode 100644 Assets/IMG/Sign.png create mode 100644 Assets/IMG/Sign.png.meta create mode 100644 Assets/IMG/Signpost.png create mode 100644 Assets/IMG/Signpost.png.meta create mode 100644 Assets/Prefabs/Sign.prefab create mode 100644 Assets/Prefabs/Sign.prefab.meta create mode 100644 Assets/Prefabs/Signpost.prefab create mode 100644 Assets/Prefabs/Signpost.prefab.meta diff --git a/Assets/IMG/Aseprite/Sign.aseprite b/Assets/IMG/Aseprite/Sign.aseprite new file mode 100644 index 0000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ie zZ2d$*xJ3}_M#AAjt4}QIR^mn=r%a8x_;_q#n_gIaA zLl^_izQb;CtK9y;)3b-|+8GZU?6JG|zVyzO|Nq_L%5VRi+3?u5^*-BykGH;Ih$3U62|z6mU4&|wk)B~wpVKbLh*2~7aA().texture = skillIcon; + desc.GetComponent().text = skillname + "(Lvl." + level + "): \r\n" + description; + } + public void reduceCooldown() { if (cooldown > 0) diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 36ed724..6686b35 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -74,18 +74,27 @@ namespace Assets.Scripts { case "Warrior": skills[0] = new BasicSkill(15,10,2,"Slash","Skills/Warrior/Slash",null); + skills[0].setDescription("A basic slash. But better than a basic attack"); skills[1] = new BasicSkill(0, 5, 1, "Block", "Skills/Warrior/Block", null); + skills[1].setDescription("Block the next attack"); skills[2] = new BasicSkill(30, 30, 4, "Execution", "Skills/Warrior/Execution", null); + skills[2].setDescription("A powerful skill. But hard to cast early"); break; case "Thief": skills[0] = new BasicSkill(15, 10, 2, "Stab", "Skills/Thief/Stab", null); + skills[0].setDescription("Early skill to apply some damage."); skills[1] = new BasicSkill(0, 5, 1, "SmokeScreen", "Skills/Thief/SmokeScreen", null); + skills[1].setDescription("Hide from the next attack"); skills[2] = new BasicSkill(30, 30, 4, "Heartstop", "Skills/Thief/Heartstop", null); + skills[2].setDescription("Stop the heart of your enemy. High damage."); break; case "Mage": skills[0] = new BasicSkill(15, 10, 2, "Icicle", "Skills/Mage/Icicle", null); + skills[0].setDescription("Small icicles to cut down your enemies HP"); skills[1] = new BasicSkill(0, 5, 1, "Teleport", "Skills/Mage/Teleport", null); + skills[1].setDescription("Evade the next attack"); skills[2] = new BasicSkill(30, 30, 4, "Fireball", "Skills/Mage/Fireball", null); + skills[2].setDescription("What a big fireball. Does some good damage"); break; } } @@ -226,7 +235,7 @@ namespace Assets.Scripts return result; } - public void displaySkill(int index, GameObject image, GameObject desc) + public void displayAction(int index, GameObject image, GameObject desc) { skills[index].display(image, desc, secondary); } @@ -437,5 +446,14 @@ namespace Assets.Scripts uihandler.showMessage("ERROR;You don't have enough points!"); } } + + public void displaySkills(GameObject pnlSkills) + { + for (int i = 1; i <= 3; i++) + { + GameObject skill = pnlSkills.transform.Find("skill" + i).gameObject; + skills[i-1].displaySkill(skill.transform.Find("imgAction").gameObject, skill.transform.Find("descAction").gameObject); + } + } } } diff --git a/Assets/Scripts/PlayerCamera.cs b/Assets/Scripts/PlayerCamera.cs index f3e4e70..8ecb9e6 100644 --- a/Assets/Scripts/PlayerCamera.cs +++ b/Assets/Scripts/PlayerCamera.cs @@ -63,6 +63,9 @@ namespace Assets.Scripts case "city": displayInformation("City"); break; + case "house": + displayInformation("House"); + break; } } } diff --git a/Assets/Scripts/UIHandler.cs b/Assets/Scripts/UIHandler.cs index 647844c..7265cd1 100644 --- a/Assets/Scripts/UIHandler.cs +++ b/Assets/Scripts/UIHandler.cs @@ -404,9 +404,9 @@ namespace Assets.Scripts GameObject actionFive = GameObject.Find("action5"); GameObject actionSix = GameObject.Find("action6"); - player.GetComponent().displaySkill(0, actionFour.transform.Find("imgAction").gameObject, actionFour.transform.Find("descAction").gameObject); - player.GetComponent().displaySkill(1, actionFive.transform.Find("imgAction").gameObject, actionFive.transform.Find("descAction").gameObject); - player.GetComponent().displaySkill(2, actionSix.transform.Find("imgAction").gameObject, actionSix.transform.Find("descAction").gameObject); + player.GetComponent().displayAction(0, actionFour.transform.Find("imgAction").gameObject, actionFour.transform.Find("descAction").gameObject); + player.GetComponent().displayAction(1, actionFive.transform.Find("imgAction").gameObject, actionFive.transform.Find("descAction").gameObject); + player.GetComponent().displayAction(2, actionSix.transform.Find("imgAction").gameObject, actionSix.transform.Find("descAction").gameObject); } private void updateFightInterfacePlayer(GameObject player) @@ -458,6 +458,7 @@ namespace Assets.Scripts player.updateName(GameObject.Find("txtName").GetComponent()); updatePoints(playerStats[10]); + player.displaySkills(GameObject.Find("pnlSkills")); } private void updatePoints(int points) diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 780f352..594b2f4 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -10,6 +10,7 @@ TagManager: - Object:NPC - Object:Enemy - Object:City + - Object:House layers: - Default - TransparentFX