Reverted radius/height changes to items, it causes issues on many maps.

Implemented proper HUD rendering, along with toggling and resizing. Works just like in UT now.
Added "extended" version of the Beta menu music, quickly put together in OpenMPT. I really like it.
Added M_DOOM graphic and changed the titlemap texture.
Made various screen graphics additive now that I know how to.
Separated pickup and first person brightmaps for Pulse Gun, this is needed for beta skin packs (there will be skins for the Pulse Gun, Redeemer and Impact Hammer).
This commit is contained in:
Marisa the Magician 2018-05-31 22:02:03 +02:00
commit 4c451de008
27 changed files with 295 additions and 327 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View file

@ -1,9 +1,20 @@
user bool flak_protomenu = false; user int flak_protomenu = 0;
user bool flak_showmenu = true;
server bool flak_betaudamage = false; server bool flak_betaudamage = false;
server bool flak_pulsereload = false; server bool flak_pulsereload = false;
server bool flak_enforcerreload = false; server bool flak_enforcerreload = false;
user bool flak_redeemerreadout = true; user bool flak_redeemerreadout = true;
user int flak_colorprefs = 0; user int flak_colorprefs = 0;
user color flak_colorcustom = "ff ff ff"; user color flak_colorcustom = "00 80 ff";
user float flak_opacity = 0.8; user int flak_opacity = 15; // UT's opacity is 1 <-> 16 in steps of 1 (default 15)
user color flak_bgcolor = "00 00 00"; // 16 means fully opaque, everything else is just additive with gradually lowering alpha
// status is never fully opaque (clamped under 16)
// currently selected weapon and numbers are fully opaque until 8 opacity (their opacity is bumped by 7 basically)
user bool flak_showweapons = true; // if disabled, frags and ammo are shown centered, with a gap for armor and health
user bool flak_showstatus = true; // if disabled armor and health show on the top right (or center between frags and ammo if weapon display is disabled)
user bool flak_showammo = true;
user bool flak_showfrags = true;
user bool flak_showinfo = true;
user float flak_hudsize = 1.0; // 0.2 <-> 1.0 in steps of 0.2 (default 1.0)
user float flak_weaponsize = 0.8; // 0.2 <-> 1.0 in steps of 0.2 (default 0.8)
user float flak_statussize = 1.0; // 0.5 <-> 1.5 in steps of 0.1 (default 1.0)

View file

@ -184,7 +184,7 @@ Brightmap Texture "models/JPulseGun_02.png"
} }
/*Brightmap Texture "models/JPulsePickup_01.png" /*Brightmap Texture "models/JPulsePickup_01.png"
{ {
Map "brightmaps/JPulseGun_02.png" Map "brightmaps/JPulsePickup_01.png"
}*/ }*/
HardwareShader Texture "models/JPulsePickup_01.png" HardwareShader Texture "models/JPulsePickup_01.png"
{ {

BIN
graphics/M_DOOM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

View file

@ -3,6 +3,12 @@ OptionValue "BetaToggle"
0, "Normal" 0, "Normal"
1, "Beta" 1, "Beta"
} }
OptionValue "BetaToggleMenu"
{
0, "Normal"
1, "Beta"
2, "Beta (Alt. music)"
}
OptionValue "ColorPrefs" OptionValue "ColorPrefs"
{ {
0, "Team" 0, "Team"
@ -14,7 +20,8 @@ OptionMenu "UTOptionMenu"
Title "UT Options" Title "UT Options"
StaticText "Menu Options", "Gold" StaticText "Menu Options", "Gold"
Option "Menu Type", "flak_protomenu", "BetaToggle" Option "Show Menu", "flak_showmenu", "YesNo"
Option "Menu Type", "flak_protomenu", "BetaToggleMenu"
Command "Apply Changes", "event refreshmenu" Command "Apply Changes", "event refreshmenu"
StaticText " " StaticText " "
StaticText "Item Options", "Gold" StaticText "Item Options", "Gold"
@ -26,10 +33,17 @@ OptionMenu "UTOptionMenu"
Option "Redeemer Target Visuals", "flak_redeemerreadout", "YesNo" Option "Redeemer Target Visuals", "flak_redeemerreadout", "YesNo"
StaticText " " StaticText " "
StaticText "HUD Options", "Gold" StaticText "HUD Options", "Gold"
Option "Show Weapon Bar", "flak_showweapons", "YesNo"
Option "Show Status Doll", "flak_showstatus", "YesNo"
Option "Show Frags", "flak_showfrags", "YesNo"
Option "Show Ammo", "flak_showammo", "YesNo"
Option "Show Player Names", "flak_showinfo", "YesNo"
Slider "HUD Size", "flak_hudsize", 0.2, 1.0, 0.2, 1
Slider "Weapon Bar Size", "flak_weaponsize", 0.2, 1.0, 0.2, 1
Slider "Status Doll Size", "flak_statussize", 0.5, 1.5, 0.1, 1
Option "Color Choice", "flak_colorprefs", "ColorPrefs" Option "Color Choice", "flak_colorprefs", "ColorPrefs"
ColorPicker "Custom Color", "flak_colorcustom" ColorPicker "Custom Color", "flak_colorcustom"
Slider "HUD Opacity", "flak_opacity", 0.5, 1, 0.05, 2 Slider "HUD Opacity", "flak_opacity", 1, 16, 1, 0
ColorPicker "Background Color", "flak_bgcolor"
} }
AddOptionMenu "OptionsMenu" AddOptionMenu "OptionsMenu"

BIN
music/menu2.it Normal file

Binary file not shown.

View file

@ -1,6 +1,6 @@
DOOM TOURNAMENT DOOM TOURNAMENT
What began as a test for importing UT vertex meshes is turning into an actual What began as a test for importing UT vertex meshes has turned into an actual
full UT weapon and item mod. full UT weapon and item mod.
Currently implemented: Currently implemented:
@ -39,21 +39,19 @@ Currently implemented:
- Minigun (slot 7) - Minigun (slot 7)
- Sniper Rifle (slot 0) - Sniper Rifle (slot 0)
- Rocket Launcher (slot 9) - Rocket Launcher (slot 9)
- Scaling/Customization options for the HUD
In progress: In progress:
- Add some more effects, maybe some nicer recoil on guns too. - Make biorifle sludge follow ceiling and wall movement (this might be hard)
- General polishing and bugfixing. - Add some more effects, maybe some nicer recoil on guns too
- Trim out unused animations. - General polishing and bugfixing
- Trim out unused animations
TODO:
- Scaling/Customization options for the HUD.
Known bugs: Known bugs:
- Sometimes the slave enforcer gets "lowered" while the main enforcer is - Sometimes the slave enforcer has its psprite "lower" slightly while the main
reloading. No idea what causes this. enforcer is reloading. No idea what causes this (Could be bobbing-related)
- Sludge doesn't react to ceiling and wall movement. - Sludge doesn't react to ceiling and wall movement
- Pulse gun beams behave oddly when the player is on moving platforms. - Pulse gun beams behave oddly when the player is on moving platforms.
This might just be a rendering interpolation glitch, as usual. This might just be a rendering interpolation glitch, as usual

BIN
textures/DTLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

View file

@ -60,8 +60,6 @@ Class UTThighPads : UTArmor replaces GreenArmor
UTArmor.ArmorAbsorption 50; UTArmor.ArmorAbsorption 50;
Inventory.PickupMessage "You got the Thigh Pads."; Inventory.PickupMessage "You got the Thigh Pads.";
Inventory.PickupSound "misc/ut_armor"; Inventory.PickupSound "misc/ut_armor";
Radius 8;
Height 20;
} }
States States
{ {
@ -82,8 +80,6 @@ Class UTBodyArmor : UTArmor replaces BlueArmor
UTArmor.ArmorAbsorption 75; UTArmor.ArmorAbsorption 75;
Inventory.PickupMessage "You got the Body Armor."; Inventory.PickupMessage "You got the Body Armor.";
Inventory.PickupSound "misc/ut_armor"; Inventory.PickupSound "misc/ut_armor";
Radius 10;
Height 20;
} }
States States
{ {
@ -99,7 +95,7 @@ Class UTShieldBelt : UTArmor replaces Megasphere
{ {
if ( (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) ) if ( (amount > 0) && !DamageTypeDefinition.IgnoreArmor(damageType) )
{ {
Owner.A_PlaySound("belt/absorb"); Owner.A_PlaySound("belt/absorb",CHAN_7);
UTMainHandler.DoFlash(Owner,Color(80,255,224,0),5); UTMainHandler.DoFlash(Owner,Color(80,255,224,0),5);
} }
Super.AbsorbDamage(damage,damageType,newdamage); Super.AbsorbDamage(damage,damageType,newdamage);
@ -141,8 +137,6 @@ Class UTShieldBelt : UTArmor replaces Megasphere
Inventory.PickupMessage "You got the Shield Belt."; Inventory.PickupMessage "You got the Shield Belt.";
Inventory.PickupSound "belt/pickup"; Inventory.PickupSound "belt/pickup";
Inventory.RespawnTics 2100; Inventory.RespawnTics 2100;
Radius 10;
Height 8;
} }
States States
{ {

View file

@ -28,8 +28,6 @@ Class BioAmmo : Ammo
Ammo.BackpackAmount 50; Ammo.BackpackAmount 50;
Ammo.BackpackMaxAmount 100; Ammo.BackpackMaxAmount 100;
Ammo.DropAmount 10; Ammo.DropAmount 10;
Radius 8;
Height 8;
} }
States States
{ {
@ -497,9 +495,6 @@ Class BioRifle : UTWeapon
Weapon.AmmoType2 "BioAmmo"; Weapon.AmmoType2 "BioAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 25; Weapon.AmmoGive 25;
Radius 10;
Height 16;
UTWeapon.DroppedHeight 14;
} }
States States
{ {

View file

@ -147,9 +147,6 @@ Class UTChainsaw : UTWeapon
Weapon.SelectionOrder 9; Weapon.SelectionOrder 9;
+WEAPON.MELEEWEAPON; +WEAPON.MELEEWEAPON;
+FORCEPAIN; +FORCEPAIN;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 12;
} }
States States
{ {
@ -247,7 +244,7 @@ Class UTChainsaw : UTWeapon
Goto Ready; Goto Ready;
Deselect: Deselect:
CSWD A 0 A_PlaySound("chainsaw/lower",CHAN_6); CSWD A 0 A_PlaySound("chainsaw/lower",CHAN_6);
CSWD ABCDEF 2; CSWD ABCDEF 1;
CSWD F 1 A_Lower(int.max); CSWD F 1 A_Lower(int.max);
Wait; Wait;
} }

View file

@ -9,8 +9,6 @@ Class UTRocketAmmo : Ammo
Ammo.BackpackAmount 12; Ammo.BackpackAmount 12;
Ammo.BackpackMaxAmount 48; Ammo.BackpackMaxAmount 48;
Ammo.DropAmount 3; Ammo.DropAmount 3;
Radius 4;
Height 14;
} }
States States
{ {
@ -29,8 +27,6 @@ Class UTRocketAmmo2 : UTRocketAmmo
Inventory.PickupMessage "You picked up a Single Rocket."; Inventory.PickupMessage "You picked up a Single Rocket.";
Inventory.Amount 1; Inventory.Amount 1;
Ammo.DropAmount 1; Ammo.DropAmount 1;
Radius 2;
Height 13;
} }
States States
{ {
@ -238,7 +234,7 @@ Class UTRocketLauncher : UTWeapon
lockontex = TexMan.CheckForTexture("Crosshr6",TexMan.Type_Any); lockontex = TexMan.CheckForTexture("Crosshr6",TexMan.Type_Any);
} }
override void PostRender() override void PreRender( double lbottom )
{ {
if ( LockedTarget ) Screen.DrawTexture(lockontex,false,Screen.GetWidth()*0.5,Screen.GetHeight()*0.5); if ( LockedTarget ) Screen.DrawTexture(lockontex,false,Screen.GetWidth()*0.5,Screen.GetHeight()*0.5);
} }
@ -351,6 +347,7 @@ Class UTRocketLauncher : UTWeapon
} }
} }
// lose lock-on // lose lock-on
if ( invoker.LockedOn ) A_PlaySound("utrl/seeklost",CHAN_6);
invoker.LockedTarget = null; invoker.LockedTarget = null;
invoker.LockedOn = false; invoker.LockedOn = false;
} }
@ -393,9 +390,6 @@ Class UTRocketLauncher : UTWeapon
Weapon.AmmoType2 "UTRocketAmmo"; Weapon.AmmoType2 "UTRocketAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 6; Weapon.AmmoGive 6;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 12;
} }
States States
{ {

View file

@ -6,8 +6,6 @@ Class EClip : MiniAmmo replaces Clip
Inventory.PickupMessage "You picked up a Clip."; Inventory.PickupMessage "You picked up a Clip.";
Inventory.Amount 20; Inventory.Amount 20;
Ammo.DropAmount 5; Ammo.DropAmount 5;
Radius 8;
Height 6;
} }
States States
{ {
@ -159,11 +157,11 @@ Class Enforcer : UTWeapon replaces Pistol
property ClipCount : ClipCount; property ClipCount : ClipCount;
property SlaveClipCount : SlaveClipCount; property SlaveClipCount : SlaveClipCount;
override void PostRender() override void PostRender( double lbottom )
{ {
if ( !CVar.GetCVar('flak_enforcerreload').GetBool() ) return; if ( !CVar.GetCVar('flak_enforcerreload').GetBool() ) return;
if ( Amount > 1 ) Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight()*2,String.Format("L Clip: %2d / 20\nR Clip: %2d / 20",slaveclipcount,clipcount)); if ( Amount > 1 ) Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,lbottom-Screen.GetHeight()*0.01-confont.GetHeight()*2,String.Format("L Clip: %2d / 20\nR Clip: %2d / 20",slaveclipcount,clipcount));
else Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight(),String.Format("Clip: %2d / 20",clipcount)); else Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,lbottom-Screen.GetHeight()*0.01-confont.GetHeight(),String.Format("Clip: %2d / 20",clipcount));
} }
override bool HandlePickup( Inventory item ) override bool HandlePickup( Inventory item )
@ -204,7 +202,7 @@ Class Enforcer : UTWeapon replaces Pistol
if ( !weap || !player ) return; if ( !weap || !player ) return;
if ( slave ) if ( slave )
{ {
if ( CVar.GetCVar('flak_enforcerreload').GetBool() && (invoker.slaveclipcount < 5) ) A_PlaySound("enforcer/click",CHAN_7); if ( CVar.GetCVar('flak_enforcerreload').GetBool() && (invoker.slaveclipcount < 5) ) A_PlaySound("enforcer/click",CHAN_6);
if ( (invoker.slaveclipcount <= 0) || (weap.Ammo1.Amount <= 0) ) if ( (invoker.slaveclipcount <= 0) || (weap.Ammo1.Amount <= 0) )
{ {
invoker.slaverefire = 0; invoker.slaverefire = 0;
@ -277,7 +275,7 @@ Class Enforcer : UTWeapon replaces Pistol
} }
invoker.FireEffect(); invoker.FireEffect();
UTMainHandler.DoFlash(self,Color(32,255,128,0),1); UTMainHandler.DoFlash(self,Color(32,255,128,0),1);
A_PlaySound("enforcer/shoot",slave?CHAN_7:CHAN_WEAPON); A_PlaySound("enforcer/shoot",slave?CHAN_6:CHAN_WEAPON);
A_AlertMonsters(); A_AlertMonsters();
A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08); A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08);
if ( slave ) if ( slave )
@ -362,9 +360,6 @@ Class Enforcer : UTWeapon replaces Pistol
Weapon.AmmoGive 30; Weapon.AmmoGive 30;
Enforcer.ClipCount 20; Enforcer.ClipCount 20;
Enforcer.SlaveClipCount 20; Enforcer.SlaveClipCount 20;
Radius 8;
Height 16;
UTWeapon.DroppedHeight 8;
} }
States States
{ {
@ -391,7 +386,7 @@ Class Enforcer : UTWeapon replaces Pistol
LeftReady: LeftReady:
2NFS A 0 2NFS A 0
{ {
A_PlaySound("enforcer/select",CHAN_7); A_PlaySound("enforcer/select",CHAN_6);
invoker.slaveactive = true; invoker.slaveactive = true;
} }
2NFS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_JumpIf(invoker.slavedown,"LeftDeselect"); 2NFS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_JumpIf(invoker.slavedown,"LeftDeselect");
@ -486,18 +481,18 @@ Class Enforcer : UTWeapon replaces Pistol
invoker.slaveclipcount = Min(20,invoker.Ammo1.Amount); invoker.slaveclipcount = Min(20,invoker.Ammo1.Amount);
invoker.slavereload = false; invoker.slavereload = false;
A_Overlay(-9998,"Null"); A_Overlay(-9998,"Null");
A_PlaySound("enforcer/click",CHAN_7); A_PlaySound("enforcer/click",CHAN_6);
} }
2NFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1; 2NFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
2NR2 AB 1; 2NR2 AB 1;
2NR2 B 30 A_PlaySound("enforcer/reload",CHAN_7); 2NR2 B 30 A_PlaySound("enforcer/reload",CHAN_6);
2NFS A 0 A_PlaySound("enforcer/select",CHAN_7); 2NFS A 0 A_PlaySound("enforcer/select",CHAN_6);
Goto LeftReady; Goto LeftReady;
Deselect: Deselect:
ENFI A 1 { invoker.slavedown = true; } ENFI A 1 { invoker.slavedown = true; }
ENFD A 0 A_Overlay(-9999,"Null"); ENFD A 0 A_Overlay(-9999,"Null");
ENFD A 0 A_JumpIf(invoker.slaveactive,"Deselect"); ENFD A 0 A_JumpIf(invoker.slaveactive,"Deselect");
ENFD ABCDEFGHIJKL 1; ENFD ABDEGHJK 1;
ENFD L 1 A_Lower(int.max); ENFD L 1 A_Lower(int.max);
Wait; Wait;
LeftDeselect: LeftDeselect:
@ -506,7 +501,8 @@ Class Enforcer : UTWeapon replaces Pistol
A_Overlay(-9998,"Null"); A_Overlay(-9998,"Null");
invoker.slaveactive = false; invoker.slaveactive = false;
} }
2NFD ABCDEFGHIJKL 1; 2NFD ABDEGHJK 1;
2NFD L 0;
Stop; Stop;
MuzzleFlash: MuzzleFlash:
EMUZ A 2 Bright EMUZ A 2 Bright

View file

@ -35,8 +35,6 @@ Class FlakAmmo : Ammo
Ammo.BackpackAmount 20; Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 50; Ammo.BackpackMaxAmount 50;
Ammo.DropAmount 5; Ammo.DropAmount 5;
Radius 10;
Height 8;
} }
States States
{ {
@ -54,8 +52,6 @@ Class FlakAmmo2 : FlakAmmo
Inventory.PickupMessage "You picked up a Flak Shell."; Inventory.PickupMessage "You picked up a Flak Shell.";
Inventory.Amount 1; Inventory.Amount 1;
Ammo.DropAmount 1; Ammo.DropAmount 1;
Radius 4;
Height 6;
} }
States States
{ {
@ -557,9 +553,6 @@ Class FlakCannon : UTWeapon
Weapon.AmmoType2 "FlakAmmo"; Weapon.AmmoType2 "FlakAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 10; Weapon.AmmoGive 10;
Radius 12;
Height 16;
UTWeapon.DroppedHeight 16;
} }
States States
{ {
@ -569,10 +562,10 @@ Class FlakCannon : UTWeapon
FPCK B -1; FPCK B -1;
Stop; Stop;
Ready: Ready:
FLKS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE); FLKS ABDEGHJKMNPQSTVWYZ 1 A_WeaponReady(WRF_NOFIRE);
FKS2 ABC 1 A_WeaponReady(WRF_NOFIRE); FKS2 BC 1 A_WeaponReady(WRF_NOFIRE);
FLKL A 1 A_Loading(true); FLKL A 1 A_Loading(true);
FLKL BCDEFGHIJKLMNO 1; FLKL BCEFGIJKMNO 1;
Goto Idle; Goto Idle;
Loading: Loading:
FLKL A 1 FLKL A 1
@ -580,7 +573,7 @@ Class FlakCannon : UTWeapon
A_CheckReload(); A_CheckReload();
if ( invoker.Ammo1.Amount > 0 ) A_Loading(); if ( invoker.Ammo1.Amount > 0 ) A_Loading();
} }
FLKL BCDEFGHIJKLMNO 1; FLKL BCEFGIJKMNO 1;
Idle: Idle:
FLKI A 10; FLKI A 10;
FLKI A 1 A_WeaponReady(); FLKI A 1 A_WeaponReady();
@ -599,7 +592,7 @@ Class FlakCannon : UTWeapon
FLKS A 1 A_Raise(int.max); FLKS A 1 A_Raise(int.max);
Wait; Wait;
Deselect: Deselect:
FLKD ABCDEFGHIJ 2; FLKD ABCDEFGHIJ 1;
FLKD J 1 A_Lower(int.max); FLKD J 1 A_Lower(int.max);
Wait; Wait;
MuzzleFlash: MuzzleFlash:

View file

@ -12,8 +12,6 @@ Class UTHealthPack : Health replaces Soulsphere
Inventory.PickupMessage "You picked up the Big Keg O' Health."; Inventory.PickupMessage "You picked up the Big Keg O' Health.";
Inventory.PickupSound "misc/ut_keg"; Inventory.PickupSound "misc/ut_keg";
Inventory.RespawnTics 3500; Inventory.RespawnTics 3500;
Radius 18;
Height 30;
} }
States States
{ {
@ -32,8 +30,6 @@ Class UTHealthBox : Health replaces Medikit
Inventory.PickupMessage "You picked up a Health Box."; Inventory.PickupMessage "You picked up a Health Box.";
Health.LowMessage 25,"You picked up a Health Box that you REALLY need!"; Health.LowMessage 25,"You picked up a Health Box that you REALLY need!";
Inventory.PickupSound "misc/ut_heal"; Inventory.PickupSound "misc/ut_heal";
Radius 16;
Height 12;
} }
States States
{ {
@ -52,8 +48,6 @@ Class UTMedBox : Health replaces Stimpack
Inventory.PickupMessage "You picked up a Health Pack."; Inventory.PickupMessage "You picked up a Health Pack.";
Inventory.PickupSound "misc/ut_heal"; Inventory.PickupSound "misc/ut_heal";
Inventory.RespawnTics 700; Inventory.RespawnTics 700;
Radius 12;
Height 10;
} }
States States
{ {
@ -75,8 +69,6 @@ Class UTHealthBonus : Health replaces HealthBonus
Inventory.PickupMessage "You picked up a Health Vial."; Inventory.PickupMessage "You picked up a Health Vial.";
Inventory.PickupSound "misc/ut_heal"; Inventory.PickupSound "misc/ut_heal";
RenderStyle "Add"; RenderStyle "Add";
Radius 2;
Height 16;
} }
States States
{ {

View file

@ -289,7 +289,7 @@ Class ImpactHammer : UTWeapon replaces Fist
Goto Idle; Goto Idle;
Deselect: Deselect:
IMPD A 0 A_StopSound(CHAN_WEAPON); IMPD A 0 A_StopSound(CHAN_WEAPON);
IMPD ABCDE 3; IMPD ABCDE 2;
IMPD E 1 A_Lower(int.max); IMPD E 1 A_Lower(int.max);
Wait; Wait;
} }

View file

@ -35,8 +35,6 @@ Class MiniAmmo : Ammo
Ammo.BackpackAmount 100; Ammo.BackpackAmount 100;
Ammo.BackpackMaxAmount 199; Ammo.BackpackMaxAmount 199;
Ammo.DropAmount 20; Ammo.DropAmount 20;
Radius 12;
Height 14;
} }
States States
{ {
@ -194,9 +192,6 @@ Class Minigun : UTWeapon
Weapon.AmmoType2 "MiniAmmo"; Weapon.AmmoType2 "MiniAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 50; Weapon.AmmoGive 50;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 8;
} }
States States
{ {
@ -412,8 +407,8 @@ Class Minigun : UTWeapon
MGU2 ABCDEFGHIJKLM 1; MGU2 ABCDEFGHIJKLM 1;
Goto Idle; Goto Idle;
Deselect: Deselect:
MGND A 2 A_StopSound(CHAN_WEAPON); MGND A 1 A_StopSound(CHAN_WEAPON);
MGND BCDEFGHIJ 2; MGND BCDEFGHIJ 1;
MGND J 1 A_Lower(int.max); MGND J 1 A_Lower(int.max);
Wait; Wait;
MuzzleFlash: MuzzleFlash:

View file

@ -12,8 +12,6 @@ Class UDamage : PowerupGiver replaces Berserk
Powerup.Type "DamageAmplifier"; Powerup.Type "DamageAmplifier";
Inventory.PickupSound "udamage/pickup"; Inventory.PickupSound "udamage/pickup";
Inventory.RespawnTics 4200; Inventory.RespawnTics 4200;
Radius 15;
Height 40;
} }
override void PostBeginPlay() override void PostBeginPlay()
{ {
@ -79,7 +77,7 @@ Class DamageAmplifier : Powerup
{ {
Super.DoEffect(); Super.DoEffect();
if ( (EffectTics == 175) || (EffectTics == 140) || (EffectTics == 105) || (EffectTics == 70) || (EffectTics == 35) ) if ( (EffectTics == 175) || (EffectTics == 140) || (EffectTics == 105) || (EffectTics == 70) || (EffectTics == 35) )
Owner.A_PlaySound("udamage/drain",CHAN_6,1.0,false,0.25); Owner.A_PlaySound("udamage/drain",CHAN_7,1.0,false,0.25);
} }
override void EndEffect() override void EndEffect()
@ -95,8 +93,8 @@ Class DamageAmplifier : Powerup
void FireEffect() void FireEffect()
{ {
if ( EffectTics < 350 ) Owner.A_PlaySound("udamage/fire2",CHAN_5,1.0,false,0.25); if ( EffectTics < 350 ) Owner.A_PlaySound("udamage/fire2",CHAN_7,1.0,false,0.25);
else Owner.A_PlaySound("udamage/fire1",CHAN_5,1.0,false,0.25); else Owner.A_PlaySound("udamage/fire1",CHAN_7,1.0,false,0.25);
UTMainHandler.DoFlash(Owner,Color(96,238,0,255),10); UTMainHandler.DoFlash(Owner,Color(96,238,0,255),10);
} }
@ -198,8 +196,6 @@ Class UTBackpack : BackpackItem replaces Backpack
Tag "Backpack"; Tag "Backpack";
Inventory.PickupMessage "You got a Backpack."; Inventory.PickupMessage "You got a Backpack.";
Inventory.RespawnTics 2100; Inventory.RespawnTics 2100;
Radius 10;
Height 32;
} }
States States
{ {
@ -239,8 +235,6 @@ Class UTInvisibility : PowerupGiver replaces BlurSphere
Inventory.PickupMessage "You have Invisibility."; Inventory.PickupMessage "You have Invisibility.";
Inventory.PickupSound "invis/pickup"; Inventory.PickupSound "invis/pickup";
Inventory.RespawnTics 4200; Inventory.RespawnTics 4200;
Radius 6;
Height 20;
} }
override void PostBeginPlay() override void PostBeginPlay()
{ {
@ -298,8 +292,6 @@ Class UTMapRevealer : MapRevealer replaces Allmap
Inventory.MaxAmount 0; Inventory.MaxAmount 0;
Inventory.PickupSound "trans/pickup"; Inventory.PickupSound "trans/pickup";
Inventory.PickupMessage "You got the Computer Map."; Inventory.PickupMessage "You got the Computer Map.";
Radius 10;
Height 4;
} }
States States
{ {
@ -321,8 +313,6 @@ Class UTJumpBoots : Inventory replaces RadSuit
Inventory.PickupMessage "You picked up the AntiGrav boots."; Inventory.PickupMessage "You picked up the AntiGrav boots.";
Inventory.PickupSound "boot/pickup"; Inventory.PickupSound "boot/pickup";
Inventory.RespawnTics 1050; Inventory.RespawnTics 1050;
Radius 9;
Height 14;
} }
override bool Use( bool pickup ) override bool Use( bool pickup )
{ {
@ -407,8 +397,6 @@ Class Searchlight : Inventory replaces Infrared
Inventory.MaxAmount 200; Inventory.MaxAmount 200;
Inventory.InterHubAmount 0; Inventory.InterHubAmount 0;
Inventory.PickupMessage "You picked up the Searchlight."; Inventory.PickupMessage "You picked up the Searchlight.";
Radius 10;
Height 16;
} }
override bool Use( bool pickup ) override bool Use( bool pickup )

View file

@ -27,8 +27,6 @@ Class PulseAmmo : Ammo
Ammo.BackpackAmount 50; Ammo.BackpackAmount 50;
Ammo.BackpackMaxAmount 199; Ammo.BackpackMaxAmount 199;
Ammo.DropAmount 10; Ammo.DropAmount 10;
Radius 5;
Height 12;
} }
States States
{ {
@ -415,10 +413,10 @@ Class PulseGun : UTWeapon
Property ClipCount : clipcount; Property ClipCount : clipcount;
override void PostRender() override void PostRender( double lbottom )
{ {
if ( !CVar.GetCVar('flak_pulsereload').GetBool() ) return; if ( !CVar.GetCVar('flak_pulsereload').GetBool() ) return;
Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight(),String.Format("Clip: %2d / 50",clipcount)); Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,lbottom-Screen.GetHeight()*0.01-confont.GetHeight(),String.Format("Clip: %2d / 50",clipcount));
} }
action void A_Reloading() action void A_Reloading()
@ -536,9 +534,6 @@ Class PulseGun : UTWeapon
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 60; Weapon.AmmoGive 60;
PulseGun.ClipCount 50; PulseGun.ClipCount 50;
Radius 18;
Height 16;
UTWeapon.DroppedHeight 12;
} }
States States
{ {
@ -645,8 +640,8 @@ Class PulseGun : UTWeapon
PGR2 ABCDEFGHIJKLMNOPQRSTUVWX 1; PGR2 ABCDEFGHIJKLMNOPQRSTUVWX 1;
Goto Idle; Goto Idle;
Deselect: Deselect:
PGNS W 0 A_StopSound(CHAN_WEAPON); PGNS W 1 A_StopSound(CHAN_WEAPON);
PGNS WVUTSRQPONMLKJIHGFEDCBA 1; PGNS VTSQPNMKJHGEDBA 1;
PGNS A 1 A_Lower(int.max); PGNS A 1 A_Lower(int.max);
Wait; Wait;
Select: Select:

View file

@ -9,8 +9,6 @@ Class RipperAmmo : Ammo
Ammo.BackpackAmount 50; Ammo.BackpackAmount 50;
Ammo.BackpackMaxAmount 75; Ammo.BackpackMaxAmount 75;
Ammo.DropAmount 10; Ammo.DropAmount 10;
Radius 4;
Height 21;
} }
States States
{ {
@ -253,9 +251,6 @@ Class Ripper2 : UTWeapon
Weapon.AmmoType2 "RipperAmmo"; Weapon.AmmoType2 "RipperAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 15; Weapon.AmmoGive 15;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 16;
} }
action void A_RazorFire( bool alt = false ) action void A_RazorFire( bool alt = false )
{ {
@ -311,7 +306,7 @@ Class Ripper2 : UTWeapon
RZRF HIJKLMNO 1; RZRF HIJKLMNO 1;
Goto Idle; Goto Idle;
Deselect: Deselect:
RZRD ABCDEF 2; RZRD ABCDEF 1;
RZRD F 1 A_Lower(int.max); RZRD F 1 A_Lower(int.max);
Wait; Wait;
} }

View file

@ -9,8 +9,6 @@ Class ShockAmmo : Ammo
Ammo.BackpackAmount 20; Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 50; Ammo.BackpackMaxAmount 50;
Ammo.DropAmount 5; Ammo.DropAmount 5;
Radius 4;
Height 23;
} }
States States
{ {
@ -958,9 +956,6 @@ Class ShockRifle : UTWeapon
Weapon.AmmoType2 "ShockAmmo"; Weapon.AmmoType2 "ShockAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 20; Weapon.AmmoGive 20;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 8;
} }
States States
{ {
@ -987,7 +982,7 @@ Class ShockRifle : UTWeapon
ASMA BCDEFGHIJ 2; ASMA BCDEFGHIJ 2;
Goto Idle; Goto Idle;
Deselect: Deselect:
ASMD ABCDEFG 2; ASMD ABCDEFG 1;
ASMD G 1 A_Lower(int.max); ASMD G 1 A_Lower(int.max);
Wait; Wait;
Select: Select:
@ -1007,8 +1002,6 @@ Class EnhancedShockAmmo : Ammo
Ammo.BackpackAmount 0; Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 25; Ammo.BackpackMaxAmount 25;
Ammo.DropAmount 2; Ammo.DropAmount 2;
Radius 4;
Height 23;
} }
States States
{ {
@ -1072,9 +1065,6 @@ Class EnhancedShockRifle : UTWeapon replaces InvulnerabilitySphere
Weapon.AmmoType2 "EnhancedShockAmmo"; Weapon.AmmoType2 "EnhancedShockAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 25; Weapon.AmmoGive 25;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 8;
} }
States States
{ {
@ -1101,7 +1091,7 @@ Class EnhancedShockRifle : UTWeapon replaces InvulnerabilitySphere
ASMA BCDEFGHIJ 2; ASMA BCDEFGHIJ 2;
Goto Idle; Goto Idle;
Deselect: Deselect:
ASMD ABCDEFG 2; ASMD ABCDEFG 1;
ASMD G 1 A_Lower(int.max); ASMD G 1 A_Lower(int.max);
Wait; Wait;
Select: Select:

View file

@ -9,8 +9,6 @@ Class RifleAmmo : Ammo
Ammo.BackpackAmount 20; Ammo.BackpackAmount 20;
Ammo.BackpackMaxAmount 50; Ammo.BackpackMaxAmount 50;
Ammo.DropAmount 5; Ammo.DropAmount 5;
Radius 6;
Height 12;
} }
States States
{ {
@ -28,8 +26,6 @@ Class RifleAmmo2 : RifleAmmo
Inventory.PickupMessage "You got a Rifle Round."; Inventory.PickupMessage "You got a Rifle Round.";
Inventory.Amount 1; Inventory.Amount 1;
Ammo.DropAmount 1; Ammo.DropAmount 1;
Radius 2;
Height 8;
} }
States States
{ {
@ -57,10 +53,10 @@ Class SniperRifle : UTWeapon
Super.PostBeginPlay(); Super.PostBeginPlay();
reticle = TexMan.CheckForTexture("RReticle",Texman.Type_Any); reticle = TexMan.CheckForTexture("RReticle",Texman.Type_Any);
} }
override void PreRender() override void PreRender( double lbottom )
{ {
if ( sniperzoom <= 1.0 ) return; if ( sniperzoom <= 1.0 ) return;
Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480); Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480,DTA_RenderStyle,(1|2<<8|1<<16));
Screen.DrawText(confont,Font.CR_DARKGREEN,192,160,String.Format("X%.1f",sniperzoom),DTA_Clean,true); Screen.DrawText(confont,Font.CR_DARKGREEN,192,160,String.Format("X%.1f",sniperzoom),DTA_Clean,true);
} }
action void A_SniperFire( bool zoomed = false ) action void A_SniperFire( bool zoomed = false )
@ -142,9 +138,6 @@ Class SniperRifle : UTWeapon
Weapon.AmmoType2 "RifleAmmo"; Weapon.AmmoType2 "RifleAmmo";
Weapon.AmmoUse2 1; Weapon.AmmoUse2 1;
Weapon.AmmoGive 8; Weapon.AmmoGive 8;
Radius 20;
Height 16;
UTWeapon.DroppedHeight 10;
} }
States States
{ {
@ -162,22 +155,7 @@ Class SniperRifle : UTWeapon
A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT); A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT);
A_WeaponReady(WRF_NOFIRE); A_WeaponReady(WRF_NOFIRE);
} }
SRFS B 2 A_WeaponReady(WRF_NOFIRE); SRFS BCDEFGHIJKLMNOPQ 1 A_WeaponReady(WRF_NOFIRE);
SRFS C 1 A_WeaponReady(WRF_NOFIRE);
SRFS D 2 A_WeaponReady(WRF_NOFIRE);
SRFS E 1 A_WeaponReady(WRF_NOFIRE);
SRFS F 2 A_WeaponReady(WRF_NOFIRE);
SRFS G 1 A_WeaponReady(WRF_NOFIRE);
SRFS H 2 A_WeaponReady(WRF_NOFIRE);
SRFS I 1 A_WeaponReady(WRF_NOFIRE);
SRFS J 2 A_WeaponReady(WRF_NOFIRE);
SRFS K 1 A_WeaponReady(WRF_NOFIRE);
SRFS L 2 A_WeaponReady(WRF_NOFIRE);
SRFS M 1 A_WeaponReady(WRF_NOFIRE);
SRFS N 2 A_WeaponReady(WRF_NOFIRE);
SRFS O 1 A_WeaponReady(WRF_NOFIRE);
SRFS P 2 A_WeaponReady(WRF_NOFIRE);
SRFS Q 1 A_WeaponReady(WRF_NOFIRE);
Idle: Idle:
SRFI A 1 SRFI A 1
{ {
@ -230,7 +208,7 @@ Class SniperRifle : UTWeapon
Goto Idle; Goto Idle;
Deselect: Deselect:
SRFD A 0 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT); SRFD A 0 A_ZoomFactor(invoker.sniperzoom=1.0,ZOOM_INSTANT);
SRFD ABCDEFG 2; SRFD ABCDEFG 1;
SRFD G 1 A_Lower(int.max); SRFD G 1 A_Lower(int.max);
Wait; Wait;
MuzzleFlash: MuzzleFlash:

View file

@ -288,6 +288,7 @@ Class Translocator : UTWeapon
p.target = self; p.target = self;
p.angle = angle; p.angle = angle;
p.pitch = BulletSlope(); p.pitch = BulletSlope();
p.A_SetSize(radius);
Vector3 dir = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch)); Vector3 dir = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch));
dir.z += 0.35*(1-abs(dir.z)); dir.z += 0.35*(1-abs(dir.z));
p.vel = dir*p.speed; p.vel = dir*p.speed;
@ -323,10 +324,13 @@ Class Translocator : UTWeapon
} }
// check if there's enough space // check if there's enough space
Vector3 oldpos = pos, newpos = invoker.module.pos; Vector3 oldpos = pos, newpos = invoker.module.pos;
double modulefloorz = invoker.module.floorz, moduleceilingz = invoker.module.ceilingz;
bool bBroken = invoker.module.bAMBUSH; bool bBroken = invoker.module.bAMBUSH;
invoker.module.Destroy(); invoker.module.Destroy();
invoker.FireEffect(); invoker.FireEffect();
A_AlertMonsters(); A_AlertMonsters();
// squeeze down new z if ceiling is in the way
if ( (newpos.z+height > moduleceilingz) ) newpos.z = max(modulefloorz,moduleceilingz-height);
if ( Warp(self,newpos.x,newpos.y,newpos.z,flags:WARPF_ABSOLUTEPOSITION|WARPF_TESTONLY) && TeleportMove(newpos,true) ) if ( Warp(self,newpos.x,newpos.y,newpos.z,flags:WARPF_ABSOLUTEPOSITION|WARPF_TESTONLY) && TeleportMove(newpos,true) )
{ {
SpawnTeleportFog(oldpos,true,false); SpawnTeleportFog(oldpos,true,false);
@ -357,9 +361,6 @@ Class Translocator : UTWeapon
Weapon.SlotNumber 1; Weapon.SlotNumber 1;
Weapon.SelectionOrder 10; Weapon.SelectionOrder 10;
+WEAPON.NO_AUTO_SWITCH; +WEAPON.NO_AUTO_SWITCH;
Radius 5;
Height 16;
UTWeapon.DroppedHeight 4;
} }
States States
{ {
@ -412,11 +413,11 @@ Class Translocator : UTWeapon
Goto Idle2; Goto Idle2;
Deselect: Deselect:
TLCD A 0 A_JumpIf(invoker.module,"Deselect2"); TLCD A 0 A_JumpIf(invoker.module,"Deselect2");
TLCD ABCDEFG 2; TLCD ABCDEFG 1;
TLCD G 1 A_Lower(int.max); TLCD G 1 A_Lower(int.max);
Wait; Wait;
Deselect2: Deselect2:
TLD2 ABCDEFG 2; TLD2 ABCDEFG 1;
TLD2 G 1 A_Lower(int.max); TLD2 G 1 A_Lower(int.max);
Wait; Wait;
} }

View file

@ -1,11 +1,16 @@
Class UTPlayer : DoomPlayer Class UTPlayer : DoomPlayer
{ {
bool lastground;
double lastvelz, prevvelz;
Default Default
{ {
Player.StartItem "MiniAmmo", 30; Player.StartItem "MiniAmmo", 30;
Player.StartItem "Enforcer"; Player.StartItem "Enforcer";
Player.StartItem "Translocator"; Player.StartItem "Translocator";
Player.StartItem "ImpactHammer"; Player.StartItem "ImpactHammer";
Player.DamageScreenColor "FF 00 00", 1.0;
Player.ViewHeight 46;
} }
// Have to modify the give cheat to handle UT armor // Have to modify the give cheat to handle UT armor
@ -163,7 +168,12 @@ Class UTPlayer : DoomPlayer
Super.Tick(); Super.Tick();
double ang = level.time/(20*TICRATE/35.)*360.; double ang = level.time/(20*TICRATE/35.)*360.;
if ( (abs(sin(ang)) >= 1.0) && player.onground && (player.cmd.forwardmove || player.cmd.sidemove) ) if ( (abs(sin(ang)) >= 1.0) && player.onground && (player.cmd.forwardmove || player.cmd.sidemove) )
A_PlaySound("ut/playerfootstep",CHAN_BODY); A_PlaySound("ut/playerfootstep",CHAN_5,abs(vel.xy.length())*0.03);
if ( player.onground && !bNoGravity && !lastground && (lastvelz < -2) && (lastvelz >= -8) )
A_PlaySound("*land",CHAN_AUTO,abs(lastvelz*0.0625));
lastground = player.onground;
lastvelz = prevvelz;
prevvelz = vel.z;
} }
} }
@ -184,14 +194,10 @@ Class RandomSpawner2 : RandomSpawner
Class UTWeapon : Weapon Class UTWeapon : Weapon
{ {
double droppedheight;
Property DroppedHeight : droppedheight;
// Drawstuffs under HUD // Drawstuffs under HUD
virtual ui void PreRender() {} virtual ui void PreRender( double lbottom ) {}
// Drawstuffs over HUD // Drawstuffs over HUD
virtual ui void PostRender() {} virtual ui void PostRender( double lbottom ) {}
override Inventory CreateTossable( int amt ) override Inventory CreateTossable( int amt )
{ {
@ -201,7 +207,6 @@ Class UTWeapon : Weapon
{ {
d.SetState(d.ResolveState("Spawn")+1); d.SetState(d.ResolveState("Spawn")+1);
d.bALWAYSPICKUP = true; d.bALWAYSPICKUP = true;
d.A_SetSize(-1,UTWeapon(d).droppedheight);
} }
return d; return d;
} }
@ -210,7 +215,6 @@ Class UTWeapon : Weapon
{ {
SetState(ResolveState("Spawn")+1); SetState(ResolveState("Spawn")+1);
bALWAYSPICKUP = true; bALWAYSPICKUP = true;
A_SetSize(-1,droppedheight);
return false; return false;
} }
@ -234,7 +238,6 @@ Class UTWeapon : Weapon
Weapon.BobRangeX 0.2; Weapon.BobRangeX 0.2;
Weapon.BobRangeY 0.4; Weapon.BobRangeY 0.4;
+WEAPON.NOALERT; +WEAPON.NOALERT;
UTWeapon.DroppedHeight 16;
} }
} }
@ -700,11 +703,13 @@ Class UTMainHandler : StaticEventHandler
override void WorldLoaded( WorldEvent e ) override void WorldLoaded( WorldEvent e )
{ {
if ( gamestate != GS_LEVEL || e.IsSaveGame ) return; if ( gamestate != GS_LEVEL || e.IsSaveGame ) return;
// prettify Kinsie's test map for a more Unreal feel
if ( level.levelname ~== "Modder Test Map" ) if ( level.levelname ~== "Modder Test Map" )
{ {
TexMan.ReplaceTextures("-noflat-","-kinsie-",0); TexMan.ReplaceTextures("-noflat-","-kinsie-",0);
TextureID skytx = TexMan.CheckForTexture("BlueSky",TexMan.Type_Any); TextureID skytx = TexMan.CheckForTexture("BlueSky",TexMan.Type_Any);
level.ChangeSky(skytx,skytx); level.ChangeSky(skytx,skytx);
// TODO handplace some dynamic lights and add Unreal/UT ambient sounds
} }
} }
@ -716,9 +721,11 @@ Class UTMainHandler : StaticEventHandler
ui void StartMenu() ui void StartMenu()
{ {
if ( gamestate != GS_TITLELEVEL ) return; if ( gamestate != GS_TITLELEVEL ) return;
if ( CVar.GetCVar('flak_protomenu',players[consoleplayer]).GetBool() ) int proto = CVar.GetCVar('flak_protomenu',players[consoleplayer]).GetInt();
if ( proto )
{ {
S_ChangeMusic("xyzdMenu"); if ( proto > 1 ) S_ChangeMusic("menu2");
else S_ChangeMusic("xyzdMenu");
tex = TexMan.CheckForTexture("protobg",TexMan.Type_Any); tex = TexMan.CheckForTexture("protobg",TexMan.Type_Any);
} }
else else
@ -758,6 +765,7 @@ Class UTMainHandler : StaticEventHandler
{ {
if ( gamestate != GS_TITLELEVEL ) return; if ( gamestate != GS_TITLELEVEL ) return;
if ( tex.IsNull() || !tex.IsValid() ) return; if ( tex.IsNull() || !tex.IsValid() ) return;
if ( !CVar.GetCVar('flak_showmenu',players[consoleplayer]).GetBool() ) return;
Screen.Dim("Black",1.0,0,0,Screen.GetWidth(),Screen.GetHeight()); Screen.Dim("Black",1.0,0,0,Screen.GetWidth(),Screen.GetHeight());
Screen.DrawTexture(tex,true,0,0,DTA_VirtualWidth,1024,DTA_VirtualHeight,768); Screen.DrawTexture(tex,true,0,0,DTA_VirtualWidth,1024,DTA_VirtualHeight,768);
} }

View file

@ -27,17 +27,22 @@ Class UTHud : BaseStatusBar
Class<Weapon> IconClasses[14]; Class<Weapon> IconClasses[14];
double HScale; double HScale;
Color tintcolor, bgcolor; Color tintcolor, bgcolor;
double opacity; int opacity;
int lastfrag, lastfragcnt, lastpickup, lastslot; int lastfrag, lastfragcnt, lastpickup, lastslot;
ViewTracer vtracer; ViewTracer vtracer;
Actor lastseen; Actor lastseen;
int lastseentic; int lastseentic;
bool showweapons, showfrags, showammo, showstatus, showinfo;
double hudsize, weaponsize, statussize;
// For easier UT Canvas drawing // For easier UT Canvas drawing
Color DrawColor, WhiteColor, GoldColor; Color DrawColor, WhiteColor, GoldColor;
double CurX, CurY; double CurX, CurY;
double FracTic; double FracTic;
// Ugh...
const TINTSTYLE = (1|2<<8|1<<16|12<<24);
override void Init() override void Init()
{ {
Super.Init(); Super.Init();
@ -139,8 +144,40 @@ Class UTHud : BaseStatusBar
override void Draw( int state, double TicFrac ) override void Draw( int state, double TicFrac )
{ {
Super.Draw(state,TicFrac); Super.Draw(state,TicFrac);
if ( players[consoleplayer].camera is 'GuidedWarShell' ) return;
HScale = Screen.GetWidth()/1280.;
switch ( CVar.GetCVar('flak_colorprefs',CPlayer).GetInt() )
{
case 0:
if ( CPlayer.GetTeam() >= Teams.Size() )
tintcolor = Color("White");
else tintcolor = Color(Teams[CPlayer.GetTeam()].mName);
break;
case 1:
tintcolor = CPlayer.GetColor();
break;
case 2:
tintcolor = Color(CVar.GetCVar('flak_colorcustom',CPlayer).GetString());
break;
}
opacity = CVar.GetCVar('flak_opacity',players[consoleplayer]).GetInt();
bgcolor = Color("Black");
showweapons = CVar.GetCVar('flak_showweapons',players[consoleplayer]).GetBool();
showstatus = CVar.GetCVar('flak_showstatus',players[consoleplayer]).GetBool();
showfrags = CVar.GetCVar('flak_showfrags',players[consoleplayer]).GetBool();
showammo = CVar.GetCVar('flak_showammo',players[consoleplayer]).GetBool();
showinfo = CVar.GetCVar('flak_showinfo',players[consoleplayer]).GetBool();
hudsize = CVar.GetCVar('flak_hudsize',players[consoleplayer]).GetFloat();
weaponsize = CVar.GetCVar('flak_weaponsize',players[consoleplayer]).GetFloat();
statussize = CVar.GetCVar('flak_statussize',players[consoleplayer]).GetFloat();
double lbottom = Screen.GetHeight();
if ( showweapons )
{
if ( weaponsize*hudsize>=1.0 ) lbottom -= 64*hudsize*HScale;
if ( showfrags ) lbottom -= 64*hudsize*HScale;
}
if ( (CPlayer.ReadyWeapon is 'UTWeapon') ) if ( (CPlayer.ReadyWeapon is 'UTWeapon') )
UTWeapon(CPlayer.ReadyWeapon).PreRender(); UTWeapon(CPlayer.ReadyWeapon).PreRender(lbottom);
if ( (state == HUD_StatusBar) || (state == HUD_Fullscreen) ) if ( (state == HUD_StatusBar) || (state == HUD_Fullscreen) )
{ {
BeginHUD(); BeginHUD();
@ -148,7 +185,7 @@ Class UTHud : BaseStatusBar
DrawUTHUD(); DrawUTHUD();
} }
if ( (CPlayer.ReadyWeapon is 'UTWeapon') ) if ( (CPlayer.ReadyWeapon is 'UTWeapon') )
UTWeapon(CPlayer.ReadyWeapon).PostRender(); UTWeapon(CPlayer.ReadyWeapon).PostRender(lbottom);
} }
private Color LerpColor( Color a, Color b, double x ) private Color LerpColor( Color a, Color b, double x )
@ -156,26 +193,24 @@ Class UTHud : BaseStatusBar
return Color(a.a,int(a.r*(1.-x)+b.r*x),int(a.g*(1.-x)+b.g*x),int(a.b*(1.-x)+b.b*x)); return Color(a.a,int(a.r*(1.-x)+b.r*x),int(a.g*(1.-x)+b.g*x),int(a.b*(1.-x)+b.b*x));
} }
private void UTDrawTintedTex( TextureID tx, double sx = 1.0, Color tint = Color("Black") ) private void UTDrawTintedTex( TextureID tx, double sx = 1.0, int opacity = -1, Color tint = Color("Black") )
{ {
double ss = (HScale*sx); double ss = (HScale*sx);
double dw = (Screen.GetWidth()/ss), dh = (Screen.GetHeight()/ss); double dw = (Screen.GetWidth()/ss), dh = (Screen.GetHeight()/ss);
double dx = CurX/ss, dy = CurY/ss; double dx = CurX/ss, dy = CurY/ss;
Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,opacity,DTA_FillColor,bgcolor); if ( opacity == -1 ) opacity = self.opacity;
Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_AlphaChannel,true,DTA_FillColor,(tint!="Black")?tint:tintcolor); if ( opacity >= 16 ) Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_FillColor,bgcolor);
double alpha = clamp(opacity/15.,0.0,1.0);
Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_RenderStyle,TINTSTYLE,DTA_FillColor,(tint!="Black")?tint:tintcolor);
} }
private void UTDrawColorTex( TextureID tx, double sx = 1.0, double alpha = 1.0 ) private void UTDrawPlainTex( TextureID tx, double sx = 1.0, int opacity = -1 )
{
double ss = (HScale*sx);
double dw = (Screen.GetWidth()/ss), dh = (Screen.GetHeight()/ss);
double dx = CurX/ss, dy = CurY/ss;
Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_AlphaChannel,true,DTA_Alpha,alpha,DTA_FillColor,DrawColor);
}
private void UTDrawPlainTex( TextureID tx, double sx = 1.0, double alpha = 1.0 )
{ {
double ss = (HScale*sx); double ss = (HScale*sx);
double dw = (Screen.GetWidth()/ss), dh = (Screen.GetHeight()/ss); double dw = (Screen.GetWidth()/ss), dh = (Screen.GetHeight()/ss);
double dx = CurX/ss, dy = CurY/ss; double dx = CurX/ss, dy = CurY/ss;
if ( opacity == -1 ) opacity = self.opacity;
if ( opacity >= 16 ) Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_FillColor,bgcolor);
double alpha = clamp(opacity/15.,0.0,1.0);
Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha); Screen.DrawTexture(tx,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha);
} }
@ -184,8 +219,8 @@ Class UTHud : BaseStatusBar
for ( int i=0; i<14; i++ ) for ( int i=0; i<14; i++ )
{ {
if ( !(w is IconClasses[i]) ) continue; if ( !(w is IconClasses[i]) ) continue;
if ( use ) UTDrawTintedTex(Uses[i],sx); if ( use ) UTDrawTintedTex(Uses[i],sx,opacity+7);
else UTDrawTintedTex(Icons[i],sx,tintcolor/2); else UTDrawTintedTex(Icons[i],sx,opacity,tintcolor/2);
return true; return true;
} }
return false; return false;
@ -201,17 +236,20 @@ Class UTHud : BaseStatusBar
String digits = String.Format("%d",min(abs(value),9999)); String digits = String.Format("%d",min(abs(value),9999));
double flen = 3*step; double flen = 3*step;
double len = digits.length()*step; double len = digits.length()*step;
double alpha = clamp((opacity+7)/15.,0.0,1.0);
for ( int i=0; i<digits.length(); i++ ) if ( digits.CharAt(i) == "1" ) len -= 0.5*step; for ( int i=0; i<digits.length(); i++ ) if ( digits.CharAt(i) == "1" ) len -= 0.5*step;
CurX += (flen-len)*0.5; CurX += (flen-len)*0.5;
if ( digits.CharAt(0) == "1" ) CurX -= 0.5*step; if ( digits.CharAt(0) == "1" ) CurX -= 0.5*step;
if ( value < 0 ) if ( value < 0 )
{ {
Screen.DrawTexture(BigNum[11],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_AlphaChannel,true,DTA_FillColor,DrawColor); if ( opacity+7 > 15 ) Screen.DrawTexture(BigNum[11],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_FillColor,bgcolor);
Screen.DrawTexture(BigNum[11],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_RenderStyle,TINTSTYLE,DTA_FillColor,DrawColor);
CurX += step; CurX += step;
} }
for ( int i=0; i<digits.length(); i++ ) for ( int i=0; i<digits.length(); i++ )
{ {
Screen.DrawTexture(BigNum[digits.CharCodeAt(i)-0x30],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_AlphaChannel,true,DTA_FillColor,DrawColor); if ( opacity+7 > 15 ) Screen.DrawTexture(BigNum[digits.CharCodeAt(i)-0x30],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_FillColor,bgcolor);
Screen.DrawTexture(BigNum[digits.CharCodeAt(i)-0x30],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_RenderStyle,TINTSTYLE,DTA_FillColor,DrawColor);
CurX += ((i<digits.length()-1)&&(digits.CharAt(i+1)=="1"))?step*0.5:step; CurX += ((i<digits.length()-1)&&(digits.CharAt(i+1)=="1"))?step*0.5:step;
} }
} }
@ -220,119 +258,142 @@ Class UTHud : BaseStatusBar
{ {
Inventory ammotype1, ammotype2; Inventory ammotype1, ammotype2;
[ammotype1, ammotype2] = GetCurrentAmmo(); [ammotype1, ammotype2] = GetCurrentAmmo();
CurX = Screen.GetWidth()-128*HScale; CurX = showweapons?(Screen.GetWidth()-128*hudsize*HScale):(Screen.GetWidth()*0.5+128*hudsize*HScale);
CurY = Screen.GetHeight()-64*HScale; CurY = Screen.GetHeight()-64*hudsize*HScale;
UTDrawTintedTex(Boxes[0]); if ( showweapons && ((weaponsize*hudsize)>=1.0) ) CurY -= 64*hudsize*HScale;
CurX += 8*HScale; UTDrawTintedTex(Boxes[0],hudsize);
CurY += 14*HScale; CurX += 8*hudsize*HScale;
CurY += 14*hudsize*HScale;
DrawColor = WhiteColor; DrawColor = WhiteColor;
if ( ammotype1 ) UTDrawBigNum(ammotype1.Amount); if ( ammotype1 ) UTDrawBigNum(ammotype1.Amount,hudsize);
if ( ammotype2 && (ammotype2 != ammotype1) ) if ( ammotype2 && (ammotype2 != ammotype1) )
{ {
CurX = Screen.GetWidth()-128*HScale; CurX = showweapons?(Screen.GetWidth()-128*hudsize*HScale):((Screen.GetWidth()+256*hudsize*HScale)*0.5);
CurY = Screen.GetHeight()-128*HScale; CurY = showweapons?(Screen.GetHeight()-128*hudsize*HScale):(Screen.GetHeight()-64*hudsize*HScale);
if ( showweapons && ((weaponsize*hudsize)>=1.0) ) CurY -= 64*hudsize*HScale;
UTDrawTintedTex(Boxes[0]); UTDrawTintedTex(Boxes[0]);
CurX += 8*HScale; CurX += 8*hudsize*HScale;
CurY += 14*HScale; CurY += 14*hudsize**HScale;
UTDrawBigNum(ammotype2.Amount); UTDrawBigNum(ammotype2.Amount,hudsize);
} }
} }
private void DrawStatus() private void DrawStatus()
{ {
CurX = Screen.GetWidth()-128*HScale;
CurY = 0;
Color dollcolor = tintcolor;
DamageAmplifier d;
UTArmor b, a, t, s; UTArmor b, a, t, s;
UTJumpBoots j;
d = DamageAmplifier(CPlayer.mo.FindInventory("DamageAmplifier"));
b = UTArmor(CPlayer.mo.FindInventory("UTArmorBonus")); b = UTArmor(CPlayer.mo.FindInventory("UTArmorBonus"));
a = UTArmor(CPlayer.mo.FindInventory("UTBodyArmor")); a = UTArmor(CPlayer.mo.FindInventory("UTBodyArmor"));
t = UTArmor(CPlayer.mo.FindInventory("UTThighPads")); t = UTArmor(CPlayer.mo.FindInventory("UTThighPads"));
j = UTJumpBoots(CPlayer.mo.FindInventory("UTJumpBoots"));
s = UTArmor(CPlayer.mo.FindInventory("UTShieldBelt")); s = UTArmor(CPlayer.mo.FindInventory("UTShieldBelt"));
if ( showstatus )
{
CurX = Screen.GetWidth()-128*HScale*hudsize*statussize;
CurY = 0;
Color dollcolor = tintcolor;
DamageAmplifier d;
UTJumpBoots j;
d = DamageAmplifier(CPlayer.mo.FindInventory("DamageAmplifier"));
j = UTJumpBoots(CPlayer.mo.FindInventory("UTJumpBoots"));
if ( d && !d.isBlinking() ) dollcolor = d.BlendColor; if ( d && !d.isBlinking() ) dollcolor = d.BlendColor;
if ( CPlayer.GetGender() == 1 ) if ( CPlayer.GetGender() == 1 )
{ {
UTDrawTintedTex(Woman[0],1.0,dollcolor); UTDrawTintedTex(Woman[0],hudsize*statussize,min(opacity,15),dollcolor);
DrawColor = dollcolor; if ( a ) UTDrawTintedTex(Woman[1],hudsize*statussize,min(opacity,15)*(a.Amount/double(a.MaxAmount)),dollcolor);
if ( a ) UTDrawColorTex(Woman[1],1.0,a.Amount/double(a.MaxAmount)); if ( t ) UTDrawTintedTex(Woman[2],hudsize*statussize,min(opacity,15)*(t.Amount/double(t.MaxAmount)),dollcolor);
if ( t ) UTDrawColorTex(Woman[2],1.0,t.Amount/double(t.MaxAmount)); if ( j ) UTDrawTintedTex(Woman[3],hudsize*statussize,min(opacity,15)*(j.Amount/double(j.MaxAmount)),dollcolor);
if ( j ) UTDrawColorTex(Woman[3],1.0,j.Amount/double(j.MaxAmount)); if ( s ) UTDrawTintedTex(Woman[4],hudsize*statussize,min(opacity,15)*(s.Amount/double(s.MaxAmount)),GoldColor);
DrawColor = GoldColor;
if ( s ) UTDrawColorTex(Woman[4],1.0,s.Amount/double(s.MaxAmount));
} }
else else
{ {
UTDrawTintedTex(Man[0],1.0,dollcolor); UTDrawTintedTex(Man[0],hudsize*statussize,min(opacity,15),dollcolor);
DrawColor = dollcolor; if ( a ) UTDrawTintedTex(Man[1],hudsize*statussize,min(opacity,15)*(a.Amount/double(a.MaxAmount)),dollcolor);
if ( a ) UTDrawColorTex(Man[1],1.0,a.Amount/double(a.MaxAmount)); if ( t ) UTDrawTintedTex(Man[2],hudsize*statussize,min(opacity,15)*(t.Amount/double(t.MaxAmount)),dollcolor);
if ( t ) UTDrawColorTex(Man[2],1.0,t.Amount/double(t.MaxAmount)); if ( j ) UTDrawTintedTex(Man[3],hudsize*statussize,min(opacity,15)*(j.Amount/double(j.MaxAmount)),dollcolor);
if ( j ) UTDrawColorTex(Man[3],1.0,j.Amount/double(j.MaxAmount)); if ( s ) UTDrawTintedTex(Man[4],hudsize*statussize,min(opacity,15)*(s.Amount/double(s.MaxAmount)),GoldColor);
DrawColor = GoldColor; }
if ( s ) UTDrawColorTex(Man[4],1.0,s.Amount/double(s.MaxAmount));
} }
DrawColor = WhiteColor; DrawColor = WhiteColor;
CurX = Screen.GetWidth()-268*HScale; if ( !showstatus && !showweapons )
UTDrawTintedTex(Boxes[1]); {
CurX = Screen.GetWidth()*0.5-128*hudsize*HScale;
CurY = Screen.GetHeight()-64*hudsize*HScale;
}
else
{
CurX = Screen.GetWidth()-140*hudsize*HScale;
if ( showstatus ) CurX -= 128*statussize*hudsize*HScale;
CurY = 0;
}
UTDrawTintedTex(Boxes[1],hudsize);
int allarmor = 0; int allarmor = 0;
if ( b ) allarmor += b.amount; if ( b ) allarmor += b.amount;
if ( a ) allarmor += a.amount; if ( a ) allarmor += a.amount;
if ( t ) allarmor += t.amount; if ( t ) allarmor += t.amount;
if ( s ) allarmor += s.amount; if ( s ) allarmor += s.amount;
CurX += 8*HScale; CurX += 8*hudsize*HScale;
CurY += 14*HScale; CurY += 14*hudsize*HScale;
UTDrawBigNum(Min(199,allarmor)); if ( !showstatus && b ) DrawColor = GoldColor;
CurX = Screen.GetWidth()-268*HScale; UTDrawBigNum(Min(199,allarmor),hudsize);
CurY = 64*HScale; DrawColor = WhiteColor;
if ( !showstatus && !showweapons )
{
CurX = Screen.GetWidth()*0.5;
CurY = Screen.GetHeight()-64*hudsize*HScale;
}
else
{
CurX = Screen.GetWidth()-140*hudsize*HScale;
if ( showstatus ) CurX -= 128*statussize*hudsize*HScale;
CurY = 64*hudsize*HScale;
}
if ( CPlayer.mo.Health < CPlayer.mo.SpawnHealth()/2 ) if ( CPlayer.mo.Health < CPlayer.mo.SpawnHealth()/2 )
{ {
Color blinkcolor; Color blinkcolor;
double blinky = ((gametic+fractic)/Thinker.TICRATE)*1.5; double blinky = ((gametic+fractic)/Thinker.TICRATE)*1.5;
blinky = blinky-floor(blinky); blinky = blinky-floor(blinky);
blinkcolor = LerpColor(tintcolor,WhiteColor,blinky); blinkcolor = LerpColor(tintcolor,WhiteColor,blinky);
UTDrawTintedTex(Boxes[2],1.0,blinkcolor); UTDrawTintedTex(Boxes[2],hudsize,-1,blinkcolor);
DrawColor = LerpColor(WhiteColor,blinkcolor,blinky); DrawColor = LerpColor(WhiteColor,blinkcolor,blinky);
CurX += 8*HScale; CurX += 8*hudsize*HScale;
CurY += 14*HScale; CurY += 14*hudsize*HScale;
UTDrawBigNum(max(0,CPlayer.mo.Health)); UTDrawBigNum(max(0,CPlayer.mo.Health),hudsize);
} }
else else
{ {
UTDrawTintedTex(Boxes[2]); UTDrawTintedTex(Boxes[2],hudsize);
CurX += 8*HScale; CurX += 8*hudsize*HScale;
CurY += 14*HScale; CurY += 14*hudsize*HScale;
UTDrawBigNum(Clamp(CPlayer.mo.Health,0,199)); UTDrawBigNum(Clamp(CPlayer.mo.Health,0,199),hudsize);
} }
} }
private void DrawWeapons() private void DrawWeapons()
{ {
double BaseX = 128*HScale; double WeapScale = hudsize*weaponsize*HScale;
double WeapScale = 0.8*HScale; double BaseX = (Screen.GetWidth()-(1280*WeapScale))*0.5;
double BaseY = Screen.GetHeight()-64*WeapScale; double BaseY = Screen.GetHeight()-64*WeapScale;
double WeaponOffset = 128*WeapScale; double WeaponOffset = 128*WeapScale;
let cw = CPlayer.ReadyWeapon; let cw = CPlayer.ReadyWeapon;
int cwslot = -1;
let pw = CPlayer.PendingWeapon; let pw = CPlayer.PendingWeapon;
int pwslot = -1;
if ( cw && (cw.SlotNumber != -1) ) if ( cw && (cw.SlotNumber != -1) )
{ {
int slot = cw.SlotNumber?(cw.SlotNumber-1):9; cwslot = cw.SlotNumber?(cw.SlotNumber-1):9;
CurX = BaseX+slot*WeaponOffset; CurX = BaseX+cwslot*WeaponOffset;
CurY = BaseY; CurY = BaseY;
UTDrawWeaponIcon(cw,true,0.8); UTDrawWeaponIcon(cw,true,hudsize*weaponsize);
CurX = BaseX+slot*WeaponOffset; CurX = BaseX+cwslot*WeaponOffset;
CurY = BaseY; CurY = BaseY;
UTDrawPlainTex(WeaponBox,0.8); UTDrawPlainTex(WeaponBox,hudsize*weaponsize,opacity+7);
} }
if ( pw && (pw.SlotNumber != -1) && (pw != WP_NOCHANGE) ) if ( pw && (pw.SlotNumber != -1) && (pw != WP_NOCHANGE) )
{ {
int slot = pw.SlotNumber?(pw.SlotNumber-1):9; pwslot = pw.SlotNumber?(pw.SlotNumber-1):9;
CurX = BaseX+slot*WeaponOffset-64*WeapScale; CurX = BaseX+pwslot*WeaponOffset-64*WeapScale;
CurY = BaseY-32*WeapScale; CurY = BaseY-32*WeapScale;
DrawColor = GoldColor; UTDrawTintedTex(Flash,hudsize*weaponsize,min(opacity,15),GoldColor);
UTDrawColorTex(Flash,0.8); CurX = BaseX+pwslot*WeaponOffset;
CurX = BaseX+slot*WeaponOffset;
CurY = BaseY; CurY = BaseY;
UTDrawWeaponIcon(pw,true,0.8); UTDrawWeaponIcon(pw,true,hudsize*weaponsize);
} }
Weapon wslots[10]; Weapon wslots[10];
for ( Inventory i = CPlayer.mo.Inv; i; i=i.Inv ) for ( Inventory i = CPlayer.mo.Inv; i; i=i.Inv )
@ -351,18 +412,17 @@ Class UTHud : BaseStatusBar
CurX = BaseX+i*WeaponOffset; CurX = BaseX+i*WeaponOffset;
CurY = BaseY; CurY = BaseY;
if ( !wslots[i] ) if ( !wslots[i] )
UTDrawTintedTex(Slots[i],1.6,tintcolor/2); UTDrawTintedTex(Slots[i],2*hudsize*weaponsize,-1,tintcolor/2);
else if ( (wslots[i] != cw) && (wslots[i] != pw) ) else if ( (i != cwslot) && (i != pwslot) )
if ( !UTDrawWeaponIcon(wslots[i],false,0.8) ) if ( !UTDrawWeaponIcon(wslots[i],false,hudsize*weaponsize) )
UTDrawTintedTex(Slots[i],1.6,tintcolor/2); UTDrawTintedTex(Slots[i],2*hudsize*weaponsize,-1,tintcolor/2);
} }
for ( int i=0; i<10; i++ ) for ( int i=0; i<10; i++ )
{ {
if ( !wslots[i] ) continue; if ( !wslots[i] ) continue;
CurX = BaseX+i*WeaponOffset+4*WeapScale; CurX = BaseX+i*WeaponOffset+4*WeapScale;
CurY = BaseY+4*WeapScale; CurY = BaseY+4*WeapScale;
DrawColor = GoldColor; UTDrawTintedTex(BigNum[(i==9)?0:(i+1)],0.75*hudsize*weaponsize,opacity+7,GoldColor);
UTDrawColorTex(BigNum[(i==9)?0:(i+1)],0.6);
if ( !wslots[i].Ammo1 ) continue; if ( !wslots[i].Ammo1 ) continue;
CurY = BaseY+52*WeapScale; CurY = BaseY+52*WeapScale;
Vector2 ss = (0.6875,0.5)*WeapScale; Vector2 ss = (0.6875,0.5)*WeapScale;
@ -370,13 +430,15 @@ Class UTHud : BaseStatusBar
double dx = CurX/ss.x, dy = CurY/ss.y; double dx = CurX/ss.x, dy = CurY/ss.y;
Vector2 bs = TexMan.GetScaledSize(AmmoBar); Vector2 bs = TexMan.GetScaledSize(AmmoBar);
double ddw = bs.x*(wslots[i].Ammo1.Amount/double(wslots[i].Ammo1.MaxAmount)); double ddw = bs.x*(wslots[i].Ammo1.Amount/double(wslots[i].Ammo1.MaxAmount));
Screen.DrawTexture(AmmoBar,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_WindowRightF,ddw); double alpha = clamp((opacity+7)/15.,0.0,1.0);
Screen.DrawTexture(AmmoBar,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_WindowRightF,ddw,DTA_Alpha,alpha);
} }
} }
private void DrawFragCount() private void DrawFragCount()
{ {
CurX = 0; CurX = showweapons?0:(Screen.GetWidth()*0.5-256*hudsize*HScale);
CurY = Screen.GetHeight()-64*HScale; CurY = Screen.GetHeight()-64*hudsize*HScale;
if ( showweapons && ((weaponsize*hudsize)>=1.0) ) CurY -= 64*hudsize*HScale;
DrawColor = tintcolor; DrawColor = tintcolor;
double whiten = ((gametic+fractic)-lastfrag)/Thinker.TICRATE; double whiten = ((gametic+fractic)-lastfrag)/Thinker.TICRATE;
if ( whiten < 3.0 ) if ( whiten < 3.0 )
@ -384,19 +446,19 @@ Class UTHud : BaseStatusBar
if ( tintcolor == GoldColor ) if ( tintcolor == GoldColor )
DrawColor = WhiteColor; DrawColor = WhiteColor;
else DrawColor = GoldColor; else DrawColor = GoldColor;
CurX -= 64*HScale; CurX -= 64*hudsize*HScale;
CurY -= 32*HScale; CurY -= 32*hudsize*HScale;
UTDrawColorTex(Flash); UTDrawTintedTex(Flash,hudsize,min(opacity,15),DrawColor);
CurX += 64*HScale; CurX += 64*hudsize*HScale;
CurY += 32*HScale; CurY += 32*hudsize*HScale;
whiten = 4*whiten-int(4*whiten); whiten = 4*whiten-int(4*whiten);
DrawColor = lerpcolor(tintcolor,DrawColor,whiten); DrawColor = lerpcolor(tintcolor,DrawColor,whiten);
} }
UTDrawTintedTex(Boxes[3],1.0,DrawColor); UTDrawTintedTex(Boxes[3],hudsize,-1,DrawColor);
CurX += 44*HScale; CurX += 44*hudsize*HScale;
CurY += 14*HScale; CurY += 14*hudsize*HScale;
DrawColor = WhiteColor; DrawColor = WhiteColor;
UTDrawBigNum((deathmatch||teamplay)?CPlayer.fragcount:CPlayer.killcount); UTDrawBigNum((deathmatch||teamplay)?CPlayer.fragcount:CPlayer.killcount,hudsize);
} }
private void DrawIdentifyInfo() private void DrawIdentifyInfo()
{ {
@ -427,47 +489,42 @@ Class UTHud : BaseStatusBar
int nrows = 0, nrowss = 0; int nrows = 0, nrowss = 0;
for ( int i=0; i<3; i++ ) if ( locks[i] ) nrows++; for ( int i=0; i<3; i++ ) if ( locks[i] ) nrows++;
for ( int i=3; i<6; i++ ) if ( locks[i] ) nrowss++; for ( int i=3; i<6; i++ ) if ( locks[i] ) nrowss++;
CurX = (Screen.GetWidth()-64*HScale); CurX = (Screen.GetWidth()-64*hudsize*HScale);
CurY = (Screen.GetHeight()-nrows*64*HScale)*0.5; CurY = (Screen.GetHeight()-nrows*64*hudsize*HScale)*0.5;
CurY -= max(0,nrows-1)*4*HScale; CurY -= max(0,nrows-1)*4*hudsize*HScale;
if ( locks[0] ) if ( locks[0] )
{ {
DrawColor = "Red"; UTDrawTintedTex(Keys[0],hudsize,min(opacity,15),Color("Red"));
UTDrawColorTex(Keys[0]); CurY += 72*hudsize*HScale;
CurY += 72*HScale;
} }
if ( locks[1] ) if ( locks[1] )
{ {
DrawColor = "Blue"; UTDrawTintedTex(Keys[1],hudsize,min(opacity,15),Color("Blue"));
UTDrawColorTex(Keys[1]); CurY += 72*hudsize*HScale;
CurY += 72*HScale;
} }
if ( locks[2] ) if ( locks[2] )
{ {
DrawColor = "Gold"; UTDrawTintedTex(Keys[2],hudsize,min(opacity,15),Color("Gold"));
UTDrawColorTex(Keys[2]); CurY += 72*hudsize*HScale;
CurY += 72*HScale;
} }
if ( nrows ) CurX -= 56*HScale; if ( nrows ) CurX -= 56*hudsize*HScale;
CurY = (Screen.GetHeight()-nrowss*64*HScale)*0.5; CurY = (Screen.GetHeight()-nrowss*64*hudsize*HScale)*0.5;
CurY += max(0,nrowss-1)*2*HScale; CurY += max(0,nrowss-1)*2*hudsize*HScale;
if ( locks[3] ) if ( locks[3] )
{ {
DrawColor = "Red"; DrawColor = "Red";
UTDrawColorTex(Keys[3]); UTDrawTintedTex(Keys[3],hudsize,min(opacity,15),Color("Red"));
CurY += 60*HScale; CurY += 60*hudsize*HScale;
} }
if ( locks[4] ) if ( locks[4] )
{ {
DrawColor = "Blue"; UTDrawTintedTex(Keys[3],hudsize,min(opacity,15),Color("Blue"));
UTDrawColorTex(Keys[3]); CurY += 60*hudsize*HScale;
CurY += 60*HScale;
} }
if ( locks[5] ) if ( locks[5] )
{ {
DrawColor = "Gold"; UTDrawTintedTex(Keys[3],hudsize,min(opacity,15),Color("Gold"));
UTDrawColorTex(Keys[3]); CurY += 60*hudsize*HScale;
CurY += 60*HScale;
} }
} }
@ -493,35 +550,17 @@ Class UTHud : BaseStatusBar
private void DrawUTHUD() private void DrawUTHUD()
{ {
if ( players[consoleplayer].camera is 'GuidedWarShell' ) return;
HScale = Screen.GetWidth()/1280.;
switch ( CVar.GetCVar('flak_colorprefs',CPlayer).GetInt() )
{
case 0:
if ( CPlayer.GetTeam() >= Teams.Size() )
tintcolor = Color("White");
else tintcolor = Color(Teams[CPlayer.GetTeam()].mName);
break;
case 1:
tintcolor = CPlayer.GetColor();
break;
case 2:
tintcolor = Color(CVar.GetCVar('flak_colorcustom',CPlayer).GetString());
break;
}
opacity = CVar.GetCVar('flak_opacity',CPlayer).GetFloat();
bgcolor = Color(CVar.GetCVar('flak_bgcolor',CPlayer).GetString());
// Display Weapons // Display Weapons
DrawWeapons(); if ( showweapons ) DrawWeapons();
// Display Frag count // Display Frag count
DrawFragCount(); if ( showfrags ) DrawFragCount();
// Draw Ammo // Draw Ammo
DrawAmmo(); if ( showammo ) DrawAmmo();
// Draw Health/Armor status // Draw Health/Armor status
DrawStatus(); DrawStatus();
// Display Keys // Display Keys
DrawKeys(); DrawKeys();
// Display Identification Info // Display Identification Info
if ( CPlayer == players[consoleplayer] ) DrawIdentifyInfo(); if ( CPlayer == players[consoleplayer] && showinfo ) DrawIdentifyInfo();
} }
} }

View file

@ -11,8 +11,6 @@ Class WarheadAmmo : Ammo
Ammo.BackpackMaxAmount 2; Ammo.BackpackMaxAmount 2;
Ammo.DropAmount 1; Ammo.DropAmount 1;
Inventory.RespawnTics 2100; Inventory.RespawnTics 2100;
Radius 2;
Height 42;
} }
States States
{ {
@ -496,17 +494,17 @@ Class RedeemerHUD : HUDMessageBase
{ {
for ( int i=0; i<ta.Size(); i++ ) for ( int i=0; i<ta.Size(); i++ )
{ {
Screen.DrawTexture(mark,false,ta[i].vpos.x,ta[i].vpos.y); Screen.DrawTexture(mark,false,ta[i].vpos.x,ta[i].vpos.y,DTA_RenderStyle,(1|2<<8|1<<16));
Screen.DrawText(whfont,Font.CR_UNTRANSLATED,(ta[i].vpos.x-whfont.StringWidth(ta[i].diststr)/2)-12,ta[i].vpos.y+8,ta[i].diststr); Screen.DrawText(whfont,Font.CR_UNTRANSLATED,(ta[i].vpos.x-whfont.StringWidth(ta[i].diststr)/2)-12,ta[i].vpos.y+8,ta[i].diststr,DTA_RenderStyle,(1|2<<8|1<<16));
} }
} }
// other stuff // other stuff
Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480); Screen.DrawTexture(reticle,false,320,240,DTA_VirtualWidth,640,DTA_VirtualHeight,480,DTA_RenderStyle,(1|2<<8|1<<16));
int numreadouts = Screen.GetHeight()/128+2; int numreadouts = Screen.GetHeight()/128+2;
for ( int i=0; i<numreadouts; i++ ) for ( int i=0; i<numreadouts; i++ )
{ {
int scroll = (gametic*5)%128; int scroll = (gametic*5)%128;
Screen.DrawTexture(readout,false,0,i*128-scroll); Screen.DrawTexture(readout,false,0,i*128-scroll,DTA_RenderStyle,(1|2<<8|1<<16));
} }
} }
} }
@ -651,9 +649,6 @@ Class WarheadLauncher : UTWeapon replaces BFG9000
Inventory.RespawnTics 2100; Inventory.RespawnTics 2100;
+INVENTORY.ALWAYSPICKUP; +INVENTORY.ALWAYSPICKUP;
+WEAPON.NOAUTOFIRE; +WEAPON.NOAUTOFIRE;
Radius 24;
Height 16;
UTWeapon.DroppedHeight 16;
} }
States States
{ {
@ -687,7 +682,7 @@ Class WarheadLauncher : UTWeapon replaces BFG9000
WARS A 1 A_Raise(int.max); WARS A 1 A_Raise(int.max);
Wait; Wait;
Deselect: Deselect:
WARD ABCDEFG 2; WARD ABCDEFG 1;
WARD G 1 A_Lower(int.max); WARD G 1 A_Lower(int.max);
Wait; Wait;
} }