1
This commit is contained in:
parent
81bb49b96a
commit
ffc4772a97
@ -42,7 +42,7 @@ enum BuffEffectType_e
|
||||
kBET_Jump = 25, //跳伞中
|
||||
kBET_IntervalAddBuff = 26, //持续掉血
|
||||
//kBET_LastAddHp = 27, //持续加血
|
||||
//kBET_OnceAddHp = 28, //加血
|
||||
kBET_OnceAddHp = 28, //加血
|
||||
kBET_SummonHero = 29, //召唤英雄
|
||||
//kBET_SummonHero = 30, //向前跳跃
|
||||
kBET_Shield = 31, //护盾
|
||||
|
@ -868,6 +868,11 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
buff->ProcIntervalAddBuff(caster);
|
||||
}
|
||||
break;
|
||||
case kBET_OnceAddHp:
|
||||
{
|
||||
AddHp(buff->meta->param1);
|
||||
}
|
||||
break;
|
||||
case kBET_SummonHero:
|
||||
{
|
||||
SummonHero(buff,
|
||||
@ -1766,3 +1771,16 @@ void Creature::GetHitEnemys(std::set<Creature*>& enemys)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Creature::AddHp(float hp)
|
||||
{
|
||||
float old_health = GetHP();
|
||||
ability.hp += hp;
|
||||
ability.hp = std::min(GetHP(), GetMaxHP());
|
||||
if (IsHuman()) {
|
||||
Human* hum = (Human*)this;
|
||||
hum->stats.heal_amount += GetHP() - old_health;
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,7 @@ class Creature : public MoveableEntity
|
||||
bool IsAndroid() const;
|
||||
bool IsHuman() const;
|
||||
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) {};
|
||||
void AddHp(float hp);
|
||||
|
||||
RaceType_e GetRace() { return race_; }
|
||||
float GetAttrAbs(int attr_id);
|
||||
|
@ -3653,15 +3653,6 @@ void Human::GMAddItem(int item_id, int item_num)
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
||||
void Human::AddHp(float hp)
|
||||
{
|
||||
float old_health = GetHP();
|
||||
ability.hp += hp;
|
||||
ability.hp = std::min(GetHP(), GetMaxHP());
|
||||
stats.heal_amount += GetHP() - old_health;
|
||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
|
||||
void Human::OnBulletHit(Bullet* bullet)
|
||||
{
|
||||
if (IsInvincible()) {
|
||||
|
@ -253,7 +253,6 @@ class Human : public Creature
|
||||
virtual std::string GetName() override { return name;};
|
||||
void UpdateViewObjects();
|
||||
void GMAddItem(int item_id, int item_num);
|
||||
void AddHp(float hp);
|
||||
|
||||
protected:
|
||||
void _InternalUpdateMove(float speed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user