Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8797 → Rev 8798

/source/sw/src/bunny.cpp
857,16 → 857,13
int CanSeePlayer(short SpriteNum);
short tang;
 
 
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
 
tang = getangle(psp->x - sp->x, psp->y - sp->y);
 
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
sp->ang = NORM_ANGLE(sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6);
sp->ang = NORM_ANGLE(sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6);
else
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
 
DoActorSetSpeed(SpriteNum, FAST_SPEED);
 
/source/sw/src/game.h
388,6 → 388,15
#define STD_RANDOM_RANGE(range) (StdRandomRange(range))
#define STD_RANDOM() (rand())
 
#if 0
// TODO: PedanticMode
#define RANDOM_NEG(x,y) (PedanticMode \
? ((RANDOM_P2(((x)<<(y))<<1) - (x))<<(y)) \
: (RANDOM_P2(((x)<<(y))<<1) - ((x) <<(y))))
#else
#define RANDOM_NEG(x,y) ((RANDOM_P2(((x)<<(y))<<1) - (x))<<(y))
#endif
 
#define MOVEx(vel,ang) (((int)(vel) * (int)sintable[NORM_ANGLE((ang) + 512)]) >> 14)
#define MOVEy(vel,ang) (((int)(vel) * (int)sintable[NORM_ANGLE((ang))]) >> 14)
 
/source/sw/src/ripper.cpp
1090,15 → 1090,13
int CanSeePlayer(short SpriteNum);
short tang;
 
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
 
tang = getangle(psp->x - sp->x, psp->y - sp->y);
 
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6));
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6));
else
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
 
DoActorSetSpeed(SpriteNum, FAST_SPEED);
 
/source/sw/src/ripper2.cpp
1097,8 → 1097,6
int CanSeePlayer(short SpriteNum);
short tang;
 
#define RANDOM_NEG(x) (RANDOM_P2((x)<<1) - (x))
 
tang = getangle(psp->x - sp->x, psp->y - sp->y);
 
// Always jump at player if mad.
1106,10 → 1104,10
//{
if (move_sprite(SpriteNum, sintable[NORM_ANGLE(tang+512)] >> 7, sintable[tang] >> 7,
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS))
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256 << 6) >> 6));
sp->ang = NORM_ANGLE((sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6));
else
sp->ang = NORM_ANGLE(tang);
// sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256 << 6) >> 6));
// sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
//} else
// sp->ang = NORM_ANGLE(tang);