99 lines
5.4 KiB
Text
99 lines
5.4 KiB
Text
// DrawWeapon code for DLC weapons
|
|
|
|
// Combat Hammer
|
|
extend Class ItamexHammer
|
|
{
|
|
ui TextureID WeaponBox, BarTex;
|
|
|
|
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
|
|
{
|
|
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ItamexDisplay.png",TexMan.Type_Any);
|
|
if ( !BarTex ) BarTex = TexMan.CheckForTexture("graphics/HUD/ItamexBar.png",TexMan.Type_Any);
|
|
double ct = clamp(ChargeInter?ChargeInter.GetValue(TicFrac):charge,0.,100.);
|
|
if ( ct <= 0 ) return;
|
|
double ch = ct*.2;
|
|
Screen.DrawTexture(WeaponBox,false,bx-8,by-25,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
Screen.DrawTexture(BarTex,false,bx-5,by-(2+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcHeight,ch,DTA_DestHeightF,ch,DTA_ColorOverlay,Color(255,0,0,0));
|
|
Screen.DrawTexture(BarTex,false,bx-6,by-(2+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcHeight,ch,DTA_DestHeightF,ch);
|
|
}
|
|
}
|
|
|
|
// Sheen HMG
|
|
extend Class HeavyMahSheenGun
|
|
{
|
|
ui TextureID WeaponBox, BulletTex[2], SpeedTex, BarTex;
|
|
|
|
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
|
|
{
|
|
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/SheenDisplay.png",TexMan.Type_Any);
|
|
if ( !BulletTex[0] ) BulletTex[0] = TexMan.CheckForTexture("graphics/HUD/SheenRound.png",TexMan.Type_Any);
|
|
if ( !BulletTex[1] ) BulletTex[1] = TexMan.CheckForTexture("graphics/HUD/SheenCasing.png",TexMan.Type_Any);
|
|
if ( !SpeedTex ) SpeedTex = TexMan.CheckForTexture("graphics/HUD/SheenSpeed.png",TexMan.Type_Any);
|
|
if ( !BarTex ) BarTex = TexMan.CheckForTexture("graphics/HUD/SheenBar.png",TexMan.Type_Any);
|
|
Screen.DrawTexture(WeaponBox,false,bx-23,by-24,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
if ( firespeed == 0 ) for ( int i=0; i<2; i++ ) Screen.DrawTexture(SpeedTex,false,bx-21,(by-14)+i*8,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
else if ( firespeed == 1 ) for ( int i=0; i<3; i++ ) Screen.DrawTexture(SpeedTex,false,bx-21,(by-14)+i*4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
else if ( firespeed == 2 ) for ( int i=0; i<5; i++ ) Screen.DrawTexture(SpeedTex,false,bx-21,(by-14)+i*2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
double ht = clamp(HeatInter?HeatInter.GetValue(TicFrac):barrelheat,0.,100.);
|
|
double hw = ht*.18;
|
|
bool blinking = (incooldown)&&(gametic%8>=4);
|
|
Screen.DrawTexture(BarTex,false,bx-20,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcWidth,hw,DTA_DestWidthF,hw,DTA_ColorOverlay,Color(255,0,0,0));
|
|
Screen.DrawTexture(BarTex,false,bx-21,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcWidth,hw,DTA_DestWidthF,hw,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
|
|
bool isfired = !!fired;
|
|
double firefact = 0.;
|
|
if ( firespeed == 0 )
|
|
{
|
|
isfired = isfired&&((fired+7)>=gametic);
|
|
firefact = clamp((gametic+TicFrac)-fired,0.,7.)/7.;
|
|
}
|
|
else if ( firespeed == 1 )
|
|
{
|
|
isfired = isfired&&((fired+3)>=gametic);
|
|
firefact = clamp((gametic+TicFrac)-fired,0.,3.)/3.;
|
|
}
|
|
else if ( firespeed == 2 )
|
|
{
|
|
isfired = isfired&&((fired+1)>=gametic);
|
|
firefact = TicFrac;
|
|
}
|
|
bool infammo = (sv_infiniteammo||Owner.FindInventory('PowerInfiniteAmmo',true));
|
|
if ( isfired )
|
|
{
|
|
Screen.DrawTexture(BulletTex[1],false,bx-15,(by-10)-4*firefact,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,1.-firefact);
|
|
for ( int i=0; i<2; i++ )
|
|
{
|
|
if ( !infammo && (Ammo1.Amount <= i) ) break;
|
|
Screen.DrawTexture(BulletTex[0],false,bx-15,(by-6)-4*firefact+i*4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipBottom,int((by-2)*hs),DTA_Alpha,(i==0)?1.:firefact);
|
|
}
|
|
return;
|
|
}
|
|
for ( int i=0; i<2; i++ )
|
|
{
|
|
if ( !infammo && (Ammo1.Amount <= i) ) break;
|
|
Screen.DrawTexture(BulletTex[0],false,bx-15,(by-10)+i*4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Quadravol
|
|
extend Class Quadravol
|
|
{
|
|
ui TextureID WeaponBox, BulletTex[2];
|
|
ui Font ChargeFont;
|
|
|
|
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
|
|
{
|
|
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/QuadravolDisplay.png",TexMan.Type_Any);
|
|
if ( !BulletTex[0] ) BulletTex[0] = TexMan.CheckForTexture("graphics/HUD/QuadravolRound.png",TexMan.Type_Any);
|
|
if ( !BulletTex[1] ) BulletTex[1] = TexMan.CheckForTexture("graphics/HUD/QuadravolCasing.png",TexMan.Type_Any);
|
|
if ( !ChargeFont ) ChargeFont = Font.GetFont('XekkasNum');
|
|
Screen.DrawTexture(WeaponBox,false,bx-16,by-44,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
for ( int i=0; i<clipcount; i++ )
|
|
Screen.DrawTexture(BulletTex[0],false,bx-6,by-(10+i*8),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
if ( chambered ) Screen.DrawTexture(BulletTex[charged],false,bx-14,by-10,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
Screen.DrawText(ChargeFont,Font.CR_UNTRANSLATED,bx-14,by-20,String.Format("%d",chargelevel),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
|
// PLACEHOLDER
|
|
String str = "THIS WEAPON IS NOT YET FUNCTIONAL";
|
|
Screen.DrawText(NewSmallFont,Font.CR_RED,(Screen.GetWidth()-NewSmallFont.StringWidth(str)*CleanXFac_1)/2,Screen.GetHeight()-(swwm_hudmargin*hs+NewSmallFont.GetHeight()*CleanYFac_1),str,DTA_CleanNoMove_1,true);
|
|
}
|
|
}
|