Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Call before Waitdraw() in your global active script.
- ///Optimised function to allow controlling the direction of silver and gold arrows.
- void ArrowDirChange()
- {
- int btn;
- if ( Link->InputA )
- {
- if ( GetEquipmentA() == I_ARROW2 ) btn = 2;
- if ( GetEquipmentB() == I_ARROW2 ) btn = 4;
- }
- if ( Link->InputB )
- {
- if ( GetEquipmentB() == I_ARROW3 ) btn = 3;
- if ( GetEquipmentB() == I_ARROW3 ) btn = 6;
- }
- //silver
- if ( btn ) //n0 mod by zero
- {
- if (!( btn % 2 ))
- {
- if ( Link->PressR )
- {
- lweapon silv;
- for ( int q = Screen->NumLWeapons(); q > 0; --q )
- {
- silv = Screen->LoadWeapon(q);
- if ( silv->Damage >= 4 )
- {
- //only once.
- if ( silv->Misc[LW_MISC_SILARROW] ) break;
- else
- {
- if ( Link->PressLeft ) { ++silv->Misc[LW_MISC_SILARROW]; silv->Dir = DIR_LEFT; break;}
- if ( Link->PressRight ) { ++silv->Misc[LW_MISC_SILARROW]; silv->Dir = DIR_RIGHT; break;}
- if ( Link->PressUp ) { ++silv->Misc[LW_MISC_SILARROW]; silv->Dir = DIR_UP; break;}
- if ( Link->PressDown ) { ++silv->Misc[LW_MISC_SILARROW]; silv->Dir = DIR_DOWN; break;}
- break;
- }
- }
- }
- }
- }
- if (!( btn % 3 )) //gold
- {
- if ( Link->PressR )
- {
- lweapon gold;
- for ( int q = Screen->NumLWeapons(); q > 0; --q )
- {
- gold = Screen->LoadWeapon(q);
- if ( gold->Damage >= 8 )
- {
- if ( Link->PressLeft ) gold->Dir = DIR_LEFT;
- if ( Link->PressRight ) gold->Dir = DIR_RIGHT;
- if ( Link->PressUp ) gold->Dir = DIR_UP;
- if ( Link->PressDown ) gold->Dir = DIR_DOWN;
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement