-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCookingDomainGocoa_Unit.cs
49 lines (44 loc) · 1.4 KB
/
CookingDomainGocoa_Unit.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
namespace XRL.World.Effects
{
[System.Serializable]
public class helado_BrewedBeverages_CookingDomainGocoa_Unit : ProceduralCookingEffectUnit
{
public override string GetDescription()
{
return "You go more than usual.";
}
public override void Apply(GameObject go, Effect parent)
{
go.RegisterEffectEvent(parent, "AfterMoved");
base.Apply(go, parent);
}
public override void FireEvent(Event e)
{
switch (e.ID)
{
case "AfterMoved":
if (
e.GetIntParameter("Forced", 0) == 0 &&
!(e.GetParameter("FromCell") as Cell).OnWorldMap() &&
!(parent.Object.OnWorldMap())
)
{
parent.Object.Move(
Direction: e.GetStringParameter("Direction"),
Forced: true,
EnergyCost: 0
);
}
break;
default:
base.FireEvent(e);
break;
}
}
public override void Remove(GameObject go, Effect parent)
{
go.UnregisterEffectEvent(parent, "AfterMoved");
base.Remove(go, parent);
}
}
}