forked from ZestyTS/DreamQEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOption.cs
More file actions
119 lines (98 loc) · 2.92 KB
/
Option.cs
File metadata and controls
119 lines (98 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DreamQEngine
{
public class Option
{
//The text of this choice
protected string mText;
//The text displayed when showing this option to the player
protected string mDisplayText;
//The various event requirements needed to display this option
protected Dictionary<string, bool> mEventReqs;
//The various event checks that we need to save when taking this option
protected Dictionary<string, bool> mEventChanges;
//The amount various stats change when making this choice
protected Dictionary<string, int> mStatChanges;
//The various stat requirements needed to display this option
protected Dictionary<string, int> mStatReqs;
//The dialogue to move to after taking this option
protected Outcome mOutcome;
public Option()
{
}
public Option(string text, string displayText, int outcomeType, int outcomeRef)
{
mText = text;
mDisplayText = displayText;
mOutcome = new Outcome(getOutcomeType(outcomeType), outcomeRef);
}
public string text
{
set { mText = value; }
get { return mText; }
}
public Dictionary<string, int> statReqs
{
set { mStatReqs = value; }
get { return mStatReqs; }
}
public string displayText
{
set { mDisplayText = value; }
get { return mDisplayText; }
}
public Dictionary<string, int> statChanges
{
set { mStatChanges = value; }
get { return mStatChanges; }
}
public Outcome outcome
{
set { mOutcome = value; }
get { return mOutcome; }
}
public Dictionary<string, bool> eventReqs
{
set { mEventReqs = value; }
get { return mEventReqs; }
}
public Dictionary<string, bool> eventChanges
{
set { mEventChanges = value; }
get { return mEventChanges; }
}
private OutcomeType getOutcomeType(int type) {
if(type == 0){
return OutcomeType.dialogue;
}
else if (type == 1)
{
return OutcomeType.scene;
}
else if (type == 2)
{
return OutcomeType.fight;
}
else
{
return OutcomeType.gameEnd;
}
}
}
public enum OutcomeType {
dialogue, scene, fight, gameEnd
}
public struct Outcome
{
public OutcomeType type;
public int reference;
public Outcome(OutcomeType theType, int theRef)
{
type = theType;
reference = theRef;
}
}
}