SHOW:
|
|
- or go back to the newest paste.
1 | #library "GIGINSKY" | |
2 | #include "zcommon.acs" | |
3 | ||
4 | #define SPAAACE_PARTICLE 0 | |
5 | #define SPAAACE_TILTSPEED 1 | |
6 | #define SPAAACE_STRAIGHTSPEED 2 | |
7 | #define SPAAACE_PARTCOUNT 3 | |
8 | #define SPAAACE_ALL 4 | |
9 | ||
10 | int spaaace_parameterz[2][SPAAACE_ALL] = { | |
11 | {"SpaceNukeParticle3", 14.0, 18.0, 64}, | |
12 | {"SpaceNukeParticle3", 32.0, 18.0, 8} | |
13 | }; | |
14 | ||
15 | script "SpaceNukeWave" (int angle1, int angle2, int disctype) { | |
16 | int x = GetActorX(0); | |
17 | int y = GetActorY(0); | |
18 | int z = GetActorZ(0); | |
19 | int an = GetActorAngle(0); | |
20 | ||
21 | - | SetActivatorToTarget(0); |
21 | + | int mistid = ActivatorTID(); |
22 | - | int playertid = ActivatorTID(); |
22 | + | if (mistid == 0) { |
23 | mistid = UniqueTID(); | |
24 | SetActivatorTID(mistid); | |
25 | } | |
26 | ||
27 | int particlename = spaaace_parameterz[disctype][SPAAACE_PARTICLE]; | |
28 | int tiltspeed = spaaace_parameterz[disctype][SPAAACE_TILTSPEED]; | |
29 | int straightspeed = spaaace_parameterz[disctype][SPAAACE_STRAIGHTSPEED]; | |
30 | int partcount = spaaace_parameterz[disctype][SPAAACE_PARTCOUNT]; | |
31 | ||
32 | int x1, y1, z1, x2, y2, z2; | |
33 | z2 = FixedMul(cos(angle2), tiltspeed); z1 = 0.0; | |
34 | int troll = FixedMul(sin(angle2), tiltspeed); | |
35 | x1 = FixedMul(cos(angle1), straightspeed); | |
36 | y1 = FixedMul(sin(angle1), straightspeed); | |
37 | y2 = FixedMul(cos(angle1), -troll); | |
38 | x2 = FixedMul(sin(angle1), troll); | |
39 | ||
40 | int tid = UniqueTID(); | |
41 | ||
42 | int velx, vely, velz; | |
43 | int shift = 1.0 / partcount; | |
44 | for (int i = 0.0; i < 1.0; i += shift) { | |
45 | velx = FixedMul(x1, cos(i)) + FixedMul(x2, sin(i)); | |
46 | vely = FixedMul(y1, cos(i)) + FixedMul(y2, sin(i)); | |
47 | velz = FixedMul(z1, cos(i)) + FixedMul(z2, sin(i)); | |
48 | Spawn(particlename, x, y, z, tid, an); | |
49 | - | SetPointer(AAPTR_TARGET, playertid); |
49 | + | |
50 | Thing_ChangeTID(tid, 0); | |
51 | SetActorVelocity(0, velx, vely, velz, 0, 0); | |
52 | SetPointer(AAPTR_TARGET, mistid, AAPTR_TARGET); | |
53 | } | |
54 | } |