Exemplo n.º 1
0
static void PlayerPCProcessMenuInput(u8 taskId)
{
    if (gMain.newAndRepeatedKeys & DPAD_UP)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(-1);
    }
    else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(1);
    }
    else if (gMain.newKeys & A_BUTTON)
    {
        Menu_DestroyCursor();
        PlaySE(SE_SELECT);
        sPlayerPCMenuActions[gPcItemMenuOptionOrder[Menu_GetCursorPos()]].func(taskId);
    }
    else if (gMain.newKeys & B_BUTTON)
    {
        Menu_DestroyCursor();
        PlaySE(SE_SELECT);
        sPlayerPCMenuActions[gPcItemMenuOptionsNum[gPcItemMenuOptionOrder - 1]].func(taskId); // run EXIT.
    }
}
Exemplo n.º 2
0
static void sub_8089D94(u8 taskID)
{
    if (!gPaletteFade.active)
    {
        if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
        {
            PlaySE(SE_SELECT);
            sPokeMenuCursorPos = Menu_MoveCursor(-1);
            sub_808B5B4(taskID);
        }
        else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
        {
            PlaySE(SE_SELECT);
            sPokeMenuCursorPos = Menu_MoveCursor(1);
            sub_808B5B4(taskID);
        }
        else if (gMain.newKeys & A_BUTTON)
        {
            PlaySE(SE_SELECT);
            sPokemonMenuActions[sPokeMenuOptionsOrder[sPokeMenuCursorPos]].func(taskID);
            sub_808B5B4(taskID);
        }
        else if (gMain.newKeys & B_BUTTON)
        {
            PokemonMenu_Cancel(taskID);
            sub_808B5B4(taskID);
        }
    }
}
Exemplo n.º 3
0
void HandleBattleTowerPartyMenu(u8 taskId)
{
    if (!gPaletteFade.active)
    {
        switch (HandleBattleTowerPartyMenuInput(taskId))
        {
        case A_BUTTON:
            PlaySE(SE_SELECT);
            gLastFieldPokeMenuOpened = sub_806CA38(taskId);
            if (gLastFieldPokeMenuOpened != 6)
            {
                GetMonNickname(&gPlayerParty[gLastFieldPokeMenuOpened], gStringVar1);
                sub_81221F8(taskId);
                gTasks[taskId].func = sub_812238C;
            }
            else
            {
                gTasks[taskId].func = sub_81224A8;
            }
            sub_808B5B4(taskId);
            break;
        case B_BUTTON:
            PlaySE(SE_SELECT);
            ClearPartySelection();
            BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
            gTasks[taskId].func = sub_8122450;
            break;
        }
    }
}
Exemplo n.º 4
0
static void ItemStorageMenuProcessInput(u8 var)
{
    if (gMain.newAndRepeatedKeys & DPAD_UP)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(-1);
        ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]);
    }
    else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(1);
        ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]);
    }
    else if (gMain.newKeys & A_BUTTON)
    {
        PlaySE(SE_SELECT);
        gPCText_ItemPCOptionsText[Menu_GetCursorPos()].func(var);
    }
    else if (gMain.newKeys & B_BUTTON)
    {
        Menu_DestroyCursor();
        PlaySE(SE_SELECT);
        gPCText_ItemPCOptionsText[ITEMPC_MENU_EXIT].func(var);
    }
}
Exemplo n.º 5
0
float Sniper::Shot(Game_Manager* gm_, Unit* User_, int team_, const coord_def& start_, const coord_def& pos_, float focus_)
{
	float angle_ = GetAngleToTarget(start_, pos_);
	if(UseBullet(1))
	{
		for(int i = 0;i<bunch;i++)
		{
			float focus2_ = rand_float(-focus_, focus_,"Sniper::Shot focus");
			if(User_->GetSniper())
				focus2_ = 0;
			float speed2_ = shot_speed*GetShotSpeedApply()*rand_float(0.8f, 1.2f, "Sniper::Shot speed");
			float damage_ =  damage*GetDamegeApply()*(User_?User_->GetAtkApply():1.0f);
			gm_->shot_list.push_back(new Shot_sniper(&tex_gun, User_, damage_, sniper, GetPower(), GetMaxPower(), team_, start_, angle_+focus2_, GetDistance(), 50));
		}
		if (gm_->isPlayerCanHear(GetPos()))
		{
			if(GetType() == WT_SILENCE || User_->GetSilencer() != 1.0f)
				PlaySE(se_silencesnipergun);
			else
				PlaySE(se_snipergun);
		}
		gm_->Noise(team_,start_,GetNoise() * User_->GetSilencer());
		return burst_speed*(1.0f/(GetBurstSpeedApply()*(User_?User_->GetAtkSpdApply():1.0f)));
	}
	return -1;
}
Exemplo n.º 6
0
void Task_ResetRtc_1(u8 taskId)
{
    s16 *data = gTasks[taskId].data;
    u8 selection = data[2];
    const struct ResetRtcStruct *selectionInfo = &gUnknown_08376420[selection - 1];

    if (gMain.newKeys & B_BUTTON)
    {
        gTasks[taskId].func = Task_ResetRtc_2;
        data[1] = 0;
        data[2] = 6;
        PlaySE(SE_SELECT);
        return;
    }

    if (gMain.newKeys & DPAD_RIGHT)
    {
        if (selectionInfo->right)
        {
            data[2] = selectionInfo->right;
            PlaySE(SE_SELECT);
            return;
        }
    }

    if (gMain.newKeys & DPAD_LEFT)
    {
        if (selectionInfo->left)
        {
            data[2] = selectionInfo->left;
            PlaySE(SE_SELECT);
            return;
        }
    }

    if (selection == 5)
    {
        if (gMain.newKeys & A_BUTTON)
        {
            gLocalTime.days = data[3];
            gLocalTime.hours = data[4];
            gLocalTime.minutes = data[5];
            gLocalTime.seconds = data[6];
            PlaySE(SE_SELECT);
            gTasks[taskId].func = Task_ResetRtc_2;
            data[1] = 1;
            data[2] = 6;
        }
    }
    else if (ResetRtcScreen_MoveTimeUpDown(&data[selectionInfo->dataIndex], selectionInfo->minVal, selectionInfo->maxVal, gMain.newAndRepeatedKeys & (DPAD_UP | DPAD_DOWN)))
    {
        PlaySE(SE_SELECT);
        ResetRtcScreen_PrintTime(4, 9, data[3], data[4], data[5], data[6]);
    }
}
Exemplo n.º 7
0
void Fire2::PlayReloadSE(Game_Manager * gm_)
{
	if (gm_->isPlayerCanHear(GetPos()))
	{
		PlaySE(se_flame_reload, false);
	}
}
Exemplo n.º 8
0
void Bazooka::PlayReloadSE(Game_Manager * gm_)
{
	if (gm_->isPlayerCanHear(GetPos()))
	{
		PlaySE(se_rocket_reload, false);
	}
}
Exemplo n.º 9
0
float Sniper::special(Game_Manager* gm_, Unit* User_, int team_, const coord_def& start_, const coord_def& pos_, float focus_)
{
	Player * my_player = clients[my_id].player;

	if(User_->GetSniper())
	{
		User_->SetSniper(false);
		if (reinterpret_cast<Player *>(User_ ) == my_player)
		{
			gm_->SetSniperMode(false, pos_, 1.0f);
		}
		ApplyDamegeApply(0.5f);
	}
	else
	{
		User_->SetSniper(true);
		if (reinterpret_cast<Player *>(User_ ) == my_player)
		{
			gm_->SetSniperMode(true, pos_, 2.0f);
		}
		ApplyDamegeApply(2.0f);
		if (gm_->isPlayerCanHear(GetPos()))
		{
			PlaySE(se_snipermode, false);
		}
	}
	return 40;

}
Exemplo n.º 10
0
bool8 ScrCmd_setdooropened(struct ScriptContext *ctx)
{
    u16 x = VarGet(ScriptReadHalfword(ctx));
    u16 y = VarGet(ScriptReadHalfword(ctx));
    x += 7;
    y += 7;
    PlaySE(sub_8058790(x, y));
    FieldAnimateDoorOpen(x, y);
    return FALSE;
}
Exemplo n.º 11
0
// Handle input
static void sub_812238C(u8 taskId)
{
    if (!gPaletteFade.active)
    {
        if (gMain.newAndRepeatedKeys & 0x40)
        {
            if (Menu_GetCursorPos() != 0)
            {
                PlaySE(SE_SELECT);
                Menu_MoveCursor(-1);
            }
            return;
        }
        if (gMain.newAndRepeatedKeys & 0x80)
        {
            if (Menu_GetCursorPos() != 3)
            {
                PlaySE(SE_SELECT);
                Menu_MoveCursor(1);
            }
            return;
        }
        if (gMain.newKeys & A_BUTTON)
        {
            TaskFunc popupMenuFunc;

            PlaySE(SE_SELECT);
            popupMenuFunc = PartyMenuGetPopupMenuFunc(
              gTasks[taskId].data[4],
              sBattleTowerEntryMenu,
              sBattleTowerEntryMenuItems,
              Menu_GetCursorPos());
            popupMenuFunc(taskId);
            return;
        }
        if (gMain.newKeys & B_BUTTON)
        {
            BattleTowerEntryMenuCallback_Exit(taskId);
            return;
        }
    }
}
Exemplo n.º 12
0
	float Melee_AssasinKnife::Shot(Game_Manager* gm_, Unit* User_, int team_, const coord_def& start_, const coord_def& pos_, float focus_)
	{
		if (gm_->isPlayerCanHear(GetPos()))
		{
			PlaySE(se_assknife);
		}
		float angle_ = GetAngleToTarget(start_, pos_);
		float damage_ =  damage*GetDamegeApply()*(User_?User_->GetAtkApply():1.0f);
		gm_->shot_list.push_back(new Shot_assasinknife(width<3.0f?effect_texture:&tex_melee2, User_, damage_, GetPower(), GetMaxPower(), burst_speed, team_, start_, angle_, GetDistance(), width, back_stab));
		return burst_speed*(1.0f/(GetBurstSpeedApply()*(User_?User_->GetAtkSpdApply():1.0f)));
	}
Exemplo n.º 13
0
void Monster::Death(Game_Manager * gm_)
{
	if (gm_->isPlayerCanHear(GetPos()))
	{
		if (CheckFlag(MF_HUMAN))
		{
			PlaySE(se_human_dead, false);
		}
		else if (CheckFlag(MF_ZOMBIE))
		{
			PlaySE2(se_zombie_dead1, se_zombie_dead2);
		}
		
		if (!CheckFlag(MF_ROBOT))
		{
			PlaySE3(se_slashed3, se_slashed4, se_slashed5);
		}
		else
		{
			PlaySE(se_grenade_hit);
		}
	}
}
Exemplo n.º 14
0
static void Mailbox_MailOptionsProcessInput(u8 taskId)
{
    if(gMain.newAndRepeatedKeys & DPAD_UP)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(-1);
    }
    else if(gMain.newAndRepeatedKeys & DPAD_DOWN)
    {
        PlaySE(SE_SELECT);
        Menu_MoveCursor(1);
    }
    else if(gMain.newKeys & A_BUTTON)
    {
        PlaySE(SE_SELECT);
        gMailboxMailOptions[Menu_GetCursorPos()].func(taskId);
    }
    else if(gMain.newKeys & B_BUTTON)
    {
        PlaySE(SE_SELECT);
        Mailbox_Cancel(taskId);
    }
}
Exemplo n.º 15
0
void HandleDefaultPartyMenu(u8 taskID)
{
    if (!gPaletteFade.active)
    {
        switch (HandleDefaultPartyMenuInput(taskID))
        {
        case A_BUTTON:
            PlaySE(SE_SELECT);
            gLastFieldPokeMenuOpened = sub_806CA38(taskID);
            GetMonNickname(&gPlayerParty[gLastFieldPokeMenuOpened], gStringVar1);
            sub_8089A8C();
            sPokeMenuCursorPos = 0;
            sub_8089C7C(0);
            gTasks[taskID].func = sub_8089D94;
            sub_808B5B4(taskID);
            break;
        case B_BUTTON:
            PlaySE(SE_SELECT);
            BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
            gTasks[taskID].func = sub_8089E4C;
            break;
        }
    }
}
Exemplo n.º 16
0
// Mailbox_ProcessInput
static void Mailbox_ProcessInput(u8 taskId)
{
    if(!gPaletteFade.active)
    {
        if(gMain.newAndRepeatedKeys & DPAD_UP)
        {
            if(eMailboxInfo.cursorPos != 0)
            {
                PlaySE(SE_SELECT);
                eMailboxInfo.cursorPos = Menu_MoveCursor(-1);
            }
            else if(eMailboxInfo.itemsAbove != 0)
            {
                PlaySE(SE_SELECT);
                eMailboxInfo.itemsAbove--;
                Mailbox_DrawMailList(taskId);
            }
        }
        else if(gMain.newAndRepeatedKeys & DPAD_DOWN)
        {
            if(eMailboxInfo.cursorPos != eMailboxInfo.pageItems - 1)
            {
                PlaySE(SE_SELECT);
                eMailboxInfo.cursorPos = Menu_MoveCursor(1);
            }
            else if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos != eMailboxInfo.count)
            {
                PlaySE(SE_SELECT);
                eMailboxInfo.itemsAbove++;
                Mailbox_DrawMailList(taskId);
            }
        }
        else if(gMain.newKeys & A_BUTTON)
        {
            Menu_DestroyCursor();
            PlaySE(SE_SELECT);

            if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos == eMailboxInfo.count)
            {
                Mailbox_TurnOff(taskId);
            }
            else
            {
                Mailbox_CloseScrollIndicators();
                TASK.FUNC = Mailbox_PrintWhatToDoWithPlayerMailText;
            }
        }
        else if(gMain.newKeys & B_BUTTON)
        {
            Menu_DestroyCursor();
            PlaySE(SE_SELECT);
            Mailbox_TurnOff(taskId);
        }
    }
}
Exemplo n.º 17
0
void Task_ShowResetRtcPrompt(u8 taskId)
{
    s16 *data = gTasks[taskId].data;

    switch (data[0])
    {
    case 0:
        Menu_EraseScreen();
        Menu_DrawStdWindowFrame(0, 0, 20, 10);
        Menu_PrintText(gSystemText_PresentTime, 1, 1);
        ResetRtcScreen_PrintTime(
            1,
            3,
            gLocalTime.days,
            gLocalTime.hours,
            gLocalTime.minutes,
            gLocalTime.seconds);
        Menu_PrintText(gSystemText_PreviousTime, 1, 5);
        ResetRtcScreen_PrintTime(
            1,
            7,
            gSaveBlock2.lastBerryTreeUpdate.days,
            gSaveBlock2.lastBerryTreeUpdate.hours,
            gSaveBlock2.lastBerryTreeUpdate.minutes,
            gSaveBlock2.lastBerryTreeUpdate.seconds);
        ResetRtcScreen_ShowMessage(gSystemText_ResetRTCPrompt);
        data[0]++;
    case 1:
        if (gMain.newKeys & B_BUTTON)
        {
            DestroyTask(taskId);
            DoSoftReset();
        }
        else if (gMain.newKeys & A_BUTTON)
        {
            PlaySE(SE_SELECT);
            DestroyTask(taskId);
        }
        break;
    }
}
Exemplo n.º 18
0
float Bazooka::Shot(Game_Manager* gm_, Unit* User_, int team_, const coord_def& start_, const coord_def& pos_, float focus_)
{
	float angle_ = GetAngleToTarget(start_, pos_);
	if(UseBullet(1))
	{
		for(int i = 0;i<bunch;i++)
		{
			float focus2_ = rand_float(-focus_, focus_, "Bazooka::Shot focus");
			float speed2_ = shot_speed*GetShotSpeedApply();
			float damage_ =  damage*GetDamegeApply()*(User_?User_->GetAtkApply():1.0f);
			gm_->shot_list.push_back(new Shot_missile(&tex_missile, User_, damage_, GetPower(), GetMaxPower(), range, team_, start_, angle_+focus2_, speed2_, guided_range, guided_power, GetDistance()));
		}
		if (gm_->isPlayerCanHear(GetPos()))
		{
			PlaySE(se_rocket, false);
		}
		gm_->Noise(team_,start_,GetNoise() * User_->GetSilencer());
		return burst_speed*(1.0f/(GetBurstSpeedApply()*(User_?User_->GetAtkSpdApply():1.0f)));
	}
	return -1;
}
Exemplo n.º 19
0
void WallyHandlecmd20(void)
{
    switch (ewram160A9)
    {
    case 0:
        sub_80304A8();
        ewram160A9++;
        ewram160AB = 80;
        // fall through
    case 1:
        ewram160AB--;
        if (ewram160AB == 0)
        {
            DestroyMenuCursor();
            PlaySE(SE_SELECT);
            Emitcmd33(1, 10, 256);
            WallyBufferExecCompleted();
        }
        break;
    }
}
Exemplo n.º 20
0
static void sub_81224A8(u8 taskId)
{
    u8 val = sub_81220C8();

    if (val != 0xFF)
    {
        PrintPartyMenuPromptText(val, 0);
        gTasks[taskId].func = sub_8122480;
    }
    else
    {
        if (gSelectedOrderFromParty[0] != 0)
        {
            BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
            gTasks[taskId].func = sub_8122450;
        }
        else
        {
            PlaySE(SE_HAZURE);
            PrintPartyMenuPromptText(14, 0);
            gTasks[taskId].func = sub_8122480;
        }
    }
}
Exemplo n.º 21
0
void Sniper::PlayReloadSE(Game_Manager * gm_)
{
	if (gm_->isPlayerCanHear(GetPos())) PlaySE(se_snipergun_reload);
}
Exemplo n.º 22
0
bool Shot_gun::Action(Game_Manager* gm_)
{
	if(valid)
	{
		int coll_ = pre_collution(3);

		if(gm_)
		{
			for(list<Unit*>::iterator it = gm_->unit_list.begin();it != gm_->unit_list.end();it++)
			{
				if((*it)->isLive() && !(*it)->isNonTarget()  && (*it)->GetTeam() != GetTeam())
				{
					if(unit_collution((*it)->GetPos(), (*it)->GetSize()+((*it)->isPlayer()?0.0f:3.0f) ))
					{
						if (gm_->isPlayerCanHear(GetPos()))
						{
							PlaySE(se_bullet_flesh);
						}
						
						(*it)->SetKnockback(power, max_power, angle);
						if(slow_turn)
							(*it)->SlowApply(slow_ratio,slow_turn, SK_GUN);
						int final_damge_ = (*it)->SetDamage(gm_, GetFirstPos(), DT_BULLET, damage, GetTeam(), sniper, unit?unit->GetCritical():0);
						
						if(unit)
							unit->GiveDamage(gm_, (*it), DT_BULLET, final_damge_);
						valid = false;
						break;
					}
				}
			}
		}

		
		if(coll_)
		{
			SetPos(GetPos()+coord_def(cos(angle)*coll_, sin(angle)*coll_));
			valid = false;
			delay++;
		}
		else
			Move();
		distance -= const_speed;
		if(distance<0)
			valid = false;

	}
	
	if(valid && delay)
	{
		delay--;
	}
	else
	{
		delay_pos += GetSpeed();
		if(!valid)
		{
			if(const_delay < delay++)
				return true;
		}
	}
	return false;
}
Exemplo n.º 23
0
bool8 ScrCmd_playsfx(struct ScriptContext *ctx)
{
    PlaySE(ScriptReadHalfword(ctx));
    return FALSE;
}
Exemplo n.º 24
0
static void sub_810CC34(void)
{
    PlaySE(SE_W115);
    FlagSet(FLAG_SYS_USE_FLASH);
    ScriptContext1_SetupScript(gUnknown_081B694A);
}
Exemplo n.º 25
0
static void ItemStorage_HandleQuantityRolling(u8 taskId)
{
    s16 *data = TASK.data;
    u8 trueIndex = PAGE_INDEX + ITEMS_ABOVE_TOP;

    if(gMain.newAndRepeatedKeys & DPAD_UP)
    {
        if(NUM_QUANTITY_ROLLER != gSaveBlock1.pcItems[trueIndex].quantity)
            NUM_QUANTITY_ROLLER++;
        else
            NUM_QUANTITY_ROLLER = 1; // you are at the max amount of items you have when you press Up, set your quantity back to 1.

        sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity?
    }
    else if(gMain.newAndRepeatedKeys & DPAD_DOWN)
    {
        if(NUM_QUANTITY_ROLLER != 1)
            NUM_QUANTITY_ROLLER--;
        else
            NUM_QUANTITY_ROLLER = gSaveBlock1.pcItems[trueIndex].quantity; // you are at 0 when you press down, set your quantity to the amount you have.

        sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity?
    }
    else if(gMain.newAndRepeatedKeys & DPAD_LEFT) // reduce by 10.
    {
        NUM_QUANTITY_ROLLER -= 10;

        if(NUM_QUANTITY_ROLLER <= 0)
            NUM_QUANTITY_ROLLER = 1; // dont underflow or allow 0!

        sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity?
    }
    else if(gMain.newAndRepeatedKeys & DPAD_RIGHT) // add 10.
    {
        NUM_QUANTITY_ROLLER += 10;

        if(NUM_QUANTITY_ROLLER > gSaveBlock1.pcItems[trueIndex].quantity)
            NUM_QUANTITY_ROLLER = gSaveBlock1.pcItems[trueIndex].quantity; // dont overflow!

        sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); // print quantity?
    }
    else if(gMain.newKeys & A_BUTTON) // confirm quantity.
    {
        PlaySE(SE_SELECT);
        Menu_EraseWindowRect(6, 6, 0xD, 0xB);

        if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW)
            ItemStorage_DoItemWithdraw(taskId);
        else
            ItemStorage_DoItemToss(taskId);
    }
    else if(gMain.newKeys & B_BUTTON) // cancel quantity.
    {
        PlaySE(SE_SELECT);
        Menu_EraseWindowRect(6, 6, 0xD, 0xB);
        StartVerticalScrollIndicators(TOP_ARROW);
        StartVerticalScrollIndicators(BOTTOM_ARROW);
        ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex?
        TASK.FUNC = ItemStorage_ProcessInput;
    }
}
Exemplo n.º 26
0
void Mon_zombie_noise::Death(Game_Manager* gm_)
{
	PlaySE(se_shout4, false);
	Effect_noise(gm_, GetPos(), 1.0f);
	gm_->Noise(GetTeam(),GetPos(),200.0f);
}
Exemplo n.º 27
0
static void ItemStorage_ProcessInput(u8 taskId)
{
    s16 *data = TASK.data;
    s16 trueIndex;

    if (gMain.newAndRepeatedKeys & DPAD_UP)
    {
        if(PAGE_INDEX != 0) // did the cursor move physically upwards?
        {
            PlaySE(SE_SELECT);
            PAGE_INDEX = Menu_MoveCursor(-1);
            trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX;
            if (SWITCH_MODE_ACTIVE == FALSE) // are we not currently switching items?
            {
                if (trueIndex == NUM_ITEMS) // if the cursor is on top of cancel, print the go back to prev description.
                {
                    ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV);
                }
                else
                {
                    ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId);
                }
            }
        }
        else // the page cursor is at the top. but we may not be at the top of the true index list, so do another check.
        {
            if (ITEMS_ABOVE_TOP == 0) // did the cursor not move due to being at the top of the list?
                return;

            PlaySE(SE_SELECT);
            ITEMS_ABOVE_TOP--;
            ItemStorage_DrawBothListAndDescription(taskId);

            if (SWITCH_MODE_ACTIVE != FALSE)
                Menu_MoveCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index.
        }
    }
    else if(gMain.newAndRepeatedKeys & DPAD_DOWN) // _0813A306
    {
        if(PAGE_INDEX != NUM_PAGE_ITEMS - 1)
        {
            PlaySE(SE_SELECT);
            PAGE_INDEX = Menu_MoveCursor(1);
            trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX;

            if(SWITCH_MODE_ACTIVE != FALSE)
                return;

            if (trueIndex == NUM_ITEMS)
                ItemStorage_PrintItemPcResponse(ITEMPC_GO_BACK_TO_PREV); // probably further down
            else
                ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[trueIndex].itemId);
        }
        else if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS)
        {
            PlaySE(SE_SELECT);
            ITEMS_ABOVE_TOP++;
            ItemStorage_DrawBothListAndDescription(taskId);

            if (SWITCH_MODE_ACTIVE != FALSE)
                Menu_MoveCursor(0);
        }
    }
    else if(gMain.newKeys & SELECT_BUTTON) // _0813A3A0
    {
        if (SWITCH_MODE_ACTIVE == FALSE)
        {
            if (PAGE_INDEX + ITEMS_ABOVE_TOP != NUM_ITEMS) // you cannot swap the Cancel button.
            {
                PlaySE(SE_SELECT);
                SWITCH_MODE_ACTIVE = TRUE;
                SWAP_ITEM_INDEX = ITEMS_ABOVE_TOP + PAGE_INDEX;
                ItemStorage_PrintItemPcResponse(ITEMPC_SWITCH_WHICH_ITEM);
            }
            // _0813A3DC
            ItemStorage_DrawItemList(taskId);
        }
        else // _0813A3E8
        {
            PlaySE(SE_SELECT);
            ItemStorage_DoItemSwap(taskId, FALSE);
            ItemStorage_DrawBothListAndDescription(taskId);
        }
    }
    else if(gMain.newKeys & A_BUTTON)
    {
        PlaySE(SE_SELECT);
        if(SWITCH_MODE_ACTIVE == FALSE)
        {
            if(ITEMS_ABOVE_TOP + PAGE_INDEX != NUM_ITEMS)
            {
                ItemStorage_DoItemAction(taskId);
            }
            else
            {
                ItemStorage_GoBackToPlayerPCMenu(taskId);
            }
        }
        else
        {
            ItemStorage_DoItemSwap(taskId, FALSE);
            ItemStorage_DrawBothListAndDescription(taskId);
        }
    }
    else if(gMain.newKeys & B_BUTTON)
    {
        PlaySE(SE_SELECT);
        if(SWITCH_MODE_ACTIVE == FALSE)
        {
            Menu_DestroyCursor();
            ItemStorage_GoBackToPlayerPCMenu(taskId);
        }
        else
        {
            ItemStorage_DoItemSwap(taskId, TRUE);
            ItemStorage_DrawBothListAndDescription(taskId);
        }
    }
}
Exemplo n.º 28
0
// �Z�N�V�����^�C�������L���O�\��
void ST_RankingView() {
	int i, max, mode, tmp, tmp5, bps, bps1,bps2,s;

	mode = 1;

	while(1) {
		// �w�i�`��
		count++;
		if(background == 0) {
			for(i = 0; i <= 6; i++) {
				ExBltFastRect(4 + (mode >= 3) + (mode == 4), 96 * i - (count % 96) / 3, 0, 0, 0, 96, 240);
			}
		} else if(background == 1) {
			for(i = 0; i <= 6; i++) {
				ExBltFastRect(4 + (mode >= 3) + (mode == 4), 96 * i, 0, 0, 0, 96, 240);
			}
		} else {
			ExBltFast(30, 0, 0);
		}
		ExBltRect(77, 0, 208,  count % 320, 20, 320 - (count % 320), 8);
		ExBltRect(77, 320 - (count % 320), 208,  0, 20, count % 320, 8);

		ExBltRect(77, count % 320, 16,  0, 28, 320 - (count % 320), 8);
		ExBltRect(77, 0, 16, 320 - (count % 320), 28, count % 320, 8);

		//�A�h���X�w��
		if(mode == 0){
			tmp5 = 0;
		}else if(mode == 1){
			tmp5 = 4;
		}else if(mode == 2){
			tmp5 = 15;
		}else if(mode == 3){
			tmp5 = 30;
		}else if(mode == 4){
			tmp5 = 40;
		}else if(mode == 5){
			tmp5 = 60;
		}

		// ���[�h���\��
		if(mode == 0)
			printFont(11, 1, "- BEGINNER MODE -", 4);
		else if(mode == 1)
			printFont(11, 1, "-  MASTER MODE  -", 1);
		else if(mode == 2)
			printFont(9, 1, "-  MASTER GRADE4 MODE  -", 1);
		else if(mode == 3)
			printFont(11, 1, "-   20G MODE    -", 7);
		else if(mode == 4)
			printFont(11, 1, "-  DEVIL MODE   -", 2);
		else if(mode == 5)
			printFont(11, 1, "-  TOMOYO MODE   -", 3);

		if(mode == 5){
			printFont(1,  3, "STAGE",1);
			printFont(8,  3, "TIME", 1);
			printFont(15, 3, "USE", 1);
			printFont(20,  3, "STAGE",1);
			printFont(28,  3, "TIME", 1);
			printFont(35, 3, "USE", 1);
		}else if(mode < 5){
			printFont(2,  3, "LEVEL",1);
			printFont(12,  3, "TIME", 1);
			printFont(21, 3, "LVSTOP", 1);
			printFont(28, 3, "USE", 1);
			printFont(32, 3, "BLOCK/S ", 1);
		}

		// �\���������߂�
		if(mode == 0)
			max = 2;
		else if( (mode == 1) || (mode == 2)|| (mode == 3) )
			max = 10;
		else if(mode == 4)
			max = 13;
		else if(mode == 5)
			max =27;

		// �����L���O�\��
		for(i=0; i<max; i++) {
			if(st_end[i + tmp5] == 1)
				tmp = 4;
			else if(st_end[i + tmp5] == 2)
				tmp = 7;
			else
				tmp = 0;

			if(mode != 5){//���̑�
				if( ((mode == 1) || (mode == 2)|| (mode == 3)) && (i == 9) ){
					sprintf(string[0], " 900-999");
				} else if(mode <= 4){
					sprintf(string[0], "%4d-%3d", i*100, (i+1)*100);
				}

				printFont(1, 4+i, string[0], tmp);

				//�^�C��
				getTime(st_time[i + tmp5]);
				printFont(11, 4+i, string[0], tmp);

				//���x���X�g�b�v
				getSTime(st_lvstop[i + tmp5]);
				printFont(21, 4+i, string[0], tmp);

				//USE�u���b�N��
				sprintf(string[0],"%d",st_others[i + tmp5]);
				printFont(29, 4+i, string[0], tmp);

				//BPS
				bps = (st_others[i + tmp5] * 1000) / (st_time[i + tmp5] / 60);
				bps1 = bps / 1000;//����
				bps2 = bps % 1000;//���O��
				sprintf(string[0],"%d.",bps1);
				printFont(32, 4+i, string[0], tmp);
				if(bps2>=100){
				sprintf(string[0],"%3d",bps2);
				printFont(34, 4+i, string[0], tmp);
				}else if(bps2>=10){
				sprintf(string[0],"0%2d",bps2);
				printFont(34, 4+i, string[0], tmp);
				}else{
				sprintf(string[0],"00%d",bps2);
				printFont(34, 4+i, string[0], tmp);
				}
				if(mode==2){
					printFont(2, 28, "GRADE HISTORY", 2);
					for(s=0;s<5;s++){
					sprintf(string[0],"%d",grade_his[s]);
					printFont(3*s, 29, string[0], tmp);
					}
				}
			}else{ //TOMOYO
				if(i <= 19){
					sprintf(string[0], "%d",i+1);
					printFont(2, 4+i, string[0], tmp);

					//�^�C��
					getTime(st_time[i + tmp5]);
					printFont(6, 4+i, string[0], tmp);

					//�g�p�u���b�N��
					sprintf(string[0],"%d",st_others[i + tmp5]);
					printFont(16, 4+i, string[0], tmp);

				}else if(i > 19){
					sprintf(string[0], "EX%d",i - 19);
					printFont(20, i - 16, string[0], tmp);

					//�^�C��
					getTime(st_time[i + tmp5]);
					printFont(26, i - 16, string[0], tmp);

					//�g�p�u���b�N��
					sprintf(string[0],"%d",st_others[i + tmp5]);
					printFont(36, i-16, string[0], tmp);
				}
			}
		}

		// ���v���\��
		tmp = 0;
		for(i=0; i<max; i++) {
			tmp = tmp + st_time[i + tmp5];
		}
		printFont(1, 25, "TOTAL TIME", 1);
		getTime(tmp);
		printFont(12, 25, string[0], 2);

		KeyInput();

		if(getPushState(0, 4) || getPushState(0, 5)) {
			// A��B�Ŗ߂�
			return;
		}

		if(getPushState(0, 2)) {
			// ��
			PlaySE(5);
			mode--;
			if(mode < 1) mode = 5;
		}
		if(getPushState(0, 3)) {
			// ��
			PlaySE(5);
			mode++;
			if(mode > 5) mode = 1;
		}

		spriteTime();//halt
	}
}
Exemplo n.º 29
0
static void sub_810B58C(void)
{
    PlaySE(SE_W088);
    FieldEffectActiveListRemove(FLDEFF_USE_ROCK_SMASH);
    EnableBothScriptContexts();
}
Exemplo n.º 30
0
void sub_81372BC(void)
{
    u8 r4;

    switch (ewram160A8)
    {
    case 0:
        ewram160AA = 64;
        ewram160A8++;
        // fall through
    case 1:
        r4 = --ewram160AA;
        if (r4 == 0)
        {
            PlaySE(SE_SELECT);
            Emitcmd33(1, 0, 0);
            WallyBufferExecCompleted();
            ewram160A8++;
            ewram160A9 = r4;
            ewram160AA = 64;
        }
        break;
    case 2:
        r4 = --ewram160AA;
        if (r4 == 0)
        {
            PlaySE(SE_SELECT);
            Emitcmd33(1, 0, 0);
            WallyBufferExecCompleted();
            ewram160A8++;
            ewram160A9 = r4;
            ewram160AA = 64;
        }
        break;
    case 3:
        r4 = --ewram160AA;
        if (r4 == 0)
        {
            Emitcmd33(1, 9, 0);
            WallyBufferExecCompleted();
            ewram160A8++;
            ewram160A9 = r4;
            ewram160AA = 64;
        }
        break;
    case 4:
        if (--ewram160AA == 0)
        {
            PlaySE(SE_SELECT);
            nullsub_8(0);
            sub_802E3E4(1, 0);
            ewram160AA = 64;
            ewram160A8++;
        }
        break;
    case 5:
        if (--ewram160AA == 0)
        {
            PlaySE(SE_SELECT);
            DestroyMenuCursor();
            Emitcmd33(1, 1, 0);
            WallyBufferExecCompleted();
        }
        break;
    }
}