1
This commit is contained in:
parent
e776c8a890
commit
a2a919a400
@ -531,6 +531,7 @@ const int ANDROID_AI_ID_START = 10001;
|
|||||||
const int MAX_SKILL_LV = 15;
|
const int MAX_SKILL_LV = 15;
|
||||||
|
|
||||||
const int CHECK_SHOT_HOLD_STATE_TIMER_EVENT = a8::TIMER_USER_EVENT + 1;
|
const int CHECK_SHOT_HOLD_STATE_TIMER_EVENT = a8::TIMER_USER_EVENT + 1;
|
||||||
|
const int SHEN_BAO_ADD_TIME_TIMER_EVENT = a8::TIMER_USER_EVENT + 2;
|
||||||
|
|
||||||
const int kReviveTimeAdd = 12;
|
const int kReviveTimeAdd = 12;
|
||||||
const int kSkinNum = 4;
|
const int kSkinNum = 4;
|
||||||
|
@ -2137,15 +2137,31 @@ void Human::ProcUseItemAction()
|
|||||||
case IS_SHEN_BAO:
|
case IS_SHEN_BAO:
|
||||||
{
|
{
|
||||||
+stats.use_medicine_times;
|
+stats.use_medicine_times;
|
||||||
if (!dead) {
|
if (!shen_bao_timer.expired()) {
|
||||||
if (downed) {
|
a8::Args args({item_meta->time()});
|
||||||
SetHP(mt::Param::s().downed_relive_recover_hp);
|
room->xtimer.FireEvent(shen_bao_timer, SHEN_BAO_ADD_TIME_TIMER_EVENT, &args);
|
||||||
downed = false;
|
} else {
|
||||||
if (!downed_timer.expired()) {
|
int exec_time = 0;
|
||||||
room->xtimer.Delete(downed_timer);
|
int total_time = item_meta->time();
|
||||||
}
|
int heal = item_meta->heal();
|
||||||
}
|
shen_bao_timer = room->xtimer.SetIntervalWpEx
|
||||||
AddHp(item_meta->heal());
|
(
|
||||||
|
SERVER_FRAME_RATE,
|
||||||
|
[this, exec_time, total_time, heal] (int event, const a8::Args* args) mutable
|
||||||
|
{
|
||||||
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
exec_time += 1;
|
||||||
|
if (exec_time >= total_time || dead) {
|
||||||
|
room->xtimer.DeleteCurrentTimer();
|
||||||
|
} else {
|
||||||
|
AddHp(heal);
|
||||||
|
}
|
||||||
|
} else if (SHEN_BAO_ADD_TIME_TIMER_EVENT == event) {
|
||||||
|
total_time += args->Get<int>(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&xtimer_attacher);
|
||||||
|
AddHp(heal);
|
||||||
}
|
}
|
||||||
DecInventory(item_meta->_inventory_slot(), 1);
|
DecInventory(item_meta->_inventory_slot(), 1);
|
||||||
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user