Advertisement
Chronos_Ouroboros

Untitled

May 6th, 2018
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1. Array<Actor> alreadyRipped;
  2. override actor StepEffects (Vector3 initialPos, Vector3 stepDiff, Vector3 realVel) {
  3.     [...]
  4.         ThinkerIterator it = ThinkerIterator.Create ("Actor");
  5.         Actor mo;
  6.  
  7.         while (mo = Actor (it.Next ())) {
  8.             if (mo == self || mo == target || !mo.bSHOOTABLE || (Distance3D (mo) > 32 * (1 + 3 * (CountInv ("OuterBeam", AAPTR_Target))) && target) || mo.CurSector.PortalGroup != CurSector.PortalGroup || !CheckSight (mo) || mo.bKILLED)
  9.                 continue;
  10.  
  11.             Vector3 posDif = self.Vec3To (mo);
  12.             double relAngle = DeltaAngle (self.angle, atan2 (posDif.Y, posDif.X)); // Difference in angle between inflictor and victim.
  13.  
  14.             if (abs (relAngle) >= 90.0 || abs (relAngle) <= 75.0)
  15.                 continue;
  16.  
  17.             if (alreadyRipped.Find (mo) == alreadyRipped.Size ()) {
  18.                 mo.target = target;
  19.  
  20.                 if (pos.Z <= mo.pos.Z + mo.height && pos.Z >= mo.pos.Z + mo.height - mo.height / 6) {
  21.                     A_GiveInventory ("HeadShot");
  22.                     mo.DamageMobj (self, target, GetMissileDamage (0, 1) * 3, "Normal");
  23.                 }
  24.  
  25.                 mo.DamageMobj (self, target, GetMissileDamage (0, 1), "Normal");
  26.                 mo.A_FaceTarget ();
  27.                 alreadyRipped.Push (mo);
  28.             }
  29.         }
  30.         SetOrigin (oldPos, false);
  31.     }
  32.     return Super.StepEffects (initialPos, stepDiff, realVel);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement