📄 npcengine.h
字号:
NPC* npcGenerateNPC( NPCGENERATOROPTS* opts );/* ---------------------------------------------------------------------- * * npcDestroyNPC * * Destroys (deallocates) the given NPC. * ---------------------------------------------------------------------- */void npcDestroyNPC( NPC* npc );/* ---------------------------------------------------------------------- * * npcHasClass * * Returns non-zero if the given NPC has at least one level of the given * class. * ---------------------------------------------------------------------- */int npcHasClass( NPC* npc, int classType );/* ---------------------------------------------------------------------- * * npcHasFeat * * Returns non-zero if the given NPC has taken the given feat at least * once. * ---------------------------------------------------------------------- */int npcHasFeat( NPC* npc, int featType );/* ---------------------------------------------------------------------- * * npcHasSkill * * Returns non-zero if the given NPC has taken the given skill at least * once. * ---------------------------------------------------------------------- */int npcHasSkill( NPC* npc, int skillType );/* ---------------------------------------------------------------------- * * npcHasSkillFocus * * Returns non-zero if the given NPC has taken the "skill focus" feat at * least once for the given skill. * ---------------------------------------------------------------------- */int npcHasSkillFocus( NPC* npc, int skillType );/* ---------------------------------------------------------------------- * * npcHasKnowsLanguage * * Returns non-zero if the given NPC knows the given language. * ---------------------------------------------------------------------- */int npcKnowsLanguage( NPC* npc, int language );/* ---------------------------------------------------------------------- * * npcGearValue * * Returns the gold piece value of the given NPC's gear. * ---------------------------------------------------------------------- */int npcGearValue( NPC* npc );/* ---------------------------------------------------------------------- * * npcClassCount * * Returns the number of classes the NPC has. * ---------------------------------------------------------------------- */int npcClassCount( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetClass * * Returns NULL if the NPC does not have any levels in the given class, * or a pointer to the given class if the NPC has at least one level in it. * ---------------------------------------------------------------------- */NPCCLASS* npcGetClass( NPC* npc, int classType );/* ---------------------------------------------------------------------- * * npcGetSkill * * Returns NULL if the NPC does not have the given skill, or a pointer to * the given skill. * ---------------------------------------------------------------------- */NPCSKILL* npcGetSkill( NPC* npc, int skillType );/* ---------------------------------------------------------------------- * * npcGetBaseFortitudeSave * * Computes the base fortitude saving throw for the NPC by summing the * base fortitude saves for each of the NPC's classes. * ---------------------------------------------------------------------- */int npcGetBaseFortitudeSave( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetBaseReflexSave * * Computes the base reflex saving throw for the NPC by summing the * base reflex saves for each of the NPC's classes. * ---------------------------------------------------------------------- */int npcGetBaseReflexSave( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetBaseWillSave * * Computes the base will saving throw for the NPC by summing the * base will saves for each of the NPC's classes. * ---------------------------------------------------------------------- */int npcGetBaseWillSave( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetBaseAttack * * Computes the base attack bonus for the NPC by calling * npcGetBaseClassAttack to get the base attack bonus based on the NPC's * classes, and adds any racial bonus to attack that the NPC has. * ---------------------------------------------------------------------- */int npcGetBaseAttack( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetBaseClassAttack * * Computes the base attack bonus for the NPC by summing the base attack * bonuses for each of the NPC's classes. * ---------------------------------------------------------------------- */int npcGetBaseClassAttack( NPC* npc );/* ---------------------------------------------------------------------- * * npcGetCharacterLevel * * Computes the character level of the NPC by summing the levels of each * class the NPC has taken. * ---------------------------------------------------------------------- */int npcGetCharacterLevel( NPC* npc );/* ---------------------------------------------------------------------- * * npcComputeActualAC * * Computes the actual armor class of the NPC, taking into account ability * score bonuses, racial bonuses, class bonuses, etc. * * If the 'breakdown' parameter is non-null, it will contain a list of * the various components that comprised the AC. (See * npcBuildComponentBreakdownDescription and npcDestroyComponentBreakdown.) * ---------------------------------------------------------------------- */int npcComputeActualAC( NPC* npc, NPCCOMPBREAKDOWN** breakdown );/* ---------------------------------------------------------------------- * * npcComputeActualInitiative * * Computes the initiative bonus of the NPC, taking into account ability * score bonuses, racial bonuses, class bonuses, etc. * * If the 'breakdown' parameter is non-null, it will contain a list of * the various components that comprised the AC. (See * npcBuildComponentBreakdownDescription and npcDestroyComponentBreakdown.) * ---------------------------------------------------------------------- */int npcComputeActualInitiative( NPC* npc, NPCCOMPBREAKDOWN** breakdown );/* ---------------------------------------------------------------------- * * npcComputeActualSave * * Computes the given saving throw of the NPC, taking into account ability * score bonuses, racial bonuses, class bonuses, etc. * * 'save' must be one of svFORTITUDE, svREFLEX, or svWILL. * * If the 'breakdown' parameter is non-null, it will contain a list of * the various components that comprised the AC. (See * npcBuildComponentBreakdownDescription and npcDestroyComponentBreakdown.) * ---------------------------------------------------------------------- */int npcComputeActualSave( NPC* npc, int save, NPCCOMPBREAKDOWN** breakdown );/* ---------------------------------------------------------------------- * * npcComputeActualAttack * * Computes the given attack bonus of the NPC, taking into account ability * score bonuses, racial bonuses, class bonuses, etc. * * 'save' must be one of attMELEE or attRANGED. * * If the 'breakdown' parameter is non-null, it will contain a list of * the various components that comprised the AC. (See * npcBuildComponentBreakdownDescription and npcDestroyComponentBreakdown.) * ---------------------------------------------------------------------- */int npcComputeActualAttack( NPC* npc, int type, NPCCOMPBREAKDOWN** breakdown );/* ---------------------------------------------------------------------- * * npcComputeActualSkill * * Computes the given skill bonus of the NPC, taking into account ability * score bonuses, racial bonuses, class bonuses, skill ranks taken, etc. * * 'type' must be one of the sk--- constants. * * If the 'breakdown' parameter is non-null, it will contain a list of * the various components that comprised the AC. (See * npcBuildComponentBreakdownDescription and npcDestroyComponentBreakdown.) * ---------------------------------------------------------------------- */float npcComputeActualSkillBonus( NPC* npc, int type, NPCCOMPBREAKDOWN** breakdown );/* ---------------------------------------------------------------------- * * npcBuildComponentBreakdownDescription * * Builds a description of the given component breakdown. The description * is either an empty string (if there were no components to describe), or * a parenthetical list of comma delimited items of the format * <bonus> <type>, where <bonus> is a numeric bonus or penalty and <type> * is Racial, Natural, Size, Base, Str, Dex, Con, Int, Wis, Cha, etc. If * the description is longer than the indicated buffer length, the * description will be truncated. * ---------------------------------------------------------------------- */char* npcBuildComponentBreakdownDescription( NPCCOMPBREAKDOWN* breakdown, char* buffer, int len );/* ---------------------------------------------------------------------- * * npcBuildHitDiceBreakdown * * Builds a description of the hit dice of the given NPC, including the * hit dice of the base creature (where applicable) and the hit dice of the * component classes. Constitution bonuses are also indicated. If the * description is longer than the indicated buffer length, it will be * truncated. * ---------------------------------------------------------------------- */char* npcBuildHitDiceBreakdown( NPC* npc, char* buffer, int len );/* ---------------------------------------------------------------------- * * npcBuildStatBlock * * Builds a brief stat-block description of the NPC into the indicated * buffer. If the buffer is not long enough to contain the entire stat- * block, the stat-block will be truncated. The stat-block will contain * formatting features as well, which need to be interpreted correctly for * clean display: * * ~I<text>~i - italics, where <text> is the text to italicize. * ~B<text>~b - bold, where <text> is the text to bold. * <newline> - new-line (\n) characters, indicating line breaks. * ---------------------------------------------------------------------- */char* npcBuildStatBlock( NPC* npc, NPCSTATBLOCKOPTS* opts, char* buffer, int len );/* ---------------------------------------------------------------------- * * npcDestroyComponentBreakdown * * Destroys (deallocates) the given component breakdown. * ---------------------------------------------------------------------- */void npcDestroyComponentBreakdown( NPCCOMPBREAKDOWN* breakdown );/* ---------------------------------------------------------------------- * * npcRandomName * * Copies a randomly generated name appropriate to the given race and * gender into the given buffer. If the buffer is not long enough, it will * be truncated. The buffer is also returned as the return value. * * 'filePath' represents an absolute or relative path from the current * application execution path to the location of the grammar files that * define the names. These files are: * * - human_names.txt * - dwarf_names.txt * - elf_names.txt * - gnome_names.txt * - halfling_names.txt * - monstrous_names.txt * ---------------------------------------------------------------------- */char* npcRandomName( int race, int gender, char* filePath, char* name, int buflen );/* ---------------------------------------------------------------------- * * npcComputeCR * * Computes the challenge rating (CR) of the given NPC. * ---------------------------------------------------------------------- */int npcComputeCR( NPC* npc );/* ---------------------------------------------------------------------- * * npcAbScoreStrategy_Best3Of4D6 * * Computes the ability scores by taking the best 3 of 4d6, rolled 6 * times. * ---------------------------------------------------------------------- */void npcAbScoreStrategy_BestOf4d6( int* scores, void* data );/* ---------------------------------------------------------------------- * * npcAbScoreStrategy_Straight3d6 * * Computes the ability scores by rolling 3d6 6 times. * ---------------------------------------------------------------------- */void npcAbScoreStrategy_Straight3d6( int* scores, void* data );/* ---------------------------------------------------------------------- * * int npcGetRandomRace( int raceType ) * * Gets a random race based on the value of raceType. If raceType is one * of the rc-- constants, that value is returned. If raceType is one of * the race-- constants, a race is randomly selected appropriate to the * constant that was specified. * ---------------------------------------------------------------------- */int npcGetRandomRace( int raceType );/* ---------------------------------------------------------------------- * * int npcGetRandomAlignment( int alType ) * * Gets a random alignment based on the value of alType, which must be * one of the al-- constants. * ---------------------------------------------------------------------- */int npcGetRandomAlignment( int alType );#ifdef __cplusplus}#endif#endif /* __NPCENGINE_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -