添加子弹后坐力和消耗类型判断

This commit is contained in:
aozhiwei 2021-10-20 16:53:24 +08:00
parent 4b9e532e87
commit 82f1bdbdc8
2 changed files with 26 additions and 14 deletions

View File

@ -41,6 +41,7 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
if (c->downed) { if (c->downed) {
return; return;
} }
if (bullet_info.delay_time <= 0) {
if (c->GetCurrWeapon()->weapon_idx == 0) { if (c->GetCurrWeapon()->weapon_idx == 0) {
return; return;
} }
@ -49,16 +50,22 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
return; return;
} }
--c->GetCurrWeapon()->ammo; --c->GetCurrWeapon()->ammo;
if (c->GetCurrWeapon()->ammo <= 0) {
c->AutoLoadingBullet();
}
if ((c->IsPlayer() || c->IsCar())) {
c->room->frame_event.AddBulletNumChg(c->GetWeakPtrRef());
c->room->frame_event.AddWeaponAmmoChg(c->GetWeakPtrRef());
}
} }
if (bullet_info.delay_time <= 0) {
int bullet_uniid = 0;
if (MetaMgr::Instance()->prebattle_can_use_skill ||
!(c->HasBuffEffect(kBET_Jump) || c->HasBuffEffect(kBET_Fly))) {
if (bullet_info.recoil_force > 0) { if (bullet_info.recoil_force > 0) {
c->DoRecoilForce(bullet_info.recoil_force); c->DoRecoilForce(bullet_info.recoil_force);
bullet_info.bullet_born_pos = bullet_info.bullet_born_pos - bullet_info.bullet_born_pos = bullet_info.bullet_born_pos -
(bullet_info.bullet_dir * bullet_info.recoil_force); (bullet_info.bullet_dir * bullet_info.recoil_force);
} }
int bullet_uniid = 0;
if (MetaMgr::Instance()->prebattle_can_use_skill ||
!(c->HasBuffEffect(kBET_Jump) || c->HasBuffEffect(kBET_Fly))) {
bullet_uniid = c->room->CreateBullet bullet_uniid = c->room->CreateBullet
(c, (c,
c->shot_passenger, c->shot_passenger,

View File

@ -1574,7 +1574,12 @@ void Human::_UpdateSpecMove()
void Human::_UpdateMove(int speed) void Human::_UpdateMove(int speed)
{ {
if (!HasBuffEffect(kBET_Vertigo)) { if (HasBuffEffect(kBET_Vertigo)) {
if (!HasBuffEffect(kBET_Recoil)) {
return;
}
}
{
a8::UnSetBitFlag(status, CS_Collisioning); a8::UnSetBitFlag(status, CS_Collisioning);
do { do {
int distance = std::min(5, speed); int distance = std::min(5, speed);