1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-11 06:40:34 +00:00
OpenMW/apps/openmw/mwmechanics/autocalcspell.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.4 KiB
C++
Raw Normal View History

#ifndef OPENMW_AUTOCALCSPELL_H
#define OPENMW_AUTOCALCSPELL_H
2023-06-05 21:21:30 +02:00
#include "creaturestats.hpp"
#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;
}
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);
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);
// 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);
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);
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);
}
#endif