mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-17 07:20:05 +00:00
[refactor] Remove the word 'Manager' from most source files/namespaces
ChatManager -> Chat MissionManager -> Missions NanoManager -> Nanos TransportManager -> Transport ChunkManager -> Chunking BuddyManager -> Buddies GroupManager -> Groups RacingManager -> Racing ItemManager -> Items NPCManager and PlayerManager remain. Note: You can use git log --follow src/file.cpp to trace the history of a file from before it was renamed.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "MobAI.hpp"
|
||||
#include "Player.hpp"
|
||||
#include "RacingManager.hpp"
|
||||
#include "TransportManager.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
#include "Racing.hpp"
|
||||
#include "Transport.hpp"
|
||||
#include "Nanos.hpp"
|
||||
#include "Combat.hpp"
|
||||
#include "Abilities.hpp"
|
||||
|
||||
@@ -19,7 +19,7 @@ bool MobAI::simulateMobs;
|
||||
static void roamingStep(Mob *mob, time_t currTime);
|
||||
|
||||
/*
|
||||
* Dynamic lerp; distinct from TransportManager::lerp(). This one doesn't care about height and
|
||||
* Dynamic lerp; distinct from Transport::lerp(). This one doesn't care about height and
|
||||
* only returns the first step, since the rest will need to be recalculated anyway if chasing player.
|
||||
*/
|
||||
static std::pair<int,int> lerp(int x1, int y1, int x2, int y2, int speed) {
|
||||
@@ -130,7 +130,7 @@ bool MobAI::aggroCheck(Mob *mob, time_t currTime) {
|
||||
int mobRange = mob->sightRange;
|
||||
|
||||
if (plr->iConditionBitFlag & CSB_BIT_UP_STEALTH
|
||||
|| RacingManager::EPRaces.find(s) != RacingManager::EPRaces.end())
|
||||
|| Racing::EPRaces.find(s) != Racing::EPRaces.end())
|
||||
mobRange /= 3;
|
||||
|
||||
// 0.33x - 1.66x the range
|
||||
@@ -223,10 +223,10 @@ static void dealCorruption(Mob *mob, std::vector<int> targetData, int skillID, i
|
||||
respdata[i].iActiveNanoSlotNum = n;
|
||||
respdata[i].iNanoID = plr->activeNano;
|
||||
|
||||
int style2 = NanoManager::nanoStyle(plr->activeNano);
|
||||
int style2 = Nanos::nanoStyle(plr->activeNano);
|
||||
if (style2 == -1) { // no nano
|
||||
respdata[i].iHitFlag = 8;
|
||||
respdata[i].iDamage = NanoManager::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||
respdata[i].iDamage = Nanos::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||
} else if (style == style2) {
|
||||
respdata[i].iHitFlag = 8; // tie
|
||||
respdata[i].iDamage = 0;
|
||||
@@ -239,12 +239,12 @@ static void dealCorruption(Mob *mob, std::vector<int> targetData, int skillID, i
|
||||
respdata[i].iNanoStamina = plr->Nanos[plr->activeNano].iStamina = 150;
|
||||
// fire damage power disguised as a corruption attack back at the enemy
|
||||
std::vector<int> targetData2 = {1, mob->appearanceData.iNPC_ID, 0, 0, 0};
|
||||
for (auto& pwr : NanoManager::NanoPowers)
|
||||
for (auto& pwr : Nanos::NanoPowers)
|
||||
if (pwr.skillType == EST_DAMAGE)
|
||||
pwr.handle(sock, targetData2, plr->activeNano, skillID, 0, 200);
|
||||
} else {
|
||||
respdata[i].iHitFlag = 16; // lose
|
||||
respdata[i].iDamage = NanoManager::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||
respdata[i].iDamage = Nanos::SkillTable[skillID].powerIntensity[0] * PC_MAXHEALTH((int)mob->data["m_iNpcLevel"]) / 1500;
|
||||
respdata[i].iNanoStamina = plr->Nanos[plr->activeNano].iStamina -= 90;
|
||||
if (plr->Nanos[plr->activeNano].iStamina < 0) {
|
||||
respdata[i].bNanoDeactive = 1;
|
||||
@@ -305,7 +305,7 @@ static void useAbilities(Mob *mob, time_t currTime) {
|
||||
continue;
|
||||
|
||||
int distance = hypot(mob->hitX - plr->x, mob->hitY - plr->y);
|
||||
if (distance < NanoManager::SkillTable[skillID].effectArea) {
|
||||
if (distance < Nanos::SkillTable[skillID].effectArea) {
|
||||
targetData[0] += 1;
|
||||
targetData[targetData[0]] = plr->iID;
|
||||
if (targetData[0] > 3) // make sure not to have more than 4
|
||||
@@ -315,8 +315,8 @@ static void useAbilities(Mob *mob, time_t currTime) {
|
||||
}
|
||||
|
||||
for (auto& pwr : Combat::MobPowers)
|
||||
if (pwr.skillType == NanoManager::SkillTable[skillID].skillType)
|
||||
pwr.handle(mob, targetData, skillID, NanoManager::SkillTable[skillID].durationTime[0], NanoManager::SkillTable[skillID].powerIntensity[0]);
|
||||
if (pwr.skillType == Nanos::SkillTable[skillID].skillType)
|
||||
pwr.handle(mob, targetData, skillID, Nanos::SkillTable[skillID].durationTime[0], Nanos::SkillTable[skillID].powerIntensity[0]);
|
||||
mob->skillStyle = -3; // eruption cooldown
|
||||
mob->nextAttack = currTime + 1000;
|
||||
return;
|
||||
@@ -336,10 +336,10 @@ static void useAbilities(Mob *mob, time_t currTime) {
|
||||
int skillID = (int)mob->data["m_iActiveSkill1"];
|
||||
std::vector<int> targetData = {1, plr->iID, 0, 0, 0};
|
||||
for (auto& pwr : Combat::MobPowers)
|
||||
if (pwr.skillType == NanoManager::SkillTable[skillID].skillType) {
|
||||
if (pwr.skillType == Nanos::SkillTable[skillID].skillType) {
|
||||
if (pwr.bitFlag != 0 && (plr->iConditionBitFlag & pwr.bitFlag))
|
||||
return; // prevent debuffing a player twice
|
||||
pwr.handle(mob, targetData, skillID, NanoManager::SkillTable[skillID].durationTime[0], NanoManager::SkillTable[skillID].powerIntensity[0]);
|
||||
pwr.handle(mob, targetData, skillID, Nanos::SkillTable[skillID].durationTime[0], Nanos::SkillTable[skillID].powerIntensity[0]);
|
||||
}
|
||||
mob->nextAttack = currTime + (int)mob->data["m_iDelayTime"] * 100;
|
||||
return;
|
||||
@@ -353,7 +353,7 @@ static void useAbilities(Mob *mob, time_t currTime) {
|
||||
pkt.iValue1 = plr->x;
|
||||
pkt.iValue2 = plr->y;
|
||||
pkt.iValue3 = plr->z;
|
||||
mob->skillStyle = NanoManager::nanoStyle(plr->activeNano) - 1;
|
||||
mob->skillStyle = Nanos::nanoStyle(plr->activeNano) - 1;
|
||||
if (mob->skillStyle == -1)
|
||||
mob->skillStyle = 2;
|
||||
if (mob->skillStyle == -2)
|
||||
@@ -394,8 +394,8 @@ void MobAI::enterCombat(CNSocket *sock, Mob *mob) {
|
||||
int skillID = (int)mob->data["m_iPassiveBuff"]; // cast passive
|
||||
std::vector<int> targetData = {1, mob->appearanceData.iNPC_ID, 0, 0, 0};
|
||||
for (auto& pwr : Combat::MobPowers)
|
||||
if (pwr.skillType == NanoManager::SkillTable[skillID].skillType)
|
||||
pwr.handle(mob, targetData, skillID, NanoManager::SkillTable[skillID].durationTime[0], NanoManager::SkillTable[skillID].powerIntensity[0]);
|
||||
if (pwr.skillType == Nanos::SkillTable[skillID].skillType)
|
||||
pwr.handle(mob, targetData, skillID, Nanos::SkillTable[skillID].durationTime[0], Nanos::SkillTable[skillID].powerIntensity[0]);
|
||||
|
||||
for (NPCEvent& event : NPCManager::NPCEvents) // trigger an ON_COMBAT
|
||||
if (event.trigger == ON_COMBAT && event.npcType == mob->appearanceData.iNPCType)
|
||||
@@ -652,7 +652,7 @@ static void roamingStep(Mob *mob, time_t currTime) {
|
||||
|
||||
/*
|
||||
* mob->nextMovement is also updated whenever the path queue is traversed in
|
||||
* TransportManager::stepNPCPathing() (which ticks at a higher frequency than nextMovement),
|
||||
* Transport::stepNPCPathing() (which ticks at a higher frequency than nextMovement),
|
||||
* so we don't have to check if there's already entries in the queue since we know there won't be.
|
||||
*/
|
||||
if (mob->nextMovement != 0 && currTime < mob->nextMovement)
|
||||
@@ -694,9 +694,9 @@ static void roamingStep(Mob *mob, time_t currTime) {
|
||||
WarpLocation from = { mob->appearanceData.iX, mob->appearanceData.iY, mob->appearanceData.iZ };
|
||||
WarpLocation to = { farX, farY, mob->appearanceData.iZ };
|
||||
|
||||
// add a route to the queue; to be processed in TransportManager::stepNPCPathing()
|
||||
TransportManager::lerp(&queue, from, to, speed);
|
||||
TransportManager::NPCQueues[mob->appearanceData.iNPC_ID] = queue;
|
||||
// add a route to the queue; to be processed in Transport::stepNPCPathing()
|
||||
Transport::lerp(&queue, from, to, speed);
|
||||
Transport::NPCQueues[mob->appearanceData.iNPC_ID] = queue;
|
||||
|
||||
if (mob->groupLeader != 0 && mob->groupLeader == mob->appearanceData.iNPC_ID) {
|
||||
// make followers follow this npc.
|
||||
@@ -713,8 +713,8 @@ static void roamingStep(Mob *mob, time_t currTime) {
|
||||
Mob* followerMob = Mobs[mob->groupMember[i]];
|
||||
from = { followerMob->appearanceData.iX, followerMob->appearanceData.iY, followerMob->appearanceData.iZ };
|
||||
to = { farX + followerMob->offsetX, farY + followerMob->offsetY, followerMob->appearanceData.iZ };
|
||||
TransportManager::lerp(&queue2, from, to, speed);
|
||||
TransportManager::NPCQueues[followerMob->appearanceData.iNPC_ID] = queue2;
|
||||
Transport::lerp(&queue2, from, to, speed);
|
||||
Transport::NPCQueues[followerMob->appearanceData.iNPC_ID] = queue2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -757,8 +757,8 @@ static void retreatStep(Mob *mob, time_t currTime) {
|
||||
// cast a return home heal spell, this is the right way(tm)
|
||||
std::vector<int> targetData = {1, 0, 0, 0, 0};
|
||||
for (auto& pwr : Combat::MobPowers)
|
||||
if (pwr.skillType == NanoManager::SkillTable[110].skillType)
|
||||
pwr.handle(mob, targetData, 110, NanoManager::SkillTable[110].durationTime[0], NanoManager::SkillTable[110].powerIntensity[0]);
|
||||
if (pwr.skillType == Nanos::SkillTable[110].skillType)
|
||||
pwr.handle(mob, targetData, 110, Nanos::SkillTable[110].durationTime[0], Nanos::SkillTable[110].powerIntensity[0]);
|
||||
// clear outlying debuffs
|
||||
clearDebuff(mob);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user