1
This commit is contained in:
parent
52144aacad
commit
b4f4b9cdfd
@ -503,6 +503,9 @@ void Creature::DoSkill(int skill_id,
|
||||
skill_target_id_ = GetEntityUniId();
|
||||
}
|
||||
if (CurrentSkill()->meta->i->skill_target() == kST_SpecDir) {
|
||||
std::set<Creature*> target_list;
|
||||
SelectSkillTargets(CurrentSkill(), GetPos(), target_list);
|
||||
TriggerBuff(CurrentSkill(), target_list, kBTT_UseSkill);
|
||||
UpdateSkill();
|
||||
} else {
|
||||
Entity* entity = room->GetEntityByUniId(skill_target_id_);
|
||||
|
@ -264,6 +264,14 @@ void RoomObstacle::Explosion()
|
||||
}
|
||||
}
|
||||
|
||||
void RoomObstacle::SpecExplosion()
|
||||
{
|
||||
++explosion_times_;
|
||||
if (explosion_times_ >= meta->i->explosion_times()) {
|
||||
room->xtimer.DeleteTimer(room->xtimer.GetRunningTimer());
|
||||
}
|
||||
}
|
||||
|
||||
void RoomObstacle::Active()
|
||||
{
|
||||
switch (meta->i->thing_type()) {
|
||||
@ -277,7 +285,18 @@ void RoomObstacle::Active()
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->Explosion();
|
||||
obstacle->room->xtimer.AddRepeatTimerAndAttach
|
||||
(
|
||||
obstacle->meta->i->explosion_interval() / FRAME_RATE_MS,
|
||||
a8::XParams()
|
||||
.SetSender(obstacle),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->SpecExplosion();
|
||||
},
|
||||
&obstacle->xtimer_attacher.timer_list_
|
||||
);
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
|
@ -24,10 +24,12 @@ class RoomObstacle : public Obstacle
|
||||
|
||||
private:
|
||||
void Explosion();
|
||||
void SpecExplosion();
|
||||
|
||||
protected:
|
||||
bool temp_through_ = false;
|
||||
std::set<GridCell*>* grid_list_ = nullptr;
|
||||
int explosion_times_ = 0;
|
||||
|
||||
RoomObstacle();
|
||||
|
||||
|
@ -115,6 +115,11 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std:
|
||||
target_list.insert(this);
|
||||
}
|
||||
break;
|
||||
case kST_SpecDir:
|
||||
{
|
||||
target_list.insert(this);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ message MapThing
|
||||
optional int32 house_id = 13; //房间id
|
||||
optional string buff_list = 14;
|
||||
optional int32 explosion_effect = 15;
|
||||
optional int32 explosion_interval = 18;
|
||||
optional int32 explosion_times = 19;
|
||||
}
|
||||
|
||||
message SafeArea
|
||||
|
Loading…
x
Reference in New Issue
Block a user