mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Group Heal Range Limit
This commit is contained in:
parent
26ca4d8671
commit
166eb5125f
@ -398,14 +398,14 @@ int MissionManager::giveMissionReward(CNSocket *sock, int task) {
|
|||||||
plr->money += reward->money;
|
plr->money += reward->money;
|
||||||
if (plr->iConditionBitFlag & CSB_BIT_REWARD_CASH) { // nano boost for taros
|
if (plr->iConditionBitFlag & CSB_BIT_REWARD_CASH) { // nano boost for taros
|
||||||
int boost = 0;
|
int boost = 0;
|
||||||
if (NanoManager::getNanoBoost(plr))
|
if (NanoManager::getNanoBoost(plr)) // for gumballs
|
||||||
boost = 1;
|
boost = 1;
|
||||||
plr->money += reward->money * (5 + boost) / 25;
|
plr->money += reward->money * (5 + boost) / 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plr->iConditionBitFlag & CSB_BIT_REWARD_BLOB) { // nano boost for fm
|
if (plr->iConditionBitFlag & CSB_BIT_REWARD_BLOB) { // nano boost for fm
|
||||||
int boost = 0;
|
int boost = 0;
|
||||||
if (NanoManager::getNanoBoost(plr))
|
if (NanoManager::getNanoBoost(plr)) // for gumballs
|
||||||
boost = 1;
|
boost = 1;
|
||||||
updateFusionMatter(sock, reward->fusionmatter * (30 + boost) / 25);
|
updateFusionMatter(sock, reward->fusionmatter * (30 + boost) / 25);
|
||||||
} else
|
} else
|
||||||
|
@ -536,9 +536,22 @@ int* NanoManager::findTargets(Player* plr, int skillID, CNPacketData* data) {
|
|||||||
if (otherPlr == nullptr)
|
if (otherPlr == nullptr)
|
||||||
return tD;
|
return tD;
|
||||||
|
|
||||||
tD[0] = otherPlr->groupCnt;
|
if (SkillTable[skillID].effectArea == 0) { // for buffs
|
||||||
for (int i = 0; i < otherPlr->groupCnt; i++)
|
tD[0] = otherPlr->groupCnt;
|
||||||
tD[i+1] = otherPlr->groupIDs[i];
|
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;
|
return tD;
|
||||||
|
@ -36,6 +36,7 @@ struct SkillData {
|
|||||||
int skillType;
|
int skillType;
|
||||||
int targetType;
|
int targetType;
|
||||||
int drainType;
|
int drainType;
|
||||||
|
int effectArea;
|
||||||
int batteryUse[4];
|
int batteryUse[4];
|
||||||
int durationTime[4];
|
int durationTime[4];
|
||||||
int powerIntensity[4];
|
int powerIntensity[4];
|
||||||
|
@ -195,7 +195,7 @@ void TableData::init() {
|
|||||||
|
|
||||||
for (nlohmann::json::iterator _skills = skills.begin(); _skills != skills.end(); _skills++) {
|
for (nlohmann::json::iterator _skills = skills.begin(); _skills != skills.end(); _skills++) {
|
||||||
auto skills = _skills.value();
|
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++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
skillData.batteryUse[i] = skills["m_iBatteryDrainUse"][i];
|
skillData.batteryUse[i] = skills["m_iBatteryDrainUse"][i];
|
||||||
skillData.durationTime[i] = skills["m_iDurationTime"][i];
|
skillData.durationTime[i] = skills["m_iDurationTime"][i];
|
||||||
|
Loading…
Reference in New Issue
Block a user