// DrawWeapon code for all weapons // Deep Impact extend Class DeepImpact { ui TextureID WeaponBox, AmmoBar; ui Font AmmoFont; override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss ) { if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DeepImpactDisplay.png"); if ( !AmmoBar ) AmmoBar = TexMan.CheckForTexture("graphics/HUD/DeepImpactBar.png"); if ( !AmmoFont ) AmmoFont = Font.GetFont("MiniHudShadow"); Screen.DrawTexture(WeaponBox,false,bx-24,by-25,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); double chg = clamp(ChargeInter?ChargeInter.GetValue(TicFrac):clipcount,0.,100.); bool blinking = (failtime>gametic)&&((failtime-gametic)%8>=4); Screen.DrawText(AmmoFont,Font.FindFontColor("MiniIce"),bx-22,by-8,String.Format("%3d",clamp(int(chg),0,100)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0)); double ch = chg*20./100.; Screen.DrawTexture(AmmoBar,false,bx-5,by-(2+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcY,20.-ch,DTA_SrcHeight,ch,DTA_DestHeightF,ch,DTA_ColorOverlay,Color(255,0,0,0)); Screen.DrawTexture(AmmoBar,false,bx-6,by-(3+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcY,20.-ch,DTA_SrcHeight,ch,DTA_DestHeightF,ch,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0)); } } // Explodium Gun extend Class ExplodiumGun { ui TextureID WeaponBox, RoundTex; override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss ) { if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ExplodiumDisplay.png"); if ( !RoundTex ) RoundTex = TexMan.CheckForTexture("graphics/HUD/ExplodiumRound.png"); Screen.DrawTexture(WeaponBox,false,bx-10,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( chambered ) Screen.DrawTexture(RoundTex,false,bx-8,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); for ( int i=0; i=(magpos-preload)))?magstate[i]?Color(128,0,0,0):Color(0,0,0,0):magstate[i]?Color(160,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0); yy -= 4; } } } // Biospark Carbine extend Class Sparkster { ui TextureID WeaponBox, RoundTex[2]; override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss ) { if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/BiosparkDisplay.png"); if ( !RoundTex[0] ) RoundTex[0] = TexMan.CheckForTexture("graphics/HUD/BiosparkShot.png"); if ( !RoundTex[1] ) RoundTex[1] = TexMan.CheckForTexture("graphics/HUD/BiosparkRed.png"); bool blinking = (failtime>gametic)&&((failtime-gametic)%16>=8); if ( doublestacc ) { Screen.DrawTexture(WeaponBox,false,bx-8,by-34,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); Screen.DrawTexture(WeaponBox,false,bx-8,by-17,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( nomag ) return; bool bRed; int yy = 32; for ( int i=0; i<8; i++ ) { if ( clipcount <= i ) Screen.DrawTexture(RoundTex[0],false,bx-6,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Desaturate,255,DTA_ColorOverlay,Color(160,0,0,0)); else { bRed = ((i>=4)&&(clipcount<6)||(i<4)&&(clipcount<2)); Screen.DrawTexture(RoundTex[bRed],false,bx-6,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(blinking?96:0,0,0,0)); } yy -= 3; if ( i == 3 ) yy -= 5; } } else { Screen.DrawTexture(WeaponBox,false,bx-8,by-17,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( nomag ) return; bool bRed; int yy = 15; for ( int i=0; i<4; i++ ) { if ( clipcount <= i ) Screen.DrawTexture(RoundTex[0],false,bx-6,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Desaturate,255,DTA_ColorOverlay,Color(160,0,0,0)); else { bRed = (clipcount<2); Screen.DrawTexture(RoundTex[bRed],false,bx-6,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(blinking?96:0,0,0,0)); } yy -= 3; } } } } // Silver Bullet JET extend Class SilverBullet { ui TextureID WeaponBox[2], ZoomBar, RoundTex[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"); if ( !WeaponBox[1] ) WeaponBox[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomDisplay.png"); if ( !ZoomBar ) ZoomBar = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomBar.png"); if ( !RoundTex[0] ) RoundTex[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletRound.png"); if ( !RoundTex[1] ) RoundTex[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletCasing.png"); double zl = clamp(ZoomInter?ZoomInter.GetValue(TicFrac):(zoomlevel*10),0.,160.); if ( zl >= 10. ) { Screen.DrawTexture(WeaponBox[1],false,bx-20,by-39,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); double zw = zl*15./160.; Screen.DrawTexture(ZoomBar,false,bx-17,by-36,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,zw,DTA_ColorOverlay,Color(255,0,0,0)); Screen.DrawTexture(ZoomBar,false,bx-18,by-37,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,zw); } Screen.DrawTexture(WeaponBox[0],false,bx-20,by-29,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); if ( chambered ) Screen.DrawTexture(RoundTex[fired],false,bx-18,by-27,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); for ( int i=0; i