Remove Dragon's Breath shells.

Nuggets can no longer be stored as spares.
This commit is contained in:
Mari the Deer 2022-06-04 22:09:46 +02:00
commit 93ac4d3a4f
45 changed files with 612 additions and 1028 deletions

View file

@ -0,0 +1 @@
// DrawWeapon code for DLC weapons

View file

@ -17,7 +17,7 @@ Class RedShell : SWWMAmmo
Inventory.Amount 1;
Inventory.MaxAmount 30;
Ammo.BackpackAmount 3;
Ammo.BackpackMaxAmount 50;
Ammo.BackpackMaxAmount 60;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
@ -72,7 +72,7 @@ Class GreenShell : SWWMAmmo
Inventory.Amount 1;
Inventory.MaxAmount 25;
Ammo.BackpackAmount 2;
Ammo.BackpackMaxAmount 45;
Ammo.BackpackMaxAmount 50;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
@ -112,60 +112,6 @@ Class GreenShell4 : GreenShell
}
}
Class WhiteShell : SWWMAmmo
{
Default
{
//$Title 1x White Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsDragon.png
//$Icon ammo
Tag "$T_WHITESHELL";
SWWMAmmo.PickupTag "WHITESHELL";
Stamina 1000;
Inventory.Icon "graphics/HUD/Icons/A_ShellsDragon.png";
Inventory.Amount 1;
Inventory.MaxAmount 10;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 30;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
Radius 4;
Accuracy 70;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class WhiteShell2 : WhiteShell
{
Default
{
//$Title 2x White Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsDragon.png
//$Icon ammo
Inventory.Amount 2;
Radius 6;
}
}
Class WhiteShell4 : WhiteShell
{
Default
{
//$Title 3x White Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsDragon.png
//$Icon ammo
Inventory.Amount 4;
Radius 6;
}
}
Class BlueShell : SWWMAmmo
{
Default
@ -176,12 +122,12 @@ Class BlueShell : SWWMAmmo
//$Icon ammo
Tag "$T_BLUESHELL";
SWWMAmmo.PickupTag "BLUESHELL";
Stamina 2500;
Stamina 1500;
Inventory.Icon "graphics/HUD/Icons/A_ShellsKinylum.png";
Inventory.Amount 1;
Inventory.MaxAmount 15;
Inventory.MaxAmount 20;
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 35;
Ammo.BackpackMaxAmount 40;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
@ -221,61 +167,6 @@ Class BlueShell4 : BlueShell
}
}
Class BlackShell : SWWMAmmo
{
Default
{
//$Title 1x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Tag "$T_BLACKSHELL";
SWWMAmmo.PickupTag "BLACKSHELL";
Stamina 4000;
Inventory.Icon "graphics/HUD/Icons/A_ShellsFuck.png";
Inventory.Amount 1;
Inventory.MaxAmount 5;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 25;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
Radius 4;
Height 20;
Accuracy 75;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class BlackShell2 : BlackShell
{
Default
{
//$Title 2x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Inventory.Amount 2;
Radius 6;
}
}
Class BlackShell4 : BlackShell
{
Default
{
//$Title 4x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Inventory.Amount 4;
Radius 6;
}
}
Class PurpleShell : SWWMAmmo
{
Default
@ -286,12 +177,12 @@ Class PurpleShell : SWWMAmmo
//$Icon ammo
Tag "$T_PURPLESHELL";
SWWMAmmo.PickupTag "PURPLESHELL";
Stamina 1500;
Stamina 2500;
Inventory.Icon "graphics/HUD/Icons/A_ShellsBall.png";
Inventory.Amount 1;
Inventory.MaxAmount 20;
Inventory.MaxAmount 15;
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 40;
Ammo.BackpackMaxAmount 30;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
@ -331,6 +222,61 @@ Class PurpleShell4 : PurpleShell
}
}
Class BlackShell : SWWMAmmo
{
Default
{
//$Title 1x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Tag "$T_BLACKSHELL";
SWWMAmmo.PickupTag "BLACKSHELL";
Stamina 4000;
Inventory.Icon "graphics/HUD/Icons/A_ShellsFuck.png";
Inventory.Amount 1;
Inventory.MaxAmount 10;
Ammo.BackpackAmount 0;
Ammo.BackpackMaxAmount 20;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
Radius 4;
Height 20;
Accuracy 75;
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
Class BlackShell2 : BlackShell
{
Default
{
//$Title 2x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Inventory.Amount 2;
Radius 6;
}
}
Class BlackShell4 : BlackShell
{
Default
{
//$Title 4x Black Shells
//$Group Ammo
//$Sprite graphics/HUD/Icons/A_ShellsFuck.png
//$Icon ammo
Inventory.Amount 4;
Radius 6;
}
}
Class GoldShellSparkle : Actor
{
override void PostBeginPlay()
@ -529,7 +475,7 @@ Class HellblazerMissiles : SWWMAmmo
Inventory.Amount 1;
Inventory.MaxAmount 18;
Ammo.BackpackAmount 2;
Ammo.BackpackMaxAmount 36;
Ammo.BackpackMaxAmount 48;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;
@ -755,7 +701,7 @@ Class SparkUnit : SWWMAmmo
Inventory.Amount 1;
Inventory.MaxAmount 8;
Ammo.BackpackAmount 1;
Ammo.BackpackMaxAmount 24;
Ammo.BackpackMaxAmount 20;
Ammo.DropAmount 1;
+FLOATBOB;
FloatBobStrength 0.25;

View file

@ -63,10 +63,10 @@ Class SWWMShellAmmoSmall : SWWMAmmoSpawner
return 'GreenShell';
case 6:
case 7:
return 'PurpleShell';
return 'BlueShell';
}
// case 8-9
return 'BlueShell';
return 'PurpleShell';
}
}
Class SWWMShellAmmoBig : SWWMAmmoSpawner
@ -77,7 +77,7 @@ Class SWWMShellAmmoBig : SWWMAmmoSpawner
{
/*if ( Random[Replacements](0,1) && (notondemand || SWWMUtility.ItemExists('PuntzerBeta') || SWWMUtility.ItemExists('PuntzerGamma')) )
return Random[Replacements](0,2)?'SMW05SmallAmmo':'SMW05BigAmmo';*/
switch( Random[Replacements](0,17) )
switch( Random[Replacements](0,14) )
{
case 0:
case 1:
@ -92,16 +92,12 @@ Class SWWMShellAmmoBig : SWWMAmmoSpawner
case 8:
case 9:
case 10:
return 'PurpleShell';
return 'BlueShell';
case 11:
case 12:
case 13:
return 'BlueShell';
case 14:
case 15:
return 'WhiteShell';
return 'PurpleShell';
}
// case 16-17
// case 13-14
return 'BlackShell';
}
}

View file

@ -19,11 +19,24 @@ Class ArmorNugget : SWWMArmor
}
Class ArmorNuggetItem : SWWMSpareArmor
{
override Inventory CreateCopy( Actor other )
override bool Use( bool pickup )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"Nugget");
return Super.CreateCopy(other);
SWWMLoreLibrary.Add(Owner.player,"Nugget");
bool bUsed = Super.Use(pickup);
// sell excess
if ( !bUsed )
{
int sellprice = int(abs(Stamina)*.5);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
{
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
}
}
return bUsed;
}
override void DoPickupSpecial( Actor toucher )
@ -40,13 +53,13 @@ Class ArmorNuggetItem : SWWMSpareArmor
//$Icon armour
Tag "$T_NUGGETA";
Stamina 400;
Inventory.Icon "graphics/HUD/Icons/I_ArmorNugget.png";
Inventory.PickupMessage "$T_NUGGETA";
Inventory.MaxAmount 20;
Inventory.InterHubAmount 20;
Inventory.MaxAmount 0;
Inventory.InterHubAmount 0;
Inventory.UseSound "misc/armor_pkup";
SWWMSpareArmor.GiveArmor "ArmorNugget";
+INVENTORY.ALWAYSPICKUP;
-INVENTORY.INVBAR;
Radius 4;
Height 22;
}

View file

@ -970,9 +970,8 @@ Class Chancebox : Actor
else if ( Random[Chancebox](0,1) )
{
Class<Inventory> vipammodrop = null;
if ( SWWMUtility.ItemExists("Ynykron") && Random[Chancebox](0,1) ) vipammodrop = "YnykronAmmo";
//if ( SWWMUtility.ItemExists("GrandLance") && Random[Chancebox](0,1) && !vipammodrop ) vipammodrop = "GrandAmmo";
//if ( SWWMUtility.ItemExists("RafanKos") && Random[Chancebox](0,1) && !vipammodrop ) vipammodrop = "UltimateAmmo";
if ( SWWMUtility.ItemExists("Ynykron") && SWWMUtility.CheckNeedsItem("YnykronAmmo",true) && Random[Chancebox](0,1) ) vipammodrop = "YnykronAmmo";
if ( SWWMUtility.ItemExists("RafanKos") && SWWMUtility.CheckNeedsItem("UltimateAmmo",true) && Random[Chancebox](0,1) && !vipammodrop ) vipammodrop = "UltimateAmmo";
if ( SWWMUtility.ItemExists("Spreadgun") && SWWMUtility.CheckNeedsItem("GoldShell",true) && !vipammodrop ) vipammodrop = "GoldShell";
Class<Inventory> vipitemdrop = null;
if ( SWWMUtility.CheckNeedsItem("Mykradvo",true) && !SWWMUtility.ItemExists("Mykradvo",worldonly:true) && Random[Chancebox](0,1) ) vipitemdrop = "Mykradvo";
@ -1051,21 +1050,13 @@ Class Chancebox : Actor
a.bDROPPED = false;
a.bNOGRAVITY = false;
a.vel.z = FRandom[Chancebox](2,4);
for ( int i=0; i<3; i++ )
{
a = Spawn("WhiteShell",pos);
a.bDROPPED = false;
a.bNOGRAVITY = false;
a.vel.z = FRandom[Chancebox](2,4);
a.vel.xy = (cos(i*120),sin(i*120))*FRandom[Chancebox](1,2);
}
for ( int i=0; i<8; i++ )
{
a = Spawn((i%2)?"PurpleShell":"BlueShell",pos);
a.bDROPPED = false;
a.bNOGRAVITY = false;
a.vel.z = FRandom[Chancebox](2,4);
a.vel.xy = (cos(i*72),sin(i*72))*FRandom[Chancebox](3,4);
a.vel.xy = (cos(i*72),sin(i*72))*FRandom[Chancebox](2,3);
}
for ( int i=0; i<12; i++ )
{
@ -1073,7 +1064,7 @@ Class Chancebox : Actor
a.bDROPPED = false;
a.bNOGRAVITY = false;
a.vel.z = FRandom[Chancebox](2,4);
a.vel.xy = (cos(i*30),sin(i*30))*FRandom[Chancebox](5,6);
a.vel.xy = (cos(i*30),sin(i*30))*FRandom[Chancebox](4,5);
}
}
else if ( Random[Chancebox](0,1) )

View file

@ -65,11 +65,24 @@ Class RefresherRegen : Powerup
Class HealthNuggetItem : SWWMHealth
{
override Inventory CreateCopy( Actor other )
override bool Use( bool pickup )
{
// additional lore
SWWMLoreLibrary.Add(other.player,"Nugget");
return Super.CreateCopy(other);
SWWMLoreLibrary.Add(Owner.player,"Nugget");
bool bUsed = Super.Use(pickup);
// sell excess
if ( !bUsed )
{
int sellprice = int(abs(Stamina)*.5);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
{
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
}
}
return bUsed;
}
override void DoPickupSpecial( Actor toucher )
{
@ -84,12 +97,12 @@ Class HealthNuggetItem : SWWMHealth
//$Icon health
Tag "$T_NUGGETH";
Stamina 200;
Inventory.Icon "graphics/HUD/Icons/I_HealthNugget.png";
Inventory.PickupMessage "$T_NUGGETH";
Inventory.MaxAmount 20;
Inventory.InterHubAmount 20;
Inventory.MaxAmount 0;
Inventory.InterHubAmount 0;
SWWMHealth.GiveHealth "HealthNugget";
+INVENTORY.ALWAYSPICKUP;
-INVENTORY.INVBAR;
Radius 4;
Height 22;
}

View file

@ -107,6 +107,9 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
{
// skip maxed items if buying
if ( cur && (cur.Amount >= cur.MaxAmount) ) return true;
// nuggets are skipped if more can't be picked up
if ( (type is 'HealthNuggetItem') && (players[consoleplayer].Health >= GetDefaultByType('HealthNugget').MaxAmount) ) return true;
if ( (type is 'ArmorNuggetItem') && (players[consoleplayer].mo.CountInv('ArmorNugget') >= GetDefaultByType('ArmorNugget').MaxAmount) ) return true;
// ignore ammo for weapons not owned if buying
bool notownedammo = false;
if ( type is 'Ammo' )
@ -600,7 +603,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
camt = 0;
max = GetDefaultByType(inv).MaxAmount;
}
if ( camt >= max )
if ( (max > 0) && (camt >= max) )
{
master.MenuSound("menu/noinvuse");
master.tmsg = StringTable.Localize("$SWWM_STOREFULL");

View file

@ -165,7 +165,7 @@ Class SWWMStats : SWWMStaticThinker
else if ( inflictor is 'AirBullet' ) which = 'DeepImpact';
else if ( inflictor is 'PusherProjectile' ) which = 'PusherWeapon';
else if ( (inflictor is 'ExplodiumMagArm') || (inflictor is 'ExplodiumMagProj') || (inflictor is 'ExplodiumBulletImpact') ) which = 'ExplodiumGun';
else if ( (inflictor is 'DragonBreathArm') || ((inflictor is 'SaltImpact') && !inflictor.Args[0]) || ((inflictor is 'SaltBeam') && !inflictor.Args[1]) || (inflictor is 'CorrodeDebuff') || (inflictor is 'CorrosiveFlechette') || ((inflictor is 'TheBall') && !inflictor.special1) || (inflictor is 'GoldenImpact') || (inflictor is 'GoldenSubImpact') || (inflictor is 'GoldenSubSubImpact') ) which = 'Spreadgun';
else if ( ((inflictor is 'SaltImpact') && !inflictor.Args[0]) || ((inflictor is 'SaltBeam') && !inflictor.Args[1]) || (inflictor is 'CorrodeDebuff') || (inflictor is 'CorrosiveFlechette') || ((inflictor is 'TheBall') && !inflictor.special1) || (inflictor is 'GoldenImpact') || (inflictor is 'GoldenSubImpact') || (inflictor is 'GoldenSubSubImpact') ) which = 'Spreadgun';
else if ( ((inflictor is 'SaltImpact') && inflictor.Args[0]) || ((inflictor is 'SaltBeam') && inflictor.Args[1]) || ((inflictor is 'TheBall') && inflictor.special1) ) which = 'Wallbuster';
else if ( (inflictor is 'EvisceratorChunk') || (inflictor is 'EvisceratorProj') ) which = 'Eviscerator';
else if ( (inflictor is 'HellblazerMissile') || (inflictor is 'HellblazerRavagerArm') || (inflictor is 'HellblazerWarheadArm') ) which = 'Hellblazer';

View file

@ -102,8 +102,8 @@ Class Hellblazer : SWWMWeapon
Property ClipCount : clipcount;
transient ui TextureID WeaponBox, AmmoIcon[4], LoadedIcon[4], LockIcon[4];
transient ui SWWMProjectionData projdata;
ui TextureID LockIcon[4];
override void RenderUnderlay( RenderEvent e )
{
@ -139,83 +139,6 @@ Class Hellblazer : SWWMWeapon
}
}
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"HellblazerMissiles","HellblazerCrackshots","HellblazerRavagers","HellblazerWarheads"};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/HellblazerDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/HellblazerMissile.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/HellblazerCrackshot.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/HellblazerRavager.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/HellblazerWarhead.png",TexMan.Type_Any);
LoadedIcon[0] = TexMan.CheckForTexture("graphics/HUD/HellblazerMissileLoaded.png",TexMan.Type_Any);
LoadedIcon[1] = TexMan.CheckForTexture("graphics/HUD/HellblazerCrackshotLoaded.png",TexMan.Type_Any);
LoadedIcon[2] = TexMan.CheckForTexture("graphics/HUD/HellblazerRavagerLoaded.png",TexMan.Type_Any);
LoadedIcon[3] = TexMan.CheckForTexture("graphics/HUD/HellblazerWarheadLoaded.png",TexMan.Type_Any);
}
double xx = -56, yy = -49;
Screen.DrawTexture(WeaponBox,false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int curtype = 0;
for ( int i=0; i<4; i++ )
{
if ( loadammo != types[i] ) continue;
curtype = i;
break;
}
xx += 2;
yy += 2;
for ( int i=0; i<4; i++ )
{
int amt = Owner.CountInv(types[i]);
String amtstr = String.Format("%3d",amt);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx+xx,by+yy,amtstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(AmmoIcon[i],false,bx+xx+19,by+yy+1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
yy += 13;
if ( i%2 )
{
yy -= 26;
xx += 28;
}
}
yy = -18;
switch ( curtype )
{
case 0:
xx = -54;
for ( int i=0; i<6; i++ )
{
Screen.DrawTexture(LoadedIcon[0],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 9;
}
break;
case 1:
xx = -49;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(LoadedIcon[1],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 18;
}
break;
case 2:
xx = -49;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(LoadedIcon[2],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 18;
}
break;
case 3:
xx = -45;
for ( int i=0; i<2; i++ )
{
Screen.DrawTexture(LoadedIcon[3],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 27;
}
break;
}
}
override void HudTick()
{
Super.HudTick();

View file

@ -14,7 +14,6 @@ Class Wallbuster : SWWMWeapon
transient bool cancelreload;
transient bool clearout;
transient ui TextureID WeaponBox, AmmoIcon[4], LoadIcon[4], UsedIcon[4], EmptyIcon;
Class<Ammo> curobt;
ui Vector3 cpos25[25];
@ -29,100 +28,6 @@ Class Wallbuster : SWWMWeapon
if ( curobt is 'PurpleShell' ) return StringTable.Localize("$O_WALLBUSTER_PURPLE");
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell"};
/*
(Layout of indices)
0
4 1
3 2
L 9
K M 8 5
O N 7 6
H D
G I C E
F J B A
*/
static const int barrelposx[] =
{
29,24,26,32,34,
10,12,18,20,15,
17,23,25,20,15,
41,43,38,33,35,
48,43,38,40,46
};
static const int barrelposy[] =
{
46,42,36,36,42,
31,25,25,31,35,
8, 8,14,18,14,
8,14,18,14, 8,
31,35,31,25,25
};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/WallbusterDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/RedShell.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/GreenShell.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/BlueShell.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/PurpleShell.png",TexMan.Type_Any);
LoadIcon[0] = TexMan.CheckForTexture("graphics/HUD/WallbusterRed.png",TexMan.Type_Any);
LoadIcon[1] = TexMan.CheckForTexture("graphics/HUD/WallbusterGreen.png",TexMan.Type_Any);
LoadIcon[2] = TexMan.CheckForTexture("graphics/HUD/WallbusterBlue.png",TexMan.Type_Any);
LoadIcon[3] = TexMan.CheckForTexture("graphics/HUD/WallbusterPurple.png",TexMan.Type_Any);
UsedIcon[0] = TexMan.CheckForTexture("graphics/HUD/WallbusterRedUsed.png",TexMan.Type_Any);
UsedIcon[1] = TexMan.CheckForTexture("graphics/HUD/WallbusterGreenUsed.png",TexMan.Type_Any);
UsedIcon[2] = TexMan.CheckForTexture("graphics/HUD/WallbusterBlueUsed.png",TexMan.Type_Any);
UsedIcon[3] = TexMan.CheckForTexture("graphics/HUD/WallbusterPurpleUsed.png",TexMan.Type_Any);
EmptyIcon = TexMan.CheckForTexture("graphics/HUD/WallbusterEmpty.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-54,by-72,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int ox = 6;
int oy = 60;
for ( int i=0; i<4; i++ )
{
Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String astr = String.Format("%3d",Owner.CountInv(types[i]));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
oy += 10;
if ( i == 1 )
{
oy = 60;
ox = 33;
}
}
// and here's the big clusterdick
for ( int i=0; i<25; i++ )
{
int idx = i;
int group = idx/5;
// shift based on group rotation
int gidx = i%5;
gidx = (gidx-rotation[group]);
while ( gidx < 0 ) gidx += 5;
idx = gidx+group*5;
// shift based on full rotation
idx = (idx-rotation[5]*5);
while ( idx < 0 ) idx += 25;
if ( !loaded[i] )
{
Screen.DrawTexture(EmptyIcon,false,bx-barrelposx[idx],by-barrelposy[idx],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
continue;
}
int which = 0;
for ( int j=0; j<4; j++ )
{
if ( !(loaded[i] is types[j]) ) continue;
which = j;
break;
}
Screen.DrawTexture(fired[i]?UsedIcon[which]:LoadIcon[which],false,bx-barrelposx[idx],by-barrelposy[idx],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
override void HudTick()
{

View file

@ -15,19 +15,6 @@ Class Eviscerator : SWWMWeapon
// countdown to loading new shell
int loadtics;
transient ui TextureID WeaponBox, AmmoIcon;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/EvisceratorDisplay.png",TexMan.Type_Any);
if ( !AmmoIcon ) AmmoIcon = TexMan.CheckForTexture("graphics/HUD/EvisceratorShell.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-46,by-16,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String astr = String.Format("%d",Ammo1.Amount);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-14-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-14,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoIcon,false,bx-14,by-14,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,chambered?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_WHITE,bx-44,by-14,extended?"►":"",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
override bool ReportHUDAmmo()
{
if ( (Ammo1.Amount > 0) || chambered ) return true;

View file

@ -3,7 +3,6 @@
Class Ynykron : SWWMWeapon
{
transient ui TextureID WeaponBox, ChargeBar[2], BoxSide[2];
transient ui DynamicValueInterpolator ChargeInter;
enum EChargeState
@ -27,20 +26,6 @@ Class Ynykron : SWWMWeapon
Property ClipCount : clipcount;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/YnykronDisplay.png",TexMan.Type_Any);
if ( !ChargeBar[0] ) ChargeBar[0] = TexMan.CheckForTexture("graphics/HUD/YnykronBarA.png",TexMan.Type_Any);
if ( !ChargeBar[1] ) ChargeBar[1] = TexMan.CheckForTexture("graphics/HUD/YnykronBarB.png",TexMan.Type_Any);
if ( !BoxSide[0] ) BoxSide[0] = TexMan.CheckForTexture("graphics/HUD/YnykronSideA.png",TexMan.Type_Any);
if ( !BoxSide[1] ) BoxSide[1] = TexMan.CheckForTexture("graphics/HUD/YnykronSideB.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-33,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*10),0,400);
int ct = int(((by-2)-chg/10.)*hs);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-30,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(BoxSide[inverted],false,bx-23,by-31,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,clipcount?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(ChargeBar[inverted],false,bx-6,by-42,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(chargestate==CS_READY)?Color(int(clamp(sin((level.maptime+TicFrac)*8)*40+24,0.,64.)),255,255,255):Color(0,0,0,0),DTA_ClipTop,ct);
}
override void HudTick()
{
Super.HudTick();

View file

@ -49,24 +49,11 @@ Class DeepImpact : SWWMWeapon
double charge;
bool charging;
transient ui TextureID WeaponBox, AmmoBar;
transient ui DynamicValueInterpolator ChargeInter;
transient int failtime;
Property ClipCount : clipcount;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DeepImpactDisplay.png",TexMan.Type_Any);
if ( !AmmoBar ) AmmoBar = TexMan.CheckForTexture("graphics/HUD/DeepImpactBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-36,by-54,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():clipcount,0,100);
int ct = int(((by-2)-(chg*50./100.))*hs);
bool blinking = (failtime>gametic)&&((failtime-gametic)%8>=4);
Screen.DrawTexture(AmmoBar,false,bx-7,by-52,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
override void HudTick()
{
Super.HudTick();

View file

@ -6,19 +6,8 @@ Class PusherWeapon : SWWMWeapon
double chargelevel, vibe;
int hitcnt;
transient ui TextureID WeaponBox, ChargeBar;
transient ui DynamicValueInterpolator ChargeInter;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/PusherDisplay.png",TexMan.Type_Any);
if ( !ChargeBar ) ChargeBar = TexMan.CheckForTexture("graphics/HUD/PusherBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-60,by-9,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*100),0,100);
double cw = chg*56./100.;
Screen.DrawTexture(ChargeBar,false,bx-58,by-7,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,cw);
}
override void HudTick()
{
Super.HudTick();

View file

@ -126,8 +126,6 @@ Class Spreadgun : SWWMWeapon
ui Class<Ammo> lastammo;
bool initialized;
transient ui TextureID WeaponBox, AmmoIcon[7], LoadedIcon[7];
override void HudTick()
{
Super.HudTick();
@ -148,73 +146,27 @@ Class Spreadgun : SWWMWeapon
{
if ( loadammo is 'RedShell' ) return StringTable.Localize("$O_SPREADGUN_RED");
if ( loadammo is 'GreenShell' ) return StringTable.Localize("$O_SPREADGUN_GREEN");
if ( loadammo is 'WhiteShell' ) return StringTable.Localize("$O_SPREADGUN_WHITE");
if ( loadammo is 'BlueShell' ) return StringTable.Localize("$O_SPREADGUN_BLUE");
if ( loadammo is 'BlackShell' ) return StringTable.Localize("$O_SPREADGUN_BLACK");
if ( loadammo is 'PurpleShell' ) return StringTable.Localize("$O_SPREADGUN_PURPLE");
if ( loadammo is 'BlackShell' ) return StringTable.Localize("$O_SPREADGUN_BLACK");
if ( loadammo is 'GoldShell' ) return StringTable.Localize("$O_SPREADGUN_GOLD");
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/SpreadgunDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/RedShell.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/GreenShell.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/WhiteShell.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/BlueShell.png",TexMan.Type_Any);
AmmoIcon[4] = TexMan.CheckForTexture("graphics/HUD/BlackShell.png",TexMan.Type_Any);
AmmoIcon[5] = TexMan.CheckForTexture("graphics/HUD/PurpleShell.png",TexMan.Type_Any);
AmmoIcon[6] = TexMan.CheckForTexture("graphics/HUD/GoldShell.png",TexMan.Type_Any);
LoadedIcon[0] = TexMan.CheckForTexture("graphics/HUD/LoadedRedShell.png",TexMan.Type_Any);
LoadedIcon[1] = TexMan.CheckForTexture("graphics/HUD/LoadedGreenShell.png",TexMan.Type_Any);
LoadedIcon[2] = TexMan.CheckForTexture("graphics/HUD/LoadedWhiteShell.png",TexMan.Type_Any);
LoadedIcon[3] = TexMan.CheckForTexture("graphics/HUD/LoadedBlueShell.png",TexMan.Type_Any);
LoadedIcon[4] = TexMan.CheckForTexture("graphics/HUD/LoadedBlackShell.png",TexMan.Type_Any);
LoadedIcon[5] = TexMan.CheckForTexture("graphics/HUD/LoadedPurpleShell.png",TexMan.Type_Any);
LoadedIcon[6] = TexMan.CheckForTexture("graphics/HUD/LoadedGoldShell.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-54,by-43,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int ox = 6;
int oy = 11;
for ( int i=0; i<7; i++ )
{
Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
String astr = String.Format("%3d",Owner.CountInv(types[i]));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
oy += 10;
if ( i == 3 )
{
oy = 21;
ox = 33;
}
}
if ( !chambered ) return;
for ( int i=0; i<7; i++ )
{
if ( loadammo != types[i] ) continue;
Screen.DrawTexture(LoadedIcon[i],false,bx-48,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fired?Color(128,0,0,0):Color(0,0,0,0));
break;
}
}
override bool ReportHUDAmmo()
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
for ( int i=0; i<7; i++ ) if ( Owner.CountInv(types[i]) > 0 ) return true;
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
for ( int i=0; i<6; i++ ) if ( Owner.CountInv(types[i]) > 0 ) return true;
return (!fired && chambered);
}
override bool CheckAmmo( int firemode, bool autoswitch, bool requireammo, int ammocount )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
if ( (firemode == PrimaryFire) || (firemode == AltFire) )
{
if ( !fired && chambered ) return true;
for ( int i=0; i<7; i++ ) if ( Owner.CountInv(types[i]) > 0 ) return true;
for ( int i=0; i<6; i++ ) if ( Owner.CountInv(types[i]) > 0 ) return true;
return false;
}
return Super.CheckAmmo(firemode,autoswitch,requireammo,ammocount);
@ -222,18 +174,18 @@ Class Spreadgun : SWWMWeapon
override bool UsesAmmo( Class<Ammo> kind )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
for ( int i=0; i<7; i++ ) if ( kind is types[i] ) return true;
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
for ( int i=0; i<6; i++ ) if ( kind is types[i] ) return true;
return false;
}
action void A_SelectUnloadState()
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const statelabel primedstates[] = {"UnloadRed", "UnloadGreen", "UnloadWhite", "UnloadBlue", "UnloadBlack", "UnloadPurple", "UnloadGold"};
static const statelabel firedstates[] = {"UnloadRedFired", "UnloadGreenFired", "UnloadWhiteFired", "UnloadBlueFired", "UnloadBlackFired", "UnloadPurpleFired", "UnloadGoldFired"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
static const statelabel primedstates[] = {"UnloadRed", "UnloadGreen", "UnloadBlue", "UnloadPurple", "UnloadBlack", "UnloadGold"};
static const statelabel firedstates[] = {"UnloadRedFired", "UnloadGreenFired", "UnloadBlueFired", "UnloadPurpleFired", "UnloadBlackFired", "UnloadGoldFired"};
int amidx = 0;
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
if ( invoker.loadammo != types[i] ) continue;
amidx = i;
@ -249,11 +201,11 @@ Class Spreadgun : SWWMWeapon
action void A_SelectLoadState()
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const statelabel primedstates[] = {"LoadRed", "LoadGreen", "LoadWhite", "LoadBlue", "LoadBlack", "LoadPurple", "LoadGold"};
static const statelabel firedstates[] = {"LoadRedFired", "LoadGreenFired", "LoadWhiteFired", "LoadBlueFired", "LoadBlackFired", "LoadPurpleFired", "LoadGoldFired"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
static const statelabel primedstates[] = {"LoadRed", "LoadGreen", "LoadBlue", "LoadPurple", "LoadBlack", "LoadGold"};
static const statelabel firedstates[] = {"LoadRedFired", "LoadGreenFired", "LoadBlueFired", "LoadPurpleFired", "LoadBlackFired", "LoadGoldFired"};
int amidx = 0;
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
if ( invoker.nextammo != types[i] ) continue;
amidx = i;
@ -278,11 +230,11 @@ Class Spreadgun : SWWMWeapon
action void A_DropShell()
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const Class<Actor> casetypes[] = {"RedShellCasing","GreenShellCasing","WhiteShellCasing","BlueShellCasing","BlackShellCasing","PurpleShellCasing","GoldShellCasing"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
static const Class<Actor> casetypes[] = {"RedShellCasing","GreenShellCasing","BlueShellCasing","PurpleShellCasing","BlackShellCasing","GoldShellCasing"};
if ( !invoker.fired )
{
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
if ( invoker.loadammo != types[i] ) continue;
let amo = FindInventory(types[i]);
@ -300,7 +252,7 @@ Class Spreadgun : SWWMWeapon
}
else
{
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
if ( invoker.loadammo != types[i] ) continue;
Vector3 x, y, z;
@ -394,13 +346,13 @@ Class Spreadgun : SWWMWeapon
action void A_FireShell()
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const statelabel flashes[] = {"FlashRed","FlashGreen","FlashWhite","FlashBlue","FlashBlack","FlashPurple","FlashGold"};
static const String sounds[] = {"spreadgun/redfire","spreadgun/greenfire","spreadgun/whitefire","spreadgun/bluefire","spreadgun/blackfire","spreadgun/purplefire","spreadgun/goldfire"};
static const int louds[] = {800,1000,1100,1200,1400,600,2500};
static const int quakes[] = {3,4,2,4,3,1,6};
static const Color cols[] = {Color(40,255,192,64),Color(36,255,192,80),Color(64,255,160,32),Color(48,32,176,255),Color(72,255,128,16),Color(24,255,224,96),Color(96,255,224,16)};
for ( int i=0; i<7; i++ )
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
static const statelabel flashes[] = {"FlashRed","FlashGreen","FlashBlue","FlashPurple","FlashBlack","FlashGold"};
static const String sounds[] = {"spreadgun/redfire","spreadgun/greenfire","spreadgun/bluefire","spreadgun/purplefire","spreadgun/blackfire","spreadgun/goldfire"};
static const int louds[] = {800,1000,1200,600,1400,2500};
static const int quakes[] = {3,4,4,1,3,6};
static const Color cols[] = {Color(40,255,192,64),Color(36,255,192,80),Color(48,32,176,255),Color(24,255,224,96),Color(72,255,128,16),Color(96,255,224,16)};
for ( int i=0; i<6; i++ )
{
if ( invoker.loadammo != types[i] ) continue;
A_SWWMFlash(flashes[i]);
@ -451,35 +403,6 @@ Class Spreadgun : SWWMWeapon
SWWMUtility.DoKnockback(self,-x,25000.);
break;
case 2:
for ( int j=0; j<3; j++ )
{
a = FRandom[Spreadgun](0,360);
s = FRandom[Spreadgun](0,.24);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
let p = Spawn("DragonBreathArm",origin);
p.target = self;
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
}
for ( int i=0; i<15; i++ )
{
let s = Spawn("SWWMSmoke",origin);
s.special1 = 1;
s.scale *= .9;
s.alpha *= .3;
s.SetShade(Color(1,1,1)*Random[Spreadgun](96,192));
s.vel += vel*.5+x*FRandom[Spreadgun](3.,5.)+y*FRandom[Spreadgun](-1,1)+z*FRandom[Spreadgun](-1,1);
}
for ( int i=0; i<12; i++ )
{
let s = Spawn("SWWMSpark",origin);
s.scale *= .3;
s.alpha *= .4;
s.vel += vel*.5+x*FRandom[Spreadgun](4.,8.)+y*FRandom[Spreadgun](-2,2)+z*FRandom[Spreadgun](-2,2);
}
SWWMUtility.DoKnockback(self,-x,13000.);
break;
case 3:
for ( int j=0; j<8; j++ )
{
a = FRandom[Spreadgun](0,360);
@ -507,6 +430,32 @@ Class Spreadgun : SWWMWeapon
}
SWWMUtility.DoKnockback(self,-x,23000.);
break;
case 3:
a = FRandom[Spreadgun](0,360);
s = FRandom[Spreadgun](0,.03);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
let b = Spawn("TheBall",origin);
b.target = self;
b.angle = atan2(dir.y,dir.x);
b.pitch = asin(-dir.z);
b.vel = dir*b.speed;
for ( int i=0; i<8; i++ )
{
let s = Spawn("SWWMSmoke",origin);
s.scale *= .6;
s.alpha *= .25;
s.SetShade(Color(1,1,1)*Random[Spreadgun](96,192));
s.vel += vel*.5+x*FRandom[Spreadgun](3.,5.);
}
for ( int i=0; i<8; i++ )
{
let s = Spawn("SWWMSpark",origin);
s.scale *= .2;
s.alpha *= .4;
s.vel += vel*.5+x*FRandom[Spreadgun](4.,8.)+y*FRandom[Spreadgun](-1,1)+z*FRandom[Spreadgun](-1,1);
}
SWWMUtility.DoKnockback(self,-x,9500.);
break;
case 4:
for ( int j=0; j<50; j++ )
{
@ -537,32 +486,6 @@ Class Spreadgun : SWWMWeapon
SWWMUtility.DoKnockback(self,-x,15000.);
break;
case 5:
a = FRandom[Spreadgun](0,360);
s = FRandom[Spreadgun](0,.03);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
let b = Spawn("TheBall",origin);
b.target = self;
b.angle = atan2(dir.y,dir.x);
b.pitch = asin(-dir.z);
b.vel = dir*b.speed;
for ( int i=0; i<8; i++ )
{
let s = Spawn("SWWMSmoke",origin);
s.scale *= .6;
s.alpha *= .25;
s.SetShade(Color(1,1,1)*Random[Spreadgun](96,192));
s.vel += vel*.5+x*FRandom[Spreadgun](3.,5.);
}
for ( int i=0; i<8; i++ )
{
let s = Spawn("SWWMSpark",origin);
s.scale *= .2;
s.alpha *= .4;
s.vel += vel*.5+x*FRandom[Spreadgun](4.,8.)+y*FRandom[Spreadgun](-1,1)+z*FRandom[Spreadgun](-1,1);
}
SWWMUtility.DoKnockback(self,-x,9500.);
break;
case 6:
a = FRandom[Spreadgun](0,360);
s = FRandom[Spreadgun](0,.01);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
@ -703,7 +626,7 @@ Class Spreadgun : SWWMWeapon
override void AttachToOwner( Actor other )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
if ( !initialized )
{
initialized = true;
@ -711,7 +634,7 @@ Class Spreadgun : SWWMWeapon
fired = false;
chambered = true;
}
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
Ammo a = Ammo(other.FindInventory(types[i]));
if ( !a ) continue;
@ -725,9 +648,9 @@ Class Spreadgun : SWWMWeapon
action void A_SwitchAmmoType( bool rev = false )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
int cur = 0, next = 0;
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
if ( invoker.nextammo != types[i] ) continue;
cur = i;
@ -746,7 +669,7 @@ Class Spreadgun : SWWMWeapon
if ( ridx == -1 )
{
// check forwards instead, but avoid golden shells
for ( int i=0; i<6; i++ )
for ( int i=0; i<5; i++ )
{
if ( CountInv(types[i]) <= 0 ) continue;
ridx = i;
@ -757,9 +680,9 @@ Class Spreadgun : SWWMWeapon
}
else
{
for ( int i=0; i<7; i++ )
for ( int i=0; i<6; i++ )
{
ridx = (i+cur+1)%7;
ridx = (i+cur+1)%6;
if ( CountInv(types[ridx]) <= 0 ) continue;
next = ridx;
break;
@ -807,8 +730,6 @@ Class Spreadgun : SWWMWeapon
MarkSound("spreadgun/redfire2");
MarkSound("spreadgun/greenfire1");
MarkSound("spreadgun/greenfire2");
MarkSound("spreadgun/whitefire1");
MarkSound("spreadgun/whitefire2");
MarkSound("spreadgun/bluefire1");
MarkSound("spreadgun/bluefire2");
MarkSound("spreadgun/blackfire1");
@ -1002,12 +923,6 @@ Class Spreadgun : SWWMWeapon
XZW4 MNOPQRSTUVWXYZ 1;
XZW9 T 1;
Goto Reload2;
UnloadWhiteFired:
XZW2 Z 2;
XZW5 ABCD 2;
XZW5 EFGHIJKLMNOPQR 1;
XZWB A 1;
Goto Reload2;
UnloadBlueFired:
XZW2 Z 2;
XZW5 STUV 2;
@ -1048,13 +963,6 @@ Class Spreadgun : SWWMWeapon
XZWL FGHIJKLMNOPQRS 1;
XZWQ M 1;
Goto Reload2;
UnloadWhite:
XZW2 A 2;
XZWL TUVW 2;
XZWL XYZ 1;
XZWM ABCDEFGHIJK 1;
XZWR T 1;
Goto Reload2;
UnloadBlue:
XZW2 A 2;
XZWM LMNO 2;
@ -1111,10 +1019,6 @@ Class Spreadgun : SWWMWeapon
XZW9 TUVWXYZ 1;
XZWA ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
Goto Ready;
LoadWhiteFired:
XZWB ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
XZWC ABCDEFG 1;
Goto Ready;
LoadBlueFired:
XZWC HIJKLMNOPQRSTUVWXYZ 1;
XZWD ABCDEFGHIJKLMN 1;
@ -1140,10 +1044,6 @@ Class Spreadgun : SWWMWeapon
XZWQ MNOPQRSTUVWXYZ 1;
XZWR ABCDEFGHIJKLMNOPQRS 1;
Goto Ready;
LoadWhite:
XZWR TUVWXYZ 1;
XZWS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
Goto Ready;
LoadBlue:
XZWT ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
XZWU ABCDEFG 1;
@ -1247,16 +1147,6 @@ Class Spreadgun : SWWMWeapon
l.target = self;
}
Stop;
FlashWhite:
XZW0 C 2 Bright
{
let l = Spawn("SWWMWeaponLight",pos);
l.args[1] = 176;
l.args[2] = 32;
l.args[3] = 160;
l.target = self;
}
Stop;
FlashBlue:
XZW0 D 2 Bright
{

View file

@ -13,7 +13,6 @@ Class RedShellCasing : SWWMCasing
}
}
Class GreenShellCasing : RedShellCasing {}
Class WhiteShellCasing : RedShellCasing {}
Class BlueShellCasing : RedShellCasing {}
Class BlackShellCasing : RedShellCasing {}
Class PurpleShellCasing : RedShellCasing {}
@ -117,184 +116,6 @@ Class SlugImpact : Actor
}
}
Class DragonBreathPuff : Actor
{
Vector2 initsc;
Default
{
RenderStyle "Add";
Scale 0.5;
Alpha 0.35;
Radius .1;
Height 0;
+NOGRAVITY;
+NOBLOCKMAP;
+DONTSPLASH;
+NOINTERACTION;
+NOTELEPORT;
+ROLLSPRITE;
+ROLLCENTER;
+FORCEXYBILLBOARD;
}
override void PostBeginPlay()
{
scale *= FRandom[Spreadgun](.8,1.);
alpha *= FRandom[Spreadgun](.8,1.);
roll = FRandom[Spreadgun](0,360);
SetState(FindState("Spawn")+Random[Spreadgun](0,19));
initsc = scale;
}
override void Tick()
{
if ( isFrozen() ) return;
A_FadeOut((waterlevel>0)?.1:.02);
scale += initsc*.2;
}
States
{
Spawn:
XFLM ABCDEFGHIJKLMNOPQRST -1 Bright;
Stop;
}
}
Class DragonBreathArm : Actor
{
Vector3 oldvel;
Default
{
Obituary "$O_SPREADGUN_WHITE";
DamageType 'Fire';
PROJECTILE;
+THRUACTORS;
+BOUNCEONWALLS;
+BOUNCEONFLOORS;
+BOUNCEONCEILINGS;
+CANBOUNCEWATER;
+USEBOUNCESTATE;
+NODAMAGETHRUST;
+FORCERADIUSDMG;
-NOGRAVITY;
Gravity 0.15;
BounceFactor 1.0;
Radius 2;
Height 4;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
reactiontime = Random[ExploS](18,24);
vel = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch))*FRandom[ExploS](16.,32.);
let l = Spawn("PaletteLight",pos);
l.Args[3] = int(60+60*(ReactionTime/20.));
l.ReactionTime = ReactionTime+2;
l.target = self;
}
override void Tick()
{
oldvel = vel;
Super.Tick();
}
void A_HandleBounce()
{
Vector3 HitNormal = -vel.unit();
F3DFloor ff;
if ( BlockingFloor )
{
// find closest 3d floor for its normal
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
{
if ( !(BlockingFloor.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
ff = BlockingFloor.Get3DFloor(i);
break;
}
if ( ff ) HitNormal = -ff.top.Normal;
else HitNormal = BlockingFloor.floorplane.Normal;
}
else if ( BlockingCeiling )
{
// find closest 3d floor for its normal
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
{
if ( !(BlockingCeiling.Get3DFloor(i).flags&F3DFloor.FF_SOLID) ) continue;
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
ff = BlockingCeiling.Get3DFloor(i);
break;
}
if ( ff ) HitNormal = -ff.bottom.Normal;
else HitNormal = BlockingCeiling.ceilingplane.Normal;
}
else if ( BlockingLine )
{
HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
if ( !SWWMUtility.PointOnLineSide(pos.xy,BlockingLine) )
HitNormal *= -1;
}
else if ( BlockingMobj )
{
Vector3 diff = level.Vec3Diff(pos,BlockingMobj.pos);
if ( (pos.x+radius) <= (BlockingMobj.pos.x-BlockingMobj.radius) )
HitNormal = (-1,0,0);
else if ( (pos.x-radius) >= (BlockingMobj.pos.x+BlockingMobj.radius) )
HitNormal = (1,0,0);
else if ( (pos.y+radius) <= (BlockingMobj.pos.y-BlockingMobj.radius) )
HitNormal = (0,-1,0);
else if ( (pos.y-radius) >= (BlockingMobj.pos.y+BlockingMobj.radius) )
HitNormal = (0,1,0);
else if ( pos.z >= (BlockingMobj.pos.z+BlockingMobj.height) )
HitNormal = (0,0,1);
else if ( (pos.z+height) <= BlockingMobj.pos.z )
HitNormal = (0,0,-1);
}
// undo the bounce, we need to hook in our own
vel = oldvel;
// re-do the bounce with our formula
vel = .8*((vel dot HitNormal)*HitNormal*(-1.8+FRandom[Spreadgun](.0,.6))+vel);
bHITOWNER = true;
}
States
{
Spawn:
TNT1 A 1
{
if ( waterlevel > 0 ) ReactionTime -= 2;
let p = Spawn("DragonBreathPuff",pos);
p.alpha *= .6+.4*(ReactionTime/20.);
p.scale *= 3.5-2.5*(ReactionTime/20.);
SWWMUtility.DoExplosion(self,6+(reactiontime/2),1000+200*reactiontime,90+5*reactiontime,flags:DE_HOWL,ignoreme:bHITOWNER?null:target);
double spd = vel.length();
vel = (vel*.4+(FRandom[ExploS](-.2,.2),FRandom[ExploS](-.2,.2),FRandom[ExploS](-.2,.2))).unit()*spd;
Vector3 pvel = (FRandom[ExploS](-1,1),FRandom[ExploS](-1,1),FRandom[ExploS](-1,1)).unit()*FRandom[ExploS](1,5);
if ( !(ReactionTime%2) )
{
let s = Spawn("SWWMHalfSmoke",pos);
s.vel = pvel+vel*.2;
s.SetShade(Color(1,1,1)*Random[ExploS](96,192));
s.special1 = Random[ExploS](2,4);
s.scale *= 2.4;
s.alpha *= .1+.2*(ReactionTime/20.);
int numpt = Random[Spreadgun](-2,4);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = vel+(FRandom[Spreadgun](-1,1),FRandom[Spreadgun](-1,1),FRandom[Spreadgun](-1,1)).unit()*FRandom[Spreadgun](2,4);
let s2 = Spawn("SWWMSpark",pos);
s2.scale *= .4;
s2.vel = pvel;
}
}
A_CountDown();
}
Wait;
Bounce:
TNT1 A 0 A_HandleBounce();
Goto Spawn;
}
}
Class SaltTracer : LineTracer
{
Actor ignore;

View file

@ -9,41 +9,9 @@ Class Sparkster : SWWMWeapon
Property ClipCount : clipcount;
transient ui TextureID WeaponBox, AmmoBar[6];
transient ui DynamicValueInterpolator iclip;
transient int failtime;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/BiosparkDisplay.png",TexMan.Type_Any);
AmmoBar[0] = TexMan.CheckForTexture("graphics/HUD/BiosparkBar.png",TexMan.Type_Any);
AmmoBar[1] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarRed.png",TexMan.Type_Any);
AmmoBar[2] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarGray.png",TexMan.Type_Any);
AmmoBar[3] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlim.png",TexMan.Type_Any);
AmmoBar[4] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlimRed.png",TexMan.Type_Any);
AmmoBar[5] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlimGray.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-28,by-28,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-26,by-25,String.Format("%2d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( nomag ) return;
bool blinking = (failtime>gametic)&&((failtime-gametic)%16>=8);
if ( doublestacc )
{
Screen.DrawTexture(AmmoBar[5],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[5],false,bx-14,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[3+(clipcount<2)],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(iclip.GetValue()/10.):0.,DTA_ColorOverlay,(blinking&&(clipcount<=4))?Color(128,0,0,0):Color(0,0,0,0));
if ( (iclip && (iclip.GetValue() > 120)) || (!iclip && (clipcount > 4)) )
Screen.DrawTexture(AmmoBar[3+(clipcount<6)],false,bx-14,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(((iclip.GetValue()/10.))-12.):0.,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
else
{
Screen.DrawTexture(AmmoBar[2],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[clipcount<2],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(iclip.GetValue()/5.):0.,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
}
override void HudTick()
{
Super.HudTick();

View file

@ -8,19 +8,10 @@ Class ExplodiumGun : SWWMWeapon
bool preinit;
bool firstselect;
double casex, casey;
transient ui TextureID WeaponBox;
int deadeyecnt;
Property ClipCount : ClipCount;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-24,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
override void HudTick()
{
if ( !Owner ) return;
@ -586,20 +577,9 @@ Class DualExplodiumGun : SWWMWeapon
int clipcount;
bool chambered;
double casex, casey, lcasex, lcasey;
transient ui TextureID WeaponBox;
Property ClipCount : ClipCount;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DualExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-48,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( ExplodiumGun(SisterWeapon).chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(ExplodiumGun(SisterWeapon).clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-46,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-43,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
override void RenderUnderlay( RenderEvent e )
{
Super.RenderUnderlay(e);

View file

@ -6,7 +6,6 @@ Class CandyGun : SWWMWeapon
int clipcount;
bool chambered;
double casex, casey;
transient ui TextureID WeaponBox;
bool tospecial;
bool swapdrop; // used by weapon swapping so CreateTossable actually tosses the gun, rather than spares
@ -86,25 +85,6 @@ Class CandyGun : SWWMWeapon
return gotstuff, gotspares;
}
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( Amount <= 0 ) return;
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/CandygunDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-51,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int cx = (Ammo1.Amount>9)?48:45;
int sb = Owner.CountInv("CandyGunBullets");
if ( sb > 0 )
{
int cbx = (sb>9)?50:47;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-17,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-37,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
override Vector3 GetTraceOffset()
{
return (10.,3,-2.);

View file

@ -224,7 +224,6 @@ Class SilverBullet : SWWMWeapon
double casex, casey;
int nkills;
transient ui TextureID WeaponBox[2], ZoomBar, BulletIcon[2], AmmoIcon[2];
transient ui DynamicValueInterpolator ZoomInter;
bool zoomed;
@ -245,47 +244,6 @@ Class SilverBullet : SWWMWeapon
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox[0] ) WeaponBox[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletDisplay.png",TexMan.Type_Any);
if ( !WeaponBox[1] ) WeaponBox[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomDisplay.png",TexMan.Type_Any);
if ( !BulletIcon[0] ) BulletIcon[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletXSB.png",TexMan.Type_Any);
if ( !BulletIcon[1] ) BulletIcon[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletFCB.png",TexMan.Type_Any);
if ( !AmmoIcon[0] ) AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletXSBMag.png",TexMan.Type_Any);
if ( !AmmoIcon[1] ) AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletFCBMag.png",TexMan.Type_Any);
if ( !ZoomBar ) ZoomBar = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomBar.png",TexMan.Type_Any);
int zl = clamp(ZoomInter?ZoomInter.GetValue():int(zoomlevel*10),0,160);
if ( zl >= 10 )
{
Screen.DrawTexture(WeaponBox[1],false,bx-35,by-56,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double zw = zl*31./160.;
Screen.DrawTexture(ZoomBar,false,bx-33,by-54,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,zw);
}
Screen.DrawTexture(WeaponBox[0],false,bx-55,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(BulletIcon[fcbchambered],false,bx-53,by-30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fired?Color(128,0,0,0):Color(0,0,0,0));
for ( int i=0; i<ClipCount; i++ )
Screen.DrawTexture(BulletIcon[fcbloaded],false,bx-53,(by-22)+i*4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoIcon[0],false,bx-18,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawTexture(AmmoIcon[1],false,bx-18,by-41,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
int cx = (Ammo1.Amount>9)?32:29;
int sb = Owner.CountInv("SilverBullets");
if ( sb > 0 )
{
int cbx = (sb>9)?34:30;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
cx = (Ammo2.Amount>9)?32:29;
sb = Owner.CountInv("SilverBullets2");
if ( sb > 0 )
{
int cbx = (sb>9)?34:30;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-42,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-35,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
}
override void HudTick()
{
Super.HudTick();

View file

@ -0,0 +1,439 @@
// DrawWeapon code for all weapons
// Deep Impact
extend Class DeepImpact
{
ui TextureID WeaponBox, AmmoBar;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DeepImpactDisplay.png",TexMan.Type_Any);
if ( !AmmoBar ) AmmoBar = TexMan.CheckForTexture("graphics/HUD/DeepImpactBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-36,by-54,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():clipcount,0,100);
int ct = int(((by-2)-(chg*50./100.))*hs);
bool blinking = (failtime>gametic)&&((failtime-gametic)%8>=4);
Screen.DrawTexture(AmmoBar,false,bx-7,by-52,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
}
// Pusher
extend Class PusherWeapon
{
ui TextureID WeaponBox, ChargeBar;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/PusherDisplay.png",TexMan.Type_Any);
if ( !ChargeBar ) ChargeBar = TexMan.CheckForTexture("graphics/HUD/PusherBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-60,by-9,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*100),0,100);
double cw = chg*56./100.;
Screen.DrawTexture(ChargeBar,false,bx-58,by-7,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,cw);
}
}
// Explodium Gun
extend Class ExplodiumGun
{
ui TextureID WeaponBox;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-24,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
extend Class DualExplodiumGun
{
ui TextureID WeaponBox;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DualExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-48,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( ExplodiumGun(SisterWeapon).chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(ExplodiumGun(SisterWeapon).clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-46,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-43,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Spreadgun
extend Class Spreadgun
{
ui TextureID WeaponBox, AmmoIcon[6], LoadedIcon[6];
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell","BlackShell","GoldShell"};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/SpreadgunDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/RedShell.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/GreenShell.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/BlueShell.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/PurpleShell.png",TexMan.Type_Any);
AmmoIcon[4] = TexMan.CheckForTexture("graphics/HUD/BlackShell.png",TexMan.Type_Any);
AmmoIcon[5] = TexMan.CheckForTexture("graphics/HUD/GoldShell.png",TexMan.Type_Any);
LoadedIcon[0] = TexMan.CheckForTexture("graphics/HUD/LoadedRedShell.png",TexMan.Type_Any);
LoadedIcon[1] = TexMan.CheckForTexture("graphics/HUD/LoadedGreenShell.png",TexMan.Type_Any);
LoadedIcon[2] = TexMan.CheckForTexture("graphics/HUD/LoadedBlueShell.png",TexMan.Type_Any);
LoadedIcon[3] = TexMan.CheckForTexture("graphics/HUD/LoadedPurpleShell.png",TexMan.Type_Any);
LoadedIcon[4] = TexMan.CheckForTexture("graphics/HUD/LoadedBlackShell.png",TexMan.Type_Any);
LoadedIcon[5] = TexMan.CheckForTexture("graphics/HUD/LoadedGoldShell.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-46,by-63,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int ox = 6;
int oy = 11;
for ( int i=0; i<6; i++ )
{
Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
String astr = String.Format("%3d",Owner.CountInv(types[i]));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
oy += 10;
}
if ( !chambered ) return;
for ( int i=0; i<6; i++ )
{
if ( loadammo != types[i] ) continue;
Screen.DrawTexture(LoadedIcon[i],false,bx-44,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fired?Color(128,0,0,0):Color(0,0,0,0));
break;
}
}
}
// Wallbuster (oh good lord why)
extend Class Wallbuster
{
ui TextureID WeaponBox, AmmoIcon[4], LoadIcon[4], UsedIcon[4], EmptyIcon;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell"};
/*
(Layout of indices)
0
4 1
3 2
L 9
K M 8 5
O N 7 6
H D
G I C E
F J B A
*/
static const int barrelposx[] =
{
29,24,26,32,34,
10,12,18,20,15,
17,23,25,20,15,
41,43,38,33,35,
48,43,38,40,46
};
static const int barrelposy[] =
{
46,42,36,36,42,
31,25,25,31,35,
8, 8,14,18,14,
8,14,18,14, 8,
31,35,31,25,25
};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/WallbusterDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/RedShell.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/GreenShell.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/BlueShell.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/PurpleShell.png",TexMan.Type_Any);
LoadIcon[0] = TexMan.CheckForTexture("graphics/HUD/WallbusterRed.png",TexMan.Type_Any);
LoadIcon[1] = TexMan.CheckForTexture("graphics/HUD/WallbusterGreen.png",TexMan.Type_Any);
LoadIcon[2] = TexMan.CheckForTexture("graphics/HUD/WallbusterBlue.png",TexMan.Type_Any);
LoadIcon[3] = TexMan.CheckForTexture("graphics/HUD/WallbusterPurple.png",TexMan.Type_Any);
UsedIcon[0] = TexMan.CheckForTexture("graphics/HUD/WallbusterRedUsed.png",TexMan.Type_Any);
UsedIcon[1] = TexMan.CheckForTexture("graphics/HUD/WallbusterGreenUsed.png",TexMan.Type_Any);
UsedIcon[2] = TexMan.CheckForTexture("graphics/HUD/WallbusterBlueUsed.png",TexMan.Type_Any);
UsedIcon[3] = TexMan.CheckForTexture("graphics/HUD/WallbusterPurpleUsed.png",TexMan.Type_Any);
EmptyIcon = TexMan.CheckForTexture("graphics/HUD/WallbusterEmpty.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-54,by-72,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int ox = 6;
int oy = 60;
for ( int i=0; i<4; i++ )
{
Screen.DrawTexture(AmmoIcon[i],false,bx-ox,by-oy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String astr = String.Format("%3d",Owner.CountInv(types[i]));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-ox-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-oy-1,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
oy += 10;
if ( i == 1 )
{
oy = 60;
ox = 33;
}
}
// and here's the big clusterdick
for ( int i=0; i<25; i++ )
{
int idx = i;
int group = idx/5;
// shift based on group rotation
int gidx = i%5;
gidx = (gidx-rotation[group]);
while ( gidx < 0 ) gidx += 5;
idx = gidx+group*5;
// shift based on full rotation
idx = (idx-rotation[5]*5);
while ( idx < 0 ) idx += 25;
if ( !loaded[i] )
{
Screen.DrawTexture(EmptyIcon,false,bx-barrelposx[idx],by-barrelposy[idx],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
continue;
}
int which = 0;
for ( int j=0; j<4; j++ )
{
if ( !(loaded[i] is types[j]) ) continue;
which = j;
break;
}
Screen.DrawTexture(fired[i]?UsedIcon[which]:LoadIcon[which],false,bx-barrelposx[idx],by-barrelposy[idx],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
}
// Eviscerator
extend Class Eviscerator
{
ui TextureID WeaponBox, AmmoIcon;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/EvisceratorDisplay.png",TexMan.Type_Any);
if ( !AmmoIcon ) AmmoIcon = TexMan.CheckForTexture("graphics/HUD/EvisceratorShell.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-46,by-16,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String astr = String.Format("%d",Ammo1.Amount);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-14-(SWWMStatusBar(StatusBar).mSmallFont.StringWidth(astr)+1),by-14,astr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoIcon,false,bx-14,by-14,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,chambered?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_WHITE,bx-44,by-14,extended?"►":"",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Hellblazer
extend Class Hellblazer
{
ui TextureID WeaponBox, AmmoIcon[4], LoadedIcon[4];
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"HellblazerMissiles","HellblazerCrackshots","HellblazerRavagers","HellblazerWarheads"};
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/HellblazerDisplay.png",TexMan.Type_Any);
AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/HellblazerMissile.png",TexMan.Type_Any);
AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/HellblazerCrackshot.png",TexMan.Type_Any);
AmmoIcon[2] = TexMan.CheckForTexture("graphics/HUD/HellblazerRavager.png",TexMan.Type_Any);
AmmoIcon[3] = TexMan.CheckForTexture("graphics/HUD/HellblazerWarhead.png",TexMan.Type_Any);
LoadedIcon[0] = TexMan.CheckForTexture("graphics/HUD/HellblazerMissileLoaded.png",TexMan.Type_Any);
LoadedIcon[1] = TexMan.CheckForTexture("graphics/HUD/HellblazerCrackshotLoaded.png",TexMan.Type_Any);
LoadedIcon[2] = TexMan.CheckForTexture("graphics/HUD/HellblazerRavagerLoaded.png",TexMan.Type_Any);
LoadedIcon[3] = TexMan.CheckForTexture("graphics/HUD/HellblazerWarheadLoaded.png",TexMan.Type_Any);
}
double xx = -56, yy = -49;
Screen.DrawTexture(WeaponBox,false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int curtype = 0;
for ( int i=0; i<4; i++ )
{
if ( loadammo != types[i] ) continue;
curtype = i;
break;
}
xx += 2;
yy += 2;
for ( int i=0; i<4; i++ )
{
int amt = Owner.CountInv(types[i]);
String amtstr = String.Format("%3d",amt);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx+xx,by+yy,amtstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(AmmoIcon[i],false,bx+xx+19,by+yy+1,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(types[i]==nextammo)?Color(0,0,0,0):Color(128,0,0,0));
yy += 13;
if ( i%2 )
{
yy -= 26;
xx += 28;
}
}
yy = -18;
switch ( curtype )
{
case 0:
xx = -54;
for ( int i=0; i<6; i++ )
{
Screen.DrawTexture(LoadedIcon[0],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 9;
}
break;
case 1:
xx = -49;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(LoadedIcon[1],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 18;
}
break;
case 2:
xx = -49;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(LoadedIcon[2],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 18;
}
break;
case 3:
xx = -45;
for ( int i=0; i<2; i++ )
{
Screen.DrawTexture(LoadedIcon[3],false,bx+xx,by+yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(192,0,0,0):Color(0,0,0,0):magstate[i]?Color(224,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
xx += 27;
}
break;
}
}
}
// Biospark Carbine
extend Class Sparkster
{
ui TextureID WeaponBox, AmmoBar[6];
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox )
{
WeaponBox = TexMan.CheckForTexture("graphics/HUD/BiosparkDisplay.png",TexMan.Type_Any);
AmmoBar[0] = TexMan.CheckForTexture("graphics/HUD/BiosparkBar.png",TexMan.Type_Any);
AmmoBar[1] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarRed.png",TexMan.Type_Any);
AmmoBar[2] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarGray.png",TexMan.Type_Any);
AmmoBar[3] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlim.png",TexMan.Type_Any);
AmmoBar[4] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlimRed.png",TexMan.Type_Any);
AmmoBar[5] = TexMan.CheckForTexture("graphics/HUD/BiosparkBarSlimGray.png",TexMan.Type_Any);
}
Screen.DrawTexture(WeaponBox,false,bx-28,by-28,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-26,by-25,String.Format("%2d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( nomag ) return;
bool blinking = (failtime>gametic)&&((failtime-gametic)%16>=8);
if ( doublestacc )
{
Screen.DrawTexture(AmmoBar[5],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[5],false,bx-14,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[3+(clipcount<2)],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(iclip.GetValue()/10.):0.,DTA_ColorOverlay,(blinking&&(clipcount<=4))?Color(128,0,0,0):Color(0,0,0,0));
if ( (iclip && (iclip.GetValue() > 120)) || (!iclip && (clipcount > 4)) )
Screen.DrawTexture(AmmoBar[3+(clipcount<6)],false,bx-14,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(((iclip.GetValue()/10.))-12.):0.,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
else
{
Screen.DrawTexture(AmmoBar[2],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoBar[clipcount<2],false,bx-26,by-8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,iclip?(iclip.GetValue()/5.):0.,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
}
}
// Silver Bullet JET
extend Class SilverBullet
{
ui TextureID WeaponBox[2], ZoomBar, BulletIcon[2], AmmoIcon[2];
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox[0] ) WeaponBox[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletDisplay.png",TexMan.Type_Any);
if ( !WeaponBox[1] ) WeaponBox[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomDisplay.png",TexMan.Type_Any);
if ( !BulletIcon[0] ) BulletIcon[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletXSB.png",TexMan.Type_Any);
if ( !BulletIcon[1] ) BulletIcon[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletFCB.png",TexMan.Type_Any);
if ( !AmmoIcon[0] ) AmmoIcon[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletXSBMag.png",TexMan.Type_Any);
if ( !AmmoIcon[1] ) AmmoIcon[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletFCBMag.png",TexMan.Type_Any);
if ( !ZoomBar ) ZoomBar = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomBar.png",TexMan.Type_Any);
int zl = clamp(ZoomInter?ZoomInter.GetValue():int(zoomlevel*10),0,160);
if ( zl >= 10 )
{
Screen.DrawTexture(WeaponBox[1],false,bx-35,by-56,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double zw = zl*31./160.;
Screen.DrawTexture(ZoomBar,false,bx-33,by-54,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,zw);
}
Screen.DrawTexture(WeaponBox[0],false,bx-55,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(BulletIcon[fcbchambered],false,bx-53,by-30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fired?Color(128,0,0,0):Color(0,0,0,0));
for ( int i=0; i<ClipCount; i++ )
Screen.DrawTexture(BulletIcon[fcbloaded],false,bx-53,(by-22)+i*4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AmmoIcon[0],false,bx-18,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawTexture(AmmoIcon[1],false,bx-18,by-41,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
int cx = (Ammo1.Amount>9)?32:29;
int sb = Owner.CountInv("SilverBullets");
if ( sb > 0 )
{
int cbx = (sb>9)?34:30;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(128,0,0,0):Color(0,0,0,0));
cx = (Ammo2.Amount>9)?32:29;
sb = Owner.CountInv("SilverBullets2");
if ( sb > 0 )
{
int cbx = (sb>9)?34:30;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-42,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-35,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,fcbselected?Color(0,0,0,0):Color(128,0,0,0));
}
}
// Candy Gun
extend Class CandyGun
{
ui TextureID WeaponBox;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( Amount <= 0 ) return;
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/CandygunDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-51,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-22,by-20,"⁺¹",DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-19,by-13,String.Format("%d",max(clipcount,0)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int cx = (Ammo1.Amount>9)?48:45;
int sb = Owner.CountInv("CandyGunBullets");
if ( sb > 0 )
{
int cbx = (sb>9)?50:47;
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cbx,by-20,String.Format("⁺%s",SWWMUtility.SuperscriptNum(sb)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Spacing,-1);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-13,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
else Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-cx,by-17,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-37,by-39,String.Format("%d",Ammo2.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Ynykron
extend Class Ynykron
{
ui TextureID WeaponBox, ChargeBar[2], BoxSide[2];
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/YnykronDisplay.png",TexMan.Type_Any);
if ( !ChargeBar[0] ) ChargeBar[0] = TexMan.CheckForTexture("graphics/HUD/YnykronBarA.png",TexMan.Type_Any);
if ( !ChargeBar[1] ) ChargeBar[1] = TexMan.CheckForTexture("graphics/HUD/YnykronBarB.png",TexMan.Type_Any);
if ( !BoxSide[0] ) BoxSide[0] = TexMan.CheckForTexture("graphics/HUD/YnykronSideA.png",TexMan.Type_Any);
if ( !BoxSide[1] ) BoxSide[1] = TexMan.CheckForTexture("graphics/HUD/YnykronSideB.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-33,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*10),0,400);
int ct = int(((by-2)-chg/10.)*hs);
Screen.DrawText(SWWMStatusBar(StatusBar).mSmallFont,Font.CR_FIRE,bx-30,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(BoxSide[inverted],false,bx-23,by-31,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,clipcount?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(ChargeBar[inverted],false,bx-6,by-42,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(chargestate==CS_READY)?Color(int(clamp(sin((level.maptime+TicFrac)*8)*40+24,0.,64.)),255,255,255):Color(0,0,0,0),DTA_ClipTop,ct);
}
}