1
This commit is contained in:
parent
43968dd48c
commit
79801598da
@ -781,6 +781,9 @@ void Buff::ProcDive()
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
if (owner->IsHuman()) {
|
||||
++owner->AsHuman()->stats.diving_times;
|
||||
}
|
||||
}
|
||||
|
||||
void Buff::ProcRemoveDive()
|
||||
|
@ -384,6 +384,10 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int
|
||||
|
||||
void Car::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
||||
{
|
||||
Human* killer = room->GetHumanByUniId(killer_id);
|
||||
if (killer) {
|
||||
++killer->stats.destory_car_times;
|
||||
}
|
||||
dead = true;
|
||||
later_removed_ = true;
|
||||
if (hero_meta_->i->delay_remove() > 0) {
|
||||
@ -527,3 +531,15 @@ void Car::RemoveFromScene()
|
||||
room->RemoveObjectLater(this);
|
||||
room->NotifyUiUpdate();
|
||||
}
|
||||
|
||||
void Car::OnKillTarget(Creature* target)
|
||||
{
|
||||
if (target->IsHuman()) {
|
||||
for (auto passenger : passengers_) {
|
||||
++passenger->stats.ride_car_kills;
|
||||
}
|
||||
if (driver_) {
|
||||
++driver_->stats.ride_car_kills;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ class Car : public Creature
|
||||
virtual void SendDebugMsg(const std::string& debug_msg) override;
|
||||
virtual void SetAttackDir(const a8::Vec2& attack_dir) override;
|
||||
virtual void DropItems(Obstacle* obstacle) override;
|
||||
void OnKillTarget(Creature* target);
|
||||
|
||||
private:
|
||||
int AllocSeat();
|
||||
|
@ -921,6 +921,9 @@ void Creature::DoSkill(int skill_id,
|
||||
}
|
||||
GetTrigger()->UseSkill(skill);
|
||||
DoSkillPostProc(true, skill_id, target_id, target_pos);
|
||||
if (IsHuman()) {
|
||||
++AsHuman()->stats.use_skill_times;
|
||||
}
|
||||
#if 0
|
||||
if (skill_id != TURN_OVER_SKILL_ID) {
|
||||
#else
|
||||
@ -1108,6 +1111,9 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
if (action_type != AT_None) {
|
||||
CancelAction();
|
||||
}
|
||||
if (IsHuman()) {
|
||||
++AsHuman()->stats.use_camouflage_times;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case kBET_BePull:
|
||||
|
@ -2307,6 +2307,7 @@ void Human::DropItems(Obstacle* obstacle)
|
||||
return;
|
||||
}
|
||||
if (room->GetRoomType() == RT_NewBrid && IsPlayer()) {
|
||||
++stats.open_airdrop_times;
|
||||
if (is_treasure_box) {
|
||||
if (box_drop_times_ < MetaMgr::Instance()->newbie_airdrop.size()) {
|
||||
drop_id = MetaMgr::Instance()->newbie_airdrop[box_drop_times_];
|
||||
@ -2772,6 +2773,7 @@ void Human::ProcUseItemAction()
|
||||
switch (action_item_id) {
|
||||
case IS_HEALTHKIT:
|
||||
{
|
||||
+stats.use_medicine_times;
|
||||
AddHp(item_meta->i->heal() * (1 + GetAbility()->GetAttrRate(kHAT_DrugEfficacy)));
|
||||
DecInventory(item_meta->i->_inventory_slot(), 1);
|
||||
GetTrigger()->UseItemAction(action_item_id);
|
||||
@ -2779,6 +2781,7 @@ void Human::ProcUseItemAction()
|
||||
break;
|
||||
case IS_PAIN_KILLER:
|
||||
{
|
||||
+stats.use_medicine_times;
|
||||
if (pain_killer_timer) {
|
||||
int passed_time = (room->GetFrameNo() - pain_killer_frameno) * FRAME_RATE_MS;
|
||||
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
||||
@ -2821,6 +2824,7 @@ void Human::ProcUseItemAction()
|
||||
break;
|
||||
case IS_SHEN_BAO:
|
||||
{
|
||||
+stats.use_medicine_times;
|
||||
if (!dead) {
|
||||
if (downed) {
|
||||
SetHP(MetaMgr::Instance()->GetSysParamAsInt("downed_relive_recover_hp"));
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "skill.h"
|
||||
#include "room.h"
|
||||
#include "human.h"
|
||||
#include "car.h"
|
||||
|
||||
void Trigger::Init()
|
||||
{
|
||||
@ -107,6 +108,9 @@ void Trigger::Kill(Creature* target)
|
||||
owner_->AsHuman()->kill_humans.insert(target->AsHuman());
|
||||
owner_->AsHuman()->SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||
}
|
||||
if (owner_->IsCar()) {
|
||||
owner_->AsCar()->OnKillTarget(target);
|
||||
}
|
||||
++kill_num_;
|
||||
TraverseCondBuffs
|
||||
(kCondBuffKillTarget,
|
||||
|
Loading…
x
Reference in New Issue
Block a user