1
This commit is contained in:
parent
c59716b96d
commit
6e5e733174
@ -374,6 +374,8 @@ void Bullet::ProcPosionGasBomb(int delay_time)
|
||||
{
|
||||
if (sender.Get()) {
|
||||
#if 1
|
||||
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
|
||||
sender.Get()->buff_vec2_param1 = GetPos();
|
||||
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(gun_meta->i->buffid());
|
||||
if (buff_meta) {
|
||||
sender.Get()->AddBuff(sender.Get(),
|
||||
@ -381,6 +383,7 @@ void Bullet::ProcPosionGasBomb(int delay_time)
|
||||
1
|
||||
);
|
||||
}
|
||||
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||
#else
|
||||
PosionGasMiTask* task = new PosionGasMiTask();
|
||||
task->room = room;
|
||||
|
@ -383,6 +383,7 @@ enum ObstacleType_e
|
||||
kObstacleSelfExplosion = 1,
|
||||
kObstacleMine = 2,
|
||||
kObstacleTrap = 3,
|
||||
kObstaclePosionGas = 4,
|
||||
};
|
||||
|
||||
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
||||
|
@ -21,6 +21,8 @@ void InternalShot(Creature* c,
|
||||
{
|
||||
if (weapon_meta->i->_inventory_slot() == IS_TRAP ||
|
||||
weapon_meta->i->_inventory_slot() == IS_MINE) {
|
||||
a8::Vec2 old_buff_vec2_param1 = c->buff_vec2_param1;
|
||||
c->buff_vec2_param1 = c->GetPos();
|
||||
MetaData::Buff * buff_meta = MetaMgr::Instance()->GetBuff(bullet_meta->i->buffid());
|
||||
if (buff_meta) {
|
||||
c->AddBuff(c,
|
||||
@ -28,6 +30,7 @@ void InternalShot(Creature* c,
|
||||
1
|
||||
);
|
||||
}
|
||||
c->buff_vec2_param1 = old_buff_vec2_param1;
|
||||
return;
|
||||
}
|
||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
||||
@ -843,6 +846,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
case kBET_SummonObstacle:
|
||||
{
|
||||
a8::Vec2 target_pos = caster->GetPos() + caster->skill_dir_ * caster->skill_distance_;
|
||||
target_pos = buff_vec2_param1;
|
||||
SummonObstacle(buff->meta->param1, target_pos);
|
||||
}
|
||||
break;
|
||||
|
@ -47,6 +47,7 @@ class Creature : public MoveableEntity
|
||||
long long poisoning_time = 0;
|
||||
|
||||
Weapon car_weapon;
|
||||
a8::Vec2 buff_vec2_param1;
|
||||
|
||||
bool need_sync_active_player = false;
|
||||
std::function<void ()> on_loading_bullet;
|
||||
|
@ -330,6 +330,11 @@ void RoomObstacle::Active()
|
||||
ActiveTrap();
|
||||
}
|
||||
break;
|
||||
case kObstaclePosionGas:
|
||||
{
|
||||
ActivePosionGas();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -393,3 +398,26 @@ void RoomObstacle::ActiveTrap()
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
|
||||
void RoomObstacle::ActivePosionGas()
|
||||
{
|
||||
room->frame_event.AddExplosionEx
|
||||
(master,
|
||||
0,//task->meta->i->id(),
|
||||
GetPos(),
|
||||
meta->i->explosion_effect());
|
||||
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(
|
||||
SERVER_FRAME_RATE,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->Die(obstacle->room);
|
||||
obstacle->BroadcastFullState(obstacle->room);
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ private:
|
||||
void ActiveSelfExplosion();
|
||||
void ActiveMine();
|
||||
void ActiveTrap();
|
||||
void ActivePosionGas();
|
||||
|
||||
protected:
|
||||
bool temp_through_ = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user