-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTestModifierRecipes.cs
63 lines (50 loc) · 1.87 KB
/
TestModifierRecipes.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
namespace ModiBuff.Core.Units
{
public sealed class TestModifierRecipes
{
private readonly ModifierRecipes _modifierRecipes;
public TestModifierRecipes(ModifierIdManager idManager)
{
_modifierRecipes = new ModifierRecipes(idManager);
SetupRecipes();
_modifierRecipes.CreateGenerators();
}
public static TagType GetTag(int id) => (TagType)ModifierRecipes.GetTag(id);
private void Register(params string[] names) => _modifierRecipes.Register(names);
private ModifierRecipe Add(string name) => _modifierRecipes.Add(name);
private void Add(string name, in ModifierGeneratorFunc createFunc, Core.TagType tag = default)
{
_modifierRecipes.Add(name, name, "", in createFunc, tag);
}
private void SetupRecipes()
{
Add("StunEverySecond")
.Interval(1)
.Effect(new StatusEffectEffect(StatusEffectType.Stun, 0.2f), EffectOn.Init | EffectOn.Interval)
.Remove(5).Refresh();
Add("InitDamageManual", (id, genId, name, tag) =>
{
var initComponent = new InitComponent(false, new IEffect[] { new DamageEffect(5) }, null);
var modifier = new Modifier(id, genId, name, initComponent, null, null, null,
new SingleTargetComponent(), null, null);
return modifier;
}, Core.TagType.IsInit);
//Delayed Silence
Add("DelayedSilence")
.Effect(new StatusEffectEffect(StatusEffectType.Silence, 1), EffectOn.Duration)
.Remove(5);
{
Register("StackingDamageApplier", "StackingDamage");
Add("StackingDamageApplier")
.Effect(new ApplierEffect("StackingDamage"), EffectOn.Init);
Add("StackingDamage")
.Effect(new DamageEffect(5, StackEffectType.Effect | StackEffectType.Add, 2), EffectOn.Stack)
.Stack(WhenStackEffect.Always)
.Remove(5).Refresh();
}
Add("ThornsOnHitEvent")
.Effect(new DamageEffect(5, targeting: Targeting.SourceTarget), EffectOn.Event)
.Event(EffectOnEvent.WhenAttacked);
}
}
}