Some stuff for custom map support (store/revive toggling, documentation for various functions, etc.).

A couple tiny fixes here and there for issues I didn't notice until I loaded the mod into UDB.
This commit is contained in:
Mari the Deer 2022-09-11 12:00:20 +02:00
commit 5243d533b1
13 changed files with 215 additions and 18 deletions

View file

@ -3249,7 +3249,7 @@ Class SWWMStatusBar : BaseStatusBar
xx = int((ss.x-len)/2.);
yy = ss.y/2.;
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
if ( goner || !swwm_revive )
if ( goner || CPlayer.mo.FindInventory("SWWMReviveDisabler") || !swwm_revive )
return (1.-dimalph);
alph = clamp((deadtimer-160)/60.,0.,1.);
str = String.Format(StringTable.Localize("$SWWM_URDED3"));

View file

@ -138,7 +138,7 @@ Class TetraHealthItem : SWWMHealth
States
{
Spawn:
XZW1 # -1;
XZW1 A -1;
Stop;
}
}
@ -165,7 +165,7 @@ Class CubeHealthItem : SWWMHealth
States
{
Spawn:
XZW1 # -1;
XZW1 A -1;
Stop;
}
}
@ -213,7 +213,7 @@ Class RefresherItem : SWWMHealth
States
{
Spawn:
XZW1 # -1;
XZW1 A -1;
Stop;
}
}

View file

@ -3,6 +3,7 @@
Class DemolitionistStoreTab : DemolitionistMenuTab
{
DemolitionistMenuList invlist[2];
bool bDisabled;
bool bSell;
int ofs, maxofs, maxw;
double smofs;
@ -70,7 +71,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
override DemolitionistMenuTab Init( DemolitionistMenu master )
{
title = StringTable.Localize("$SWWM_STORETAB");
bHidden = (deathmatch||(G_SkillPropertyInt(SKILLP_ACSReturn)>=4));
bDisabled = (deathmatch||(G_SkillPropertyInt(SKILLP_ACSReturn)>=4)||players[consoleplayer].mo.FindInventory("SWWMStoreDisabler"));
return Super.Init(master);
}
override void OnDestroy()
@ -148,6 +149,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
override void Ticker()
{
if ( bDisabled ) return; // do nothing
bool mustsort = false;
bool skipsel = false;
// only update active list to reduce perf hit
@ -278,6 +280,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
override void MenuInput( int key )
{
if ( bDisabled ) return; // do nothing
if ( key == MK_BACK )
{
bSell = !bSell;
@ -330,6 +333,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
}
override void MouseInput( Vector2 pos, int btn )
{
if ( bDisabled ) return; // do nothing
if ( btn == MB_RIGHT )
{
// just toggle buy/sell
@ -377,9 +381,17 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
override void Drawer( double fractic )
{
if ( bDisabled )
{
String str = StringTable.Localize("$SWWM_NOSTORE");
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
return;
}
if ( !invlist[bSell] || (invlist[bSell].items.Size() <= 0) )
{
String str = StringTable.Localize(bSell?"$SWWM_NOSTORESELL":"$SWWM_NOSTORE");
String str = StringTable.Localize(bSell?"$SWWM_NOSTORESELL":"$SWWM_NOSTOREBUY");
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);

View file

@ -2520,7 +2520,7 @@ Class Demolitionist : PlayerPawn
player.playerstate = PST_ENTER;
if ( special1 > 2 ) special1 = 0;
}
else if ( (player.cmd.buttons&BT_ATTACK) && (deadtimer > 120) && swwm_revive )
else if ( (player.cmd.buttons&BT_ATTACK) && (deadtimer > 120) && !FindInventory("SWWMReviveDisabler") && swwm_revive )
{
// reboot (if possible)
if ( !FindInventory("ReviveCooldown") && (((swwm_revivecooldown >= 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4)) || !hasrevived) )

View file

@ -1,5 +1,25 @@
// player-specific item stuff
// tokens for custom maps
Class SWWMStoreDisabler : Inventory
{
Default
{
+INVENTORY.UNCLEARABLE;
+INVENTORY.UNDROPPABLE;
+INVENTORY.UNTOSSABLE;
}
}
Class SWWMReviveDisabler : Inventory
{
Default
{
+INVENTORY.UNCLEARABLE;
+INVENTORY.UNDROPPABLE;
+INVENTORY.UNTOSSABLE;
}
}
// lucky collar
// made by Ashley Knox, given to you and Ibuki by Saya
Class SayaCollar : SWWMArmor