-
Notifications
You must be signed in to change notification settings - Fork 10
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
NwCreature - Associates #795
Conversation
OnSpellBroadcast - Add Target & position parameters
NwAreaOfEffect - Add SetRadius
NwCreature - Add Setters for familiar and companions types and names
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); | ||
} |
There was a problem hiding this comment.
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.
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 :)
/// Instructs this creature to summon their animal companion.<br/> | ||
/// Instructs this creature to summon their animal companion. |
There was a problem hiding this comment.
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
for (int i = 1;; i++) | ||
for (int i = 1; ; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change
Add methods to handle associates