mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- smaller stuff
This commit is contained in:
parent
6d7337e41b
commit
959147c656
7 changed files with 36 additions and 61 deletions
|
@ -815,14 +815,13 @@ int PachinkoCheckWin(DSWActor* actor)
|
|||
SWStatIterator it(STAT_ENEMY);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
tsp = &itActor->s();
|
||||
tu = itActor->u();
|
||||
|
||||
if (tsp->lotag == TAG_PACHINKOLIGHT)
|
||||
if (itActor->spr.lotag == TAG_PACHINKOLIGHT)
|
||||
{
|
||||
if (tsp->hitag == SP_TAG5(actor))
|
||||
if (itActor->spr.hitag == SP_TAG5(actor))
|
||||
{
|
||||
tsp->shade = -90; // Full brightness
|
||||
itActor->spr.shade = -90; // Full brightness
|
||||
tu->WaitTics = SEC(3); // Flash
|
||||
ChangeState(itActor,s_PachinkoLightOperate);
|
||||
}
|
||||
|
|
|
@ -114,7 +114,6 @@ short DoSectorObjectSetScale(short match)
|
|||
short DoSOevent(short match, short state)
|
||||
{
|
||||
SECTOR_OBJECTp sop;
|
||||
SPRITEp me_sp;
|
||||
short vel_adj=0, spin_adj=0;
|
||||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
|
@ -138,19 +137,17 @@ short DoSOevent(short match, short state)
|
|||
if (me_act == nullptr)
|
||||
continue;
|
||||
|
||||
me_sp = &me_act->s();
|
||||
|
||||
// toggle
|
||||
if (state == -1)
|
||||
{
|
||||
if (TEST_BOOL3(me_sp))
|
||||
if (TEST_BOOL3(me_act))
|
||||
{
|
||||
RESET_BOOL3(me_sp);
|
||||
RESET_BOOL3(me_act);
|
||||
state = OFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_BOOL3(me_sp);
|
||||
SET_BOOL3(me_act);
|
||||
state = ON;
|
||||
}
|
||||
}
|
||||
|
@ -158,22 +155,22 @@ short DoSOevent(short match, short state)
|
|||
if (state == ON)
|
||||
{
|
||||
spin_adj = (int)SP_TAG3(me_act);
|
||||
vel_adj = SP_TAG7(me_sp);
|
||||
vel_adj = SP_TAG7(me_act);
|
||||
}
|
||||
else if (state == OFF)
|
||||
{
|
||||
spin_adj = -(int)SP_TAG3(me_act);
|
||||
vel_adj = -SP_TAG7(me_sp);
|
||||
vel_adj = -SP_TAG7(me_act);
|
||||
}
|
||||
|
||||
sop->spin_speed += spin_adj;
|
||||
|
||||
if (TEST_BOOL1(me_sp))
|
||||
if (TEST_BOOL1(me_act))
|
||||
sop->vel_tgt += vel_adj;
|
||||
else
|
||||
sop->vel += vel_adj;
|
||||
|
||||
if (TEST_BOOL2(me_sp))
|
||||
if (TEST_BOOL2(me_act))
|
||||
{
|
||||
sop->dir *= -1;
|
||||
}
|
||||
|
|
|
@ -68,11 +68,11 @@ void InitNetPlayerOptions(void)
|
|||
|
||||
// myconnectindex palette
|
||||
pp->TeamColor = gs.NetColor;
|
||||
if (pp->Actor())
|
||||
DSWActor* actor = pp->actor;
|
||||
if (actor)
|
||||
{
|
||||
auto psp = &pp->Actor()->s();
|
||||
psp->pal = PALETTE_PLAYER0 + pp->TeamColor;
|
||||
pp->Actor()->user.spal = psp->pal;
|
||||
actor->spr.pal = PALETTE_PLAYER0 + pp->TeamColor;
|
||||
pp->Actor()->user.spal = actor->spr.pal;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2420,8 +2420,8 @@ void InitPlayerSprite(PLAYERp pp)
|
|||
|
||||
void SpawnPlayerUnderSprite(PLAYERp pp)
|
||||
{
|
||||
SPRITEp psp = &pp->Actor()->s();
|
||||
USERp pu = pp->Actor()->u(), u;
|
||||
DSWActor* plActor = pp->actor;
|
||||
USERp pu = plActor->u(), u;
|
||||
|
||||
SPRITEp sp;
|
||||
int pnum = int(pp - Player);
|
||||
|
@ -2446,13 +2446,10 @@ void SpawnPlayerUnderSprite(PLAYERp pp)
|
|||
|
||||
u->ActorActionSet = pu->ActorActionSet;
|
||||
|
||||
actor->spr.picnum = psp->picnum;
|
||||
actor->spr.clipdist = psp->clipdist;
|
||||
actor->spr.xrepeat = psp->xrepeat;
|
||||
actor->spr.yrepeat = psp->yrepeat;
|
||||
|
||||
//actor->spr.pal = psp->pal;
|
||||
//u->spal = pu->spal;
|
||||
actor->spr.picnum = plActor->spr.picnum;
|
||||
actor->spr.clipdist = plActor->spr.clipdist;
|
||||
actor->spr.xrepeat = plActor->spr.xrepeat;
|
||||
actor->spr.yrepeat = plActor->spr.yrepeat;
|
||||
}
|
||||
|
||||
#include "saveable.h"
|
||||
|
|
|
@ -1060,10 +1060,10 @@ int DoRipperHangJF(DSWActor* actor)
|
|||
int DoRipperBeginJumpAttack(DSWActor* actor)
|
||||
{
|
||||
USER* u = actor->u();
|
||||
SPRITEp psp = &u->targetActor->s();
|
||||
DSWActor* target = u->targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(psp->pos.X - actor->spr.pos.X, psp->pos.Y - actor->spr.pos.Y);
|
||||
tang = getangle(target->spr.pos.X - actor->spr.pos.X, target->spr.pos.Y - actor->spr.pos.Y);
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
@ -1126,11 +1126,10 @@ int DoRipperQuickJump(DSWActor* actor)
|
|||
// Tests to see if ripper is on top of a player/enemy and then immediatly
|
||||
// does another jump
|
||||
|
||||
if (u->lowActor)
|
||||
DSWActor* low = u->lowActor;
|
||||
if (low)
|
||||
{
|
||||
SPRITEp tsp = &u->lowActor->s();
|
||||
|
||||
if (TEST(tsp->extra, SPRX_PLAYER_OR_ENEMY))
|
||||
if (TEST(low->spr.extra, SPRX_PLAYER_OR_ENEMY))
|
||||
{
|
||||
NewStateGroup(actor, sg_RipperJumpAttack);
|
||||
// move past the first state
|
||||
|
@ -1138,7 +1137,6 @@ int DoRipperQuickJump(DSWActor* actor)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1174,13 +1172,13 @@ int DoRipperRipHeart(DSWActor* actor)
|
|||
{
|
||||
USERp u = actor->u();
|
||||
|
||||
SPRITEp tsp = &u->targetActor->s();
|
||||
DSWActor* target = u->targetActor;
|
||||
|
||||
NewStateGroup(actor, sg_RipperHeart);
|
||||
u->WaitTics = 6 * 120;
|
||||
|
||||
// player face ripper
|
||||
tsp->ang = getangle(actor->spr.pos.X - tsp->pos.X, actor->spr.pos.Y - tsp->pos.Y);
|
||||
target->spr.ang = getangle(actor->spr.pos.X - target->spr.pos.X, actor->spr.pos.Y - target->spr.pos.Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1075,10 +1075,10 @@ int DoRipper2HangJF(DSWActor* actor)
|
|||
int DoRipper2BeginJumpAttack(DSWActor* actor)
|
||||
{
|
||||
USER* u = actor->u();
|
||||
SPRITEp psp = &u->targetActor->s();
|
||||
DSWActor* target = u->targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(psp->pos.X - actor->spr.pos.X, psp->pos.Y - actor->spr.pos.Y);
|
||||
tang = getangle(target->spr.pos.X - actor->spr.pos.X, target->spr.pos.Y - actor->spr.pos.Y);
|
||||
|
||||
// Always jump at player if mad.
|
||||
|
||||
|
@ -1144,11 +1144,10 @@ int DoRipper2QuickJump(DSWActor* actor)
|
|||
// Tests to see if ripper2 is on top of a player/enemy and then immediatly
|
||||
// does another jump
|
||||
|
||||
if (u->lowActor)
|
||||
DSWActor* low = u->targetActor;
|
||||
if (low)
|
||||
{
|
||||
SPRITEp tsp = &u->lowActor->s();
|
||||
|
||||
if (TEST(tsp->extra, SPRX_PLAYER_OR_ENEMY))
|
||||
if (TEST(low->spr.extra, SPRX_PLAYER_OR_ENEMY))
|
||||
{
|
||||
NewStateGroup(actor, sg_Ripper2JumpAttack);
|
||||
// move past the first state
|
||||
|
@ -1189,13 +1188,12 @@ int DoRipper2RipHeart(DSWActor* actor)
|
|||
{
|
||||
USERp u = actor->u();
|
||||
|
||||
SPRITEp tsp = &u->targetActor->s();
|
||||
|
||||
DSWActor* target = u->targetActor;
|
||||
NewStateGroup(actor, sg_Ripper2Heart);
|
||||
u->WaitTics = 6 * 120;
|
||||
|
||||
// player face ripper2
|
||||
tsp->ang = getangle(actor->spr.pos.X - tsp->pos.X, actor->spr.pos.Y - tsp->pos.Y);
|
||||
target->spr.ang = getangle(actor->spr.pos.X - target->spr.pos.X, actor->spr.pos.Y - target->spr.pos.Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,23 +57,9 @@ bool FAF_DebugView = false;
|
|||
DSWActor* insertActor(sectortype* sect, int statnum)
|
||||
{
|
||||
auto pActor = static_cast<DSWActor*>(::InsertActor(RUNTIME_CLASS(DSWActor), sect, statnum));
|
||||
auto pSprite = &pActor->s();
|
||||
|
||||
pSprite->pos.X = pSprite->pos.Y = pSprite->pos.Z = 0;
|
||||
pSprite->cstat = 0;
|
||||
pSprite->picnum = 0;
|
||||
pSprite->shade = 0;
|
||||
pSprite->pal = 0;
|
||||
pSprite->clipdist = 0;
|
||||
pSprite->xrepeat = pSprite->yrepeat = 0;
|
||||
pSprite->xoffset = pSprite->yoffset = 0;
|
||||
pSprite->ang = 0;
|
||||
pSprite->owner = -1;
|
||||
pSprite->xvel = pSprite->yvel = pSprite->zvel = 0;
|
||||
pSprite->lotag = 0;
|
||||
pSprite->hitag = 0;
|
||||
pSprite->extra = 0;
|
||||
|
||||
pActor->spr.clear();
|
||||
pActor->spr.owner = -1;
|
||||
return pActor;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue