Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simple Somaria
- // ZoriaRPG
- // v0.2
- ffc script SimpleSomariaBlock
- {
- void run()
- {
- int pos; int x; int y; int blocks;
- while(1)
- {
- switch(Link->Dir)
- {
- //find best position for Link's midpoint
- case DIR_UP: { pos = ComboAt(Link->X+8, Link->Y+8)); break;}
- case DIR_DOWN: { pos = ComboAt(Link->X+7, Link->Y+8)); break;}
- case DIR_LEFT: { pos = ComboAt(Link->X+8, Link->Y+7)); break;}
- case DIR_RIGHT: { pos = ComboAt(Link->X+8, Link->Y+8)); break;}
- }
- pos = AdjacentCombo(pos, Link->Dir); //update
- x = ComboX(pos);
- y = ComboY(pos);
- if ( pos <= 0 ) //illegal pos. We should block the other corners, too.
- {
- //error out
- }
- if ( Screen->ComboS[pos] != 0 )
- {
- //error out
- }
- else
- {
- if ( blocks )
- {
- //find and destroy old block
- //we obviously need to mark them in some way when they move!!
- //no, just a unique combo ID.
- for ( int q = 0; q < 176; ++q )
- {
- if ( Screen->ComboD[q] == CMB_SOMARIA )
- {
- //poof anim
- lweapon poof = Screen->CreateLWeapon(LW_SPARKLE);
- poof->X = x;
- poof->Y = y;
- poof->UseSprite(SPR_SOMARIA_POOF);
- //sound
- Game->PlaySound(SFX_SOMARIA_POOF);
- //remove block
- Screen->ComboD[pos] = Screen->Undercombo;
- --blocks;
- while(poof->isValid()) Waitframe();
- break;
- }
- }
- //create new block
- }
- //Creaqte the block.
- //set combo type to a 4-way block
- //poof anim
- lweapon poof = Screen->CreateLWeapon(LW_SPARKLE);
- poof->X = x;
- poof->Y = y;
- poof->UseSprite(SPR_SOMARIA_POOF);
- //sound
- Game->PlaySound(SFX_SOMARIA_POOF);
- ComboD[pos] = CMB_SOMARIA; //must be a 4-way push type, and only used by this script.
- ++blocks;
- }
- Waitframe();
- }
- }
- }
- item script SimpleSomariaCane
- {
- void run()
- {
- Link->Action = LA_ATTACKING;
- //if the ffc script isn't running, run it.
- RunFFCScriptOrQuit("SimpleSomariaBlock");
- }
- }
RAW Paste Data