添加骑驴子弹出生偏移

This commit is contained in:
aozhiwei 2020-03-18 16:49:21 +08:00
parent b779b32f20
commit ebf4b2452e
3 changed files with 8 additions and 0 deletions

View File

@ -138,6 +138,8 @@ public:
MetaMgr::Instance()->tank_damage_interval = MetaMgr::Instance()->GetSysParamAsFloat("tank_damage_interval", 1);
MetaMgr::Instance()->average_oil = MetaMgr::Instance()->GetSysParamAsInt("average_oil");
MetaMgr::Instance()->max_oil = MetaMgr::Instance()->GetSysParamAsInt("max_oil");
MetaMgr::Instance()->horse_shoot_x = MetaMgr::Instance()->GetSysParamAsInt("horse_shoot_x");
MetaMgr::Instance()->horse_shoot_y = MetaMgr::Instance()->GetSysParamAsInt("horse_shoot_y");
if (MetaMgr::Instance()->K < 0.01f) {
abort();
}

View File

@ -57,6 +57,8 @@ class MetaMgr : public a8::Singleton<MetaMgr>
float tank_damage_interval = 0.0f;
float average_oil = 0.0f;
float max_oil = 0.0f;
float horse_shoot_x = 0.0f;
float horse_shoot_y = 0.0f;
private:
MetaDataLoader* loader_ = nullptr;

View File

@ -372,6 +372,10 @@ void Player::Shot()
}
}
bullet_dir.Rotate(bullet_angle / 180.0f);
if (car_.car_id != 0) {
bullet_born_pos.x += MetaMgr::Instance()->horse_shoot_x;
bullet_born_pos.y += MetaMgr::Instance()->horse_shoot_y;
}
room->frame_event.AddBullet(this, bullet_born_pos, bullet_dir, fly_distance);
if (room->BattleStarted() || (room->gas_data.gas_mode == GasJump && !a8::HasBitFlag(status, HS_Jump))) {
room->CreateBullet(this, curr_weapon, bullet_born_pos, bullet_dir, fly_distance);