Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Bugfix: enemy's random special skill changes in battle.
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Jul 27, 2020
1 parent 7f9d009 commit b08bbae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,11 +2389,13 @@ const u16 strongHealSpecialSkills[] = {
u16 getUnitRandomSpecialSkill(struct Unit *unit)
{
int factor;
struct Unit *realUnit;

if(isGenericUnit(unit))
{
// factor shouldn't change in a chapter
factor = unit->character->id + unit->job->id + unit->lv + unit->number + unit->side + unit->maxHp + unit->pow + unit->skl + unit->spd + unit->def + unit->res + unit->luk + unit->levelSword + unit->levelLance + unit->levelAxe + unit->levelBow + unit->levelStaff + unit->levelAnima + unit->levelLight + unit->levelDark + gRAMChapterData.chapterIndex + gRAMChapterData.playerName[0] + gRAMChapterData.playerName[1] + gRAMChapterData.playerName[2] + gRAMChapterData.playerName[3] + gRAMChapterData.playerName[4] + gRAMChapterData.playerName[5] + gRAMChapterData.playerName[6] + gRAMChapterData.playerName[7] + gRAMChapterData.playerName[8] + gRAMChapterData.playerName[9] + gRAMChapterData.playerBloodType + gRAMChapterData.playerBirthMonth + gRAMChapterData.playerGender + gRAMChapterData.playerStars;
realUnit = GetUnitNew(unit->side, unit->number);
factor = realUnit->character->id + realUnit->job->id + realUnit->lv + realUnit->number + realUnit->side + realUnit->maxHp + realUnit->pow + realUnit->skl + realUnit->spd + realUnit->def + realUnit->res + realUnit->luk + realUnit->levelSword + realUnit->levelLance + realUnit->levelAxe + realUnit->levelBow + realUnit->levelStaff + realUnit->levelAnima + realUnit->levelLight + realUnit->levelDark + gRAMChapterData.chapterIndex + gRAMChapterData.playerName[0] + gRAMChapterData.playerName[1] + gRAMChapterData.playerName[2] + gRAMChapterData.playerName[3] + gRAMChapterData.playerName[4] + gRAMChapterData.playerName[5] + gRAMChapterData.playerName[6] + gRAMChapterData.playerName[7] + gRAMChapterData.playerName[8] + gRAMChapterData.playerName[9] + gRAMChapterData.playerBloodType + gRAMChapterData.playerBirthMonth + gRAMChapterData.playerGender + gRAMChapterData.playerStars;
Debugf("Generic unit special skill factor: unit %x, number %d, factor %d", unit, unit->number, factor);
switch(getEnemySpecialSkillLevel())
{
Expand Down

0 comments on commit b08bbae

Please sign in to comment.