diff --git a/resources/assets/zscript/actors/hxdd/hexen2/pickups/armor.zs b/resources/assets/zscript/actors/hxdd/hexen2/pickups/armor.zs index f35b7db..bf59bf1 100644 --- a/resources/assets/zscript/actors/hxdd/hexen2/pickups/armor.zs +++ b/resources/assets/zscript/actors/hxdd/hexen2/pickups/armor.zs @@ -1,6 +1,14 @@ +class HX2Armor : HexenArmor { + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } +} + // Breastplate (1) ----------------------------------------------------------- -class HX2Breastplate : HexenArmor { +class HX2Breastplate : HX2Armor { Default { +FLOATBOB +NOGRAVITY @@ -17,7 +25,7 @@ class HX2Breastplate : HexenArmor { // Bracers (2) -------------------------------------------------------- -class HX2Bracers : HexenArmor { +class HX2Bracers : HX2Armor { Default { +FLOATBOB +NOGRAVITY @@ -34,7 +42,7 @@ class HX2Bracers : HexenArmor { // Helmet (3) -------------------------------------------------------- -class HX2Helmet : HexenArmor { +class HX2Helmet : HX2Armor { Default { +FLOATBOB +NOGRAVITY @@ -51,7 +59,7 @@ class HX2Helmet : HexenArmor { // Amulet of Protection (4) ---------------------------------------------------- -class HX2Amulet : HexenArmor { +class HX2Amulet : HX2Armor { Default { +FLOATBOB +NOGRAVITY diff --git a/resources/assets/zscript/actors/hxdd/hexen2/pickups/artifacts.zs b/resources/assets/zscript/actors/hxdd/hexen2/pickups/artifacts.zs index 1f599ec..925a9eb 100644 --- a/resources/assets/zscript/actors/hxdd/hexen2/pickups/artifacts.zs +++ b/resources/assets/zscript/actors/hxdd/hexen2/pickups/artifacts.zs @@ -8,6 +8,12 @@ class HX2ArtiHealth : ArtiHealth { 0000 A -1; Loop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } // Needs HX2 Matching Implementation @@ -20,6 +26,12 @@ class HX2ArtiSuperHealth : ArtiSuperHealth { 0000 A 350; Loop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } // Needs HX2 Matching Implementation @@ -34,6 +46,12 @@ class HX2ArtiFly : ArtiFly { Stop; } + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + override bool Use(bool pickup) { let result = Super.Use(pickup); if (result) { @@ -59,6 +77,12 @@ class HX2ArtiInvulnerability : ArtiInvulnerability2 { Stop; } + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + override bool Use(bool pickup) { let result = Super.Use(pickup); if (result) { @@ -84,6 +108,12 @@ class HX2ArtiTomeOfPower : ArtiTomeOfPower { Stop; } + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + override bool Use(bool pickup) { let result = Super.Use(pickup); if (result) { @@ -109,6 +139,12 @@ class HX2ArtiSpeedBoots : ArtiSpeedBoots { Stop; } + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + override bool Use(bool pickup) { let result = Super.Use(pickup); if (result) { @@ -133,6 +169,12 @@ class HX2ArtiBlastRadius : ArtiBlastRadius { 0000 A -1; Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } class HX2ArtiBoostMana : ArtiBoostMana { @@ -144,6 +186,12 @@ class HX2ArtiBoostMana : ArtiBoostMana { 0000 A -1; Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } // Needs HX2 Matching Implementation @@ -157,6 +205,13 @@ class HX2ArtiTorch : ArtiTorch { 0000 A -1; Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + override bool Use(bool pickup) { if (CurSector.MoreFlags & Sector.SECMF_UNDERWATERMASK) { return false; @@ -175,6 +230,12 @@ class HX2ArtiInvisibility : ArtiInvisibility { 0000 A -1; Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } class HX2ArtiTeleport : ArtiTeleport { @@ -186,4 +247,10 @@ class HX2ArtiTeleport : ArtiTeleport { 0000 A -1; Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } \ No newline at end of file diff --git a/resources/assets/zscript/actors/hxdd/hexen2/pickups/mana.zs b/resources/assets/zscript/actors/hxdd/hexen2/pickups/mana.zs index d34476e..35dcffd 100644 --- a/resources/assets/zscript/actors/hxdd/hexen2/pickups/mana.zs +++ b/resources/assets/zscript/actors/hxdd/hexen2/pickups/mana.zs @@ -15,6 +15,12 @@ class HX2Mana1 : CustomInventory { Stop; } + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } + } class HX2Mana2 : CustomInventory { Default { @@ -31,6 +37,12 @@ class HX2Mana2 : CustomInventory { TNT1 A 0 A_GiveInventory("Mana2", 15); Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } class HX2Mana3 : Mana3 { States { @@ -42,4 +54,10 @@ class HX2Mana3 : Mana3 { TNT1 A 0 A_GiveInventory("Mana2", 20); Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } \ No newline at end of file diff --git a/resources/assets/zscript/actors/hxdd/hexen2/pickups/pickups.zs b/resources/assets/zscript/actors/hxdd/hexen2/pickups/pickups.zs index 63c8806..1c94cdb 100644 --- a/resources/assets/zscript/actors/hxdd/hexen2/pickups/pickups.zs +++ b/resources/assets/zscript/actors/hxdd/hexen2/pickups/pickups.zs @@ -10,6 +10,12 @@ class HX2CrystalVial : CrystalVial { TNT1 A 0 A_GiveInventory("CrystalVial", 1); Stop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } class HX2SuperMap : SuperMap { @@ -18,4 +24,10 @@ class HX2SuperMap : SuperMap { 0000 A -1; Loop; } + + override void Tick() { + Super.Tick(); + + self.lightlevel = LemonActor.CalcHX2ModelGlowLighting(self); + } } \ No newline at end of file diff --git a/resources/assets/zscript/lib/_lib.zs b/resources/assets/zscript/lib/_lib.zs index fd461c4..7453b52 100644 --- a/resources/assets/zscript/lib/_lib.zs +++ b/resources/assets/zscript/lib/_lib.zs @@ -4,6 +4,7 @@ #include "zscript/lib/Gutamatics/include.zsc" #include "zscript/lib/filejson.zs" #include "zscript/lib/gameinforeader.zs" +#include "zscript/lib/lemonactor.zs" #include "zscript/lib/lemonutil.zs" #include "zscript/lib/particles.zs" #include "zscript/lib/xclasstranslation.zs" diff --git a/resources/assets/zscript/lib/lemonactor.zs b/resources/assets/zscript/lib/lemonactor.zs new file mode 100644 index 0000000..da8a2e8 --- /dev/null +++ b/resources/assets/zscript/lib/lemonactor.zs @@ -0,0 +1,9 @@ + +class LemonActor { + // ref: https://github.com/videogamepreservation/hexen2/blob/eac5fd50832ce2509226761b3b1a387c468e7a50/H2W/Client/r_alias.c#L958 + static int CalcHX2ModelGlowLighting(Actor source) { + int curLightLevel = source.cursector.GetLightLevel(); + int ambLightLevel = 60 + 34 + sin(source.pos.x + source.pos.y + (level.MapTime * 3.8)) * 34; + return curLightLevel + ambLightLevel; + } +} \ No newline at end of file