Make the devistator behavior closer to the original Duke code

git-svn-id: https://svn.eduke32.com/eduke32@905 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-07-26 02:12:44 +00:00
parent d1df28e457
commit 8446a1f2d9

View file

@ -1960,18 +1960,23 @@ void DoFire(player_struct *p)
SetGameVarID(g_iWorksLikeVarID,aplWeaponWorksLike[p->curr_weapon][snum], p->i, snum);
shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]);
for (i=1;i<aplWeaponShotsPerBurst[p->curr_weapon][snum];i++)
{
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER)
{
// this makes the projectiles fire on a delay from player code
hittype[p->i].temp_data[7] = (aplWeaponShotsPerBurst[p->curr_weapon][snum])<<1;
}
else
{
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AMMOPERSHOT)
{
if (p->ammo_amount[p->curr_weapon] > 0)
{
p->ammo_amount[p->curr_weapon]--;
else break;
}
shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]);
}
}
else
shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]);
}
if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE))
{
@ -4658,6 +4663,29 @@ SHOOTINCODE:
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_GLOWS)
p->random_club_frame += 64; // Glowing
// this is for WEAPON_FLAG_FIREEVERYOTHER
if (hittype[p->i].temp_data[7])
{
hittype[p->i].temp_data[7]--;
if (p->last_weapon == -1 && hittype[p->i].temp_data[7] != 0 && hittype[p->i].temp_data[7] % 2 == 0)
{
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AMMOPERSHOT)
{
if (p->ammo_amount[p->curr_weapon] > 0)
p->ammo_amount[p->curr_weapon]--;
else
{
hittype[p->i].temp_data[7] = 0;
checkavailweapon(p);
}
}
if (hittype[p->i].temp_data[7] != 0)
{
shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]);
}
}
}
if (p->rapid_fire_hold == 1)
{
if (sb_snum&(1<<2)) return;