diff --git a/gamedir/Data-1.13/Interface/background_tetris_game.png b/gamedir/Data-1.13/Interface/background_tetris_game.png new file mode 100644 index 000000000..7233e0aa8 Binary files /dev/null and b/gamedir/Data-1.13/Interface/background_tetris_game.png differ diff --git a/gamedir/Data-1.13/Interface/background_tetris_gameover.png b/gamedir/Data-1.13/Interface/background_tetris_gameover.png new file mode 100644 index 000000000..4a6315c66 Binary files /dev/null and b/gamedir/Data-1.13/Interface/background_tetris_gameover.png differ diff --git a/gamedir/Data-1.13/Interface/background_tetris_startscreen.png b/gamedir/Data-1.13/Interface/background_tetris_startscreen.png new file mode 100644 index 000000000..e4fee869a Binary files /dev/null and b/gamedir/Data-1.13/Interface/background_tetris_startscreen.png differ diff --git a/gamedir/Data-1.13/Scripts/Overhead.lua b/gamedir/Data-1.13/Scripts/Overhead.lua index 0ab67e631..32d062f45 100644 --- a/gamedir/Data-1.13/Scripts/Overhead.lua +++ b/gamedir/Data-1.13/Scripts/Overhead.lua @@ -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 diff --git a/gamedir/Data-1.13/TableData/Map/InteractiveActions.xml b/gamedir/Data-1.13/TableData/Map/InteractiveActions.xml index c0f84d7e5..fb9e92cec 100644 --- a/gamedir/Data-1.13/TableData/Map/InteractiveActions.xml +++ b/gamedir/Data-1.13/TableData/Map/InteractiveActions.xml @@ -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 @@ + + + + lawless3.sti + 8 + 7 + 5 + 50 + + + diff --git a/gamedir/Data/CURSORS/minigame.sti b/gamedir/Data/CURSORS/minigame.sti new file mode 100644 index 000000000..effb208c4 Binary files /dev/null and b/gamedir/Data/CURSORS/minigame.sti differ diff --git a/gamedir/Data/CURSORS/minigame_r.sti b/gamedir/Data/CURSORS/minigame_r.sti new file mode 100644 index 000000000..b28f86ddf Binary files /dev/null and b/gamedir/Data/CURSORS/minigame_r.sti differ