bot survival update - total damage dealt while alive stat

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6811 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2012-05-29 02:36:29 +00:00
parent e7a233c610
commit ef8d536ea9
+10 -2
View File
@@ -9,7 +9,7 @@
// * If the player dies, or leaves the "zone" for too long of a duration, the game ends.
// * Total seconds survived, total number of enemies killed during, and average amount of time between kills are reported as stats when the game ends.
const survResetAliases "gotCheckPoint lastCheckPoint survIsFinished startedSurvival startedOBCount startPreSurvMillis startSurvMillis survKills survTeleported"
const survResetAliases "gotCheckPoint lastCheckPoint survIsFinished startedSurvival startedOBCount startPreSurvMillis startSurvMillis survKills survTeleported survTotalDmg"
const resetSurvAliases [
loop rsa (listlen $survResetAliases) [ (at $survResetAliases $rsa) = 0 ]
@@ -46,6 +46,14 @@ const survival [
]
]
]
if (! (checkalias onHit)) [ onHit = "" ]
if (! (strstr $onHit survTotalDmg)) [
add2alias onHit [ // Use onHit for total damage dealt stat
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [
+= survTotalDmg $arg3
]
]
]
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!
@@ -120,7 +128,7 @@ const checkzone [
if (&& (! $startedSurvival) (>= (- (millis) $startPreSurvMillis) $timeUntilTele)) [ teleportPlayer ]
if (&& (>= (- (millis) $lastCheckPoint) $timeBetChkPts) (&& $startedSurvival $gotCheckPoint)) [ increaseDifficulty ]
if (&& (! $startedOBCount) (&& (! (isInZone)) $startedSurvival)) [ startOBCount ]
if (&& $startedSurvival (&& (! (alive)) (>= (- (millis) $startSurvMillis) 500))) [ finalSurvMillis = (- (millis) $startSurvMillis); endSurvival (concatword (genSurvDifStr) (c 3) " You survived for " (c 5) (divf $finalSurvMillis 1000) (c 3) " seconds, and killed " (c 5) $survKills (c 3) " enemies. Average: " (c 5) (divf (listaverage $survTimeBetKills) 1000) (c 3) " seconds between kills.") ]
if (&& $startedSurvival (&& (! (alive)) (>= (- (millis) $startSurvMillis) 500))) [ finalSurvMillis = (- (millis) $startSurvMillis); endSurvival (concatword (genSurvDifStr) (c 3) " You survived for " (c 5) (divf $finalSurvMillis 1000) (c 3) " seconds, killed " (c 5) $survKills (c 3) " enemies. Average: " (c 5) (divf (listaverage $survTimeBetKills) 1000) (c 3) " seconds between kills. Total Damage Dealt: " (white) $survTotalDmg) ]
if (&& (! (curteam)) (! $startedSurvival)) [ team RVSF ]; sleep 0 [ checkzone ]
]
]