Skip to content

Commit 18bef1d

Browse files
committed
Add Very Hard / Brutal AI difficulty
1 parent 566e9e9 commit 18bef1d

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/extra_difficulty.asm

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
section .bss
1010
UltimatelyEasyDifficultyData RESB 80
1111
ExtremelyEasyDifficultyData RESB 80
12+
BrutallyEasyDifficultyData RESB 80
1213
VeryEasyDifficultyData RESB 80
1314
AINormalDifficultyData RESB 80
1415

1516
sstring str_UltimatelyEasy, "UltimatelyEasy"
1617
sstring str_ExtremelyEasy, "ExtremelyEasy"
18+
sstring str_BrutallyEasy, "BrutallyEasy"
1719
sstring str_VeryEasy, "VeryEasy"
1820
sstring str_AINormal, "AINormal"
1921
sstring str_Easy, "Easy"
@@ -31,6 +33,11 @@ hack 0x005CE198
3133
mov edx, ExtremelyEasyDifficultyData
3234
call 0x005CE1E0 ; Difficulty_Get(CCINIClass & ini, DifficultyClass & diff, char const * section)
3335

36+
push str_BrutallyEasy
37+
mov ecx, edi ; CCINIClass pointer
38+
mov edx, BrutallyEasyDifficultyData
39+
call 0x005CE1E0 ; Difficulty_Get(CCINIClass & ini, DifficultyClass & diff, char const * section)
40+
3441
push str_VeryEasy
3542
mov ecx, edi ; CCINIClass pointer
3643
mov edx, VeryEasyDifficultyData
@@ -194,10 +201,12 @@ hack 0x004BB479
194201
; Check if the requested difficulty type matches any the difficulty
195202
; values that we should process
196203
; (5 = Ultimately Easy, 4 = Extremely Easy, 3 = Very Easy, 1 = AINormal only if the house is an AI house)
197-
cmp edi, 5
204+
cmp edi, 6
198205
je .Ultimately_Easy_Diff
199-
cmp edi, 4
206+
cmp edi, 5
200207
je .Extremely_Easy_Diff
208+
cmp edi, 4
209+
je .Brutally_Easy_Diff
201210
cmp edi, 3
202211
je .Very_Easy_Diff
203212
cmp edi, 1
@@ -226,6 +235,17 @@ hack 0x004BB479
226235
mov edi, 0 ; Hard difficulty
227236
jmp 0x004BB654 ; let the original game code handle the rest
228237

238+
.Brutally_Easy_Diff:
239+
; Set the 'difficulty index' of the house to 0 (Hard AI)
240+
mov dword [ecx+58h], 0
241+
242+
; This difficulty level can only show up in MP
243+
Set_Difficulty_Modifiers_Multiplayer BrutallyEasyDifficultyData
244+
245+
mov eax, [0x0074C488] ; RulesClass pointer
246+
mov edi, 0 ; Hard difficulty
247+
jmp 0x004BB654 ; let the original game code handle the rest
248+
229249
.Very_Easy_Diff:
230250

231251
; Set the 'difficulty index' of the house to 0 (Hard AI)

src/spawner/spawner.asm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ section .rdata
202202
str_HardAI db "Hard AI",0
203203
str_MediumAI db "Medium AI",0
204204
str_EasyAI db "Easy AI",0
205+
str_VeryHardAI db "Very Hard AI",0
205206
str_BrutalAI db "Brutal AI",0
206207
str_ExtremeAI db "Extreme AI",0
207208
str_UltimateAI db "Ultimate AI",0
@@ -491,10 +492,12 @@ _Assign_Houses_AI_Player_Names:
491492
cmp ecx, 2
492493
je .Easy_AI
493494
cmp ecx, 3
494-
je .Brutal_AI
495+
je .Very_Hard_AI
495496
cmp ecx, 4
496-
je .Extreme_AI
497+
je .Brutal_AI
497498
cmp ecx, 5
499+
je .Extreme_AI
500+
cmp ecx, 6
498501
je .Ultimate_AI
499502
jmp .Original_Code
500503

@@ -507,6 +510,9 @@ _Assign_Houses_AI_Player_Names:
507510
.Easy_AI:
508511
mov eax, str_EasyAI
509512
jmp .Assign_AI_Player_Name
513+
.Very_Hard_AI:
514+
mov eax, str_VeryHardAI
515+
jmp .Assign_AI_Player_Name
510516
.Brutal_AI:
511517
mov eax, str_BrutalAI
512518
jmp .Assign_AI_Player_Name

0 commit comments

Comments
 (0)