mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-30 12:30:06 +00:00
[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 - ???
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "Missions.hpp"
|
||||
#include "Eggs.hpp"
|
||||
#include "Items.hpp"
|
||||
#include "Abilities.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <limits.h>
|
||||
@@ -501,9 +502,12 @@ static void buffCommand(std::string full, std::vector<std::string>& args, CNSock
|
||||
if (*tmp)
|
||||
return;
|
||||
|
||||
if (Eggs::eggBuffPlayer(sock, skillId, 0, duration)<0)
|
||||
if (Abilities::SkillTable.count(skillId) == 0) {
|
||||
Chat::sendServerMessage(sock, "/buff: unknown skill Id");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Eggs::eggBuffPlayer(sock, skillId, 0, duration);
|
||||
}
|
||||
|
||||
static void eggCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
|
||||
Reference in New Issue
Block a user