-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspell_type.cs
249 lines (215 loc) · 7.98 KB
/
spell_type.cs
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using Newtonsoft.Json.Linq;
namespace cdda_item_creator
{
namespace spell
{
class StaticDataLoader
{
public void loadAll()
{
loadFlags();
loadEffects();
}
public void loadFlags()
{
string flag_path = System.Windows.Forms.Application.StartupPath + "\\json\\spell_flags.json";
string flag_file_text = File.ReadAllText(flag_path);
JObject o1 = JObject.Parse(flag_file_text);
allowed_strings.spell_flags_description = o1.ToObject<Dictionary<string, string>>();
}
public void loadEffects()
{
string flag_path = System.Windows.Forms.Application.StartupPath + "\\json\\spell_effects.json";
string flag_file_text = File.ReadAllText(flag_path);
JObject o1 = JObject.Parse(flag_file_text);
allowed_strings.effect_descriptions = o1.ToObject<Dictionary<string, string>>();
}
}
static class allowed_strings
{
// flag, description
public static Dictionary<string, string> spell_flags_description = new Dictionary<string, string>
{ };
public static string[] energy_types =
{
"NONE",
"HP",
"MANA",
"STAMINA",
"BIONIC",
"FATGIUE"
};
public static string[] valid_targets =
{
"ally",
"hostile",
"self",
"ground",
"none",
"item",
"fd_fire",
"fd_blood"
};
public static string[] damage_types =
{
"fire",
"acid",
"bash",
"bio",
"cold",
"cut",
"electric",
"stab",
"NONE"
};
// available options for recover_energy effect
public static string[] recover_energy_types =
{
"MANA",
"STAMINA",
"FATIGUE",
"PAIN",
"BIONIC"
};
// available options for timed_event effect
public static string[] timed_event =
{
"help",
"wanted",
"robot_attack",
"spawn_wyrms",
"amigara",
"roots_die",
"temple_open",
"temple_flood",
"temple_spawn",
"dim",
"artifact_light"
};
public static string[] body_parts =
{
"TORSO",
"HEAD",
"EYES",
"MOUTH",
"ARM_L",
"ARM_R",
"HAND_L",
"HAND_R",
"LEG_L",
"LEG_R",
"FOOT_L",
"FOOT_R"
};
public static string[] sound_types =
{
"background",
"weather",
"music",
"movement",
"speech",
"movement",
"speech",
"activity",
"destructive_activity",
"alarm",
"combat",
"alert",
"order"
};
// effect, description
public static Dictionary<string, string> effect_descriptions = new Dictionary<string, string> { };
}
public class FakeSpell
{
// mandatory member
public string Id { get; set; } = "";
[DefaultValue(-1)]
public int MaxLevel { get; set; }
public int Level { get; set; }
[DefaultValue(false)]
public bool Self { get; set; }
}
public class spell_type
{
public spell_type() { }
public string Id { get; set; } = "";
public string Type { get; } = "SPELL";
public string Name { get; set; } = "";
public string Description { get; set; } = "";
[DefaultValue("You cast %s!")]
public string Message { get; set; } = "You cast %s!";
[DefaultValue("an explosion")]
public string SoundDescription { get; set; } = "an explosion";
[DefaultValue("combat")]
public string SoundType { get; set; } = "combat";
public bool SoundAmbient { get; set; } = false;
[DefaultValue("")]
public string SoundId { get; set; } = "";
[DefaultValue("default")]
public string SoundVariant { get; set; } = "default";
public string Effect { get; set; } = "none";
[DefaultValue("")]
public string EffectStr { get; set; } = "";
[DefaultValue(default(List<FakeSpell>))]
public List<FakeSpell> ExtraEffects { get; set; }
[DefaultValue("none")]
public string FieldId { get; set; } = "none";
[DefaultValue(1)]
public int FieldChance { get; set; } = 1;
public int MinFieldIntensity { get; set; }
public float FieldIntensityIncrement { get; set; }
public int MaxFieldIntensity { get; set; }
public float FieldIntensityVariance { get; set; }
public int MinDamage { get; set; }
public float DamageIncrement { get; set; }
public int MaxDamage { get; set; }
public int MinRange { get; set; }
public float RangeIncrement { get; set; }
public int MaxRange { get; set; }
public int MinAoe { get; set; }
public float AoeIncrement { get; set; }
public int MaxAoe { get; set; }
public int MinDot { get; set; }
public float DotIncrement { get; set; }
public int MaxDot { get; set; }
public int MinPierce { get; set; }
public float PierceIncrement { get; set; }
public int MaxPierce { get; set; }
public int MinDuration { get; set; }
public int DurationIncrement { get; set; }
public int MaxDuration { get; set; }
public int BaseEnergyCost { get; set; }
public float EnergyIncrement { get; set; }
public int FinalEnergyCost { get; set; }
[DefaultValue("NONE")]
public string SpellClass { get; set; } = "NONE";
public int Difficulty { get; set; }
public int MaxLevel { get; set; }
public int BaseCastingTime { get; set; }
public float CastingTimeIncrement { get; set; }
public int FinalCastingTime { get; set; }
[DefaultValue(default(Dictionary<string, int>))]
public Dictionary<string, int> LearnSpells { get; set; }
[DefaultValue("NONE")]
public string EnergySource { get; set; } = "NONE";
[DefaultValue("NONE")]
public string DamageType { get; set; } = "NONE";
public bool ShouldSerializeEffectTargets() => EffectTargets.Count > 0;
[DefaultValue(default(List<string>))]
public List<string> EffectTargets { get; set; }
[DefaultValue(default(List<string>))]
public List<string> ValidTargets { get; set; }
public bool ShouldSerializeAffectedBps() => AffectedBps.Count > 0;
[DefaultValue(default(List<string>))]
public List<string> AffectedBps { get; set; }
public bool ShouldSerializeFlags() => Flags.Count > 0;
[DefaultValue(default(List<string>))]
public List<string> Flags { get; set; }
}
}
}