diff --git a/Assets/Resources/ThePlayer.prefab b/Assets/Resources/ThePlayer.prefab index 6ce61304..864e72ad 100644 --- a/Assets/Resources/ThePlayer.prefab +++ b/Assets/Resources/ThePlayer.prefab @@ -19,6 +19,7 @@ GameObject: - component: {fileID: 4869648843286970676} - component: {fileID: 4869648843286970678} - component: {fileID: 4869648843286970673} + - component: {fileID: -4072721723537361924} m_Layer: 0 m_Name: ThePlayer m_TagString: Player @@ -118,11 +119,18 @@ MonoBehaviour: walkSpeed: 10 Panel: {fileID: 0} dmgParticleSystem: {fileID: 4869648843387222763} - maxHealth: {fileID: 11400000, guid: 2cac7af95874b184aae736e0ed4994d7, type: 2} - currentHealth: 10 healthBar: {fileID: 0} lvlUp: 0 test: 0 + healthPoints: 0 + defensePoints: 0 + strengthPoints: 0 + intelligencePoints: 0 + attackValue: 0 + defenseValue: 0 + currentSpeed: 0 + currentHealth: 10 + maxHealth: 0 exp: 0 lvl: 0 maxExp: 0 @@ -270,6 +278,18 @@ MonoBehaviour: - E-InteractivePanelAbove - Spacebar-InteractivePanel - Spacebar-InteractivePanelAbove +--- !u!114 &-4072721723537361924 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4869648843286970700} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b706d33712b371949b5623cdf98fc4a4, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &4869648843387222766 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/CaveEntrance.unity b/Assets/Scenes/CaveEntrance.unity index b2096e97..1cd8c2dc 100644 --- a/Assets/Scenes/CaveEntrance.unity +++ b/Assets/Scenes/CaveEntrance.unity @@ -56351,6 +56351,10 @@ MonoBehaviour: difficulty: 0 axe: {fileID: 1826809974269949497, guid: 83fa1f81238efb541bd77405dcf33dd1, type: 3} isTaskAccepted: 0 + reward: + Items: [] + Cash: 15 + Experience: 10 --- !u!114 &551619109 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/NPCs' Scripts/NPCDialogue.cs b/Assets/Scripts/NPCs' Scripts/NPCDialogue.cs index f96255ed..075eb25f 100644 --- a/Assets/Scripts/NPCs' Scripts/NPCDialogue.cs +++ b/Assets/Scripts/NPCs' Scripts/NPCDialogue.cs @@ -332,6 +332,9 @@ public class NPCDialogue : MonoBehaviour else TaskUIManager.Instance.RemoveByName(gameObject.GetComponent().quest.Title); + // 4. Get reward + GameObject.FindGameObjectWithTag("Player").GetComponent().GetReward(gameObject.GetComponent().reward); + // 3. Set as finished isQuest = 3; EndDialogue(); diff --git a/Assets/Scripts/NPCs' Scripts/NPCQuest.cs b/Assets/Scripts/NPCs' Scripts/NPCQuest.cs index 145c9f01..60859906 100644 --- a/Assets/Scripts/NPCs' Scripts/NPCQuest.cs +++ b/Assets/Scripts/NPCs' Scripts/NPCQuest.cs @@ -14,6 +14,8 @@ public class NPCQuest : MonoBehaviour [SerializeField] private bool isTaskAccepted = false; + [SerializeField] public MissionReward reward; + // Start is called before the first frame update void Start() { diff --git a/Assets/Scripts/REFACTORING/Application/Mission/MissionReward.cs b/Assets/Scripts/REFACTORING/Application/Mission/MissionReward.cs index 322a7fd0..473e9965 100644 --- a/Assets/Scripts/REFACTORING/Application/Mission/MissionReward.cs +++ b/Assets/Scripts/REFACTORING/Application/Mission/MissionReward.cs @@ -11,6 +11,9 @@ public class MissionReward [SerializeField] public int Cash = 0; + [SerializeField] + public int Experience = 0; + public MissionReward() { } public MissionReward(List _items, int _cash) diff --git a/Assets/Scripts/REFACTORING/Application/Player/PlayerActions.cs b/Assets/Scripts/REFACTORING/Application/Player/PlayerActions.cs index 7ea5f799..0af60bd5 100644 --- a/Assets/Scripts/REFACTORING/Application/Player/PlayerActions.cs +++ b/Assets/Scripts/REFACTORING/Application/Player/PlayerActions.cs @@ -28,7 +28,10 @@ public class PlayerActions : MonoBehaviour // 2. Add cash AccountBalanceManager.Instance.IncreaseAccountBalanceValue(reward.Cash); - Debug.Log($"Give reward - {reward.Cash}"); + //Debug.Log($"Give reward - {reward.Cash}"); + + // 3. Add experience points + gameObject.GetComponent().GetExp(reward.Experience); // 3. Save changes // TODO - sync saving process reward / mission proggress @@ -36,5 +39,7 @@ public class PlayerActions : MonoBehaviour //GameObject.FindObjectOfType().SavePlayerEquipmentItems(); //GameObject.FindObjectOfType().SavePlayerInventory(); //GameObject.FindObjectOfType().SaveAccountBalance(); + + // save exp } }