Fix stair physics fudging with gap crossing.

Stubs for Radio and Games tabs.
This commit is contained in:
Mari the Deer 2020-08-14 16:33:11 +02:00
commit f03a434928
7 changed files with 49 additions and 14 deletions

View file

@ -17,7 +17,7 @@ after the first release.
- Ray-Khom (UnSX)
* Additional Demolitionist Menu features
- Radio (add-on)
- Pong minigame
- Minigames (pong and other stuff)
- Selling items at the store
* Achievements
* Collectable items (will recycle Chanceboxes for this)

View file

@ -209,6 +209,8 @@ SWWM_STORETAB = "Store";
SWWM_STOREFULL = "You can't hold more of that";
SWWM_STOREMUNS = "You don't have enough money";
SWWM_NOSTORE = "(no items left to buy)";
SWWM_RADIOTAB = "Radio";
SWWM_GAMETAB = "Games";
SWWM_TRADETAB = "Trading";
SWWM_TRADEFULL = "They can't hold more of that";
SWWM_NOTRADE = "(no units found nearby for trade)";

View file

@ -206,6 +206,7 @@ SWWM_STORETAB = "Tienda";
SWWM_STOREFULL = "No puedes llevar más de eso";
SWWM_STOREMUNS = "No tienes suficiente dinero";
SWWM_NOSTORE = "(no queda nada que comprar)";
SWWM_GAMETAB = "Juegos";
SWWM_TRADETAB = "Intercambio";
SWWM_TRADEFULL = "No puede llevar más de eso";
SWWM_NOTRADE = "(no hay unidades con las que intercambiar)";

View file

@ -1,2 +1,2 @@
[default]
SWWM_MODVER="\chSWWM \cwGZ\c- r479 (Mon 10 Aug 16:41:36 CEST 2020)";
SWWM_MODVER="\chSWWM \cwGZ\c- r480 (Fri 14 Aug 16:33:11 CEST 2020)";

View file

@ -93,7 +93,7 @@ Class EvisceratorChunk : Actor
+BOUNCEONWALLS;
+BOUNCEONFLOORS;
+BOUNCEONCEILINGS;
//+ALLOWBOUNCEONACTORS;
//+ALLOWBOUNCEONACTORS; // uncomment when a new gzdoom version lands with the fix for this
+NODAMAGETHRUST;
+DONTBOUNCEONSKY;
+CANBOUNCEWATER;

View file

@ -9,6 +9,8 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
TAB_KEYS,
TAB_LIBRARY,
TAB_STORE,
TAB_RADIO,
TAB_GAME,
TAB_TRADING,
TAB_CHAT,
TAB_SECRET,
@ -101,7 +103,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
LoreSeparator = TexMan.CheckForTexture("graphics/KBase/LibraryTabSeparator.png",TexMan.Type_MiscPatch);
LoreSeparatorW = TexMan.CheckForTexture("graphics/KBase/LibraryTabSeparatorJP.png",TexMan.Type_MiscPatch);
curtab = CVar.GetCVar('swwm_lasttab',players[consoleplayer]).GetInt();
int maxtab = multiplayer?TAB_CHAT:TAB_STORE;
int maxtab = multiplayer?TAB_CHAT:TAB_GAME;
if ( (curtab < TAB_MISSION) || (curtab > maxtab) ) curtab = TAB_MISSION;
if ( curtab == TAB_LIBRARY ) sel1 = CVar.GetCVar('swwm_lastloretab',players[consoleplayer]).GetInt();
else if ( curtab == TAB_STATS ) sel1 = CVar.GetCVar('swwm_laststattab',players[consoleplayer]).GetInt();
@ -274,7 +276,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
kcode = 0;
break;
}
int maxtab = multiplayer?TAB_CHAT:TAB_STORE;
int maxtab = multiplayer?TAB_CHAT:TAB_GAME;
switch ( mkey )
{
case MKEY_BACK:
@ -705,10 +707,11 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
static const string tabnames[] =
{
"$SWWM_MISSTAB", "$SWWM_STATTAB", "$SWWM_INVTAB", "$SWWM_KEYTAB",
"$SWWM_KBASETAB", "$SWWM_STORETAB", "$SWWM_TRADETAB", "$SWWM_CHATTAB"
"$SWWM_KBASETAB", "$SWWM_STORETAB", "$SWWM_RADIOTAB", "$SWWM_GAMETAB",
"$SWWM_TRADETAB", "$SWWM_CHATTAB", "$SWWM_SECRETTAB", "$SWWM_HELPTAB"
};
xx = 0;
int maxtab = multiplayer?TAB_CHAT:TAB_STORE;
int maxtab = multiplayer?TAB_CHAT:TAB_GAME;
for ( int i=TAB_MISSION; i<=maxtab; i++ )
{
len = fnt.StringWidth(tabnames[i])+6;
@ -1981,8 +1984,8 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
static const string tabnames[] =
{
"$SWWM_MISSTAB", "$SWWM_STATTAB", "$SWWM_INVTAB", "$SWWM_KEYTAB",
"$SWWM_KBASETAB", "$SWWM_STORETAB", "$SWWM_TRADETAB", "$SWWM_CHATTAB",
"$SWWM_SECRETTAB", "$SWWM_HELPTAB"
"$SWWM_KBASETAB", "$SWWM_STORETAB", "$SWWM_RADIOTAB", "$SWWM_GAMETAB",
"$SWWM_TRADETAB", "$SWWM_CHATTAB", "$SWWM_SECRETTAB", "$SWWM_HELPTAB"
};
static const string ltabnames[] =
{
@ -1992,7 +1995,7 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
{
"$SWWM_STATTAB0", "$SWWM_STATTAB1", "$SWWM_STATTAB2", "$SWWM_STATTAB3"
};
int maxtab = multiplayer?TAB_CHAT:TAB_STORE;
int maxtab = multiplayer?TAB_CHAT:TAB_GAME;
int mx = maxtab;
if ( (curtab > TAB_CHAT) ) mx++;
for ( int i=0; i<=mx; i++ )
@ -2526,6 +2529,16 @@ Class SWWMKnowledgeBaseMenu : GenericMenu
Screen.DrawTexture(WindowSeparatorH,false,origin.x,origin.y+377,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
else if ( curtab == TAB_RADIO )
{
str = StringTable.Localize("$SWWM_COMINGSOON");
Screen.DrawText(fnt,Font.CR_FIRE,(ss.x-fnt.StringWidth(str))/2.,(ss.y-fnt.GetHeight())/2.,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
else if ( curtab == TAB_GAME )
{
str = StringTable.Localize("$SWWM_COMINGSOON");
Screen.DrawText(fnt,Font.CR_FIRE,(ss.x-fnt.StringWidth(str))/2.,(ss.y-fnt.GetHeight())/2.,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
else if ( curtab == TAB_TRADING )
{
if ( !sub )

View file

@ -830,6 +830,11 @@ Class Demolitionist : PlayerPawn
if ( spd > 10. ) vel = (vel+accel/TICRATE).unit()*spd;
else vel = vel+accel/TICRATE;
}
else if ( player.onground && !bNOGRAVITY && (waterlevel < 2) )
{
// quickly decelerate if we're not holding movement keys
if ( !(player.cmd.forwardmove|player.cmd.sidemove) ) vel *= .97;
}
if ( abs(roll) > 0. ) A_SetRoll(roll+clamp(deltaangle(roll,0),-3.,3.),SPF_INTERPOLATE);
}
guideangle *= .9;
@ -838,9 +843,23 @@ Class Demolitionist : PlayerPawn
// anchor to ground when going down steps
if ( lastground && !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);
lastground = player.onground = true;
// test for gap crossing (i.e: climbing up platforms with holes between them)
Vector3 storepos = pos;
bool crossgap = false;
for ( int i=1; i<=4; i++ ) // test up to 4 steps ahead, should be enough for most cases
{
SetOrigin(Vec3Offset(vel.x,vel.y,vel.z),false);
if ( floorz < storepos.z ) continue;
crossgap = true;
break;
}
SetOrigin(storepos,false);
if ( !crossgap )
{
ssup = max(0,(pos.z-floorz));
SetOrigin(Vec2OffsetZ(0,0,floorz),true);
lastground = player.onground = true;
}
}
if ( player.onground ) lastgroundtic = level.maptime;
if ( !(player.cheats & CF_PREDICTING) && !(player.cmd.forwardmove|player.cmd.sidemove) )
@ -1439,7 +1458,7 @@ Class Demolitionist : PlayerPawn
if ( player.cmd.buttons&BT_JUMP ) return false;
if ( InStateSequence(CurState,FindState("Dash")) ) return false; // no crouch during dash
if ( swwm_crouchjump ) return true; // allowed
if ( (waterlevel >= 2) || bNOGRAVITY ) return false; // no crouch while swimming/floating
if ( (waterlevel > 2) || bNOGRAVITY ) return false; // no crouch while swimming/floating
if ( !player.onground ) return false; // no crouch while in air
return true;
}