mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
- handle the bolts
These used temp_data which was remapped to temp_pos for being floats.
This commit is contained in:
parent
dd3346cbc5
commit
44f0a6ae67
4 changed files with 19 additions and 22 deletions
|
@ -1083,13 +1083,12 @@ CLEAR_THE_BOLT2:
|
|||
}
|
||||
if ((actor->spr.ScaleX() == 0 && actor->spr.ScaleY()) == 0)
|
||||
{
|
||||
actor->spr.xrepeat = actor->temp_data[0];
|
||||
actor->spr.yrepeat = actor->temp_data[1];
|
||||
actor->spr.SetScale(actor->temp_pos.X, actor->temp_pos.Y);
|
||||
}
|
||||
if ((krand() & 8) == 0)
|
||||
{
|
||||
actor->temp_data[0] = actor->spr.xrepeat;
|
||||
actor->temp_data[1] = actor->spr.yrepeat;
|
||||
actor->temp_pos.X = actor->spr.ScaleX();
|
||||
actor->temp_pos.Y = actor->spr.ScaleY();
|
||||
actor->temp_data[2] = global_random & 4;
|
||||
actor->spr.SetScale(0, 0);
|
||||
goto CLEAR_THE_BOLT2;
|
||||
|
@ -1129,13 +1128,12 @@ CLEAR_THE_BOLT:
|
|||
}
|
||||
if (actor->spr.ScaleX() == 0 && actor->spr.ScaleY() == 0)
|
||||
{
|
||||
actor->spr.xrepeat = actor->temp_data[0];
|
||||
actor->spr.yrepeat = actor->temp_data[1];
|
||||
actor->spr.SetScale(actor->temp_pos.X, actor->temp_pos.Y);
|
||||
}
|
||||
else if ((krand() & 8) == 0)
|
||||
{
|
||||
actor->temp_data[0] = actor->spr.xrepeat;
|
||||
actor->temp_data[1] = actor->spr.yrepeat;
|
||||
actor->temp_pos.X = actor->spr.ScaleX();
|
||||
actor->temp_pos.Y = actor->spr.ScaleY();
|
||||
actor->temp_data[2] = global_random & 4;
|
||||
actor->spr.SetScale(0, 0);
|
||||
goto CLEAR_THE_BOLT;
|
||||
|
@ -1143,7 +1141,7 @@ CLEAR_THE_BOLT:
|
|||
actor->spr.picnum++;
|
||||
|
||||
int l = global_random & 7;
|
||||
actor->spr.xrepeat = l + 8;
|
||||
actor->spr.SetScaleX(0.125 + l * REPEAT_SCALE);
|
||||
|
||||
if (l & 1) actor->spr.cstat ^= CSTAT_SPRITE_TRANSLUCENT;
|
||||
|
||||
|
|
|
@ -763,15 +763,14 @@ CLEAR_THE_BOLT:
|
|||
sectp->ceilingshade = 20;
|
||||
return;
|
||||
}
|
||||
if ((actor->spr.xrepeat | actor->spr.yrepeat) == 0)
|
||||
if (actor->spr.ScaleX() == 0 && actor->spr.ScaleY() == 0)
|
||||
{
|
||||
actor->spr.xrepeat = actor->temp_data[0];
|
||||
actor->spr.yrepeat = actor->temp_data[1];
|
||||
actor->spr.SetScale(actor->temp_pos.X, actor->temp_pos.Y);
|
||||
}
|
||||
else if ((krand() & 8) == 0)
|
||||
{
|
||||
actor->temp_data[0] = actor->spr.xrepeat;
|
||||
actor->temp_data[1] = actor->spr.yrepeat;
|
||||
actor->temp_pos.X = actor->spr.ScaleX();
|
||||
actor->temp_pos.Y = actor->spr.ScaleY();
|
||||
actor->temp_data[2] = global_random & 4;
|
||||
actor->spr.SetScale(0, 0);
|
||||
goto CLEAR_THE_BOLT;
|
||||
|
@ -779,7 +778,7 @@ CLEAR_THE_BOLT:
|
|||
actor->spr.picnum++;
|
||||
|
||||
int l = global_random & 7;
|
||||
actor->spr.xrepeat = l + 8;
|
||||
actor->spr.SetScaleX(0.125 + l * REPEAT_SCALE);
|
||||
|
||||
if (l & 1) actor->spr.cstat ^= CSTAT_SPRITE_TRANSLUCENT;
|
||||
|
||||
|
|
|
@ -746,21 +746,21 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case SIDEBOLT1 + 1:
|
||||
case SIDEBOLT1 + 2:
|
||||
case SIDEBOLT1 + 3:
|
||||
act->temp_data[0] = act->spr.xrepeat;
|
||||
act->temp_data[1] = act->spr.yrepeat;
|
||||
act->temp_pos.X = act->spr.ScaleX();
|
||||
act->temp_pos.Y = act->spr.ScaleY();
|
||||
[[fallthrough]];
|
||||
case MASTERSWITCH:
|
||||
if (act->spr.picnum == MASTERSWITCH)
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
act->spr.yint = 0;
|
||||
ChangeActorStat(act, 6);
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
case TARGET:
|
||||
case DUCK:
|
||||
case LETTER:
|
||||
act->spr.extra = 1;
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
ChangeActorStat(act, 1);
|
||||
ChangeActorStat(act, STAT_ACTOR);
|
||||
break;
|
||||
case OCTABRAINSTAYPUT:
|
||||
case LIZTROOPSTAYPUT:
|
||||
|
|
|
@ -708,14 +708,14 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case BOLT1 + 1:
|
||||
case BOLT1 + 2:
|
||||
case BOLT1 + 3:
|
||||
act->temp_data[0] = act->spr.xrepeat;
|
||||
act->temp_data[1] = act->spr.yrepeat;
|
||||
act->temp_pos.X = act->spr.ScaleX();
|
||||
act->temp_pos.Y = act->spr.ScaleY();
|
||||
[[fallthrough]];
|
||||
case MASTERSWITCH:
|
||||
if (act->spr.picnum == MASTERSWITCH)
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
act->spr.yint = 0;
|
||||
ChangeActorStat(act, 6);
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
|
||||
// this is not really nice...
|
||||
|
|
Loading…
Reference in a new issue