mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-30 04:20:06 +00:00
Passive nano powers boilerplate
This commit is contained in:
@@ -71,6 +71,15 @@ int Player::getCurrentHP() {
|
||||
return HP;
|
||||
}
|
||||
|
||||
std::vector<EntityRef> Player::getGroupMembers() {
|
||||
std::vector<EntityRef> members;
|
||||
if(group != nullptr)
|
||||
members = group->members;
|
||||
else
|
||||
members.push_back(PlayerManager::getSockFromID(iID));
|
||||
return members;
|
||||
}
|
||||
|
||||
int32_t Player::getID() {
|
||||
return iID;
|
||||
}
|
||||
@@ -116,6 +125,15 @@ int CombatNPC::getCurrentHP() {
|
||||
return hp;
|
||||
}
|
||||
|
||||
std::vector<EntityRef> CombatNPC::getGroupMembers() {
|
||||
std::vector<EntityRef> members;
|
||||
if(group != nullptr)
|
||||
members = group->members;
|
||||
else
|
||||
members.push_back(id);
|
||||
return members;
|
||||
}
|
||||
|
||||
int32_t CombatNPC::getID() {
|
||||
return id;
|
||||
}
|
||||
@@ -335,7 +353,6 @@ static void dotDamageOnOff(CNSocket *sock, CNPacketData *data) {
|
||||
-1, // infinite
|
||||
sock, // self-inflicted
|
||||
BuffClass::ENVIRONMENT,
|
||||
|
||||
[](EntityRef host, BuffStack* stack) {
|
||||
Buffs::timeBuffUpdate(host, stack, ETBU_ADD);
|
||||
},
|
||||
@@ -724,18 +741,12 @@ static void playerTick(CNServer *serv, time_t currTime) {
|
||||
// nano has skill data
|
||||
SkillData* skill = &Abilities::SkillTable[nano.iSkillID];
|
||||
int boost = Nanos::getNanoBoost(plr);
|
||||
drainRate = skill->batteryUse[boost * 3];
|
||||
std::cout << "[SKILL] id " << nano.iSkillID << ", type " << skill->skillType << ", target " << (int)skill->targetType << std::endl;
|
||||
|
||||
if (skill->drainType == SkillDrainType::PASSIVE) {
|
||||
// apply passive buff
|
||||
std::vector<EntityRef> targets;
|
||||
if (skill->targetType == SkillTargetType::GROUP && plr->group != nullptr)
|
||||
targets = plr->group->members; // group
|
||||
else if(skill->targetType == SkillTargetType::SELF)
|
||||
targets.push_back(sock); // self
|
||||
|
||||
std::cout << "[SKILL] id " << nano.iSkillID << ", type " << skill->skillType << ", target " << (int)skill->targetType << std::endl;
|
||||
// TODO abilities
|
||||
drainRate = skill->batteryUse[boost * 3];
|
||||
Abilities::usePassiveNanoSkill(skill, plr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user