mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +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
GameDir >= r2350 is required. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8346 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -8916,14 +8916,15 @@ void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT8 ubID, BOOLEAN aSucce
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !aSuccess )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[7], pSoldier->GetName( ) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case INTERACTIVE_STRUCTURE_MINIGAME:
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[9] );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -8963,5 +8964,9 @@ BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount )
|
||||
aAmount = 0;
|
||||
}
|
||||
|
||||
// warning if we don't have enough money
|
||||
if ( aAmount > 0 )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[7], pSoldier->GetName( ) );
|
||||
|
||||
return (aAmount == 0);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ typedef enum
|
||||
INTERACTIVE_STRUCTURE_READFILE,
|
||||
INTERACTIVE_STRUCTURE_WATERTAP,
|
||||
INTERACTIVE_STRUCTURE_SODAMACHINE,
|
||||
INTERACTIVE_STRUCTURE_MINIGAME,
|
||||
|
||||
INTERACTIVE_STRUCTURE_TYPE_MAX,
|
||||
} INTERACTIVE_STRUCTURE_TYPE;
|
||||
|
||||
@@ -230,6 +230,9 @@ UICursor gUICursors[ NUM_UI_CURSORS ] =
|
||||
SODAMACHINE_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_SODAMACHINE, 0,
|
||||
SODAMACHINE_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_SODAMACHINE_RED, 0,
|
||||
|
||||
MINIGAME_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_MINIGAME, 0,
|
||||
MINIGAME_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_MINIGAME_RED, 0,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -207,6 +207,9 @@ typedef enum
|
||||
SODAMACHINE_GREY_UICURSOR,
|
||||
SODAMACHINE_RED_UICURSOR,
|
||||
|
||||
MINIGAME_GREY_UICURSOR,
|
||||
MINIGAME_RED_UICURSOR,
|
||||
|
||||
NUM_UI_CURSORS
|
||||
|
||||
} UICursorDefines;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef __MINIGAME_H
|
||||
#define __MINIGAME_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @author Flugente (bears-pit.com)
|
||||
*/
|
||||
|
||||
// Flugente: lets create a few minigames
|
||||
enum
|
||||
{
|
||||
MINIGAME_FIRST = 0,
|
||||
TETRIS = MINIGAME_FIRST,
|
||||
};
|
||||
|
||||
// enums of gamestates
|
||||
enum
|
||||
{
|
||||
MINIGAME_STARTSCREEN = 0,
|
||||
MINIGAME_GAME,
|
||||
MINIGAME_GAMEOVER,
|
||||
MINIGAME_PAUSE,
|
||||
};
|
||||
|
||||
void SetNextGame( UINT32 ausGame, UINT32 ausGameState = MINIGAME_STARTSCREEN );
|
||||
|
||||
UINT32 MiniGameScreenInit( void );
|
||||
UINT32 MiniGameScreenHandle( void );
|
||||
UINT32 MiniGameScreenShutdown( void );
|
||||
|
||||
void MiniGame_Init_Tetris();
|
||||
UINT32 MiniGame_Handle_Tetris();
|
||||
|
||||
#endif //__MINIGAME_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4031,6 +4031,9 @@ INT16 GetAPsForInteractiveAction( SOLDIERTYPE *pSoldier, UINT8 usActionType )
|
||||
case INTERACTIVE_STRUCTURE_SODAMACHINE:
|
||||
sAPCost += APBPConstants[AP_SODAMACHINE];
|
||||
break;
|
||||
case INTERACTIVE_STRUCTURE_MINIGAME:
|
||||
sAPCost += APBPConstants[AP_READFILE];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -19135,6 +19135,16 @@ UINT16 SOLDIERTYPE::GetInteractiveActionSkill( INT32 sGridNo, UINT8 usLevel, UIN
|
||||
}
|
||||
break;
|
||||
|
||||
case INTERACTIVE_STRUCTURE_MINIGAME:
|
||||
{
|
||||
if ( this->ubProfile == ROBOT || IsVehicle( this ) )
|
||||
return 0;
|
||||
|
||||
// we are pros at playing games
|
||||
return 100;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -530,6 +530,10 @@
|
||||
RelativePath=".\Militia Control.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MiniGame.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Morale.h"
|
||||
>
|
||||
@@ -884,6 +888,10 @@
|
||||
RelativePath=".\Militia Control.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MiniGame.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Morale.cpp"
|
||||
>
|
||||
|
||||
@@ -534,6 +534,10 @@
|
||||
RelativePath="Militia Control.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MiniGame.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Morale.h"
|
||||
>
|
||||
@@ -886,6 +890,10 @@
|
||||
RelativePath="Militia Control.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MiniGame.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Morale.cpp"
|
||||
>
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
<ClInclude Include="merc entering.h" />
|
||||
<ClInclude Include="Merc Hiring.h" />
|
||||
<ClInclude Include="Militia Control.h" />
|
||||
<ClInclude Include="Morale.h" />
|
||||
<ClInclude Include="MiniGame.h" />
|
||||
<ClInclude Include="Morale.h" />
|
||||
<ClInclude Include="opplist.h" />
|
||||
<ClInclude Include="Overhead Types.h" />
|
||||
<ClInclude Include="Overhead.h" />
|
||||
@@ -159,7 +160,8 @@
|
||||
<ClCompile Include="Merc Entering.cpp" />
|
||||
<ClCompile Include="Merc Hiring.cpp" />
|
||||
<ClCompile Include="Militia Control.cpp" />
|
||||
<ClCompile Include="Morale.cpp" />
|
||||
<ClCompile Include="MiniGame.cpp" />
|
||||
<ClCompile Include="Morale.cpp" />
|
||||
<ClCompile Include="opplist.cpp" />
|
||||
<ClCompile Include="Overhead.cpp" />
|
||||
<ClCompile Include="PATHAI.cpp" />
|
||||
|
||||
@@ -144,7 +144,10 @@
|
||||
<ClInclude Include="Militia Control.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Morale.h">
|
||||
<ClInclude Include="MiniGame.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Morale.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="opplist.h">
|
||||
@@ -404,7 +407,10 @@
|
||||
<ClCompile Include="Militia Control.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Morale.cpp">
|
||||
<ClCompile Include="MiniGame.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Morale.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="opplist.cpp">
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
<ClInclude Include="merc entering.h" />
|
||||
<ClInclude Include="Merc Hiring.h" />
|
||||
<ClInclude Include="Militia Control.h" />
|
||||
<ClInclude Include="MiniGame.h" />
|
||||
<ClInclude Include="Morale.h" />
|
||||
<ClInclude Include="opplist.h" />
|
||||
<ClInclude Include="Overhead Types.h" />
|
||||
@@ -160,6 +161,7 @@
|
||||
<ClCompile Include="Merc Entering.cpp" />
|
||||
<ClCompile Include="Merc Hiring.cpp" />
|
||||
<ClCompile Include="Militia Control.cpp" />
|
||||
<ClCompile Include="Minigame.cpp" />
|
||||
<ClCompile Include="Morale.cpp" />
|
||||
<ClCompile Include="opplist.cpp" />
|
||||
<ClCompile Include="Overhead.cpp" />
|
||||
|
||||
@@ -276,6 +276,9 @@
|
||||
<ClInclude Include="Disease.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MiniGame.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Air Raid.cpp">
|
||||
@@ -704,5 +707,8 @@
|
||||
<ClCompile Include="XML_InteractiveTiles.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Minigame.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -2294,6 +2294,8 @@ UINT8 HandleHackCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCursorFla
|
||||
return skill ? WATERTAP_GREY_UICURSOR : WATERTAP_RED_UICURSOR;
|
||||
else if ( possibleaction == INTERACTIVE_STRUCTURE_SODAMACHINE )
|
||||
return skill ? SODAMACHINE_GREY_UICURSOR : SODAMACHINE_RED_UICURSOR;
|
||||
else if ( possibleaction == INTERACTIVE_STRUCTURE_MINIGAME )
|
||||
return skill ? MINIGAME_GREY_UICURSOR : MINIGAME_RED_UICURSOR;
|
||||
|
||||
return NO_UICURSOR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user