1
This commit is contained in:
parent
8937986608
commit
d530ef29da
@ -3,6 +3,7 @@
|
|||||||
#include "guide.h"
|
#include "guide.h"
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
#include "glmhelper.h"
|
||||||
|
|
||||||
#include "mt/GuideStep.h"
|
#include "mt/GuideStep.h"
|
||||||
|
|
||||||
@ -70,7 +71,16 @@ void Guide::ProcMoveTarget()
|
|||||||
[this] (int event, const a8::Args* args)
|
[this] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
if (!curr_step_meta_->_params.empty()) {
|
||||||
|
Position pos;
|
||||||
|
pos.FromGlmVec3(std::get<1>(curr_step_meta_->_params.at(0)));
|
||||||
|
if (owner_->GetPos().Distance2D2(pos) < 5) {
|
||||||
|
owner_->room->xtimer.DeleteCurrentTimer();
|
||||||
|
NextStep();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
NextStep();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
&owner_->xtimer_attacher);
|
&owner_->xtimer_attacher);
|
||||||
@ -78,7 +88,18 @@ void Guide::ProcMoveTarget()
|
|||||||
|
|
||||||
void Guide::ProcMoveTargetAndPickup()
|
void Guide::ProcMoveTargetAndPickup()
|
||||||
{
|
{
|
||||||
|
if (curr_step_meta_->_params.empty()) {
|
||||||
|
NextStep();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (auto& tuple : curr_step_meta_->_params) {
|
||||||
|
owner_->room->CreateLoot(
|
||||||
|
std::get<2>(tuple),
|
||||||
|
std::get<1>(tuple),
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guide::ProcKillEnemy()
|
void Guide::ProcKillEnemy()
|
||||||
@ -99,5 +120,16 @@ void Guide::ProcUseSkill()
|
|||||||
|
|
||||||
void Guide::NextStep()
|
void Guide::NextStep()
|
||||||
{
|
{
|
||||||
|
++curr_step_idx_;
|
||||||
|
if (curr_step_idx_ >= mt::GuideStep::_steps.size()) {
|
||||||
|
owner_->room->frame_event.AddPropChg
|
||||||
|
(
|
||||||
|
owner_->GetWeakPtrRef(),
|
||||||
|
kPropGuideStep,
|
||||||
|
-1,
|
||||||
|
0,
|
||||||
|
true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateStep();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user