Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Sprite
- const int SUBSC_CURSOR_SPR = 66;
- //Sounds
- const int SUBSC_CURSOR_SFX = 63;
- const int SUBSC_CLOSE_SFX = 65;
- const int SUBSC_SELECTED_SFX = 66;
- const int SUBSC_OPEN_SFX = 67;
- ffc script SubscreenScript{
- void run(){
- bool active = true;
- int x = 30; int y = 20;
- int q[265]; itemdata id[24]; item i[25]; lweapon cursor;
- int selected = -1; int lastselected = -1;
- int sfxtimer; int cursortimer;
- int cursorinitpos[2];
- int subscreenitems[240]={I_SWORD, I_SWORD2, I_SWORD3, I_SWORD4, I_BRANG1, I_BRANG2
- I_CANDLE1, I_CANDLE2, I_BOMB, I_SBOMB, I_HAMMER, I_CBYRNA,
- I_BOOTS, I_BOW2, I_FLIPPERS, I_LADDER, I_HOOKSHOT, I_POTION1,
- I_POTION2, I_SHIELD, I_WAND, I_WHISTLE, I_MAP, I_BAIT};
- //put the items on the screen.
- for ( q[0] = 0; q[0] < 24; q[0]++ ) {
- i[ q[0] ] = Screen->CreateItem( subscreenitems[ q[0] ]);
- i[ q[0] ]->X = x;
- i[ q[0] ]->Y = y;
- i[ q[0] ]->Pickup = IP_DUMMY;
- if ( x < ( 30 + (18*6) ) x += 18;
- else x = 30;
- if ( y < ( 30 + (18*4) ) y += 18;
- else y = 30;
- }
- cursor = Screen->CreateLWeapon(LW_SCRIPT1);
- cursor->UseSprite(SUBSC_CURSOR_SPR);
- //Find out what is in Link's B slot.
- for ( q[3] = 0; q[3] < 24; q[3]++ ) {
- if ( subscreenitems[q] == Link->ItemB ) { lastselected = subscreenitems[q]; selected = subscreenitems[q]; }
- }
- //if nothing matches, check the A slot
- for ( q[3] = 0; q[3] < 24; q[3]++ ) {
- if ( subscreenitems[q] == Link->ItemA ) { lastselected = subscreenitems[q]; selected = subscreenitems[q]; }
- }
- if ( selected == -1 || lastselected == -1 ) selected = 0; //Otherwise, start with item 0
- cursor->X = i[lastselected]->X;
- cursor->Y = i[lastselected]->Y;
- Game->PlaySound(SUBSC_OPEN_SFX);
- while(active){
- if ( Link->PressRight ) {
- if ( selected < 24 ) {
- lastselected = selected;
- selected++;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- else {
- lastselected = selected;
- selected = 0;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- }
- if ( Link->PressLeft ) {
- if ( selected > 0 ) {
- lastselected = selected;
- selected--;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- else {
- lastselected = selected;
- selected = 23;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- }
- if ( Link->PressDown ) {
- if ( selected < 18 ) {
- lastselected = selected;
- selected += 6;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- else {
- lastselected = selected;
- selected = (24-selected);
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- }
- if ( Link->PressUp ) {
- if ( selected > 5 ) {
- lastselected = selected;
- selected -= 6;
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- else {
- lastselected = selected;
- selected = (Abs(selected-24));
- cursor->X = i[selected]->X;
- cursor->Y = i[selected]->Y;
- Game->PlaySound(SUBSC_CURSOR_SFX);
- }
- }
- if ( Link->PressA ) {
- Link->ItemA = i[selected]->ID;
- Game->PlaySound(SUBSC_SELECTED_SFX);
- }
- if ( Link->PressB ) {
- Link->ItemB = i[selected]->ID;
- Game->PlaySound(SUBSC_SELECTED_SFX);
- }
- if ( Link->PressR ) {} //pan to right page
- if ( Link->PressL ) {} //pan to left page
- if ( Link->PressStart || Link->InputStart ) {
- Link->InputStart = false;
- Link->PressStart = false;
- Game->PlaySound(SUBSC_CLOSE_SFX);
- for ( q[5] = 0; q[5] < 25; q[5]++ ) Remove(i[ q[5] ]);
- active = false;
- }
- Waitframe();
- }
- this->Data = 0; this->Script = 0; Quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement