34 lines
809 B
C++
34 lines
809 B
C++
#include "precompile.h"
|
|
|
|
#include "buff/autoshot.h"
|
|
|
|
#include "human.h"
|
|
#include "room.h"
|
|
|
|
void AutoShotBuff::Activate()
|
|
{
|
|
owner->room->xtimer.SetIntervalEx
|
|
(
|
|
1,
|
|
[this] (int event, const a8::Args* args)
|
|
{
|
|
if (a8::TIMER_EXEC_EVENT == event) {
|
|
if (owner->IsHuman()) {
|
|
owner->AsHuman()->shot_hold = true;
|
|
owner->AsHuman()->series_shot_frames = 0;
|
|
}
|
|
} else if (a8::TIMER_DELETE_EVENT == event) {
|
|
if (owner->IsHuman()) {
|
|
owner->AsHuman()->shot_hold = false;
|
|
owner->AsHuman()->series_shot_frames = 0;
|
|
}
|
|
}
|
|
},
|
|
&xtimer_attacher);
|
|
}
|
|
|
|
void AutoShotBuff::Deactivate()
|
|
{
|
|
|
|
}
|