|
OpenGothic
Open source reimplementation of Gothic I and II
|
#include <fightalgo.h>
Public Types | |
| enum | Action : uint8_t { MV_NULL = 0 , MV_MOVEG = 1 , MV_MOVEA = 2 , MV_JUMPBACK = 3 , MV_ATTACK = 4 , MV_ATTACKL = 5 , MV_ATTACKR = 6 , MV_STRAFEL = 7 , MV_STRAFER = 8 , MV_BLOCK = 9 , MV_WAIT = 10 , MV_WAITLONG = 11 , MV_TURN2HIT = 12 , MV_TURNA = 13 , MV_TURNG = 14 , MV_STRAFE_E = 15 , MV_MAX = 6 } |
Public Member Functions | |
| FightAlgo () | |
| void | load (Serialize &fin) |
| void | save (Serialize &fout) |
| Action | nextFromQueue (Npc &npc, Npc &tg, GameScript &owner) |
| void | consumeAction () |
| void | onClearTarget () |
| void | onTakeHit () |
| bool | hasInstructions () const |
| bool | fetchInstructions (Npc &npc, Npc &tg, GameScript &owner) |
| float | baseDistance (const Npc &npc, const Npc &tg, GameScript &owner) const |
| float | prefferedAttackDistance (const Npc &npc, const Npc &tg, GameScript &owner) const |
| float | prefferedGDistance (const Npc &npc, const Npc &tg, GameScript &owner) const |
| float | attackFinishDistance (GameScript &owner) const |
| bool | isInAttackRange (const Npc &npc, const Npc &tg, GameScript &owner) const |
| bool | isInFinishRange (const Npc &npc, const Npc &tg, GameScript &owner) const |
| bool | isInWRange (const Npc &npc, const Npc &tg, GameScript &owner) const |
| bool | isInGRange (const Npc &npc, const Npc &tg, GameScript &owner) const |
| bool | isInFocusAngle (const Npc &npc, const Npc &tg) const |
Definition at line 11 of file fightalgo.h.
| enum FightAlgo::Action : uint8_t |
| Enumerator | |
|---|---|
| MV_NULL | |
| MV_MOVEG | |
| MV_MOVEA | |
| MV_JUMPBACK | |
| MV_ATTACK | |
| MV_ATTACKL | |
| MV_ATTACKR | |
| MV_STRAFEL | |
| MV_STRAFER | |
| MV_BLOCK | |
| MV_WAIT | |
| MV_WAITLONG | |
| MV_TURN2HIT | |
| MV_TURNA | |
| MV_TURNG | |
| MV_STRAFE_E | |
| MV_MAX | |
Definition at line 18 of file fightalgo.h.
| FightAlgo::FightAlgo | ( | ) |
Definition at line 16 of file fightalgo.cpp.
| float FightAlgo::attackFinishDistance | ( | GameScript & | owner | ) | const |
Definition at line 260 of file fightalgo.cpp.
| float FightAlgo::baseDistance | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 238 of file fightalgo.cpp.
| void FightAlgo::consumeAction | ( | ) |
Definition at line 221 of file fightalgo.cpp.
| bool FightAlgo::fetchInstructions | ( | Npc & | npc, |
| Npc & | tg, | ||
| GameScript & | owner | ||
| ) |
Definition at line 213 of file fightalgo.cpp.
| bool FightAlgo::hasInstructions | ( | ) | const |
Definition at line 209 of file fightalgo.cpp.
| bool FightAlgo::isInAttackRange | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 271 of file fightalgo.cpp.
| bool FightAlgo::isInFinishRange | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 283 of file fightalgo.cpp.
Definition at line 301 of file fightalgo.cpp.
| bool FightAlgo::isInGRange | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 295 of file fightalgo.cpp.
| bool FightAlgo::isInWRange | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 289 of file fightalgo.cpp.
| void FightAlgo::load | ( | Serialize & | fin | ) |
Definition at line 19 of file fightalgo.cpp.
| FightAlgo::Action FightAlgo::nextFromQueue | ( | Npc & | npc, |
| Npc & | tg, | ||
| GameScript & | owner | ||
| ) |
Definition at line 105 of file fightalgo.cpp.
| void FightAlgo::onClearTarget | ( | ) |
Definition at line 227 of file fightalgo.cpp.
| void FightAlgo::onTakeHit | ( | ) |
Definition at line 232 of file fightalgo.cpp.
| float FightAlgo::prefferedAttackDistance | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 245 of file fightalgo.cpp.
| float FightAlgo::prefferedGDistance | ( | const Npc & | npc, |
| const Npc & | tg, | ||
| GameScript & | owner | ||
| ) | const |
Definition at line 252 of file fightalgo.cpp.
| void FightAlgo::save | ( | Serialize & | fout | ) |
Definition at line 26 of file fightalgo.cpp.