- WHaven: Interpolate weapon changing drop.

This commit is contained in:
Mitchell Richters 2021-02-13 18:45:02 +11:00
parent 16c0f88451
commit 4e5ee86bd7
3 changed files with 12 additions and 8 deletions

View file

@ -33,6 +33,9 @@ void drawweapons(int snum, double const dasmoothratio) {
double dasnakex = osnakex + MulScaleF(snakex - osnakex, dasmoothratio, 16);
double dasnakey = osnakey + MulScaleF(snakey - osnakey, dasmoothratio, 16);
// Interpolated weapon dropping.
double daweapondrop = oweapondrop + MulScaleF(weapondrop - oweapondrop, dasmoothratio, 16);
int dabits;
if (plr.invisibletime > 0)
dabits = RS_TRANS1;
@ -246,32 +249,32 @@ void drawweapons(int snum, double const dasmoothratio) {
case 2: // unready
if (isWh2()) {
if (plr.currweaponframe == BOWREADYEND) {
day = readyanimtics[plr.currweapon][6].curry + (weapondrop);
day = readyanimtics[plr.currweapon][6].curry + daweapondrop;
dax = readyanimtics[plr.currweapon][6].currx;
}
else if (plr.currweaponframe == ZBOWWALK) {
day = zreadyanimtics[plr.currweapon][6].curry + (weapondrop);
day = zreadyanimtics[plr.currweapon][6].curry + daweapondrop;
dax = zreadyanimtics[plr.currweapon][6].currx;
}
else {
if (plr.weapon[plr.currweapon] == 1 || plr.weapon[7] == 2) {
dax = weaponanimtics[plr.currweapon][0].currx;
day = weaponanimtics[plr.currweapon][0].curry + (weapondrop);
day = weaponanimtics[plr.currweapon][0].curry + daweapondrop;
}
else {
dax = zweaponanimtics[plr.currweapon][0].currx;
day = zweaponanimtics[plr.currweapon][0].curry + (weapondrop);
day = zweaponanimtics[plr.currweapon][0].curry + daweapondrop;
}
}
}
else {
if (plr.currweaponframe == BOWREADYEND) {
day = readyanimtics[plr.currweapon][6].curry + (weapondrop);
day = readyanimtics[plr.currweapon][6].curry + daweapondrop;
dax = readyanimtics[plr.currweapon][6].currx;
}
else {
dax = weaponanimtics[plr.currweapon][0].currx;
day = weaponanimtics[plr.currweapon][0].curry + (weapondrop);
day = weaponanimtics[plr.currweapon][0].curry + daweapondrop;
}
}

View file

@ -13,7 +13,7 @@ static int arrowcnt, throwpikecnt;
int dropshieldcnt = 0;
boolean droptheshield = false;
int dahand = 0;
int weapondrop;
int oweapondrop, weapondrop;
double osnakex, osnakey, snakex, snakey;
boolean checkmedusadist(int i, int x, int y, int z, int lvl) {
@ -687,6 +687,7 @@ void weaponsprocess(int snum) {
}
break;
case 2: // unready
oweapondrop = weapondrop;
if (plr.currweapon == 1)
weapondrop += TICSPERFRAME << 1;
else

View file

@ -290,7 +290,7 @@ extern WEAPONINF lefthandanimtics[5][MAXFRAMES];
extern int dropshieldcnt;
extern boolean droptheshield;
extern int dahand;
extern int weapondrop;
extern int oweapondrop, weapondrop;
extern double osnakex, osnakey, snakex, snakey;
boolean checkmedusadist(int i, int x, int y, int z, int lvl);