mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-24 22:11:04 +00:00
Quick fix for Fuse boss fight NPCEvent logic
Will be replaced with a proper rework immediately.
This commit is contained in:
parent
eb88fa05cb
commit
ba20f5a401
@ -307,19 +307,21 @@ void CombatNPC::step(time_t currTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CombatNPC::transition(AIState newState, EntityRef src) {
|
void CombatNPC::transition(AIState newState, EntityRef src) {
|
||||||
|
|
||||||
state = newState;
|
state = newState;
|
||||||
|
|
||||||
if (transitionHandlers.find(newState) != transitionHandlers.end())
|
if (transitionHandlers.find(newState) != transitionHandlers.end())
|
||||||
transitionHandlers[newState](this, src);
|
transitionHandlers[newState](this, src);
|
||||||
else {
|
else {
|
||||||
std::cout << "[WARN] Transition to " << (int)state << " has no handler; going inactive" << std::endl;
|
std::cout << "[WARN] Transition to " << (int)state << " has no handler; going inactive" << std::endl;
|
||||||
transition(AIState::INACTIVE, id);
|
transition(AIState::INACTIVE, id);
|
||||||
}
|
}
|
||||||
/* TODO: fire any triggered events
|
|
||||||
|
// TODO: Properly refactor this
|
||||||
|
if (newState == AIState::DEAD && src.kind == EntityKind::PLAYER) {
|
||||||
for (NPCEvent& event : NPCManager::NPCEvents)
|
for (NPCEvent& event : NPCManager::NPCEvents)
|
||||||
if (event.trigger == ON_KILLED && event.npcType == type)
|
if (event.trigger == ON_KILLED && event.npcType == type)
|
||||||
event.handler(src, this);
|
event.handler(src.sock, this);
|
||||||
*/
|
}
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
@ -306,18 +306,18 @@ static void lordFuseStageTwo(CNSocket *sock, BaseNPC *npc) {
|
|||||||
|
|
||||||
// Fuse doesn't move
|
// Fuse doesn't move
|
||||||
// Blastons, Heal
|
// Blastons, Heal
|
||||||
Mob *newbody = (Mob*)NPCManager::summonNPC(oldbody->x, oldbody->y, oldbody->z, plr->instanceID, 2467);
|
Mob *newbody = (Mob*)NPCManager::summonNPC(oldbody->x, oldbody->y, oldbody->z, oldbody->instanceID, 2467);
|
||||||
|
|
||||||
newbody->angle = oldbody->angle;
|
newbody->angle = oldbody->angle;
|
||||||
NPCManager::updateNPCPosition(newbody->id, newbody->x, newbody->y, newbody->z,
|
NPCManager::updateNPCPosition(newbody->id, newbody->spawnX, newbody->spawnY, newbody->spawnZ,
|
||||||
plr->instanceID, oldbody->angle);
|
oldbody->instanceID, oldbody->angle);
|
||||||
|
|
||||||
// right arm, Adaptium, Stun
|
// right arm, Adaptium, Stun
|
||||||
Mob *arm = (Mob*)NPCManager::summonNPC(oldbody->x - 600, oldbody->y, oldbody->z, plr->instanceID, 2469);
|
Mob *arm = (Mob*)NPCManager::summonNPC(oldbody->x - 600, oldbody->y, oldbody->z, oldbody->instanceID, 2469);
|
||||||
|
|
||||||
arm->angle = oldbody->angle;
|
arm->angle = oldbody->angle;
|
||||||
NPCManager::updateNPCPosition(arm->id, arm->x, arm->y, arm->z,
|
NPCManager::updateNPCPosition(arm->id, arm->spawnX, arm->spawnY, arm->spawnZ,
|
||||||
plr->instanceID, oldbody->angle);
|
oldbody->instanceID, oldbody->angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// summon left arm and stage 3 body
|
// summon left arm and stage 3 body
|
||||||
@ -328,18 +328,18 @@ static void lordFuseStageThree(CNSocket *sock, BaseNPC *npc) {
|
|||||||
std::cout << "Lord Fuse stage three" << std::endl;
|
std::cout << "Lord Fuse stage three" << std::endl;
|
||||||
|
|
||||||
// Cosmix, Damage Point
|
// Cosmix, Damage Point
|
||||||
Mob *newbody = (Mob*)NPCManager::summonNPC(oldbody->x, oldbody->y, oldbody->z, plr->instanceID, 2468);
|
Mob *newbody = (Mob*)NPCManager::summonNPC(oldbody->x, oldbody->y, oldbody->z, oldbody->instanceID, 2468);
|
||||||
|
|
||||||
newbody->angle = oldbody->angle;
|
newbody->angle = oldbody->angle;
|
||||||
NPCManager::updateNPCPosition(newbody->id, newbody->x, newbody->y, newbody->z,
|
NPCManager::updateNPCPosition(newbody->id, newbody->spawnX, newbody->spawnY, newbody->spawnZ,
|
||||||
plr->instanceID, oldbody->angle);
|
newbody->instanceID, oldbody->angle);
|
||||||
|
|
||||||
// Blastons, Heal
|
// Blastons, Heal
|
||||||
Mob *arm = (Mob*)NPCManager::summonNPC(oldbody->x + 600, oldbody->y, oldbody->z, plr->instanceID, 2470);
|
Mob *arm = (Mob*)NPCManager::summonNPC(oldbody->x + 600, oldbody->y, oldbody->z, oldbody->instanceID, 2470);
|
||||||
|
|
||||||
arm->angle = oldbody->angle;
|
arm->angle = oldbody->angle;
|
||||||
NPCManager::updateNPCPosition(arm->id, arm->x, arm->y, arm->z,
|
NPCManager::updateNPCPosition(arm->id, arm->spawnX, arm->spawnY, arm->spawnZ,
|
||||||
plr->instanceID, oldbody->angle);
|
arm->instanceID, oldbody->angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<NPCEvent> NPCManager::NPCEvents = {
|
std::vector<NPCEvent> NPCManager::NPCEvents = {
|
||||||
|
Loading…
Reference in New Issue
Block a user