mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +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_HACKING = 1,
|
||||||
ACTIONTYPE_READFILE = 2,
|
ACTIONTYPE_READFILE = 2,
|
||||||
ACTIONTYPE_WATERTAP = 3,
|
ACTIONTYPE_WATERTAP = 3,
|
||||||
|
ACTIONTYPE_SODAMACHINE = 4,
|
||||||
|
ACTIONTYPE_MINIGAME = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoTypes =
|
InfoTypes =
|
||||||
@@ -401,6 +403,16 @@ InfoTypes =
|
|||||||
INFO_TYPE_VIP = 1,
|
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 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
|
-- We simply set up some enums here to make it easier for us to remember what is what
|
||||||
ModSpecificActions =
|
ModSpecificActions =
|
||||||
@@ -481,9 +493,12 @@ ModSpecificActions =
|
|||||||
READING_ORTA_BOOKSHELF_1 = 48,
|
READING_ORTA_BOOKSHELF_1 = 48,
|
||||||
|
|
||||||
-- San Mona
|
-- San Mona
|
||||||
READING_SANMONA_KINGPIN_BOOKSHELF_1 = 49,
|
READING_SANMONA_KINGPIN_BOOKSHELF_1 = 49,
|
||||||
|
|
||||||
-- |||||||||||||||||||||||||||||||||| books |||||||||||||||||||||||||||||||||||||
|
-- |||||||||||||||||||||||||||||||||| books |||||||||||||||||||||||||||||||||||||
|
||||||
|
|
||||||
|
-- |||||||||||||||||||||||||||||||||| minigames |||||||||||||||||||||||||||||||||||||
|
||||||
|
MINIGAME_TETRIS = 50,
|
||||||
|
-- |||||||||||||||||||||||||||||||||| minigames |||||||||||||||||||||||||||||||||||||
|
||||||
}
|
}
|
||||||
|
|
||||||
-- General defines for various states
|
-- 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, "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.")
|
SetScreenMsg(FontColour.FONT_MCOLOR_DKWHITE, "But none of the records explicitly state something criminal is going on.")
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
2: read a file from a file cabinet
|
2: read a file from a file cabinet
|
||||||
3: take water from a water tap
|
3: take water from a water tap
|
||||||
4: buy soda from a soda machine
|
4: buy soda from a soda machine
|
||||||
|
5: play a minigame
|
||||||
difficulty how hard it is to perform action
|
difficulty how hard it is to perform action
|
||||||
luaactionid if this is set, lua script HandleInteractiveActionResult() in Overhead.lua is called
|
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.
|
with this Id to perform special actions. If no ID is set, the standard action is called.
|
||||||
@@ -994,4 +995,15 @@
|
|||||||
</ACTION>
|
</ACTION>
|
||||||
<!-- |||||||||||||||||||| SODA MACHINE |||||||||||||||||||| -->
|
<!-- |||||||||||||||||||| 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>
|
</INTERACTIVEACTIONS>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user