Dash can now be interrupted by releasing the button.

Dash collision detection adjusted.
Adjusted prices of some weapons/ammo.
Actually show "1x" next to singular ammo units in the store.
This commit is contained in:
Mari the Deer 2020-04-28 14:23:03 +02:00
commit c27f813376
7 changed files with 49 additions and 25 deletions

View file

@ -31,15 +31,15 @@ respective weapon.
Crackshots | 8000
Ravagers | 12000
Warheads | 25000
Sparkster | 150000
Spark Unit | 20000
Sparkster | 200000
Spark Unit | 50000
Silver Bullet | 400000
S.B. Mag | 30000
S.B. Mag | 70000
Candygun | 1000000
Candy Mag | 80000
Candy Mag | 100000
Spare Gun | 600000
Ynykron | 2000000
Crystal Unit | 400000
Ynykron | 2500000
Crystal Unit | 1000000
#### DLC weapons and ammo (when available)
@ -59,11 +59,11 @@ These will be available long after the first release.
Puntzer Gamma | 200000
SMW.05 Mag | 20000
EMP Carbine | 300000
EMP Core | 35000
EMP Core | 60000
PROWEL&TADEL | 1600000
Insane Core | 40000
S.H. Fun Ball | 2500000
Fun Stuff | 500000
Insane Core | 150000
S.H. Fun Ball | 2000000
Fun Stuff | 800000
#### Other items

View file

@ -655,7 +655,7 @@ Class SparkUnit : Ammo
{
Tag "$T_SPARKUNIT";
Inventory.PickupMessage "$T_SPARKUNIT";
Stamina 20000;
Stamina 50000;
Inventory.Amount 1;
Inventory.MaxAmount 8;
Ammo.BackpackAmount 1;
@ -681,7 +681,7 @@ Class SilverBulletAmmo : Ammo
{
Tag "$T_XSBMAG";
Inventory.PickupMessage "$T_XSBMAG";
Stamina 6000;
Stamina 70000;
Inventory.Amount 1;
Inventory.MaxAmount 5;
Ammo.BackpackAmount 1;
@ -707,7 +707,7 @@ Class CandyGunAmmo : Ammo
{
Tag "$T_CANDYMAG";
Inventory.PickupMessage "$T_CANDYMAG";
Stamina 80000;
Stamina 100000;
Inventory.Amount 1;
Inventory.MaxAmount 4;
Ammo.BackpackAmount 0;
@ -745,7 +745,7 @@ Class YnykronAmmo : Ammo
{
Tag "$T_YNYKRONAMMO";
Inventory.PickupMessage "$T_YNYKRONAMMO";
Stamina 400000;
Stamina 1000000;
Inventory.Amount 1;
Inventory.MaxAmount 1;
Ammo.BackpackAmount 0;

View file

@ -73,6 +73,28 @@ Class SWWMUtility
return (((p.y-l.v1.p.y)*l.delta.x+(l.v1.p.x-p.x)*l.delta.y) > double.epsilon);
}
// box intersection check, for collision detection
static bool BoxIntersect( Actor a, Actor b, Vector3 ofs = (0,0,0), int pad = 0 )
{
Vector3 diff = level.Vec3Diff(level.Vec3Offset(a.pos,ofs),b.pos);
if ( (abs(diff.x) > (a.radius+b.radius+pad)) || (abs(diff.y) > (a.radius+b.radius+pad)) ) return false;
if ( (diff.z > a.height+pad) || (diff.z < -(b.height+pad)) ) return false;
return true;
}
// extruded box intersection check, useful when checking things that might be hit along a path
static bool ExtrudeIntersect( Actor a, Actor b, Vector3 range, int steps, int pad = 0 )
{
if ( steps <= 0 ) return BoxIntersect(a,b,pad:pad);
double step = 1./steps;
for ( double i=step; i<=1.; i+=step )
{
if ( BoxIntersect(a,b,range*i,pad) )
return true;
}
return false;
}
// sphere intersection check, useful for proximity detection
static bool SphereIntersect( Actor a, Vector3 p, double radius )
{

View file

@ -30,7 +30,7 @@ Class Ynykron : SWWMWeapon
Obituary "$O_YNYKRON";
Weapon.SlotNumber 0;
Weapon.SelectionOrder 1000;
Stamina 2000000;
Stamina 2500000;
Weapon.AmmoType1 "YnykronAmmo";
Weapon.AmmoGive1 1;
+SWWMWEAPON.NOFIRSTGIVE;

View file

@ -1040,6 +1040,10 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
drag = 3;
}
}
else if ( (curtab == TAB_TRADING) && isrclick )
{
MenuEvent(MKEY_Back,false);
}
else if ( (curtab == TAB_TRADING) && !isrclick )
{
if ( !sub )
@ -1495,12 +1499,12 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
}
}
}
// sort by unit price
bool greater = false;
for ( int j=0; j<storelist.Size(); j++ )
{
let inv2 = GetDefaultByType(storelist[j]);
int price2 = int(inv2.Stamina*(1.+.5*(storeunits[j]-1)));
if ( price > price2 ) continue;
if ( inv.Stamina > inv2.Stamina ) continue;
greater = true;
storelist.Insert(j,type);
storeunits.Insert(j,amt);
@ -2135,7 +2139,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
{
if ( !storelist[i] ) continue;
let def = GetDefaultByType(storelist[i]);
if ( storeunits[i] > 1 ) str = String.Format("%dx %s",storeunits[i],def.GetTag());
if ( (storeunits[i] > 1) || (storelist[i] is 'Ammo') ) str = String.Format("%dx %s",storeunits[i],def.GetTag());
else str = def.GetTag();
int clscol = Font.CR_WHITE;
if ( storelist[i] is 'Weapon' ) clscol = Font.CR_GOLD;

View file

@ -283,11 +283,11 @@ Class Demolitionist : PlayerPawn
else
{
if ( swwm_extraalert ) A_AlertMonsters(800);
dashboost *= .5;
dashboost *= (player.cmd.buttons&BT_USER2)?.8:.1;
}
mystats.fuelusage += dashfuel-max(0.,dashfuel-dashboost);
dashfuel = max(0.,dashfuel-dashboost);
dashcooldown = 40;
dashcooldown = min(40,max(10,int(dashcooldown*1.4)));
fuelcooldown = max(60,fuelcooldown);
if ( (dashfuel <= 0.) || (dashboost <= 0.) )
SetStateLabel("DashEnd");
@ -580,9 +580,7 @@ Class Demolitionist : PlayerPawn
a = bi.Thing;
if ( !a || (a == self) || !a.bSHOOTABLE || a.bTHRUACTORS ) continue;
Vector3 diff = level.Vec3Diff(pos,a.pos);
if ( (abs(diff.x) > (radius+a.radius+spd*2)) || (abs(diff.y) > (radius+a.radius+spd*2)) ) continue;
if ( (diff.z > (height+spd*2)) || (diff.z < -(a.height+spd*2)) ) continue;
if ( diff.unit() dot dir.unit() < .35 ) continue;
if ( !SWWMUtility.ExtrudeIntersect(self,a,dir*spd,8,16) ) continue;
if ( !CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
// large monsters will stop the player
A_QuakeEx(4,4,4,10,0,128,"",QF_RELATIVE|QF_SCALEDOWN);
@ -809,7 +807,7 @@ Class Demolitionist : PlayerPawn
if ( (dodge.length() > 0) && (dashcooldown <= 0) && (dashfuel > 20.) && player.cmd.buttons&BT_USER2 && level.IsJumpingAllowed() )
{
dashdir = dodge.unit();
dashcooldown = 40;
dashcooldown = 10;
dashboost = 20.;
bOnMobj = false;
if ( player.cheats & CF_REVERTPLEASE )

View file

@ -1554,7 +1554,7 @@ Class Sparkster : SWWMWeapon
Weapon.SlotNumber 7;
Weapon.UpSound "biospark/select";
Weapon.SelectionOrder 1600;
Stamina 150000;
Stamina 200000;
Weapon.AmmoType1 "SparkUnit";
Weapon.AmmoGive1 1;
Sparkster.ClipCount 8;