Prevent misinterpretation of deep impact altfire.

This commit is contained in:
Mari the Deer 2022-01-22 17:17:41 +01:00
commit 9cf984cea8
4 changed files with 21 additions and 5 deletions

View file

@ -46,6 +46,7 @@ Class DeepImpact : SWWMWeapon
transient ui TextureID WeaponBox, AmmoBar;
transient ui DynamicValueInterpolator ChargeInter;
transient int failtime;
Property ClipCount : clipcount;
@ -56,8 +57,9 @@ Class DeepImpact : SWWMWeapon
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);
Screen.DrawTexture(AmmoBar,false,bx-7,by-52,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct);
Screen.DrawText(smallfont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
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(smallfont,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()
@ -247,6 +249,12 @@ Class DeepImpact : SWWMWeapon
}
}
action void A_DryAltFire()
{
invoker.failtime = gametic+32;
A_StartSound("deepimpact/dryaltfire",CHAN_WEAPON,CHANF_OVERLAP);
}
action void A_AltBullet()
{
let weap = Weapon(invoker);
@ -363,11 +371,18 @@ Class DeepImpact : SWWMWeapon
XZW2 STU 3;
Goto Ready;
AltFire:
XZW2 A 0 A_JumpIf(invoker.ClipCount<100,"Reload");
XZW2 A 0 A_JumpIf(invoker.ClipCount<100,"DryAltFire");
XZW2 A 0 A_BeginCharge();
XZW2 A 1 A_ChargeUp();
XZW2 V 1 A_ChargeUp();
Wait;
DryAltFire:
// the useless goddess
XZW2 A 2 A_DryAltFire();
XZW2 Q 4;
XZW2 U 5;
XZW2 A 2;
Goto Ready;
AltRelease:
XZW2 V 1 A_AltBullet();
XZW2 W 1;