Finishing touches for hexen compatibility (1.1 update):

- Fully implemented ammo cubes.
 - Fixed environment map shaders (incorrect texture coords were being used).
 - HUD support for displaying Hexen keys.
 - Fixed "has no ammo" messages displaying more often than they should.
 - Fixed lack of footsteps with UT physics disabled.
 - Sneaky initial Strife compatibility work:
   - Impact Hammer will have reduced alert distance.
   - HUD support for displaying Strife keys.
This commit is contained in:
Marisa the Magician 2019-12-15 14:28:20 +01:00
commit da8f6fc4b2
27 changed files with 314 additions and 70 deletions

View file

@ -58,19 +58,21 @@ This mod requires GZDoom 4.2.4 or later.
- UT gore system (WIP, toggleable) - UT gore system (WIP, toggleable)
- Liquid splashes - Liquid splashes
- Original Invulnerability and Night Vision items - Original Invulnerability and Night Vision items
- Hexen compatibility
## In progress ## In progress
- Tooltips for menu options. - N/A, this is the 1.1 release.
- Help screens describing items and stuff (maybe?).
## Planned ## Planned
- Stuff for 1.1 - Stuff for 1.2
- Fancy titlemap like Doomreal. - Fancy titlemap with intro narration.
- Touch up blood/gibbing features. At the moment, Nashgore is still a - Touch up blood/gibbing features. At the moment, Nashgore is still a
superior alternative. superior alternative.
- Hexen/Strife compatibility ??? - Help screens describing items and stuff (maybe?).
- Chex Quest compatibility ?
- Strife compatibility ????
- Stuff for much later - Stuff for much later
- Add ammo counters to Pulsegun, Minigun, Flak Cannon and Rocket Launcher - Add ammo counters to Pulsegun, Minigun, Flak Cannon and Rocket Launcher
once scripted textures are implemented once scripted textures are implemented

BIN
brightmaps/JAmmoBox1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
brightmaps/S_Ammo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

View file

@ -242,6 +242,51 @@ Object ActUTNightVision
Frame "UKEY" { light "UTVISLIGHT" } Frame "UKEY" { light "UTVISLIGHT" }
} }
PointLight UTAMMOBOXLOW
{
Color 0.1 0.2 0.5
Size 16
Offset 0 20 0
Attenuate 1
}
PointLight UTAMMOBOXMED
{
Color 0.2 0.5 0.1
Size 18
Offset 0 20 0
Attenuate 1
}
PointLight UTAMMOBOXHIGH
{
Color 0.5 0.1 0.2
Size 20
Offset 0 20 0
Attenuate 1
}
PointLight UTAMMOBOXFULL
{
Color 0.3 0.1 0.5
Size 24
Offset 0 20 0
Attenuate 1
}
Object UTMinorAmmoBox
{
Frame "ABOX" { light "UTAMMOBOXLOW" }
}
Object UTMediumAmmoBox
{
Frame "ABOX" { light "UTAMMOBOXMED" }
}
Object UTMajorAmmoBox
{
Frame "ABOX" { light "UTAMMOBOXHIGH" }
}
Object ActUTFullAmmoBox
{
Frame "ABOX" { light "UTAMMOBOXFULL" }
}
// Shaders / Brightmaps // Shaders / Brightmaps
HardwareShader Texture "models/Jgreen.png" HardwareShader Texture "models/Jgreen.png"
{ {
@ -811,6 +856,32 @@ HardwareShader Texture "models/Effect1.png"
{ {
Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp" Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp"
} }
HardwareShader Texture "models/ABoxBlue_env.png"
{
Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp"
}
HardwareShader Texture "models/ABoxGreen_env.png"
{
Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp"
}
HardwareShader Texture "models/ABoxRed_env.png"
{
Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp"
}
HardwareShader Texture "models/ABoxPurple_env.png"
{
Shader "shaders/glsl/MeshEnviroMap_AmbientGlow.fp"
}
HardwareShader Texture "models/JAmmoBox1.png"
{
Shader "shaders/glsl/AmbientGlow_Brightmapped.fp"
Texture brighttex "brightmaps/JAmmoBox1.png"
}
HardwareShader Texture "models/S_Ammo.png"
{
Shader "shaders/glsl/AmbientGlow_Brightmapped.fp"
Texture brighttex "brightmaps/S_Ammo.png"
}
// PP shaders // PP shaders
HardwareShader PostProcess scene HardwareShader PostProcess scene
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

Before After
Before After

BIN
graphics/hud/ItemABox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -88,6 +88,10 @@ I_REDEEMER = "You got the Redeemer.";
I_CHAINSAWAMMO = "You picked up a Fuel Can."; I_CHAINSAWAMMO = "You picked up a Fuel Can.";
I_UTINVUL = "You have Invulnerability!"; I_UTINVUL = "You have Invulnerability!";
I_UTVISION = "You have Night Vision."; I_UTVISION = "You have Night Vision.";
I_AMMOBOXLOW = "You picked up a lesser Ammo Cube.";
I_AMMOBOXMED = "You picked up a medium Ammo Cube.";
I_AMMOBOXHIGH = "You picked up a greater Ammo Cube.";
I_AMMOBOXFULL = "You got a full Ammo Cube.";
/* Tags */ /* Tags */
T_ARMORBONUS = "Armor Bonus"; T_ARMORBONUS = "Armor Bonus";
T_THIGHPADS = "Thigh Pads"; T_THIGHPADS = "Thigh Pads";
@ -144,6 +148,10 @@ T_REDEEMER = "Redeemer";
T_CHAINSAWAMMO = "Chainsaw Fuel"; T_CHAINSAWAMMO = "Chainsaw Fuel";
T_UTINVUL = "Invulnerability"; T_UTINVUL = "Invulnerability";
T_UTVISION = "Night Vision"; T_UTVISION = "Night Vision";
T_AMMOBOXLOW = "Lesser Ammo Cube";
T_AMMOBOXMED = "Medium Ammo Cube";
T_AMMOBOXHIGH = "Greater Ammo Cube";
T_AMMOBOXFULL = "Full Ammo Cube";
/* Miscellaneous */ /* Miscellaneous */
D_SHIELDBELT = "The Shield Belt has depleted."; D_SHIELDBELT = "The Shield Belt has depleted.";
D_UDAMAGE = "Damage Amplifier has worn off."; D_UDAMAGE = "Damage Amplifier has worn off.";
@ -362,6 +370,10 @@ I_REDEEMER = "Has obtenido el Redentor.";
I_CHAINSAWAMMO = "Has recogido una Lata de Combustible."; I_CHAINSAWAMMO = "Has recogido una Lata de Combustible.";
I_UTINVUL = "Tienes la Invulnerabilidad!"; I_UTINVUL = "Tienes la Invulnerabilidad!";
I_UTVISION = "Tienes la Visión Nocturna."; I_UTVISION = "Tienes la Visión Nocturna.";
I_AMMOBOXLOW = "Has recogido un Cubo de Munición menor.";
I_AMMOBOXMED = "Has recogido un Cubo de Munición mediano.";
I_AMMOBOXHIGH = "Has recogido un Cubo de Munición mayor.";
I_AMMOBOXFULL = "Has obtenido un Cubo de Munición completa.";
/* Tags */ /* Tags */
T_ARMORBONUS = "Armadura Extra"; T_ARMORBONUS = "Armadura Extra";
T_THIGHPADS = "Musleras"; T_THIGHPADS = "Musleras";
@ -418,6 +430,10 @@ T_REDEEMER = "Redentor";
T_CHAINSAWAMMO = "Combustible de Motosierra"; T_CHAINSAWAMMO = "Combustible de Motosierra";
T_UTINVUL = "Invulnerabilidad"; T_UTINVUL = "Invulnerabilidad";
T_UTVISION = "Visión Nocturna"; T_UTVISION = "Visión Nocturna";
T_AMMOBOXLOW = "Cubo de Munición menor";
T_AMMOBOXMED = "Cubo de Munición mediano";
T_AMMOBOXHIGH = "Cubo de Munición mayor";
T_AMMOBOXFULL = "Cubo de Munición completa";
/* Miscellaneous */ /* Miscellaneous */
D_SHIELDBELT = "El Cinturón Protector se ha agotado."; D_SHIELDBELT = "El Cinturón Protector se ha agotado.";
D_UDAMAGE = "El Amplificador de Daño ha desaparecido."; D_UDAMAGE = "El Amplificador de Daño ha desaparecido.";

View file

@ -886,3 +886,60 @@ Model "UTLavaSplish"
FrameIndex SPSH Y 0 25 FrameIndex SPSH Y 0 25
FrameIndex SPSH Z 0 26 FrameIndex SPSH Z 0 26
} }
Model "UTMinorAmmoBox"
{
Path "models"
Model 0 "AmmoCube_d.3d"
SurfaceSkin 0 0 "JAmmoBox1.png"
SurfaceSkin 0 1 "ABoxBlue_env.png"
SurfaceSkin 0 2 "S_Ammo.png"
Scale 0.015 0.015 0.015
ZOffset 20
ROTATING
Rotation-Speed 3
FrameIndex ABOX A 0 0
}
Model "UTMediumAmmoBox"
{
Path "models"
Model 0 "AmmoCube_d.3d"
SurfaceSkin 0 0 "JAmmoBox1.png"
SurfaceSkin 0 1 "ABoxGreen_env.png"
SurfaceSkin 0 2 "S_Ammo.png"
Scale 0.017 0.017 0.017
ZOffset 20
ROTATING
Rotation-Speed 3
FrameIndex ABOX A 0 0
}
Model "UTMajorAmmoBox"
{
Path "models"
Model 0 "AmmoCube_d.3d"
SurfaceSkin 0 0 "JAmmoBox1.png"
SurfaceSkin 0 1 "ABoxRed_env.png"
SurfaceSkin 0 2 "S_Ammo.png"
Scale 0.02 0.02 0.02
ZOffset 20
ROTATING
Rotation-Speed 3
FrameIndex ABOX A 0 0
}
Model "ActUTFullAmmoBox"
{
Path "models"
Model 0 "AmmoCube_d.3d"
SurfaceSkin 0 0 "JAmmoBox1.png"
SurfaceSkin 0 1 "ABoxPurple_env.png"
SurfaceSkin 0 2 "S_Ammo.png"
Scale 0.03 0.03 0.03
ZOffset 20
ROTATING
Rotation-Speed 3
FrameIndex ABOX A 0 0
}

BIN
models/ABoxBlue_env.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
models/ABoxGreen_env.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
models/ABoxPurple_env.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
models/ABoxRed_env.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View file

@ -3,5 +3,5 @@ vec4 ProcessTexel()
{ {
vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz);
vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz));
return getTexel(norm.xz*0.5); return getTexel(norm.xz*0.5+0.5);
} }

View file

@ -10,5 +10,5 @@ vec4 ProcessTexel()
{ {
vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz); vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz);
vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz)); vec3 norm = reflect(eyedir,normalize(vWorldNormal.xyz));
return getTexel(norm.xz*0.5); return getTexel(norm.xz*0.5+0.5);
} }

View file

@ -166,6 +166,12 @@ $random ut/playerfootstep { ut/playerfootstep1 ut/playerfootstep2 ut/playerfoots
ut/bossfootstep bfootstp ut/bossfootstep bfootstp
// Hexen fixup
PlayerLand DSEMPTY
PuzzleFailFighter DSEMPTY
PuzzleFailCleric DSEMPTY
PuzzleFailMage DSEMPTY
// fluid sounds // fluid sounds
ut/playerfootstepwet lsplash ut/playerfootstepwet lsplash

View file

@ -21,3 +21,4 @@ Sprite "CHIPA0",1,1{}
Sprite "USKLA0",1,1{} Sprite "USKLA0",1,1{}
Sprite "UKEYA0",1,1{} Sprite "UKEYA0",1,1{}
Sprite "RNGXA0",1,1{} Sprite "RNGXA0",1,1{}
Sprite "ABOXA0",1,1{}

View file

@ -287,13 +287,13 @@ Class UTHexenAmmoBox : Inventory
default default
{ {
UTHexenAmmoBox.AmmoFactor -1; UTHexenAmmoBox.AmmoFactor -1;
+INVENTORY.ALWAYSPICKUP; +FLOATBOB;
Inventory.PickupSound = "misc/i_pkup"; Inventory.PickupSound "misc/i_pkup";
} }
override bool TryPickup( in out Actor toucher ) override bool TryPickup( in out Actor toucher )
{ {
bool hasgiven = (AmmoFactor <= 0); // always true bool hasgiven = (AmmoFactor < 0); // always true
for ( int i=0; i<AllActorClasses.Size(); i++ ) for ( int i=0; i<AllActorClasses.Size(); i++ )
{ {
let type = (class<Ammo>)(AllActorClasses[i]); let type = (class<Ammo>)(AllActorClasses[i]);
@ -315,23 +315,27 @@ Class UTHexenAmmoBox : Inventory
} }
} }
// sneaky fix for chainsaw ammo // sneaky fix for chainsaw ammo
if ( (type is 'ChainsawAmmo') && flak_sawammo ) isvalid = true; if ( (type is 'ChainsawAmmo') && flak_sawammo && (GetReplacement(type) == type) ) isvalid = true;
if ( !isvalid ) continue; if ( !isvalid ) continue;
let ammoitem = Ammo(toucher.FindInventory(type)); let ammoitem = Ammo(toucher.FindInventory(type));
int amount; int amount = GetDefaultByType(type).BackpackAmount;
if ( AmmoFactor < 0 ) amount = GetDefaultByType(type).MaxAmount; if ( AmmoFactor < 0 )
{
if ( ammoitem ) amount = ammoitem.MaxAmount;
else amount = GetDefaultByType(type).MaxAmount;
}
else else
{ {
amount = (GetDefaultByType(type).Amount*100)/AmmoFactor; amount = (amount*AmmoFactor)/100;
// extra ammo in baby mode and nightmare mode // extra ammo in baby mode and nightmare mode
if ( !bIgnoreSkill ) amount = int(amount*G_SkillPropertyFloat(SKILLP_AmmoFactor)); if ( !bIgnoreSkill ) amount = int(amount*G_SkillPropertyFloat(SKILLP_AmmoFactor));
} }
if ( amount < 0 ) amount = 0; if ( amount <= 0 ) continue;
if ( !ammoitem ) if ( !ammoitem )
{ {
// The player did not have the ammoitem. Add it. // The player did not have the ammoitem. Add it.
ammoitem = Ammo(Spawn(type)); ammoitem = Ammo(Spawn(type));
ammoitem.Amount = bDepleted?0:amount; ammoitem.Amount = amount;
if ( ammoitem.Amount > ammoitem.MaxAmount ) if ( ammoitem.Amount > ammoitem.MaxAmount )
ammoitem.Amount = ammoitem.MaxAmount; ammoitem.Amount = ammoitem.MaxAmount;
ammoitem.AttachToOwner(toucher); ammoitem.AttachToOwner(toucher);
@ -340,7 +344,7 @@ Class UTHexenAmmoBox : Inventory
else else
{ {
// The player had the ammoitem. Give some more. // The player had the ammoitem. Give some more.
if ( !bDepleted && (ammoitem.Amount < ammoitem.MaxAmount) ) if ( ammoitem.Amount < ammoitem.MaxAmount )
{ {
ammoitem.Amount += amount; ammoitem.Amount += amount;
if ( ammoitem.Amount > ammoitem.MaxAmount ) if ( ammoitem.Amount > ammoitem.MaxAmount )
@ -375,12 +379,12 @@ Class UTMediumAmmoBox : UTHexenAmmoBox
{ {
Tag "$T_AMMOBOXMED"; Tag "$T_AMMOBOXMED";
Inventory.PickupMessage "$I_AMMOBOXMED"; Inventory.PickupMessage "$I_AMMOBOXMED";
UTHexenAmmoBox.AmmoFactor 120; UTHexenAmmoBox.AmmoFactor 90;
} }
States States
{ {
Spawn: Spawn:
ABOX B -1; ABOX A -1;
Stop; Stop;
} }
} }
@ -390,12 +394,12 @@ Class UTMajorAmmoBox : UTHexenAmmoBox
{ {
Tag "$T_AMMOBOXHIGH"; Tag "$T_AMMOBOXHIGH";
Inventory.PickupMessage "$I_AMMOBOXHIGH"; Inventory.PickupMessage "$I_AMMOBOXHIGH";
UTHexenAmmoBox.AmmoFactor 180; UTHexenAmmoBox.AmmoFactor 120;
} }
States States
{ {
Spawn: Spawn:
ABOX C -1; ABOX A -1;
Stop; Stop;
} }
} }
@ -407,6 +411,7 @@ Class ActUTFullAmmoBox : UTActivatable
Inventory.Icon "ItemABox"; Inventory.Icon "ItemABox";
Inventory.PickupMessage "$I_AMMOBOXFULL"; Inventory.PickupMessage "$I_AMMOBOXFULL";
+COUNTITEM; +COUNTITEM;
+FLOATBOB;
+INVENTORY.BIGPOWERUP; +INVENTORY.BIGPOWERUP;
UTActivatable.GiveItem "UTHexenAmmoBox"; UTActivatable.GiveItem "UTHexenAmmoBox";
Inventory.RespawnTics 4200; Inventory.RespawnTics 4200;
@ -414,7 +419,7 @@ Class ActUTFullAmmoBox : UTActivatable
States States
{ {
Spawn: Spawn:
ABOX D -1; ABOX A -1;
Stop; Stop;
} }
} }

View file

@ -66,7 +66,7 @@ Class ImpactHammer : UTWeapon
if ( invoker.count > .2 ) if ( invoker.count > .2 )
{ {
invoker.count = 0; invoker.count = 0;
A_AlertMonsters(); A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0);
} }
A_QuakeEx(clamp(int(invoker.chargesize),0,2),clamp(int(invoker.chargesize),0,2),clamp(int(invoker.chargesize),0,2),2,0,96,"",QF_RELATIVE,rollIntensity:clamp(invoker.chargesize*0.3,0,0.3)); A_QuakeEx(clamp(int(invoker.chargesize),0,2),clamp(int(invoker.chargesize),0,2),clamp(int(invoker.chargesize),0,2),2,0,96,"",QF_RELATIVE,rollIntensity:clamp(invoker.chargesize*0.3,0,0.3));
UTMainHandler.DoSwing(self,(FRandom[Impact](-1,1),FRandom[Impact](-1,1)),invoker.chargesize*0.1,0,1,SWING_Spring); UTMainHandler.DoSwing(self,(FRandom[Impact](-1,1),FRandom[Impact](-1,1)),invoker.chargesize*0.1,0,1,SWING_Spring);
@ -90,7 +90,7 @@ Class ImpactHammer : UTWeapon
A_PlaySound("impact/release",CHAN_WEAPON); A_PlaySound("impact/release",CHAN_WEAPON);
invoker.FireEffect(); invoker.FireEffect();
UTMainHandler.DoSwing(self,(FRandom[Impact](-0.3,-1.5),FRandom[Impact](-1.2,-0.4)),3,-0.8,3,SWING_Spring,3,2); UTMainHandler.DoSwing(self,(FRandom[Impact](-0.3,-1.5),FRandom[Impact](-1.2,-0.4)),3,-0.8,3,SWING_Spring,3,2);
A_AlertMonsters(); A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0);
Vector3 x, y, z; Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-4*z); Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-4*z);
@ -102,6 +102,7 @@ Class ImpactHammer : UTWeapon
int dmg = int(60*realcharge); int dmg = int(60*realcharge);
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'impact',DMG_THRUSTLESS); dmg = d.HitActor.DamageMobj(invoker,self,dmg,'impact',DMG_THRUSTLESS);
d.HitActor.vel = x*(8000/d.HitActor.mass)*realcharge; d.HitActor.vel = x*(8000/d.HitActor.mass)*realcharge;
if ( gameinfo.gametype&GAME_Strife ) d.HitActor.DaggerAlert(self);
if ( d.HitActor.bNOBLOOD ) if ( d.HitActor.bNOBLOOD )
{ {
let p = Spawn("HammerImpact",d.HitLocation-d.HitDir*4); let p = Spawn("HammerImpact",d.HitLocation-d.HitDir*4);
@ -154,7 +155,7 @@ Class ImpactHammer : UTWeapon
A_PlaySound("impact/fire",CHAN_WEAPON); A_PlaySound("impact/fire",CHAN_WEAPON);
invoker.FireEffect(); invoker.FireEffect();
UTMainHandler.DoSwing(self,(FRandom[Impact](-0.3,-1.5),FRandom[Impact](-1.2,-0.4)),2,-0.6,2,SWING_Spring,1,2); UTMainHandler.DoSwing(self,(FRandom[Impact](-0.3,-1.5),FRandom[Impact](-1.2,-0.4)),2,-0.6,2,SWING_Spring,1,2);
A_AlertMonsters(); A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0);
A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1);
Vector3 x, y, z; Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
@ -167,6 +168,7 @@ Class ImpactHammer : UTWeapon
int dmg = int(20*dscale); int dmg = int(20*dscale);
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'impact',DMG_THRUSTLESS); dmg = d.HitActor.DamageMobj(invoker,self,dmg,'impact',DMG_THRUSTLESS);
d.HitActor.vel = x*(4000/d.HitActor.mass)*dscale; d.HitActor.vel = x*(4000/d.HitActor.mass)*dscale;
if ( gameinfo.gametype&GAME_Strife ) d.HitActor.DaggerAlert(self);
} }
else if ( d.HitType != TRACE_HitNone ) else if ( d.HitType != TRACE_HitNone )
{ {

View file

@ -234,7 +234,7 @@ Class UTBackpack : BackpackItem
} }
} }
// sneaky fix for chainsaw ammo // sneaky fix for chainsaw ammo
if ( (type is 'ChainsawAmmo') && flak_sawammo ) isvalid = true; if ( (type is 'ChainsawAmmo') && flak_sawammo && (GetReplacement(type) == type) ) isvalid = true;
if ( !isvalid ) continue; if ( !isvalid ) continue;
let ammoitem = Ammo(other.FindInventory(type)); let ammoitem = Ammo(other.FindInventory(type));
int amount = GetDefaultByType(type).BackpackAmount; int amount = GetDefaultByType(type).BackpackAmount;

View file

@ -1,5 +1,6 @@
Class UTPlayer : DoomPlayer Class UTPlayer : DoomPlayer
{ {
bool doprintnoammo;
bool lastground; bool lastground;
int lastwaterlevel; int lastwaterlevel;
int lastgroundtic; int lastgroundtic;
@ -198,9 +199,14 @@ Class UTPlayer : DoomPlayer
let type = (class<Inventory>)(AllActorClasses[i]); let type = (class<Inventory>)(AllActorClasses[i]);
if ( !type ) continue; if ( !type ) continue;
let def = GetDefaultByType(type); let def = GetDefaultByType(type);
if ( !(gameinfo.gametype&GAME_Raven) if ( (!(gameinfo.gametype&GAME_Raven)
&& ((type is "UTActivatable") || (type is "UTActivatableHealth"))) && ((type is "UTActivatable") || (type is "UTActivatableHealth")))
continue; // don't give these outside of Heretic/Hexen || ((gameinfo.gametype&GAME_HERETIC) && (type is 'ActUTFullAmmoBox')) )
{
// don't give activatables outside of Heretic/Hexen
// don't give full ammo cubes outside of Hexen
continue;
}
if ( def.Icon.isValid() && (def.MaxAmount > 1) && if ( def.Icon.isValid() && (def.MaxAmount > 1) &&
!(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "Armor")) !(type is "PuzzleItem") && !(type is "Powerup") && !(type is "Ammo") && !(type is "Armor"))
{ {
@ -235,9 +241,28 @@ Class UTPlayer : DoomPlayer
else GiveInventory(type,amount,true); else GiveInventory(type,amount,true);
} }
// modified so it displays the "has no ammo" message
override Weapon PickWeapon( int slot, bool checkammo )
{
doprintnoammo = true;
let rslt = Super.PickWeapon(slot,checkammo);
doprintnoammo = false;
return rslt;
}
override void Tick() override void Tick()
{ {
Super.Tick(); Super.Tick();
if ( !flak_utmovement || !player || (player.mo != self) || (player.cheats&(CF_FROZEN|CF_TOTALLYFROZEN)) )
{
bNOFRICTION = false;
bNOFRICTIONBOUNCE = false;
}
else
{
bNOFRICTION = true;
bNOFRICTIONBOUNCE = true;
}
if ( InStateSequence(CurState,FindState("See",true)) ) if ( InStateSequence(CurState,FindState("See",true)) )
SetStateLabel("See2"); SetStateLabel("See2");
if ( (waterlevel >= 2) && (lastwaterlevel < 2) ) if ( (waterlevel >= 2) && (lastwaterlevel < 2) )
@ -252,17 +277,6 @@ Class UTPlayer : DoomPlayer
else if ( (waterlevel < 3) && underwatersnd ) else if ( (waterlevel < 3) && underwatersnd )
underwatersnd.Destroy(); underwatersnd.Destroy();
lastwaterlevel = waterlevel; lastwaterlevel = waterlevel;
if ( !flak_utmovement || !player || (player.mo != self) || (player.cheats&(CF_FROZEN|CF_TOTALLYFROZEN)) )
{
bNOFRICTION = false;
bNOFRICTIONBOUNCE = false;
return;
}
else
{
bNOFRICTION = true;
bNOFRICTIONBOUNCE = true;
}
if ( !footsteps ) footsteps = CVar.GetCVar('flak_footsteps',players[consoleplayer]); if ( !footsteps ) footsteps = CVar.GetCVar('flak_footsteps',players[consoleplayer]);
if ( !footsteps.GetBool() || (Health <= 0) ) return; if ( !footsteps.GetBool() || (Health <= 0) ) return;
double ang = level.time/(20*TICRATE/35.)*360.; double ang = level.time/(20*TICRATE/35.)*360.;
@ -1895,11 +1909,9 @@ Class UTWeapon : Weapon
override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount )
{ {
bool rslt = Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount); bool rslt = Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount);
if ( (gametic > lastnoammotic) && !rslt && !autoSwitch && !requireAmmo && Owner.CheckLocalView() ) if ( (gametic <= lastnoammotic) || rslt || !Owner.CheckLocalView() || !(Owner is 'UTPlayer') || !UTPlayer(Owner).doprintnoammo ) return rslt;
{
lastnoammotic = gametic; lastnoammotic = gametic;
Console.Printf(StringTable.Localize((Amount>1)?"$M_NOAMMO2":"$M_NOAMMO"),GetTag()); Console.Printf(StringTable.Localize((Amount>1)?"$M_NOAMMO2":"$M_NOAMMO"),GetTag());
}
return rslt; return rslt;
} }
@ -3133,6 +3145,10 @@ Class UTMainHandler : EventHandler
else if ( e.Replacee == 'FWeaponPiece1' ) e.Replacement = 'WarheadAmmo'; else if ( e.Replacee == 'FWeaponPiece1' ) e.Replacement = 'WarheadAmmo';
else if ( e.Replacee == 'CWeaponPiece1' ) e.Replacement = 'UTBackpack'; else if ( e.Replacee == 'CWeaponPiece1' ) e.Replacement = 'UTBackpack';
else if ( (e.Replacee == 'MWeaponPiece1') || (e.Replacee == 'MWeapBloodscourge') || (e.Replacee.GetClassName() == 'mkFullBloodscourge') ) e.Replacement = 'WarheadLauncher'; else if ( (e.Replacee == 'MWeaponPiece1') || (e.Replacee == 'MWeapBloodscourge') || (e.Replacee.GetClassName() == 'mkFullBloodscourge') ) e.Replacement = 'WarheadLauncher';
else if ( e.Replacee == 'Mana1' ) e.Replacement = 'UTMinorAmmoBox';
else if ( e.Replacee == 'Mana2' ) e.Replacement = 'UTMediumAmmoBox';
else if ( e.Replacee == 'Mana3' ) e.Replacement = 'UTMajorAmmoBox';
else if ( e.Replacee == 'ArtiBoostMana' ) e.Replacement = 'ActUTFullAmmoBox';
// TODO Strife replacements // TODO Strife replacements
} }
@ -3199,19 +3215,23 @@ Class UTMainHandler : EventHandler
level.sectors[i].SetTexture(1,skyflatnum); level.sectors[i].SetTexture(1,skyflatnum);
if ( level.sectors[i].GetTexture(0) == deftex ) if ( level.sectors[i].GetTexture(0) == deftex )
{ {
if ( gameinfo.gametype == GAME_DOOM ) if ( gameinfo.gametype&GAME_DOOM )
level.sectors[i].SetTexture(0,((i==47)||((i>=256)&&(i<=260)))?baseceil:baseflor); level.sectors[i].SetTexture(0,((i==47)||((i>=256)&&(i<=260)))?baseceil:baseflor);
else if ( gameinfo.gametype == GAME_HERETIC ) else if ( gameinfo.gametype&GAME_HERETIC )
level.sectors[i].SetTexture(0,((i==47)||((i>=144)&&(i<=148)))?baseceil:baseflor); level.sectors[i].SetTexture(0,((i==47)||((i>=144)&&(i<=148)))?baseceil:baseflor);
else if ( gameinfo.gametype&GAME_HEXEN )
level.sectors[i].SetTexture(0,((i==47)||((i>=152)&&(i<=155)))?baseceil:baseflor);
level.sectors[i].SetXScale(0,2.); level.sectors[i].SetXScale(0,2.);
level.sectors[i].SetYScale(0,2.); level.sectors[i].SetYScale(0,2.);
} }
if ( level.sectors[i].GetTexture(1) == deftex ) if ( level.sectors[i].GetTexture(1) == deftex )
{ {
if ( gameinfo.gametype == GAME_DOOM ) if ( gameinfo.gametype&GAME_DOOM )
level.sectors[i].SetTexture(1,((i==47)||((i>=256)&&(i<=260)))?baseflor:baseceil); level.sectors[i].SetTexture(1,((i==47)||((i>=256)&&(i<=260)))?baseflor:baseceil);
else if ( gameinfo.gametype == GAME_HERETIC ) else if ( gameinfo.gametype&GAME_HERETIC )
level.sectors[i].SetTexture(1,((i==47)||((i>=144)&&(i<=148)))?baseflor:baseceil); level.sectors[i].SetTexture(1,((i==47)||((i>=144)&&(i<=148)))?baseflor:baseceil);
else if ( gameinfo.gametype&GAME_HEXEN )
level.sectors[i].SetTexture(1,((i==47)||((i>=152)&&(i<=155)))?baseflor:baseceil);
level.sectors[i].SetXScale(1,2.); level.sectors[i].SetXScale(1,2.);
level.sectors[i].SetYScale(1,2.); level.sectors[i].SetYScale(1,2.);
} }
@ -3223,8 +3243,8 @@ Class UTMainHandler : EventHandler
for ( int j=0; j<3; j++ ) for ( int j=0; j<3; j++ )
{ {
if ( level.sides[i].GetTexture(j) != deftex ) continue; if ( level.sides[i].GetTexture(j) != deftex ) continue;
if ( ((gameinfo.gametype == GAME_DOOM) && ((i==529) || (i==530) || (i==533) || (i==534))) if ( ((gameinfo.gametype&GAME_DOOM) && ((i==529) || (i==530) || (i==533) || (i==534)))
|| ((gameinfo.gametype == GAME_HERETIC) && ((i==295) || (i==296) || (i==309) || (i==310))) ) || ((gameinfo.gametype&GAME_RAVEN) && ((i==295) || (i==296) || (i==309) || (i==310))) )
{ {
level.sides[i].SetTexture(j,xbasewall); level.sides[i].SetTexture(j,xbasewall);
level.sides[i].SetTextureYOffset(j,-2304); level.sides[i].SetTextureYOffset(j,-2304);
@ -3236,7 +3256,7 @@ Class UTMainHandler : EventHandler
} }
// fixup // fixup
level.sectors[53].SetFade("00 00 20"); level.sectors[53].SetFade("00 00 20");
if ( gameinfo.gametype == GAME_DOOM ) if ( gameinfo.gametype&GAME_DOOM )
{ {
for ( int i=215; i<246; i++ ) for ( int i=215; i<246; i++ )
{ {
@ -3248,7 +3268,7 @@ Class UTMainHandler : EventHandler
level.sides[1844].SetTexture(1,glasstex); level.sides[1844].SetTexture(1,glasstex);
level.lines[945].alpha = 0.5; level.lines[945].alpha = 0.5;
} }
else if ( gameinfo.gametype == GAME_HERETIC ) else if ( gameinfo.gametype&GAME_HERETIC )
{ {
for ( int i=104; i<134; i++ ) for ( int i=104; i<134; i++ )
{ {
@ -3260,6 +3280,18 @@ Class UTMainHandler : EventHandler
level.sides[216].SetTexture(1,glasstex); level.sides[216].SetTexture(1,glasstex);
level.lines[125].alpha = 0.5; level.lines[125].alpha = 0.5;
} }
else if ( gameinfo.gametype&GAME_HEXEN )
{
for ( int i=111; i<141; i++ )
{
if ( (i==114) || (i==117) || (i==123)
|| (i==126) || (i==128) || (i==134)
|| (i==139) ) continue;
level.sectors[i].SetSpecialColor(0,"00 00 00");
}
level.sides[216].SetTexture(1,glasstex);
level.lines[125].alpha = 0.5;
}
AddLight((0,-288,128),"E0 E0 FF",256); AddLight((0,-288,128),"E0 E0 FF",256);
AddLight((-2560,1024,1280),"E0 E0 FF",1024); AddLight((-2560,1024,1280),"E0 E0 FF",1024);
AddLight((0,1024,1280),"E0 E0 FF",1024); AddLight((0,1024,1280),"E0 E0 FF",1024);
@ -3271,7 +3303,7 @@ Class UTMainHandler : EventHandler
AddLight((2904,1344,128),"80 80 FF",256); AddLight((2904,1344,128),"80 80 FF",256);
AddLight((3408,1344,128),"80 80 FF",256); AddLight((3408,1344,128),"80 80 FF",256);
AddLight((1568,1760,64),"20 20 80",128); AddLight((1568,1760,64),"20 20 80",128);
if ( gameinfo.gametype == GAME_DOOM ) if ( gameinfo.gametype&GAME_DOOM )
{ {
AddLight((1824,1760,64),"80 20 20",128); AddLight((1824,1760,64),"80 20 20",128);
AddLight((2080,1760,64),"FF 80 20",128); AddLight((2080,1760,64),"FF 80 20",128);
@ -3281,8 +3313,14 @@ Class UTMainHandler : EventHandler
AddLight((2944,960,64),"20 FF 20",128); AddLight((2944,960,64),"20 FF 20",128);
AddLight((2944,736,64),"20 FF 20",128); AddLight((2944,736,64),"20 FF 20",128);
AddLight((3264,960,64),"FF 20 20",128); AddLight((3264,960,64),"FF 20 20",128);
AddLight((3264,736,64),"A0 A0 30",128);
AddLight((3264,512,64),"80 80 20",128);
AddLight((3584,960,64),"80 80 20",128);
AddLight((3584,736,64),"20 FF 20",128);
AddLight((3584,512,64),"FF 80 20",128);
AddLight((3584,288,64),"FF 80 FF",128);
} }
else if ( gameinfo.gametype == GAME_HERETIC ) else if ( gameinfo.gametype&GAME_HERETIC )
{ {
AddLight((1824,1760,64),"A0 A0 30",128); AddLight((1824,1760,64),"A0 A0 30",128);
AddLight((2080,1760,64),"80 80 20",128); AddLight((2080,1760,64),"80 80 20",128);
@ -3291,18 +3329,6 @@ Class UTMainHandler : EventHandler
AddLight((2944,960,64),"A0 A0 30",128); AddLight((2944,960,64),"A0 A0 30",128);
AddLight((2944,736,64),"A0 A0 30",128); AddLight((2944,736,64),"A0 A0 30",128);
AddLight((3264,960,64),"A0 A0 30",128); AddLight((3264,960,64),"A0 A0 30",128);
}
AddLight((3264,736,64),"A0 A0 30",128);
if ( gameinfo.gametype == GAME_DOOM )
{
AddLight((3264,512,64),"80 80 20",128);
AddLight((3584,960,64),"80 80 20",128);
AddLight((3584,736,64),"20 FF 20",128);
AddLight((3584,512,64),"FF 80 20",128);
AddLight((3584,288,64),"FF 80 FF",128);
}
else if ( gameinfo.gametype == GAME_HERETIC )
{
AddLight((3264,736,64),"A0 A0 30",128); AddLight((3264,736,64),"A0 A0 30",128);
AddLight((3264,512,64),"A0 A0 30",128); AddLight((3264,512,64),"A0 A0 30",128);
AddLight((3264,288,64),"FF 80 20",128); AddLight((3264,288,64),"FF 80 20",128);
@ -3311,6 +3337,23 @@ Class UTMainHandler : EventHandler
AddLight((3584,512,64),"FF 80 20",128); AddLight((3584,512,64),"FF 80 20",128);
AddLight((3584,288,64),"A0 A0 30",128); AddLight((3584,288,64),"A0 A0 30",128);
} }
else if ( gameinfo.gametype&GAME_HEXEN )
{
AddLight((1824,1760,64),"40 80 20",128);
AddLight((2080,1760,64),"FF 80 20",128);
AddLight((2336,1760,64),"20 20 80",128);
AddLight((2592,1760,64),"20 20 80",128);
AddLight((2944,960,64),"40 80 20",128);
AddLight((2944,736,64),"40 80 20",128);
AddLight((3264,960,64),"40 80 20",128);
AddLight((3264,736,64),"40 80 20",128);
AddLight((3264,512,64),"40 80 20",128);
AddLight((3264,288,64),"FF 80 20",128);
AddLight((3584,960,64),"40 80 20",128);
AddLight((3584,736,64),"FF 80 20",128);
AddLight((3584,512,64),"FF 80 20",128);
AddLight((3584,288,64),"FF 80 20",128);
}
AddAmbient((0,-288,192),"testamb/wind1",0.5,1.6); AddAmbient((0,-288,192),"testamb/wind1",0.5,1.6);
AddAmbient((-2560,1024,768),"testamb/wind1",0.4,0.8); AddAmbient((-2560,1024,768),"testamb/wind1",0.4,0.8);
AddAmbient((0,1024,768),"testamb/wind1",0.4,0.8); AddAmbient((0,1024,768),"testamb/wind1",0.4,0.8);
@ -3318,7 +3361,7 @@ Class UTMainHandler : EventHandler
AddAmbient((768,1600,1280),"testamb/wind2",0.8,1.6); AddAmbient((768,1600,1280),"testamb/wind2",0.8,1.6);
AddAmbient((3174,1344,128),"testamb/water",0.4,1.6); AddAmbient((3174,1344,128),"testamb/water",0.4,1.6);
AddAmbient((1568,1760,64),"testamb/water",0.4,2.4); AddAmbient((1568,1760,64),"testamb/water",0.4,2.4);
if ( gameinfo.gametype == GAME_DOOM ) if ( gameinfo.gametype&GAME_DOOM )
{ {
AddAmbient((2080,1760,64),"testamb/lava",0.8,2.4); AddAmbient((2080,1760,64),"testamb/lava",0.8,2.4);
AddAmbient((2336,1760,64),"testamb/slime",0.4,2.4); AddAmbient((2336,1760,64),"testamb/slime",0.4,2.4);
@ -3326,12 +3369,19 @@ Class UTMainHandler : EventHandler
AddAmbient((2944,736,64),"testamb/slime",0.4,2.4); AddAmbient((2944,736,64),"testamb/slime",0.4,2.4);
AddAmbient((3584,736,64),"testamb/slime",0.4,2.4); AddAmbient((3584,736,64),"testamb/slime",0.4,2.4);
} }
else if ( gameinfo.gametype == GAME_HERETIC ) else if ( gameinfo.gametype&GAME_HERETIC )
{ {
AddAmbient((2336,1760,64),"testamb/water",0.4,2.4); AddAmbient((2336,1760,64),"testamb/water",0.4,2.4);
AddAmbient((2592,1760,64),"testamb/lava",0.8,2.4); AddAmbient((2592,1760,64),"testamb/lava",0.8,2.4);
AddAmbient((3264,288,64),"testamb/lava",0.8,2.4); AddAmbient((3264,288,64),"testamb/lava",0.8,2.4);
} }
else if ( gameinfo.gametype&GAME_HEXEN )
{
AddAmbient((2080,1760,64),"testamb/lava",0.8,2.4);
AddAmbient((3264,288,64),"testamb/lava",0.8,2.4);
AddAmbient((3584,736,64),"testamb/lava",0.4,2.4);
AddAmbient((3584,288,64),"testamb/lava",0.4,2.4);
}
AddAmbient((3584,512,64),"testamb/lava",0.8,2.4); AddAmbient((3584,512,64),"testamb/lava",0.8,2.4);
} }

View file

@ -681,7 +681,41 @@ Class UTHud : BaseStatusBar
private void DrawKeys() private void DrawKeys()
{ {
if ( deathmatch ) return; // no need to draw in DM if ( deathmatch ) return; // no need to draw in DM
if ( gameinfo.gametype&(GAME_Hexen|GAME_Strife) ) return; // no key display for these ATM (will do eventually) if ( gameinfo.gametype&(GAME_Hexen|GAME_Strife) )
{
if ( !automapactive ) return;
int kw = (gameinfo.gametype&GAME_Strife)?20:30,
kh = (gameinfo.gametype&GAME_Strife)?20:40;
double ks = (gameinfo.gametype&GAME_Strife)?2.:1.5;
int nkeys = 0;
Array<int> rows;
Array<Inventory> keys;
keys.Clear();
rows.Clear();
rows.Push(0);
for ( Inventory i=CPlayer.mo.inv; i; i=i.inv )
{
if ( !(i is 'Key') ) continue;
keys.Push(i);
if ( rows[rows.Size()-1] >= 6 ) rows.Push(1);
else rows[rows.Size()-1]++;
}
int j = 0;
CurX = (Screen.GetWidth()-kw*hudsize*HScale*ks);
for ( int i=0; i<rows.Size(); i++ )
{
CurY = (Screen.GetHeight()-rows[i]*kh*hudsize*HScale*ks)*0.5;
CurY += 64*hudsize*HScale;
for ( int k=0; k<rows[i]; k++ )
{
UTDrawPlainTex(keys[j].Icon,hudsize*ks,min(opacity,15));
j++;
CurY += kh*hudsize*HScale*ks;
}
CurX -= kw*hudsize*HScale*ks;
}
return;
}
bool locks[6]; bool locks[6];
for ( int i=0; i<6; i++ ) locks[i] = CPlayer.mo.CheckKeys(i+1,false,true); for ( int i=0; i<6; i++ ) locks[i] = CPlayer.mo.CheckKeys(i+1,false,true);
int nrows = 0, nrowss = 0; int nrows = 0, nrowss = 0;