Can't remember what I just changed, oh well.

This commit is contained in:
Mari the Deer 2020-02-28 00:18:19 +01:00
commit 191a9a5bb9
8 changed files with 49 additions and 23 deletions

View file

@ -767,10 +767,11 @@ Class YnykronAmmo : Ammo
Class AmmoFabricator : Inventory abstract
{
int budget, pertype;
int budget, pertype, maxunitprice;
Property Budget : budget;
Property PerType : pertype;
Property MaxUnitPrice : maxunitprice;
override Inventory CreateCopy( Actor other )
{
@ -786,10 +787,10 @@ Class AmmoFabricator : Inventory abstract
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
let a = (Class<Ammo>)(AllActorClasses[i]);
// only direct descendants of ammo with a set price below our budget
// only direct descendants of ammo with a set price below our max unit price
if ( !a || (a.GetParentClass() != 'Ammo') ) continue;
let def = GetDefaultByType(a);
if ( !(def.Stamina) || (def.Stamina > budget) ) continue;
if ( !(def.Stamina) || (def.Stamina > maxunitprice) ) continue;
available.Push(a);
}
// start from lowest to highest needed until we fill the inventory or run out of budget
@ -873,8 +874,9 @@ Class FabricatorTier1 : AmmoFabricator
Inventory.Icon "graphics/HUD/Icons/I_Fabricator1.png";
Inventory.PickupMessage "$T_FABRICATOR1";
Inventory.MaxAmount 30;
AmmoFabricator.Budget 2000;
AmmoFabricator.Budget 5000;
AmmoFabricator.PerType 2;
AmmoFabricator.MaxUnitPrice 2500;
Stamina 3000;
}
}
@ -888,6 +890,7 @@ Class FabricatorTier2 : AmmoFabricator
Inventory.MaxAmount 20;
AmmoFabricator.Budget 15000;
AmmoFabricator.PerType 4;
AmmoFabricator.MaxUnitPrice 10000;
Stamina 12000;
}
}
@ -899,8 +902,9 @@ Class FabricatorTier3 : AmmoFabricator
Inventory.Icon "graphics/HUD/Icons/I_Fabricator3.png";
Inventory.PickupMessage "$T_FABRICATOR3";
Inventory.MaxAmount 10;
AmmoFabricator.Budget 100000;
AmmoFabricator.Budget 120000;
AmmoFabricator.PerType 8;
AmmoFabricator.MaxUnitPrice 80000;
Stamina 150000;
}
}

View file

@ -1876,7 +1876,24 @@ Class SWWMHandler : EventHandler
}
else if ( e.Replacee is 'CWeaponPiece2' ) e.Replacement = 'CandyGun';
else if ( e.Replacee is 'MWeaponPiece1' ) e.Replacement = 'Ynykron';
else if ( (e.Replacee == 'Clip') || (e.Replacee == 'GoldWandAmmo') || (e.Replacee == 'GoldWandHefty') || (e.Replacee is 'ArtiPoisonBag') )
else if ( e.Replacee is 'ArtiPoisonBag' )
{
switch( Random[Replacement](0,6) )
{
case 0:
case 1:
case 2:
e.Replacement = redpool[!Random[Replacement](0,2)];
break;
case 3:
case 4:
e.Replacement = greenpool[!Random[Replacement](0,2)];
break;
default:
e.Replacement = 'SWWMNothing';
}
}
else if ( (e.Replacee == 'Clip') || (e.Replacee == 'GoldWandAmmo') || (e.Replacee == 'GoldWandHefty') )
{
switch( Random[Replacement](0,6) )
{

View file

@ -247,6 +247,7 @@ Class Demolitionist : PlayerPawn
Super.PostBeginPlay();
mystats = SWWMStats.Find(player);
oldpos = pos;
lastground = true;
}
void A_Dash()
{
@ -549,14 +550,14 @@ Class Demolitionist : PlayerPawn
guideangle *= .9;
guidepitch *= .9;
guideroll *= .9;
if ( player.onground ) lastgroundtic = gametic;
// anchor to ground when going down steps
if ( !player.onground && !bFly && !bFlyCheat && (waterlevel < 2) && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) && (vel.z < 0) )
{
ssup = max(0,(pos.z-floorz));
SetOrigin(Vec2OffsetZ(0,0,floorz),true);
player.onground = true;
lastground = player.onground = true;
}
if ( player.onground ) lastgroundtic = gametic;
if ( !(player.cheats & CF_PREDICTING) && !(player.cmd.forwardmove|player.cmd.sidemove) )
PlayIdle();
Vector3 dodge = (0,0,0), x, y, z;

View file

@ -1289,7 +1289,7 @@ Class Spreadgun : SWWMWeapon
next = ridx;
break;
}
if ( rev && (invoker.nextammo == types[next]) )
if ( rev && ((invoker.nextammo == types[next]) || (CountInv(invoker.nextammo) <= 0)) )
{
A_SwitchAmmoType(false); // recheck forward
return;

View file

@ -2,7 +2,7 @@
Class SWWMTitleStuff : EventHandler
{
transient ui TextureID tex[2];
transient ui TextureID tex[3];
transient ui Font TewiFont;
override void WorldTick()
@ -15,12 +15,19 @@ Class SWWMTitleStuff : EventHandler
if ( gamestate != GS_TITLELEVEL ) return;
if ( !tex[0] ) tex[0] = TexMan.CheckForTexture("graphics/UnSXLogo.png",TexMan.Type_Any);
if ( !tex[1] ) tex[1] = TexMan.CheckForTexture("graphics/SWWMGZLogo.png",TexMan.Type_Any);
if ( !tex[2] ) tex[2] = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
if ( !TewiFont ) TewiFont = Font.GetFont('TewiShadedInverse');
Screen.Dim("Black",clamp(1.-((level.maptime+e.FracTic)/Thinker.TICRATE)*.1,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
double ar = Screen.GetAspectRatio();
Vector2 tsize = TexMan.GetScaledSize(tex[0]);
Vector2 tsize = TexMan.GetScaledSize(tex[2]);
double sar = tsize.x/tsize.y;
Vector2 vsize;
if ( sar < ar ) vsize = (tsize.x,tsize.x/ar);
else if ( sar > ar ) vsize = (tsize.y*ar,tsize.y);
else vsize = tsize;
Screen.DrawTexture(tex[2],false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(192,0,0,0));
Screen.Dim("Black",clamp(1.-((level.maptime+e.FracTic)/Thinker.TICRATE)*.05,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
tsize = TexMan.GetScaledSize(tex[0]);
sar = tsize.x/tsize.y;
if ( sar > ar ) vsize = (tsize.x,tsize.x/ar);
else if ( sar < ar ) vsize = (tsize.y*ar,tsize.y);
else vsize = tsize;
@ -30,11 +37,11 @@ Class SWWMTitleStuff : EventHandler
String str = "presents";
alf = clamp(((level.maptime+e.FracTic)/Thinker.TICRATE)-10,0.,1.);
alf *= 1.-clamp(((level.maptime+e.FracTic)/Thinker.TICRATE)-16,0.,1.);
Screen.DrawText(TewiFont,Font.CR_WHITE,(160-TewiFont.StringWidth(str))/2,(100-TewiFont.GetHeight())/2,str,DTA_VirtualWidth,160,DTA_VirtualHeight,100,DTA_Alpha,alf);
Screen.DrawText(TewiFont,Font.CR_WHITE,(320-TewiFont.StringWidth(str))/2,(200-TewiFont.GetHeight())/2,str,DTA_VirtualWidth,320,DTA_VirtualHeight,200,DTA_Alpha,alf);
str = "a mod by \cxMarisa Kirisame";
alf = clamp(((level.maptime+e.FracTic)/Thinker.TICRATE)-18,0.,1.);
alf *= 1.-clamp(((level.maptime+e.FracTic)/Thinker.TICRATE)-24,0.,1.);
Screen.DrawText(TewiFont,Font.CR_WHITE,(160-TewiFont.StringWidth(str))/2,(100-TewiFont.GetHeight())/2,str,DTA_VirtualWidth,160,DTA_VirtualHeight,100,DTA_Alpha,alf);
Screen.DrawText(TewiFont,Font.CR_WHITE,(320-TewiFont.StringWidth(str))/2,(200-TewiFont.GetHeight())/2,str,DTA_VirtualWidth,320,DTA_VirtualHeight,200,DTA_Alpha,alf);
tsize = TexMan.GetScaledSize(tex[1]);
sar = tsize.x/tsize.y;
if ( sar > ar ) vsize = (tsize.x,tsize.x/ar);