-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEffectPanel.cs
More file actions
94 lines (81 loc) · 1.62 KB
/
EffectPanel.cs
File metadata and controls
94 lines (81 loc) · 1.62 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
public class EffectPanel : Effect2
{
public EffectCharPaint eff;
private int i0;
private int dx0;
private int dy0;
private int x;
private int y;
private Char c;
private Mob m;
private short loopCount;
private long endTime;
private int trans;
public static void addServerEffect(int id, int cx, int cy, int loopCount)
{
EffectPanel effectPanel = new EffectPanel();
effectPanel.eff = GameScr.efs[id - 1];
effectPanel.x = cx;
effectPanel.y = cy;
effectPanel.loopCount = (short)loopCount;
Effect2.vEffect3.addElement(effectPanel);
}
public override void paint(mGraphics g)
{
if (mGraphics.zoomLevel == 1)
{
GameScr.countEff++;
}
if (GameScr.countEff < 8)
{
if (c != null)
{
x = c.cx;
y = c.cy + GameCanvas.transY;
}
if (m != null)
{
x = m.x;
y = m.y + GameCanvas.transY;
}
int num = x + dx0 + eff.arrEfInfo[i0].dx;
int num2 = y + dy0 + eff.arrEfInfo[i0].dy;
SmallImage.drawSmallImage(g, eff.arrEfInfo[i0].idImg, num, num2, trans, mGraphics.VCENTER | mGraphics.HCENTER);
}
}
public override void update()
{
if (endTime != 0)
{
i0++;
if (i0 >= eff.arrEfInfo.Length)
{
i0 = 0;
}
if (mSystem.currentTimeMillis() - endTime > 0)
{
Effect2.vEffect3.removeElement(this);
}
}
else
{
i0++;
if (i0 >= eff.arrEfInfo.Length)
{
loopCount--;
if (loopCount <= 0)
{
Effect2.vEffect3.removeElement(this);
}
else
{
i0 = 0;
}
}
}
if (GameCanvas.gameTick % 11 == 0 && c != null && c != Char.myCharz() && !GameScr.vCharInMap.contains(c))
{
Effect2.vEffect3.removeElement(this);
}
}
}