Skip to content

Commit

Permalink
Assortment of bug fixes, statusbar progression optimization, death an…
Browse files Browse the repository at this point in the history
…imations wip
  • Loading branch information
Lemon-King committed Oct 25, 2023
1 parent 5eda6b8 commit 63dfaf1
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 71 deletions.
4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class HX2AssassinPlayer : HXDDHexenIIPlayerPawn
+NOSKIN
+NODAMAGETHRUST
+PLAYERPAWN.NOTHRUSTWHENINVUL
PainSound "Hexen2PlayerFemalePain";
RadiusDamageFactor 0.25;
Player.JumpZ 9;
Player.Viewheight 41;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class HX2CrusaderPlayer : HXDDHexenIIPlayerPawn
+NOSKIN
+NODAMAGETHRUST
+PLAYERPAWN.NOTHRUSTWHENINVUL
PainSound "Hexen2PlayerMalePain";
RadiusDamageFactor 0.25;
Player.JumpZ 9;
Player.Viewheight 41;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class HX2NecromancerPlayer : HXDDHexenIIPlayerPawn
+NOSKIN
+NODAMAGETHRUST
+PLAYERPAWN.NOTHRUSTWHENINVUL
PainSound "Hexen2PlayerMalePain";
RadiusDamageFactor 0.25;
Player.JumpZ 9;
Player.Viewheight 41;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class HX2PaladinPlayer : HXDDHexenIIPlayerPawn {
+NOSKIN
+NODAMAGETHRUST
+PLAYERPAWN.NOTHRUSTWHENINVUL
PainSound "Hexen2PlayerMalePain";
RadiusDamageFactor 0.25;
Player.JumpZ 9;
Player.Viewheight 41;
Expand Down Expand Up @@ -141,19 +142,26 @@ class HX2PaladinPlayer : HXDDHexenIIPlayerPawn {
PPST ABCDEFG 2;
Goto Spawn4;
Death:
PLAY H 6;
PLAY I 6 A_PlayerScream;
PLAY JK 6;
PLAY L 6 A_NoBlocking;
PLAY M 6;
PLAY N -1;
PDEA A 2 A_PlayerScream;
PDEA BCDEFGHIJKLMNOPQRS 2;
PDEA T -1;
//PLAY H 6;
//PLAY I 6 A_PlayerScream;
//PLAY JK 6;
//PLAY L 6 A_NoBlocking;
//PLAY M 6;
//PLAY N -1;
Stop;
XDeath:
PLAY O 5 A_PlayerScream;
PLAY P 5 A_SkullPop("BloodyFighterSkull");
PLAY R 5 A_NoBlocking;
PLAY STUV 5;
PLAY W -1;
PDDA A 2 A_SkullPop("HX2PaladinPlayer_Head");
PDDA BCDEFGHIJKLMNOPQRSTUVWXYZ 2;
PDDB A 2;
PDDB B -1;
//PLAY O 5 A_PlayerScream;
//PLAY P 5 A_SkullPop("BloodyFighterSkull");
//PLAY R 5 A_NoBlocking;
//PLAY STUV 5;
//PLAY W -1;
Stop;
Ice:
PLAY X 5 A_FreezeDeath;
Expand Down Expand Up @@ -184,3 +192,25 @@ class HX2PaladinPlayer : HXDDHexenIIPlayerPawn {
Stop;
}
}

class HX2PaladinPlayer_Head : PlayerChunk {
Default {
Radius 4;
Height 4;
Gravity 0.125;
+NOBLOCKMAP
+DROPOFF
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
}
States {
Spawn:
PHED A 1 A_CheckFloor("Hit");
Loop;
Hit:
PHED A 16 A_CheckPlayerDone;
Stop;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class HX2SuccubusPlayer : HXDDHexenIIPlayerPawn
+NOSKIN
+NODAMAGETHRUST
+PLAYERPAWN.NOTHRUSTWHENINVUL
PainSound "Hexen2PlayerFemalePain";
RadiusDamageFactor 0.25;
Player.JumpZ 9;
Player.Viewheight 48;
Expand Down Expand Up @@ -146,19 +147,26 @@ class HX2SuccubusPlayer : HXDDHexenIIPlayerPawn
PPSA ABCDEFG 2;
Goto Spawn4;
Death:
PLAY H 6;
PLAY I 6 A_PlayerScream;
PLAY JK 6;
PLAY L 6 A_NoBlocking;
PLAY M 6;
PLAY N -1;
PDEA A 2 A_PlayerScream;
PDEA BCDEFGHIJKLMNOPQRS 2;
PDEA T -1;
//PLAY H 6;
//PLAY I 6 A_PlayerScream;
//PLAY JK 6;
//PLAY L 6 A_NoBlocking;
//PLAY M 6;
//PLAY N -1;
Stop;
XDeath:
PLAY O 5 A_PlayerScream;
PLAY P 5 A_SkullPop("BloodyFighterSkull");
PLAY R 5 A_NoBlocking;
PLAY STUV 5;
PLAY W -1;
PDDA A 2 A_SkullPop("HX2SuccubusPlayer_Head");
PDDA BCDEFGHIJKLMNOPQRSTUVWXYZ 2;
PDDB A 2;
PDDB B -1;
//PLAY O 5 A_PlayerScream;
//PLAY P 5 A_SkullPop("BloodyFighterSkull");
//PLAY R 5 A_NoBlocking;
//PLAY STUV 5;
//PLAY W -1;
Stop;
Ice:
PLAY X 5 A_FreezeDeath;
Expand Down Expand Up @@ -189,3 +197,25 @@ class HX2SuccubusPlayer : HXDDHexenIIPlayerPawn
Stop;
}
}

class HX2SuccubusPlayer_Head : PlayerChunk {
Default {
Radius 4;
Height 4;
Gravity 0.125;
+NOBLOCKMAP
+DROPOFF
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
}
States {
Spawn:
PSHD A 1 A_CheckFloor("Hit");
Loop;
Hit:
PSHD A 16 A_CheckPlayerDone;
Stop;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class PWeapPurifier_Missile: Actor {
Projectile;
Scale 1;

//SeeSound "hexen2/succubus/acidfire";
DeathSound "hexen2/weapons/expsmall";
Obituary "$OB_MPPWEAPPURIFIER";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class SWeapBloodRain : SuccubusWeapon {

States {
Select:
SWSE ABCDEFGHIJKLMNOPQRST 2 Offset(0, 32);
SWSE ABCDEFGHIJKLMNOPQRST 1 Offset(0, 32);
TNT1 A 0 A_Raise(100);
Loop;
Deselect:
SWSE TSRQPONMLKJIHGFEDCBA 2;
SWSE TSRQPONMLKJIHGFEDCBA 1;
TNT1 A 0 A_Lower(100);
Loop;
Ready:
Expand All @@ -29,9 +29,9 @@ class SWeapBloodRain : SuccubusWeapon {
Goto Ready;
Fire:
SWAA ABCDEF 2;
SWAA G 2 A_BloodRain;
SWAA HIJK 2;
SWAA L 2 A_ReFire("Fire");
SWAA G 1 A_BloodRain;
SWAA HIJK 1;
SWAA L 1 A_ReFire("Fire");
Goto Ready;
}

Expand All @@ -56,9 +56,8 @@ class SWeapBloodRain : SuccubusWeapon {
if (!weapon.DepleteAmmo (weapon.bAltFire))
return;
}
SpawnPlayerMissile("SWeapBloodRain_Missile", angle, -5 * sin(angle), 5 * cos(angle), 11);
//Fire3DProjectile("SWeapBloodRain_Missile", 30, -13, -3, false, 0, 0);
//A_StartSound("hexen2/succubus/brnfire", CHAN_WEAPON);
SpawnFirstPerson("SWeapBloodRain_Missile", 25, -5.75, -5, true);
A_StartSound("hexen2/succubus/brnfire", CHAN_WEAPON);
}
}

Expand Down Expand Up @@ -88,7 +87,7 @@ class SWeapBloodRain_Missile : Actor
Height 8;
Projectile;

SeeSound "hexen2/succubus/brnfire";
//SeeSound "hexen2/succubus/brnfire";
DeathSound "hexen2/succubus/brnwall";
Obituary "$OB_MPSWEAPBLOODRAIN";

Expand Down Expand Up @@ -118,6 +117,11 @@ class SWeapBloodRain_Missile : Actor
if (InStateSequence(CurState, self.Findstate("Death"))) {
return;
}

Vector3 facing = LemonUtil.GetEularFromVelocity(self.vel);
self.angle = facing.x;
self.pitch = facing.y;
self.roll = facing.z;

Vector3 vecDiff = (start.x - self.pos.x, start.y - self.pos.y, start.z - self.pos.z);
double distance = sqrt((vecDiff.x * vecDiff.x) + (vecDiff.y * vecDiff.y) + (vecDiff.z * vecDiff.z));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HXDDClericBoss : ClericBoss replaces ClericBoss
CLER S 5;
CLER T 5 A_NoBlocking;
CLER UVWXYZ 5;
CLER [ -1;
CLRF A -1;
Stop;
Ice:
CLRF B 5 A_FreezeDeath;
Expand Down
35 changes: 17 additions & 18 deletions resources/assets/zscript/statusbar/hxddstatusbar.zs
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,37 @@ class HXDDStatusBar : BaseStatusBar {
private int gemColorAssignment;

private bool hasACArmor;

Progression prog;

Progression GetProgression() {
Progression prog = Progression(CPlayer.mo.FindInventory("Progression"));
return prog;
void UpdateProgression() {
if (CPlayer.mo is "PlayerPawn") {
prog = Progression(CPlayer.mo.FindInventory("Progression"));
}
}

int GetPlayerLevel() {
Progression prog = GetProgression();
if (prog) {
return prog.currlevel;
}
return 0;
}

String GetPlayerExperience() {
Progression prog = GetProgression();
if (prog) {
return String.format("%.2f", mXPInterpolator.GetValue());
}
return "";
}

int GetPlayerProgressionType() {
Progression prog = GetProgression();
if (prog) {
return prog.ProgressionType;
}
return PSP_NONE;
}

bool IsPlayerArmorAC() {
Progression prog = GetProgression();
if (prog) {
return prog.ArmorType == PSAT_ARMOR_AC;
}
Expand Down Expand Up @@ -134,8 +133,9 @@ class HXDDStatusBar : BaseStatusBar {
Super.Tick();
mHealthInterpolator.Update(CPlayer.health);
mHealthInterpolator2.Update(CPlayer.health);

UpdateProgression();

Progression prog = GetProgression();
if (prog) {
if (prog.ProgressionType == PSP_LEVELS) {
mXPInterpolator.Update(prog.levelpct);
Expand Down Expand Up @@ -260,13 +260,12 @@ class HXDDStatusBar : BaseStatusBar {


String imgFrameLeft = "assets/ui/FS_HERETIC_SBAR_LEFT.png";
Progression prog = GetProgression();
if (prog.ArmorType == PSAT_ARMOR_AC) {
if (prog && prog.ArmorType == PSAT_ARMOR_AC) {
imgFrameLeft = "assets/ui/FS_HERETIC_SBAR_LEFT_AC.png";
}
DrawImage(imgFrameLeft, (anchorLeft, -15) + v2Left, DI_SCREEN_LEFT_BOTTOM | DI_ITEM_LEFT_BOTTOM, scale: pixelRatioScale);

if (prog.ProgressionType == PSP_LEVELS) {
if (prog && prog.ProgressionType == PSP_LEVELS) {
// draw xp bar
DrawImage("assets/ui/FS_HERETIC_SBAR_LEFT_XP_LEFTSIDE.png", (anchorLeft - 63, anchorBottom) + v2Left, DI_SCREEN_LEFT_BOTTOM | DI_ITEM_LEFT_BOTTOM, scale: pixelRatioScale);

Expand All @@ -292,7 +291,10 @@ class HXDDStatusBar : BaseStatusBar {

DrawString(mHUDFont, FormatNumber(mHealthInterpolator.GetValue()), ((anchorLeft + 81) - (wStrHealthWidth / strHealthValue.Length()), anchorBottom - 17 * pixelRatioScale.y) + v2Left, DI_SCREEN_LEFT_BOTTOM | DI_TEXT_ALIGN_CENTER | DI_ITEM_CENTER, scale: pixelRatioScale);

double armorValue = prog.ArmorType == PSAT_ARMOR_AC ? mACInterpolator.GetValue() / 5.0 : mArmorInterpolator.GetValue();
double armorValue = mArmorInterpolator.GetValue();
if (prog) {
armorValue = prog.ArmorType == PSAT_ARMOR_AC ? mACInterpolator.GetValue() / 5.0 : mArmorInterpolator.GetValue();
}
String strArmorValue = String.format("%d", armorValue);
int wStrArmorWidth = mHUDFontWidth * strArmorValue.Length();
DrawString(mHUDFont, FormatNumber(armorValue), ((anchorLeft + 30) - (wStrArmorWidth / strArmorValue.Length()), anchorBottom - 17 * pixelRatioScale.y) + v2Left, DI_SCREEN_LEFT_BOTTOM | DI_TEXT_ALIGN_CENTER | DI_ITEM_CENTER, scale: pixelRatioScale);
Expand Down Expand Up @@ -423,8 +425,7 @@ class HXDDStatusBar : BaseStatusBar {
}
}

Progression prog = GetProgression();
if (prog.currlevel > 0) {
if (prog && prog.currlevel > 0) {
DrawString(mHUDFont, FormatNumber(mXPInterpolator.GetValue()), (-21, -60), DI_TEXT_ALIGN_RIGHT);
DrawString(mHUDFont, GetPlayerExperience(), (-21, -45), DI_TEXT_ALIGN_RIGHT);
}
Expand Down Expand Up @@ -475,8 +476,7 @@ class HXDDStatusBar : BaseStatusBar {
int maxValue = 100;
int value = 0;
int wiggle = 0;
Progression prog = GetProgression();
if (prog.currlevel > 0) {
if (prog && prog.currlevel > 0) {
value = mXPInterpolator.GetValue();
wiggle = (floor(mXPInterpolator.GetValue()) != floor(prog.levelpct)) && Random[ChainWiggle](0, 1);
} else {
Expand Down Expand Up @@ -650,8 +650,7 @@ class HXDDStatusBar : BaseStatusBar {
int maxValue = 100;
int value = 0;
int wiggle = 0;
Progression prog = GetProgression();
if (prog.currlevel > 0) {
if (prog && prog.currlevel > 0) {
value = mXPInterpolator.GetValue();
wiggle = (floor(mXPInterpolator.GetValue()) != floor(prog.levelpct)) && Random[ChainWiggle](0, 1);
} else {
Expand Down
2 changes: 0 additions & 2 deletions resources/pakdata/modeldef/assassincrossbow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

<Flag name="USEACTORPITCH" />
<Flag name="USEACTORROLL" />
<Flag name="PITCHFROMMOMENTUM" />

<Animation key="BOLT" frames="1" model="0" comment="Bolt"/>
</Group>
Expand All @@ -50,7 +49,6 @@

<Flag name="USEACTORPITCH" />
<Flag name="USEACTORROLL" />
<Flag name="PITCHFROMMOMENTUM" />

<Animation key="BOLT" frames="9" model="0" comment="Flaming Bolt"/>
</Group>
Expand Down
Loading

0 comments on commit 63dfaf1

Please sign in to comment.