Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NwCreature - Associates #795

Merged
merged 24 commits into from
Jan 20, 2025

Conversation

Chimerik
Copy link
Contributor

@Chimerik Chimerik commented Jan 4, 2025

Add methods to handle associates

Copy link

github-actions bot commented Jan 4, 2025

Test Results

       1 files  ±0     219 suites  ±0   1m 25s ⏱️ ±0s
1 416 tests ±0  1 416 ✔️ ±0  0 💤 ±0  0 ±0 
2 224 runs  ±0  2 224 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 816e7b3. ± Comparison against base commit 0627996.

♻️ This comment has been updated with latest results.

@Chimerik Chimerik requested a review from jhett12321 January 4, 2025 16:24
Comment on lines 1024 to 1037
public void ForceLevelUp(byte nClass, byte nHitDie, byte nAbilityGain = 6, int bEpic = 0, ushort nSkillPointsRemaining = 0, byte nDomain1 = 255, byte nDomain2 = 255, byte nSchool = 255, int addStatsToList = 1)
{
CNWLevelStats stats = new CNWLevelStats()
{
m_nClass = nClass,
m_nHitDie = nHitDie,
m_nAbilityGain = nAbilityGain,
m_bEpic = bEpic,
m_nSkillPointsRemaining = nSkillPointsRemaining,
};

Creature.m_pStats.LevelUp(stats, nDomain1, nDomain2, nSchool, addStatsToList);
GC.SuppressFinalize(stats);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anvil API functions should use wrapper classes and more friendly types when possible.

We do not prefix parameter names with the type.

Suggested change
public void ForceLevelUp(byte nClass, byte nHitDie, byte nAbilityGain = 6, int bEpic = 0, ushort nSkillPointsRemaining = 0, byte nDomain1 = 255, byte nDomain2 = 255, byte nSchool = 255, int addStatsToList = 1)
{
CNWLevelStats stats = new CNWLevelStats()
{
m_nClass = nClass,
m_nHitDie = nHitDie,
m_nAbilityGain = nAbilityGain,
m_bEpic = bEpic,
m_nSkillPointsRemaining = nSkillPointsRemaining,
};
Creature.m_pStats.LevelUp(stats, nDomain1, nDomain2, nSchool, addStatsToList);
GC.SuppressFinalize(stats);
}
public void ForceLevelUp(NwClass classType, byte hitDie, Ability? abilityGain = default, bool epic = false, ushort skillPointsRemaining = 0, NwDomain? domain1 = default, NwDomain? domain2 = default, SpellSchool school = SpellSchool.Unknown, bool addStatsToList = true)
{
CNWLevelStats stats = new CNWLevelStats()
{
m_nClass = classType.Id,
m_nHitDie = hitDie,
m_nAbilityGain = abilityGain?.Value ?? 6,
m_bEpic = epic.ToInt(),
m_nSkillPointsRemaining = skillPointsRemaining,
};
Creature.m_pStats.LevelUp(stats, nDomain1?.Id ?? 255, nDomain2?.Id ?? 255, (unchecked((byte)School), addStatsToList.ToInt());
GC.SuppressFinalize(stats);
}

Please update the comments with the parameter changes :)

Comment on lines 2569 to 2612
/// Instructs this creature to summon their animal companion.<br/>
/// Instructs this creature to summon their animal companion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line break can be restored

Comment on lines 2667 to 2750
for (int i = 1;; i++)
for (int i = 1; ; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change

@Chimerik Chimerik requested a review from jhett12321 January 11, 2025 09:18
@jhett12321 jhett12321 merged commit 3075e2d into nwn-dotnet:development Jan 20, 2025
8 checks passed
@Chimerik Chimerik deleted the NwCreatureAssociates branch January 25, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants