Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Games/Freibier/include/modules/Freibier_BasicGame.hpp>
- #include <Games/Freibier/include/modules/Freibier_BasicGameCmd.hpp>
- #include <vevt/include/VEVT_ReelsSubscriber.hpp>
- #include <vlib/include/suppliers/VLIB_FiguresProvider.hpp>
- #include <vcore/include/accounting/VCORE_Account.hpp>
- #include <vlib/include/factory/ObjectFac.hpp>
- #include <vgui/include/factory/VGUI_MovieFac.hpp>
- #include <vsdk/gameBS/include/BSViewSupplier.hpp>
- #include <vsdk/gameBS/include/BSCmd.hpp>
- #include <iostream>
- using namespace freibier;
- using namespace vevt;
- using namespace vlib;
- using namespace vsdk;
- using namespace std;
- BasicGame::BasicGame() : m_respin_win(0)
- {
- }
- void BasicGame::ActionFinish(VEVT_Event* const event)
- {
- printf("Action finish!!! \n");
- if (m_respin)
- {
- m_nor_chain.clear();
- m_ext_chain.clear();
- BSModel::ActionStart(nullptr);
- Notify(COREFIRE.HIDE_GAME_MESSAGE);
- printf("1# Action finish! m_respin = true\n");
- }
- else
- {
- printf("2# Action finish! m_respin = false\n");
- BSModel::ActionFinish(event);
- }
- }
- void BasicGame::ProbeNormal(VEVT_Event* const event)
- {
- if (m_first_probe)
- {
- printf("3# ProbeNormal m_first_probe = true\n");
- ProcessRespin();
- }
- BSModel::ProbeNormal(event);
- }
- void BasicGame::ActionStart(VEVT_Event* const event)
- {
- printf("4# Action start");
- BSModel::ActionStart(event);
- indexes.clear();
- }
- void BasicGame::MediaStateChanged(VEVT_Event* const event)
- {
- BSModel::MediaStateChanged(event);
- if (event->GetCommand() != WL_EVENT.WHEEL_STOP)
- return;
- const auto scatter_id = VLIB_FiguresProvider::Instance()->Scatter()->GetIdentity();
- const auto wheel = event->GetContent();
- const auto curr_wheel = BSViewSupplier::Instance()->GetWheels()->GetWheel(wheel);
- int symbol{ curr_wheel->GetVisibleCount() };
- while (symbol--)
- {
- //Анимация скеттера при крутке только на 1-3 барабанах
- if (curr_wheel->GetContents(symbol) == scatter_id) {
- indexes.push_back(wheel);
- std::cout << "SIZE: " << indexes.size() << std::endl;
- if(wheel > 2)
- continue;
- StrBuf panel_name;
- sprintf(panel_name, "app.overlay.profits.movie.W%d#R%d", wheel, symbol);
- auto panel = ObjectFac::Instance()->LoadPanel(panel_name);
- auto scatter_movie = VGUI_MovieFac::Instance()->GetMovie("bs_F10_appear"); VLIB_ASSERT(scatter_movie);
- panel->SetImage(scatter_movie);
- scatter_movie->Play();
- }
- }
- }
- void freibier::BasicGame::ProcessRespin()
- {
- auto wheels = BSViewSupplier::Instance()->GetWheels();
- if (!m_respin && (indexes.size() > 1))
- {
- printf("5# ProcessRespin !m_respin && (indexes.size() > 1)");
- m_respin = true;
- m_ext_chain.clear();
- wheels->SetNotSpinningWheels(indexes);
- }
- else
- {
- printf("6# ProcessRespin ResetNotSpinningWheels");
- Notify(BASIC_GAME_EVENT.STOP_RESPIN);
- SetGameWin(m_respin_win);
- m_respin = false;
- m_respin_win = 0;
- wheels->ResetNotSpinningWheels();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement