git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6520 e016b1c5-ed68-44aa-a2f7-31cac88cffde

This commit is contained in:
Bukz
2011-06-08 00:08:01 +00:00
parent d235d2bf81
commit 4e063d00c2
7 changed files with 38 additions and 8 deletions
+1
View File
@@ -169,6 +169,7 @@ Cubescript
[*] testlist - Tests a list argument for certain things. (e.g. echo (testlist "1 2.3 3.14") // Output: 1 // It is a valid list of ints/floats.)
[*] listaverage - Returns the average of a list of numbers. (Supports ints and floats - e.g. echo (listaverage "2 5 5") // Output: 4.0)
[*] player1 - // TODO explain // Also getposition and positiontype have been removed in favor of this command which does that and a lot more. :p
[*] rndmap - Returns a random official map. (e.g. echo (rndmap) // Example output: ac_desert3)
[*] Multiple Idents - New helper aliases for voting for SURV, TPF, and TLSS. (e.g. /surv ac_desert)
[*] "Sleeps" can be persistent. (3rd argument of "sleep" command)
[*] Substr crash bug is fixed. Also the command can now use a negative position value.
+1
View File
@@ -710,6 +710,7 @@ docident [xhairwpsel] [Determines if bot waypoints should be selected/placed usi
docargument [V] [Note: This is turned on by default.] [min 0/max 1/default 1];
docident [survival] [Prepares a round of bot survival mode on the specified map.];
docargument [M] [the map to use] [] [0];
docargument [D] [optional: the difficulty] [0 = easy, 1 = intermediate, 2 = hard, 3 = impossible] [0];
docremark [All official maps are compatible with survival, if you want to play survival on a custom map, prior edits/additions to the script are necessary, such as adding a zone for that specific map.];
docident [inWater] [Determines if the local player is standing in water or submerged.];
docargument [T] [check if submerged instead?] [min 0/max 1/default 0] [0];
+2 -1
View File
@@ -107,10 +107,11 @@ genenemyitems "4 8 12 16 24 32" 1
survSetsList = "survNumBots survBotsToAdd timeBetChkPts timeUntilTele survMaxBots"
survDifList = [ "10 1 60000 120000 20" "12 1 45000 90000 30" "14 2 30000 45000 50" "16 5 10000 30000 50" ]
survSetDif = [ survDifficulty = $arg1; tmpSurvCtr = 0; loop sdl 5 [ (at $survSetsList $sdl) = (at (at $survDifList $survDifficulty) $tmpSurvCtr); += tmpSurvCtr 1 ] ]
newmenu "Survival Mode"
menuitemslider "Map: " 0 28 "$survMap" 1 [ "ac_aqueous" "ac_arabian" "ac_arctic" "ac_arid" "ac_complex" "ac_depot" "ac_desert" "ac_desert2" "ac_desert3" "ac_douze" "ac_edifice" "ac_elevation" "ac_gothic" "ac_iceroad" "ac_industrial" "ac_ingress" "ac_keller" "ac_mines" "ac_outpost" "ac_power" "ac_rattrap" "ac_scaffold" "ac_shine" "ac_snow" "ac_stellar" "ac_sunset" "ac_toxic" "ac_urban" "ac_werk" ] [ survMap = $arg1 ]
menuitemslider "Difficulty: " 0 3 "$survDifficulty" 1 [ "easy" "intermediate" "hard" "impossible" ] [ survDifficulty = $arg1; tmpSurvCtr = 0; loop sdl 5 [ (at $survSetsList $sdl) = (at (at $survDifList $survDifficulty) $tmpSurvCtr); += tmpSurvCtr 1 ]; nonSurvDefaults = 0 ]
menuitemslider "Difficulty: " 0 3 "$survDifficulty" 1 [ "easy" "intermediate" "hard" "impossible" ] [ survSetDif $arg1; nonSurvDefaults = 0 ]
menuitem [] -1
menuitem " Customize" [ showmenu "Survival Mode - Customize" ]
menuitem " Start!" [ survival (at $defaultmaps $survMap) ]
+1
View File
@@ -253,6 +253,7 @@ addOnQuit = [ add2alias onQuit $arg1 ]
checkinit = [ if (> $numargs 0) [ if (! (checkalias $arg1)) [ $arg1 = ""; if (> $numargs 1) [ add2alias $arg1 $arg2 ] ] ] ]
aliasinit = [ loop ail (listlen $arg1) [ if (< $numargs 2) [ checkinit (at $arg1 $ail) ] [ checkinit (at $arg1 $ail) $arg2 ] ] ]
add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ]
rndmap = [ result (at $defaultmaps (rnd (listlen $defaultmaps))) ]
// rrnd - Returns a ranged random integer.
rrnd = [ + (rnd (- $arg2 $arg1)) $arg1 ]
+30 -5
View File
@@ -25,15 +25,29 @@ genSurvDifStr = [
]
survival = [
kickallbots; tmpSurvSets = $survNumBots; curSurvDifficulty = 0; survLastKill = ""; survTimeBetKills = ""; resetSurvAliases
if (! (checkalias onKill)) [ onKill = "" ]; if (! (strstr $onKill survKills)) [ add2alias onKill [ if (&& $startedSurvival (= $arg1 (findcn $curname))) [ += survKills 1; if (! (listlen $survTimeBetKills)) [ survTimeBetKills = (- (millis) $startSurvMillis) ] [ add2list survTimeBetKills (- (millis) $survLastKill) ]; survLastKill = (millis) ] ] ]
kickallbots; if (! (curteam)) [ team RVSF ]; if (> $numargs 1) [ survSetDif $arg2; nonSurvDefaults = 0 ]
tmpSurvSets = $survNumBots; curSurvDifficulty = 0; survLastKill = ""; survTimeBetKills = ""; resetSurvAliases
if (! (checkalias onKill)) [ onKill = "" ]
if (! (strstr $onKill survKills)) [
add2alias onKill [
if $startedSurvival [
if (&& (= $arg1 (findcn $curname)) (!= $arg1 $arg2)) [
+= survKills 1
if (! (listlen $survTimeBetKills)) [
survTimeBetKills = (- (millis) $startSurvMillis)
] [ add2list survTimeBetKills (- (millis) $survLastKill) ]
survLastKill = (millis)
] [ if (= $arg2 (findcn $curname)) [ add2list tmpSurvSets (concat $arg1 $arg2 $arg3 $arg4 (findpn $arg1)) ] ]
]
]
]
add2alias mapstartonce [
startPreSurvMillis = (millis); add2list tmpSurvSets (curmap 1)
echo (genSurvDifStr) (c 2)Bot survival mode prepared, gather items and find the arena to start! (c 9)You have (c 5) (div $timeUntilTele 1000) (c 9)seconds to prepare!
if (strstr $defaultmaps (curmap 1)) [ survMap = (findlist $defaultmaps (curmap 1)) ]
setOfcZones; checkzone
]
if (! (curteam)) [ team RVSF ]; mode 7; map $arg1 // Make 'em fight for us :p
votemap 7 $arg1
]
startSurvival = [
@@ -131,8 +145,19 @@ increaseDifficulty = [
endSurvival = [
tmp_survstr = $arg1; survIsFinished = 1; startedSurvival = 0; survNumBots = (at $tmpSurvSets 0)
add2alias mapstartonce [ if (&& (strstr $tmp_survstr " You survived for ") (strstr $tmp_survstr " enemies. Average: ")) [ echo (c 0)Bot Survival results for map: (c 5) (at $tmpSurvSets 1) ]; echo $tmp_survstr; if (&& $spamSurvMsgs $survKills) [ hudecho (c 0)GG ] ]
tdm (at $defaultmaps (rnd (listlen $defaultmaps)))
add2alias mapstartonce [
if (&& (strstr $tmp_survstr " You survived for ") (strstr $tmp_survstr " enemies. Average: ")) [
echo (c 0)Bot Survival results for map: (c 5) (at $tmpSurvSets 1)
if (!= (at $tmpSurvSets 2) (at $tmpSurvSets 3)) [
if (= (at $tmpSurvSets 5) 1) [ sleep 5 [ echo (concatword (c 2) (format "you were %1 by %2" (gibmessage (at $tmpSurvSets 4)) (at $tmpSurvSets 6))) ] ] [
sleep 5 [ echo (concatword (c 2) (format "you were %1 by %2" (fragmessage (at $tmpSurvSets 4)) (at $tmpSurvSets 6))) ]
]
] [ sleep 5 [ echo (concatword (c 2) "you suicided!") ] ]
]
echo $tmp_survstr
if (&& $spamSurvMsgs $survKills) [ hudecho (c 0)GG ]
]
tdm (rndmap)
]
// List of aliases that need to be cleared from saved.cfg on quit:
+1 -1
View File
@@ -211,5 +211,5 @@ menuitem "Try it out!" -1
menuitem "" -1
menuitem " 0Finish - 7/7" "paused 0; endmenuitem"
endmenuitem = [ sleep 1000 [ showscores 1 ]; sleep 60000 [ endtutorial; tdm (at $defaultmaps (rnd (listlen $defaultmaps))) ] ]
endmenuitem = [ sleep 1000 [ showscores 1 ]; sleep 60000 [ endtutorial; tdm (rndmap) ] ]
watchingtutorial = 0
+2 -1
View File
@@ -3048,7 +3048,8 @@ Output:
<remark>All official maps are compatible with survival, if you want to play survival on a custom map, prior edits/additions to the script are necessary, such as adding a zone for that specific map.</remark>
</remarks>
<arguments>
<argument description="the map to use"/>
<argument token="M" description="the map to use"/>
<argument token="D" description="optional: the difficulty" valueNotes="0 = easy, 1 = intermediate, 2 = hard, 3 = impossible"/>
</arguments>
</command>