Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "zcommon.acs"
- #library "hatstuff"
- #include "commonFuncs.h"
- int CL_ShipTIDs[PLAYERMAX]; // BUTT SHIP TIDS SON
- int CL_ShipScripts[PLAYERMAX]; // WE TWERKING THE SEVEN SEAS YET
- int CL_PlayerTIDS[PLAYERMAX]; // duh
- script 173 enter
- {
- int pln = PlayerNumber();
- int tid;
- int time = 0;
- while (1)
- {
- if (!isDead(0)) { tid = defaultTID(-1); }
- if (time % 18 == 0)
- {
- ACS_ExecuteAlways(174, 0, 0, tid);
- time %= 18;
- }
- time++;
- Delay(1);
- }
- }
- script 174 (int which, int a1, int a2) clientside
- {
- int pln = PlayerNumber();
- int testtid = unusedTID(38000, 48000);
- switch (which)
- {
- case 0:
- CL_PlayerTIDs[pln] = a1;
- Thing_ChangeTID(0, a1);
- // GET THAT BUTT SHIP ROLLING
- ACS_ExecuteWithResult(175, pln, 0);
- break;
- }
- }
- script 175 (int pln, int nocountdeath) clientside
- {
- if (CL_ShipScripts[pln]) { terminate; }
- CL_ShipScripts[pln] = 1;
- SetActivator(-1);
- int shipTID = -1;
- int mytid;
- int i, x, y, z, a, vx, vy, vz;
- int reloop;
- int nx, ny, nz;
- int height;
- while (PlayerInGame(pln))
- {
- mytid = CL_PlayerTIDs[pln];
- if (isDead(mytid) && Timer() >= nocountdeath)
- {
- // BUTT SHIP'S DOWN, WHAT THE HELL NIGGA
- }
- x = GetActorX(mytid);
- y = GetActorY(mytid);
- z = GetActorZ(mytid);
- a = GetActorAngle(mytid);
- vx = GetActorVelX(mytid);
- vy = GetActorVelY(mytid);
- vz = GetActorVelZ(mytid);
- // WE GOT NO BUTT SHIP, WE GOTTA FIX THAT SHIT
- if (ThingCount(0, shipTID) <= 0)
- {
- if (ThingCount(0, shipTID) > 0 && shipTID != 0) { Thing_Remove(shipTID); }
- shipTID = unusedTID(12000, 15000);
- while (1)
- {
- reloop = 0;
- // NIGGA WE CAN'T BE CONFUSING BUTT SHIPS
- for (i = 0; i < PLAYERMAX; i++)
- {
- if (CL_PlayerTIDs[i] == shipTID || CL_ShipTIDs[i] == shipTID || ThingCount(0, shipTID) > 0)
- {
- shipTID++;
- reloop = 1;
- break;
- }
- }
- if (!reloop) { break; }
- }
- // TOOT TOOT THE BUTT SHIP HAS ARRIVED
- Spawn("NIGPLZ", x,y,z, shipTID, a);
- }
- // YOUR COLORS ARE NEAT, AND THE BUTT SHIP'S STEALIN' EM
- if (1)
- {
- SetActivator(mytid);
- Thing_SetTranslation(shipTID, -1);
- SetActivator(-1);
- }
- CL_ShipTIDs[pln] = shipTID;
- // THE BUTT SHIP IS STEALTHY
- SetActorProperty(shipTID, APROP_Alpha, GetActorProperty(mytid, APROP_Alpha));
- // MOVE THAT BUTT SHIP AROUND WOOP WOOP
- // (angle's factored in; pitch isn't)
- int xOffset = 0, yOffset = 0, zOffset = 0;
- nx = x + FixedMul(xOffset, cos(a)) + FixedMul(yOffset, sin(a));
- ny = y + FixedMul(xOffset, sin(a)) - FixedMul(yOffset, cos(a));
- nz = z + zOffset;
- if (pln != ConsolePlayerNumber())
- {
- // HOLD ON BACK THAT BUTT SHIP UP
- nx -= vx; ny -= vy; nz -= vz;
- }
- else
- {
- // NOT FAR ENOUGH, KEEP BACKIN IT UP
- // (players have weird camera interpolation re. Z movement)
- nx -= vx; ny -= vy; nz -= 2*vz;
- }
- SetActorAngle(shipTID, a);
- SetActorPosition(shipTID, nx, ny, nz, 0);
- SetActorVelocity(shipTID, vx, vy, vz, 0, 0);
- Delay(1);
- }
- CL_ShipScripts[pln] = 0;
- }
- script 176 (int pln) disconnect clientside
- {
- Thing_Remove(CL_ShipTIDs[pln]);
- CL_PlayerTIDs[pln] = 0;
- CL_ShipTIDs[pln] = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement