1
This commit is contained in:
parent
6729f2f1d4
commit
f688b2fded
@ -52,16 +52,14 @@ void InternalShot(Creature* c,
|
|||||||
if (c->room->BattleStarted() ||
|
if (c->room->BattleStarted() ||
|
||||||
(c->room->GetGasData().gas_mode == GasJump &&
|
(c->room->GetGasData().gas_mode == GasJump &&
|
||||||
!c->HasBuffEffect(kBET_Jump))) {
|
!c->HasBuffEffect(kBET_Jump))) {
|
||||||
#if 0
|
c->room->CreateBullet(c,
|
||||||
c->room->CreateBullet(hum,
|
weapon_meta,
|
||||||
weapon_meta,
|
weapon_upgrade_meta,
|
||||||
weapon_upgrade_meta,
|
bullet_meta,
|
||||||
bullet_meta,
|
bullet_born_pos,
|
||||||
bullet_born_pos,
|
bullet_dir,
|
||||||
bullet_dir,
|
fly_distance,
|
||||||
fly_distance,
|
is_tank_skin);
|
||||||
is_tank_skin);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,7 +502,6 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
a8::Vec2 old_attack_dir = attack_dir;
|
a8::Vec2 old_attack_dir = attack_dir;
|
||||||
attack_dir = entity->GetPos() - GetPos();
|
attack_dir = entity->GetPos() - GetPos();
|
||||||
attack_dir.Normalize();
|
attack_dir.Normalize();
|
||||||
#if 0
|
|
||||||
InternalShot
|
InternalShot
|
||||||
(
|
(
|
||||||
this,
|
this,
|
||||||
@ -516,7 +513,6 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
target_distance,
|
target_distance,
|
||||||
false);
|
false);
|
||||||
attack_dir = old_attack_dir;
|
attack_dir = old_attack_dir;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -558,7 +554,6 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
equip_meta->i->equip_type() == EQUIP_TYPE_CAR &&
|
equip_meta->i->equip_type() == EQUIP_TYPE_CAR &&
|
||||||
equip_meta->i->equip_subtype() == 1
|
equip_meta->i->equip_subtype() == 1
|
||||||
) {
|
) {
|
||||||
#if 0
|
|
||||||
MetaData::Equip* car_weapon_meta = MetaMgr::Instance()->GetEquip(equip_meta->int_param1);
|
MetaData::Equip* car_weapon_meta = MetaMgr::Instance()->GetEquip(equip_meta->int_param1);
|
||||||
if (car_weapon_meta) {
|
if (car_weapon_meta) {
|
||||||
car_weapon.weapon_idx = 100;
|
car_weapon.weapon_idx = 100;
|
||||||
@ -568,7 +563,6 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
car_weapon.Recalc();
|
car_weapon.Recalc();
|
||||||
car_weapon.ammo = car_weapon.GetClipVolume();
|
car_weapon.ammo = car_weapon.GetClipVolume();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,3 +114,12 @@ private:
|
|||||||
|
|
||||||
friend class Skill;
|
friend class Skill;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void InternalShot(Creature* sender,
|
||||||
|
MetaData::Equip* weapon_meta,
|
||||||
|
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
||||||
|
MetaData::Equip* bullet_meta,
|
||||||
|
int weapon_lv,
|
||||||
|
int skill_id,
|
||||||
|
float fly_distance,
|
||||||
|
bool is_tank_skin);
|
||||||
|
@ -34,69 +34,6 @@ const int kReviveTimeAdd = 12;
|
|||||||
const int kSkinNum = 4;
|
const int kSkinNum = 4;
|
||||||
const int kREVIVE_BUFF_ID = 0;
|
const int kREVIVE_BUFF_ID = 0;
|
||||||
|
|
||||||
void InternalShot(Human* hum,
|
|
||||||
MetaData::Equip* weapon_meta,
|
|
||||||
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
|
||||||
MetaData::Equip* bullet_meta,
|
|
||||||
int weapon_lv,
|
|
||||||
int skill_id,
|
|
||||||
float fly_distance,
|
|
||||||
bool is_tank_skin)
|
|
||||||
{
|
|
||||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
|
||||||
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
|
||||||
bullet_born_offset.Rotate(hum->attack_dir.CalcAngle(a8::Vec2::UP));
|
|
||||||
a8::Vec2 bullet_born_pos = hum->GetPos() + bullet_born_offset;
|
|
||||||
if (hum->room->OverBorder(bullet_born_pos, 0)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hum->room->frame_event.AddShot(hum);
|
|
||||||
for (auto& tuple : weapon_meta->bullet_born_offset) {
|
|
||||||
a8::Vec2 bullet_born_offset = a8::Vec2(std::get<0>(tuple), std::get<1>(tuple));
|
|
||||||
bullet_born_offset.Rotate(hum->attack_dir.CalcAngle(a8::Vec2::UP));
|
|
||||||
a8::Vec2 bullet_born_pos = hum->GetPos() + bullet_born_offset;
|
|
||||||
a8::Vec2 bullet_dir = hum->attack_dir;
|
|
||||||
float bullet_angle = std::get<2>(tuple);
|
|
||||||
if (weapon_meta->i->bullet_angle() >= 0.10f) {
|
|
||||||
int angle = (int)weapon_meta->i->bullet_angle() * 1000;
|
|
||||||
#if 0
|
|
||||||
if (curr_weapon->GetUpgradeMeta()) {
|
|
||||||
angle -= curr_weapon->GetAttrValue(kHAT_BulletAngle) * 1000;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (angle > 0) {
|
|
||||||
bullet_angle += (rand() % angle) / 1000.0f * (rand() % 2 == 0 ? 1 : -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bullet_dir.Rotate(bullet_angle / 180.0f);
|
|
||||||
if (hum->GetCar()) {
|
|
||||||
#if 0
|
|
||||||
bullet_born_pos.x += MetaMgr::Instance()->horse_shoot_x;
|
|
||||||
bullet_born_pos.y += MetaMgr::Instance()->horse_shoot_y;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
hum->room->frame_event.AddBullet(hum,
|
|
||||||
weapon_meta,
|
|
||||||
weapon_lv,
|
|
||||||
bullet_born_pos,
|
|
||||||
bullet_dir,
|
|
||||||
fly_distance);
|
|
||||||
if (hum->room->BattleStarted() ||
|
|
||||||
(hum->room->GetGasData().gas_mode == GasJump &&
|
|
||||||
!hum->HasBuffEffect(kBET_Jump))) {
|
|
||||||
hum->room->CreateBullet(hum,
|
|
||||||
weapon_meta,
|
|
||||||
weapon_upgrade_meta,
|
|
||||||
bullet_meta,
|
|
||||||
bullet_born_pos,
|
|
||||||
bullet_dir,
|
|
||||||
fly_distance,
|
|
||||||
is_tank_skin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Human::Human():Creature()
|
Human::Human():Creature()
|
||||||
{
|
{
|
||||||
default_weapon.weapon_idx = 0;
|
default_weapon.weapon_idx = 0;
|
||||||
|
@ -368,12 +368,3 @@ private:
|
|||||||
friend class FrameMaker;
|
friend class FrameMaker;
|
||||||
friend class FrameEvent;
|
friend class FrameEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
void InternalShot(Human* hum,
|
|
||||||
MetaData::Equip* weapon_meta,
|
|
||||||
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
|
||||||
MetaData::Equip* bullet_meta,
|
|
||||||
int weapon_lv,
|
|
||||||
int skill_id,
|
|
||||||
float fly_distance,
|
|
||||||
bool is_tank_skin);
|
|
||||||
|
@ -520,7 +520,7 @@ int Room::CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::CreateBullet(Human* hum,
|
void Room::CreateBullet(Creature* sender,
|
||||||
MetaData::Equip* weapon_meta,
|
MetaData::Equip* weapon_meta,
|
||||||
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
||||||
MetaData::Equip* bullet_meta,
|
MetaData::Equip* bullet_meta,
|
||||||
@ -531,7 +531,7 @@ void Room::CreateBullet(Human* hum,
|
|||||||
{
|
{
|
||||||
if (grid_service->CanAdd(pos.x, pos.y)) {
|
if (grid_service->CanAdd(pos.x, pos.y)) {
|
||||||
Bullet* bullet = EntityFactory::Instance()->MakeBullet(AllocUniid());
|
Bullet* bullet = EntityFactory::Instance()->MakeBullet(AllocUniid());
|
||||||
bullet->sender = hum;
|
bullet->sender = sender;
|
||||||
bullet->room = this;
|
bullet->room = this;
|
||||||
bullet->gun_meta = weapon_meta;
|
bullet->gun_meta = weapon_meta;
|
||||||
bullet->gun_upgrade_meta = weapon_upgrade_meta;
|
bullet->gun_upgrade_meta = weapon_upgrade_meta;
|
||||||
|
@ -102,7 +102,7 @@ public:
|
|||||||
void DropItem(a8::Vec2 pos, int item_id, int item_count, int item_lv);
|
void DropItem(a8::Vec2 pos, int item_id, int item_count, int item_lv);
|
||||||
|
|
||||||
int CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
int CreateLoot(int equip_id, a8::Vec2 pos, int count, int equip_lv);
|
||||||
void CreateBullet(Human* hum,
|
void CreateBullet(Creature* sender,
|
||||||
MetaData::Equip* weapon_meta,
|
MetaData::Equip* weapon_meta,
|
||||||
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
MetaData::EquipUpgrade* weapon_upgrade_meta,
|
||||||
MetaData::Equip* bullet_meta,
|
MetaData::Equip* bullet_meta,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user