1
This commit is contained in:
parent
b4ec86c3b2
commit
49c8e679ee
@ -934,3 +934,26 @@ void Creature::TouchProperTargets(std::function<void (Creature*, bool&)> func)
|
|||||||
GetGridList(),
|
GetGridList(),
|
||||||
callback);
|
callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::UpdatePoisoning()
|
||||||
|
{
|
||||||
|
if (dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bool need_notify = poisoning_time > 1000;
|
||||||
|
while (poisoning_time > 1000) {
|
||||||
|
if (room->GetGasData().is_last_gas) {
|
||||||
|
DecHP(room->GetGasData().new_area_meta->i->hurt(), VP_SafeArea, TEXT("battle_server_killer_gas", "毒圈"), VW_SafeArea);
|
||||||
|
} else {
|
||||||
|
DecHP(room->GetGasData().old_area_meta->i->hurt(), VP_SafeArea, TEXT("battle_server_killer_gas", "毒圈"), VW_SafeArea);
|
||||||
|
}
|
||||||
|
if (dead) {
|
||||||
|
poisoning_time = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
poisoning_time -= 1000;
|
||||||
|
}
|
||||||
|
if (need_notify && IsEntitySubType(EST_Player)) {
|
||||||
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -62,6 +62,7 @@ class Creature : public MoveableEntity
|
|||||||
void ClearSkill();
|
void ClearSkill();
|
||||||
void AddPassiveSkill(int skill_id);
|
void AddPassiveSkill(int skill_id);
|
||||||
void ClearPassiveSkill();
|
void ClearPassiveSkill();
|
||||||
|
void UpdatePoisoning();
|
||||||
|
|
||||||
bool IsProperTarget(Creature* target);
|
bool IsProperTarget(Creature* target);
|
||||||
bool IsEnemy(Creature* target);
|
bool IsEnemy(Creature* target);
|
||||||
|
@ -38,14 +38,14 @@ HeroAI::~HeroAI()
|
|||||||
void HeroAI::Update(int delta_time)
|
void HeroAI::Update(int delta_time)
|
||||||
{
|
{
|
||||||
Hero* hero = (Hero*)owner;
|
Hero* hero = (Hero*)owner;
|
||||||
#if 0
|
if (hero->poisoning) {
|
||||||
if (hum->poisoning) {
|
hero->poisoning_time += delta_time;
|
||||||
hum->poisoning_time += delta_time;
|
|
||||||
}
|
}
|
||||||
if (hum->poisoning) {
|
if (hero->poisoning) {
|
||||||
hum->UpdatePoisoning();
|
#if 0
|
||||||
|
hero->UpdatePoisoning();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (hero->dead) {
|
if (hero->dead) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -741,29 +741,6 @@ float Human::GetMaxHP()
|
|||||||
return ability.max_hp;
|
return ability.max_hp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::UpdatePoisoning()
|
|
||||||
{
|
|
||||||
if (dead) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bool need_notify = poisoning_time > 1000;
|
|
||||||
while (poisoning_time > 1000) {
|
|
||||||
if (room->GetGasData().is_last_gas) {
|
|
||||||
DecHP(room->GetGasData().new_area_meta->i->hurt(), VP_SafeArea, TEXT("battle_server_killer_gas", "毒圈"), VW_SafeArea);
|
|
||||||
} else {
|
|
||||||
DecHP(room->GetGasData().old_area_meta->i->hurt(), VP_SafeArea, TEXT("battle_server_killer_gas", "毒圈"), VW_SafeArea);
|
|
||||||
}
|
|
||||||
if (dead) {
|
|
||||||
poisoning_time = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
poisoning_time -= 1000;
|
|
||||||
}
|
|
||||||
if (need_notify && IsEntitySubType(EST_Player)) {
|
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::AutoLoadingBullet(bool manual)
|
void Human::AutoLoadingBullet(bool manual)
|
||||||
{
|
{
|
||||||
Weapon* p_weapon = curr_weapon;
|
Weapon* p_weapon = curr_weapon;
|
||||||
|
@ -156,7 +156,6 @@ class Human : public Creature
|
|||||||
float GetRadius();
|
float GetRadius();
|
||||||
float GetHP();
|
float GetHP();
|
||||||
float GetMaxHP();
|
float GetMaxHP();
|
||||||
void UpdatePoisoning();
|
|
||||||
void AutoLoadingBullet(bool manual = false);
|
void AutoLoadingBullet(bool manual = false);
|
||||||
void BeKill(int killer_id, const std::string& killer_name, int weapon_id);
|
void BeKill(int killer_id, const std::string& killer_name, int weapon_id);
|
||||||
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override;
|
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user