Compare commits

..

31 Commits

Author SHA1 Message Date
9b2a65f8fd
[refactor] More buff + skill fixes 2023-10-08 16:43:11 -04:00
6a69388822
Refactor and generalize NPCEvent logic 2023-10-08 16:43:11 -04:00
2924a27eb4
Rename coord args in summonNPC() and constructors to clarify purpose
This makes it clearer that the real coords aren't set until the first
call to updateNPCPosition().
2023-10-08 16:43:11 -04:00
ba20f5a401
Quick fix for Fuse boss fight NPCEvent logic
Will be replaced with a proper rework immediately.
2023-10-08 16:43:11 -04:00
gsemaj
eb88fa05cb
reduce drain tickrate 2023-10-08 16:43:11 -04:00
gsemaj
0b73cef187
Clear player buffs on death if not revived 2023-10-08 16:43:11 -04:00
gsemaj
7af39b3d04
[refactor] Buff + skill bugfixes 2023-10-08 16:43:11 -04:00
gsemaj
33206b1207
Updater contributer guide 2023-10-08 16:43:11 -04:00
gsemaj
e325f7a40b
Implement buff handling for CombatNPC 2023-10-08 16:43:11 -04:00
gsemaj
82bee2051a
[refactor] Active power handling 2023-10-08 16:43:11 -04:00
gsemaj
4ece1bb89b
[refactor] Sync with master
This was initially a merge commit that got ironed out by rebase cleanup.
Notable changes are:
- Copying EntityRef instead of referencing it
- Some changes to includes
2023-10-08 16:41:51 -04:00
gsemaj
31677e2638
[refactor] New buff framework (player implementation)
Get rid of `iConditionBitFlag` in favor of a system of individual buff
objects that get composited to a bitflag on-the-fly.
Buff objects can have callbacks for application, expiration, and tick,
making them pretty flexible. Scripting languages can eventually use
these for custom behavior, too.

TODO:
- Get rid of bitflag in BaseNPC
- Apply buffs from passive nano powers
- Apply buffs from active nano powers
- Move eggs to new system
- ???
2023-10-08 16:34:43 -04:00
gsemaj
d32827b692
The great re-#include
Was getting frustrated by the inconsistency in our include statements,
which were causing me problems. As a result, I went through and manually
re-organized every include statement in non-core files.

I'm just gonna copy my rant from Discord:
FOR HEADER FILES (.hpp):
- everything you use IN THE HEADER must be EXPLICITLY INCLUDED with the exception of things that fall under Core.hpp
- you may NOT include ANYTHING ELSE

FOR SOURCE FILES (.cpp):
- you can #include whatever you want as long as the partner header is included first
- anything that gets included by another include is fair game
- redundant includes are ok because they'll be harmless AS LONG AS our header files stay lean.

the point of this is NOT to optimize the number of includes used all around or make things more efficient necessarily. it's to improve readability & coherence and make it easier to avoid cyclical issues
2023-10-08 16:34:18 -04:00
gsemaj
13c009b448
Get rid of player fire rate suspicion
This was super primitive & jank, and caused false positives.
Will replace with a polished system later on.
2023-10-08 16:34:18 -04:00
gsemaj
a032497bed
Handle case where cmake is invoked outside root 2023-10-08 16:34:18 -04:00
gsemaj
3b6b61d087
[refactor] SkillData additions for buffs 2023-10-08 16:34:18 -04:00
gsemaj
6d760f5bce
Replace group filter operator with function 2023-10-08 16:33:54 -04:00
gsemaj
2a622f901c
Ignore .bak files
for my local backups lol
2023-10-08 16:33:53 -04:00
gsemaj
03d28bf4e4
[refactor] Refactor groups 2023-10-08 16:33:53 -04:00
gsemaj
4b834579c5
[refactor] Remaining ICombatant implementation 2023-10-08 16:33:34 -04:00
gsemaj
07fe8ca367
(WIP) Remove BaseNPC::barkerType to save space 2023-10-08 16:32:49 -04:00
gsemaj
2f3f8a3951
[refactor] Initial ICombatant draft 2023-10-08 16:32:49 -04:00
4f890a9c07
[refactor] Get rid of NPC.hpp
This file was already obsoleted at the start of the refactor, but seems
to have escaped notice until now.
2023-10-08 16:31:53 -04:00
8517e0c7de
[refactor] Replace a few uses of magic numbers with enums 2023-10-08 16:31:53 -04:00
5fb0cbbcf7
[refactor] Cosmetic cleanup in Fuse fight functions 2023-10-08 16:31:53 -04:00
55e9f6531d
[refactor] Remove redundant coord args from most entity constructors
Mobs and CombatNPCs still need theirs in order to properly set their
roaming and spawn coords. Assignment of the latter has been moved to the
CombatNPC constructor, where it should have already been.
2023-10-08 16:31:53 -04:00
gsemaj
7726357fbe
[WIP] Stub power handler 2023-10-08 16:31:53 -04:00
gsemaj
564c275d51
[WIP] Use EntityRef instead of CNSocket in ability handler 2023-10-08 16:31:53 -04:00
gsemaj
3ce9ae5f77
[WIP] Replace appearance data with individual fields
Storing certain things in appearance data and others in their own fields
was gross. Now everything is stored on the same level and functions have
been added to generate appearance data when it's needed by the client.
2023-10-08 16:31:53 -04:00
gsemaj
7c5b9a8105
[WIP] Rename Entity.type -> Entity.kind 2023-10-08 16:31:53 -04:00
gsemaj
258ff35e20
[WIP] Initial merge of ability namespaces & features 2023-10-08 16:31:53 -04:00

View File

@ -359,19 +359,23 @@ static void npcRotateCommand(std::string full, std::vector<std::string>& args, C
int angle = (plr->angle + 180) % 360; int angle = (plr->angle + 180) % 360;
NPCManager::updateNPCPosition(npc->id, npc->x, npc->y, npc->z, npc->instanceID, angle); NPCManager::updateNPCPosition(npc->id, npc->x, npc->y, npc->z, npc->instanceID, angle);
bool isGruntworkNpc = true; // if it's a gruntwork NPC, rotate in-place
if (TableData::RunningMobs.find(npc->id) != TableData::RunningMobs.end()) {
NPCManager::updateNPCPosition(npc->id, npc->x, npc->y, npc->z, npc->instanceID, angle);
// add a rotation entry to the gruntwork file, unless it's already a gruntwork NPC Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) + " for gruntwork NPC "
if (TableData::RunningMobs.find(npc->id) == TableData::RunningMobs.end()) { + std::to_string(npc->id));
} else {
TableData::RunningNPCRotations[npc->id] = angle; TableData::RunningNPCRotations[npc->id] = angle;
isGruntworkNpc = false;
Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) + " for NPC "
+ std::to_string(npc->id));
} }
Chat::sendServerMessage(sock, "[NPCR] Successfully set angle to " + std::to_string(angle) + // update rotation clientside
" for " + (isGruntworkNpc ? "gruntwork " : "") + "NPC " + std::to_string(npc->id)); INITSTRUCT(sP_FE2CL_NPC_ENTER, pkt);
pkt.NPCAppearanceData = npc->getAppearanceData();
// update rotation clientside by refreshing the player's chunks (same as the /refresh command) sock->sendPacket(pkt, P_FE2CL_NPC_ENTER);
PlayerManager::updatePlayerPositionForWarp(sock, plr->x, plr->y, plr->z, plr->instanceID);
} }
static void refreshCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) { static void refreshCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {