diff --git a/language.version b/language.version index 27836f5f0..f38a16e0a 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/zscript/handler/swwm_handler.zsc b/zscript/handler/swwm_handler.zsc index e56c88500..ee879eaba 100644 --- a/zscript/handler/swwm_handler.zsc +++ b/zscript/handler/swwm_handler.zsc @@ -10,7 +10,6 @@ Class SWWMHandler : EventHandler SWWMDamNum damnums; SWWMInterest intpoints; Array damtypes, damcolors; - transient CVar usedamcolors; transient int slotstrictwarn; transient ui String sswstr; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index b1a8a161b..a44fe4116 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -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() diff --git a/zscript/hud/swwm_hud_status.zsc b/zscript/hud/swwm_hud_status.zsc index 0baf98531..dee67923c 100644 --- a/zscript/hud/swwm_hud_status.zsc +++ b/zscript/hud/swwm_hud_status.zsc @@ -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"); diff --git a/zscript/hud/swwm_hudobjects.zsc b/zscript/hud/swwm_hudobjects.zsc index 138a9610c..0d8f568b1 100644 --- a/zscript/hud/swwm_hudobjects.zsc +++ b/zscript/hud/swwm_hudobjects.zsc @@ -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 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); } } diff --git a/zscript/player/swwm_player_face.zsc b/zscript/player/swwm_player_face.zsc index 3fb4c48fc..6e1a7d39b 100644 --- a/zscript/player/swwm_player_face.zsc +++ b/zscript/player/swwm_player_face.zsc @@ -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); diff --git a/zscript/player/swwm_player_fx.zsc b/zscript/player/swwm_player_fx.zsc index 1b35ae060..46d226d72 100644 --- a/zscript/player/swwm_player_fx.zsc +++ b/zscript/player/swwm_player_fx.zsc @@ -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 diff --git a/zscript/player/swwm_player_move.zsc b/zscript/player/swwm_player_move.zsc index cbe3a005a..54b9c157f 100644 --- a/zscript/player/swwm_player_move.zsc +++ b/zscript/player/swwm_player_move.zsc @@ -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"); } diff --git a/zscript/player/swwm_player_think.zsc b/zscript/player/swwm_player_think.zsc index 3d7000a97..2e32608eb 100644 --- a/zscript/player/swwm_player_think.zsc +++ b/zscript/player/swwm_player_think.zsc @@ -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); } } diff --git a/zscript/player/swwm_player_tick.zsc b/zscript/player/swwm_player_tick.zsc index 8c584ebf8..9c3c22031 100644 --- a/zscript/player/swwm_player_tick.zsc +++ b/zscript/player/swwm_player_tick.zsc @@ -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);