Skip to content

Commit

Permalink
Various small fixes
Browse files Browse the repository at this point in the history
- Use gametic instead of level.time to set static mugshot image duration
- Optimize fizzle effect slightly and fix off-by-one error that left the top left pixel empty
- Increase Pacman ghost damage slightly so that screen fade takes effect properly...  Still can't quite get the Wol3D-accurate effect because Doom's damage fade is capped arbitrarily in internal code.
  • Loading branch information
AFADoomer committed Mar 5, 2019
1 parent 90aa163 commit feb7f97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Scripts/Actors/Enemies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class ClassicNazi : ClassicBase
"####" A 0 A_JumpIf((vel.x == 0) && (vel.y == 0), "Spawn.PatrolNoClip");
Loop;
Chase:
"####" A 0 { if (health <= 0) { SetStateLabel("Dead"); } } // Just in case...
"####" AAAAA 1 A_Chase;
"####" A 1;
"####" BBBB 1 A_Chase;
Expand Down Expand Up @@ -962,7 +963,7 @@ class PacManGhost : ClassicBase
Loop;
Melee:
"####" A 0 A_FaceTarget;
"####" AAAAABBBBB 1 A_CustomMeleeAttack(1, "", "", "WolfNazi", false);
"####" AAAAABBBBB 1 A_CustomMeleeAttack(3, "", "", "WolfNazi", false);
Goto Chase;
Dead:
"####" A -1;
Expand Down
1 change: 0 additions & 1 deletion Scripts/Actors/Player.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class WolfPlayer : DoomPlayer
Player.ColorSet 5, "Tan", 0xC0, 0xCF, 0xCA;
Player.ColorSet 6, "Purple", 0xB0, 0xBF, 0xB2;
Player.ColorSet 7, "Teal", 0x70, 0x7F, 0x7A;
Player.DamageScreenColor "Red", 1.0;
Player.DisplayName "BJ";
Player.Face "WLF";
Player.ForwardMove 1.3, 1.3;
Expand Down
18 changes: 10 additions & 8 deletions Scripts/ClassicStatusBar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class ClassicStatusBar : BaseStatusBar

pixel = TexMan.CheckForTexture("Floor", TexMan.Type_Any);

SetFizzleFadeSteps();
fizzleindex = 0;
SetFizzleFadeSteps();

fizzleeffect = false;
}

Expand All @@ -37,16 +38,15 @@ class ClassicStatusBar : BaseStatusBar

if (pixel && fizzleeffect)
{
for (int f = 0; f < fizzleindex; f++)
for (int f = 0; f <= fizzleindex; f++)
{
Vector2 fizzle = fizzlepoints[f];

screen.DrawTexture(pixel, false, fizzle.x, fizzle.y, DTA_320x200, true, DTA_DestWidth, 1, DTA_DestHeight, 1, DTA_TopOffset, 0, DTA_LeftOffset, 0, DTA_FillColor, fizzlecolor);
screen.DrawTexture(pixel, false, fizzle.x - 320, fizzle.y, DTA_320x200, true, DTA_DestWidth, 1, DTA_DestHeight, 1, DTA_TopOffset, 0, DTA_LeftOffset, 0, DTA_FillColor, fizzlecolor);
screen.DrawTexture(pixel, false, fizzle.x + 320, fizzle.y, DTA_320x200, true, DTA_DestWidth, 1, DTA_DestHeight, 1, DTA_TopOffset, 0, DTA_LeftOffset, 0, DTA_FillColor, fizzlecolor);
screen.DrawTexture(pixel, false, fizzle.x > 160 ? fizzle.x - 320 : fizzle.x + 320, fizzle.y, DTA_320x200, true, DTA_DestWidth, 1, DTA_DestHeight, 1, DTA_TopOffset, 0, DTA_LeftOffset, 0, DTA_FillColor, fizzlecolor);
}

fizzleindex += 1750; // Draw 1750 pixels at a time...
fizzleindex += 1920; // Draw a chunk of pixels at a time...

if (fizzleindex >= fizzlepoints.Size()) { fizzleindex = fizzlepoints.Size() - 1; }
}
Expand Down Expand Up @@ -80,15 +80,15 @@ class ClassicStatusBar : BaseStatusBar
if (players[consoleplayer].mo != caller) { return; }

ClassicStatusBar(StatusBar).staticmugshot = 1;
ClassicStatusBar(StatusBar).staticmugshottimer = level.time + 80; // 80 tics is roughly the duration of the chaingun pickup sound
ClassicStatusBar(StatusBar).staticmugshottimer = gametic + 80; // 80 tics is roughly the duration of the chaingun pickup sound
}

play void DoIdleFace(Actor caller)
{
if (players[consoleplayer].mo != caller) { return; }

ClassicStatusBar(StatusBar).staticmugshot = 2;
ClassicStatusBar(StatusBar).staticmugshottimer = level.time + 35;
ClassicStatusBar(StatusBar).staticmugshottimer = gametic + 35;
}

protected void DrawClassicBar()
Expand Down Expand Up @@ -197,7 +197,7 @@ class ClassicStatusBar : BaseStatusBar

void DrawMugShot(int x, int y, int size = 32)
{
if (staticmugshot && staticmugshottimer >= level.time)
if (staticmugshot && staticmugshottimer >= gametic)
{
mugshot = GetMugShot(5, type:staticmugshot);
}
Expand Down Expand Up @@ -376,5 +376,7 @@ class ClassicStatusBar : BaseStatusBar
fizzleindex++;
}
} while (fizzleval != 1)

fizzleindex = 0;
}
}

0 comments on commit feb7f97

Please sign in to comment.