2014-07-11 07:31:18 +02:00
|
|
|
#ifndef OPENMW_AUTOCALCSPELL_H
|
|
|
|
#define OPENMW_AUTOCALCSPELL_H
|
|
|
|
|
2023-06-05 21:21:30 +02:00
|
|
|
#include "creaturestats.hpp"
|
2022-10-18 09:26:55 +02:00
|
|
|
#include <components/esm/refid.hpp>
|
2023-06-05 21:21:30 +02:00
|
|
|
#include <map>
|
2019-02-19 01:10:55 +03:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2023-06-05 21:21:30 +02:00
|
|
|
|
2019-02-19 01:10:55 +03:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Spell;
|
|
|
|
struct Race;
|
|
|
|
}
|
2014-07-11 07:31:18 +02:00
|
|
|
|
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Contains algorithm for calculating an NPC's spells based on stats
|
|
|
|
/// @note We might want to move this code to a component later, so the editor can use it for preview purposes
|
|
|
|
|
2023-06-19 20:41:54 +02:00
|
|
|
std::vector<ESM::RefId> autoCalcNpcSpells(const std::map<ESM::RefId, SkillValue>& actorSkills,
|
2023-08-03 20:21:44 +02:00
|
|
|
const std::map<ESM::RefId, AttributeValue>& actorAttributes, const ESM::Race* race);
|
2014-07-11 07:31:18 +02:00
|
|
|
|
2023-06-19 20:41:54 +02:00
|
|
|
std::vector<ESM::RefId> autoCalcPlayerSpells(const std::map<ESM::RefId, SkillValue>& actorSkills,
|
2023-08-03 20:21:44 +02:00
|
|
|
const std::map<ESM::RefId, AttributeValue>& actorAttributes, const ESM::Race* race);
|
2016-11-18 17:59:05 +01:00
|
|
|
|
2014-07-11 07:31:18 +02:00
|
|
|
// Helpers
|
|
|
|
|
2023-06-19 20:41:54 +02:00
|
|
|
bool attrSkillCheck(const ESM::Spell* spell, const std::map<ESM::RefId, SkillValue>& actorSkills,
|
2023-08-03 20:21:44 +02:00
|
|
|
const std::map<ESM::RefId, AttributeValue>& actorAttributes);
|
2014-07-11 07:31:18 +02:00
|
|
|
|
2023-06-05 21:21:30 +02:00
|
|
|
void calcWeakestSchool(const ESM::Spell* spell, const std::map<ESM::RefId, SkillValue>& actorSkills,
|
2023-06-26 20:42:52 +02:00
|
|
|
ESM::RefId& effectiveSchool, float& skillTerm);
|
2014-07-11 07:31:18 +02:00
|
|
|
|
2023-06-05 21:21:30 +02:00
|
|
|
float calcAutoCastChance(const ESM::Spell* spell, const std::map<ESM::RefId, SkillValue>& actorSkills,
|
2023-08-03 20:21:44 +02:00
|
|
|
const std::map<ESM::RefId, AttributeValue>& actorAttributes, ESM::RefId effectiveSchool);
|
2014-07-11 07:31:18 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|