New feature: Minigames are interactive actions that happen in a dedicated screen. For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=347722&#msg_347722

git-svn-id: https://ja2svn.mooo.com/source/ja2_v1.13_data@2350 4f8fa57e-7814-0410-bad4-adc449f26b7c
This commit is contained in:
Flugente
2016-12-11 12:37:27 +00:00
parent bdb1067636
commit d5429f5372
7 changed files with 44 additions and 2 deletions
+32 -2
View File
@@ -393,6 +393,8 @@ ActionTypes =
ACTIONTYPE_HACKING = 1,
ACTIONTYPE_READFILE = 2,
ACTIONTYPE_WATERTAP = 3,
ACTIONTYPE_SODAMACHINE = 4,
ACTIONTYPE_MINIGAME = 5,
}
InfoTypes =
@@ -401,6 +403,16 @@ InfoTypes =
INFO_TYPE_VIP = 1,
}
ScreenTypes =
{
MINIGAME = 30,
}
MiniGames =
{
TETRIS = 0,
}
-- We have an array of 1000 signed integers that a modder can use to set whatever data he wants.
-- We simply set up some enums here to make it easier for us to remember what is what
ModSpecificActions =
@@ -481,9 +493,12 @@ ModSpecificActions =
READING_ORTA_BOOKSHELF_1 = 48,
-- San Mona
READING_SANMONA_KINGPIN_BOOKSHELF_1 = 49,
READING_SANMONA_KINGPIN_BOOKSHELF_1 = 49,
-- |||||||||||||||||||||||||||||||||| books |||||||||||||||||||||||||||||||||||||
-- |||||||||||||||||||||||||||||||||| minigames |||||||||||||||||||||||||||||||||||||
MINIGAME_TETRIS = 50,
-- |||||||||||||||||||||||||||||||||| minigames |||||||||||||||||||||||||||||||||||||
}
-- General defines for various states
@@ -1442,6 +1457,21 @@ function HandleInteractiveActionResult(sSectorX, sSectorY, bSectorZ, sGridNo, bL
SetScreenMsg(FontColour.FONT_MCOLOR_DKWHITE, "It seems he controls almost all of San Mona.")
SetScreenMsg(FontColour.FONT_MCOLOR_DKWHITE, "But none of the records explicitly state something criminal is going on.")
end
elseif ( usActionType == ActionTypes.ACTIONTYPE_MINIGAME ) then
-- for now, the only game we have is tetris
if ( sLuaactionid == ModSpecificActions.MINIGAME_TETRIS ) then
-- playing a game costs $1
if ( SoldierSpendMoney(ubID, 1) == 1 ) then
SetMiniGameType(MiniGames.TETRIS)
SetPendingNewScreen(ScreenTypes.MINIGAME)
end
end
end
end