Added First Wizard Quest - part II

This commit is contained in:
kabix09 2023-01-07 17:49:15 +01:00
parent 6f557f1b96
commit ecaddbd69a
18 changed files with 677 additions and 73 deletions

View File

@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: WizardFirstQuestDialENG
m_EditorClassIdentifier:
SpeakerName: Wizard
CurrentStep: 2
CurrentStep: 1
DialogueSteps:
- Header: Wizard
WasDisplayed: 1
@ -99,6 +99,18 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: PlayerQuestContentManage
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: FinishDialogue
@ -205,6 +217,18 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: RemoveQuestFromList
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
@ -222,7 +246,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: FinishMission
m_MethodName: FinishMissionStepAndGoToNext
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

View File

@ -15,8 +15,8 @@ MonoBehaviour:
MissionName: WizardFirstQuest
PlayerTask:
id: 0
title: Crab Venom
description: Kill crabs and bring venom back to the Wizard
title: Wizard Quest
description: Kill crabs and bring venom to the Wizard
difficulty: 0
SpeakerName: Wizard
Status: 3
@ -24,6 +24,7 @@ MonoBehaviour:
MissionStepsList:
- SpeakerName: Wizard
Status: 2
MissionIssue: Kill crabs and bring venom to the Wizard
DialogueStep: {fileID: 11400000, guid: d335043aa9e96214b96d916c075923a9, type: 2}
MissionConditions:
Key: 0
@ -34,6 +35,7 @@ MonoBehaviour:
RequiredObject: {fileID: 8707952282648172651, guid: 7e7c7a913b3a569458a1f9ed3e86314f, type: 3}
- SpeakerName: Wizard
Status: 1
MissionIssue: Find the scroll and bring it back to the Wizard
DialogueStep: {fileID: 11400000, guid: fefb09c4dc167d4409e980ff6ca6fafe, type: 2}
MissionConditions:
Key: 0

View File

@ -85,7 +85,19 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: AcceptMission
m_MethodName: FinishMissionStep
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: PlayerQuestContentManage
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

View File

@ -0,0 +1,257 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67587597537a4344cad65ddbcebee119, type: 3}
m_Name: WizardFirstQuestDialPL
m_EditorClassIdentifier:
SpeakerName: Wizard
CurrentStep: 1
DialogueSteps:
- Header: Wizard
WasDisplayed: 1
ListOfSentences:
- Sentence: Dzien dobry! Ciesze sie, ze wreszcie sie obudziles. Jak sie masz?
Buttons:
- ButtonName: Kim jestes? Co to za miejsce?
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Jestem Czarodziejem. Znalazlem cie pobitego w jaskini i przyprowadzilem
tutaj. Nie bylem pewny czy sie obudzisz...
Buttons:
- ButtonName: "Dzi\u0119kuje za pomoc, ale powinienem juz isc."
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Nie sadze, ze jestes wystarczajaco silny. A ci bandyci i tak zabrali
prawie wszystko co miales. Dam ci ziola, jak wroce.
Buttons:
- ButtonName: Czuje sie dobrze. Musze isc.
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Dobrze. Udowodnij mi, ze jestes juz zdrowy i pozwole ci pojsc. W
lesie na polnocny wschod od mojego domu sa pewne robaki. Potrzebuje, zebys
je zabil i przyniosl mi ich jad. Przynies mi go, a pozwole ci odejsc.
Buttons:
- ButtonName: W porzadku.
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: AcceptMission
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: PlayerQuestContentManage
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: FinishDialogue
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
EndOfDialogueStepAction:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: -6535739299540378870, guid: 417d111e604a8124cb960805d809e513, type: 3}
m_TargetAssemblyTypeName: WizardFirstQuestManager, Assembly-CSharp
m_MethodName: AfterMissionAccepting
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Header: Wizard
WasDisplayed: 1
ListOfSentences:
- Sentence: Gdzies w domu powinienem miec miecz. Mozesz go zabrac.
Buttons: []
EndOfDialogueStepAction:
m_PersistentCalls:
m_Calls: []
- Header: Wizard
WasDisplayed: 0
ListOfSentences:
- Sentence: Udalo ci sie zdobyc jad?
Buttons:
- ButtonName: Bez problemu
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: HandleCondition
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
EndOfDialogueStepAction:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: -6535739299540378870, guid: 417d111e604a8124cb960805d809e513, type: 3}
m_TargetAssemblyTypeName: WizardFirstQuestManager, Assembly-CSharp
m_MethodName: AfterMeetingCondition
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Header: Wizard
WasDisplayed: 0
ListOfSentences:
- Sentence: Dziekuje
Buttons:
- ButtonName: Czy moge juz isc?
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: GiveReward
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: RemoveQuestFromList
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
EndOfDialogueStepAction:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: FinishMissionStepAndGoToNext
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 62aee70c95c27ab4bb19053e7089117d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,17 +12,41 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0a3bcdd1e2dba0c4791bcb151c0df6c1, type: 3}
m_Name: WizardFirstQuestPL
m_EditorClassIdentifier:
MissionName:
MissionName: WizardFirstQuest
PlayerTask:
id: 0
title:
description:
title: Wizard Quest
description: Kill crabs and bring venom to the Wizard
difficulty: 0
SpeakerName:
Status: 0
SpeakerName: Wizard
Status: 3
CurrentStep: 0
MissionStepsList: []
MissionStepsList:
- SpeakerName: Wizard
Status: 2
MissionIssue: Kill crabs and bring venom to the Wizard
DialogueStep: {fileID: 11400000, guid: d335043aa9e96214b96d916c075923a9, type: 2}
MissionConditions:
Key: 0
Value:
- Type: 0
RequiredElements:
- RequiredAmount: 1
RequiredObject: {fileID: 8707952282648172651, guid: 7e7c7a913b3a569458a1f9ed3e86314f, type: 3}
- SpeakerName: Wizard
Status: 1
MissionIssue: Find the scroll and bring it back to the Wizard
DialogueStep: {fileID: 11400000, guid: fefb09c4dc167d4409e980ff6ca6fafe, type: 2}
MissionConditions:
Key: 0
Value:
- Type: 0
RequiredElements:
- RequiredAmount: 1
RequiredObject: {fileID: 3372166038178475857, guid: 7f90c54472a8fe94f9b70805d288429b, type: 3}
Reward:
Items: []
Cash: 0
Experience: 0
Items:
- {fileID: 11400000, guid: b366ff81d4bcf0d4f9633bbbf7ea17df, type: 2}
- {fileID: 11400000, guid: dc7fdbc8450965344914371023ddb0c5, type: 2}
Cash: 20
Experience: 20

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 628a6902813ecdf42a05b57a5cd62501
guid: 578891406eb5573499c8e34b30989be6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@ -0,0 +1,109 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67587597537a4344cad65ddbcebee119, type: 3}
m_Name: WizardSecondQuestDialPL
m_EditorClassIdentifier:
SpeakerName: Wizard
CurrentStep: 0
DialogueSteps:
- Header: Wizard
WasDisplayed: 0
ListOfSentences:
- Sentence: Widze, ze faktycznie jestes wystarczajaco silny. Czy moglbym cie
prosic o jeszcze jedna rzecz?
Buttons:
- ButtonName: O co chodzi?
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Widzisz, gdzies w poblizu znajduje sie bardzo silne zrodlo magii.
To zaczarowany zwoj. Chcialbym zebys go dla mnie zdobyl.
Buttons:
- ButtonName: Dlaczego sam go nie zdobedziesz?
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Nie jestem wojownikiem. Sam nie dam rady. Ty wydajesz sie bardziej
niz odpowiedni. Obiecuje cie nagrodzic.
Buttons:
- ButtonName: Gdzie go znajde?
Type: 1
ButtonActions:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: Dialogue, Assembly-CSharp
m_MethodName: GoToNextSentence
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- Sentence: Idz na wschod. Na pewno dasz rade.
Buttons: []
EndOfDialogueStepAction:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: FinishMissionStep
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 11400000}
m_TargetAssemblyTypeName: MissionDialogue, Assembly-CSharp
m_MethodName: PlayerQuestContentManage
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e18c54fde6f4c0a47a8f39d74194c495
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -28,6 +28,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.2, y: 6, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2835830911057077560}
m_RootOrder: 0
@ -107,6 +108,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 5, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2835830911057077560}
m_RootOrder: 1
@ -186,6 +188,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.95, y: 0.2, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2835830909972040045}
- {fileID: 2835830910843601522}
@ -194,8 +197,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 74}
m_SizeDelta: {x: 800, y: 590}
m_AnchoredPosition: {x: 0, y: 81.5}
m_SizeDelta: {x: 800, y: 665}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2835830911057077562
CanvasRenderer:

View File

@ -67,6 +67,36 @@ public class MissionDialogue : Dialogue
{
Parent.GetOriginMission().FinishMission();
}
public void FinishMissionStep()
{
Parent.GetOriginMission().FinishMissionStep();
}
public void FinishMissionStepAndGoToNext()
{
Parent.GetOriginMission().FinishMissionStepAndGoToNext();
}
public void PlayerQuestContentManage(string newMissionIssue)
{
Parent.PlayerQuestContentManage(newMissionIssue);
}
public void PlayerQuestContentManage()
{
Parent.PlayerQuestContentManage();
}
public void CreateQuestOnList()
{
Parent.GetOriginMission().CreateQuestOnList();
}
public void RemoveQuestFromList()
{
Parent.GetOriginMission().RemoveQuestFromList();
}
#endregion
#region Dialogue Status API

View File

@ -31,9 +31,9 @@ public class Mission : ScriptableObject
[SerializeField]
public List<MissionStepModel> MissionStepsList;
/*
[SerializeField]
public MissionProcess missionProcess = null;*/
/*
[SerializeField]
public MissionProcess missionProcess = null;*/
[SerializeField]
public MissionReward Reward;
@ -41,17 +41,17 @@ public class Mission : ScriptableObject
//ConditionController . check condition
//private ConditionFactory factory = new ConditionFactory();
/*
public void AssignMissionProcessToStep(int stepNumber)
{
MissionStepsList[stepNumber].SetStepProcess(missionProcess);
}
*/
/*
public void AssignMissionProcessToStep(int stepNumber)
{
MissionStepsList[stepNumber].SetStepProcess(missionProcess);
}
*/
/* public void SetMissionCondition(string name)
{
//factory.CreateCondition(Type); //, name)
}*/
/* public void SetMissionCondition(string name)
{
//factory.CreateCondition(Type); //, name)
}*/
// Set by hand as mission condition as final astion specyfic step
public void CheckMissionRequirements()
@ -70,17 +70,8 @@ public class Mission : ScriptableObject
// ADD CONDITION LISTENING TO SPECIFY MISSION MANAGER missions list
// 2. Add mission to Player Panel :D
TaskUIManager.Instance.Add(PlayerTask);
CreateQuestOnList();
// 3. Save Player Quest Panel status & (somehow) mission status in game
var saveController = GameObject.FindObjectOfType<SaveController>();
if (saveController == null)
throw new Exception($"There is no SaveController component on scene!!!");
saveController.GetComponent<SaveController>().SavePlayerQuests();
//// TODO ! ! !
///saveController.SaveMissions();
///
@ -121,13 +112,35 @@ public class Mission : ScriptableObject
Status = MissionStatusEnum.Finished;
// 3. remove quest from player list
var task = TaskUIManager.Instance.FindTaskByName(PlayerTask.Title);
RemoveQuestFromList();
}
if (task.Count == 0)
Debug.LogError($"Task '{PlayerTask.Title}' not found");
else
TaskUIManager.Instance.RemoveByName(PlayerTask.Title);
/// <summary>
/// czy ta akcja ma by wywolywana w buttonie i ma wywoływac inn eakcje z 'end of step actions lsit'
/// czy ma byc jedna z nich i byc wywoływana przez 'go to next sentence' ....
/// </summary>
public void FinishMissionStep()
{
MissionStepsList[CurrentStep].Status = MissionStepStatusEnum.Finished;
CurrentStep++;
// build without starting
BuildMission(MissionStepsList);
}
/// <summary>
/// Alias dla tego co powinna robić logika 'GoToNextStep' w Missjach
/// </summary>
public void FinishMissionStepAndGoToNext()
{
MissionStepsList[CurrentStep].Status = MissionStepStatusEnum.Finished;
CurrentStep++;
// build & start
StartDialogue();
}
@ -167,7 +180,7 @@ public class Mission : ScriptableObject
{
// NIKE TYLKO ACTIVE !!
if ((MissionStep.Status == MissionStepStatusEnum.Active || MissionStep.Status == MissionStepStatusEnum.AfterCondition) && MissionStep.DialogueStep.GetCurrentStep().DialogueController.CurrentPanel != null)
if ((MissionStep.Status == MissionStepStatusEnum.Active || MissionStep.Status == MissionStepStatusEnum.AfterCondition) && MissionStep.DialogueStep.GetCurrentStep().DialogueController.CurrentPanel != null)
{
MissionStep.DialogueStep.GetCurrentStep().DialogueController.CloseCurrentPanel(); // close panel
@ -187,23 +200,23 @@ public class Mission : ScriptableObject
break;
}
/*
// jesli stan jest oczekujacy && dialog nie został w całości przegadany
// jesli warnek jest zpeniony - idz dalej - nie, czeksaj
if (MissionStep.Status == MissionStepStatusEnum.Pending && MissionStep.DialogueStep.GetCurrentStep().DialogueController.listOfDialogue.Count != 0)
{
// Check or register condition.....
// 1. Register condition
//ConditionManager.Instance.RegisterCondition(MissionName, MissionStep.MissionConditions);
/*
// jesli stan jest oczekujacy && dialog nie został w całości przegadany
// jesli warnek jest zpeniony - idz dalej - nie, czeksaj
if (MissionStep.Status == MissionStepStatusEnum.Pending && MissionStep.DialogueStep.GetCurrentStep().DialogueController.listOfDialogue.Count != 0)
{
// Check or register condition.....
// 1. Register condition
//ConditionManager.Instance.RegisterCondition(MissionName, MissionStep.MissionConditions);
// 2. register next step action
// TODO
// 2. register next step action
// TODO
// 3. Open panel (dialogue) ???
MissionStep.DialogueStep.StartDialogue(); // create panel
// 3. Open panel (dialogue) ???
MissionStep.DialogueStep.StartDialogue(); // create panel
break;
}*/
break;
}*/
}
}
@ -213,20 +226,20 @@ public class Mission : ScriptableObject
{
// Case I: Do nothing sepciaj just get first Step which wasn't invoked yet
if(MissionStep.Status == MissionStepStatusEnum.Pending)
if (MissionStep.Status == MissionStepStatusEnum.Pending)
{
/// var nextSentence = MissionStep.DialogueStep.DialogueController.ShowNextPanel(
/// var nextSentence = MissionStep.DialogueStep.DialogueController.ShowNextPanel(
// MissionStep.DialogueStep.DialogueController
//);
//If there is no sentence in Step - go to next one
/* if (!nextSentence)
{
MissionStep.Status = MissionStepStatusEnum.Finished;
/* if (!nextSentence)
{
MissionStep.Status = MissionStepStatusEnum.Finished;
ShowStep();
}
*/
ShowStep();
}
*/
break;
}
@ -237,11 +250,11 @@ public class Mission : ScriptableObject
// po spełnieniu step misji oznaczany jest jako ukończony
var conditionResult = CheckStepFinalCondition();
if(conditionResult)
if (conditionResult)
ShowStep();
break;
}
}
}
}
@ -264,8 +277,11 @@ public class Mission : ScriptableObject
}
// Additionaly set first step as active
Debug.Log("BuildMission - Activate step");
MissionStepsList[CurrentStep].ActivateStep();
//Debug.Log("BuildMission - Activate step");
if (MissionStepsList.Count() > CurrentStep)
MissionStepsList[CurrentStep].ActivateStep();
else
Debug.Log($"Mission [{MissionName}] step {CurrentStep} out of steps list containing {MissionStepsList.Count()}");
}
#region Dialogue Status API
@ -302,4 +318,59 @@ public class Mission : ScriptableObject
{
return MissionStepsList[CurrentStep];
}
#region Quest managment
public void CreateQuestOnList()
{
// WHERE IS CONDITION TO CHECK IF MISSION ALREADY EXISTS ??? ??? ???
// 2. Add mission to Player Panel :D
TaskUIManager.Instance.Add(PlayerTask);
// 3. Save Player Quest Panel status & (somehow) mission status in game
// Don't save quest in this moement on list because mission proggrss isnt saved before using
// teleport or saving proggress by player - data consistency
/*
var saveController = GameObject.FindObjectOfType<SaveController>();
if (saveController == null)
throw new Exception($"There is no SaveController component on scene!!!");
saveController.GetComponent<SaveController>().SavePlayerQuests();
*/
}
public void RemoveQuestFromList()
{
var task = TaskUIManager.Instance.FindTaskByName(PlayerTask.Title);
if (task.Count == 0)
Debug.LogError($"Task '{PlayerTask.Title}' not found");
else
TaskUIManager.Instance.RemoveByName(PlayerTask.Title);
}
/// <summary>
/// Po co misja idwoluje sie do dziecka zamiast ustawic to samemu?
///
/// Wprzyszlosci ustawic nowy content w stepei!
///
/// IMPORANT:
/// nadpisanie w jednym kroku nadpisuje żródłowy Description w Taku obiektu Mission!!!
/// </summary>
/// <param name="newMissionissue"></param>
public void PlayerQuestContentManage(string newMissionissue)
{
var task = TaskUIManager.Instance.FindTaskByName(PlayerTask.Title);
if (task.Count() == 0)
CreateQuestOnList();
// manually setupped new contrent for wqizard first mission script
((TaskUIManager)TaskUIManager.Instance).ChangeTaskIssue(PlayerTask.Title, newMissionissue);
}
#endregion
}

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System;
using UnityEngine.Events;
/*
* In basic want to have 3 steps
* - first to say hello and accept/reject mission
@ -22,6 +23,11 @@ public class MissionStepModel
[SerializeField] // this flag tell whatewer dialoge ware already display to user
public MissionStepStatusEnum Status = MissionStepStatusEnum.None;
// new mission header (optional - deleted (string, string) ) & task content
[SerializeField]
public string MissionIssue;
/*
[SerializeField]
public MissionDialogue DialogueStepTemplate;*/
@ -131,6 +137,11 @@ public class MissionStepModel
{
return ConditionManager.Instance.CheckCondition(MissionOrigin.MissionName);
}
/*
public void FinishStep()
{
}*/
#endregion
#region Mission Status API
@ -150,6 +161,19 @@ public class MissionStepModel
DialogueStep.UpdateDialogueState(dialogueData.MissionDialogueData);
}
#endregion
/// <summary>
/// Function to update Pkayer Quest description (and header optionaly) during mission progress
/// </summary>
public void PlayerQuestContentManage(string newContent)
{
MissionOrigin.PlayerQuestContentManage(newContent);
}
public void PlayerQuestContentManage()
{
MissionOrigin.PlayerQuestContentManage(MissionIssue);
}
}

View File

@ -166,6 +166,9 @@ public class NpcMissionManager : DialogueManager // ScriptableObject
public override bool GetCurrentDialoguePanelStatus()
{
if (Mission.CurrentStep >= Mission.MissionStepsList.Count())
return false;
return Mission
.GetCurrentStep()
.DialogueStep

View File

@ -111,4 +111,16 @@ class MissionConditionDataManager : SceneBaseDataManager<IndexValuePair<string,
return SaveData(MissionConditionDataList, SceneElementTypeEnum.Dynamic);
}
public List<MissionConditionData> FindMissionConditionByMissionName(string missionName)
{
return MissionConditionDataList
.Where(el => el.Key == missionName)
.ToList()
.SelectMany(el => el.Value)
.Where(el => el.Type == MissionTypeEnum.Collect)
.ToList()
;
}
}

View File

@ -87,7 +87,7 @@ class MissionDataManager : SceneBaseDataManager<MissionData>
// when chest detect player in near arrea and player press "c"
// open panel -> chest controller handle Open panel in Scene Chest Manager passing info about what Chest Palyer want to open
// Manager Build panel and pass info about chest content
Debug.Log("UseDynamicSettings");
LoadDynamicData();

View File

@ -57,4 +57,12 @@ public class TaskUIManager : UIBaseManager<Task>
// Resources = default path - Asset/Resources ... .obj
return Resources.Load(ITEM_LOCALIZATION + PANEL_NAME) as GameObject;
}
public void ChangeTaskIssue(string taskName, string newContent)
{
Elements.Where(task => task.Title == taskName).First().description = newContent;
UpdateList();
}
}

View File

@ -3,6 +3,12 @@ using System.Collections.Generic;
using GUI_Scripts.ProceduralGeneration;
using UnityEngine;
/// <summary>
/// Note:
/// Wizard changing quest content after finishing second dialogue
/// Before that prev gest stay in Quest list
/// </summary>
public enum WizzardMissionStateEnum
{
None = 0,
@ -53,6 +59,9 @@ public class WizardFirstQuestManager : MonoBehaviour
MissionProggress = (WizzardMissionStateEnum)PlayerPrefs.GetInt(gameObject.GetComponent<NPC>().name + ".FirstMission");
// ODCZYTANIE STANU Z PlayerPrefs JEST NIEZPOJNE Z DANYMI ODCZYTYWANIYMI Z PLIKU O PROGRESSIE MISJI
// Player Prefs zapisuje po kliknieciu buttona w dailogu
// Mission & Quest - zapisuje po teleporcie albo recznym 'save'
if (MissionProggress == WizzardMissionStateEnum.None)
StartCoroutine(WaitBeforStartingAction(5f));
else if (MissionProggress == WizzardMissionStateEnum.WaitingForPeoggress || MissionProggress == WizzardMissionStateEnum.MainPlotIntroduction)