1
This commit is contained in:
parent
af87dfc37e
commit
7254d889a3
@ -376,6 +376,7 @@ enum EventAddBuff_e
|
|||||||
kEventBuffDmgOut = 19,
|
kEventBuffDmgOut = 19,
|
||||||
kEventEnterBattleMode = 20,
|
kEventEnterBattleMode = 20,
|
||||||
kEventLeaveBattleMode = 21,
|
kEventLeaveBattleMode = 21,
|
||||||
|
kEventBeAttack = 22,
|
||||||
kEventBuffEnd
|
kEventBuffEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -432,6 +432,7 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
|
|||||||
only_self);
|
only_self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GetTrigger()->BeAttack(killer_id);
|
||||||
}
|
}
|
||||||
GetTrigger()->HpChg();
|
GetTrigger()->HpChg();
|
||||||
room->OnTeamPartChg(this);
|
room->OnTeamPartChg(this);
|
||||||
|
@ -706,3 +706,20 @@ void Trigger::LeaveBattleMode()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Trigger::BeAttack(int attacker_id)
|
||||||
|
{
|
||||||
|
TraverseCondBuffs
|
||||||
|
(kEventBeAttack,
|
||||||
|
[this] (Buff* buff, bool& stop)
|
||||||
|
{
|
||||||
|
for (int buff_id : buff->meta->_buff_param4_int_list) {
|
||||||
|
if (buff_id > 0) {
|
||||||
|
owner_->TryAddBuff(owner_, buff_id, buff->skill_meta);
|
||||||
|
} else {
|
||||||
|
owner_->ClearBuffById(-buff_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
void EnterCrazeMode();
|
void EnterCrazeMode();
|
||||||
void EnterBattleMode();
|
void EnterBattleMode();
|
||||||
void LeaveBattleMode();
|
void LeaveBattleMode();
|
||||||
|
void BeAttack(int attacker_id);
|
||||||
|
|
||||||
std::weak_ptr<EventHandler> AddListener(int event_id, a8::CommonCbProc cb);
|
std::weak_ptr<EventHandler> AddListener(int event_id, a8::CommonCbProc cb);
|
||||||
void RemoveEventHandler(std::weak_ptr<EventHandler> handler_ptr);
|
void RemoveEventHandler(std::weak_ptr<EventHandler> handler_ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user