Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script LockBlock{
- void run(int perm, int d, int i, int sfx, int pushtime){
- if(pushtime == 0) pushtime = 10;
- int loc = ComboAt(this->X,this->Y);
- int pushclk = 0;
- while(!GetScreenDBit(d,perm)){
- if(PushingCombo(loc,this)) pushclk++;
- else pushclk = 0;
- Waitframe();
- if(pushclk == pushtime) Unlock(sfx,i,perm,d);
- }
- SetGraphic(this);
- }
- void Unlock(int sfx, int i, int perm, int d){
- if(!CheckItem(i)) return;
- if(sfx == 0) Game->PlaySound(SFX_SHUTTER);
- else if(sfx > 0) Game->PlaySound(sfx);
- SetScreenDBit(d,perm,true);
- }
- bool CheckItem(int i){
- return (Link->Item[i] == true);
- }
- bool PushingCombo(int loc, ffc size){
- int w = Floor(size->EffectWidth/16); int h = Floor(size->EffectHeight/16);
- int x = ComboX(loc); int y = ComboY(loc);
- return Link->Z == 0 &&
- ((Link->Dir == DIR_UP && Link->InputUp && Link->Y == y+8+16*(h-1) && Abs((Link->X+8)-(x+8*w)) < 8*w)
- || (Link->Dir == DIR_DOWN && Link->InputDown && Link->Y == y-16 && Abs((Link->X+8)-(x+8*w)) < 8*w)
- || (Link->Dir == DIR_LEFT && Link->InputLeft && Link->X == x+16*w && Abs((Link->Y+8)-(y+8*h)) < 8*h)
- || (Link->Dir == DIR_RIGHT && Link->InputRight && Link->X == x-16 && Abs((Link->Y+8)-(y+8*h)) < 8*h));
- }
- void SetGraphic(ffc size){
- int first = ComboAt(size->X,size->Y);
- int last = ComboAt(size->X+(size->EffectWidth-16),size->Y+(size->EffectHeight-16));
- int w = last%16 - first%16;
- for(int i=0;i<=last-first;i++) if(i%16 <= w) Screen->ComboD[first+i]++;
- }
- }
- ffc script Copycat{
- void run(int perm, int d){
- while(!GetScreenDBit(d,perm)) Waitframe();
- SetGraphic(this);
- }
- void SetGraphic(ffc size){
- int first = ComboAt(size->X,size->Y);
- int last = ComboAt(size->X+(size->EffectWidth-16),size->Y+(size->EffectHeight-16));
- int w = last%16 - first%16;
- for(int i=0;i<=last-first;i++) if(i%16 <= w) Screen->ComboD[first+i]++;
- }
- }
Add Comment
Please, Sign In to add comment