mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
(WIP) onRoamStart hook implementation
This commit is contained in:
parent
a58971c270
commit
a811e73fed
@ -448,8 +448,7 @@ void Mob::deadStep(time_t currTime) {
|
|||||||
|
|
||||||
std::cout << "respawning mob " << id << " with HP = " << maxHealth << std::endl;
|
std::cout << "respawning mob " << id << " with HP = " << maxHealth << std::endl;
|
||||||
|
|
||||||
hp = maxHealth;
|
transition(AIState::ROAMING, id);
|
||||||
state = AIState::ROAMING;
|
|
||||||
|
|
||||||
// if mob is a group leader/follower, spawn where the group is.
|
// if mob is a group leader/follower, spawn where the group is.
|
||||||
if (groupLeader != 0) {
|
if (groupLeader != 0) {
|
||||||
@ -720,7 +719,15 @@ void Mob::retreatStep(time_t currTime) {
|
|||||||
// if we got there
|
// if we got there
|
||||||
//if (distance <= mob->data["m_iIdleRange"]) {
|
//if (distance <= mob->data["m_iIdleRange"]) {
|
||||||
if (distance <= 10) { // retreat back to the spawn point
|
if (distance <= 10) { // retreat back to the spawn point
|
||||||
state = AIState::ROAMING;
|
transition(AIState::ROAMING, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mob::onInactive() {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mob::onRoamStart() {
|
||||||
hp = maxHealth;
|
hp = maxHealth;
|
||||||
killedTime = 0;
|
killedTime = 0;
|
||||||
nextAttack = 0;
|
nextAttack = 0;
|
||||||
@ -734,15 +741,6 @@ void Mob::retreatStep(time_t currTime) {
|
|||||||
// clear outlying debuffs
|
// clear outlying debuffs
|
||||||
clearDebuff(this);
|
clearDebuff(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Mob::onInactive() {
|
|
||||||
// no-op
|
|
||||||
}
|
|
||||||
|
|
||||||
void Mob::onRoamStart() {
|
|
||||||
// stub
|
|
||||||
}
|
|
||||||
|
|
||||||
void Mob::onCombatStart(EntityRef src) {
|
void Mob::onCombatStart(EntityRef src) {
|
||||||
assert(src.type == EntityType::PLAYER);
|
assert(src.type == EntityType::PLAYER);
|
||||||
|
Loading…
Reference in New Issue
Block a user