1
This commit is contained in:
parent
a3b6a8fbbb
commit
58dc4db50b
@ -149,12 +149,17 @@ void Bullet::ProcBomb()
|
|||||||
ProcC4Bomb(delay_time);
|
ProcC4Bomb(delay_time);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case IS_SINGAL_GUN:
|
||||||
|
{
|
||||||
|
ProcSignalGunBomb(delay_time);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
room->RemoveObjectLater(this);
|
room->RemoveObjectLater(this);
|
||||||
|
later_removed_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::ProcSmokeBomb()
|
void Bullet::ProcSmokeBomb()
|
||||||
@ -203,11 +208,15 @@ bool Bullet::IsBomb()
|
|||||||
meta->i->_inventory_slot() == IS_SMOKE ||
|
meta->i->_inventory_slot() == IS_SMOKE ||
|
||||||
meta->i->_inventory_slot() == IS_POSION_GAS_BOMB ||
|
meta->i->_inventory_slot() == IS_POSION_GAS_BOMB ||
|
||||||
meta->i->_inventory_slot() == IS_MOLOTOR_COCKTAIL ||
|
meta->i->_inventory_slot() == IS_MOLOTOR_COCKTAIL ||
|
||||||
meta->i->_inventory_slot() == IS_C4;
|
meta->i->_inventory_slot() == IS_C4 ||
|
||||||
|
meta->i->_inventory_slot() == IS_SINGAL_GUN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::MapServiceUpdate()
|
void Bullet::MapServiceUpdate()
|
||||||
{
|
{
|
||||||
|
if (later_removed_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (sender.Get()) {
|
if (sender.Get()) {
|
||||||
SetPos(GetPos() + dir * gun_meta->i->bullet_speed() / (float)SERVER_FRAME_RATE);
|
SetPos(GetPos() + dir * gun_meta->i->bullet_speed() / (float)SERVER_FRAME_RATE);
|
||||||
float distance = (GetPos() - born_pos).Norm();
|
float distance = (GetPos() - born_pos).Norm();
|
||||||
@ -218,6 +227,7 @@ void Bullet::MapServiceUpdate()
|
|||||||
Check(distance);
|
Check(distance);
|
||||||
if (!later_removed_) {
|
if (!later_removed_) {
|
||||||
room->RemoveObjectLater(this);
|
room->RemoveObjectLater(this);
|
||||||
|
later_removed_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -380,3 +390,20 @@ void Bullet::ProcC4Bomb(int delay_time)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bullet::ProcSignalGunBomb(int delay_time)
|
||||||
|
{
|
||||||
|
printf("%d xxxxxx\n",this);
|
||||||
|
if (sender.Get()) {
|
||||||
|
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(),
|
||||||
|
buff_meta,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
void ProcPosionGasBomb(int delay_time);
|
void ProcPosionGasBomb(int delay_time);
|
||||||
void ProcMolotorCocktailBomb(int delay_time);
|
void ProcMolotorCocktailBomb(int delay_time);
|
||||||
void ProcC4Bomb(int delay_time);
|
void ProcC4Bomb(int delay_time);
|
||||||
|
void ProcSignalGunBomb(int delay_time);
|
||||||
inline void MapServiceUpdate();
|
inline void MapServiceUpdate();
|
||||||
void Check(float distance);
|
void Check(float distance);
|
||||||
|
|
||||||
|
@ -335,6 +335,7 @@ enum ObstacleType_e
|
|||||||
kObstacleSpring = 5,
|
kObstacleSpring = 5,
|
||||||
kObstacleHideHouse = 6,
|
kObstacleHideHouse = 6,
|
||||||
kObstacleGully = 7,
|
kObstacleGully = 7,
|
||||||
|
kObstacleAirDropBox = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
||||||
|
@ -155,6 +155,14 @@ namespace MetaData
|
|||||||
a8::SetBitFlag(receive_special_damage_type, n);
|
a8::SetBitFlag(receive_special_damage_type, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
int_param1 = a8::XValue(i->param1());
|
||||||
|
float_param1 = a8::XValue(i->param1()).GetDouble();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
int_param2 = a8::XValue(i->param2());
|
||||||
|
float_param2 = a8::XValue(i->param2()).GetDouble();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Equip::Init()
|
void Equip::Init()
|
||||||
|
@ -47,6 +47,10 @@ namespace MetaData
|
|||||||
std::vector<int> airdrop_mon_list;
|
std::vector<int> airdrop_mon_list;
|
||||||
long long special_damage_type = 0;
|
long long special_damage_type = 0;
|
||||||
long long receive_special_damage_type = 0;
|
long long receive_special_damage_type = 0;
|
||||||
|
int int_param1 = 0;
|
||||||
|
float float_param1 = 0;
|
||||||
|
int int_param2 = 0;
|
||||||
|
float float_param2 = 0;
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
};
|
};
|
||||||
|
@ -364,6 +364,11 @@ void RoomObstacle::Active()
|
|||||||
ActiveGully();
|
ActiveGully();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kObstacleAirDropBox:
|
||||||
|
{
|
||||||
|
ActiveAirDrop();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -506,6 +511,36 @@ void RoomObstacle::ActiveGully()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RoomObstacle::ActiveAirDrop()
|
||||||
|
{
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(
|
||||||
|
meta->int_param2 / FRAME_RATE_MS,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||||
|
obstacle->SummonAirDropBox(obstacle->meta->int_param1);
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
|
(
|
||||||
|
meta->int_param2 / FRAME_RATE_MS * 1,
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(this),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||||
|
obstacle->room->frame_event.AddAirDrop(obstacle->meta->int_param2 / 1000,
|
||||||
|
obstacle->meta->int_param1,
|
||||||
|
obstacle->GetPos());
|
||||||
|
},
|
||||||
|
&xtimer_attacher.timer_list_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
bool RoomObstacle::DoInteraction(Human* sender)
|
bool RoomObstacle::DoInteraction(Human* sender)
|
||||||
{
|
{
|
||||||
if (Obstacle::DoInteraction(sender)) {
|
if (Obstacle::DoInteraction(sender)) {
|
||||||
@ -514,3 +549,12 @@ bool RoomObstacle::DoInteraction(Human* sender)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RoomObstacle::SummonAirDropBox(int box_id)
|
||||||
|
{
|
||||||
|
RoomObstacle* obstacle = room->CreateObstacle
|
||||||
|
(
|
||||||
|
box_id,
|
||||||
|
GetPos().x,
|
||||||
|
GetPos().y
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -35,6 +35,9 @@ private:
|
|||||||
void ActiveSpring();
|
void ActiveSpring();
|
||||||
void ActiveHideHouse();
|
void ActiveHideHouse();
|
||||||
void ActiveGully();
|
void ActiveGully();
|
||||||
|
void ActiveAirDrop();
|
||||||
|
|
||||||
|
void SummonAirDropBox(int box_id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool temp_through_ = false;
|
bool temp_through_ = false;
|
||||||
|
@ -64,6 +64,8 @@ message MapThing
|
|||||||
optional string monster_list = 21;
|
optional string monster_list = 21;
|
||||||
optional string special_damage_type = 22;
|
optional string special_damage_type = 22;
|
||||||
optional string receive_special_damage_type = 23;
|
optional string receive_special_damage_type = 23;
|
||||||
|
optional string param1 = 24;
|
||||||
|
optional string param2 = 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SafeArea
|
message SafeArea
|
||||||
|
Loading…
x
Reference in New Issue
Block a user