Some tweaks to the Mister.
This commit is contained in:
parent
49f90f6c18
commit
4d2ab09880
6 changed files with 29 additions and 23 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r441 \cu(Mon 12 Sep 23:14:07 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r441 \cu(2022-09-12 23:14:07)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r442 \cu(Mon 12 Sep 23:14:37 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r442 \cu(2022-09-12 23:14:37)\c-";
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -151,12 +151,13 @@ extend Class MisterRifle
|
|||
DemolitionistMenu.SetClock(c_year,c_month,c_day,c_hour,c_minute,c_tz);
|
||||
}
|
||||
int ingun = min(clipcount+(chambered&&!fired),99);
|
||||
if ( ingun != oldammo ) ammoflash = gametic+10;
|
||||
bool increase = (ingun>oldammo);
|
||||
if ( ingun != oldammo ) ammoflash = increase?(gametic+30):(gametic+10);
|
||||
oldammo = ingun;
|
||||
if ( firemode+1 != oldfiremode ) firemodeflash = gametic+10;
|
||||
if ( firemode+1 != oldfiremode ) firemodeflash = gametic+20;
|
||||
oldfiremode = firemode+1;
|
||||
int gstate = gchambered?gfired?2:1:0;
|
||||
if ( gstate != oldgrenade ) grenadeflash = gametic+10;
|
||||
if ( gstate != oldgrenade ) grenadeflash = gametic+20;
|
||||
oldgrenade = gstate;
|
||||
// Side touchscreen
|
||||
if ( !TouchScreen ) TouchScreen = TexMan.GetCanvas("MORTLED1");
|
||||
|
|
@ -178,16 +179,21 @@ extend Class MisterRifle
|
|||
int fw = MortalFontBig.StringWidth(str), fh = MortalFontBig.GetHeight();
|
||||
DrawWindowFrame(80-fw/2,72-fh/2,fw,fh,32);
|
||||
bool blink = (ingun<=4)&&(gametic%16<=8);
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0x80000000:0x00000000);
|
||||
if ( ingun < 10 )
|
||||
if ( ingun <= 0 ) TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,"00",DTA_ColorOverlay,blink?0xA0000000:0x80000000);
|
||||
else
|
||||
{
|
||||
str = String.Format("0 ");
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0xA0000000:0x80000000);
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0x80000000:0x00000000);
|
||||
if ( ingun < 10 ) TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,"0 ",DTA_ColorOverlay,blink?0xA0000000:0x80000000);
|
||||
}
|
||||
if ( ammoflash && (gametic < ammoflash) )
|
||||
{
|
||||
double alph = clamp((ammoflash-(gametic+e.fractic))/10.,0.,1.)**2.;
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniBlurp"),80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0x80000000:0x00000000,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
double alph = (increase?clamp((ammoflash-(gametic+e.fractic))/25.,0.,1.):clamp((ammoflash-(gametic+e.fractic))/5.,0.,1.))**2.;
|
||||
if ( ingun <= 0 ) TouchScreen.DrawText(MortalFontBig,Font.CR_UNTRANSLATED,80-fw/2,72-fh/2,"00",DTA_ColorOverlay,blink?0x80000000:0x00000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_AddStencil,DTA_FillColor,0xFF808080);
|
||||
else
|
||||
{
|
||||
TouchScreen.DrawText(MortalFontBig,Font.CR_UNTRANSLATED,80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0x80000000:0x00000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_AddStencil,DTA_FillColor,0xFFFFFFFF);
|
||||
if ( ingun < 10 ) TouchScreen.DrawText(MortalFontBig,Font.CR_UNTRANSLATED,80-fw/2,72-fh/2,"0 ",DTA_ColorOverlay,blink?0x80000000:0x00000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_AddStencil,DTA_FillColor,0xFF808080);
|
||||
}
|
||||
}
|
||||
fw = 64;
|
||||
fh = 32;
|
||||
|
|
@ -195,8 +201,8 @@ extend Class MisterRifle
|
|||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32);
|
||||
if ( firemodeflash && (gametic < firemodeflash) )
|
||||
{
|
||||
double alph = clamp((firemodeflash-(gametic+e.fractic))/10.,0.,1.)**2.;
|
||||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
double alph = clamp((firemodeflash-(gametic+e.fractic))/15.,0.,1.)**2.;
|
||||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_AddStencil,DTA_FillColor,0xFFFFFFFF);
|
||||
}
|
||||
str = StringTable.Localize("$SWWM_MRMODE"..(firemode+1));
|
||||
DrawWindowFrame(200-fw/2,72+8,fw,fh);
|
||||
|
|
@ -205,8 +211,8 @@ extend Class MisterRifle
|
|||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32);
|
||||
if ( grenadeflash && (gametic < grenadeflash) )
|
||||
{
|
||||
double alph = clamp((grenadeflash-(gametic+e.fractic))/10.,0.,1.)**2.;
|
||||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_Alpha,alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
double alph = clamp((grenadeflash-(gametic+e.fractic))/15.,0.,1.)**2.;
|
||||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_AddStencil,DTA_FillColor,0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
if ( lowammotic && (lowammotic > gametic) )
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ Class MisterRifle : SWWMWeapon
|
|||
override bool CheckAmmo( int firemode, bool autoswitch, bool requireammo, int ammocount )
|
||||
{
|
||||
if ( sv_infiniteammo || Owner.FindInventory('PowerInfiniteAmmo',true) ) return true;
|
||||
if ( firemode == PrimaryFire ) return (chambered&&!fired)||(clipcount>0)||(Ammo1.Amount>0);
|
||||
if ( firemode == PrimaryFire ) return (chambered&&!fired)||(clipcount>0)||(Ammo1.Amount>0)||(Owner.CountInv("MisterRound")>0);
|
||||
if ( firemode == AltFire ) return (gchambered&&!gfired)||(Ammo2.Amount>0);
|
||||
return Super.CheckAmmo(firemode,autoswitch,requireammo,ammocount);
|
||||
}
|
||||
|
|
@ -124,13 +124,13 @@ Class MisterRifle : SWWMWeapon
|
|||
if ( curammo == 0 )
|
||||
{
|
||||
// no ammo alert
|
||||
A_StartSound("mister/noammo",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
if ( CheckLocalView() ) A_StartSound("mister/noammo",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
invoker.noammotic = gametic+50;
|
||||
}
|
||||
else if ( (curammo == 4) || (bOnReload && (curammo <= 4)) )
|
||||
{
|
||||
// low ammo alert
|
||||
A_StartSound("mister/lowammo",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
if ( CheckLocalView() ) A_StartSound("mister/lowammo",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
invoker.lowammotic = gametic+40;
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ Class MisterRifle : SWWMWeapon
|
|||
|
||||
action void A_FireSelect()
|
||||
{
|
||||
A_StartSound("mister/fireselect",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
if ( CheckLocalView() ) A_StartSound("mister/fireselect",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
invoker.firemode = (invoker.firemode+1)%4;
|
||||
if ( (player == players[consoleplayer]) && swwm_beepboop )
|
||||
SWWMHandler.AddOneliner("buttonpush",2,0);
|
||||
|
|
@ -438,19 +438,19 @@ Class MisterRifle : SWWMWeapon
|
|||
}
|
||||
Wait;
|
||||
AutoCycle:
|
||||
XZW2 A 2 A_JumpIf(invoker.clipcount<=0,"AutoCycleLock");
|
||||
XZW2 A 1 A_JumpIf(invoker.clipcount<=0,"AutoCycleLock");
|
||||
XZW6 H 2 A_BoltBack(true);
|
||||
XZW6 IJ 2;
|
||||
XZW6 K 2 A_BoltForward();
|
||||
XZW6 LMN 2;
|
||||
XZW6 O 2 A_DropCasing();
|
||||
XZW6 O 3 A_DropCasing();
|
||||
Goto Ready;
|
||||
AutoCycleLock:
|
||||
XZW2 A 2 { invoker.boltlock = true; }
|
||||
XZW2 A 1 { invoker.boltlock = true; }
|
||||
XZWA W 2 A_BoltBack(true);
|
||||
XZWA XYZ 2;
|
||||
XZWB ABC 2;
|
||||
XZWB D 2 A_DropCasing();
|
||||
XZWB D 3 A_DropCasing();
|
||||
Goto ReadyLock;
|
||||
Fire:
|
||||
XZW2 A 1 A_MisterFire();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue