Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ComboInFront(int dir){
- if(dir==DIR_UP)
- return ComboAt(Link->X+8,Link->Y-8);
- else if(dir==DIR_DOWN)
- return ComboAt(Link->X+8,Link->Y+24);
- else if(dir==DIR_LEFT)
- return ComboAt(Link->X-8,Link->Y+8);
- else if(dir==DIR_RIGHT)
- return ComboAt(Link->X+24,Link->Y+8);
- }
- const int POT_1_TILE = 16472;
- const int POT_2_TILE = 16494;
- const int POT_3_TILE = 16484;
- const int I_LVL1_BRACELET= I_BRACELET2;
- item script BraceletThrow{
- void run(int damage){
- int loc = ComboInFront(Link->Dir);
- if(Link->Item[I_LVL1_BRACELET]
- && (Screen->ComboT[loc]== CT_PUSHHEAVY || Screen->ComboT[loc]==CT_BUSHNEXT
- ||Screen->ComboT[loc]==CT_PUSHHEAVY2)){
- if(CountFFCsRunning(THROW_FFC_SCRIPT)==0
- && Link->PressB){
- Link->PressB=false;
- Link->InputB=false;
- int tile;
- if(Screen->ComboT[loc]==CT_PUSHHEAVY)
- tile= ROCK_TILE;
- else if(Screen->ComboT[loc]==CT_BUSHNEXT)
- tile= BUSH_TILE;
- else if(Screen->ComboT[loc]==CT_PUSHHEAVY2){
- if(Screen->ComboI[loc]==CF_SCRIPT1)
- tile= POT_1_TILE;
- else if(Screen->ComboI[loc]==CF_SCRIPT2)
- tile= POT_2_TILE;
- }
- int Args[8]= {tile,damage};
- NewFFCScript(THROW_FFC_SCRIPT,Args);
- Link->Action= LA_ATTACKING;
- if(Screen->ComboT[loc]== CT_PUSHHEAVY||Screen->ComboT[loc]== CT_PUSHHEAVY2)
- Screen->ComboD[loc]= Screen->UnderCombo;
- else
- Screen->ComboD[loc]++;
- if(ComboFI(loc,CF_ARMOSITEM) && !Screen->State[ST_SPECIALITEM]
- && Screen->RoomType==RT_SPECIALITEM){
- item theitem = Screen->CreateItem(Screen->RoomData);
- theitem->X= ComboX(loc);
- theitem->Y= ComboY(loc);
- theitem->Pickup |= IP_HOLDUP;
- theitem->Pickup |= IP_ST_SPECIALITEM;
- }
- }
- }
- }
- }
- int NewFFCScript(int scriptNum, float args){
- // Invalid script
- if(scriptNum<0 || scriptNum>511)
- return 0;
- ffc theFFC;
- // Find an FFC not already in use
- for(int i=FFCS_MIN_FFC; i<=FFCS_MAX_FFC; i++){
- theFFC=Screen->LoadFFC(i);
- if(theFFC->Script!=0 ||
- (theFFC->Data!=0 && theFFC->Data!=FFCS_INVISIBLE_COMBO) ||
- theFFC->Flags[FFCF_CHANGER])
- continue;
- // Found an unused one; set it up
- theFFC->Data=FFCS_INVISIBLE_COMBO;
- theFFC->TileWidth = 1;
- theFFC->TileHeight = 1;
- theFFC->Script=scriptNum;
- if(args!=NULL){
- for(int j=Min(SizeOfArray(args), 8)-1; j>=0; j--)
- theFFC->InitD[j]=args[j];
- }
- theFFC->Flags[FFCF_ETHEREAL]= true;
- return i;
- }
- // No FFCs available
- return 0;
- }
- const int THROW_FFC_SCRIPT = 53;
- const int ROCK_TILE = 4297;
- const int BUSH_TILE = 4296;
- ffc script Thrown_Object{
- void run(int tile, int damage){
- lweapon throw;
- throw= FireLWeapon(LW_SCRIPT7, Link->X+8, Link->Y, __DirtoRad(Link->Dir),
- 100, damage, SPR_NULL, SFX_THROW, 0);
- SetLWeaponMovement(throw,LWM_THROW,3,LWMF_DIE);
- if(tile==ROCK_TILE)
- SetLWeaponDeathEffect(throw,LWD_4_FIREBALLS_RANDOM,18);
- else if(tile==BUSH_TILE)
- SetLWeaponDeathEffect(throw,LWD_4_FIREBALLS_RANDOM,57);
- SetLWeaponFlag2(throw,LWF_SHADOW);
- while(throw->isValid()){
- Screen->FastTile(3,throw->X,throw->Y-throw->Z,tile,0,128);
- Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement