//NPC AI //v0.1 //Rudimentary AI Functions bool EnemyHitByWeapon(lewapon l, npc n){ return Collision(l,n); } void EnemyHomesWhenHit(npc n, lweapon l, int miscIndex, int amount, bool multiply){ if ( EnemyHitByWeapon(n,l) && !n->Misc[miscIndex] ) { n->Misc[miscIndex] = 1; if ( multiply ) n->Homing = n->Homing * amount; else n->Homing += amount; } } void EnemyHomesWhenPerceivingThreat(npc n, int miscIndex, int amount, bool multiply){ if ( EnemyPerceiveThreat(n) && !n->Misc[miscIndex] ) { n->Misc[miscIndex] = 1; if ( multiply ) n->Homing = n->Homing * amount; else n->Homing += amount; } } void EnemyAttack(int type, int weapon){ } void EnemyParry(){ } float EnemyRetreat(){} //Move to a safe distance, and make checks for next action. float EnemyTactics(){} //Decide on a complex pattern float EnemyFollowPattern(int pattern){} //Follow a predetermined pattern. int EnemySavingThrow(int type, int mindset, int penaltyOrBonus){} float EnemyPerceiveIncomingAttack(){} float EnemyPerceiveThreat(){} float EnemyPerceivePlayerCharacter(int charType){} float EnemyPerceiveFollowerNPC(){} float EnemyChaseFollowerNPC(){} void EnemyDodgeAttack(){} void EnemyEvadeThreat(){} float EnemyFindPathToItem(){} float EnemyFindPathToPlayer(){} float EnemyFindPathToNPC(){} float EnemyFriendlyFire(){} //Avoid friendly fire float EnemyFlankTarget(){} //Flank the target of an attack. float EnemySurroundTarget(){} //As flank, but more than two. float EnemySeekItemDrops(){} //Find Hearts, if enemy HP is low. float EnhemySeekHealthBoost(){} float EnemyStealItemFromPlayer(){} float EnemyUseItem(){} //Use item from own inventory. Requires an inventory list per enemy. float EnemyInventories[256*20]; //Items held by an enemy, to use, or potentially drop. float EnemyWeaponSelection[256*10]; //Weapons that the enemy can use. float EnemySpellSelection[256*20]; //Spells that the enemy can use. int EnemyChooseWeapon(){} //Choose a weapon for use to attack a target. int EnemyChooseSpell(){} int EnemyIsInjured(){} //Returns total amount of damage enemy has suffered. void EnemyFindAndStoreMovementPath(){} //Find a apth to a target, and store it in an array. void EnemyExecuteMove(){} //Moves along the path. int EnemyMakeSkillCheck(int type, int mindset, int penaltyorBonus){}; float EnemyDecision(int basis, int mindset, int stat, int skill, int type){} float EnemySkillsAndStats[256*20]; //Statistics and skills for each enemy. const int ENEMY_STAT_MUSC const int ENEMY_STAT_ const int ENEMY_STAT_ const int ENEMY_STAT_ const int ENEMY_STAT_ const int ENEMY_STAT_ const int ENEMY_SKILL_AWARENESS const int ENEMY_SKILL_SWORDS const int ENEMY_SKILL_RANGED_WEAPONS const int ENEMY_SKILL_SPELLS const int ENEMY_MINDSET_ANGRY const int ENEMY_MINDSET__NORMAL const int ENEMY_MINDSET__FRIGHTENED const int ENEMY_MINDSET_PANICKED const int ENEMY_MINDSET_ARROGANT