mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
Binary file not shown.
|
After Width: | Height: | Size: 727 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 705 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 714 KiB |
@@ -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
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
2: read a file from a file cabinet
|
||||
3: take water from a water tap
|
||||
4: buy soda from a soda machine
|
||||
5: play a minigame
|
||||
difficulty how hard it is to perform action
|
||||
luaactionid if this is set, lua script HandleInteractiveActionResult() in Overhead.lua is called
|
||||
with this Id to perform special actions. If no ID is set, the standard action is called.
|
||||
@@ -994,4 +995,15 @@
|
||||
</ACTION>
|
||||
<!-- |||||||||||||||||||| SODA MACHINE |||||||||||||||||||| -->
|
||||
|
||||
<!-- |||||||||||||||||||| MINIGAME |||||||||||||||||||| -->
|
||||
<!-- game machine -->
|
||||
<ACTION>
|
||||
<szTileSetName>lawless3.sti</szTileSetName>
|
||||
<usTileIndex>8</usTileIndex>
|
||||
<usTileIndex>7</usTileIndex>
|
||||
<sActionType>5</sActionType>
|
||||
<luaactionid>50</luaactionid>
|
||||
</ACTION>
|
||||
<!-- |||||||||||||||||||| MINIGAME |||||||||||||||||||| -->
|
||||
|
||||
</INTERACTIVEACTIONS>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user