-
Notifications
You must be signed in to change notification settings - Fork 0
/
NeutralCards.cs
423 lines (241 loc) · 11.4 KB
/
NeutralCards.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
namespace FightMasters
{
internal class NeutralCards
{
internal class Dummy : ICard
{
//Properties
public string Name { get; } = "Dummy";
public string Description { get; } = "You shouldn't be reading this, if you are then please report this as a bug to me.";
public int StaminaCost { get; } = 0;
public Damage[]? DamageDealt { get; } = null;
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = null;
public IMinion[]? Summons { get; } = null;
public bool HasDeactivate { get; } = false;
//Constructor
public Dummy() { }
//Methods
public string Play(Player p1, Player p2)
{
return "Nothing Happens.";
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string? ToString()
{
return CardPrinter.PrintCard(this);
}
}
//STORAGE FOR ALL NEUTRAL (NON CLASS SPECIFIC) CARDS
internal class Zap : ICard
{
//Properties
public string Name { get; } = "Zap";
public string Description { get; } = "Shoot a bolt of lightning from your fingertips, dealing 4 lightning damage to your target. Has a 30% chance to Shock the target.";
public int StaminaCost { get; } = 3;
public Damage[]? DamageDealt { get; } = { new Damage("Lightning", 4) };
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = new() {
{ "<S>", new List<IToken>() { new ShockToken() } }
};
public IMinion[]? Summons { get; } = null;
public bool HasDeactivate { get; } = false;
//Constructor
public Zap() { }
//Methods
public string Play(Player p1, Player p2)
{
p1.CurrentStamina -= this.StaminaCost;
(string PlaySummary, bool[] DamageDodged) = PlayHelper.DamagePlayer(this, p1, p2);
//Zap has a 30% chance to apply a shock token to the target
if (!DamageDodged[0] && (new Random().Next(1,10) <= 3))
{
//If damage isn't dodged, chance to apply shock token
PlaySummary += "The attack has lingering effects...";
PlaySummary += PlayHelper.AddOpponentTokens(this.TokensAppliedOpponent!, p2);
}
return PlaySummary;
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string? ToString()
{
return CardPrinter.PrintCard(this);
}
}
internal class DragonBreath : ICard
{
//Properties
public string Name { get; } = "Dragon Breath";
public string Description { get; } = "Transform your head into that of a dragon and take a deep breath, releasing hot lava as you exhale dealing 5 fire damage and applying a Burn token to your target.";
public int StaminaCost { get; } = 4;
public Damage[]? DamageDealt { get; } = { new Damage("Fire", 5) };
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = new() {
{ "<B>", new List<IToken>() { new BurnToken() } }
};
public IMinion[]? Summons { get; } = null;
public bool HasDeactivate { get; } = false;
//Constructor
public DragonBreath() { }
//Methods
public string Play(Player p1, Player p2)
{
p1.CurrentStamina -= this.StaminaCost;
(string PlaySummary, bool[] DamageDodged) = PlayHelper.DamagePlayer(this, p1, p2);
//Dragon Breath applies a Burn token to the target if damage is not dodged
if (!DamageDodged[0])
{
PlaySummary += "The emblazoned atmosphere leaves its mark...";
PlaySummary += PlayHelper.AddOpponentTokens(this.TokensAppliedOpponent!, p2);
}
return PlaySummary;
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string? ToString()
{
return CardPrinter.PrintCard(this);
}
}
internal class LFrostShield : ICard
{
//Properties
public string Name { get; } = "Lesser Frost Shield";
public string Description { get; } = "Gain 20% physical and Frost resistance.";
public int StaminaCost { get; } = 3;
public Damage[]? DamageDealt { get; } = null;
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = null;
public IMinion[]? Summons { get; } = null;
public bool HasDeactivate { get; } = true;
//Constructor
public LFrostShield() { }
//Methods
public string Play(Player p1, Player p2)
{
p1.CurrentStamina -= this.StaminaCost;
string PlaySummary = "You encase yourself in an icy wind.";
p1.Resistances["Frost"] += 20;
p1.Resistances["Physical"] += 20;
return PlaySummary;
}
public string DeactivateEffects(Player p1, Player p2)
{
//This card's effects last until the start of the player's next turn.
string DeactivateSummary = "The effects of the Lesser Frost Shield wear off, reducing your physical and frost resistances by 20.";
p1.Resistances["Frost"] -= 20;
p1.Resistances["Physical"] -= 20;
p1.PersistentCards.Remove(this);
return DeactivateSummary;
}
public override string? ToString()
{
return CardPrinter.PrintCard(this);
}
}
internal class BoulderToss : ICard
{
//Properties
public string Name { get; } = "Boulder Toss";
public string Description { get; } = "Push your hands into the ground and grab as hard as you can, pulling a massive boulder from the earth beneath you and fling it at your opponent dealing 12 physical damage if it hits.";
public int StaminaCost { get; } = 6;
public Damage[]? DamageDealt { get; } = { new Damage("Physical", 12) };
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = null;
public IMinion[]? Summons { get; } = null;
public bool HasDeactivate { get; } = false;
//Constructor
public BoulderToss() { }
//Methods
public string Play(Player p1, Player p2)
{
p1.CurrentStamina -= this.StaminaCost;
(string PlaySummary, _) = PlayHelper.DamagePlayer(this, p1, p2);
return PlaySummary;
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string ToString()
{
return CardPrinter.PrintCard(this);
}
}
internal class SummonWolf : ICard
{
//Properties
public string Name { get; } = "Summon Wolf";
public string Description { get; } = "Summon a wolf to fight by your side for 3 turns. It deals 2 physical damage and reduces your opponent's physical resistance by 1% everytime it attacks (their resistance goes back to normal after the wolf is unsummoned). If you have atleast 3 wolves, they form a wolf pack, causing each to deal 1 extra damage per turn. This effect also makes the physical resistance they shred from your opponent permanent for the rest if the match (including the resistance shredded until that point). Anytime a wolf is added to the pack, each wolf's duration is increased by 1.";
public int StaminaCost { get; } = 3;
public Damage[]? DamageDealt { get; } = null;
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = null;
public IMinion[]? Summons { get; } = { new NeutralMinions.Wolf() };
public bool HasDeactivate { get; } = false;
//Constructor
public SummonWolf() { }
//Methods
public string Play(Player p1, Player p2)
{
return PlayHelper.SummonMinions(this, p1);
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string ToString()
{
return CardPrinter.PrintCard(this);
}
}
}
internal class SummonZombie : ICard
{
//Properties
public string Name { get; } = "Summon Zombie";
public string Description { get; } = "Summon a zombie to fight by your side for 2 turns. It deals 1 poison damage and has a 50% chance to apply a poison token on hit. If its target already has a poison token on them, it deals double damage.";
public int StaminaCost { get; } = 2;
public Damage[]? DamageDealt { get; } = null;
public int Heal { get; } = 0;
public Dictionary<string, List<IToken>>? TokensAppliedCaster { get; } = null;
public Dictionary<string, List<IToken>>? TokensAppliedOpponent { get; } = null;
public IMinion[]? Summons { get; } = { new NeutralMinions.Zombie() };
public bool HasDeactivate { get; } = false;
//Constructor
public SummonZombie() { }
//Methods
public string Play(Player p1, Player p2)
{
return PlayHelper.SummonMinions(this, p1);
}
public string DeactivateEffects(Player p1, Player p2)
{
//Has no effects to deactivate
return string.Empty;
}
public override string ToString()
{
return CardPrinter.PrintCard(this);
}
}
}