Skip to content

Commit

Permalink
Remove base weapon ranks of characters and classes. #8. #11.
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Aug 21, 2022
1 parent 9e39492 commit 60d146f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions linkerscript/unit.lds
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
.rodata.unitStateCheckForCounting : {*(.rodata.unitStateCheckForCounting)}
. = 0x808a0f0;
.rodata.unitStateCheckForListing : {*(.rodata.unitStateCheckForListing)}
. = 0x8017d20;
.text.loadUnitStats : {*(.text.loadUnitStats)}
30 changes: 30 additions & 0 deletions source/unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,33 @@ cu32 unitStateCheckForCounting = US_UNAVAILABLE | US_HIDDEN;
// AddToUnitList(unit, proc);
// unitStateCheckForListing: US_UNAVAILABLE -> US_UNAVAILABLE | US_HIDDEN
cu32 unitStateCheckForListing = US_UNAVAILABLE | US_HIDDEN;

void loadUnitStatsCore(struct Unit *unit, const struct Character *character)
{
unit->maxHP = character->baseHP + unit->pClass->baseHP;
unit->pow = character->basePow + unit->pClass->basePow;
unit->skl = character->baseSkl + unit->pClass->baseSkl;
unit->spd = character->baseSpd + unit->pClass->baseSpd;
unit->def = character->baseDef + unit->pClass->baseDef;
unit->res = character->baseRes + unit->pClass->baseRes;
unit->lck = character->baseLck;

unit->conBonus = 0;

// for (int i = 0; i < 8; ++i) {
// unit->ranks[i] = unit->pClass->baseRanks[i];

// if (unit->pCharacter->baseRanks[i])
// unit->ranks[i] = unit->pCharacter->baseRanks[i];
// }

if (UNIT_FACTION(unit) == FACTION_BLUE && (unit->level != UNIT_LEVEL_MAX))
unit->exp = 0;
else
unit->exp = UNIT_EXP_DISABLED;
}

void loadUnitStats(struct Unit *unit, const struct Character *character)
{
loadUnitStatsCore(unit, character);
}

0 comments on commit 60d146f

Please sign in to comment.