Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lweapon script reflectWp
- {
- define IGNORE_MIRROR = 0;
- void run()
- {
- //Wait to get off of a mirror, if spawned over one.
- while(isMirror((this->X+(this->HitWidth*0.5)), (this->Y+(this->HitHeight*0.5)))) { Waitframe();}
- while(this->isValid())
- {
- if ( isMirror((this->X+(this->HitWidth*0.5)), (this->Y+(this->HitHeight*0.5))) )
- {
- lweapon reflect = Clone(this);
- reflect->Dir = DirRev(this);
- Remove(this);
- }
- Waitframe();
- }
- }
- bool isMirror(int x, int y)
- {
- mapdata theMaps;
- theMaps = Game->LoadMapData(/*however you do mirror placement*/);
- if ( theMaps->ComboT[ComboAt(x,y)] == CT_SCRIPT_MIRROR ) return true;
- return false;
- }
- lweapon Clone(lweapon a)
- {
- lweapon b = Screen->CreateLWeaponDx(a->ID);
- b->X = a->X;
- b->Y = a->Y;
- b->Z = a->Z;
- b->Jump = a->Jump;
- b->Extend = a->Extend;
- b->TileWidth = a->TileWidth;
- b->TileHeight = a->TileHeight;
- b->HitWidth = a->HitWidth;
- b->HitHeight = a->HitHeight;
- b->HitZHeight = a->HitZHeight;
- b->HitXOffset = a->HitXOffset;
- b->HitYOffset = a->HitYOffset;
- b->DrawXOffset = a->DrawXOffset;
- b->DrawYOffset = a->DrawYOffset;
- b->DrawZOffset = a->DrawZOffset;
- b->Tile = a->Tile;
- b->CSet = a->CSet;
- b->DrawStyle = a->DrawStyle;
- b->Dir = a->Dir;
- b->OriginalTile = a->OriginalTile;
- b->OriginalCSet = a->OriginalCSet;
- b->FlashCSet = a->FlashCSet;
- b->NumFrames = a->NumFrames;
- b->Frame = a->Frame;
- b->ASpeed = a->ASpeed;
- b->Damage = a->Damage;
- b->Step = a->Step;
- b->Angle = a->Angle;
- b->Angular = a->Angular;
- b->CollDetection = a->CollDetection;
- b->DeadState = a->DeadState;
- b->Flash = a->Flash;
- b->Flip = a->Flip;
- for (int q = 0; q < 32; q++)
- {
- b->Misc[q] = a->Misc[q];
- }
- b->Script = a->Script;
- for ( int q = 0; q < 8; +=q )
- {
- b->InitD[q] = a->InitD[q];
- }
- b->ScriptTile = a->ScriptTile;
- b->ScriptFlip = a->ScriptFlip;
- b->Animation = a->Animation;
- return b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement