Group Heal Range Limit

This commit is contained in:
Jade 2020-11-25 00:16:06 +00:00 committed by Gent S
parent 26ca4d8671
commit 166eb5125f
4 changed files with 20 additions and 6 deletions

View File

@ -398,14 +398,14 @@ int MissionManager::giveMissionReward(CNSocket *sock, int task) {
plr->money += reward->money;
if (plr->iConditionBitFlag & CSB_BIT_REWARD_CASH) { // nano boost for taros
int boost = 0;
if (NanoManager::getNanoBoost(plr))
if (NanoManager::getNanoBoost(plr)) // for gumballs
boost = 1;
plr->money += reward->money * (5 + boost) / 25;
}
if (plr->iConditionBitFlag & CSB_BIT_REWARD_BLOB) { // nano boost for fm
int boost = 0;
if (NanoManager::getNanoBoost(plr))
if (NanoManager::getNanoBoost(plr)) // for gumballs
boost = 1;
updateFusionMatter(sock, reward->fusionmatter * (30 + boost) / 25);
} else

View File

@ -536,9 +536,22 @@ int* NanoManager::findTargets(Player* plr, int skillID, CNPacketData* data) {
if (otherPlr == nullptr)
return tD;
tD[0] = otherPlr->groupCnt;
for (int i = 0; i < otherPlr->groupCnt; i++)
tD[i+1] = otherPlr->groupIDs[i];
if (SkillTable[skillID].effectArea == 0) { // for buffs
tD[0] = otherPlr->groupCnt;
for (int i = 0; i < otherPlr->groupCnt; i++)
tD[i+1] = otherPlr->groupIDs[i];
return tD;
}
for (int i = 0; i < otherPlr->groupCnt; i++) { // group heals have an area limit
Player *otherPlr2 = PlayerManager::getPlayerFromID(otherPlr->groupIDs[i]);
if (otherPlr2 == nullptr)
continue;
if (hypot(otherPlr2->x - plr->x, otherPlr2->y - plr->y) < SkillTable[skillID].effectArea) {
tD[i+1] = otherPlr->groupIDs[i];
tD[0] += 1;
}
}
}
return tD;

View File

@ -36,6 +36,7 @@ struct SkillData {
int skillType;
int targetType;
int drainType;
int effectArea;
int batteryUse[4];
int durationTime[4];
int powerIntensity[4];

View File

@ -195,7 +195,7 @@ void TableData::init() {
for (nlohmann::json::iterator _skills = skills.begin(); _skills != skills.end(); _skills++) {
auto skills = _skills.value();
SkillData skillData = {skills["m_iSkillType"], skills["m_iTargetType"], skills["m_iBatteryDrainType"]};
SkillData skillData = {skills["m_iSkillType"], skills["m_iTargetType"], skills["m_iBatteryDrainType"], skills["m_iEffectArea"]};
for (int i = 0; i < 4; i++) {
skillData.batteryUse[i] = skills["m_iBatteryDrainUse"][i];
skillData.durationTime[i] = skills["m_iDurationTime"][i];