Skip to content

Commit f3276a2

Browse files
authored
Merge pull request LandSandBoat#10366 from LandSandBoat/tidy_entities
Core: Rename entity files (charentity.h -> char_entity.h, etc.)
2 parents ddf2e57 + 7a88325 commit f3276a2

388 files changed

Lines changed: 1138 additions & 933 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/tools/packetcap/packetcap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
************************************************************************/
1414

1515
#include "common/settings.h"
16-
#include "map/entities/charentity.h"
16+
#include "map/entities/char_entity.h"
1717
#include "map/packets/basic.h"
1818
#include "map/utils/moduleutils.h"
1919

src/common/mmo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include <cstring>
3232
#include <string>
3333

34+
//
35+
// Types inferred or reversed from the client
36+
//
37+
3438
#define FFXI_HEADER_SIZE 0x1C // common packet header size
3539

3640
// For filters1_t, filters2_t and SAVE_CONF:

src/map/ability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "common/cbasetypes.h"
2626

27-
#include "entities/battleentity.h"
27+
#include "entities/battle_entity.h"
2828
#include "enums/action/animation.h"
2929
#include "enums/recast.h"
3030
#include "status_effect.h"

src/map/action/action.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#pragma once
2323

2424
#include "common/cbasetypes.h"
25-
#include "entities/battleentity.h"
25+
#include "entities/battle_entity.h"
2626
#include "enums/action/animation.h"
2727
#include "enums/action/category.h"
2828
#include "enums/action/hit_distortion.h"

src/map/ai/ai_container.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
#include "ai/controllers/mob_controller.h"
2525
#include "ai/controllers/pet_controller.h"
2626
#include "ai/controllers/player_controller.h"
27-
#include "entities/baseentity.h"
28-
#include "entities/battleentity.h"
29-
#include "entities/charentity.h"
30-
#include "entities/mobentity.h"
27+
#include "entities/base_entity.h"
28+
#include "entities/battle_entity.h"
29+
#include "entities/char_entity.h"
30+
#include "entities/mob_entity.h"
3131
#include "packets/s2c/0x038_schedulor.h"
3232
#include "states/ability_state.h"
3333
#include "states/attack_state.h"

src/map/ai/ai_container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <stack>
2727

2828
#include "ai/controllers/controller.h"
29-
#include "entities/baseentity.h"
29+
#include "entities/base_entity.h"
3030
#include "helpers/action_queue.h"
3131
#include "helpers/event_handler.h"
3232
#include "helpers/pathfind.h"

src/map/ai/controllers/automaton_controller.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "common/database.h"
2929
#include "common/utils.h"
3030
#include "enmity_container.h"
31-
#include "entities/trustentity.h"
31+
#include "entities/trust_entity.h"
3232
#include "enums/automaton.h"
3333
#include "lua/luautils.h"
3434
#include "mob_spell_container.h"
@@ -53,11 +53,11 @@ CAutomatonController::CAutomatonController(CAutomatonEntity* PPet)
5353

5454
void CAutomatonController::setCooldowns()
5555
{
56-
switch (PAutomaton->getFrame())
56+
switch (PAutomaton->frame())
5757
{
5858
case AutomatonFrame::Sharpshot:
5959
{
60-
switch (PAutomaton->getHead())
60+
switch (PAutomaton->head())
6161
{
6262
case AutomatonHead::Sharpshot:
6363
m_rangedCooldown = 20s;
@@ -90,7 +90,7 @@ void CAutomatonController::setCooldowns()
9090
// New retail Automaton magic AI (Needs more information to accurately recreate)
9191
void CAutomatonController::setMagicCooldowns()
9292
{
93-
switch (PAutomaton->getHead())
93+
switch (PAutomaton->head())
9494
{
9595
case AutomatonHead::Harlequin:
9696
{
@@ -156,11 +156,11 @@ auto CAutomatonController::shouldStandBack() const -> bool
156156
return true;
157157
}
158158
}
159-
else if (PAutomaton->getFrame() == AutomatonFrame::Valoredge)
159+
else if (PAutomaton->frame() == AutomatonFrame::Valoredge)
160160
{
161161
return false;
162162
}
163-
else if (PAutomaton->getHead() >= AutomatonHead::Sharpshot)
163+
else if (PAutomaton->head() >= AutomatonHead::Sharpshot)
164164
{
165165
return true;
166166
}
@@ -278,7 +278,7 @@ auto CAutomatonController::TrySpellcast(const CurrentManeuvers& maneuvers) -> bo
278278
return false;
279279
}
280280

281-
switch (PAutomaton->getHead())
281+
switch (PAutomaton->head())
282282
{
283283
case AutomatonHead::Valoredge:
284284
{
@@ -508,7 +508,7 @@ auto CAutomatonController::TryHeal(const CurrentManeuvers& maneuvers) -> bool
508508
}
509509
}
510510

511-
if (maneuvers.light && !PCastTarget && PAutomaton->getHead() == AutomatonHead::Soulsoother && PAutomaton->PMaster->PParty) // Light + Soulsoother head -> Heal party
511+
if (maneuvers.light && !PCastTarget && PAutomaton->head() == AutomatonHead::Soulsoother && PAutomaton->PMaster->PParty) // Light + Soulsoother head -> Heal party
512512
{
513513
// clang-format off
514514
if (PMob)
@@ -632,7 +632,7 @@ auto CAutomatonController::TryElemental(const CurrentManeuvers& maneuvers) -> bo
632632
castPriority.emplace_back(res.first);
633633
}
634634
}
635-
else if (PAutomaton->getHead() == AutomatonHead::Spiritreaver)
635+
else if (PAutomaton->head() == AutomatonHead::Spiritreaver)
636636
{
637637
if (maneuvers.thunder)
638638
{ // Thunder -> Thunder spells
@@ -725,7 +725,7 @@ auto CAutomatonController::TryEnfeeble(const CurrentManeuvers& maneuvers) -> boo
725725
std::vector<SpellID> castPriority;
726726
std::vector<SpellID> defaultPriority;
727727

728-
switch (PAutomaton->getHead())
728+
switch (PAutomaton->head())
729729
{
730730
case AutomatonHead::Stormwaker:
731731
{
@@ -1137,7 +1137,7 @@ auto CAutomatonController::TryStatusRemoval(const CurrentManeuvers& maneuvers) -
11371137
}
11381138
}
11391139

1140-
if (maneuvers.water && PAutomaton->getHead() == AutomatonHead::Soulsoother && PAutomaton->PMaster->PParty) // Water + Soulsoother head -> Remove party's statuses
1140+
if (maneuvers.water && PAutomaton->head() == AutomatonHead::Soulsoother && PAutomaton->PMaster->PParty) // Water + Soulsoother head -> Remove party's statuses
11411141
{
11421142
for (auto member : PAutomaton->PMaster->PParty->members)
11431143
{
@@ -1179,7 +1179,7 @@ auto CAutomatonController::TryEnhance() -> bool
11791179
return false;
11801180
}
11811181

1182-
if (PAutomaton->getHead() == AutomatonHead::Spiritreaver)
1182+
if (PAutomaton->head() == AutomatonHead::Spiritreaver)
11831183
{
11841184
return Cast(PAutomaton->targid, SpellID::Dread_Spikes);
11851185
}
@@ -1500,7 +1500,7 @@ auto CAutomatonController::TryTPMove() -> bool
15001500
// load the skills that the automaton has access to with it's skill
15011501
SKILLTYPE skilltype = SKILL_AUTOMATON_MELEE;
15021502

1503-
if (PAutomaton->getFrame() == AutomatonFrame::Sharpshot)
1503+
if (PAutomaton->frame() == AutomatonFrame::Sharpshot)
15041504
{
15051505
skilltype = SKILL_AUTOMATON_RANGED;
15061506
}
@@ -1584,9 +1584,9 @@ auto CAutomatonController::TryTPMove() -> bool
15841584

15851585
auto CAutomatonController::TryRangedAttack() -> bool // TODO: Find the animation for its ranged attack
15861586
{
1587-
if (PAutomaton->getFrame() == AutomatonFrame::Sharpshot)
1587+
if (PAutomaton->frame() == AutomatonFrame::Sharpshot)
15881588
{
1589-
timer::duration minDelay = PAutomaton->getHead() == AutomatonHead::Sharpshot ? 5s : 10s;
1589+
timer::duration minDelay = PAutomaton->head() == AutomatonHead::Sharpshot ? 5s : 10s;
15901590
timer::duration attackTime = m_rangedCooldown - std::chrono::seconds(PAutomaton->getMod(Mod::AUTO_RANGED_DELAY));
15911591

15921592
if (m_rangedCooldown > 0s && m_Tick > m_LastRangedTime + std::max(attackTime, minDelay))
@@ -1700,7 +1700,7 @@ void LoadAutomatonSpellList()
17001700
bool CanUseSpell(CAutomatonEntity* PCaster, SpellID spellid)
17011701
{
17021702
const AutomatonSpell& PSpell = autoSpellList[spellid];
1703-
return ((PCaster->GetSkill(SKILL_AUTOMATON_MAGIC) >= PSpell.skilllevel) && (PSpell.heads & (1 << ((uint8)PCaster->getHead() - 1))));
1703+
return ((PCaster->GetSkill(SKILL_AUTOMATON_MAGIC) >= PSpell.skilllevel) && (PSpell.heads & (1 << ((uint8)PCaster->head() - 1))));
17041704
}
17051705

17061706
bool CanUseEnfeeble(CBattleEntity* PTarget, SpellID spell)

src/map/ai/controllers/automaton_controller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <common/types/maybe.h>
2525

26-
#include "entities/automatonentity.h"
26+
#include "entities/automaton_entity.h"
2727

2828
#include "pet_controller.h"
2929
#include "spell.h"

src/map/ai/controllers/controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "controller.h"
2323

2424
#include "ai/ai_container.h"
25-
#include "entities/battleentity.h"
25+
#include "entities/battle_entity.h"
2626

2727
CController::CController(CBattleEntity* _POwner)
2828
: m_Tick(timer::now())

src/map/ai/controllers/mob_controller.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "battlefield.h"
3232
#include "common/utils.h"
3333
#include "enmity_container.h"
34-
#include "entities/mobentity.h"
34+
#include "entities/mob_entity.h"
3535
#include "mob_modifier.h"
3636
#include "mob_spell_container.h"
3737
#include "mobskill.h"
@@ -219,9 +219,9 @@ void CMobController::TryLink()
219219
{
220220
const auto PPetEntity = static_cast<CPetEntity*>(PTarget->PPet);
221221
if (PPetEntity->getPetType() == PET_TYPE::AVATAR &&
222-
PPetEntity->m_PetID != PETID_ALEXANDER &&
223-
PPetEntity->m_PetID != PETID_ODIN &&
224-
PPetEntity->m_PetID != PETID_ATOMOS)
222+
PPetEntity->petID() != PETID_ALEXANDER &&
223+
PPetEntity->petID() != PETID_ODIN &&
224+
PPetEntity->petID() != PETID_ATOMOS)
225225
{
226226
if (PTarget->objtype == TYPE_PC)
227227
{

0 commit comments

Comments
 (0)