Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const WallJumpHitCount = 12.0;
- const WallJumpHitInterval = 45.0 / WallJumpHitCount;
- void Movement_WallJump () {
- if (playerData.wjumpJustJumped)
- playerData.wjumpJustJumped--;
- if (health <= 0 || !playerData.wjumpJustJumped || CheckInventory ("S7_SoulLance_BeamGrabbed"))
- double hCount = WallJumpHitCount / 2;
- double zOff = height / 2.0 + attackZOffset;
- Actor puff;
- if (player.cmd.forwardmove < 0 && (player.cmd.buttons & BT_JUMP) && !(player.oldbuttons & BT_JUMP) && (floorZ - pos.Z) > 24.0) {
- Vector3 normal, randomVec;
- normal.x = cos (-pitch) * cos (-angle);
- normal.y = cos (-pitch) * sin ( angle);
- normal.z = sin (-pitch);
- normal = normal.unit ();
- do {
- randomVec = (frandom (-1, 1), frandom (-1, 1), frandom (-1, 1)).unit ();
- } while (randomVec == normal);
- Vector3 normalPerp = (normal cross randomVec).unit ();
- Vector3 center = pos + (0, 0, (height / 2) + attackZOffset);
- Vector3 point1, point2;
- point1 = center + cos ( 45) * normal + sin ( 45) * normalPerp;
- point2 = center + cos (-90) * normal + sin (-90) * normalPerp;
- for (int i = 0; i < WallJumpHitCount; i++) { //Force: XY: 18?, Z: 40?, S7_WalljumpMarker
- double hitAngle = WallJumpHitInterval * (i >= hCount ? i - 6 : i);
- for (int j = 0; j < WallJumpHitCount; j++) {
- double hitPitch = WallJumpHitInterval * (j >= hCount ? j - 6 : j);
- puff = LineAttack (hitAngle, 48, hitPitch, 0, "None", "S7_WalljumpPuff", LAF_NoRandomPuffZ | LAF_NoImpactDecal, null, zOff);
- if (puff && (puff.GetZAt () - puff.pos.Z) >= 1.0) {
- // Destroy the puff
- puff.Destroy ();
- // Get the hit positions
- Vector3 hitPos1, hitPos2;
- let marker = Spawn ("S7_WalljumpMarker", point1);
- // Get hit position 1
- puff = LineAttack (hitAngle, 48, hitPitch, 0, "None", "S7_WalljumpPuff", LAF_NoRandomPuffZ | LAF_NoImpactDecal, null, zOff);
- if (!puff) continue;
- hitPos1 = puff.pos; puff.Destroy ();
- // Get hit position 2
- puff = LineAttack (hitAngle, 48, hitPitch, 0, "None", "S7_WalljumpPuff", LAF_NoRandomPuffZ | LAF_NoImpactDecal, null, zOff);
- if (!puff) continue;
- hitPos2 = puff.pos; puff.Destroy ();
- //playerData.wjumpJustJumped = WJUMPDELAY;
- //A_SetAngle ();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement