better zones for bot survival, fixes/cleanup

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7322 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-03-07 19:55:11 +00:00
parent df6eb25e1e
commit e609eac10a
+35 -28
View File
@@ -28,29 +28,36 @@ const genSurvDifStr [
]
]
const survOnKill [
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [ // Player1 was actor and was not suicide
++ survKills // Increment enemies killed counter
if (! (listlen $survTimeBetKills)) [ // First kill
survTimeBetKills = (- (millis) $startSurvMillis) //
] [ add2list survTimeBetKills (- (millis) $survLastKill) ] // Other kills
survLastKill = (millis) // Update last kill
] [
if (= $arg2 (player1 cn)) [
add2list tmpSurvSets (concat $arg1 $arg2 $arg3 $arg4 (player $arg1 name)) // Player1 was target, pass arguments/data along for use in the after game results/stats messages.
]
]
]
const survOnHit [
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [
+= survTotalDmg $arg3
]
]
checkinit onKill [if $startedSurvival [survOnKill $arg1 $arg2 $arg3 $arg4]]
checkinit onHit [if $startedSurvival [survOnHit $arg1 $arg2 $arg3 $arg4]]
const survival [
if (> $numargs 1) [ survSetDif $arg2 ]; kickallbots; if (! (curteam)) [ team RVSF ]
tmpSurvSets = $survNumBots; curSurvDifficulty = 0; survLastKill = []; survTimeBetKills = []; resetSurvAliases
checkinit onKill [ // Use onKill for enemies killed counter and other stats
if $startedSurvival [ //
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [ // Player1 was actor and was not suicide
++ survKills // Increment enemies killed counter
if (! (listlen $survTimeBetKills)) [ // First kill
survTimeBetKills = (- (millis) $startSurvMillis) //
] [ add2list survTimeBetKills (- (millis) $survLastKill) ] // Other kills
survLastKill = (millis) // Update last kill
] [ if (= $arg2 (player1 cn)) [ add2list tmpSurvSets (concat $arg1 $arg2 $arg3 $arg4 (player $arg1 name)) ] ] // Player1 was target, pass arguments/data along for use in the after game results/stats messages.
]
]
checkinit onHit [ // Use onHit for total damage dealt stat
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [
+= survTotalDmg $arg3
]
]
checkinit mapstartonce [
startPreSurvMillis = (millis); add2list tmpSurvSets (curmap 1); sleep 3 [ storesets gamma survOrigSets ]
echo (genSurvDifStr) (yellow)Bot survival mode prepared, gather items and find the arena to start! (orange)You have (white) (div $timeUntilTele 1000) (orange)seconds to prepare!
if (strstr $defaultmaps (curmap 1)) [ survMap = (findlist $defaultmaps (curmap 1)) ]
setOfcZones; checkzone
]
btdm $arg1 $MAX_BOT_MATCH_LENGTH
@@ -71,15 +78,15 @@ const survOfcZones [
ac_aqueous 159 198 128 142
ac_arabian 128 196 93 146
ac_arctic 81 120 137 176
ac_arid 135 155 97 138
ac_avenue 190 246 33 116
ac_arid 133 184 88 144
ac_avenue 156 230 64 145
ac_cavern 129 201 77 122
ac_complex 105 150 129 181
ac_depot 137 166 205 262
ac_desert 89 102 129 174
ac_desert 70 133 110 178
ac_desert2 65 98 149 190
ac_desert3 25 62 97 134
ac_douze 137 186 121 150
ac_douze 99 140 153 190
ac_edifice 33 80 82 120
ac_elevation 61 102 66 121
ac_gothic 47 83 41 83
@@ -88,15 +95,15 @@ const survOfcZones [
ac_ingress 133 181 66 112
ac_keller 66 100 222 244
ac_lainio 92 204 95 135
ac_mines 83 110 117 131
ac_outpost 61 99 73 98
ac_mines 95 167 136 193
ac_outpost 84 126 74 137
ac_power 155 216 211 244
ac_rattrap 145 185 57 102
ac_scaffold 62 91 49 63
ac_shine 99 124 79 106
ac_scaffold 34 73 38 99
ac_shine 168 207 120 200
ac_snow 17 54 102 127
ac_stellar 85 124 52 131
ac_sunset 148 183 102 127
ac_stellar 81 144 47 160
ac_sunset 107 152 48 183
ac_swamp 136 180 159 188
ac_terros 122 168 64 137
ac_toxic 72 114 120 147
@@ -135,7 +142,7 @@ const teleportPlayer [ if (! (alive)) attack; if (!= $gamespeed 100) [ gamespeed
const isInZone [ result (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) ]
changingspeed = 0; changinggamma = 0
forceinit [changingspeed changinggamma] 0
const changespeed [
changingspeed = 1; curspeed = $gamespeed; targetspeed = $arg1; increments = $arg2