Some Mortal Rifle progress.
This commit is contained in:
parent
4bb363928f
commit
4f7241b05b
14 changed files with 113 additions and 29 deletions
|
|
@ -708,8 +708,10 @@ SWWM_MRMODE1 = "Precision Shot";
|
|||
SWWM_MRMODE2 = "Cluster Shot";
|
||||
SWWM_MRMODE3 = "Stream Shot";
|
||||
SWWM_MRMODE4 = "Overpressure Shot";
|
||||
SWWM_MRLOW = "AMMO LOW";
|
||||
SWWM_MRNONE = "RELOAD";
|
||||
SWWM_MRLOW = "LOW AMMO"; // do not localize the Mortal Rifle strings, the font they use is English-only
|
||||
SWWM_MRNONE = "EMPTY";
|
||||
SWWM_MRCHARGE = "CHARGING";
|
||||
SWWM_MRREADY = "READY";
|
||||
SWWM_SHEENREADY = "The Sheen HMG has cooled down.";
|
||||
SWWM_DMRANK = "Rank:";
|
||||
SWWM_DMSPREAD = "Spread:";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r490 \cu(Tue 20 Sep 22:51:17 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r490 \cu(2022-09-20 22:51:17)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r492 \cu(Wed 21 Sep 18:28:30 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r492 \cu(2022-09-21 18:28:30)\c-";
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
models/canvas/MortalFrameTex.png
Normal file
BIN
models/canvas/MortalFrameTex.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 123 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 960 B |
|
|
@ -127,6 +127,9 @@ mister/firescatter sounds/dlc1/mister/mr_fire_scatter.ogg
|
|||
mister/firestream sounds/dlc1/mister/mr_fire_stream.ogg
|
||||
mister/fireover sounds/dlc1/mister/mr_fire_over.ogg
|
||||
mister/chargeover sounds/dlc1/mister/mr_charge_over.ogg
|
||||
mister/holdover sounds/dlc1/mister/mr_hold_over.ogg
|
||||
mister/beepover sounds/dlc1/mister/mr_beep_over.ogg
|
||||
mister/cancelover sounds/dlc1/mister/mr_cancel_over.ogg
|
||||
mister/magout sounds/dlc1/mister/mr_magout.ogg
|
||||
mister/magin sounds/dlc1/mister/mr_magin.ogg
|
||||
$alias mister/mag1 explodium/mag1
|
||||
|
|
|
|||
BIN
sounds/dlc1/mister/mr_beep_over.ogg
Normal file
BIN
sounds/dlc1/mister/mr_beep_over.ogg
Normal file
Binary file not shown.
BIN
sounds/dlc1/mister/mr_cancel_over.ogg
Normal file
BIN
sounds/dlc1/mister/mr_cancel_over.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
sounds/dlc1/mister/mr_hold_over.ogg
Normal file
BIN
sounds/dlc1/mister/mr_hold_over.ogg
Normal file
Binary file not shown.
|
|
@ -378,3 +378,8 @@ MiniRedFlash // "low health"
|
|||
#000000 #FF0000 0 50
|
||||
#FF0000 #FF0000 51 255
|
||||
}
|
||||
MiniWhiteFlash // "misc"
|
||||
{
|
||||
#000000 #FFFFFF 0 50
|
||||
#FFFFFF #FFFFFF 51 255
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ extend Class MisterRifle
|
|||
{
|
||||
transient ui Canvas TouchScreen, AmmoLed;
|
||||
ui Font MortalFontSmall, MortalFontMed, MortalFontBig;
|
||||
ui TextureID MortalBG, MortalIcons[2], AmmoLedFont;
|
||||
ui TextureID MortalBG, MortalIcons[2], AmmoLedFont, FrameTex;
|
||||
|
||||
transient ui int oldammo, oldfiremode, oldgrenade;
|
||||
transient ui int ammoflash, firemodeflash, grenadeflash;
|
||||
|
|
@ -127,20 +127,22 @@ extend Class MisterRifle
|
|||
transient ui String c_tz;
|
||||
transient ui bool c_init;
|
||||
|
||||
private ui void DrawWindowFrame( int x, int y, int w, int h, int padx = 4, int pady = 4, bool noborder = false )
|
||||
private ui void DrawWindowFrame( int x, int y, int w, int h, int padx = 4, int pady = 4 )
|
||||
{
|
||||
if ( !FrameTex ) FrameTex = TexMan.CheckForTexture("models/canvas/MortalFrameTex.png",TexMan.Type_Any);
|
||||
x -= padx/2;
|
||||
y -= pady/2;
|
||||
w += padx;
|
||||
h += pady;
|
||||
if ( !noborder )
|
||||
{
|
||||
TouchScreen.DrawThickLine(x,y,x+w,y,2,"White",128);
|
||||
TouchScreen.DrawThickLine(x,y+h,x+w,y+h,2,"White",128);
|
||||
TouchScreen.DrawThickLine(x,y,x,y+h,2,"White",128);
|
||||
TouchScreen.DrawThickLine(x+w,y,x+w,y+h,2,"White",128);
|
||||
}
|
||||
TouchScreen.Dim("Black",.5,x,y,w,h);
|
||||
TouchScreen.Dim("Black",.65,x,y,w,h);
|
||||
TouchScreen.DrawTexture(FrameTex,false,x,y,DTA_SrcX,0.,DTA_SrcY,0.,DTA_SrcWidth,1.,DTA_SrcHeight,1.,DTA_DestWidth,1,DTA_DestHeight,1);
|
||||
if ( w > 2 ) TouchScreen.DrawTexture(FrameTex,false,x+1,y,DTA_SrcX,1.,DTA_SrcY,0.,DTA_SrcWidth,1.,DTA_SrcHeight,1.,DTA_DestWidth,int(w-2),DTA_DestHeight,1);
|
||||
if ( h > 2 ) TouchScreen.DrawTexture(FrameTex,false,x,y+1,DTA_SrcX,0.,DTA_SrcY,1.,DTA_SrcWidth,1.,DTA_SrcHeight,1.,DTA_DestWidth,1,DTA_DestHeight,int(h-2));
|
||||
TouchScreen.DrawTexture(FrameTex,false,(x+w)-1,y,DTA_SrcX,2.,DTA_SrcY,0.,DTA_SrcWidth,1.,DTA_SrcHeight,1.,DTA_DestWidth,1,DTA_DestHeight,1);
|
||||
TouchScreen.DrawTexture(FrameTex,false,x,(y+h)-1,DTA_SrcX,0.,DTA_SrcY,2.,DTA_SrcWidth,1.,DTA_SrcHeight,1.,DTA_DestWidth,1,DTA_DestHeight,1);
|
||||
if ( h > 2 ) TouchScreen.DrawTexture(FrameTex,false,(x+w)-1,y+1,DTA_SrcX,2.,DTA_SrcY,1.,DTA_SrcWidth,2.,DTA_SrcHeight,1.,DTA_DestWidth,2,DTA_DestHeight,int(h-2));
|
||||
if ( w > 2 ) TouchScreen.DrawTexture(FrameTex,false,x+1,(y+h)-1,DTA_SrcX,1.,DTA_SrcY,2.,DTA_SrcWidth,1.,DTA_SrcHeight,2.,DTA_DestWidth,int(w-2),DTA_DestHeight,2);
|
||||
TouchScreen.DrawTexture(FrameTex,false,(x+w)-1,(y+h)-1,DTA_SrcX,2.,DTA_SrcY,2.,DTA_SrcWidth,2.,DTA_SrcHeight,2.,DTA_DestWidth,2,DTA_DestHeight,2);
|
||||
}
|
||||
|
||||
override void RenderTexture( RenderEvent e )
|
||||
|
|
@ -188,31 +190,31 @@ extend Class MisterRifle
|
|||
if ( ammoflash && (gametic < ammoflash) )
|
||||
{
|
||||
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);
|
||||
if ( ingun <= 0 ) TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniWhiteFlash"),80-fw/2,72-fh/2,"00",DTA_ColorOverlay,blink?0xA0000000:0x80000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
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);
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniWhiteFlash"),80-fw/2,72-fh/2,str,DTA_ColorOverlay,blink?0x80000000:0x00000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
if ( ingun < 10 ) TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniWhiteFlash"),80-fw/2,72-fh/2,"0 ",DTA_ColorOverlay,blink?0xA0000000:0x80000000,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
}
|
||||
fw = 64;
|
||||
fh = 32;
|
||||
DrawWindowFrame(200-fw/2,72-(fh+8),fw,fh);
|
||||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32);
|
||||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_SrcX,0,DTA_SrcWidth,64,DTA_DestWidth,64);
|
||||
if ( firemodeflash && (gametic < firemodeflash) )
|
||||
{
|
||||
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);
|
||||
TouchScreen.DrawTexture(MortalIcons[0],false,200-fw/2,72-(fh+8),DTA_SrcY,firemode*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_SrcX,64,DTA_SrcWidth,64,DTA_DestWidth,64,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
str = StringTable.Localize("$SWWM_MRMODE"..(firemode+1));
|
||||
DrawWindowFrame(200-fw/2,72+8,fw,fh);
|
||||
if ( gchambered )
|
||||
{
|
||||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_ColorOverlay,gfired?0x80000000:0x00000000);
|
||||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_SrcX,0,DTA_SrcWidth,64,DTA_DestWidth,64,DTA_ColorOverlay,gfired?0x80000000:0x00000000);
|
||||
if ( grenadeflash && (gametic < grenadeflash) )
|
||||
{
|
||||
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,gfired?0xFF808080:0xFFFFFFFF);
|
||||
TouchScreen.DrawTexture(MortalIcons[1],false,200-fw/2,72+8,DTA_SrcY,gfired*32,DTA_SrcHeight,32,DTA_DestHeight,32,DTA_SrcX,64,DTA_SrcWidth,64,DTA_DestWidth,64,DTA_Alpha,alph*(gfired?.4:.8),DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
}
|
||||
if ( lowammotic && (lowammotic > gametic) )
|
||||
|
|
@ -221,7 +223,7 @@ extend Class MisterRifle
|
|||
str = StringTable.Localize("$SWWM_MRLOW");
|
||||
fw = MortalFontMed.StringWidth(str);
|
||||
fh = MortalFontMed.GetHeight();
|
||||
DrawWindowFrame(128-fw/2,72-fh/2,fw,fh,2,-2,true);
|
||||
DrawWindowFrame(128-fw/2,72-fh/2,fw,fh,8,4);
|
||||
TouchScreen.DrawText(MortalFontMed,Font.FindFontColor("MiniBrass"),128-fw/2,72-fh/2,str,DTA_ColorOverlay,(gametic%8>=4)?0x80000000:0x000000);
|
||||
}
|
||||
if ( noammotic && (noammotic > gametic) )
|
||||
|
|
@ -230,9 +232,43 @@ extend Class MisterRifle
|
|||
str = StringTable.Localize("$SWWM_MRNONE");
|
||||
fw = MortalFontBig.StringWidth(str);
|
||||
fh = MortalFontBig.GetHeight();
|
||||
DrawWindowFrame(128-fw/2,72-fh/2,fw,fh,4,-4,true);
|
||||
DrawWindowFrame(128-fw/2,72-fh/2,fw,fh,16,8);
|
||||
TouchScreen.DrawText(MortalFontBig,Font.FindFontColor("MiniRed"),128-fw/2,72-fh/2,str,DTA_ColorOverlay,(gametic%16>=8)?0x80000000:0x000000);
|
||||
}
|
||||
if ( prefirecnt > 0 )
|
||||
{
|
||||
// charge bar
|
||||
Font fnt;
|
||||
int fofs;
|
||||
if ( prefirecnt >= 100 )
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_MRREADY");
|
||||
fnt = MortalFontMed;
|
||||
fofs = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_MRCHARGE");
|
||||
fnt = MortalFontSmall;
|
||||
fofs = (MortalFontMed.GetHeight()-MortalFontSmall.GetHeight())/2;
|
||||
}
|
||||
int strw = fnt.StringWidth(str);
|
||||
int strh = MortalFontMed.GetHeight();
|
||||
fw = max(strw,128);
|
||||
fh = strh+16;
|
||||
DrawWindowFrame(128-fw/2,72-fh/2,fw,fh,8,4);
|
||||
TouchScreen.Dim(0xFF000000,.8,128-52,72+(fh/2-14),104,12);
|
||||
double bw = PreFireInter.GetValue(e.FracTic);
|
||||
Color barcol = SWWMUtility.LerpColor(0xFF000080,0xFF00C0FF,bw/100.);
|
||||
TouchScreen.Dim(barcol,1.,128-50,72+(fh/2-12),int(bw),8);
|
||||
TouchScreen.DrawText(fnt,Font.FindFontColor("MiniCyanblu"),128-strw/2,72-fh/2+fofs,str);
|
||||
if ( (prefirecnt >= 100) && ((gametic-holdtic)%32 <= 16) )
|
||||
{
|
||||
double alph = clamp(1.-((gametic-holdtic)%32)/16.,0.,1.)**2.;
|
||||
TouchScreen.Dim(0xFFFFFFFF,alph*.8,128-50,72+(fh/2-12),int(bw),8,STYLE_Add);
|
||||
TouchScreen.DrawText(fnt,Font.FindFontColor("MiniWhiteFlash"),128-strw/2,72-fh/2+fofs,str,DTA_Alpha,alph*.8,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
}
|
||||
// Holo sub-screen
|
||||
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("MORTLED2");
|
||||
if ( !AmmoLedFont ) AmmoLedFont = TexMan.CheckForTexture("models/canvas/MortalFlatChars.png",TexMan.Type_Any);
|
||||
|
|
|
|||
|
|
@ -153,10 +153,13 @@ Class MisterRifle : SWWMWeapon
|
|||
bool waschambered;
|
||||
bool wasgchambered;
|
||||
int prefirecnt;
|
||||
transient int holdtic;
|
||||
int firemode;
|
||||
ui int lastfiremode;
|
||||
String serialnum;
|
||||
|
||||
transient ui SmoothLinearValueInterpolator PreFireInter;
|
||||
|
||||
// for alerts in the canvas
|
||||
transient int lowammotic, noammotic;
|
||||
|
||||
|
|
@ -182,6 +185,8 @@ Class MisterRifle : SWWMWeapon
|
|||
override void HudTick()
|
||||
{
|
||||
Super.HudTick();
|
||||
if ( !PreFireInter ) PreFireInter = SmoothLinearValueInterpolator.Create(prefirecnt,100.);
|
||||
PreFireInter.Update(prefirecnt);
|
||||
if ( lastfiremode && (lastfiremode != firemode+1) && (Owner.player == players[consoleplayer]) )
|
||||
{
|
||||
let bar = SWWMStatusBar(statusbar);
|
||||
|
|
@ -661,14 +666,46 @@ Class MisterRifle : SWWMWeapon
|
|||
}
|
||||
}
|
||||
|
||||
override void OwnerDied()
|
||||
{
|
||||
Super.OwnerDied();
|
||||
prefirecnt = 0;
|
||||
}
|
||||
override void Travelled()
|
||||
{
|
||||
Super.Travelled();
|
||||
prefirecnt = 0;
|
||||
}
|
||||
|
||||
action void A_MisterStartRail()
|
||||
{
|
||||
// pre-heat our ovens
|
||||
A_StartSound("mister/chargeover",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
invoker.prefirecnt = 15; // pre-heat our ovens
|
||||
A_StartSound("mister/holdover",CHAN_WEAPONEXTRA,CHANF_LOOPING,.01,4.);
|
||||
invoker.prefirecnt = 0;
|
||||
}
|
||||
|
||||
action State A_MisterHoldRail()
|
||||
{
|
||||
if ( (invoker.prefirecnt < 100) && !(player.cmd.buttons&BT_ATTACK) )
|
||||
{
|
||||
invoker.prefirecnt = 0;
|
||||
A_StopSound(CHAN_WEAPONEXTRA);
|
||||
A_StartSound("mister/cancelover",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
return ResolveState("FireOverpressureCancel");
|
||||
}
|
||||
if ( invoker.prefirecnt == 99 ) invoker.holdtic = gametic;
|
||||
invoker.prefirecnt = min(100,int(invoker.prefirecnt+1));
|
||||
A_SoundVolume(CHAN_WEAPONEXTRA,clamp(invoker.prefirecnt*.01,.01,1.));
|
||||
if ( (invoker.prefirecnt >= 100) && !((gametic-invoker.holdtic)%32) && CheckLocalView() )
|
||||
A_StartSound("mister/beepover",CHAN_WEAPON,CHANF_OVERLAP);
|
||||
return A_JumpIf((invoker.prefirecnt>=100)&&!(player.cmd.buttons&BT_ATTACK),"FireOverpressureRelease");
|
||||
}
|
||||
|
||||
action void A_MisterFireRail()
|
||||
{
|
||||
invoker.prefirecnt = 0;
|
||||
A_StopSound(CHAN_WEAPONEXTRA);
|
||||
A_PlayerFire();
|
||||
Vector3 x, y, z;
|
||||
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
|
||||
|
|
@ -958,11 +995,7 @@ Class MisterRifle : SWWMWeapon
|
|||
FireOverpressure:
|
||||
XZW2 A 2 A_MisterStartRail();
|
||||
XZW4 DEF 5;
|
||||
XZW4 F 1
|
||||
{
|
||||
invoker.prefirecnt--;
|
||||
return A_JumpIf((invoker.prefirecnt<=0)&&!(player.cmd.buttons&BT_ATTACK),"FireOverpressureRelease");
|
||||
}
|
||||
XZW4 F 1 A_MisterHoldRail();
|
||||
Wait;
|
||||
FireOverpressureRelease:
|
||||
XZW4 F 1 A_MisterFireRail();
|
||||
|
|
@ -970,6 +1003,9 @@ Class MisterRifle : SWWMWeapon
|
|||
XZW4 IJ 2;
|
||||
XZW4 KLMN 3;
|
||||
Goto AutoCycle;
|
||||
FireOverpressureCancel:
|
||||
XZW4 FED 3;
|
||||
Goto Ready;
|
||||
AltFire:
|
||||
XZW2 A 1
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ Enum EMiniHUDFontColor
|
|||
MCR_PURB,
|
||||
MCR_FLASH,
|
||||
MCR_REDFLASH,
|
||||
MCR_WHITEFLASH,
|
||||
NUM_MINIHUD_COLOR
|
||||
};
|
||||
|
||||
|
|
@ -1271,6 +1272,7 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
mhudfontcol[MCR_PURB] = Font.FindFontColor("MiniPurb");
|
||||
mhudfontcol[MCR_FLASH] = Font.FindFontColor("MiniFlash");
|
||||
mhudfontcol[MCR_REDFLASH] = Font.FindFontColor("MiniRedFlash");
|
||||
mhudfontcol[MCR_WHITEFLASH] = Font.FindFontColor("MiniWhiteFlash");
|
||||
tclabel = mhudfontcol[MCR_CYANBLU];
|
||||
tcvalue = mhudfontcol[MCR_WHITE];
|
||||
tcextra = mhudfontcol[MCR_IBUKIHUD];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue