mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-22 11:31:11 +00:00
- animateobjs JAVLIN loop
This commit is contained in:
parent
88842d8e96
commit
2393fe6fc6
1 changed files with 34 additions and 32 deletions
|
@ -981,43 +981,45 @@ void animateobjs(PLAYER& plr) {
|
||||||
|
|
||||||
for (i = headspritestat[JAVLIN]; i >= 0; i = nextsprite) {
|
for (i = headspritestat[JAVLIN]; i >= 0; i = nextsprite) {
|
||||||
nextsprite = nextspritestat[i];
|
nextsprite = nextspritestat[i];
|
||||||
sprite[i].lotag -= TICSPERFRAME;
|
auto& spr = sprite[i];
|
||||||
if (isBlades(sprite[i].picnum)) {
|
|
||||||
sprite[i].z -= sprite[i].zvel;
|
spr.lotag -= TICSPERFRAME;
|
||||||
if (sprite[i].z < sector[sprite[i].sectnum].ceilingz + (4 << 8)) {
|
if (isBlades(spr.picnum)) {
|
||||||
sprite[i].z = sector[sprite[i].sectnum].ceilingz + (4 << 8);
|
spr.z -= spr.zvel;
|
||||||
sprite[i].zvel = (short) -(sprite[i].zvel >> 1);
|
if (spr.z < sector[spr.sectnum].ceilingz + (4 << 8)) {
|
||||||
|
spr.z = sector[spr.sectnum].ceilingz + (4 << 8);
|
||||||
|
spr.zvel = (short) -(spr.zvel >> 1);
|
||||||
}
|
}
|
||||||
if (sprite[i].z > sector[sprite[i].sectnum].floorz - (4 << 8)) {
|
if (spr.z > sector[spr.sectnum].floorz - (4 << 8)) {
|
||||||
sprite[i].z = sector[sprite[i].sectnum].floorz - (4 << 8);
|
spr.z = sector[spr.sectnum].floorz - (4 << 8);
|
||||||
if (sector[sprite[i].sectnum].floorpicnum == WATER || sector[sprite[i].sectnum].floorpicnum == SLIME
|
if (sector[spr.sectnum].floorpicnum == WATER || sector[spr.sectnum].floorpicnum == SLIME
|
||||||
|| sector[sprite[i].sectnum].floorpicnum == FLOORMIRROR)
|
|| sector[spr.sectnum].floorpicnum == FLOORMIRROR)
|
||||||
if (krand() % 100 > 60)
|
if (krand() % 100 > 60)
|
||||||
makemonstersplash(SPLASHAROO, i);
|
makemonstersplash(SPLASHAROO, i);
|
||||||
deletesprite((short) i);
|
deletesprite((short) i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dax = sprite[i].xvel;
|
dax = spr.xvel;
|
||||||
day = sprite[i].yvel;
|
day = spr.yvel;
|
||||||
if (isWh2())
|
if (isWh2())
|
||||||
daz = sprite[i].zvel;
|
daz = spr.zvel;
|
||||||
else
|
else
|
||||||
daz = (((sprite[i].zvel) * TICSPERFRAME) >> 3);
|
daz = (((spr.zvel) * TICSPERFRAME) >> 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
osectnum = sprite[i].sectnum;
|
osectnum = spr.sectnum;
|
||||||
|
|
||||||
sprite[i].cstat = 0;
|
spr.cstat = 0;
|
||||||
|
|
||||||
hitobject = (short) movesprite(i, (bcos(sprite[i].extra) * TICSPERFRAME) << 6,
|
hitobject = (short) movesprite(i, (bcos(spr.extra) * TICSPERFRAME) << 6,
|
||||||
(bsin(sprite[i].extra) * TICSPERFRAME) << 6, daz, 4 << 8, 4 << 8, 0);
|
(bsin(spr.extra) * TICSPERFRAME) << 6, daz, 4 << 8, 4 << 8, 0);
|
||||||
|
|
||||||
if (sprite[i].picnum == WALLARROW || sprite[i].picnum == THROWHALBERD)
|
if (spr.picnum == WALLARROW || spr.picnum == THROWHALBERD)
|
||||||
sprite[i].cstat = 0x11;
|
spr.cstat = 0x11;
|
||||||
else if (sprite[i].picnum == DART)
|
else if (spr.picnum == DART)
|
||||||
sprite[i].cstat = 0x10;
|
spr.cstat = 0x10;
|
||||||
else
|
else
|
||||||
sprite[i].cstat = 0x15;
|
spr.cstat = 0x15;
|
||||||
|
|
||||||
if ((hitobject & 0xc000) == 16384) { // Hits a ceiling / floor
|
if ((hitobject & 0xc000) == 16384) { // Hits a ceiling / floor
|
||||||
// EG Bugfix 17 Aug 2014: Since the game thinks that a javlin hitting the
|
// EG Bugfix 17 Aug 2014: Since the game thinks that a javlin hitting the
|
||||||
|
@ -1025,11 +1027,11 @@ void animateobjs(PLAYER& plr) {
|
||||||
// floor/ceiling hit rather than a sprite hit, we'll need to check if the JAVLIN
|
// floor/ceiling hit rather than a sprite hit, we'll need to check if the JAVLIN
|
||||||
// is
|
// is
|
||||||
// actually in the floor/ceiling before going inactive.
|
// actually in the floor/ceiling before going inactive.
|
||||||
if (sprite[i].z <= sector[sprite[i].sectnum].ceilingz
|
if (spr.z <= sector[spr.sectnum].ceilingz
|
||||||
&& sprite[i].z >= sector[sprite[i].sectnum].floorz) {
|
&& spr.z >= sector[spr.sectnum].floorz) {
|
||||||
if (sprite[i].picnum == THROWPIKE) {
|
if (spr.picnum == THROWPIKE) {
|
||||||
sprite[i].picnum++;
|
spr.picnum++;
|
||||||
sprite[i].detail = WALLPIKETYPE;
|
spr.detail = WALLPIKETYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
changespritestat(i, INACTIVE); // EG Note: RAF.H gives this a nice name, so use it
|
changespritestat(i, INACTIVE); // EG Note: RAF.H gives this a nice name, so use it
|
||||||
|
@ -1037,9 +1039,9 @@ void animateobjs(PLAYER& plr) {
|
||||||
continue;
|
continue;
|
||||||
} else if ((hitobject & 0xc000) == 32768) { // hit a wall
|
} else if ((hitobject & 0xc000) == 32768) { // hit a wall
|
||||||
|
|
||||||
if (sprite[i].picnum == THROWPIKE) {
|
if (spr.picnum == THROWPIKE) {
|
||||||
sprite[i].picnum++;
|
spr.picnum++;
|
||||||
sprite[i].detail = WALLPIKETYPE;
|
spr.detail = WALLPIKETYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
changespritestat(i, INACTIVE);
|
changespritestat(i, INACTIVE);
|
||||||
|
@ -1053,7 +1055,7 @@ void animateobjs(PLAYER& plr) {
|
||||||
if (hitdamage)
|
if (hitdamage)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// if (sprite[i].owner != hitobject) {
|
// if (spr.owner != hitobject) {
|
||||||
// hitdamage = damageactor(plr, hitobject, i);
|
// hitdamage = damageactor(plr, hitobject, i);
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
|
|
Loading…
Reference in a new issue