📄 dndutil.h
字号:
/* ---------------------------------------------------------------------- * * dndutil.h * * by Jamis Buck (jgb3@email.byu.edu) * * Utility functions for the Dungeons & Dragons(tm) API. This file is in * the public domain. * * Function summary: * * int dndClassBonusFeatEveryXLevels( int id ) * int dndClassHasBonusFeatAtFirstLevel( int id ) * int dndFeatIsReusable( int id ) * int dndGetAbilityBonus( int abilityScore ) * char* dndGetAbilityName( int ability ) * char* dndGetAlignmentAbbr( int alignment ) * char* dndGetAlignmentText( int alignment ) * int dndGetArmorACBonus( int id ) * int dndGetArmorArcaneSpellFailure( int id ) * int dndGetArmorCheckPenalty( int id ) * int dndGetArmorCost( int id ) * int dndGetArmorMaxDexterity( int id ) * char* dndGetArmorName( int id ) * int dndGetArmorType( int id ) * int dndGetBonusLanguages( int id, char** next ) * int dndGetBonusSpellsPerDay( int relevantAbility, int spellLevel ) * char* dndGetClassAbbr( int id ) * int dndGetClassAttackBonus( int id, int level ) * int dndGetClassAttacksPerRound( int baseAttack ) * int dndGetClassHitDie( int id ) * int dndGetClassMultipleAttackBonus( int baseAttack, int which ) * char* dndGetClassName( int id ) * int dndGetClassType( int id ) * char* dndGetClassTypeName( int id ) * char* dndGetDomainName( int id ) * char* dndGetFeatName( int id ) * int dndGetFeatPrerequisite( int id, int* type, int* data1, int* data2, char** next ) * int dndGetForbiddenAlignmentsForDomain( int id ) * int dndGetFortitudeSave( int classType, int level ) * int dndGetRelativeWeaponSize( int raceid, int weapon ) * int dndGetGivenLanguages( int id, char** next ) * char* dndGetLanguageName( int id ) * int dndGetMonkAttacksPerRound( int baseAttack ) * int dndGetMonkMultipleAttackBonus( int baseAttack, int which ) * int dndGetMonkSpeedForRace( int raceid, int level ) * int dndGetNPCGearValue( int level ) * int dndGetRaceAlignment( int race ) * int dndGetRaceCR( int id ) * int dndGetRaceExtraHitDice( int race, int* count, int* type ) * char* dndGetRaceName( int id ) * int dndGetRaceSize( int id ) * int dndGetRaceSpeed( int id ) * int dndGetRaceBonus( int id, int gender, int type, int data ) * int dndGetRaceBonusOfType( int race, int gender, int type, int* data, int* bonus, char** next ) * int dndGetRacePreferredClass( int race ); * int dndGetRacialHeightWeight( int race, int gender, DNDRACIALHEIGHTWEIGHT* data ) * int dndGetReflexSave( int classType, int level ) * char* dndGetSchoolOfMagicName( int id ) * int dndGetSizeACMod( int id ) * int dndGetSizeHideMod( int id ) * char* dndGetSizeName( int id ) * int dndGetSkillAbility( int skill ) * int dndGetSkillBonusForClass( int classType ) * char* dndGetSkillName( int skill ) * int dndGetSkillType( int classType, int skill ) * int dndGetSpellLevel( int classid, int spellid ) * char* dndGetSpellName( int id ) * int dndGetSpellSchool( int id ) * int dndGetSpellOfLevel( int classid, int level, char** next ) * int dndGetSpellsKnown( int classid, int classLevel, int spellLevel ) * int dndGetSpellsPerDay( int classid, int classLevel, int spellLevel ) * int dndGetWeaponCost( int id ) * char* dndGetWeaponName( int id ) * int dndGetWeaponSize( int id ) * int dndGetWeaponType( int id ) * int dndGetWillSave( int classType, int level ) * * ---------------------------------------------------------------------- */#ifndef __DNDUTIL_H__#define __DNDUTIL_H__/* ---------------------------------------------------------------------- * * Dependencies * ---------------------------------------------------------------------- */#include "dndconst.h"/* ---------------------------------------------------------------------- * * Constant definitions * ---------------------------------------------------------------------- *//* ---------------------------------------------------------------------- * * Type definitions * ---------------------------------------------------------------------- */typedef struct __dndracialheightweight__ DNDRACIALHEIGHTWEIGHT;/* ---------------------------------------------------------------------- * * Structure definitions * ---------------------------------------------------------------------- */struct __dndracialheightweight__ { int baseHeight_Feet; int baseHeight_Inches; int heightModDieCount; int heightModDie; int baseWeight; int weightModDieCount; int weightModDie;};/* ---------------------------------------------------------------------- * * Functions * ---------------------------------------------------------------------- */#ifdef __cplusplusextern "C" {#endif/* ---------------------------------------------------------------------- * * dndGetClassName( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * char* - a static buffer containing the text that describes the given * class's name, or NULL if an unknown class was specified. * ---------------------------------------------------------------------- */char* dndGetClassName( int id );/* ---------------------------------------------------------------------- * * dndGetClassAbbr( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * char* - a static buffer containing the 3 character abbreviation for * the given class. * ---------------------------------------------------------------------- */char* dndGetClassAbbr( int id );/* ---------------------------------------------------------------------- * * dndGetClassType( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * int - the id of the class type that the class is (player, npc, or * prestige), or 0 if the id is not known. * ---------------------------------------------------------------------- */int dndGetClassType( int id );/* ---------------------------------------------------------------------- * * dndGetClassHitDie( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * int - the number of sides for the die used for calculating the hit * points for a character of the given class. * ---------------------------------------------------------------------- */int dndGetClassHitDie( int id );/* ---------------------------------------------------------------------- * * dndClassHasBonusFeatAtFirstLevel( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * boolean - 1 (true) or 0 (false) * ---------------------------------------------------------------------- */int dndClassHasBonusFeatAtFirstLevel( int id );/* ---------------------------------------------------------------------- * * dndClassBonusFeatEveryXLevels( int id ) * * INPUT: * id (int) - one of the pc, npc, or prestige class constants. * * OUTPUT: * boolean - the number of levels that, once a character of the given * class has attained, he gains a bonus feat. This will return * zero if the class has no bonus feats. * ---------------------------------------------------------------------- */int dndClassBonusFeatEveryXLevels( int id );/* ---------------------------------------------------------------------- * * dndGetClassTypeName( int id ) * * INPUT: * id (int) - one of the class type constants (player, prestige, or * nonplayer) * * OUTPUT: * char* - a static buffer containing the text that describes the given * class type's name, or NULL if an unknown type was specified. * ---------------------------------------------------------------------- */char* dndGetClassTypeName( int id );/* ---------------------------------------------------------------------- * * dndGetClassAttackBonus( int id, int level ) * * INPUT: * id (int) - one of the class type constants (player, prestige, or * nonplayer) * level (int) - a number from 1 to 20, inclusive. * * OUTPUT: * int - the base attack bonus for the given class at the given level. * ---------------------------------------------------------------------- */int dndGetClassAttackBonus( int id, int level );/* ---------------------------------------------------------------------- * * dndGetClassAttacksPerRound( int baseAttack ) * * INPUT: * baseAttack (int) - the base attack bonus * * OUTPUT: * int - the number of attacks granted per round. * ---------------------------------------------------------------------- */int dndGetClassAttacksPerRound( int baseAttack );/* ---------------------------------------------------------------------- * * dndGetMonkAttacksPerRound( int baseAttack ) * * INPUT: * baseAttack (int) - the base attack bonus * * OUTPUT: * int - the number of attacks granted per round, for monks with the * given base attack. * ---------------------------------------------------------------------- */int dndGetMonkAttacksPerRound( int baseAttack );/* ---------------------------------------------------------------------- * * dndGetClassMultipleAttackBonus( int baseAttack, int which ) * * INPUT: * baseAttack (int) - the base attack bonus * which (int) - which multiple attack bonus to return (1,2,3,4) * * OUTPUT: * int - the bonus of the given attack * ---------------------------------------------------------------------- */int dndGetClassMultipleAttackBonus( int baseAttack, int which );/* ---------------------------------------------------------------------- * * dndGetMonkMultipleAttackBonus( int baseAttack, int which ) * * INPUT: * baseAttack (int) - the base attack bonus * which (int) - which multiple attack bonus to return (1,2,3,4) * * OUTPUT: * int - the bonus of the given attack for a monk with the given * base attack bonus. * ---------------------------------------------------------------------- */int dndGetMonkMultipleAttackBonus( int baseAttack, int which );/* ---------------------------------------------------------------------- * * dndGetAlignmentText( int alignment ) * * INPUT: * alignment (int) - a valid combination of the alignment constants * (lawful good, lawful neutral, lawful evil, netural * good, true neutral, neutral evil, chaotic good, * chaotic neutral, or chaotic evil). * * OUTPUT: * char* - a static buffer containing the text that describes the given * alignment, or NULL if an unknown alignment was specified. * ---------------------------------------------------------------------- */char* dndGetAlignmentText( int alignment );/* ---------------------------------------------------------------------- * * dndGetAlignmentAbbr( int alignment ) * * INPUT: * alignment (int) - a valid combination of the alignment constants * (lawful good, lawful neutral, lawful evil, netural * good, true neutral, neutral evil, chaotic good, * chaotic neutral, or chaotic evil). * * OUTPUT: * char* - a static buffer containing the one or two letter abbreviation * for the specified alignment, or NULL if an unknown alignment * was specified. * ---------------------------------------------------------------------- */char* dndGetAlignmentAbbr( int alignment );/* ---------------------------------------------------------------------- * * dndGetSkillName( int skill ) * * INPUT: * skill (int) - one of the sk-- constants. * * OUTPUT: * char* - a static buffer containing the text that describes the given * skill, or NULL if an unknown skill was specified. * ---------------------------------------------------------------------- */char* dndGetSkillName( int skill );/* ---------------------------------------------------------------------- * * dndGetSkillAbility( int skill ) * * INPUT: * skill (int) - one of the sk-- constants. * * OUTPUT: * int - one of the ab--- constants that indicates the ability associated * with the given skill. * ---------------------------------------------------------------------- */int dndGetSkillAbility( int skill );/* ---------------------------------------------------------------------- * * dndGetSkillType( int classType, int skill ) * * INPUT: * classType (int) - one of the pc---, npc---, or prc--- constants.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -