Skip to content

Commit

Permalink
24.12.2
Browse files Browse the repository at this point in the history
[Diggers]
* Optimise in-game status screens rendering.
* Block the book from opening if a digger is going home or teleporting home.
* Swap out the score for 'death expenses' for 'exploration' which is 1 point for every fully unshrouded part of a zone uncovered which there is a theoretical maximum of a million points up for grabs. Existing save games are unaffected.
* Swap out the score for 'salary paid' for 'homicide duties' because violence is wrong and you lose 1000 points for every digger you kill, and gain 1000 points for every digger of yours you lose in the line of duty.
* Swap out the score for 'items value' for 'enemy kills'. An enemy kill is any moving spirit object that is not a digger.
* Optimise some in-game code a little.
* Optimise score screen a little.
* Fix cursor graphic not being restored properly when exiting setup in some instances.

[Assets]
* Rebuild API docs to account for cvar changes.

[Engine]
* Rename cvar 'app_homedir' to 'ast_homedir' and 'app_basedir' to 'ast_basedir' (ast_=asset related cvars).
* Add 'ast_modbundle' to scan for archives from the directory pointed at 'ast_homedir'.
* Resolve cases were forward-slashes were being stripped from the beginning of a pathname.
* Fix in-archive directory display issue with 'dir' console command.
  • Loading branch information
Mhatxotic committed Dec 2, 2024
1 parent 2f16daf commit b56a202
Show file tree
Hide file tree
Showing 22 changed files with 929 additions and 779 deletions.
3 changes: 2 additions & 1 deletion diggers/app.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ app_description = A remake of the classic Amiga/DOS game for Windows
app_icon = app/icon.png
app_longname = Diggers
app_shortname = Diggers
app_version = R45
app_version = R46
app_website = github.com/Mhatxotic/Engine
ast_modbundle = true
con_font = app/console.ttf
con_fontflags = 4
con_fontheight = 8
Expand Down
157 changes: 81 additions & 76 deletions diggers/src/data.lua

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions diggers/src/end.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local UtilIsBoolean<const>, UtilIsInteger<const>, UtilIsString<const>,
local Fade, GetCapitalValue, GetGameTicks, InitPost, InitScore,
IsButtonReleased, LoadResources, PlayMusic, PlayStaticSound, RenderFade,
RenderObjects, RenderTerrain, SetCallbacks, SetCursor, SetKeys,
aGemsAvailable, aGlobalData, fontLarge;
aGemsAvailable, aGlobalData, aShroudData, fontLarge;
-- Locals ------------------------------------------------------------------ --
local aCollections, -- All texts
aLinesBottom, -- Bottom lines of texts
Expand All @@ -30,6 +30,7 @@ local aCollections, -- All texts
iCOK, iCExit, iCWait, -- Cursor ids
iDeadCost, -- Death duties total
iEndTexId, -- End tile id chosen from texture
iExploration, -- Total explored
iGameTicks, -- Total game ticks
iGameTime, -- Total game time
iKeyBankLoseId, -- Lose screen key bank id
Expand Down Expand Up @@ -245,16 +246,19 @@ local function OnLoaded(aResources, aActivePlayer, aOpponentPlayer, sMsg)
-- Get cost of capital
aGlobalData.gCapitalCarried = GetCapitalValue();
-- Get cost of digger deaths
iDeadCost, iSalary = 0, 0;
local aActivePlayerDiggers<const> = aActivePlayer.D;
for iI = 1, #aActivePlayerDiggers do
local aDigger<const> = aActivePlayerDiggers[iI];
if not aDigger then
aGlobalData.gTotalDeaths = aGlobalData.gTotalDeaths + 1;
iDeadCost = iDeadCost + 65;
else
iSalary = iSalary + 30;
end
local iPRemain<const> = aActivePlayer.DC;
local iPDeaths<const> = #aActivePlayer.D - iPRemain;
aGlobalData.gTotalDeaths = aGlobalData.gTotalDeaths + iPDeaths
iDeadCost, iSalary = iPDeaths * 65, iPRemain * 30;
-- Add enemy kills
local iPKills<const> = aActivePlayer.EK;
aGlobalData.gTotalEnemyKills = aGlobalData.gTotalEnemyKills + iPKills;
-- Add homicides of opponent playerss
aGlobalData.gTotalHomicides = aGlobalData.gTotalHomicides + aActivePlayer.LK;
-- Calculate exploration data
iExploration = 0;
for iI = 1, #aShroudData do
if aShroudData[iI][2] == 0xF then iExploration = iExploration + 1 end;
end
-- Get game ticks and time
iGameTicks = GetGameTicks();
Expand All @@ -266,10 +270,8 @@ local function OnLoaded(aResources, aActivePlayer, aOpponentPlayer, sMsg)
aGlobalData.gTotalGemsSold + aActivePlayer.GS;
aGlobalData.gTotalCapital =
aGlobalData.gTotalCapital + aGlobalData.gCapitalCarried;
aGlobalData.gTotalDeathExp =
aGlobalData.gTotalDeathExp + iDeadCost;
aGlobalData.gTotalPurchExp =
aGlobalData.gTotalPurchExp + aActivePlayer.BP;
aGlobalData.gTotalExploration =
aGlobalData.gTotalExploration + iExploration;
aGlobalData.gTotalTimeTaken =
aGlobalData.gTotalTimeTaken + iGameTicks // 60;
aGlobalData.gTotalIncome =
Expand All @@ -278,8 +280,6 @@ local function OnLoaded(aResources, aActivePlayer, aOpponentPlayer, sMsg)
aGlobalData.gTotalDug + aActivePlayer.DUG;
aGlobalData.gTotalPurchases =
aGlobalData.gTotalPurchases + aActivePlayer.PUR;
aGlobalData.gTotalSalaryPaid =
aGlobalData.gTotalSalaryPaid + iSalary;
aGlobalData.gBankBalance =
aGlobalData.gBankBalance + (aActivePlayer.M - iDeadCost - iSalary);
aGlobalData.gPercentCompleted =
Expand Down Expand Up @@ -360,12 +360,12 @@ local function OnReady(GetAPI)
Fade, GetCapitalValue, GetGameTicks, InitPost, InitScore, IsButtonReleased,
LoadResources, PlayMusic, PlayStaticSound, RenderFade, RenderObjects,
RenderTerrain, SetCallbacks, SetCursor, SetKeys, aGemsAvailable,
aGlobalData, fontLarge =
aGlobalData, aShroudData, fontLarge =
GetAPI("Fade", "GetCapitalValue", "GetGameTicks", "InitPost",
"InitScore", "IsButtonReleased", "LoadResources", "PlayMusic",
"PlayStaticSound", "RenderFade", "RenderObjects", "RenderTerrain",
"SetCallbacks", "SetCursor", "SetKeys", "aGemsAvailable",
"aGlobalData", "fontLarge");
"aGlobalData", "aShroudData", "fontLarge");
-- Register keybinds
local aKeys<const>, aStates<const> = Input.KeyCodes, Input.States;
local iPress<const> = aStates.PRESS;
Expand Down
18 changes: 9 additions & 9 deletions diggers/src/file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ local function InitNewGame()
aGlobalData.gGameSaved, aGlobalData.gLevelsCompleted,
aGlobalData.gNewGame, aGlobalData.gPercentCompleted,
aGlobalData.gSelectedLevel, aGlobalData.gSelectedRace,
aGlobalData.gTotalCapital, aGlobalData.gTotalDeathExp,
aGlobalData.gTotalCapital, aGlobalData.gTotalExploration,
aGlobalData.gTotalDeaths, aGlobalData.gTotalDug,
aGlobalData.gTotalGemsFound, aGlobalData.gTotalGemsSold,
aGlobalData.gTotalIncome, aGlobalData.gTotalPurchExp,
aGlobalData.gTotalPurchases, aGlobalData.gTotalSalaryPaid,
aGlobalData.gTotalIncome, aGlobalData.gTotalEnemyKills,
aGlobalData.gTotalPurchases, aGlobalData.gTotalHomicides,
aGlobalData.gTotalTimeTaken, aGlobalData.gZogsToWinGame =
0, 0,
true, { },
Expand Down Expand Up @@ -246,11 +246,11 @@ local function FileLoad()
aGlobalData.gSelectedLevel, aGlobalData.gZogsToWinGame,
aGlobalData.gBankBalance, aGlobalData.gPercentCompleted,
aGlobalData.gCapitalCarried, aGlobalData.gNewGame,
aGlobalData.gGameSaved, aGlobalData.gTotalSalaryPaid,
aGlobalData.gTotalCapital, aGlobalData.gTotalDeathExp,
aGlobalData.gGameSaved, aGlobalData.gTotalHomicides,
aGlobalData.gTotalCapital, aGlobalData.gTotalExploration,
aGlobalData.gTotalDeaths, aGlobalData.gTotalGemsSold,
aGlobalData.gTotalGemsFound, aGlobalData.gTotalIncome,
aGlobalData.gTotalDug, aGlobalData.gTotalPurchExp,
aGlobalData.gTotalDug, aGlobalData.gTotalEnemyKills,
aGlobalData.gTotalPurchases, aGlobalData.gLevelsCompleted =
Data[2], Data[3],
nil, 17500,
Expand Down Expand Up @@ -286,11 +286,11 @@ local function FileSave()
format("%u,%u,%u,%d,%d,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%s",
CoreOSTime(), aGlobalData.gTotalTimeTaken,
aGlobalData.gSelectedRace, aGlobalData.gBankBalance,
aGlobalData.gCapitalCarried, aGlobalData.gTotalSalaryPaid,
aGlobalData.gTotalCapital, aGlobalData.gTotalDeathExp,
aGlobalData.gCapitalCarried, aGlobalData.gTotalHomicides,
aGlobalData.gTotalCapital, aGlobalData.gTotalExploration,
aGlobalData.gTotalDeaths, aGlobalData.gTotalGemsSold,
aGlobalData.gTotalGemsFound, aGlobalData.gTotalIncome,
aGlobalData.gTotalDug, aGlobalData.gTotalPurchExp,
aGlobalData.gTotalDug, aGlobalData.gTotalEnemyKills,
aGlobalData.gTotalPurchases, NL, LC));
-- Set message
sMsg = "FILE "..iSelected.." SAVED SUCCESSFULLY!";
Expand Down
Loading

0 comments on commit b56a202

Please sign in to comment.