From 4599c7201c1bb8d154a5153307ced7bbf05dbeb3 Mon Sep 17 00:00:00 2001 From: Bukz Date: Fri, 8 Mar 2013 22:17:28 +0000 Subject: [PATCH] avoid using compatibility.cfg idents where possible git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7327 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/menus_bot.cfg | 6 +++--- config/menus_multiplayer.cfg | 10 +++++----- config/menus_settings.cfg | 2 +- config/scripts.cfg | 6 +++--- config/survival.cfg | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/config/menus_bot.cfg b/config/menus_bot.cfg index 5fd1e238..332bf80c 100644 --- a/config/menus_bot.cfg +++ b/config/menus_bot.cfg @@ -30,8 +30,8 @@ const startbotmatch [ if (isbotteammode $tmp_mode) [ // team botmode numrvsf = (div $tmp_numbots 2) numcla = (div $tmp_numbots 2) - if (= (curteam) 0) [ -- numcla ] [ - if (= (curteam) 1) [ -- numrvsf ] + if (= (player1 team) 0) [ -- numcla ] [ + if (= (player1 team) 1) [ -- numrvsf ] ] if (&& (= $numrvsf $numcla) $needsswitch) [ -- numrvsf ] addnbot $numrvsf RVSF $tmp_botskill @@ -44,7 +44,7 @@ const startbotmatch [ const preparebotmatch [ echo starting botmatch.. needsswitch = 0 - if (&& (!= (curteam) 0) (!= (curteam) 1)) [ needsswitch = 1; team RVSF ] + if (&& (!= (player1 team) 0) (!= (player1 team) 1)) [ needsswitch = 1; team RVSF ] // register event that is fired during mapload addOnLoadOnce [ kickallbots diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index 22eb375c..002c79a3 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -1,7 +1,7 @@ persistidents 0 // Decides whether to open the admin or normal in-game menu. -const ingamemenu [ if (currole) [ showmenu [In-game admin] ] [ showmenu In-game ] ] +const ingamemenu [ if (player1 role) [ showmenu [In-game admin] ] [ showmenu In-game ] ] // "Join server" menu. personalserverlist = [] @@ -21,7 +21,7 @@ menuitemtextinput [Nickname: ] "result $curname" [ name $arg1 ] [ __ingamemenu_ menuitem [Change weapon...] [ showmenu Weapons ] [ __ingamemenu_showmodel [In-game] 0 ] menuitem [Change to the enemy team] changeteam [ __ingamemenu_showmodel [In-game] 0 ] menuitemvar [result (concat [Change to] (if (> (player1 team) 1) [ result active ] [ result spectate]) mode)] spectate [ __ingamemenu_showmodel [In-game] 0 ] -menuitem [Change player skin...] [showmenu (at [CLA RVSF] (curteam))] [ __ingamemenu_showmodel [In-game] 1 ] +menuitem [Change player skin...] [showmenu (at [CLA RVSF] (player1 team))] [ __ingamemenu_showmodel [In-game] 1 ] menuitem [] -1 [__ingamemenu_showmodel [In-game] 0] menuitem [Set mode/map...] [ showmenu Gamemode ] // menuitem "Kick/ban player..." [ showmenu kick/ban ] // only noobish vote abusers use this, if you really want it, just uncomment @@ -37,8 +37,8 @@ menuitem " 3Quit AssaultCube" savequit menuinitselection 13 const __ingamemenu_showmodel [ - if (&& (< (curteam) 4) $arg2) [ - chmenumdl $arg1 (concatword "playermodels/" (at [CLA RVSF CLA RVSF] (curteam)) "/0" (+ 1 (skin))) idle 15 3 + if (&& (< (player1 team) 4) $arg2) [ + chmenumdl $arg1 (concatword "playermodels/" (at [CLA RVSF CLA RVSF] (player1 team)) "/0" (+ 1 (skin))) idle 15 3 ] [ chmenumdl $arg1 ] @@ -59,7 +59,7 @@ menuitemtextinput [Nickname: ] "result $curname" [ name $arg1 ] menuitem [Change weapon...] [ showmenu Weapons ] [ __ingamemenu_showmodel [In-game admin] 0 ] menuitem [Change to the enemy team] changeteam [ __ingamemenu_showmodel [In-game admin] 1 ] menuitemvar [result (concat [Change to] (if (> (player1 team) 1) [ result active ] [ result spectate ]) mode)] spectate [ __ingamemenu_showmodel [In-game admin] 1 ] -menuitem [Change player skin...] [ showmenu (at [CLA RVSF] (curteam)) ] [ __ingamemenu_showmodel [In-game admin] 1 ] +menuitem [Change player skin...] [ showmenu (at [CLA RVSF] (player1 team)) ] [ __ingamemenu_showmodel [In-game admin] 1 ] menuitem [Demos...] [ showmenu Demo ] [ __ingamemenu_showmodel "In-game admin" 0 ] menuitem [] -1 menuitem " 4Main menu..." [ closemenu [In-game admin]; showmenu main ] diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index 5503ceef..920bccea 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -440,7 +440,7 @@ menuitemslider [Name highlight color: ] 0 9 "$nickhighlight" 1 [ " 0green 5(def menuitemcheckbox [Show scores on death: ] "$showscoresondeath" [ showscoresondeath $arg1 ] menuitem [Change to the enemy team] changeteam menuitem [Change weapon...] [ showmenu Weapons ] -menuitem [Change player skin...] [ showmenu (at [CLA RVSF] (curteam)) ] +menuitem [Change player skin...] [ showmenu (at [CLA RVSF] (player1 team)) ] menuitem [Weapon settings...] [ showmenu [Weapon Settings] ] menuitem [Edit kill messages...] [ showmenu [Kill Messages] ] diff --git a/config/scripts.cfg b/config/scripts.cfg index 482dda9e..12f6f6eb 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -106,7 +106,7 @@ gamemodedesc 19 [Bot Last Swiss Standing: Knive and bomb the enemy A.I!] const resetbinds [ run resetbinds; echo (c 3)All binds have been reset to default values! ] -const changeteam [ if (< (curteam) 4) [ team (at [RVSF CLA RVSF-SPECT CLA-SPECT] (curteam)) ] ] +const changeteam [ if (< (player1 team) 4) [ team (at [RVSF CLA RVSF-SPECT CLA-SPECT] (curteam)) ] ] const WEAPONS [KNIFE PISTOL CARBINE SHOTGUN SMG SNIPER AR CPISTOL GRENADES AKIMBO] const NUM_WEAPONS (listlen $WEAPONS) @@ -210,7 +210,7 @@ const domodifier [ modifier = $arg1; onrelease [ modifier = 0 ] ] const universaldelta [ if $editing [ s = edit ] [ - if (alive) [ s = game ] [ s = spect ] + if (player1 alive) [ s = game ] [ s = spect ] ] (concatword delta _ $s _ $modifier) ] @@ -421,7 +421,7 @@ _CAS_serverpass = "PASSWORD" _CAS_servername = "SERVER NAME" const customclaimadminscript [ if (strcmp (curserver 1) $_CAS_serverip) [ - if (! (currole)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0 ] + if (! (player1 role)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0 ] ] [ echo (red)Error: (white)you're not connected to $_CAS_servername servers ] ] diff --git a/config/survival.cfg b/config/survival.cfg index 86b36463..893e5170 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -53,7 +53,7 @@ checkinit onHit [if $startedSurvival [survOnHit $arg1 $arg2 $arg3 $arg4]] const survival [ - if (> $numargs 1) [ survSetDif $arg2 ]; kickallbots; if (! (curteam)) [ team RVSF ] + if (> $numargs 1) [ survSetDif $arg2 ]; kickallbots; if (! (player1 team)) [ team RVSF ] tmpSurvSets = $survNumBots; curSurvDifficulty = 0; survLastKill = []; survTimeBetKills = []; resetSurvAliases checkinit mapstartonce [ startPreSurvMillis = (millis); add2list tmpSurvSets (curmap 1); sleep 3 [ storesets gamma survOrigSets ] @@ -138,7 +138,7 @@ const findCenter [ midZoneY = (+f (divf (-f (at $tmpSurvZone 3) (at $tmpSurvZone 2)) 2) (at $tmpSurvZone 2)) ] -const teleportPlayer [ if (! (alive)) attack; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) edittoggle; go_to $midZoneX $midZoneY; sleep 25 edittoggle ] +const teleportPlayer [ if (! (player1 alive)) attack; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) edittoggle; go_to $midZoneX $midZoneY; sleep 25 edittoggle ] const isInZone [ result (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) ] @@ -182,13 +182,13 @@ const applySurvDamageEffects [ const checkzone [ if (! $survIsFinished) [ if (! $startedSurvival) [ - if (! (curteam)) [ team RVSF ] + if (! (player1 team)) [ team RVSF ] if (isInZone) startSurvival if (>= (- (millis) $startPreSurvMillis) $timeUntilTele) teleportPlayer ] [ if (>= (- (millis) $startSurvMillis) 500) [ if (|| $editing (|| (idlebots 2) (! (botsshoot 2)))) [ endSurvival (concatword (genSurvDifStr) (red) [ Error: editmode, idlebots, and botsshoot are not allowed in bot survival mode.]) 1 ] - if (! (alive)) [ finalSurvMillis = (- (millis) $startSurvMillis); endSurvival (concatword (genSurvDifStr) (red) [ You survived for ] (white) (divf $finalSurvMillis 1000) (red) [ seconds, killed ] (white) $survKills (red) [ enemies. Average: ] (white) (divf (listaverage $survTimeBetKills) 1000) (red) [ seconds between kills. Total Damage Dealt: ] (white) $survTotalDmg) ] + if (! (player1 alive)) [ finalSurvMillis = (- (millis) $startSurvMillis); endSurvival (concatword (genSurvDifStr) (red) [ You survived for ] (white) (divf $finalSurvMillis 1000) (red) [ seconds, killed ] (white) $survKills (red) [ enemies. Average: ] (white) (divf (listaverage $survTimeBetKills) 1000) (red) [ seconds between kills. Total Damage Dealt: ] (white) $survTotalDmg) ] ] if (&& (! (isInZone)) (! $startedOBCount)) startOBCount [ if (&& (isInZone) (&& $startedOBCount (! $backInZone))) [ backInZone = 1 ]