mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-01 23:41:04 +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:
@@ -187,7 +187,7 @@ bool MobAI::aggroCheck(Mob *mob, time_t currTime) {
|
||||
|
||||
int mobRange = mob->sightRange;
|
||||
|
||||
if (plr->iConditionBitFlag & CSB_BIT_UP_STEALTH
|
||||
if (plr->hasBuff(ECSB_UP_STEALTH)
|
||||
|| Racing::EPRaces.find(s) != Racing::EPRaces.end())
|
||||
mobRange /= 3;
|
||||
|
||||
@@ -315,7 +315,7 @@ static void dealCorruption(Mob *mob, std::vector<int> targetData, int skillID, i
|
||||
plr->HP -= respdata[i].iDamage;
|
||||
|
||||
respdata[i].iHP = plr->HP;
|
||||
respdata[i].iConditionBitFlag = plr->iConditionBitFlag;
|
||||
respdata[i].iConditionBitFlag = plr->getCompositeCondition();
|
||||
|
||||
if (plr->HP <= 0) {
|
||||
if (!MobAI::aggroCheck(mob, getTime()))
|
||||
|
||||
Reference in New Issue
Block a user