Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Decompilation] [th02] Score: Skill value calculation
This will end up at the end of Mima's translation unit. Might as well start a separate temporary one then, which will simplify the diff once we eventually merge it into that future Mima TU which is very likely to grow from top to bottom. Part of P0279, funded by Yanga and Blue Bolt.
- Loading branch information
Showing
4 changed files
with
32 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "th02/main/boss/b5_.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "platform.h" | ||
#include "th02/resident.hpp" | ||
#include "th02/core/globals.hpp" | ||
#include "th02/main/playperf.hpp" | ||
|
||
void near skill_calculate(void) | ||
{ | ||
int skill = (rank * 20); | ||
skill += (10 - (resident->continues_used * 3)); | ||
|
||
int skill_miss_and_bombs = (50 - (total_miss_count * 3) - total_bombs_used); | ||
if(skill_miss_and_bombs < 0) { | ||
skill_miss_and_bombs = 0; | ||
} | ||
skill += skill_miss_and_bombs; | ||
|
||
if(item_skill > 25) { | ||
item_skill = 25; | ||
} else if(item_skill < 0) { | ||
item_skill = 0; | ||
} | ||
skill += item_skill; | ||
resident->skill = skill; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters