1
This commit is contained in:
parent
19aa4a38c0
commit
f3250e450c
@ -142,46 +142,12 @@ void Bullet::ProcBomb()
|
|||||||
}
|
}
|
||||||
}//end for
|
}//end for
|
||||||
|
|
||||||
#if 0
|
|
||||||
switch (meta->i->_inventory_slot()) {
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
//榴弹炮
|
|
||||||
a8::Vec2 bomb_pos = pos;
|
|
||||||
room->frame_event.AddExplosionEx(player, 0, bomb_pos, 0);
|
|
||||||
OnHit(objects);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
//手雷
|
|
||||||
a8::Vec2 bomb_pos = pos;
|
|
||||||
room->frame_event.AddExplosion(this, meta->i->id(), bomb_pos);
|
|
||||||
OnHit(objects);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
//烟雾弹
|
|
||||||
a8::Vec2 bomb_pos = pos;
|
|
||||||
room->frame_event.AddSmoke(this, meta->i->id(), bomb_pos);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
room->RemoveObjectLater(this);
|
room->RemoveObjectLater(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bullet::IsBomb()
|
bool Bullet::IsBomb()
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
return false;
|
return false;
|
||||||
#else
|
|
||||||
return
|
|
||||||
meta->i->_inventory_slot() == 4 ||
|
|
||||||
meta->i->_inventory_slot() == 5 ||
|
|
||||||
meta->i->_inventory_slot() == 6;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bullet::MapServiceUpdate()
|
void Bullet::MapServiceUpdate()
|
||||||
@ -207,7 +173,6 @@ void Bullet::MapServiceUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//end for
|
}//end for
|
||||||
#if 1
|
|
||||||
{
|
{
|
||||||
std::set<ColliderComponent*> colliders;
|
std::set<ColliderComponent*> colliders;
|
||||||
room->map_service.GetColliders(pos.x, pos.y, colliders);
|
room->map_service.GetColliders(pos.x, pos.y, colliders);
|
||||||
@ -217,15 +182,9 @@ void Bullet::MapServiceUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
float bullet_range = meta->i->range();
|
float bullet_range = meta->i->range();
|
||||||
#if 1
|
|
||||||
if (!objects.empty() || distance > bullet_range ||
|
if (!objects.empty() || distance > bullet_range ||
|
||||||
(IsBomb() && distance >= fly_distance)
|
(IsBomb() && distance >= fly_distance)
|
||||||
#else
|
|
||||||
if (!objects.empty() || distance > bullet_range ||
|
|
||||||
(IsBomb() && meta->i->_inventory_slot() != 4 && distance >= fly_distance)
|
|
||||||
#endif
|
|
||||||
) {
|
) {
|
||||||
if (IsBomb()) {
|
if (IsBomb()) {
|
||||||
ProcBomb();
|
ProcBomb();
|
||||||
|
@ -227,6 +227,13 @@ enum EquipType_e
|
|||||||
EquipType_Bullet = 1,
|
EquipType_Bullet = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BulletType_e
|
||||||
|
{
|
||||||
|
BulletType_Normal = 1, //普通子弹
|
||||||
|
BulletType_Missile = 2, //导弹
|
||||||
|
BulletType_FireBomb = 3, //燃烧弹
|
||||||
|
};
|
||||||
|
|
||||||
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
const char* const PROJ_NAME_FMT = "game%d_gameserver";
|
||||||
const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
||||||
|
|
||||||
|
@ -237,9 +237,14 @@ void Human::DirectShot(MetaData::Equip* bullet_meta)
|
|||||||
}
|
}
|
||||||
bullet_dir.Rotate(bullet_angle / 180.0f);
|
bullet_dir.Rotate(bullet_angle / 180.0f);
|
||||||
int hit_time = 0;
|
int hit_time = 0;
|
||||||
|
if (bullet_meta->i->equip_subtype() == BulletType_Missile) {
|
||||||
|
hit_time = bullet_meta->i->time() * 1000;
|
||||||
|
}
|
||||||
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance, hit_time);
|
room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance, hit_time);
|
||||||
if (room->BattleStarted()) {
|
if (room->BattleStarted()) {
|
||||||
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance);
|
if (bullet_meta->i->equip_subtype() != BulletType_Missile) {
|
||||||
|
room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user