This commit is contained in:
aozhiwei 2019-08-01 16:46:53 +08:00
parent c07f461f26
commit 7aac2662bd
3 changed files with 16 additions and 3 deletions

View File

@ -198,7 +198,9 @@ void AndroidAI::DoAttack()
) { ) {
if (HumMaster()->CanUseSkill() && if (HumMaster()->CanUseSkill() &&
HumMaster()->pos.Distance(enemy->pos) < HumMaster()->tank_meta_->i->atk_range()) { HumMaster()->pos.Distance(enemy->pos) < HumMaster()->tank_meta_->i->atk_range()) {
#if 0
UseSkill(enemy); UseSkill(enemy);
#endif
} else { } else {
Shot(enemy); Shot(enemy);
} }

View File

@ -228,14 +228,14 @@ void FrameEvent::AddHpChg(Human* hum)
void FrameEvent::AddInventoryChg(Human* hum) void FrameEvent::AddInventoryChg(Human* hum)
{ {
chged_inventorys_.push_back(hum); chged_inventorys_.push_back(hum);
int idx = chged_inventorys_.size(); int idx = chged_inventorys_.size() - 1;
hum->chged_inventorys_.push_back(idx); hum->chged_inventorys_.push_back(idx);
} }
void FrameEvent::AddSkillCdChg(Human* hum) void FrameEvent::AddSkillCdChg(Human* hum)
{ {
chged_skillcds_.push_back(hum); chged_skillcds_.push_back(hum);
int idx = chged_skillcds_.size(); int idx = chged_skillcds_.size() - 1;
hum->chged_skillcds_.push_back(idx); hum->chged_skillcds_.push_back(idx);
} }

View File

@ -546,7 +546,11 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, i
android->ai->LockEnemy(last_attacker_id); android->ai->LockEnemy(last_attacker_id);
} }
} }
#if 1
room->frame_event.AddHpChg(this);
#else
SyncAroundPlayers(); SyncAroundPlayers();
#endif
} }
void Human::AddToNewObjects(Entity* entity) void Human::AddToNewObjects(Entity* entity)
@ -633,9 +637,13 @@ void Human::DoSkill()
} }
++stats.use_skill_times; ++stats.use_skill_times;
OnAttack(); OnAttack();
#if 1
room->frame_event.AddSkillCdChg(this);
#else
need_sync_active_player = true;
#endif
} }
use_skill = false; use_skill = false;
need_sync_active_player = true;
} }
void Human::FindLocation() void Human::FindLocation()
@ -854,6 +862,9 @@ void Human::DecInventory(int slot_id, int num)
abort(); abort();
} }
inventory_[slot_id] -= num; inventory_[slot_id] -= num;
if (slot_id == kWEAPON_SLOT) {
room->frame_event.AddInventoryChg(this);
}
} }
int Human::GetVolume(int slot_id) int Human::GetVolume(int slot_id)