From e5653c52e2629f527369e6ec9cf22464a75e64a4 Mon Sep 17 00:00:00 2001 From: Bukz Date: Wed, 27 Apr 2011 14:30:41 +0000 Subject: [PATCH] updates git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6372 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/defaults.cfg | 3 ++- config/survival.cfg | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/config/defaults.cfg b/config/defaults.cfg index c52e84cc..3ca53e9e 100644 --- a/config/defaults.cfg +++ b/config/defaults.cfg @@ -34,4 +34,5 @@ survNumBots = 12 survBotsToAdd = 1 timeBetChkPts = 60000 timeUntilTele = 120000 -survMaxBots = 32 \ No newline at end of file +survMaxBots = 32 +tmpSurvData = \ No newline at end of file diff --git a/config/survival.cfg b/config/survival.cfg index 5cc234ef..bef3ea40 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -4,7 +4,8 @@ // * Each map has a unique "zone" that the player must stay in, to continue playing. // * Every "zone" is located somewhere other than the usual two bases. // * When the player first enters the "zone", the timers/counters start. -// * If the player has not found the zone within the set timeframe, they are automatically teleported there. +// * If the player has not found the "zone" within the set timeframe, they are automatically teleported there. +// * The difficulty is "increased" over time, by spawning more and increasing the skill level of bots at "checkpoints". // * If the player dies, or leaves the "zone" for too long of a duration, the game ends. // * Total seconds survived, and total number of enemies killed during, are reported as stats when the game ends. @@ -15,7 +16,7 @@ survResetAliases = "gotCheckPoint lastCheckPoint survIsFinished startedSurvival resetSurvAliases = [ loop rsa (listlen $survResetAliases) [ (at $survResetAliases $rsa) = 0 ] checkSurvAliases survMap (rnd (listlen $defaultmaps)) - checkSurvAliases survBotsToAdd 1; checkSurvAliases survDifficulty 0; checkSurvAliases survNumBots 12; checkSurvAliases survMaxBots 32; checkSurvAliases timeBetChkPts 60000 + checkSurvAliases survBotsToAdd 1; checkSurvAliases survDifficulty 0; checkSurvAliases survNumBots 12; checkSurvAliases survMaxBots 32; checkSurvAliases timeBetChkPts 60000; checkSurvAliases timeUntilTele 120000 ] resetSurvAliases @@ -33,8 +34,7 @@ survival = [ ] startSurvival = [ - startedSurvival = 1; startSurvMillis = (millis) - addnbot $survNumBots CLA bad + startedSurvival = 1; startSurvMillis = (millis); addnbot $survNumBots CLA bad sleep 2500 [ if $survTeleported [ echo (c 9)You were teleported to the zone. ]; echo (c 3)Starting survival mode, good luck! ] sleep $timeBetChkPts [ gotCheckPoint = 1; increaseDifficulty ] ] @@ -91,7 +91,7 @@ findCenter = [ tmpZoneCenter = (concat $midZoneX $midZoneY) ] -teleportPlayer = [ if (! (alive)) [ attack ]; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) [ edittoggle ]; go_to (at $tmpZoneCenter 0) (at $tmpZoneCenter 1); sleep 50 [ edittoggle ] ] +teleportPlayer = [ if (! (alive)) [ attack ]; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) [ edittoggle ]; go_to (at $tmpZoneCenter 0) (at $tmpZoneCenter 1); sleep 25 [ edittoggle ] ] isInZone = [ if (&& (&& (>= (getposition 0) (at $zone 0)) (>= (getposition 1) (at $zone 2))) (&& (<= (getposition 0) (at $zone 1)) (<= (getposition 1) (at $zone 3)))) [ @@ -132,7 +132,13 @@ endSurvival = [ tdm (at $defaultmaps (rnd (listlen $defaultmaps))) ] -// List of aliases that need to be cleared from saved.cfg on quit: -survAliases = "backInZone checkzone curSurvDifficulty endSurvival finalSurvMillis gotCheckPoint increaseDifficulty isInZone lastCheckPoint midZoneX midZoneY onKill resetSurvAliases setOfcZones setzone startedOBCount startedSurvival startOBCount startOBMillis startPreSurvMillis startSurvival startSurvMillis survIsFinished survival_test survKills survMapIndex survOfcZones survTeleported tmpSurvCtr tmpSurvInt tmpSurvSets tmp_survstr tmpSurvZone tmpZoneCenter zone checkSurvAliases survResetAliases survAliases" +// Use a single alias to store data rather than many +survSaveAliases = "survMaxBots survDifficulty timeBetChkPts survNumBots survBotsToAdd timeUntilTele survMap" +if (! (checkalias afterinit)) [ afterinit = "" ] +if (! (strstr $afterinit tmpSurvData)) [ add2alias afterinit [ if (checkalias tmpSurvData) [ if (= (listlen $tmpSurvData) (listlen $survSaveAliases)) [ loop oll (listlen $survSaveAliases) [ (at $survSaveAliases $oll) = (at $tmpSurvData $oll) ] ] ] ] ] +addOnQuit [ tmpSurvData = ""; loop oql (listlen $survSaveAliases) [ add2list tmpSurvData (getalias (at $survSaveAliases $oql)) ] ] -addListOnQuit $survAliases \ No newline at end of file +// List of aliases that need to be cleared from saved.cfg on quit: +survAliases = "backInZone checkzone curSurvDifficulty endSurvival finalSurvMillis gotCheckPoint increaseDifficulty isInZone lastCheckPoint midZoneX midZoneY onKill resetSurvAliases setOfcZones setzone startedOBCount startedSurvival startOBCount startOBMillis startPreSurvMillis startSurvival startSurvMillis survIsFinished survival_test survKills survMapIndex survOfcZones survTeleported tmpSCtr tmpSurvCtr tmpSurvInt tmpSurvSets tmp_survstr tmpSurvZone tmpZoneCenter zone checkSurvAliases survResetAliases survAliases" + +addListOnQuit $survAliases; addListOnQuit $survSaveAliases \ No newline at end of file