mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-16 01:11:28 +00:00
Projectile changes:
-palette is now set at spawn time, instead of during movement (oops!) -projectiles can no longer hit their owner during their first tic of movement git-svn-id: https://svn.eduke32.com/eduke32@5498 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
935e9fa197
commit
0871e56b92
3 changed files with 18 additions and 6 deletions
|
@ -2677,14 +2677,14 @@ static int32_t Proj_MaybeDamageCF(const spritetype *s)
|
|||
|
||||
ACTOR_STATIC void Proj_MoveCustom(int32_t i)
|
||||
{
|
||||
int const m = SpriteProjectile[i].workslike & PROJECTILE_MOVED;
|
||||
SpriteProjectile[i].workslike |= PROJECTILE_MOVED;
|
||||
|
||||
const projectile_t *const proj = &SpriteProjectile[i];
|
||||
spritetype *const s = &sprite[i];
|
||||
vec3_t davect;
|
||||
int32_t j=0;
|
||||
|
||||
if (proj->pal >= 0)
|
||||
s->pal = proj->pal;
|
||||
|
||||
switch (proj->workslike & PROJECTILE_TYPE_MASK)
|
||||
{
|
||||
case PROJECTILE_HITSCAN:
|
||||
|
@ -2727,9 +2727,7 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
|
|||
|
||||
if (proj->trail >= 0)
|
||||
{
|
||||
int32_t cnt;
|
||||
|
||||
for (cnt=0; cnt<=proj->tnum; cnt++)
|
||||
for (int cnt=0; cnt<=proj->tnum; cnt++)
|
||||
{
|
||||
j = A_Spawn(i, proj->trail);
|
||||
|
||||
|
@ -2754,6 +2752,14 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
|
|||
ll >>= 1;
|
||||
}
|
||||
|
||||
uint16_t cst = 0;
|
||||
|
||||
if (!m && (unsigned) s->owner < MAXSPRITES)
|
||||
{
|
||||
cst = sprite[s->owner].cstat;
|
||||
sprite[s->owner].cstat &= ~CSTAT_SPRITE_BLOCK;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
vec3_t tmpvect;
|
||||
|
@ -2765,6 +2771,8 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
|
|||
|
||||
j = A_MoveSprite(i, &tmpvect, CLIPMASK1);
|
||||
} while (!j && --cnt > 0);
|
||||
|
||||
if (cst) sprite[s->owner].cstat = cst;
|
||||
}
|
||||
|
||||
if (!(proj->workslike & PROJECTILE_BOUNCESOFFWALLS) && // NOT_BOUNCESOFFWALLS_YVEL
|
||||
|
|
|
@ -285,6 +285,7 @@ enum pflags_t {
|
|||
PROJECTILE_REALCLIPDIST = 0x00080000,
|
||||
PROJECTILE_ACCURATE = 0x00100000,
|
||||
PROJECTILE_NOSETOWNERSHADE = 0x00200000,
|
||||
PROJECTILE_MOVED = 0x80000000, // internal flag, do not document
|
||||
PROJECTILE_TYPE_MASK = PROJECTILE_HITSCAN|PROJECTILE_RPG|PROJECTILE_KNEE|PROJECTILE_BLOOD,
|
||||
};
|
||||
|
||||
|
|
|
@ -978,6 +978,9 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
|
|||
sprite[j].xrepeat = proj->xrepeat;
|
||||
sprite[j].yrepeat = proj->yrepeat;
|
||||
|
||||
if (proj->pal >= 0)
|
||||
sprite[j].pal = proj->pal;
|
||||
|
||||
if (proj->extra_rand > 0)
|
||||
sprite[j].extra += (krand()&proj->extra_rand);
|
||||
|
||||
|
|
Loading…
Reference in a new issue