CVar caching is no longer needed.
This commit is contained in:
parent
9f529afb3c
commit
2b41ba0225
12 changed files with 41 additions and 52 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r717 \cu(Thu 29 Dec 10:44:53 CET 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r717 \cu(2022-12-29 10:44:53)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r718 \cu(Thu 29 Dec 13:20:08 CET 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r718 \cu(2022-12-29 13:20:08)\c-";
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ Class SWWMHandler : EventHandler
|
|||
SWWMDamNum damnums;
|
||||
SWWMInterest intpoints;
|
||||
Array<String> damtypes, damcolors;
|
||||
transient CVar usedamcolors;
|
||||
|
||||
transient int slotstrictwarn;
|
||||
transient ui String sswstr;
|
||||
|
|
|
|||
|
|
@ -190,8 +190,6 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
|
||||
transient ui int rss;
|
||||
|
||||
transient CVar tagcolor; // for mugshot
|
||||
|
||||
// called by static handler when loading a game
|
||||
// forcibly flushes our interpolators
|
||||
void Flush()
|
||||
|
|
|
|||
|
|
@ -113,8 +113,7 @@ extend Class SWWMStatusBar
|
|||
Vector2 shake = (RandomShiver(),RandomShiver())*noiz;
|
||||
if ( !CPlayer.mo.FindInventory("GhostPower") )
|
||||
{
|
||||
if ( !tagcolor ) tagcolor = CVar.GetCVar('swwm_tagcolor',CPlayer);
|
||||
int facecol = tagcolor.GetInt();
|
||||
int facecol = CVar.GetCVar('swwm_tagcolor',CPlayer).GetInt();
|
||||
if ( (facecol < 0) || (facecol > 15) ) facecol = 0;
|
||||
Screen.DrawTexture(FaceTex[0],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcWidth,32,DTA_SrcHeight,32,DTA_DestWidth,32,DTA_DestHeight,32,DTA_SrcX,32*(facecol%4),DTA_SrcY,32*(facecol/4));
|
||||
bool raging = CPlayer.mo.FindInventory("RagekitPower");
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ Class SWWMDamNum play
|
|||
o.damage = damage;
|
||||
o.pos = pos;
|
||||
o.tcolor = Font.FindFontColor("MiniRed");
|
||||
if ( !hnd.usedamcolors ) hnd.usedamcolors = CVar.FindCVar('swwm_damnums_color');
|
||||
if ( hnd.usedamcolors.GetBool() ) for ( int i=0; i<hnd.damtypes.Size(); i++ )
|
||||
if ( swwm_damnums_color ) for ( int i=0; i<hnd.damtypes.Size(); i++ )
|
||||
{
|
||||
if ( hnd.damtypes[i] != type ) continue;
|
||||
o.tcolor = Font.FindFontColor(hnd.damcolors[i]);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ Class Demolitionist : PlayerPawn
|
|||
double lastvelz, prevvelz, landvelz;
|
||||
double ssup;
|
||||
|
||||
transient CVar myvoice;
|
||||
|
||||
SWWMStats mystats;
|
||||
int cairtime;
|
||||
bool hasteleported;
|
||||
|
|
@ -67,7 +65,6 @@ Class Demolitionist : PlayerPawn
|
|||
|
||||
transient int bumptic;
|
||||
transient double lastbump;
|
||||
transient CVar bumpstr;
|
||||
|
||||
DemolitionistSelfLight selflight;
|
||||
Actor oldencroached;
|
||||
|
|
@ -114,7 +111,6 @@ Class Demolitionist : PlayerPawn
|
|||
transient int rss;
|
||||
transient bool facedamage, facegrin, facesad, facewink, faceblink;
|
||||
|
||||
transient CVar tagcolor;
|
||||
int oldtagcolor;
|
||||
|
||||
transient int magtime;
|
||||
|
|
@ -243,8 +239,7 @@ Class Demolitionist : PlayerPawn
|
|||
if ( lastbump <= 0. ) lastbump = 1.;
|
||||
if ( lastbump != 1. )
|
||||
{
|
||||
if ( !bumpstr ) bumpstr = CVar.GetCVar('swwm_bumpstrength',player);
|
||||
double str = bumpstr.GetFloat();
|
||||
double str = CVar.GetCVar('swwm_bumpstrength',player).GetFloat();
|
||||
player.fov *= lastbump*str+1.-str;
|
||||
lastbump = 1.;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ extend Class Demolitionist
|
|||
{
|
||||
if ( IsActorPlayingSound(CHAN_JETPACK,"demolitionist/jet") )
|
||||
A_StartSound("demolitionist/jetstop",CHAN_JETPACK);
|
||||
if ( !myvoice ) myvoice = CVar.GetCVar('swwm_voicetype',player);
|
||||
String myvoice = CVar.GetCVar('swwm_voicetype',player).GetString();
|
||||
int loudlv = swwm_voiceamp;
|
||||
if ( lastdamage > 70 )
|
||||
{
|
||||
|
|
@ -409,10 +409,10 @@ extend Class Demolitionist
|
|||
lastbump *= 1.04;
|
||||
if ( swwm_mutevoice < 4 )
|
||||
{
|
||||
A_StartSound(String.Format("voice/%s/hipain",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/hipain",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/hipain",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/hipain",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/hipain",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/hipain",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/hipain",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/hipain",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
}
|
||||
else if ( lastdamage > 30 )
|
||||
|
|
@ -422,10 +422,10 @@ extend Class Demolitionist
|
|||
lastbump *= 1.02;
|
||||
if ( swwm_mutevoice < 4 )
|
||||
{
|
||||
A_StartSound(String.Format("voice/%s/pain",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/pain",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/pain",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/pain",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/pain",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/pain",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/pain",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/pain",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
}
|
||||
else if ( lastdamage > 0 )
|
||||
|
|
@ -435,10 +435,10 @@ extend Class Demolitionist
|
|||
lastbump *= 1.01;
|
||||
if ( swwm_mutevoice < 4 )
|
||||
{
|
||||
A_StartSound(String.Format("voice/%s/lopain",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/lopain",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/lopain",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/lopain",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/lopain",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/lopain",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/lopain",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/lopain",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ extend Class Demolitionist
|
|||
A_StopSound(CHAN_DEMOVOICEAUX);
|
||||
A_StopSound(CHAN_DEMOVOICEAUX2);
|
||||
A_StopSound(CHAN_DEMOVOICEAUX3);
|
||||
if ( !myvoice ) myvoice = CVar.GetCVar('swwm_voicetype',player);
|
||||
String myvoice = CVar.GetCVar('swwm_voicetype',player).GetString();
|
||||
int loudlv = swwm_voiceamp;
|
||||
Sound snd = "demolitionist/death";
|
||||
if ( special1 < 10 )
|
||||
|
|
@ -461,10 +461,10 @@ extend Class Demolitionist
|
|||
A_StartSound(snd,CHAN_VOICE);
|
||||
if ( swwm_mutevoice < 4 )
|
||||
{
|
||||
A_StartSound(String.Format("voice/%s/death",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/death",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/death",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/death",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/death",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/death",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/death",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/death",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ extend Class Demolitionist
|
|||
|
||||
private void UpdateTags()
|
||||
{
|
||||
if ( !tagcolor ) tagcolor = CVar.GetCVar('swwm_tagcolor',player);
|
||||
static const String colname[] =
|
||||
{
|
||||
"",
|
||||
|
|
@ -28,7 +27,7 @@ extend Class Demolitionist
|
|||
"Black",
|
||||
"Rust"
|
||||
};
|
||||
int idx = tagcolor.GetInt();
|
||||
int idx = CVar.GetCVar('swwm_tagcolor',player).GetInt();
|
||||
if ( (idx < 0) || (idx >= colname.Size()) ) idx = 0;
|
||||
if ( idx != oldtagcolor )
|
||||
A_ChangeModel("",0,"","",0,"models","DemoTags"..colname[idx]..".png",CMDL_USESURFACESKIN,-1);
|
||||
|
|
|
|||
|
|
@ -298,7 +298,6 @@ Class DemolitionistSelfLight : Thinker
|
|||
bool oldactive;
|
||||
bool oldglow;
|
||||
Actor target;
|
||||
transient CVar tagcolor;
|
||||
int oldcolor;
|
||||
double oldheight;
|
||||
|
||||
|
|
@ -309,7 +308,6 @@ Class DemolitionistSelfLight : Thinker
|
|||
Destroy();
|
||||
return;
|
||||
}
|
||||
if ( !tagcolor ) tagcolor = CVar.GetCVar('swwm_tagcolor',target.player);
|
||||
static const Color litecolor[] =
|
||||
{
|
||||
Color(255, 24, 48, 8), // Green
|
||||
|
|
@ -329,7 +327,7 @@ Class DemolitionistSelfLight : Thinker
|
|||
Color(255, 16, 16, 16), // Black
|
||||
Color(255, 32, 16, 16) // Rust
|
||||
};
|
||||
int idx = tagcolor.GetInt();
|
||||
int idx = CVar.GetCVar('swwm_tagcolor',target.player).GetInt();
|
||||
if ( (idx < 0) || (idx >= litecolor.Size()) ) idx = 0;
|
||||
bool curactive = !(target.bINVISIBLE || (target.alpha <= double.epsilon));
|
||||
// setting the pitch to a value outside [-90,90] makes it auto-update to the actor's own pitch
|
||||
|
|
|
|||
|
|
@ -538,11 +538,12 @@ extend Class Demolitionist
|
|||
BumpView(clamp((vel.length()-10)/12.,1.,20.),vel);
|
||||
if ( swwm_mutevoice < 4 )
|
||||
{
|
||||
String myvoice = CVar.GetCVar('swwm_voicetype',player).GetString();
|
||||
int loudlv = swwm_voiceamp;
|
||||
A_StartSound(String.Format("voice/%s/jump",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/jump",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/jump",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/jump",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/jump",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/jump",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/jump",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/jump",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
SetStateLabel("Jump");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,12 +208,13 @@ extend Class Demolitionist
|
|||
}
|
||||
else if ( (failcounter > 2) && Random[DemoLines](0,1) && (gametic > failcooldown) && (swwm_mutevoice < 4) )
|
||||
{
|
||||
String myvoice = CVar.GetCVar('swwm_voicetype',player).GetString();
|
||||
int loudlv = swwm_voiceamp;
|
||||
A_StartSound(String.Format("voice/%s/usegrunt",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
failcooldown = int(S_GetLength(String.Format("voice/%s/usegrunt",myvoice.GetString()))*GameTicRate);
|
||||
A_StartSound(String.Format("voice/%s/usegrunt",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/usegrunt",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
failcooldown = int(S_GetLength(String.Format("voice/%s/usegrunt",myvoice))*GameTicRate);
|
||||
failcounter = max(2,failcounter-1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,6 @@ extend Class Demolitionist
|
|||
if ( vel.length() > mystats.topspeed ) mystats.topspeed = vel.length();
|
||||
if ( vel.length() > ((3600*GameTicRate)/32000.) )
|
||||
SWWMUtility.AchievementProgress("sanic",int((vel.length()*3600*GameTicRate)/32000.),player);
|
||||
if ( !myvoice ) myvoice = CVar.GetCVar('swwm_voicetype',player);
|
||||
if ( player.onground && !bNoGravity && !lastground )
|
||||
{
|
||||
// bump down weapon
|
||||
|
|
@ -343,11 +342,12 @@ extend Class Demolitionist
|
|||
A_StartSound("demolitionist/runstop",CHAN_FOOTSTEP,CHANF_OVERLAP);
|
||||
if ( (lastvelz < -gruntspeed) && (swwm_mutevoice < 4) && (health > 0) )
|
||||
{
|
||||
String myvoice = CVar.GetCVar('swwm_voicetype',player).GetString();
|
||||
int loudlv = swwm_voiceamp;
|
||||
A_StartSound(String.Format("voice/%s/grunt",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/grunt",myvoice.GetString()),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/grunt",myvoice.GetString()),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/grunt",myvoice.GetString()),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
A_StartSound(String.Format("voice/%s/grunt",myvoice),CHAN_DEMOVOICE,CHANF_OVERLAP);
|
||||
if ( loudlv > 1 ) A_StartSound(String.Format("voice/%s/grunt",myvoice),CHAN_DEMOVOICEAUX,CHANF_OVERLAP);
|
||||
if ( loudlv > 2 ) A_StartSound(String.Format("voice/%s/grunt",myvoice),CHAN_DEMOVOICEAUX2,CHANF_OVERLAP);
|
||||
if ( loudlv > 3 ) A_StartSound(String.Format("voice/%s/grunt",myvoice),CHAN_DEMOVOICEAUX3,CHANF_OVERLAP);
|
||||
}
|
||||
if ( lastvelz < -1 )
|
||||
A_Footstep(0,1,clamp(-lastvelz*0.05,0.0,1.0),true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue