Advertisement
ZoriaRPG

Reflected Weapon Script

Dec 24th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. lweapon script reflectWp
  2. {
  3.     define IGNORE_MIRROR = 0;
  4.     void run()
  5.     {
  6.         //Wait to get off of a mirror, if spawned over one.
  7.         while(isMirror((this->X+(this->HitWidth*0.5)), (this->Y+(this->HitHeight*0.5)))) { Waitframe();}
  8.         while(this->isValid())
  9.         {
  10.        
  11.  
  12.             if ( isMirror((this->X+(this->HitWidth*0.5)), (this->Y+(this->HitHeight*0.5))) )
  13.             {
  14.                 lweapon reflect = Clone(this);
  15.                 reflect->Dir = DirRev(this);
  16.                 Remove(this);
  17.             }
  18.             Waitframe();
  19.         }
  20.     }
  21.     bool isMirror(int x, int y)
  22.     {
  23.         mapdata theMaps;
  24.         theMaps = Game->LoadMapData(/*however you do mirror placement*/);
  25.         if ( theMaps->ComboT[ComboAt(x,y)] == CT_SCRIPT_MIRROR ) return true;
  26.         return false;
  27.     }
  28.     lweapon Clone(lweapon a)
  29.     {
  30.         lweapon b = Screen->CreateLWeaponDx(a->ID);
  31.         b->X = a->X;
  32.         b->Y = a->Y;
  33.         b->Z = a->Z;
  34.         b->Jump = a->Jump;
  35.         b->Extend = a->Extend;
  36.         b->TileWidth = a->TileWidth;
  37.         b->TileHeight = a->TileHeight;
  38.         b->HitWidth = a->HitWidth;
  39.         b->HitHeight = a->HitHeight;
  40.         b->HitZHeight = a->HitZHeight;
  41.         b->HitXOffset = a->HitXOffset;
  42.         b->HitYOffset = a->HitYOffset;
  43.         b->DrawXOffset = a->DrawXOffset;
  44.         b->DrawYOffset = a->DrawYOffset;
  45.         b->DrawZOffset = a->DrawZOffset;
  46.         b->Tile = a->Tile;
  47.         b->CSet = a->CSet;
  48.         b->DrawStyle = a->DrawStyle;
  49.         b->Dir = a->Dir;
  50.         b->OriginalTile = a->OriginalTile;
  51.         b->OriginalCSet = a->OriginalCSet;
  52.         b->FlashCSet = a->FlashCSet;
  53.         b->NumFrames = a->NumFrames;
  54.         b->Frame = a->Frame;
  55.         b->ASpeed = a->ASpeed;
  56.         b->Damage = a->Damage;
  57.         b->Step = a->Step;
  58.         b->Angle = a->Angle;
  59.         b->Angular = a->Angular;
  60.         b->CollDetection = a->CollDetection;
  61.         b->DeadState = a->DeadState;
  62.         b->Flash = a->Flash;
  63.         b->Flip = a->Flip;
  64.         for (int q = 0; q < 32; q++)
  65.         {
  66.             b->Misc[q] = a->Misc[q];
  67.         }
  68.         b->Script = a->Script;
  69.         for ( int q = 0; q < 8; +=q )
  70.         {
  71.             b->InitD[q] = a->InitD[q];
  72.         }
  73.         b->ScriptTile = a->ScriptTile;
  74.         b->ScriptFlip = a->ScriptFlip;
  75.         b->Animation = a->Animation;
  76.         return b;
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement