From 8446a1f2d93601b11700b42a0a20e65c76f33db1 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 26 Jul 2008 02:12:44 +0000 Subject: [PATCH] Make the devistator behavior closer to the original Duke code git-svn-id: https://svn.eduke32.com/eduke32@905 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 40 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index e32d810ef..ac67971df 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -1961,16 +1961,21 @@ void DoFire(player_struct *p) shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]); for (i=1;icurr_weapon][snum];i++) { - if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_AMMOPERSHOT) + if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) { - if (p->ammo_amount[p->curr_weapon] > 0) - { - p->ammo_amount[p->curr_weapon]--; - shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]); - } + // 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]); + } } if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE)) @@ -4657,6 +4662,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) {