- SW: changed Animator interface to use USERp parameters.

This commit is contained in:
Christoph Oelckers 2021-10-08 10:03:14 +02:00
parent bb3a141c42
commit e241e7dc52
36 changed files with 1089 additions and 1301 deletions

View file

@ -53,7 +53,7 @@ extern STATE s_NinjaDieSlicedHack[];
extern STATEp sg_NinjaGrabThroat[];
int DoActorStopFall(short SpriteNum);
int DoActorStopFall(USERp SpriteNum);
int
@ -168,7 +168,7 @@ DoActorDie(short SpriteNum, short weapon)
u->ActorActionFunc = nullptr;
sp->xvel = 200 + RandomRange(200);
u->jump_speed = -200 - RandomRange(250);
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
sprite[SpriteNum].ang = sprite[weapon].ang;
}
}
@ -180,7 +180,7 @@ DoActorDie(short SpriteNum, short weapon)
ChangeState(SpriteNum, u->StateEnd);
sp->xvel = 0;
u->jump_speed = 0;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
}
u->RotNum = 0;
@ -212,13 +212,13 @@ DoActorDie(short SpriteNum, short weapon)
{
sp->xvel <<= 1;
u->jump_speed = -100 - RandomRange(250);
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
}
else
{
sp->xvel = 0;
u->jump_speed = -10 - RandomRange(25);
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
}
u->ActorActionFunc = nullptr;
// Get angle to player
@ -242,7 +242,7 @@ DoActorDie(short SpriteNum, short weapon)
sp->xvel = 100 + RandomRange(200);
u->jump_speed = -100 - RandomRange(250);
}
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
u->ActorActionFunc = nullptr;
// Get angle to player
sp->ang = NORM_ANGLE(getangle(u->tgt_sp->x - sp->x, u->tgt_sp->y - sp->y) + 1024);
@ -271,7 +271,7 @@ DoActorDie(short SpriteNum, short weapon)
u->ActorActionFunc = nullptr;
sp->xvel = 300 + RandomRange(400);
u->jump_speed = -300 - RandomRange(350);
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
sprite[SpriteNum].ang = sprite[weapon].ang;
break;
}
@ -326,10 +326,10 @@ DoDebrisCurrent(SPRITEp sp)
}
int
DoActorSectorDamage(short SpriteNum)
DoActorSectorDamage(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SECT_USERp sectu = SectUser[sp->sectnum].Data();
SECTORp sectp = &sector[sp->sectnum];
@ -408,10 +408,10 @@ move_debris(short SpriteNum, int xchange, int ychange, int zchange)
// current move with the current.
int
DoActorDebris(short SpriteNum)
DoActorDebris(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SECTORp sectp = &sector[sp->sectnum];
int nx, ny;
@ -472,10 +472,10 @@ DoActorDebris(short SpriteNum)
int
DoFireFly(short SpriteNum)
DoFireFly(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
nx = 4 * ACTORMOVETICS * bcos(sp->ang) >> 14;
@ -627,7 +627,7 @@ DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec)
u->slide_vel = vel;
u->slide_dec = dec;
//DoActorSlide(SpriteNum);
//DoActorSlide(u);
return 0;
}
@ -636,9 +636,9 @@ DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec)
// Has its own set of variables
int
DoActorSlide(short SpriteNum)
DoActorSlide(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
int nx, ny;
nx = MulScale(u->slide_vel, bcos(u->slide_ang), 14);
@ -663,9 +663,9 @@ DoActorSlide(short SpriteNum)
// !AIC - Actor jumping and falling
int
DoActorBeginJump(short SpriteNum)
DoActorBeginJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -687,15 +687,15 @@ DoActorBeginJump(short SpriteNum)
//DO NOT CALL DoActorJump! DoActorStopFall can cause an infinite loop and
//stack overflow if it is called.
//DoActorJump(SpriteNum);
//DoActorJump(u);
return 0;
}
int
DoActorJump(short SpriteNum)
DoActorJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int jump_adj;
@ -711,7 +711,7 @@ DoActorJump(short SpriteNum)
MONO_PRINT(ds);
// Start falling
DoActorBeginFall(SpriteNum);
DoActorBeginFall(u);
return 0;
}
@ -731,7 +731,7 @@ DoActorJump(short SpriteNum)
MONO_PRINT(ds);
// Change sprites state to falling
DoActorBeginFall(SpriteNum);
DoActorBeginFall(u);
}
return 0;
@ -739,10 +739,8 @@ DoActorJump(short SpriteNum)
int
DoActorBeginFall(short SpriteNum)
DoActorBeginFall(USERp u)
{
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_FALLING);
RESET(u->Flags, SPR_JUMPING);
@ -753,28 +751,27 @@ DoActorBeginFall(short SpriteNum)
{
if (TEST(u->Flags, SPR_DEAD))
{
NewStateGroup(SpriteNum, u->ActorActionSet->DeathFall);
NewStateGroup(u, u->ActorActionSet->DeathFall);
}
else
NewStateGroup(SpriteNum, u->ActorActionSet->Fall);
NewStateGroup(u, u->ActorActionSet->Fall);
if (u->StateFallOverride)
{
NewStateGroup(SpriteNum, u->StateFallOverride);
NewStateGroup(u, u->StateFallOverride);
}
}
DoActorFall(SpriteNum);
DoActorFall(u);
return 0;
}
int
DoActorFall(short SpriteNum)
DoActorFall(USERp u)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
SPRITEp sp = u->s();
// adjust jump speed by gravity
u->jump_speed += u->jump_grav * ACTORMOVETICS;
@ -785,16 +782,16 @@ DoActorFall(short SpriteNum)
// Stick like glue when you hit the ground
if (sp->z > u->loz)
{
DoActorStopFall(SpriteNum);
DoActorStopFall(u);
}
return 0;
}
int
DoActorStopFall(short SpriteNum)
DoActorStopFall(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
sp->z = u->loz;
@ -813,7 +810,7 @@ DoActorStopFall(short SpriteNum)
//DSPRINTF(ds,"StopFall: sp_num %d, sp->picnum %d, lo_num %d, lo_sp->picnum %d",SpriteNum, sp->picnum, u->lo_sp - sprite, u->lo_sp->picnum);
MONO_PRINT(ds);
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
return 0;
}
@ -843,20 +840,19 @@ DoActorStopFall(short SpriteNum)
}
int
DoActorDeathMove(short SpriteNum)
DoActorDeathMove(USER* u)
{
ANIMATOR DoFindGround;
int SpriteNum = u->SpriteNum;
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
nx = MulScale(sp->xvel, bcos(sp->ang), 14);

View file

@ -138,7 +138,7 @@ bool ActorMoveHitReact(short SpriteNum)
action = ChooseAction(u->Personality->TouchTarget);
if (action)
{
(*action)(SpriteNum);
(*action)(u);
return true;
}
}
@ -819,9 +819,9 @@ DoActorActionDecide(short SpriteNum)
int
InitActorDecide(short SpriteNum)
InitActorDecide(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
// NOTE: It is possible to overflow the stack with too many calls to this
// routine
@ -833,15 +833,15 @@ InitActorDecide(short SpriteNum)
u->ActorActionFunc = DoActorDecide;
DoActorDecide(SpriteNum);
DoActorDecide(u);
return 0;
}
int
DoActorDecide(short SpriteNum)
DoActorDecide(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
ANIMATORp actor_action;
@ -875,7 +875,7 @@ DoActorDecide(short SpriteNum)
if (actor_action != InitActorDecide)
{
// NOT staying put
(*actor_action)(SpriteNum);
(*actor_action)(u);
//CON_Message("DoActorDecide: NOT Staying put");
}
else
@ -895,9 +895,9 @@ int sw_snd_scratch = 0;
int
InitActorAlertNoise(short SpriteNum)
InitActorAlertNoise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 1;
// MONO_PRINT(strcpy(ds,"Init Actor Threat Noise"));
@ -911,9 +911,9 @@ InitActorAlertNoise(short SpriteNum)
int
InitActorAmbientNoise(short SpriteNum)
InitActorAmbientNoise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 2;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -927,9 +927,9 @@ InitActorAmbientNoise(short SpriteNum)
}
int
InitActorAttackNoise(short SpriteNum)
InitActorAttackNoise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 3;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -943,9 +943,9 @@ InitActorAttackNoise(short SpriteNum)
}
int
InitActorPainNoise(short SpriteNum)
InitActorPainNoise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 4;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -959,9 +959,9 @@ InitActorPainNoise(short SpriteNum)
}
int
InitActorDieNoise(short SpriteNum)
InitActorDieNoise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 5;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -975,9 +975,9 @@ InitActorDieNoise(short SpriteNum)
}
int
InitActorExtra1Noise(short SpriteNum)
InitActorExtra1Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 6;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -990,9 +990,9 @@ InitActorExtra1Noise(short SpriteNum)
}
int
InitActorExtra2Noise(short SpriteNum)
InitActorExtra2Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 7;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1005,9 +1005,9 @@ InitActorExtra2Noise(short SpriteNum)
}
int
InitActorExtra3Noise(short SpriteNum)
InitActorExtra3Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 8;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1020,9 +1020,9 @@ InitActorExtra3Noise(short SpriteNum)
}
int
InitActorExtra4Noise(short SpriteNum)
InitActorExtra4Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 9;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1035,9 +1035,9 @@ InitActorExtra4Noise(short SpriteNum)
}
int
InitActorExtra5Noise(short SpriteNum)
InitActorExtra5Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 10;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1050,9 +1050,9 @@ InitActorExtra5Noise(short SpriteNum)
}
int
InitActorExtra6Noise(short SpriteNum)
InitActorExtra6Noise(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
sw_snd_scratch = 11;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1070,9 +1070,9 @@ InitActorExtra6Noise(short SpriteNum)
*/
int
InitActorMoveCloser(short SpriteNum)
InitActorMoveCloser(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
//MONO_PRINT("Init Actor Move Closer\n");
@ -1081,15 +1081,15 @@ InitActorMoveCloser(short SpriteNum)
if (u->Rot != u->ActorActionSet->Run)
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorCantMoveCloser(short SpriteNum)
DoActorCantMoveCloser(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Can't move closer\n");
@ -1109,20 +1109,18 @@ DoActorCantMoveCloser(short SpriteNum)
}
else
{
int InitActorReposition(short SpriteNum);
// Try to move closer
//MONO_PRINT("Move Closer - Trying to move around\n");
InitActorReposition(SpriteNum);
InitActorReposition(u);
}
return 0;
}
int
DoActorMoveCloser(short SpriteNum)
DoActorMoveCloser(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -1137,7 +1135,7 @@ DoActorMoveCloser(short SpriteNum)
if (ActorMoveHitReact(SpriteNum))
return 0;
DoActorCantMoveCloser(SpriteNum);
DoActorCantMoveCloser(u);
return 0;
}
@ -1168,7 +1166,7 @@ DoActorMoveCloser(short SpriteNum)
if (!CanSeePlayer(SpriteNum))
{
// stay put and choose another option
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
else
@ -1181,7 +1179,7 @@ DoActorMoveCloser(short SpriteNum)
// Should be a random value test
if (u->Dist > 512 * 3)
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
@ -1364,9 +1362,9 @@ FindWanderTrack(USERp u)
int
InitActorRunAway(short SpriteNum)
InitActorRunAway(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Init Actor RunAway\n");
@ -1386,7 +1384,7 @@ InitActorRunAway(short SpriteNum)
else
{
SET(u->Flags, SPR_RUN_AWAY);
InitActorReposition(SpriteNum);
InitActorReposition(u);
////DSPRINTF(ds, "Actor RunAway\n");
//MONO_PRINT(ds);
}
@ -1395,16 +1393,16 @@ InitActorRunAway(short SpriteNum)
}
int
InitActorRunToward(short SpriteNum)
InitActorRunToward(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
//MONO_PRINT("InitActorRunToward\n");
u->ActorActionFunc = DoActorDecide;
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
InitActorReposition(SpriteNum);
InitActorReposition(u);
DoActorSetSpeed(SpriteNum, FAST_SPEED);
return 0;
@ -1418,9 +1416,9 @@ InitActorRunToward(short SpriteNum)
int
InitActorAttack(short SpriteNum)
InitActorAttack(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
// zombie is attacking a player
@ -1437,7 +1435,7 @@ InitActorAttack(short SpriteNum)
if (TEST(sprite[u->tgt_sp-sprite].cstat, CSTAT_SPRITE_TRANSLUCENT))
{
InitActorRunAway(SpriteNum);
InitActorRunAway(u);
return 0;
}
@ -1445,13 +1443,13 @@ InitActorAttack(short SpriteNum)
User[u->tgt_sp-sprite]->Health <= 0)
{
DoActorPickClosePlayer(SpriteNum);
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
if (!CanHitPlayer(SpriteNum))
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
@ -1462,7 +1460,7 @@ InitActorAttack(short SpriteNum)
TEST(User[u->tgt_sp-sprite]->PlayerP->Flags, PF_DEAD))
{
DoActorPickClosePlayer(SpriteNum);
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
@ -1477,7 +1475,7 @@ InitActorAttack(short SpriteNum)
// If it's your own kind, lay off!
if (u->ID == User[u->tgt_sp - sprite]->ID && !User[u->tgt_sp - sprite]->PlayerP)
{
InitActorRunAway(SpriteNum);
InitActorRunAway(u);
return 0;
}
@ -1516,16 +1514,17 @@ InitActorAttack(short SpriteNum)
}
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorAttack(short SpriteNum)
DoActorAttack(USER* u)
{
USERp u = User[SpriteNum].Data(),pu;
int SpriteNum = u->SpriteNum;
USERp pu;
SPRITEp sp = User[SpriteNum]->SpriteP;
short rand_num;
int dist,a,b,c;
@ -1560,9 +1559,9 @@ DoActorAttack(short SpriteNum)
}
int
InitActorEvade(short SpriteNum)
InitActorEvade(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Init Actor Evade\n");
@ -1588,9 +1587,9 @@ InitActorEvade(short SpriteNum)
}
int
InitActorWanderAround(short SpriteNum)
InitActorWanderAround(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//DSPRINTF(ds, "InitActorWanderAround\n");
@ -1613,9 +1612,9 @@ InitActorWanderAround(short SpriteNum)
}
int
InitActorFindPlayer(short SpriteNum)
InitActorFindPlayer(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int DoActorFindPlayer(short SpriteNum);
@ -1638,7 +1637,7 @@ InitActorFindPlayer(short SpriteNum)
}
else
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
}
@ -1646,9 +1645,9 @@ InitActorFindPlayer(short SpriteNum)
}
int
InitActorDuck(short SpriteNum)
InitActorDuck(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
short dist;
@ -1676,15 +1675,15 @@ InitActorDuck(short SpriteNum)
}
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorDuck(short SpriteNum)
DoActorDuck(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if ((u->WaitTics -= ACTORMOVETICS) < 0)
{
@ -1698,9 +1697,9 @@ DoActorDuck(short SpriteNum)
}
int
DoActorMoveJump(short SpriteNum)
DoActorMoveJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -1713,7 +1712,7 @@ DoActorMoveJump(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
@ -1928,10 +1927,9 @@ FindNewAngle(short SpriteNum, signed char dir, int DistToMove)
#if REPOSITION == 2
int
InitActorReposition(short SpriteNum)
InitActorReposition(USER* u)
{
int DoActorReposition(short SpriteNum);
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
short ang;
int rnum;
@ -1987,7 +1985,7 @@ InitActorReposition(short SpriteNum)
if (ang == -1)
{
u->Vis = 8;
InitActorPause(SpriteNum);
InitActorPause(u);
return 0;
}
@ -2008,7 +2006,7 @@ InitActorReposition(short SpriteNum)
if (ang == -1)
{
u->Vis = 8;
InitActorPause(SpriteNum);
InitActorPause(u);
return 0;
}
}
@ -2029,15 +2027,15 @@ InitActorReposition(short SpriteNum)
if (!TEST(u->Flags, SPR_SWIMMING))
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorReposition(short SpriteNum)
DoActorReposition(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2051,14 +2049,14 @@ DoActorReposition(short SpriteNum)
return 0;
u->Vis = 6;
InitActorPause(SpriteNum);
InitActorPause(u);
return 0;
}
// if close to target distance do a Decision again
if (u->TargetDist < 50)
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
@ -2066,9 +2064,9 @@ DoActorReposition(short SpriteNum)
int
InitActorPause(short SpriteNum)
InitActorPause(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
u->ActorActionFunc = DoActorPause;
@ -2076,15 +2074,15 @@ InitActorPause(short SpriteNum)
//if (!TEST(u->Flags, SPR_SWIMMING))
//NewStateGroup(SpriteNum, u->ActorActionSet->Stand);
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorPause(short SpriteNum)
DoActorPause(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
// Using Vis instead of WaitTics, var name sucks, but it's the same type
// WaitTics is used by too much other actor code and causes problems here
@ -2102,10 +2100,9 @@ DoActorPause(short SpriteNum)
// just leaving it here to look at
#if REPOSITION == 1
int
InitActorReposition(short SpriteNum)
InitActorReposition(USER* u)
{
int DoActorReposition(short SpriteNum);
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("InitActorReposition\n");
@ -2116,15 +2113,15 @@ InitActorReposition(short SpriteNum)
u->ActorActionFunc = DoActorReposition;
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorReposition(short SpriteNum)
DoActorReposition(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2136,7 +2133,7 @@ DoActorReposition(short SpriteNum)
if (ActorMoveHitReact(SpriteNum))
return 0;
InitActorPause(SpriteNum);
InitActorPause(u);
return 0;
}
@ -2145,9 +2142,9 @@ DoActorReposition(short SpriteNum)
int
InitActorPause(short SpriteNum)
InitActorPause(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("InitActorPause\n");
@ -2156,15 +2153,15 @@ InitActorPause(short SpriteNum)
//NewStateGroup(SpriteNum, u->ActorActionSet->Stand);
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int
DoActorPause(short SpriteNum)
DoActorPause(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
if ((u->WaitTics -= ACTORMOVETICS) < 0)

View file

@ -80,41 +80,41 @@ bool CanSeePlayer(short SpriteNum);
int CanHitPlayer(short SpriteNum);
int DoActorPickClosePlayer(short SpriteNum);
int CloseRangeDist(SPRITEp sp1,SPRITEp sp2);
int InitActorDecide(short SpriteNum);
int DoActorDecide(short SpriteNum);
int InitActorAlertNoise(short SpriteNum);
int InitActorAmbientNoise(short SpriteNum);
int InitActorAttackNoise(short SpriteNum);
int InitActorPainNoise(short SpriteNum);
int InitActorDieNoise(short SpriteNum);
int InitActorExtra1Noise(short SpriteNum);
int InitActorExtra2Noise(short SpriteNum);
int InitActorExtra3Noise(short SpriteNum);
int InitActorExtra4Noise(short SpriteNum);
int InitActorExtra5Noise(short SpriteNum);
int InitActorExtra6Noise(short SpriteNum);
int InitActorMoveCloser(short SpriteNum);
int DoActorCantMoveCloser(short SpriteNum);
int DoActorMoveCloser(short SpriteNum);
int InitActorDecide(USER* SpriteNum);
int DoActorDecide(USER* SpriteNum);
int InitActorAlertNoise(USER* SpriteNum);
int InitActorAmbientNoise(USER* SpriteNum);
int InitActorAttackNoise(USER* SpriteNum);
int InitActorPainNoise(USER* SpriteNum);
int InitActorDieNoise(USER* SpriteNum);
int InitActorExtra1Noise(USER* SpriteNum);
int InitActorExtra2Noise(USER* SpriteNum);
int InitActorExtra3Noise(USER* SpriteNum);
int InitActorExtra4Noise(USER* SpriteNum);
int InitActorExtra5Noise(USER* SpriteNum);
int InitActorExtra6Noise(USER* SpriteNum);
int InitActorMoveCloser(USER* SpriteNum);
int DoActorCantMoveCloser(USER* SpriteNum);
int DoActorMoveCloser(USER* SpriteNum);
short FindTrackToPlayer(USERp u);
short FindTrackAwayFromPlayer(USERp u);
short FindWanderTrack(USERp u);
int InitActorRunAway(short SpriteNum);
int InitActorRunToward(short SpriteNum);
int InitActorAttack(short SpriteNum);
int DoActorAttack(short SpriteNum);
int InitActorEvade(short SpriteNum);
int InitActorWanderAround(short SpriteNum);
int InitActorFindPlayer(short SpriteNum);
int InitActorDuck(short SpriteNum);
int DoActorDuck(short SpriteNum);
int DoActorMoveJump(short SpriteNum);
int InitActorRunAway(USER* SpriteNum);
int InitActorRunToward(USER* SpriteNum);
int InitActorAttack(USER* SpriteNum);
int DoActorAttack(USER* SpriteNum);
int InitActorEvade(USER* SpriteNum);
int InitActorWanderAround(USER* SpriteNum);
int InitActorFindPlayer(USER* SpriteNum);
int InitActorDuck(USER* SpriteNum);
int DoActorDuck(USER* SpriteNum);
int DoActorMoveJump(USER* SpriteNum);
int move_scan(short SpriteNum,short ang,int dist,int *stopx,int *stopy,int *stopz,short *stopsect);
int FindNewAngle(short SpriteNum,signed char dir,int DistToMove);
int InitActorReposition(short SpriteNum);
int DoActorReposition(short SpriteNum);
int InitActorPause(short SpriteNum);
int DoActorPause(short SpriteNum);
int InitActorReposition(USER* SpriteNum);
int DoActorReposition(USER* SpriteNum);
int InitActorPause(USER* SpriteNum);
int DoActorPause(USER* SpriteNum);
/*
ANIMATOR

View file

@ -537,7 +537,7 @@ STATEp sg_BunnyFall[] =
//////////////////////
#define BUNNY_JUMP_ATTACK_RATE 35
int DoBunnyBeginJumpAttack(short SpriteNum);
int DoBunnyBeginJumpAttack(USER* SpriteNum);
STATE s_BunnyJumpAttack[5][6] =
{
@ -850,10 +850,10 @@ PickBunnyJumpSpeed(short SpriteNum, int pix_height)
//
int
DoBunnyBeginJumpAttack(short SpriteNum)
DoBunnyBeginJumpAttack(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -885,10 +885,9 @@ DoBunnyBeginJumpAttack(short SpriteNum)
}
int
DoBunnyMoveJump(short SpriteNum)
DoBunnyMoveJump(USERp u)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->s();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -898,32 +897,32 @@ DoBunnyMoveJump(short SpriteNum)
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
move_actor(SpriteNum, nx, ny, 0L);
move_actor(u->SpriteNum, nx, ny, 0L);
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
DoActorZrange(SpriteNum);
DoActorZrange(u->SpriteNum);
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
// if (DoBunnyQuickJump(SpriteNum))
// return (0);
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
}
int
DoPickCloseBunny(short SpriteNum)
DoPickCloseBunny(USERp u)
{
USERp u = User[SpriteNum].Data(), tu;
SPRITEp sp = &sprite[SpriteNum],tsp;
USERp tu;
SPRITEp sp = u->s(),tsp;
int dist, near_dist = 1000, a,b,c;
int i;
//short BunnyCount=0, Bunny_Result = -1;
@ -960,15 +959,15 @@ DoPickCloseBunny(short SpriteNum)
}
int
DoBunnyQuickJump(short SpriteNum)
DoBunnyQuickJump(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal != PALETTE_PLAYER8) return false;
if (!u->lo_sp && u->spal == PALETTE_PLAYER8 && MoveSkip4)
DoPickCloseBunny(SpriteNum);
DoPickCloseBunny(u);
// Random Chance of like sexes fighting
if (u->lo_sp)
@ -1096,17 +1095,16 @@ DoBunnyQuickJump(short SpriteNum)
int
NullBunny(short SpriteNum)
NullBunny(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
// stay on floor unless doing certain things
@ -1114,29 +1112,29 @@ NullBunny(short SpriteNum)
KeepActorOnFloor(SpriteNum);
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoBunnyPain(short SpriteNum)
int DoBunnyPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullBunny(SpriteNum);
NullBunny(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int DoBunnyRipHeart(short SpriteNum)
int DoBunnyRipHeart(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = u->tgt_sp;
@ -1148,12 +1146,12 @@ int DoBunnyRipHeart(short SpriteNum)
return 0;
}
int DoBunnyStandKill(short SpriteNum)
int DoBunnyStandKill(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
NullBunny(SpriteNum);
NullBunny(u);
// Growl like the bad ass bunny you are!
if (RandomRange(1000) > 800)
@ -1236,7 +1234,7 @@ void BunnyHatch(short Weapon)
// if I didn't do this here they get stuck in the air sometimes
DoActorZrange(New);
DoActorJump(New);
DoActorJump(nu);
}
}
@ -1306,16 +1304,16 @@ int BunnyHatch2(short Weapon)
// if I didn't do this here they get stuck in the air sometimes
DoActorZrange(New);
DoActorJump(New);
DoActorJump(nu);
return New;
}
int
DoBunnyMove(short SpriteNum)
DoBunnyMove(USER* u)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
auto sp = u->s();
int SpriteNum = u->SpriteNum;
// Parental lock crap
if (TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE))
@ -1333,30 +1331,30 @@ DoBunnyMove(short SpriteNum)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
// if on a player/enemy sprite jump quickly
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
DoBunnyQuickJump(SpriteNum);
DoBunnyQuickJump(u);
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
// stay on floor unless doing certain things
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
if (RandomRange(1000) > 985 && sp->pal != PALETTE_PLAYER1 && u->track < 0)
{
@ -1377,7 +1375,7 @@ DoBunnyMove(short SpriteNum)
default:
sp->ang = NORM_ANGLE(RandomRange(2048 << 6) >> 6);
u->jump_speed = -350;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
u->ActorActionFunc = DoActorMoveJump;
break;
}
@ -1387,42 +1385,43 @@ DoBunnyMove(short SpriteNum)
}
int
BunnySpew(short SpriteNum)
BunnySpew(USER* u)
{
int SpriteNum = u->SpriteNum;
//InitBloodSpray(SpriteNum,true,-1);
InitBloodSpray(SpriteNum,true,-1);
return 0;
}
int
DoBunnyEat(short SpriteNum)
DoBunnyEat(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
// if on a player/enemy sprite jump quickly
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
DoBunnyQuickJump(SpriteNum);
DoBunnyQuickJump(u);
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// stay on floor unless doing certain things
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
switch (sector[sp->sectnum].floorpicnum)
{
@ -1447,27 +1446,27 @@ DoBunnyEat(short SpriteNum)
}
int
DoBunnyScrew(short SpriteNum)
DoBunnyScrew(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else
DoActorFall(SpriteNum);
DoActorFall(u);
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// stay on floor unless doing certain things
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
if (RandomRange(1000) > 990) // Bunny sex sounds
{
@ -1496,10 +1495,10 @@ DoBunnyScrew(short SpriteNum)
}
int
DoBunnyGrowUp(short SpriteNum)
DoBunnyGrowUp(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->pal == PALETTE_PLAYER1) return 0; // Don't bother white bunnies

View file

@ -585,13 +585,11 @@ NewCoolg(short SpriteNum)
int
DoCoolgBirth(short New)
DoCoolgBirth(USER* u)
{
USERp u;
int New = u->SpriteNum;
ANIMATOR DoActorDecide;
u = User[New].Data();
u->Health = HEALTH_COOLIE_GHOST;
u->Attrib = &CoolgAttrib;
DoActorSetSpeed(New, NORM_SPEED);
@ -610,18 +608,18 @@ DoCoolgBirth(short New)
return 0;
}
int NullCoolg(short SpriteNum)
int NullCoolg(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
u->ShellNum -= ACTORMOVETICS;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoCoolgMatchPlayerZ(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
@ -709,11 +707,10 @@ int DoCoolgMatchPlayerZ(short SpriteNum)
return 0;
}
int InitCoolgCircle(short SpriteNum)
int InitCoolgCircle(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ActorActionFunc = DoCoolgCircle;
@ -737,15 +734,15 @@ int InitCoolgCircle(short SpriteNum)
u->WaitTics = (RandomRange(3)+1) * 120;
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int DoCoolgCircle(short SpriteNum)
int DoCoolgCircle(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx,ny,bound;
@ -756,7 +753,7 @@ int DoCoolgCircle(short SpriteNum)
if (!move_actor(SpriteNum, nx, ny, 0L))
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
@ -768,14 +765,14 @@ int DoCoolgCircle(short SpriteNum)
{
// bumped something
u->sz = bound;
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
// time out
if ((u->WaitTics -= ACTORMOVETICS) < 0)
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
u->WaitTics = 0;
return 0;
}
@ -785,10 +782,10 @@ int DoCoolgCircle(short SpriteNum)
int
DoCoolgDeath(short SpriteNum)
DoCoolgDeath(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
@ -809,7 +806,7 @@ DoCoolgDeath(short SpriteNum)
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// slide while falling
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
@ -830,10 +827,10 @@ DoCoolgDeath(short SpriteNum)
return 0;
}
int DoCoolgMove(short SpriteNum)
int DoCoolgMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->ShellNum -= ACTORMOVETICS) <= 0)
{
@ -895,13 +892,13 @@ int DoCoolgMove(short SpriteNum)
}
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
{
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
}
if (RANDOM_P2(1024) < 32 && !TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE))
@ -909,21 +906,19 @@ int DoCoolgMove(short SpriteNum)
DoCoolgMatchPlayerZ(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoCoolgPain(short SpriteNum)
int DoCoolgPain(USER* u)
{
USERp u = User[SpriteNum].Data();
NullCoolg(SpriteNum);
NullCoolg(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}

View file

@ -558,9 +558,10 @@ SetupCoolie(short SpriteNum)
int NewCoolg(short);
int SpawnCoolg(short SpriteNum)
int SpawnCoolg(USER* u)
{
int SpriteNum = u->SpriteNum;
// Don't do a ghost every time
if (RandomRange(1000) > 700 || Skill < MinEnemySkill - 1)
{
@ -574,55 +575,55 @@ int SpawnCoolg(short SpriteNum)
return 0;
}
int CooliePain(short SpriteNum)
int CooliePain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int NullCoolie(short SpriteNum)
int NullCoolie(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoCoolieMove(short SpriteNum)
int DoCoolieMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
KeepActorOnFloor(SpriteNum);
if (DoActorSectorDamage(SpriteNum))
if (DoActorSectorDamage(u))
{
return 0;
}
@ -638,8 +639,9 @@ int DoCoolieMove(short SpriteNum)
return 0;
}
int InitCoolieCharge(short SpriteNum)
int InitCoolieCharge(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
if (RANDOM_P2(1024) > 950)
@ -647,7 +649,7 @@ int InitCoolieCharge(short SpriteNum)
DoActorSetSpeed(SpriteNum, FAST_SPEED);
InitActorMoveCloser(SpriteNum);
InitActorMoveCloser(u);
NewStateGroup(SpriteNum, sg_CoolieCharge);
@ -656,11 +658,9 @@ int InitCoolieCharge(short SpriteNum)
int
DoCoolieWaitBirth(short SpriteNum)
DoCoolieWaitBirth(USER* u)
{
USERp u;
u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if ((u->Counter -= ACTORMOVETICS) <= 0)
{

View file

@ -354,7 +354,7 @@ ACTOR_ACTION_SET EelActionSet =
nullptr
};
int DoEelMatchPlayerZ(short SpriteNum);
int DoEelMatchPlayerZ(USER* SpriteNum);
void
@ -413,9 +413,9 @@ SetupEel(short SpriteNum)
#if 0
int
NewEel(short SpriteNum)
NewEel(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp nu;
SPRITEp np;
@ -443,24 +443,24 @@ NewEel(short SpriteNum)
}
#endif
int NullEel(short SpriteNum)
int NullEel(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoEelMatchPlayerZ(SpriteNum);
DoEelMatchPlayerZ(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoEelMatchPlayerZ(short SpriteNum)
int DoEelMatchPlayerZ(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = User[SpriteNum]->tgt_sp;
int zdiff,zdist;
int loz,hiz;
@ -558,10 +558,10 @@ int DoEelMatchPlayerZ(short SpriteNum)
}
int
DoEelDeath(short SpriteNum)
DoEelDeath(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
if (TEST(u->Flags, SPR_FALLING))
{
@ -575,7 +575,7 @@ DoEelDeath(short SpriteNum)
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// slide while falling
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
@ -599,9 +599,9 @@ DoEelDeath(short SpriteNum)
return 0;
}
int DoEelMove(short SpriteNum)
int DoEelMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
ASSERT(u->Rot != nullptr);
@ -609,16 +609,16 @@ int DoEelMove(short SpriteNum)
NewStateGroup(SpriteNum, u->ActorActionSet->CloseAttack[0]);
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
DoEelMatchPlayerZ(SpriteNum);
DoEelMatchPlayerZ(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;

View file

@ -527,7 +527,8 @@ typedef struct PANEL_SPRITEstruct PANEL_SPRITE, *PANEL_SPRITEp;
struct ANIMstruct;
typedef struct ANIMstruct ANIM, *ANIMp;
typedef int ANIMATOR (int16_t SpriteNum);
struct USER;
typedef int ANIMATOR (USER* SpriteNum);
typedef ANIMATOR *ANIMATORp;
typedef void pANIMATOR (PANEL_SPRITEp);
@ -566,7 +567,7 @@ struct STATEstruct
typedef enum {WATER_FOOT, BLOOD_FOOT} FOOT_TYPE;
extern FOOT_TYPE FootMode;
int QueueFloorBlood(short hit_sprite); // Weapon.c
int QueueFloorBlood(USER* hit_sprite); // Weapon.c
int QueueFootPrint(short hit_sprite); // Weapon.c
int QueueGeneric(short SpriteNum, short pic); // Weapon.c
int QueueLoWangs(short SpriteNum); // Weapon.c
@ -1129,6 +1130,7 @@ struct USER
short SpriteNum;
short Attach; // attach to sprite if needed - electro snake
SPRITEp SpriteP;
SPRITEp s() { return SpriteP;}
// if a player's sprite points to player structure
PLAYERp PlayerP;
@ -1854,6 +1856,7 @@ ANIMATOR NullAnimator;
int Distance(int x1, int y1, int x2, int y2);
int NewStateGroup(short SpriteNum, STATEp SpriteGroup[]);
int NewStateGroup(USERp user, STATEp SpriteGroup[]);
void SectorMidPoint(short sectnum, int *xmid, int *ymid, int *zmid);
USERp SpawnUser(short SpriteNum, short id, STATEp state);
@ -2075,7 +2078,6 @@ int PickJumpMaxSpeed(short SpriteNum, short max_speed); // ripper.c
int DoRipperRipHeart(short SpriteNum); // ripper.c
int DoRipper2RipHeart(short SpriteNum); // ripper2.c
int BunnyHatch2(short Weapon); // bunny.c
int DoSkullBeginDeath(int16_t SpriteNum); // skull.c
void TerminateLevel(void); // game.c
void DrawMenuLevelScreen(void); // game.c

View file

@ -40,7 +40,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
int DoHariKariBlood(short SpriteNum);
//int InitActorMoveCloser(short SpriteNum);
DECISION GirlNinjaBattle[] =
@ -751,29 +750,29 @@ SetupGirlNinja(short SpriteNum)
int
DoGirlNinjaMove(short SpriteNum)
DoGirlNinjaMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
// jumping and falling
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING) && !TEST(u->Flags, SPR_CLIMBING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else if (TEST(u->Flags, SPR_FALLING))
DoActorFall(SpriteNum);
DoActorFall(u);
}
// sliding
if (TEST(u->Flags, SPR_SLIDING) && !TEST(u->Flags, SPR_CLIMBING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// !AIC - do track or call current action function - such as DoActorMoveCloser()
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
{
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
}
// stay on floor unless doing certain things
@ -783,15 +782,15 @@ DoGirlNinjaMove(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int
GirlNinjaJumpActionFunc(short SpriteNum)
GirlNinjaJumpActionFunc(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -807,47 +806,47 @@ GirlNinjaJumpActionFunc(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
}
int
NullGirlNinja(short SpriteNum)
NullGirlNinja(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->WaitTics > 0) u->WaitTics -= ACTORMOVETICS;
if (TEST(u->Flags, SPR_SLIDING) && !TEST(u->Flags, SPR_CLIMBING) && !TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags, SPR_CLIMBING) && !TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoGirlNinjaPain(short SpriteNum)
int DoGirlNinjaPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullGirlNinja(SpriteNum);
NullGirlNinja(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int DoGirlNinjaSpecial(short SpriteNum)
int DoGirlNinjaSpecial(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal == PALETTE_PLAYER5)
{

View file

@ -513,53 +513,47 @@ SetupGoro(short SpriteNum)
return 0;
}
int NullGoro(short SpriteNum)
int NullGoro(USER* u)
{
USERp u = User[SpriteNum].Data();
ASSERT(SpriteNum >= 0);
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoGoroPain(short SpriteNum)
int DoGoroPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
ASSERT(SpriteNum >= 0);
NullGoro(SpriteNum);
NullGoro(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int DoGoroMove(short SpriteNum)
int DoGoroMove(USER* u)
{
USERp u = User[SpriteNum].Data();
ASSERT(SpriteNum >= 0);
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
ASSERT(User[SpriteNum].Data());
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}

View file

@ -332,16 +332,16 @@ SetupHornet(short SpriteNum)
return 0;
}
int NullHornet(short SpriteNum)
int NullHornet(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoHornetMatchPlayerZ(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
@ -421,10 +421,10 @@ int DoHornetMatchPlayerZ(short SpriteNum)
return 0;
}
int InitHornetCircle(short SpriteNum)
int InitHornetCircle(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ActorActionFunc = DoHornetCircle;
@ -448,15 +448,15 @@ int InitHornetCircle(short SpriteNum)
u->WaitTics = (RandomRange(3)+1) * 60;
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
return 0;
}
int DoHornetCircle(short SpriteNum)
int DoHornetCircle(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx,ny,bound;
sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
@ -476,7 +476,7 @@ int DoHornetCircle(short SpriteNum)
if (!move_actor(SpriteNum, nx, ny, 0L))
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
}
@ -489,14 +489,14 @@ int DoHornetCircle(short SpriteNum)
{
// bumped something
u->sz = bound;
InitActorReposition(SpriteNum);
InitActorReposition(u);
return 0;
}
// time out
if ((u->WaitTics -= ACTORMOVETICS) < 0)
{
InitActorReposition(SpriteNum);
InitActorReposition(u);
u->WaitTics = 0;
return 0;
}
@ -506,10 +506,10 @@ int DoHornetCircle(short SpriteNum)
int
DoHornetDeath(short SpriteNum)
DoHornetDeath(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
if (TEST(u->Flags, SPR_FALLING))
@ -528,7 +528,7 @@ DoHornetDeath(short SpriteNum)
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// slide while falling
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
@ -550,11 +550,12 @@ DoHornetDeath(short SpriteNum)
}
// Hornets can swarm around other hornets or whatever is tagged as swarm target
int DoCheckSwarm(short SpriteNum)
int DoCheckSwarm(USER* u)
{
int SpriteNum = u->SpriteNum;
int i;
SPRITEp sp = &sprite[SpriteNum], tsp;
USERp u = User[SpriteNum].Data(), tu;
USERp tu;
int dist, pdist, a,b,c;
PLAYERp pp;
@ -596,28 +597,28 @@ int DoCheckSwarm(short SpriteNum)
}
int DoHornetMove(short SpriteNum)
int DoHornetMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
// Check for swarming
// lotag of 1 = Swarm around lotags of 2
// lotag of 0 is normal
if (sp->hitag == TAG_SWARMSPOT && sp->lotag == 1)
DoCheckSwarm(SpriteNum);
DoCheckSwarm(u);
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
DoHornetMatchPlayerZ(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}

View file

@ -257,10 +257,10 @@ STATE s_BloodSprayDrip[] =
/////////////////////////////////////////////////////////////////////////////////////////////
int
DoWallBloodDrip(short SpriteNum)
DoWallBloodDrip(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
//sp->z += (300+RandomRange(2300)) >> 1;
@ -366,10 +366,10 @@ SpawnFloorSplash(short SpriteNum)
int
DoBloodSpray(int16_t Weapon)
DoBloodSpray(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
int cz,fz;
if (TEST(u->Flags, SPR_UNDERWATER))
@ -593,10 +593,10 @@ DoBloodSpray(int16_t Weapon)
int
DoPhosphorus(int16_t Weapon)
DoPhosphorus(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -817,10 +817,10 @@ DoPhosphorus(int16_t Weapon)
}
int
DoChemBomb(int16_t Weapon)
DoChemBomb(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -1063,9 +1063,9 @@ DoChemBomb(int16_t Weapon)
}
int
DoCaltropsStick(int16_t Weapon)
DoCaltropsStick(USER* u)
{
USERp u = User[Weapon].Data();
int Weapon = u->SpriteNum;
u->Counter = !u->Counter;
@ -1076,10 +1076,10 @@ DoCaltropsStick(int16_t Weapon)
}
int
DoCaltrops(int16_t Weapon)
DoCaltrops(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -1332,10 +1332,10 @@ SpawnRadiationCloud(short SpriteNum)
}
int
DoRadiationCloud(short SpriteNum)
DoRadiationCloud(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
sp->z -= sp->zvel;
@ -1642,13 +1642,15 @@ PlayerInitFlashBomb(PLAYERp pp)
}
int
InitFlashBomb(int16_t SpriteNum)
InitFlashBomb(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
int i;
unsigned int stat;
int dist, tx, ty, tmin;
short damage;
SPRITEp sp = &sprite[SpriteNum], hp;
SPRITEp hp;
USERp hu;
PLAYERp pp = Player + screenpeek;
@ -2081,8 +2083,9 @@ InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity)
}
int
BloodSprayFall(int16_t SpriteNum)
BloodSprayFall(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
sp->z += 1500;
@ -2171,10 +2174,10 @@ DoFlagRangeTest(short Weapon, short range)
}
int
DoCarryFlag(int16_t Weapon)
DoCarryFlag(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
#define FLAG_DETONATE_STATE 99
SPRITEp fp = &sprite[u->FlagOwner];
@ -2326,10 +2329,11 @@ DoCarryFlag(int16_t Weapon)
}
int
DoCarryFlagNoDet(int16_t Weapon)
DoCarryFlagNoDet(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
SPRITEp ap = &sprite[u->Attach];
USERp au = User[u->Attach].Data();
SPRITEp fp = &sprite[u->FlagOwner];
@ -2416,10 +2420,10 @@ SetCarryFlag(int16_t Weapon)
}
int
DoFlag(int16_t Weapon)
DoFlag(USER* u)
{
int Weapon = u->SpriteNum;
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon].Data();
int16_t hit_sprite = -1;
hit_sprite = DoFlagRangeTest(Weapon, 1000);

View file

@ -485,34 +485,34 @@ SetupLava(short SpriteNum)
return 0;
}
int NullLava(short SpriteNum)
int NullLava(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoLavaMove(short SpriteNum)
int DoLavaMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}

View file

@ -66,8 +66,8 @@ int DoJump(short SpriteNum);
int DoBeginFall(short SpriteNum);
int DoFall(short SpriteNum);
void KeepActorOnFloor(short SpriteNum);
int DoActorSlide(short SpriteNum);
int DoActorSectorDamage(short SpriteNum);
int DoActorSlide(USERp SpriteNum);
int DoActorSectorDamage(USERp SpriteNum);
int DoScaleSprite(short SpriteNum);
void InitPlayerSprite(PLAYERp pp);

View file

@ -149,9 +149,9 @@ SetupToiletGirl(short SpriteNum)
return 0;
}
int DoToiletGirl(short SpriteNum)
int DoToiletGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -201,15 +201,15 @@ int DoToiletGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullToiletGirl(short SpriteNum)
int NullToiletGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -239,9 +239,9 @@ int NullToiletGirl(short SpriteNum)
return 0;
}
int ToiletGirlUzi(short SpriteNum)
int ToiletGirlUzi(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -256,11 +256,11 @@ int ToiletGirlUzi(short SpriteNum)
return 0;
}
int ToiletGirlPain(short SpriteNum)
int ToiletGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullToiletGirl(SpriteNum);
NullToiletGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_ToiletGirlStand);
@ -388,9 +388,9 @@ SetupWashGirl(short SpriteNum)
return 0;
}
int DoWashGirl(short SpriteNum)
int DoWashGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -446,15 +446,15 @@ int DoWashGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullWashGirl(short SpriteNum)
int NullWashGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -484,9 +484,9 @@ int NullWashGirl(short SpriteNum)
return 0;
}
int WashGirlUzi(short SpriteNum)
int WashGirlUzi(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -501,11 +501,10 @@ int WashGirlUzi(short SpriteNum)
return 0;
}
int WashGirlPain(short SpriteNum)
int WashGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
NullWashGirl(SpriteNum);
int SpriteNum = u->SpriteNum;
NullWashGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_WashGirlStand);
@ -597,16 +596,16 @@ SetupTrashCan(short SpriteNum)
return 0;
}
int DoTrashCan(short SpriteNum)
int DoTrashCan(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//(*u->ActorActionFunc) (SpriteNum);
// stay on floor unless doing certain things
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING | SPR_CLIMBING))
{
@ -618,12 +617,12 @@ int DoTrashCan(short SpriteNum)
return 0;
}
int TrashCanPain(short SpriteNum)
int TrashCanPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -705,10 +704,10 @@ SetupPachinkoLight(short SpriteNum)
return 0;
}
int PachinkoLightOperate(short SpriteNum)
int PachinkoLightOperate(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
{
@ -804,10 +803,10 @@ SetupPachinko1(short SpriteNum)
return 0;
}
int PachinkoCheckWin(short SpriteNum)
int PachinkoCheckWin(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
u->WaitTics = 0; // Can operate it again now
@ -869,9 +868,9 @@ int PachinkoCheckWin(short SpriteNum)
return 0;
}
int Pachinko1Operate(short SpriteNum)
int Pachinko1Operate(USER* u)
{
SPRITEp sp = &sprite[SpriteNum];
SPRITEp sp = u->s();
short rnd;
rnd = RandomRange(1000);
@ -1260,9 +1259,9 @@ SetupCarGirl(short SpriteNum)
return 0;
}
int DoCarGirl(short SpriteNum)
int DoCarGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1303,15 +1302,15 @@ int DoCarGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullCarGirl(short SpriteNum)
int NullCarGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1348,9 +1347,9 @@ int NullCarGirl(short SpriteNum)
return 0;
}
int CarGirlUzi(short SpriteNum)
int CarGirlUzi(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1365,11 +1364,10 @@ int CarGirlUzi(short SpriteNum)
return 0;
}
int CarGirlPain(short SpriteNum)
int CarGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
NullCarGirl(SpriteNum);
int SpriteNum = u->SpriteNum;
NullCarGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_CarGirlStand);
@ -1479,9 +1477,9 @@ SetupMechanicGirl(short SpriteNum)
return 0;
}
int DoMechanicGirl(short SpriteNum)
int DoMechanicGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1522,15 +1520,15 @@ int DoMechanicGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullMechanicGirl(short SpriteNum)
int NullMechanicGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1567,10 +1565,9 @@ int NullMechanicGirl(short SpriteNum)
return 0;
}
int MechanicGirlDrill(short SpriteNum)
int MechanicGirlDrill(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1584,11 +1581,11 @@ int MechanicGirlDrill(short SpriteNum)
return 0;
}
int MechanicGirlPain(short SpriteNum)
int MechanicGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullMechanicGirl(SpriteNum);
NullMechanicGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_MechanicGirlStand);
@ -1699,9 +1696,9 @@ SetupSailorGirl(short SpriteNum)
return 0;
}
int DoSailorGirl(short SpriteNum)
int DoSailorGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1746,15 +1743,15 @@ int DoSailorGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullSailorGirl(short SpriteNum)
int NullSailorGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
static short alreadythrew = 0;
@ -1796,9 +1793,9 @@ int NullSailorGirl(short SpriteNum)
return 0;
}
int SailorGirlThrow(short SpriteNum)
int SailorGirlThrow(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1813,11 +1810,10 @@ int SailorGirlThrow(short SpriteNum)
return 0;
}
int SailorGirlPain(short SpriteNum)
int SailorGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
NullSailorGirl(SpriteNum);
int SpriteNum = u->SpriteNum;
NullSailorGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_SailorGirlStand);
@ -1911,9 +1907,9 @@ SetupPruneGirl(short SpriteNum)
return 0;
}
int DoPruneGirl(short SpriteNum)
int DoPruneGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1970,15 +1966,15 @@ int DoPruneGirl(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
sp->xvel = sp->yvel = sp->zvel = 0;
return 0;
}
int NullPruneGirl(short SpriteNum)
int NullPruneGirl(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -2014,9 +2010,9 @@ int NullPruneGirl(short SpriteNum)
return 0;
}
int PruneGirlUzi(short SpriteNum)
int PruneGirlUzi(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -2031,11 +2027,11 @@ int PruneGirlUzi(short SpriteNum)
return 0;
}
int PruneGirlPain(short SpriteNum)
int PruneGirlPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullPruneGirl(SpriteNum);
NullPruneGirl(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
ChangeState(SpriteNum,s_PruneGirlStand);

View file

@ -1405,7 +1405,6 @@ STATEp sg_NinjaUzi[] =
#define NINJA_HARI_KARI_WAIT_RATE 200
#define NINJA_HARI_KARI_FALL_RATE 16
ANIMATOR DoHariKariBlood;
ANIMATOR DoNinjaSpecial;
STATE s_NinjaHariKari[] =
@ -1810,13 +1809,6 @@ ACTOR_ACTION_SET PlayerNinjaActionSet =
sg_PlayerNinjaSwim
};
int
DoHariKariBlood(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
return 0;
}
/*
@ -1947,9 +1939,9 @@ SetupNinja(short SpriteNum)
}
int
DoNinjaHariKari(short SpriteNum)
DoNinjaHariKari(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
short cnt,i;
@ -1977,9 +1969,9 @@ DoNinjaHariKari(short SpriteNum)
}
int
DoNinjaGrabThroat(short SpriteNum)
DoNinjaGrabThroat(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
@ -2003,7 +1995,7 @@ DoNinjaGrabThroat(short SpriteNum)
ChangeState(SpriteNum, u->StateEnd);
sp->xvel = 0;
//u->jump_speed = -300;
//DoActorBeginJump(SpriteNum);
//DoActorBeginJump(u);
PlaySound(DIGI_NINJASCREAM, sp, v3df_follow);
}
@ -2017,9 +2009,9 @@ DoNinjaGrabThroat(short SpriteNum)
*/
int
DoNinjaMove(short SpriteNum)
DoNinjaMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags2, SPR2_DYING))
{
@ -2034,21 +2026,21 @@ DoNinjaMove(short SpriteNum)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING) && !TEST(u->Flags, SPR_CLIMBING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else if (TEST(u->Flags, SPR_FALLING))
DoActorFall(SpriteNum);
DoActorFall(u);
}
// sliding
if (TEST(u->Flags, SPR_SLIDING) && !TEST(u->Flags, SPR_CLIMBING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// !AIC - do track or call current action function - such as DoActorMoveCloser()
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
{
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
}
// stay on floor unless doing certain things
@ -2058,15 +2050,15 @@ DoNinjaMove(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int
NinjaJumpActionFunc(short SpriteNum)
NinjaJumpActionFunc(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2082,7 +2074,7 @@ NinjaJumpActionFunc(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
return 0;
@ -2096,29 +2088,29 @@ NinjaJumpActionFunc(short SpriteNum)
*/
int
NullNinja(short SpriteNum)
NullNinja(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->WaitTics > 0) u->WaitTics -= ACTORMOVETICS;
if (TEST(u->Flags, SPR_SLIDING) && !TEST(u->Flags, SPR_CLIMBING) && !TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags, SPR_CLIMBING) && !TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoNinjaPain(short SpriteNum)
int DoNinjaPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullNinja(SpriteNum);
NullNinja(u);
if (TEST(u->Flags2, SPR2_DYING))
{
@ -2130,16 +2122,16 @@ int DoNinjaPain(short SpriteNum)
}
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int DoNinjaSpecial(short SpriteNum)
int DoNinjaSpecial(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal == PALETTE_PLAYER5)
{
RESET(sp->cstat,CSTAT_SPRITE_TRANSLUCENT);
@ -2150,20 +2142,21 @@ int DoNinjaSpecial(short SpriteNum)
return 0;
}
int CheckFire(short SpriteNum)
int CheckFire(USER* u)
{
int SpriteNum = u->SpriteNum;
if (!CanSeePlayer(SpriteNum))
InitActorDuck(SpriteNum);
InitActorDuck(u);
return 0;
}
int
DoNinjaCeiling(short SpriteNum)
DoNinjaCeiling(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
@ -2509,8 +2502,6 @@ SpawnPlayerUnderSprite(PLAYERp pp)
static saveable_code saveable_ninja_code[] =
{
SAVE_CODE(DoHariKariBlood),
SAVE_CODE(SetupNinja),
SAVE_CODE(DoNinjaHariKari),
SAVE_CODE(DoNinjaGrabThroat),
SAVE_CODE(DoNinjaMove),

View file

@ -105,7 +105,7 @@ int ChangeWeapon(PLAYERp);
ANIMATOR InitFire;
int
NullAnimator(short)
NullAnimator(USER*)
{
return 0;
}
@ -433,7 +433,6 @@ void PlayerUpdateArmor(PLAYERp pp, short value)
int WeaponOperate(PLAYERp pp)
{
short weapon;
int DoPlayerSpriteReset(short SpriteNum);
USERp u = User[pp->PlayerSprite].Data();

View file

@ -197,7 +197,7 @@ extern short target_ang;
#if 1
#define PLAYER_NINJA_RATE 14
int DoFootPrints(short SpriteNum);
int DoFootPrints(USERp SpriteNum);
STATE s_PlayerNinjaRun[5][6] =
{
@ -360,7 +360,7 @@ STATEp sg_PlayerNinjaStand[] =
#define PLAYER_NINJA_STAR_RATE 12
extern STATEp sg_NinjaRun[];
int DoPlayerSpriteReset(short SpriteNum);
int DoPlayerSpriteReset(USERp SpriteNum);
#if 0
STATE s_PlayerNinjaThrow[5][4] =
@ -1077,9 +1077,9 @@ DoPlayerSpriteThrow(PLAYERp pp)
}
int
DoPlayerSpriteReset(short SpriteNum)
DoPlayerSpriteReset(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
PLAYERp pp;
if (!u->PlayerP)
@ -2621,6 +2621,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
while ((i = it2.NextIndex()) >= 0)
{
sp = &sprite[i];
auto u = User[i].Data();
if (testpointinquad(sp->x, sp->y, x, y))
{
@ -2632,7 +2633,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
if (vel < 9000)
{
DoActorBeginSlide(i, getangle(pp->xvect, pp->yvect), vel/8, 5);
if (DoActorSlide(i))
if (DoActorSlide(u))
continue;
}
@ -6792,7 +6793,7 @@ PlayerStateControl(int16_t SpriteNum)
while (TEST(u->State->Tics, SF_QUICK_CALL))
{
// Call it once and go to the next state
(*u->State->Animator)(SpriteNum);
(*u->State->Animator)(u);
// if still on the same QUICK_CALL should you
// go to the next state.
@ -6816,7 +6817,7 @@ PlayerStateControl(int16_t SpriteNum)
// Call the correct animator
if (TEST(u->State->Tics, SF_PLAYER_FUNC))
if (u->State->Animator)
(*u->State->Animator)(SpriteNum);
(*u->State->Animator)(u);
return;
}
@ -7473,9 +7474,9 @@ InitMultiPlayerInfo(void)
// If player stepped in something gooey, track it all over the place.
int
DoFootPrints(short SpriteNum)
DoFootPrints(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->PlayerP)
{

View file

@ -553,7 +553,7 @@ STATEp sg_RipperFall[] =
//////////////////////
#define RIPPER_JUMP_ATTACK_RATE 35
int DoRipperBeginJumpAttack(short SpriteNum);
int DoRipperBeginJumpAttack(USERp SpriteNum);
STATE s_RipperJumpAttack[5][6] =
{
@ -937,10 +937,10 @@ PickJumpMaxSpeed(short SpriteNum, short max_speed)
//
int
InitRipperHang(short SpriteNum)
InitRipperHang(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int dist;
hitdata_t hitinfo = { { 0, 0, 0 }, -2, 0, -2 };
@ -976,7 +976,7 @@ InitRipperHang(short SpriteNum)
if (!Found)
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
@ -999,9 +999,9 @@ InitRipperHang(short SpriteNum)
}
int
DoRipperHang(short SpriteNum)
DoRipperHang(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if ((u->WaitTics -= ACTORMOVETICS) > 0)
return 0;
@ -1013,10 +1013,10 @@ DoRipperHang(short SpriteNum)
}
int
DoRipperMoveHang(short SpriteNum)
DoRipperMoveHang(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
// Move while jumping
@ -1053,9 +1053,9 @@ DoRipperMoveHang(short SpriteNum)
int
DoRipperHangJF(short SpriteNum)
DoRipperHangJF(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1067,13 +1067,13 @@ DoRipperHangJF(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipperQuickJump(SpriteNum))
if (DoRipperQuickJump(u))
return 0;
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
DoRipperMoveHang(SpriteNum);
DoRipperMoveHang(u);
return 0;
@ -1084,10 +1084,10 @@ DoRipperHangJF(short SpriteNum)
//
int
DoRipperBeginJumpAttack(short SpriteNum)
DoRipperBeginJumpAttack(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -1119,9 +1119,9 @@ DoRipperBeginJumpAttack(short SpriteNum)
}
int
DoRipperMoveJump(short SpriteNum)
DoRipperMoveJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1133,13 +1133,13 @@ DoRipperMoveJump(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipperQuickJump(SpriteNum))
if (DoRipperQuickJump(u))
return 0;
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
DoRipperMoveHang(SpriteNum);
DoRipperMoveHang(u);
return 0;
}
@ -1148,10 +1148,9 @@ DoRipperMoveJump(short SpriteNum)
//
int
DoRipperQuickJump(short SpriteNum)
DoRipperQuickJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
// Tests to see if ripper is on top of a player/enemy and then immediatly
// does another jump
@ -1173,27 +1172,27 @@ DoRipperQuickJump(short SpriteNum)
int
NullRipper(short SpriteNum)
NullRipper(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoRipperPain(short SpriteNum)
int DoRipperPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullRipper(SpriteNum);
NullRipper(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
@ -1216,14 +1215,13 @@ int DoRipperRipHeart(short SpriteNum)
return 0;
}
// CTW MODIFICATION
//int DoRipperStandHeart(SpriteNum)
int DoRipperStandHeart(short SpriteNum)
// CTW MODIFICATION END
{
USERp u = User[SpriteNum].Data();
NullRipper(SpriteNum);
//int DoRipperStandHeart(SpriteNum)
int DoRipperStandHeart(USER* u)
{
int SpriteNum = u->SpriteNum;
NullRipper(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
NewStateGroup(SpriteNum, sg_RipperRun);
@ -1282,9 +1280,9 @@ void RipperHatch(short Weapon)
}
int
DoRipperMove(short SpriteNum)
DoRipperMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->scale_speed)
{
@ -1302,21 +1300,21 @@ DoRipperMove(short SpriteNum)
// if on a player/enemy sprite jump quickly
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipperQuickJump(SpriteNum))
if (DoRipperQuickJump(u))
return 0;
KeepActorOnFloor(SpriteNum);
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}

View file

@ -37,8 +37,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
int DoCheckSwarm(short SpriteNum);
ANIMATOR InitRipper2Hang;
ANIMATOR DoActorMoveJump;
ANIMATOR DoRipper2MoveJump;
@ -610,7 +608,7 @@ STATEp sg_Ripper2Fall[] =
//////////////////////
#define RIPPER2_JUMP_ATTACK_RATE 35
int DoRipper2BeginJumpAttack(short SpriteNum);
int DoRipper2BeginJumpAttack(USERp SpriteNum);
STATE s_Ripper2JumpAttack[5][6] =
{
@ -937,10 +935,10 @@ SetupRipper2(short SpriteNum)
//
int
InitRipper2Hang(short SpriteNum)
InitRipper2Hang(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int dist;
hitdata_t hitinfo = { { 0, 0, 0 }, -2, 0, -2 };
@ -975,7 +973,7 @@ InitRipper2Hang(short SpriteNum)
if (!Found)
{
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
@ -998,9 +996,9 @@ InitRipper2Hang(short SpriteNum)
}
int
DoRipper2Hang(short SpriteNum)
DoRipper2Hang(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if ((u->WaitTics -= ACTORMOVETICS) > 0)
return 0;
@ -1013,10 +1011,10 @@ DoRipper2Hang(short SpriteNum)
}
int
DoRipper2MoveHang(short SpriteNum)
DoRipper2MoveHang(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
// Move while jumping
@ -1060,9 +1058,9 @@ DoRipper2MoveHang(short SpriteNum)
int
DoRipper2HangJF(short SpriteNum)
DoRipper2HangJF(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1074,13 +1072,13 @@ DoRipper2HangJF(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipper2QuickJump(SpriteNum))
if (DoRipper2QuickJump(u))
return 0;
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
DoRipper2MoveHang(SpriteNum);
DoRipper2MoveHang(u);
return 0;
@ -1091,10 +1089,10 @@ DoRipper2HangJF(short SpriteNum)
//
int
DoRipper2BeginJumpAttack(short SpriteNum)
DoRipper2BeginJumpAttack(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -1133,9 +1131,9 @@ DoRipper2BeginJumpAttack(short SpriteNum)
}
int
DoRipper2MoveJump(short SpriteNum)
DoRipper2MoveJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1147,13 +1145,13 @@ DoRipper2MoveJump(short SpriteNum)
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipper2QuickJump(SpriteNum))
if (DoRipper2QuickJump(u))
return 0;
InitActorDecide(SpriteNum);
InitActorDecide(u);
}
DoRipper2MoveHang(SpriteNum);
DoRipper2MoveHang(u);
return 0;
}
@ -1162,9 +1160,9 @@ DoRipper2MoveJump(short SpriteNum)
//
int
DoRipper2QuickJump(short SpriteNum)
DoRipper2QuickJump(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
// Tests to see if ripper2 is on top of a player/enemy and then immediatly
// does another jump
@ -1187,27 +1185,26 @@ DoRipper2QuickJump(short SpriteNum)
int
NullRipper2(short SpriteNum)
NullRipper2(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoRipper2Pain(short SpriteNum)
int DoRipper2Pain(USER* u)
{
USERp u = User[SpriteNum].Data();
NullRipper2(SpriteNum);
int SpriteNum = u->SpriteNum;
NullRipper2(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
@ -1227,12 +1224,12 @@ int DoRipper2RipHeart(short SpriteNum)
return 0;
}
int DoRipper2StandHeart(short SpriteNum)
int DoRipper2StandHeart(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
NullRipper2(SpriteNum);
NullRipper2(u);
if (!SoundValidAndActive(sp, CHAN_RipHeart))
PlaySound(DIGI_RIPPER2HEARTOUT, sp, v3df_none, CHAN_RipHeart);
@ -1297,13 +1294,13 @@ void Ripper2Hatch(short Weapon)
}
int
DoRipper2Move(short SpriteNum)
DoRipper2Move(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->hitag == TAG_SWARMSPOT && sp->lotag == 1)
DoCheckSwarm(SpriteNum);
DoCheckSwarm(u);
if (u->scale_speed)
{
@ -1321,39 +1318,41 @@ DoRipper2Move(short SpriteNum)
// if on a player/enemy sprite jump quickly
if (!TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (DoRipper2QuickJump(SpriteNum))
if (DoRipper2QuickJump(u))
return 0;
KeepActorOnFloor(SpriteNum);
}
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int InitRipper2Charge(short SpriteNum)
int InitRipper2Charge(USER* u)
{
int SpriteNum = u->SpriteNum;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
InitActorMoveCloser(SpriteNum);
InitActorMoveCloser(u);
NewStateGroup(SpriteNum, sg_Ripper2RunFast);
return 0;
}
int ChestRipper2(short SpriteNum)
int ChestRipper2(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
PlaySound(DIGI_RIPPER2CHEST, sp, v3df_follow);

View file

@ -433,10 +433,9 @@ int DoRotatorMove(short SpriteNum)
return 0;
}
int DoRotator(short SpriteNum)
int DoRotator(USER* u)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
int SpriteNum = u->SpriteNum;
// could move this inside sprite control
DoRotatorMove(SpriteNum);

View file

@ -51,7 +51,7 @@ BEGIN_SW_NS
#define LAVAMAXDROPS 32
#define DEFAULT_DOOR_SPEED 800
int InitFireballTrap(short SpriteNum);
int InitFireballTrap(USER* SpriteNum);
ANIMATOR DoGrating;
void DoPlayerBeginForceJump(PLAYERp);
@ -1112,9 +1112,9 @@ DoExplodeSector(short match)
}
int DoSpawnSpot(short SpriteNum)
int DoSpawnSpot(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if ((u->WaitTics -= synctics) < 0)
{
@ -2043,7 +2043,7 @@ int DoTrapMatch(short match)
if (u->WaitTics <= 0)
{
u->WaitTics = 1 * 120;
InitFireballTrap(i);
InitFireballTrap(u);
}
}
@ -2055,7 +2055,7 @@ int DoTrapMatch(short match)
if (u->WaitTics <= 0)
{
u->WaitTics = 1 * 120;
InitBoltTrap(i);
InitBoltTrap(u);
}
}
@ -2246,7 +2246,7 @@ OperateContinuousTrigger(PLAYERp pp)
if (u->WaitTics <= 0)
{
u->WaitTics = 1 * 120;
InitFireballTrap(i);
InitFireballTrap(u);
}
}
@ -2258,7 +2258,7 @@ OperateContinuousTrigger(PLAYERp pp)
if (u->WaitTics <= 0)
{
u->WaitTics = 1 * 120;
InitBoltTrap(i);
InitBoltTrap(u);
}
}

View file

@ -753,31 +753,31 @@ SetupSerp(short SpriteNum)
return 0;
}
int NullSerp(short SpriteNum)
int NullSerp(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
KeepActorOnFloor(SpriteNum);
//DoActorSectorDamage(SpriteNum);
//DoActorSectorDamage(u);
return 0;
}
int DoSerpMove(short SpriteNum)
int DoSerpMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
// serp ring
if (sp->pal != 16)
@ -804,12 +804,13 @@ int DoSerpMove(short SpriteNum)
KeepActorOnFloor(SpriteNum);
//DoActorSectorDamage(SpriteNum);
//DoActorSectorDamage(u);
return 0;
}
int DoDeathSpecial(short SpriteNum)
int DoDeathSpecial(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
DoMatchEverything(nullptr, sp->lotag, ON);

View file

@ -533,8 +533,9 @@ SetupSkel(short SpriteNum)
return 0;
}
int DoSkelInitTeleport(short SpriteNum)
int DoSkelInitTeleport(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -544,8 +545,9 @@ int DoSkelInitTeleport(short SpriteNum)
return 0;
}
int DoSkelTeleport(short SpriteNum)
int DoSkelTeleport(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
int x,y;
@ -577,8 +579,9 @@ int DoSkelTeleport(short SpriteNum)
return 0;
}
int DoSkelTermTeleport(short SpriteNum)
int DoSkelTermTeleport(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
SET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -586,46 +589,45 @@ int DoSkelTermTeleport(short SpriteNum)
return 0;
}
int NullSkel(short SpriteNum)
int NullSkel(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoSkelPain(short SpriteNum)
int DoSkelPain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullSkel(SpriteNum);
NullSkel(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}
int DoSkelMove(short SpriteNum)
int DoSkelMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}

View file

@ -34,9 +34,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
int InitSpriteGrenade(short SpriteNum);
int InitSpriteGrenade(USER* SpriteNum);
int InitSpriteChemBomb(short SpriteNum);
int InitFlashBomb(short SpriteNum);
int InitFlashBomb(USER* SpriteNum);
int InitCaltrops(short SpriteNum);
int InitPhosphorus(int16_t SpriteNum);
bool SpriteOverlapZ(int16_t, int16_t, int);
@ -262,10 +262,10 @@ SetupSkull(short SpriteNum)
}
int
DoSkullMove(int16_t SpriteNum)
DoSkullMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int32_t dax, day, daz;
dax = MOVEx(sp->xvel, sp->ang);
@ -279,10 +279,10 @@ DoSkullMove(int16_t SpriteNum)
}
int
DoSkullBeginDeath(int16_t SpriteNum)
DoSkullBeginDeath(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int16_t i,num_ord=0;
//extern short *DamageRadiusSkull;
@ -320,7 +320,7 @@ DoSkullBeginDeath(int16_t SpriteNum)
case 3:
UpdateSinglePlayKills(SpriteNum);
InitFlashBomb(SpriteNum);
InitFlashBomb(u);
break;
case 4:
@ -331,7 +331,7 @@ DoSkullBeginDeath(int16_t SpriteNum)
for (i=0; i<num_ord; i++)
{
sp->ang = NORM_ANGLE(sp->ang+(i*(2048/num_ord)));
InitSpriteGrenade(SpriteNum);
InitSpriteGrenade(u);
}
break;
default:
@ -366,14 +366,14 @@ DoSkullBeginDeath(int16_t SpriteNum)
}
int DoSkullJump(short SpriteNum)
int DoSkullJump(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->xvel)
DoSkullMove(SpriteNum);
DoSkullMove(u);
else
sp->ang = NORM_ANGLE(sp->ang + (64 * ACTORMOVETICS));
@ -397,7 +397,7 @@ int DoSkullJump(short SpriteNum)
SpriteOverlapZ(SpriteNum, short(u->tgt_sp - sprite), Z(32)))
{
UpdateSinglePlayKills(SpriteNum);
DoSkullBeginDeath(SpriteNum);
DoSkullBeginDeath(u);
return 0;
}
@ -405,7 +405,7 @@ int DoSkullJump(short SpriteNum)
{
sp->z = u->loz - Z(36);
UpdateSinglePlayKills(SpriteNum);
DoSkullBeginDeath(SpriteNum);
DoSkullBeginDeath(u);
return 0;
}
}
@ -415,7 +415,7 @@ int DoSkullJump(short SpriteNum)
if (u->jump_speed > 200)
{
UpdateSinglePlayKills(SpriteNum);
DoSkullBeginDeath(SpriteNum);
DoSkullBeginDeath(u);
}
}
@ -423,16 +423,16 @@ int DoSkullJump(short SpriteNum)
else
{
UpdateSinglePlayKills(SpriteNum);
DoSkullBeginDeath(SpriteNum);
DoSkullBeginDeath(u);
}
return 0;
}
int DoSkullBob(short SpriteNum)
int DoSkullBob(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
// actor does a sine wave about u->sz - this is the z mid point
#define SKULL_BOB_AMT (Z(16))
@ -444,8 +444,9 @@ int DoSkullBob(short SpriteNum)
return 0;
}
int DoSkullSpawnShrap(short SpriteNum)
int DoSkullSpawnShrap(USER* u)
{
int SpriteNum = u->SpriteNum;
int SpawnShrap(short, short);
SpawnShrap(SpriteNum, -1);
@ -454,10 +455,10 @@ int DoSkullSpawnShrap(short SpriteNum)
return 0;
}
int DoSkullWait(short SpriteNum)
int DoSkullWait(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int a,b,c,dist;
DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c);
@ -490,7 +491,7 @@ int DoSkullWait(short SpriteNum)
{
sp->ang = NORM_ANGLE(sp->ang + (48 * ACTORMOVETICS));
DoSkullBob(SpriteNum);
DoSkullBob(u);
if (dist < 8000)
{
@ -680,10 +681,10 @@ SetupBetty(short SpriteNum)
}
int
DoBettyMove(int16_t SpriteNum)
DoBettyMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int32_t dax, day, daz;
dax = MOVEx(sp->xvel, sp->ang);
@ -697,10 +698,10 @@ DoBettyMove(int16_t SpriteNum)
}
int
DoBettyBeginDeath(int16_t SpriteNum)
DoBettyBeginDeath(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int16_t i,num_ord=0;
//extern short *DamageRadiusBetty;
@ -733,7 +734,7 @@ DoBettyBeginDeath(int16_t SpriteNum)
break;
case 3:
InitFlashBomb(SpriteNum);
InitFlashBomb(u);
break;
case 4:
@ -744,7 +745,7 @@ DoBettyBeginDeath(int16_t SpriteNum)
for (i=0; i<num_ord; i++)
{
sp->ang = NORM_ANGLE(sp->ang + (i*(2048/num_ord)));
InitSpriteGrenade(SpriteNum);
InitSpriteGrenade(u);
}
break;
default:
@ -779,14 +780,14 @@ DoBettyBeginDeath(int16_t SpriteNum)
}
int DoBettyJump(short SpriteNum)
int DoBettyJump(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->xvel)
DoBettyMove(SpriteNum);
DoBettyMove(u);
else
sp->ang = NORM_ANGLE(sp->ang + (64 * ACTORMOVETICS));
@ -809,7 +810,7 @@ int DoBettyJump(short SpriteNum)
SpriteOverlapZ(SpriteNum, short(u->tgt_sp - sprite), Z(32)))
{
UpdateSinglePlayKills(SpriteNum);
DoBettyBeginDeath(SpriteNum);
DoBettyBeginDeath(u);
return 0;
}
@ -817,7 +818,7 @@ int DoBettyJump(short SpriteNum)
{
sp->z = u->loz - Z(36);
UpdateSinglePlayKills(SpriteNum);
DoBettyBeginDeath(SpriteNum);
DoBettyBeginDeath(u);
return 0;
}
}
@ -827,7 +828,7 @@ int DoBettyJump(short SpriteNum)
if (u->jump_speed > 200)
{
UpdateSinglePlayKills(SpriteNum);
DoBettyBeginDeath(SpriteNum);
DoBettyBeginDeath(u);
}
}
@ -835,15 +836,15 @@ int DoBettyJump(short SpriteNum)
else
{
UpdateSinglePlayKills(SpriteNum);
DoBettyBeginDeath(SpriteNum);
DoBettyBeginDeath(u);
}
return 0;
}
int DoBettyBob(short SpriteNum)
int DoBettyBob(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
// actor does a sine wave about u->sz - this is the z mid point
#define BETTY_BOB_AMT (Z(16))
@ -855,18 +856,18 @@ int DoBettyBob(short SpriteNum)
return 0;
}
int DoBettySpawnShrap(short SpriteNum)
int DoBettySpawnShrap(USER* u)
{
int SpawnShrap(short, short);
SpawnShrap(SpriteNum, -1);
SpawnShrap(u->SpriteNum, -1);
//PlaySpriteSound(SpriteNum,attr_extra1,v3df_none);
return 0;
}
int DoBettyWait(short SpriteNum)
int DoBettyWait(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
int a,b,c,dist;
DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c);
@ -899,7 +900,7 @@ int DoBettyWait(short SpriteNum)
{
sp->ang = NORM_ANGLE(sp->ang + (48 * ACTORMOVETICS));
DoBettyBob(SpriteNum);
DoBettyBob(u);
if (dist < 8000)
{

View file

@ -679,10 +679,10 @@ int DoSlidorMove(short SpriteNum)
return 0;
}
int DoSlidor(short SpriteNum)
int DoSlidor(USER* u)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
SECTORp sectp = &sector[sp->sectnum];
DoSlidorMove(SpriteNum);

View file

@ -324,9 +324,9 @@ void MoveSpritesWithSpike(short sectnum)
}
}
int DoSpike(short SpriteNum)
int DoSpike(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = u->SpriteP;
int *lptr;
@ -442,9 +442,9 @@ int DoSpike(short SpriteNum)
return 0;
}
int DoSpikeAuto(short SpriteNum)
int DoSpikeAuto(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = u->SpriteP;
int *lptr;

View file

@ -51,35 +51,36 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
ANIMATOR SetupCoolie;
ANIMATOR SetupNinja;
ANIMATOR SetupGoro;
ANIMATOR SetupCoolg;
ANIMATOR SetupEel;
ANIMATOR SetupSumo;
ANIMATOR SetupZilla;
ANIMATOR SetupToiletGirl;
ANIMATOR SetupWashGirl;
ANIMATOR SetupCarGirl;
ANIMATOR SetupMechanicGirl;
ANIMATOR SetupSailorGirl;
ANIMATOR SetupPruneGirl;
ANIMATOR SetupTrashCan;
ANIMATOR SetupBunny;
ANIMATOR SetupRipper;
ANIMATOR SetupRipper2;
ANIMATOR SetupSerp;
ANIMATOR SetupLava;
ANIMATOR SetupSkel;
ANIMATOR SetupHornet;
ANIMATOR SetupSkull;
ANIMATOR SetupBetty;
ANIMATOR SetupPachinkoLight;
ANIMATOR SetupPachinko1;
ANIMATOR SetupPachinko2;
ANIMATOR SetupPachinko3;
ANIMATOR SetupPachinko4;
ANIMATOR SetupGirlNinja;
int SetupCoolie(short);
int SetupNinja(short);
int SetupGoro(short);
int SetupCoolg(short);
int SetupEel(short);
int SetupSumo(short);
int SetupZilla(short);
int SetupToiletGirl(short);
int SetupWashGirl(short);
int SetupCarGirl(short);
int SetupMechanicGirl(short);
int SetupSailorGirl(short);
int SetupPruneGirl(short);
int SetupTrashCan(short);
int SetupBunny(short);
int SetupRipper(short);
int SetupRipper2(short);
int SetupSerp(short);
int SetupLava(short);
int SetupSkel(short);
int SetupHornet(short);
int SetupSkull(short);
int SetupBetty(short);
int SetupPachinkoLight(short);
int SetupPachinko1(short);
int SetupPachinko2(short);
int SetupPachinko3(short);
int SetupPachinko4(short);
int SetupGirlNinja(short);
ANIMATOR DoVator, DoVatorAuto;
ANIMATOR DoRotator;
ANIMATOR DoSlidor;
@ -4671,6 +4672,11 @@ NewStateGroup(short SpriteNum, STATEp StateGroup[])
return 0;
}
int NewStateGroup(USERp user, STATEp StateGroup[])
{
return NewStateGroup(user->SpriteNum, StateGroup);
}
bool
SpriteOverlap(int16_t spritenum_a, int16_t spritenum_b)
@ -5141,16 +5147,18 @@ move_actor(short SpriteNum, int xchange, int ychange, int zchange)
}
int
DoStayOnFloor(short SpriteNum)
DoStayOnFloor(USER* u)
{
int SpriteNum = u->SpriteNum;
sprite[SpriteNum].z = sector[sprite[SpriteNum].sectnum].floorz;
//sprite[SpriteNum].z = getflorzofslope(sprite[SpriteNum].sectnum, sprite[SpriteNum].x, sprite[SpriteNum].y);
return 0;
}
int
DoGrating(short SpriteNum)
DoGrating(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
int dir;
#define GRATE_FACTOR 3
@ -5217,59 +5225,25 @@ DoSpriteFade(short SpriteNum)
}
#endif
int
SpearOnFloor(short SpriteNum)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (!TEST(u->Flags, SPR_SO_ATTACHED))
{
// if on a sprite bridge, stay with the sprite otherwize stay with
// the floor
if (u->lo_sp)
sp->z = u->loz;
else
sp->z = sector[sp->sectnum].floorz + u->sz;
}
return 0;
}
int
SpearOnCeiling(short SpriteNum)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (!TEST(u->Flags, SPR_SO_ATTACHED))
{
// if on a sprite bridge, stay with the sprite otherwize stay with
// the floor
if (u->hi_sp)
sp->z = u->hiz;
else
sp->z = sector[sp->sectnum].ceilingz + u->sz;
}
return 0;
}
int
DoKey(short SpriteNum)
DoKey(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
sp->ang = NORM_ANGLE(sp->ang + (14 * ACTORMOVETICS));
//DoSpriteFade(SpriteNum);
DoGet(SpriteNum);
DoGet(u);
return 0;
}
int
DoCoin(short SpriteNum)
DoCoin(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
int offset;
u->WaitTics -= ACTORMOVETICS * 2;
@ -5541,9 +5515,10 @@ struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL] =
#define ITEMFLASHAMT -8
#define ITEMFLASHCLR 144
int
DoGet(short SpriteNum)
DoGet(USER* u)
{
USERp u = User[SpriteNum].Data(), pu;
int SpriteNum = u->SpriteNum;
USERp pu;
SPRITEp sp = u->SpriteP;
PLAYERp pp;
short pnum, key_num;
@ -6515,92 +6490,6 @@ AdjustActiveRange(PLAYERp pp, short SpriteNum, int dist)
}
}
/*
!AIC KEY - Main processing loop for sprites. Sprites are separated and
traversed by STAT lists. Note the STAT_MISC, STAT_ENEMY, STAT_VATOR below.
Most everything here calls StateControl().
*/
#if DEBUG
#define INLINE_STATE 0
#else
#define INLINE_STATE 1
#endif
#define STATE_CONTROL(SpriteNum, sp, u, StateTics) \
if (!(u)->State) \
{ \
ASSERT((u)->ActorActionFunc); \
((u)->ActorActionFunc)((SpriteNum)); \
} \
else \
{ \
if ((sp)->statnum >= STAT_SKIP4_START && (sp)->statnum <= STAT_SKIP4_END) \
(u)->Tics += ACTORMOVETICS * 2; \
else \
(u)->Tics += ACTORMOVETICS; \
\
while ((u)->Tics >= TEST((u)->State->Tics, SF_TICS_MASK)) \
{ \
(StateTics) = TEST((u)->State->Tics, SF_TICS_MASK); \
\
if (TEST((u)->State->Tics, SF_TIC_ADJUST)) \
{ \
ASSERT((u)->Attrib); \
ASSERT((u)->speed < MAX_SPEED); \
ASSERT((StateTics) > -(u)->Attrib->TicAdjust[(u)->speed]); \
\
(StateTics) += (u)->Attrib->TicAdjust[(u)->speed]; \
} \
\
(u)->Tics -= (StateTics); \
\
(u)->State = (u)->State->NextState; \
\
while (TEST((u)->State->Tics, SF_QUICK_CALL)) \
{ \
(*(u)->State->Animator)((SpriteNum)); \
ASSERT(u); \
\
if (!(u)) \
break; \
\
if (TEST((u)->State->Tics, SF_QUICK_CALL)) \
(u)->State = (u)->State->NextState; \
} \
\
if (!(u)) \
break; \
\
if (!(u)->State->Pic) \
{ \
NewStateGroup((SpriteNum), (STATEp *) (u)->State->NextState); \
} \
} \
\
if (u) \
{ \
if (TEST((u)->State->Tics, SF_WALL_STATE)) \
{ \
ASSERT((u)->WallP); \
(u)->WallP->picnum = (u)->State->Pic; \
} \
else \
{ \
if ((u)->RotNum > 1) \
(sp)->picnum = (u)->Rot[0]->Pic; \
else \
(sp)->picnum = (u)->State->Pic; \
} \
\
if ((u)->State->Animator && (u)->State->Animator != NullAnimator) \
(*(u)->State->Animator)((SpriteNum)); \
} \
}
/*
@ -6620,7 +6509,7 @@ StateControl(int16_t SpriteNum)
if (!u->State)
{
ASSERT(u->ActorActionFunc);
(u->ActorActionFunc)(SpriteNum);
(u->ActorActionFunc)(u);
return 0;
}
@ -6653,7 +6542,7 @@ StateControl(int16_t SpriteNum)
while (TEST(u->State->Tics, SF_QUICK_CALL))
{
// Call it once and go to the next state
(*u->State->Animator)(SpriteNum);
(*u->State->Animator)(u);
ASSERT(u); //put this in to see if actor was getting killed with in his QUICK_CALL state
@ -6695,7 +6584,7 @@ StateControl(int16_t SpriteNum)
// Call the correct animator
if (u->State->Animator && u->State->Animator != NullAnimator)
(*u->State->Animator)(SpriteNum);
(*u->State->Animator)(u);
}
return 0;
@ -6717,17 +6606,8 @@ SpriteControl(void)
StatIterator it(STAT_MISC);
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
// ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != nullptr : true);
#else
ASSERT(User[i]);
StateControl(i);
// ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != nullptr : true);
#endif
}
// Items and skip2 things
@ -6738,17 +6618,7 @@ SpriteControl(void)
StatIterator it(stat);
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != nullptr : true);
#else
ASSERT(User[i]);
StateControl(i);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != nullptr : true);
#endif
}
}
}
@ -6788,13 +6658,7 @@ SpriteControl(void)
// Only update the ones close to ANY player
if (CloseToPlayer)
{
#if INLINE_STATE
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
#else
StateControl(i);
#endif
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != nullptr : true);
}
else
@ -6813,17 +6677,7 @@ SpriteControl(void)
StatIterator it(stat);
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != nullptr : true);
#else
ASSERT(User[i]);
StateControl(i);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != nullptr : true);
#endif
StateControl(i);
}
}
}
@ -6832,8 +6686,7 @@ SpriteControl(void)
while ((i = it.NextIndex()) >= 0)
{
if (User[i].Data() && User[i]->ActorActionFunc)
(*User[i]->ActorActionFunc)(i);
ASSERT(it.PeekIndex() >= 0 ? sprite[it.PeekIndex()].statnum != MAXSTATUS : true);
(*User[i]->ActorActionFunc)(User[i].Data());
}
if (MoveSkip8 == 0)
@ -6852,10 +6705,7 @@ SpriteControl(void)
it.Reset(STAT_WALLBLOOD_QUEUE);
while ((i = it.NextIndex()) >= 0)
{
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
StateControl(i);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != nullptr : true);
}
@ -6881,7 +6731,7 @@ SpriteControl(void)
if (!TEST(u->Flags, SPR_ACTIVE))
continue;
(*User[i]->ActorActionFunc)(i);
(*User[i]->ActorActionFunc)(u);
}
it.Reset(STAT_SPIKE);
@ -6903,7 +6753,7 @@ SpriteControl(void)
if (i == 69 && it.PeekIndex() == -1)
continue;
(*User[i]->ActorActionFunc)(i);
(*User[i]->ActorActionFunc)(u);
}
it.Reset(STAT_ROTATOR);
@ -6922,7 +6772,7 @@ SpriteControl(void)
if (!TEST(u->Flags, SPR_ACTIVE))
continue;
(*User[i]->ActorActionFunc)(i);
(*User[i]->ActorActionFunc)(u);
}
it.Reset(STAT_SLIDOR);
@ -6941,7 +6791,7 @@ SpriteControl(void)
if (!TEST(u->Flags, SPR_ACTIVE))
continue;
(*User[i]->ActorActionFunc)(i);
(*User[i]->ActorActionFunc)(u);
}
it.Reset(STAT_SUICIDE);
@ -7531,7 +7381,6 @@ move_ground_missile(short spritenum, int xchange, int ychange, int ceildist, int
return retval;
}
#include "saveable.h"
static saveable_code saveable_sprite_code[] =
@ -7540,8 +7389,6 @@ static saveable_code saveable_sprite_code[] =
SAVE_CODE(DoActorGlobZ),
SAVE_CODE(DoStayOnFloor),
SAVE_CODE(DoGrating),
SAVE_CODE(SpearOnFloor),
SAVE_CODE(SpearOnCeiling),
SAVE_CODE(DoKey),
SAVE_CODE(DoCoin),
SAVE_CODE(KillGet),

View file

@ -46,7 +46,6 @@ int DoBody(short SpriteNum);
bool CanMoveHere(int16_t spritenum);
bool SpriteOverlap(int16_t spritenum_a, int16_t spritenum_b);
int DoActorDie(short SpriteNum, short weapon);
int DoGet(short SpriteNum);
void SpriteControl(void);
void SetEnemyInactive(short SpriteNum);
void DoActorZrange(short SpriteNum);

View file

@ -676,36 +676,36 @@ SetupSumo(short SpriteNum)
return 0;
}
int NullSumo(short SpriteNum)
int NullSumo(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
//DoActorSlide(u);
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoSumoMove(short SpriteNum)
int DoSumoMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
//DoActorSlide(u);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
KeepActorOnFloor(SpriteNum);
if (DoActorSectorDamage(SpriteNum))
if (DoActorSectorDamage(u))
{
return 0;
}
@ -714,10 +714,10 @@ int DoSumoMove(short SpriteNum)
}
#if 0
int InitSumoCharge(short SpriteNum)
int InitSumoCharge(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (RANDOM_P2(1024) > 950)
PlaySound(DIGI_SUMOALERT, sp, v3df_follow);
@ -732,18 +732,19 @@ int InitSumoCharge(short SpriteNum)
}
#endif
int DoSumoRumble(short SpriteNum)
int DoSumoRumble(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SetSumoQuake(SpriteNum);
return 0;
}
int InitSumoFart(short SpriteNum)
int InitSumoFart(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
extern int InitSumoNapalm(short SpriteNum);
@ -757,8 +758,9 @@ int InitSumoFart(short SpriteNum)
return 0;
}
int InitSumoStomp(short SpriteNum)
int InitSumoStomp(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
extern int InitSumoStompAttack(short SpriteNum);
@ -769,8 +771,9 @@ int InitSumoStomp(short SpriteNum)
return 0;
}
int InitSumoClap(short SpriteNum)
int InitSumoClap(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
extern int InitMiniSumoClap(short SpriteNum);
extern int InitSumoSkull(short SpriteNum);
@ -782,10 +785,10 @@ int InitSumoClap(short SpriteNum)
return 0;
}
int DoSumoDeathMelt(short SpriteNum)
int DoSumoDeathMelt(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
PlaySound(DIGI_SUMOFART, sp, v3df_follow);

View file

@ -969,7 +969,7 @@ SectorObjectSetupBounds(SECTOR_OBJECTp sop)
break;
}
ASSERT(sn < SIZ(sop->sp_num) - 1);
ASSERT(sn < (int)SIZ(sop->sp_num) - 1);
sop->sp_num[sn] = sp_num;
so_setspriteinterpolation(sop, sp);
@ -3193,7 +3193,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
else
u->jump_speed = -tpoint->tag_high;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
u->ActorActionFunc = DoActorMoveJump;
}
@ -3240,7 +3240,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
u->jump_speed = PickJumpSpeed(SpriteNum, zdiff);
}
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
u->ActorActionFunc = DoActorMoveJump;
return false;
@ -3252,8 +3252,6 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
if (u->ActorActionSet->Jump)
{
int DoActorMoveJump(short SpriteNum);
sp->ang = tpoint->ang;
ActorLeaveTrack(SpriteNum);
@ -3267,7 +3265,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
u->jump_speed = -350;
}
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
u->ActorActionFunc = DoActorMoveJump;
return false;
}
@ -3288,7 +3286,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
if (u->Rot != u->ActorActionSet->Duck)
{
int DoActorDuck(short SpriteNum);
int DoActorDuck(USERp SpriteNum);
sp->ang = tpoint->ang;
@ -3299,7 +3297,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
else
u->WaitTics = tpoint->tag_high * 128;
InitActorDuck(SpriteNum);
InitActorDuck(u);
u->ActorActionFunc = DoActorDuck;
return false;
}
@ -3385,7 +3383,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
else
u->jump_speed = -tpoint->tag_high;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
}
break;
@ -3398,7 +3396,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
else
u->jump_speed = -tpoint->tag_high;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
}
break;
@ -3460,7 +3458,7 @@ ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
SET(u->Flags, SPR_DEAD);
sp->xvel <<= 1;
u->jump_speed = -495;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
NewStateGroup(SpriteNum, u->ActorActionSet->DeathJump);
}
@ -3767,7 +3765,7 @@ ActorFollowTrack(short SpriteNum, short locktics)
DoActorSetSpeed(SpriteNum, SLOW_SPEED);
u->ActorActionFunc = NinjaJumpActionFunc;
u->jump_speed = -650;
DoActorBeginJump(SpriteNum);
DoActorBeginJump(u);
return true;
}

View file

@ -453,9 +453,9 @@ int DoVatorMove(short SpriteNum, int *lptr)
}
int DoVator(short SpriteNum)
int DoVator(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
int *lptr;
@ -622,9 +622,9 @@ int DoVator(short SpriteNum)
return 0;
}
int DoVatorAuto(short SpriteNum)
int DoVatorAuto(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
int *lptr;

File diff suppressed because it is too large Load diff

View file

@ -160,7 +160,7 @@ int DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec);
int GetOverlapSector(int x, int y, short *over, short *under);
bool MissileHitDiveArea(short SpriteNum);
int DoDamageTest(short);
int DoDamageTest(USERp);
extern short StatDamageList[STAT_DAMAGE_LIST_SIZE];
@ -208,10 +208,10 @@ void InitSpellRing(PLAYERp pp);
void InitSpellNapalm(PLAYERp pp);
int InitUzi(PLAYERp pp);
int InitSobjGun(PLAYERp pp);
int InitBoltTrap(short SpriteNum);
int InitBoltTrap(USER* SpriteNum);
int InitSpearTrap(short SpriteNum);
int InitTurretMgun(SECTOR_OBJECTp sop);
int InitVulcanBoulder(short SpriteNum);
int InitVulcanBoulder(USERp SpriteNum);
int DoBladeDamage(short SpriteNum);
int DoFindGround(int16_t SpriteNum);
int DoFindGroundPoint(int16_t SpriteNum);
@ -233,7 +233,7 @@ int SpawnTracerExp(int16_t Weapon);
int SpawnGoroFireballExp(int16_t Weapon);
bool MissileHitMatch(short Weapon,short WeaponNum,short hit_sprite);
int DoItemFly(int16_t SpriteNum);
int SpawnVehicleSmoke(short SpriteNum);
int SpawnVehicleSmoke(USERp SpriteNum);
short PrevWall(short wall_num);
int DoDamage(short SpriteNum,short Weapon);

View file

@ -678,13 +678,13 @@ SetupZilla(short SpriteNum)
return 0;
}
int NullZilla(short SpriteNum)
int NullZilla(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
SPRITEp sp = User[SpriteNum]->SpriteP;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
//DoActorSlide(u);
#if 0
if (u->State == s_ZillaDie)
@ -705,19 +705,19 @@ int NullZilla(short SpriteNum)
u->hi_sp = nullptr;
sp->z = u->loz;
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoZillaMove(short SpriteNum)
int DoZillaMove(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
short choose;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
//DoActorSlide(u);
// Random Zilla taunts
if (!SoundValidAndActive(sp, CHAN_AnimeMad))
@ -737,11 +737,11 @@ int DoZillaMove(short SpriteNum)
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
KeepActorOnFloor(SpriteNum);
if (DoActorSectorDamage(SpriteNum))
if (DoActorSectorDamage(u))
{
return 0;
}
@ -749,8 +749,9 @@ int DoZillaMove(short SpriteNum)
return 0;
}
int DoZillaStomp(short SpriteNum)
int DoZillaStomp(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
PlaySound(DIGI_ZILLASTOMP, sp, v3df_follow);
@ -760,10 +761,10 @@ int DoZillaStomp(short SpriteNum)
extern int SpawnGrenadeExp(int16_t Weapon);
int DoZillaDeathMelt(short SpriteNum)
int DoZillaDeathMelt(USER* u)
{
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
if (RandomRange(1000) > 800)
SpawnGrenadeExp(SpriteNum);

View file

@ -880,9 +880,9 @@ SpawnZombie2(short Weapon)
}
int
DoZombieMove(short SpriteNum)
DoZombieMove(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->Counter3++ >= ZOMBIE_TIME_LIMIT)
{
@ -900,21 +900,21 @@ DoZombieMove(short SpriteNum)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
if (TEST(u->Flags, SPR_JUMPING))
DoActorJump(SpriteNum);
DoActorJump(u);
else if (TEST(u->Flags, SPR_FALLING))
DoActorFall(SpriteNum);
DoActorFall(u);
}
// sliding
if (TEST(u->Flags, SPR_SLIDING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
// Do track or call current action function - such as DoActorMoveCloser()
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
else
{
(*u->ActorActionFunc)(SpriteNum);
(*u->ActorActionFunc)(u);
}
// stay on floor unless doing certain things
@ -924,15 +924,15 @@ DoZombieMove(short SpriteNum)
}
// take damage from environment
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int
NullZombie(short SpriteNum)
NullZombie(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
if (u->Counter3++ >= ZOMBIE_TIME_LIMIT)
{
@ -950,25 +950,25 @@ NullZombie(short SpriteNum)
u->WaitTics -= ACTORMOVETICS;
if (TEST(u->Flags, SPR_SLIDING) && !TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
DoActorSlide(SpriteNum);
DoActorSlide(u);
if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
KeepActorOnFloor(SpriteNum);
DoActorSectorDamage(SpriteNum);
DoActorSectorDamage(u);
return 0;
}
int DoZombiePain(short SpriteNum)
int DoZombiePain(USER* u)
{
USERp u = User[SpriteNum].Data();
int SpriteNum = u->SpriteNum;
NullZombie(SpriteNum);
NullZombie(u);
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
InitActorDecide(SpriteNum);
InitActorDecide(u);
return 0;
}