Changing many built-in script aliases to constants.

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6591 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-08-17 12:33:02 +00:00
parent a25bc7da04
commit 05d2fd4939
7 changed files with 98 additions and 98 deletions
+2 -2
View File
@@ -4,9 +4,9 @@ if (! (strstr $mapstartalways autoSaveCheck)) [ add2alias mapstartalways [ if $a
if (! (checkalias autosavemap)) [ autosavemap = 0 ]
if (! (checkalias timeBetAutoSaves)) [ timeBetAutoSaves = 300000 ] // Once every 5 minutes.
autoSaveCheck = [ sleep $timeBetAutoSaves [ doAutoSave ] ]
const autoSaveCheck [ sleep $timeBetAutoSaves [ doAutoSave ] ]
doAutoSave = [
const doAutoSave [
if (! (strstr $defaultmaps (curmap 1))) [
if (|| $editing (= $gamemode 1)) [
if $autosavemap [
+4 -4
View File
@@ -1,11 +1,11 @@
// Makes old cubescripts compatible with newer versions of the game
curmode = [ result $gamemode ]
getclientmode = [ result $gamemode ]
const curmode [ result $gamemode ]
const getclientmode [ result $gamemode ]
curteam = [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 team) ] [ result (player1 team) ] ]
const curteam [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 team) ] [ result (player1 team) ] ]
pstat_score = [
const pstat_score [
if (isclient $arg1) [
result (concat (player $arg1 flags) (player $arg1 frags) (player $arg1 deaths) (player $arg1 points) (player $arg1 team) (player $arg1 tks) (findpn $arg1))
] [ result (concat "0 0 0 0 -1 0" (addpunct)) ]
+1 -1
View File
@@ -8,7 +8,7 @@ if (! (checkalias ofc_gamma_list)) [
// setgamma - allows clients to set custom gamma values for each official map, disabling/enabling the entire system
// can be done with the dyngamma variable.
setgamma = [
const setgamma [
if (&& (<= $arg1 300) (>= $arg1 30)) [
if (strstr $defaultmaps (curmap 1)) [
tmp_gamma_list = $ofc_gamma_list
+2 -2
View File
@@ -1,9 +1,9 @@
// Adds a list of aliases to be deleted (cleared from saved.cfg) on every quit.
// Do not modify. (unless you really know what you're doing)
addListOnQuit = [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat "delalias" (at $alias_list $al)) ] ]
const addListOnQuit [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat "delalias" (at $alias_list $al)) ] ]
on_quit_aliases = [
const on_quit_aliases [
_demofile
badargs
cmapp
+62 -62
View File
@@ -7,7 +7,7 @@
// Note: The editent command can NOT define rotation/yaw inside the command!
// However, the current yaw of the player will define the rotation/yaw when
// using the command!
editent = [
const editent [
if (strcmp (getenttype) "mapmodel") [ saycommand "/entset" (getenttype) (getentattr 1) (getentattr 2) (getentattr 3) ] [
if (> (findlist "light sound clip plclip" (getenttype)) -1) [
saycommand "/entset" (getenttype) (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3)
@@ -19,7 +19,7 @@ editent = [
// "convertclips" command:
// This command automatically changes the a "clip" to a "plclip" entity or vice-versa.
convertclips = [
const convertclips [
if (strcmp (getenttype) "clip") [ entset plclip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) ] [
if (strcmp (getenttype) "plclip") [ entset clip (getentattr 0) (getentattr 1) (getentattr 2) (getentattr 3) ] [
echo No changes made. This entity isn't a clip or a plclip.; echo Try using the /closestenttype command to find a specific entity.
@@ -29,7 +29,7 @@ convertclips = [
// "gibsgore" command:
// This command controls gib Speed/Number/TTL all in one variable.
gibsgore = [
const gibsgore [
if (= $arg1 4) [ // Unrealistic
gib 1; gibspeed 40; gibnum 100; gibttl 2500 // Turn TTL down to minimise lag...
__gibsgore = 4
@@ -58,18 +58,18 @@ gibsgore = [
// "fullscreenscript" command:
// This command allows swapping of fullscreen mode to be bound to a key.
fullscreenscript = [ if $fullscreen [ fullscreen 0 ] [ fullscreen 1 ] ]
const fullscreenscript [ if $fullscreen [ fullscreen 0 ] [ fullscreen 1 ] ]
editmapmsg = [ saycommand ( concatword [/mapmsg ] ["] (getmapmsg) ["] ) ]
const editmapmsg [ saycommand ( concatword [/mapmsg ] ["] (getmapmsg) ["] ) ]
run = [ exec (concatword config/ $arg1 .cfg) ]
const run [ exec (concatword config/ $arg1 .cfg) ]
// Auto-completions
mapcomplete = [complete $arg1 "packages/maps/official packages/maps" cgz]
mapcommands = "map tdm coop dm surv ts ctf pf lss osok tosok htf vip tktf ktf sendmap"
const mapcomplete [complete $arg1 "packages/maps/official packages/maps" cgz]
const mapcommands "map tdm coop dm surv ts ctf pf lss osok tosok htf vip tktf ktf sendmap"
loop i (listlen $mapcommands) [ mapcomplete (at $mapcommands $i) ]
complete demo "demos" dmo
entcomplete = [ listcomplete $arg1 "light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip plclip helmet" ]
const entcomplete [ listcomplete $arg1 "light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip plclip helmet" ]
entcomplete newent; entcomplete clearents; entcomplete closestenttype
// TODO:FIXME change all occurrence of SPECT(ator) to GHOST
@@ -97,10 +97,10 @@ gamemodedesc 17 [Team Last Swiss Standing: TODO]
gamemodedesc 18 [Bot Pistol Frenzy: TODO]
gamemodedesc 19 [Bot Last Swiss Standing: TODO]
resetbinds = [ run resetbinds; echo (c 3)All binds have been reset to default values! ]
const resetbinds [ run resetbinds; echo (c 3)All binds have been reset to default values! ]
changeteam = [ if (< (curteam) 4) [ team (at "RVSF CLA RVSF-SPECT CLA-SPECT" (curteam)) ] ]
spectate = [ if $connected [ suicide; sleep 500 [ team SPECTATOR ] ] ]
const changeteam [ if (< (curteam) 4) [ team (at "RVSF CLA RVSF-SPECT CLA-SPECT" (curteam)) ] ]
const spectate [ if $connected [ suicide; sleep 500 [ team SPECTATOR ] ] ]
const NUM_WEAPONS 10
const NUM_MODES 22
@@ -109,10 +109,10 @@ loop d $NUM_WEAPONS [ const (at "KNIFE PISTOL CARBINE SHOTGUN SMG SNIPER AR CPIS
loop r $NUM_MODES [ const (at "tdm coop dm surv ts ctf pf btdm bdm lss osok tosok bosok htf tktf ktf tpf tlss bpf blss bts btosok" $r) (addpunct (concat votemap $r (addpunct arg1 3)) 2) ]
// Mode/map-setting aliases.
votemap = [ mode $arg1; map $arg2 ]
const votemap [ mode $arg1; map $arg2 ]
lms = [ votemap 3 $arg1 ]
vip = [ votemap 13 $arg1 ]
const lms [ votemap 3 $arg1 ]
const vip [ votemap 13 $arg1 ]
// Helper aliases for (c) - easy color insertion. (e.g. echo (red)Hello (blue)world! (white)My fov today is: (orange) $fov)
const green [ result (c 0) ]
@@ -127,21 +127,21 @@ const purple [ result (c 8) ]
const orange [ result (c 9) ]
// Weapon switching/action utilities.
primary = [ weapon (currentprimary) ]
ptoggle = [ if (= (currentprimary) (curweapon)) [ $arg1 ] [ primary ] ] // Toggle between primary/specified weapon
secondary = [ weapon 1 ]
sndtoggle = [ ptoggle secondary ]
melee = [ weapon 0 ]
knftoggle = [ ptoggle melee ]
grenades = [ weapon 8 ]
gndtoggle = [ ptoggle grenades ]
const primary [ weapon (currentprimary) ]
const ptoggle [ if (= (currentprimary) (curweapon)) [ $arg1 ] [ primary ] ] // Toggle between primary/specified weapon
const secondary [ weapon 1 ]
const sndtoggle [ ptoggle secondary ]
const melee [ weapon 0 ]
const knftoggle [ ptoggle melee ]
const grenades [ weapon 8 ]
const gndtoggle [ ptoggle grenades ]
altaction = [ (concatword altaction_ (curweapon)) ]
const altaction [ (concatword altaction_ (curweapon)) ]
checkmag = [ if (|| (magcontent $arg1) (magreserve $arg1)) [ result 1 ] [ result 0 ] ]
checkrange = [ if (&& (>=f $arg1 $arg2) (<=f $arg1 $arg3)) [ result 1 ] [ result 0 ] ]
const checkmag [ if (|| (magcontent $arg1) (magreserve $arg1)) [ result 1 ] [ result 0 ] ]
const checkrange [ if (&& (>=f $arg1 $arg2) (<=f $arg1 $arg3)) [ result 1 ] [ result 0 ] ]
quicknadethrow_old = [
const quicknadethrow_old [
if (> (magcontent 8) 0) [
if (!= (curweapon) 7) [ grenades ]
attack
@@ -157,7 +157,7 @@ altaction_5 = [ setscope 1; onrelease [ setscope 0 ] ] // Sniper
oldsens = $sensitivity
zoom = [
const zoom [
if (= $arg1 1) [
if (! (=f $sensitivity (scopesens))) [
oldsens = $sensitivity
@@ -176,9 +176,9 @@ delta_spect_0 = [ changefollowplayer $arg1 ]
// Map editing using the mousewheel...
modifier = 0
domodifier = [ modifier = $arg1; onrelease [ modifier = 0 ] ]
const domodifier [ modifier = $arg1; onrelease [ modifier = 0 ] ]
universaldelta = [
const universaldelta [
if $editing [ s = "edit" ] [
if (alive) [ s = "game" ] [ s = "spect" ]
]
@@ -202,7 +202,7 @@ delta_edit_9 = [ entproperty 3 $arg1 ] // Changes the fourth value on entiti
delta_edit_10 = [ if (checkrange (+f $flyspeed (divf $arg1 4)) 1 5) [ flyspeed (+f $flyspeed (divf $arg1 4)) ]; echo $flyspeed ] // Tweak flyspeed
// HUD toggles
toggleshowmap = [ showmap 1; onrelease [ showmap 0 ] ]
const toggleshowmap [ showmap 1; onrelease [ showmap 0 ] ]
// convenient connecting from the serverbrowser
// sbconnect arg list:
@@ -215,7 +215,7 @@ toggleshowmap = [ showmap 1; onrelease [ showmap 0 ] ]
// TODO: interpret a#3,4,5,6 [ft:any1:2010apr04]
sbdns = ""; sbport = ""; sbdesc = ""; sbmsg = ""; sbpwd = ""
sbconnect = [
const sbconnect [
sbdns = $arg1; sbport = $arg2; sbdesc = $arg7; sbpwd = ""; sbmsg = ""
if (>= $arg5 1) [
sbmsg = "This server is set to private."; showmenu "password required"
@@ -232,34 +232,34 @@ sbconnect = [
]
]
// For those players who use IRC too much...
join = [ connect $arg1 $arg2 $arg3 ]
add2alias = [
const join [ connect $arg1 $arg2 $arg3 ]
const add2alias [
if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [
$arg1 = (concat (concatword (getalias $arg1) ";") $arg2)
]
]
addOnLoadOnce = [ add2alias mapstartonce $arg1 ]
addOnLoadAlways = [ add2alias mapstartalways $arg1 ]
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) ] ]
add2bind = [ if (! (strstr (keybind $arg1) $arg2)) [ bind $arg1 (format "%1; %2" (keybind $arg1) $arg2) ] ]
rndmap = [ result (at $defaultmaps (rnd (listlen $defaultmaps))) ]
const addOnLoadOnce [ add2alias mapstartonce $arg1 ]
const addOnLoadAlways [ add2alias mapstartalways $arg1 ]
const addOnQuit [ add2alias onQuit $arg1 ]
const checkinit [ if (> $numargs 0) [ if (! (checkalias $arg1)) [ $arg1 = ""; if (> $numargs 1) [ add2alias $arg1 $arg2 ] ] ] ]
const aliasinit [ loop ail (listlen $arg1) [ if (< $numargs 2) [ checkinit (at $arg1 $ail) ] [ checkinit (at $arg1 $ail) $arg2 ] ] ]
const add2list [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ]
const add2bind [ if (! (strstr (keybind $arg1) $arg2)) [ bind $arg1 (format "%1; %2" (keybind $arg1) $arg2) ] ]
const rndmap [ result (at $defaultmaps (rnd (listlen $defaultmaps))) ]
// rrnd - Returns a ranged random integer.
rrnd = [ + (rnd (- $arg2 $arg1)) $arg1 ]
const rrnd [ + (rnd (- $arg2 $arg1)) $arg1 ]
// listaverage - Returns the average of a list of numbers. (Supports ints & floats - e.g. echo (listaverage "2 5 5") // Output: 4.0)
listaverage = [ if (&& (listlen $arg1) (testlist $arg1)) [ tmp_sum = 0; loop gsl (listlen $arg1) [ +=f tmp_sum (at $arg1 $gsl) ]; result (divf $tmp_sum (listlen $arg1)) ] ]
const listaverage [ if (&& (listlen $arg1) (testlist $arg1)) [ tmp_sum = 0; loop gsl (listlen $arg1) [ +=f tmp_sum (at $arg1 $gsl) ]; result (divf $tmp_sum (listlen $arg1)) ] ]
// copyent & pasteent - Quickly copy/paste the current closest entity. Initialize the two aliases below as "NULL" for error catching.
// If /config/saved.cfg is readable/writable, errors are only possible up until the very first use of /copyent.
cp_entbuf = NULL; cp_entstr = NULL
get_ent_attrs = [ cp_entbuf = (getenttype); loop gea 4 [ add2list cp_entbuf (getentattr $gea) ] ]
const get_ent_attrs [ cp_entbuf = (getenttype); loop gea 4 [ add2list cp_entbuf (getentattr $gea) ] ]
copyent = [
const copyent [
if $editing [
get_ent_attrs
cp_entstr = (concatword (c 9) "(" (at $cp_entbuf 0) " " (at $cp_entbuf 1) " " (at $cp_entbuf 2) " " (at $cp_entbuf 3) " " (at $cp_entbuf 4) ")" (c 5)) // Output (a string): (enttype param1 param2 param3 param4)
@@ -267,7 +267,7 @@ copyent = [
]
]
pasteent = [
const pasteent [
if $editing [
if (&& (! (strcmp $cp_entbuf NULL)) (! (strcmp $cp_entstr NULL))) [
if (strcmp (at $cp_entbuf 0) mapmodel) [
@@ -281,7 +281,7 @@ pasteent = [
]
// genhex - Randomly generates a valid hexadecimal color value (e.g. 0x2FCAF1) - useful for finding fogcolours.
genhex = [
const genhex [
tmp_hex = "0x"
loop ghl 6 [
if (rnd 2) [ tmp_hex = (concatword $tmp_hex (rnd 10)) ] [ tmp_hex = (concatword $tmp_hex (at [ A B C D E F ] (rnd 6))) ]
@@ -291,7 +291,7 @@ genhex = [
]
// genwc - Randomly generates a valid watercolour value (e.g. 2 17 29) - useful for finding watercolours.
genwc = [
const genwc [
if $editing [
tmp_wc = ""
loop gwl 3 [ add2list tmp_wc (rrnd 1 256) ]
@@ -301,7 +301,7 @@ genwc = [
]
// gencl - Randomly generates a valid coloured light.
gencl = [
const gencl [
if $editing [
tmp_numargs = $numargs; tmp_cl = ""
loop gcl 3 [ add2list tmp_cl (rrnd 1 256) ]
@@ -320,10 +320,10 @@ gencl = [
]
// megabind - Binds a key to many different actions depending on the current game state.
megabind = [ if (> $numargs 5) [ bind $arg1 (format "if (watchingdemo) [ %1 ] [ if (|| $editing (= $gamemode 1)) [ %2 ] [ if $connected [ %3 ] [ if (curmodeattr bot) [ %4 ] [ %5 ] ] ] ]" $arg2 $arg3 $arg4 $arg5 $arg6) ] ]
const megabind [ if (> $numargs 5) [ bind $arg1 (format "if (watchingdemo) [ %1 ] [ if (|| $editing (= $gamemode 1)) [ %2 ] [ if $connected [ %3 ] [ if (curmodeattr bot) [ %4 ] [ %5 ] ] ] ]" $arg2 $arg3 $arg4 $arg5 $arg6) ] ]
// getscrext - Returns the proper file extension for the client's current screenshottype setting, including the "."
getscrext = [
const getscrext [
if (= $screenshottype 0) [ result ".bmp" ] [
if (= $screenshottype 1) [ result ".jpg" ] [
if (= $screenshottype 2) [ result ".png" ] [ result -1 ]
@@ -332,9 +332,9 @@ getscrext = [
]
// storesets - Generates an alias (list) of the current values for the given CVARs.
omit_idents = "botsshoot curname curteam idlebots name"
const omit_idents "botsshoot curname curteam idlebots name"
storesets = [
const storesets [
if (> $numargs 1) [
badargs = 0; $arg2 = ""
loop ssl (listlen $arg1) [
@@ -347,7 +347,7 @@ storesets = [
]
// strins - Inserts a string into another string, at position x.
strins = [
const strins [
if (> $numargs 2) [
if (&& (> $arg3 -1) (< $arg3 (strlen $arg1))) [
tmp_output = ""
@@ -360,19 +360,19 @@ strins = [
]
// cleanshot - Take a "clean" screenshot with no HUD items.
cs_sets = "clockdisplay crosshairsize hidecompass hideconsole hidectfhud hidedamageindicator hidehudequipment hidehudmsgs hideradar hidespecthud hideteam hidevote hudgun spechudgun showstats showtargetname"
cs_newsets = "0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0"
const cs_sets "clockdisplay crosshairsize hidecompass hideconsole hidectfhud hidedamageindicator hidehudequipment hidehudmsgs hideradar hidespecthud hideteam hidevote hudgun spechudgun showstats showtargetname"
const cs_newsets "0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0"
disablehud = [ storesets $cs_sets tmp_old_sets; loop csl (listlen $cs_sets) [ (at $cs_sets $csl) (at $cs_newsets $csl) ] ]
enablehud = [ if (checkalias tmp_old_sets) [ loop ros (listlen $cs_sets) [ (at $cs_sets $ros) (at $tmp_old_sets $ros) ] ] ]
cleanshot = [ disablehud; sleep 10 [ screenshot ]; sleep 90 [ enablehud ] ]
const disablehud [ storesets $cs_sets tmp_old_sets; loop csl (listlen $cs_sets) [ (at $cs_sets $csl) (at $cs_newsets $csl) ] ]
const enablehud [ if (checkalias tmp_old_sets) [ loop ros (listlen $cs_sets) [ (at $cs_sets $ros) (at $tmp_old_sets $ros) ] ] ]
const cleanshot [ disablehud; sleep 10 [ screenshot ]; sleep 90 [ enablehud ] ]
votepending = 0
if (! (checkalias onCallVote)) [ onCallVote = "" ]; if (! (strstr $onCallVote votepending)) [ add2alias onCallVote [ votepending = 1 ] ]
if (! (checkalias onVoteEnd)) [ onVoteEnd = "" ]; if (! (strstr $onVoteEnd votepending)) [ add2alias onVoteEnd [ votepending = 0 ] ]
// convertcase - Zap a list of strings to lower/uppercase.
convertcase = [
const convertcase [
if (> $numargs 1) [
tmpCCO = ""
loop ccl $numargs [ if (> $ccl 0) [ tmpCCO = (concatword $tmpCCO " " (getalias (format arg%1 (+ $ccl 2)))) ] [ tmpCCO = (concatword $tmpCCO $arg2) ] ]
@@ -386,7 +386,7 @@ convertcase = [
_CAS_serverip = "IP ADDRESS"
_CAS_serverpass = "PASSWORD"
_CAS_servername = "SERVER NAME"
customclaimadminscript = [
const customclaimadminscript [
if (strcmp (curserver 1) $_CAS_serverip) [
if (! (currole)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0; echo you relinquished admin status ]
] [ echo (c 3)Error: (c 5)you're not connected to $_CAS_servername servers ]
+16 -16
View File
@@ -9,9 +9,9 @@
// * 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.
survResetAliases = "gotCheckPoint lastCheckPoint survIsFinished startedSurvival startedOBCount startPreSurvMillis startSurvMillis survKills survTeleported"
const survResetAliases "gotCheckPoint lastCheckPoint survIsFinished startedSurvival startedOBCount startPreSurvMillis startSurvMillis survKills survTeleported"
resetSurvAliases = [
const resetSurvAliases [
loop rsa (listlen $survResetAliases) [ (at $survResetAliases $rsa) = 0 ]
aliasinit survBotsToAdd 1; aliasinit "spamSurvMsgs survDifficulty" 0; aliasinit survNumBots 12; aliasinit survMaxBots 32; aliasinit timeBetChkPts 60000; aliasinit timeUntilTele 120000
]
@@ -22,14 +22,14 @@ if (! (strstr $afterinit resetSurvAliases)) [
if (! (checkalias survMap)) [ survMap = (rnd (listlen $defaultmaps)) ]
]
genSurvDifStr = [
const genSurvDifStr [
if $nonSurvDefaults [ result "[CUSTOM]" ] [
tmpstrlist = (concat (concatword (c 0) "[EASY]") (concatword (c 2) "[INTERMEDIATE]") (concatword (c 9) "[HARD]") (concatword (c 7) "[IMPOSSIBLE]"))
if (&& $numargs (checkrange $arg1 0 3)) [ result (at $tmpstrlist $arg1) ] [ result (at $tmpstrlist $survDifficulty) ]
]
]
survival = [
const survival [
kickallbots; if (! (curteam)) [ team RVSF ]; if (> $numargs 1) [ survSetDif $arg2 ]
tmpSurvSets = $survNumBots; curSurvDifficulty = 0; survLastKill = ""; survTimeBetKills = ""; resetSurvAliases
if (! (checkalias onKill)) [ onKill = "" ]
@@ -55,18 +55,18 @@ survival = [
votemap 7 $arg1
]
startSurvival = [
const startSurvival [
startedSurvival = 1; startSurvMillis = (millis); addnbot $survNumBots CLA bad
sleep 1000 [ if $survTeleported [ echo (c 9)You were teleported to the zone. ]; echo (c 3)Starting survival mode, good luck! ]
sleep $timeBetChkPts [ gotCheckPoint = 1; increaseDifficulty ]
]
setzone = [ if (> (listlen $arg1) 3) [ zone = ""; loop szl 4 [ add2list zone (at $arg1 $szl) ] ] ]
const setzone [ if (> (listlen $arg1) 3) [ zone = ""; loop szl 4 [ add2list zone (at $arg1 $szl) ] ] ]
// Zones consist of two points on a grid. Any area within these points are considered "inner zone".
// The order of the arguments given to setzone are important: setzone "minX maxX minY maxY"
// Hint: Use /whereami to find the two points.
survOfcZones = [
const survOfcZones [
ac_aqueous 159.10 198.90 128.10 142.90
ac_arabian 128.10 196.90 93.10 146.90
ac_arctic 81.10 120.90 137.10 176.90
@@ -98,21 +98,21 @@ survOfcZones = [
ac_werk 121.10 147.90 110.10 150.90
]
setOfcZones = [
const setOfcZones [
survMapIndex = (findlist $survOfcZones (curmap 1))
if $survMapIndex [ tmpSurvZone = ""; loop soz 4 [ add2list tmpSurvZone (at $survOfcZones (+ $survMapIndex (+ $soz 1))) ]; setzone $tmpSurvZone ]
]
findCenter = [
const findCenter [
midZoneX = (+f (divf (-f (at $tmpSurvZone 1) (at $tmpSurvZone 0)) 2) (at $tmpSurvZone 0))
midZoneY = (+f (divf (-f (at $tmpSurvZone 3) (at $tmpSurvZone 2)) 2) (at $tmpSurvZone 2))
]
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 (! (alive)) [ attack ]; if (!= $gamespeed 100) [ gamespeed 100 ]; survTeleported = 1; findCenter; if (! $editing) [ edittoggle ]; go_to $midZoneX $midZoneY; sleep 25 [ edittoggle ] ]
isInZone = [ if (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) [ result 1 ] [ result 0 ] ]
const isInZone [ if (&& (checkrange (player1 x) (at $zone 0) (at $zone 1)) (checkrange (player1 y) (at $zone 2) (at $zone 3))) [ result 1 ] [ result 0 ] ]
checkzone = [
const checkzone [
if (! $survIsFinished) [
if (&& $startedSurvival (&& (>= (- (millis) $startSurvMillis) 500) (|| (|| (idlebots 2) (! (botsshoot 2))) (|| $editing (!= $gamespeed 100))))) [ endSurvival (concatword (genSurvDifStr) (c 3) " Error: " (c 1) editmode (c 5) ", " (c 3) gamespeed (c 5) ", " (c 2) idlebots (c 5) ", and " (c 0) botsshoot (c 5) " are not allowed in Survival Mode.") ]
if (&& (isInZone) (! $startedSurvival)) [ startSurvival ]
@@ -124,20 +124,20 @@ checkzone = [
]
]
startOBCount = [
const startOBCount [
startedOBCount = 1; startOBMillis = (millis); backInZone = 0; tmpSCtr = 5
echo (c 3)Get back into the arena! (c 5)You only have (c 3)5 (c 5)seconds to return.
loop soc 5 [ sleep (* $soc 1000) [ if (&& (! $survIsFinished) (&& (! (isInZone)) (! $backInZone))) [ if $spamSurvMsgs [ hudecho (concatword (c 9) $tmpSCtr ...) ] [ echo (concatword (c 9) $tmpSCtr ...) ]; -= tmpSCtr 1 ] [ backInZone = 1 ] ] ]
sleep 5000 [ if (&& (! (isInZone)) (&& (! $backInZone) (>= (- (millis) $startOBMillis) 5000))) [ endSurvival (concatword (genSurvDifStr) (c 3) " You took too long to return to the arena!") ] [ startedOBCount = 0 ] ]
]
increaseDifficulty = [
const increaseDifficulty [
lastCheckPoint = (millis)
if (<= (+ $survNumBots $survBotsToAdd) $survMaxBots) [ += survNumBots $survBotsToAdd; addnbot $survBotsToAdd CLA best ] [ tmpSurvInt = (- $survMaxBots $survNumBots); += survNumBots $tmpSurvInt; addnbot $tmpSurvInt CLA best ]
if (< $curSurvDifficulty 4) [ += curSurvDifficulty 1; botskillall (at "bad worse medium good best" $curSurvDifficulty) ]
]
endSurvival = [
const 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: ")) [
@@ -155,6 +155,6 @@ endSurvival = [
]
// List of aliases that need to be cleared from saved.cfg on quit:
survAliases = (concat $survResetAliases "resetSurvAliases genSurvDifStr survival tmpSurvSets curSurvDifficulty survLastKill survTimeBetKills startPreSurvMillis startSurvival startedSurvival setzone survOfcZones setOfcZones survMapIndex tmpSurvZone findCenter midZoneX midZoneY teleportPlayer survTeleported isInZone checkzone startOBCount startedOBCount startOBMillis backInZone tmpSCtr increaseDifficulty lastCheckPoint tmpSurvInt endSurvival tmp_survstr survIsFinished tmpstrlist finalSurvMillis zone survSetsList survDifList survSetDif survResetAliases survAliases")
const survAliases = (concat $survResetAliases "resetSurvAliases genSurvDifStr survival tmpSurvSets curSurvDifficulty survLastKill survTimeBetKills startPreSurvMillis startSurvival startedSurvival setzone survOfcZones setOfcZones survMapIndex tmpSurvZone findCenter midZoneX midZoneY teleportPlayer survTeleported isInZone checkzone startOBCount startedOBCount startOBMillis backInZone tmpSCtr increaseDifficulty lastCheckPoint tmpSurvInt endSurvival tmp_survstr survIsFinished tmpstrlist finalSurvMillis zone survSetsList survDifList survSetDif survResetAliases survAliases")
addListOnQuit $survAliases
+11 -11
View File
@@ -1,4 +1,4 @@
tutstart = [
const tutstart [
if (= $arg1 1) [
add2alias mapstartonce [ tut ]
// Disable most of the HUD
@@ -7,19 +7,19 @@ tutstart = [
demo "tutorial_demo"
]
]
endtutorial = [
const endtutorial [
consize (at $tmp_tutsets 0); crosshairsize (at $tmp_tutsets 1); hidespecthud (at $tmp_tutsets 2)
hideteam (at $tmp_tutsets 3); hidehudequipment (at $tmp_tutsets 4); spechudgun (at $tmp_tutsets 5)
watchingtutorial = 0
]
tut = [
const tut [
sleep 50 [ paused 1; showmenu "AC Tutorial - Welcome"; sleep 20 [ add2alias mapstartonce = [ endtutorial ] ] ]
consize 1; echo (c 2)Live tutorial information will appear here.
]
tut2 = [ sleep 9000 [ paused 1; showmenu "AC Tutorial - Basic Movement" ] ] // Need echoes timed with the movement before the paused 1
tut3 = [ sleep 8000 [ paused 1; showmenu "AC Tutorial - More Movement" ] ] // ibid
const tut2 [ sleep 9000 [ paused 1; showmenu "AC Tutorial - Basic Movement" ] ] // Need echoes timed with the movement before the paused 1
const tut3 [ sleep 8000 [ paused 1; showmenu "AC Tutorial - More Movement" ] ] // ibid
tut4 = [
const tut4 [
consize 1; echo Here, the players are straferunning.
sleep 14200 [
consize 2; echo Now, they are jumping.
@@ -32,9 +32,9 @@ tut4 = [
]
sleep 42000 [ paused 1; showmenu "AC Tutorial - Weapons" ] // Main timing sequence to go to next menu, all above are subkeyframes
]
tut5 = [ sleep 10 [ paused 1; showmenu "AC Tutorial - Weapon Info" ] ]
const tut5 [ sleep 10 [ paused 1; showmenu "AC Tutorial - Weapon Info" ] ]
tut6 = [
const tut6 [
sleep 6000 [ consize 2; echo Someone is about to get splattered with the shotgun... ]
sleep 18000 [ consize 2; echo (c 3)BOOM HEADSHOT! (c 5)The sniper was scoping. ]
sleep 26000 [ consize 2; echo Slice and dice with the knife. ]
@@ -42,7 +42,7 @@ tut6 = [
sleep 50000 [ paused 1; showmenu "AC Tutorial - CTF" ]
]
tut7 = [
const tut7 [
sleep 9000 [ consize 2; echo Touch a flag to pick it up... ]
sleep 17000 [ echo You will drop the flag if you get fragged. ]
sleep 19000 [ echo Touch the flag to return it... ]
@@ -50,7 +50,7 @@ tut7 = [
sleep 41000 [ paused 1; showmenu "AC Tutorial - Advanced" ]
]
tut8 = [
const tut8 [
sleep 50 [ echo They are now edge jumping. These are popular spots to edgejump. ]
sleep 18500 [ echo To rifle sprint, face opposite to where you want to go, and jump backwards while shooting. ]
sleep 32500 [ echo Similar to the rifle sprint, rifle jump by jumping, facing down, and shooting. ]
@@ -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 (rndmap) ] ]
const endmenuitem [ sleep 1000 [ showscores 1 ]; sleep 60000 [ endtutorial; tdm (rndmap) ] ]
watchingtutorial = 0