Lumberjack - getting reward after quest

This commit is contained in:
kabix09 2023-01-05 16:52:57 +01:00
parent ea2879c9ff
commit 442a3617f1
6 changed files with 40 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -332,6 +332,9 @@ public class NPCDialogue : MonoBehaviour
else
TaskUIManager.Instance.RemoveByName(gameObject.GetComponent<NPCQuest>().quest.Title);
// 4. Get reward
GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerActions>().GetReward(gameObject.GetComponent<NPCQuest>().reward);
// 3. Set as finished
isQuest = 3;
EndDialogue();

View File

@ -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()
{

View File

@ -11,6 +11,9 @@ public class MissionReward
[SerializeField]
public int Cash = 0;
[SerializeField]
public int Experience = 0;
public MissionReward() { }
public MissionReward(List<EquippableItem> _items, int _cash)

View File

@ -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<Player>().GetExp(reward.Experience);
// 3. Save changes
// TODO - sync saving process reward / mission proggress
@ -36,5 +39,7 @@ public class PlayerActions : MonoBehaviour
//GameObject.FindObjectOfType<SaveController>().SavePlayerEquipmentItems();
//GameObject.FindObjectOfType<SaveController>().SavePlayerInventory();
//GameObject.FindObjectOfType<SaveController>().SaveAccountBalance();
// save exp
}
}