mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-18 09:41:06 +00:00
- castspell sprite[] replacements.
This commit is contained in:
parent
2a1a175305
commit
9f6fc6ef1a
1 changed files with 25 additions and 23 deletions
|
@ -580,39 +580,41 @@ void processfluid(int i, int zr_florhit, boolean fly) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void castspell(PLAYER& plr, int i) {
|
void castspell(PLAYER& plr, int i) {
|
||||||
int j = insertsprite(sprite[i].sectnum, MISSILE);
|
auto& spr = sprite[i];
|
||||||
|
int j = insertsprite(spr.sectnum, MISSILE);
|
||||||
|
auto& spawned = sprite[j];
|
||||||
|
|
||||||
sprite[j].x = sprite[i].x;
|
spawned.x = spr.x;
|
||||||
sprite[j].y = sprite[i].y;
|
spawned.y = spr.y;
|
||||||
if (isWh2() || sprite[i].picnum == SPAWNFIREBALL)
|
if (isWh2() || spr.picnum == SPAWNFIREBALL)
|
||||||
sprite[j].z = sprite[i].z - ((tileHeight(sprite[i].picnum) >> 1) << 8);
|
spawned.z = spr.z - ((tileHeight(spr.picnum) >> 1) << 8);
|
||||||
else
|
else
|
||||||
sprite[j].z = getflorzofslope(sprite[i].sectnum, sprite[i].x, sprite[i].y) - ((tileHeight(sprite[i].picnum) >> 1) << 8);
|
spawned.z = getflorzofslope(spr.sectnum, spr.x, spr.y) - ((tileHeight(spr.picnum) >> 1) << 8);
|
||||||
sprite[j].cstat = 0; // Hitscan does not hit other bullets
|
spawned.cstat = 0; // Hitscan does not hit other bullets
|
||||||
sprite[j].picnum = MONSTERBALL;
|
spawned.picnum = MONSTERBALL;
|
||||||
sprite[j].shade = -15;
|
spawned.shade = -15;
|
||||||
sprite[j].xrepeat = 64;
|
spawned.xrepeat = 64;
|
||||||
sprite[j].yrepeat = 64;
|
spawned.yrepeat = 64;
|
||||||
if (sprite[i].picnum == SPAWNFIREBALL)
|
if (spr.picnum == SPAWNFIREBALL)
|
||||||
sprite[j].ang = (short)((getangle(plr.x - sprite[j].x, plr.y - sprite[j].y) + 2048) & 2047);
|
spawned.ang = (short)((getangle(plr.x - spawned.x, plr.y - spawned.y) + 2048) & 2047);
|
||||||
else
|
else
|
||||||
sprite[j].ang = (short)(((getangle(plr.x - sprite[j].x, plr.y - sprite[j].y) + (krand() & 15)
|
spawned.ang = (short)(((getangle(plr.x - spawned.x, plr.y - spawned.y) + (krand() & 15)
|
||||||
- 8) + 2048) & 2047);
|
- 8) + 2048) & 2047);
|
||||||
sprite[j].xvel = bcos(sprite[j].ang, -6);
|
spawned.xvel = bcos(spawned.ang, -6);
|
||||||
sprite[j].yvel = bsin(sprite[j].ang, -6);
|
spawned.yvel = bsin(spawned.ang, -6);
|
||||||
|
|
||||||
int discrim = ksqrt((plr.x - sprite[j].x) * (plr.x - sprite[j].x) + (plr.y - sprite[j].y) * (plr.y - sprite[j].y));
|
int discrim = ksqrt((plr.x - spawned.x) * (plr.x - spawned.x) + (plr.y - spawned.y) * (plr.y - spawned.y));
|
||||||
if (discrim == 0)
|
if (discrim == 0)
|
||||||
discrim = 1;
|
discrim = 1;
|
||||||
if (isWh2())
|
if (isWh2())
|
||||||
sprite[j].zvel = (short)(((plr.z + (8 << 8) - sprite[j].z) << 7) / discrim);
|
spawned.zvel = (short)(((plr.z + (8 << 8) - spawned.z) << 7) / discrim);
|
||||||
else
|
else
|
||||||
sprite[j].zvel = (short)(((plr.z + (48 << 8) - sprite[j].z) << 7) / discrim);
|
spawned.zvel = (short)(((plr.z + (48 << 8) - spawned.z) << 7) / discrim);
|
||||||
|
|
||||||
sprite[j].owner = (short)i;
|
spawned.owner = (short)i;
|
||||||
sprite[j].clipdist = 16;
|
spawned.clipdist = 16;
|
||||||
sprite[j].lotag = 512;
|
spawned.lotag = 512;
|
||||||
sprite[j].hitag = 0;
|
spawned.hitag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void skullycastspell(PLAYER& plr, int i) {
|
void skullycastspell(PLAYER& plr, int i) {
|
||||||
|
|
Loading…
Reference in a new issue