Advertisement
ZoriaRPG

Byrna Beam Block and Reflect

Mar 24th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. byrnaKillsEWeapons(int sfx)
  2. {
  3.     bool byrnabeam;
  4.     for ( int q = Screen->NumLWeapons(); q > 0; --q )
  5.     {
  6.         lweapon b = Screen->LoadLWeapon(q);
  7.         if ( b->ID != LW_BYRNA ) continue;
  8.         for ( int w = Screen->NumEWeapons(); w > 0; --w )
  9.         {
  10.             eweapon p = Screen->LoadEWeapon(w);
  11.             if ( p->CollDetection )
  12.             {
  13.                 if ( Collision(b,p) )
  14.                 {
  15.                     b->DeadState = WDS_DEAD;
  16.                     p->DeadState = WDS_DEAD;
  17.                     Game->PlaySound(sfx);
  18.                 }
  19.             }
  20.         }
  21.     }
  22. }
  23.                    
  24.  
  25. byrnaReflectsEWeapons(int sfx)
  26. {
  27.     bool byrnabeam;
  28.     for ( int q = Screen->NumLWeapons(); q > 0; --q )
  29.     {
  30.         lweapon b = Screen->LoadLWeapon(q);
  31.         if ( b->ID != LW_BYRNA ) continue;
  32.         for ( int w = Screen->NumEWeapons(); w > 0; --w )
  33.         {
  34.             eweapon p = Screen->LoadEWeapon(w);
  35.             if ( p->CollDetection )
  36.             {
  37.                 if ( Collision(b,p) )
  38.                 {
  39.                     b->DeadState = WDS_DEAD;
  40.                     if ( p->Angular )
  41.                     {
  42.                         p->Angle = WrapDegrees(p->Angle - 180);
  43.                     }
  44.                     else
  45.                     {
  46.                         p->Flip = FlipRev(p->Dir);
  47.                         p->Dir = DirRev(p->Dir);
  48.                     }
  49.                     Game->PlaySound(sfx);
  50.                 }
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement