mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Compare commits
5 Commits
a5ebc15707
...
9ab3a9e248
Author | SHA1 | Date | |
---|---|---|---|
|
9ab3a9e248 | ||
bd0cc3c212 | |||
a14354ca4b | |||
46296b76e9 | |||
1800334bb7 |
@ -76,12 +76,20 @@ static SkillResult handleSkillDamageNDebuff(SkillData* skill, int power, ICombat
|
|||||||
}
|
}
|
||||||
|
|
||||||
sSkillResult_Damage_N_Debuff result{};
|
sSkillResult_Damage_N_Debuff result{};
|
||||||
|
|
||||||
result.iDamage = duration / 10; // we use the duration as the damage number (why?)
|
result.iDamage = duration / 10; // we use the duration as the damage number (why?)
|
||||||
result.iHP = target->getCurrentHP();
|
result.iHP = target->getCurrentHP();
|
||||||
result.eCT = target->getCharType();
|
result.eCT = target->getCharType();
|
||||||
result.iID = target->getID();
|
result.iID = target->getID();
|
||||||
result.bProtected = blocked;
|
result.bProtected = blocked;
|
||||||
result.iConditionBitFlag = target->getCompositeCondition();
|
result.iConditionBitFlag = target->getCompositeCondition();
|
||||||
|
|
||||||
|
// for player targets, make sure to update Nano stamina
|
||||||
|
if (target->getCharType() == 1) {
|
||||||
|
Player *plr = dynamic_cast<Player*>(target);
|
||||||
|
result.iStamina = plr->getActiveNano()->iStamina;
|
||||||
|
}
|
||||||
|
|
||||||
return SkillResult(sizeof(sSkillResult_Damage_N_Debuff), &result);
|
return SkillResult(sizeof(sSkillResult_Damage_N_Debuff), &result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +131,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour
|
|||||||
int combatLifetime = 0;
|
int combatLifetime = 0;
|
||||||
if(!target->addBuff(timeBuffId,
|
if(!target->addBuff(timeBuffId,
|
||||||
[drainType](EntityRef self, Buff* buff, int status, BuffStack* stack) {
|
[drainType](EntityRef self, Buff* buff, int status, BuffStack* stack) {
|
||||||
if(buff->id == ECSB_BOUNDINGBALL) {
|
if(buff->id == ECSB_BOUNDINGBALL && status == ETBU_ADD) {
|
||||||
// drain
|
// drain
|
||||||
ICombatant* combatant = dynamic_cast<ICombatant*>(self.getEntity());
|
ICombatant* combatant = dynamic_cast<ICombatant*>(self.getEntity());
|
||||||
combatant->takeDamage(buff->getLastSource(), 0); // aggro
|
combatant->takeDamage(buff->getLastSource(), 0); // aggro
|
||||||
@ -138,7 +146,7 @@ static SkillResult handleSkillBuff(SkillData* skill, int power, ICombatant* sour
|
|||||||
Buffs::tickDrain(self, buff, COMBAT_TICKS_PER_DRAIN_PROC); // drain
|
Buffs::tickDrain(self, buff, COMBAT_TICKS_PER_DRAIN_PROC); // drain
|
||||||
combatLifetime++;
|
combatLifetime++;
|
||||||
},
|
},
|
||||||
&passiveBuff)) return SkillResult(); // no result if already buffed
|
&passiveBuff)) return SkillResult();
|
||||||
|
|
||||||
sSkillResult_Buff result{};
|
sSkillResult_Buff result{};
|
||||||
result.eCT = target->getCharType();
|
result.eCT = target->getCharType();
|
||||||
|
@ -15,12 +15,12 @@ constexpr size_t MAX_SKILLRESULT_SIZE = sizeof(sSkillResult_BatteryDrain);
|
|||||||
enum class SkillType {
|
enum class SkillType {
|
||||||
DAMAGE = 1,
|
DAMAGE = 1,
|
||||||
HEAL_HP = 2,
|
HEAL_HP = 2,
|
||||||
KNOCKDOWN = 3, // dnd
|
KNOCKDOWN = 3, // uses DamageNDebuff
|
||||||
SLEEP = 4, // dnd
|
SLEEP = 4, // uses DamageNDebuff
|
||||||
SNARE = 5, // dnd
|
SNARE = 5, // uses DamageNDebuff
|
||||||
HEAL_STAMINA = 6,
|
HEAL_STAMINA = 6,
|
||||||
STAMINA_SELF = 7,
|
STAMINA_SELF = 7,
|
||||||
STUN = 8, // dnd
|
STUN = 8, // uses DamageNDebuff
|
||||||
WEAPONSLOW = 9,
|
WEAPONSLOW = 9,
|
||||||
JUMP = 10,
|
JUMP = 10,
|
||||||
RUN = 11,
|
RUN = 11,
|
||||||
|
@ -72,10 +72,10 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
|
|
||||||
// Handle serverside value-changes
|
// Handle serverside value-changes
|
||||||
switch (setData->iSetValueType) {
|
switch (setData->iSetValueType) {
|
||||||
case 1:
|
case CN_GM_SET_VALUE_TYPE__HP:
|
||||||
response.iSetValue = plr->HP = setData->iSetValue;
|
response.iSetValue = plr->HP = setData->iSetValue;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case CN_GM_SET_VALUE_TYPE__WEAPON_BATTERY :
|
||||||
plr->batteryW = setData->iSetValue;
|
plr->batteryW = setData->iSetValue;
|
||||||
|
|
||||||
// caps
|
// caps
|
||||||
@ -84,7 +84,7 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
|
|
||||||
response.iSetValue = plr->batteryW;
|
response.iSetValue = plr->batteryW;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case CN_GM_SET_VALUE_TYPE__NANO_BATTERY:
|
||||||
plr->batteryN = setData->iSetValue;
|
plr->batteryN = setData->iSetValue;
|
||||||
|
|
||||||
// caps
|
// caps
|
||||||
@ -93,13 +93,17 @@ static void setValuePlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
|
|
||||||
response.iSetValue = plr->batteryN;
|
response.iSetValue = plr->batteryN;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case CN_GM_SET_VALUE_TYPE__FUSION_MATTER:
|
||||||
Missions::updateFusionMatter(sock, setData->iSetValue - plr->fusionmatter);
|
Missions::updateFusionMatter(sock, setData->iSetValue - plr->fusionmatter);
|
||||||
response.iSetValue = plr->fusionmatter;
|
response.iSetValue = plr->fusionmatter;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case CN_GM_SET_VALUE_TYPE__CANDY:
|
||||||
response.iSetValue = plr->money = setData->iSetValue;
|
response.iSetValue = plr->money = setData->iSetValue;
|
||||||
break;
|
break;
|
||||||
|
case CN_GM_SET_VALUE_TYPE__SPEED:
|
||||||
|
case CN_GM_SET_VALUE_TYPE__JUMP:
|
||||||
|
response.iSetValue = setData->iSetValue;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
response.iPC_ID = setData->iPC_ID;
|
response.iPC_ID = setData->iPC_ID;
|
||||||
|
@ -175,10 +175,13 @@ void Player::step(time_t currTime) {
|
|||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region CombatNPC
|
#pragma region CombatNPC
|
||||||
bool CombatNPC::addBuff(int buffId, BuffCallback<int, BuffStack*> onUpdate, BuffCallback<time_t> onTick, BuffStack* stack) { /* stubbed */
|
bool CombatNPC::addBuff(int buffId, BuffCallback<int, BuffStack*> onUpdate, BuffCallback<time_t> onTick, BuffStack* stack) {
|
||||||
if(!isAlive())
|
if(!isAlive())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (this->state != AIState::COMBAT && this->state != AIState::ROAMING)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(!hasBuff(buffId)) {
|
if(!hasBuff(buffId)) {
|
||||||
buffs[buffId] = new Buff(buffId, getRef(), onUpdate, onTick, stack);
|
buffs[buffId] = new Buff(buffId, getRef(), onUpdate, onTick, stack);
|
||||||
return true;
|
return true;
|
||||||
@ -189,7 +192,7 @@ bool CombatNPC::addBuff(int buffId, BuffCallback<int, BuffStack*> onUpdate, Buff
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Buff* CombatNPC::getBuff(int buffId) { /* stubbed */
|
Buff* CombatNPC::getBuff(int buffId) {
|
||||||
if(hasBuff(buffId)) {
|
if(hasBuff(buffId)) {
|
||||||
return buffs[buffId];
|
return buffs[buffId];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user