share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
author Wuzzy <almikes@aol.com>
Sat, 09 Apr 2016 08:45:46 +0200
changeset 12000 132ffe52d943
parent 11999 2193619b6b13
child 12001 acf5dab74f92
permissions -rw-r--r--
Write better “greeting” message for HedgeEditor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     1
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     2
--- HEDGE EDITOR 0.9 (for use with Hedgewars 0.9.22 and up)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     3
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     4
-- a horrible mission editor by mikade
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     5
-- place gears like a boss
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     6
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     7
-- feel free to shower me with your adoration and/or hate mail
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     8
-- more info can be found at http://hedgewars.org/HedgeEditor
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     9
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    10
-- special thanks to nemo, unC0Rr, sheepluva and koda for their assistance
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    11
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    12
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    13
-- GETTING STARTED (for best results!)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    14
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    15
-- create a weaponset that has NO DELAYS on any weapons, and that gives you 1 ammo per crate
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    16
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    17
-- (optional) copy GameLogExtractor.html, jquery-1.js
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    18
-- into your Documents/Hedgewars/Logs folder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    19
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    20
-- (optional) copy hwpmapconverter somewhere easily accessible
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    21
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    22
-- (optional) profit??
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    23
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    24
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    25
-- CORE FEATURES as of latest version
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    26
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    27
-- togglable help (press PRECISE + 1, while you have a tool (e.g. airstrike) selected)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    28
-- you can also the set the ScriptParameter in scheme, e.g: helpDisabled="true"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    29
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    30
-- place girders, rubberbands and custom sprites anywhere on the map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    31
-- the above objects may be destructible, indestructible, icy, or bouncy.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    32
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    33
-- place mines, sticky mines, air mines, barrels, weapon crates, utility crates,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    34
-- health crates, targets, and cleavers anywhere on the map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    35
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    36
-- select, reposition, modify, or delete placed objects.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    37
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    38
-- read in data from a previously generated map and allow the map to be edited/saved again
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    39
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    40
-- contextual cursor and menu graphics
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    41
-- placement sounds that are slightly more soothing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    42
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    43
-- meaningless version number
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    44
-- extra whitespace
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    45
-- fewer capital letters than ideal
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    46
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    47
-- upon saving, all level data will be output to logs/game0.log.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    48
-- game0.log also includes a lot of other data so if you only want to see the relevant lines of code
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    49
-- you can use GameLogExtractor.html to extract and prune the log into a cleaner form of data,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    50
-- specifically: either as an automagically generated template mission, just core data, or hwmap points.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    51
-- from there, please copy and paste any lines relevant to your interest into an existing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    52
-- (or totally empty!) script and edit them according to taste.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    53
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    54
--------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    55
-- MODE SPECIFIC SUPPORT
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    56
--------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    57
-- FOR CUSTOM MISSIONS/CAMPAIGN LEVELS:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    58
-- the names/hats/flags/voices/graves of any teams/hogs that you use to play this script can be saved,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    59
-- as can (most of) the settings from your scheme and weapons selection.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    60
-- HOWEVER, you can also use the 'hog identity' tool to give hogs preset names/hats/weapons/health
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    61
-- or use the 'team identity' tool to give an entire team themed names/hats.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    62
-- give hogs differing health by using the health modification tool
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    63
-- create goals by tagging gears with victory/defeat/collection markers (somewhat implemented)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    64
-- flavor text, as well as victory/defeat conditions will be generated based on these tags.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    65
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    66
-- SHOPPA BALANCE / CONSTRUCTION MODE (partial and/or possibly decremented):
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    67
-- Press 1-5 while repositioning hogs with the reposition tool to assign them (their position) a rank.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    68
-- This value will be expressed as a colour that is intended to represent how "good" or "bad"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    69
-- a position on the map is. These ranks/points will be output along with other game data to game0.log
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    70
-- This data could be pasted into the ShoppaBalance script to create balances for additional maps.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    71
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    72
-- TECH RACER / HEDGE EDITOR / POINT INTERPRETER:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    73
-- place/remove waypoints/special points
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    74
-- use the ScriptParameter in the frontend scheme editor to set additional options, e.g.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    75
-- ufoFuel=1000 (Flying Saucer will start with half the normal fuel. A value of 2000 is infinite fuel)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    76
-- portalDistance=15 (This is the distance portals can travel before fizzling)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    77
-- m=3 (load a particular map from the map library of Data/Scripts/TechMaps
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    78
-- helpDisabled="true" (the help pop-up overlay will be disabled by default)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    79
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    80
-- when saving data, points for conversion to HWMAP are also generated and placed inside block comments.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    81
-- copy paste/these points at the START of a converted HWMAP and then convert the map back to HWMAP format.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    82
-- following the above procedure it is then possible to load the map in frontend and play it using a
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    83
-- script like TechRacer (or HedgeEditor itself) that can interpret the points using InterpretPoints()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    84
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    85
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    86
-- DISCLAIMER
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    87
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    88
-- well, I really just made this for myself, so it's usage might be a little complicated for others.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    89
-- it also probably has a million errors, and has grown rather bloated over time due to the addition of
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    90
-- more and more features that my initial design didn't take into account.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    91
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    92
-- anyway, I've tried to make it more user-friendly by including more comments and gradually adding
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    93
-- some basic guidelines such as those listed above, and also the in-game Help displays for each tool.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    94
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    95
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    96
-- GIANT "TO DO" LIST / OTHER NOTES
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    97
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    98
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    99
-- try to prune waypoint list and portal/ufo fuel in the mission template
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   100
-- for gamelog extractor
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   101
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   102
-- I should probably check if there are tagged gears on save
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   103
-- and if there are enable gfOneClanMode so that user can't
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   104
-- just destroy all hogs to win map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   105
-- (what happens if we lose all our hogs?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   106
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   107
-- I might be able to make the flavor text even better (assassinate hogName) by
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   108
-- checking if there is only 1 hog, etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   109
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   110
-- possibly try show landflag addcaption constantly like we do for superdelete when
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   111
-- using girders / rubbers.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   112
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   113
-- check to what extent hog info is preserved on saving (does health/weps really save correctly?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   114
-- atm I think it's only for missions so I don't think it is preserved in core data
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   115
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   116
-- check if we lose a mission when the enemy collects our crate (we should)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   117
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   118
-- How about a weapons profile tool that is used with team ammo
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   119
-- and then hog identity tool would only be available if gfPerHogAmmo is set
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   120
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   121
-- INVESTIGATE when you can bother to do so
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   122
-- is airmine still missing anywhere, e.g. the weplist generated FOR THE TEMPLATE SCRIPT
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   123
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   124
-- [high] 	waypoints don't reload yet
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   125
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   126
-- [high] 	add missing weps/utils/gears as they appear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   127
--			some gameflags and settings are probably missing, too (diff border types etc)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   128
--			some themes are also probably missing: cake, hoggywood?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   129
-- 			the ongameinit stuff is probaably missing something akin to numAirMines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   130
--			and also probably scriptParam and gravity etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   131
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   132
-- [med] 	add a limited form of save/load within level before mass-output
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   133
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   134
-- [med] 	rework gameflag handling to use the newer API methods (done?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   135
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   136
-- [med]	maybe incorporate portal effects / ufo tracking into the template generated script if
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   137
-- 			you want the missions to use it
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   138
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   139
-- [med]	improve ammo handling (if possible, take more scheme settings into account)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   140
-- 			also be sure to generate wep data so crates don't have 0 in them (done?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   141
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   142
-- [low] 	match the user picked color to the color array
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   143
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   144
-- [low] 	break up the division of labor of the tools into airstrike, minestrike, napalm, etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   145
			--[[
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   146
			girder =		"Girder Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   147
			rubber =		"Rubber Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   148
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   149
			airstrike =		(target sprite) (gear placement)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   150
							"Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   151
							"Sticky Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   152
							"Air Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   153
							"Barrel Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   154
							"Target Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   155
							"Cleaver Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   156
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   157
			drillstrike =	crate sprite (crate placement mode)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   158
							"Health Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   159
							"Weapon Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   160
							"Utility Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   161
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   162
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   163
			napalm =		arrow sprite (selection/modification/deletion mode)
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
   164
							"Repositioning Mode",  -- also include a delete
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
   165
							"Goal Mode",
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   166
							"Hog Identity Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   167
							"Team Identity Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   168
							"Health Modification Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   169
							"Sprite Testing Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   170
							"Sprite Modification Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   171
							"Sprite Placement Mode",
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
   172
							"Waypoint Mode"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   173
							}]]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   174
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   175
-- [low]	improve support for ShoppaBalance and ConstructionMode, see ranking)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   176
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   177
-- [low] 	consider combining landflags
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   178
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   179
-- [low] 	periodically rework the code to make it less terrible (hahahahahaha!)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   180
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   181
-- [low]	eventually incorporate scripted structures into the editor / mission mode
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   182
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   183
-- [low] 	some kind of support for single team training missions
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   184
-- 			we could possibly add gfOneClanMode and kill the other team we're playing with?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   185
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   186
-- [never?]	set all actors to heresurrectible (why did I want this?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   187
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   188
-- [never?] more detailed goal tagging and multi-stage triggers
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   189
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   190
-- [never?]	theoretically might be possible to create forts (and other grouped objects)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   191
--			that can be mirrored and generated/placed in a big enough space
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   192
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   193
-- [never?]	add a pulsing glow thing for sprites you have selected,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   194
--			kind of like the invaders in SpaceInvader (currently they are just displayed as purple)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   195
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   196
-- [never?] add the thing that would be useful for this editor, but that others might use to cheat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   197
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   198
-- [never?]	improve "illegal" placement detection (pretty sure should just let people do what they want)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   199
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   200
-- [never?]	add GUIs for editing ammo, init settings, additional gear attributes
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   201
-- 			perhaps using precise with timer to enable/disable certain features
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   202
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   203
--[[ gui menu ideas that have long since been abandoned
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   204
INITIALISATION MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   205
	--gameFlags, etc
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   206
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   207
	Map
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   208
	Theme
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   209
	TurnTime
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   210
	Explosives
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   211
	MinesNum
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   212
	CaseFreq
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   213
	Delay
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   214
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   215
	HealthCaseProb
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   216
	HealthCaseAmount
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   217
	DamagePercent
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   218
	MinesTime
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   219
	MineDudPercent
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   220
	SuddenDeathTurns
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   221
	WaterRise
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   222
	HealthDecrease
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   223
HOG MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   224
	health
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   225
	name (can be randomly generated from the list of hog names already in localisation)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   226
	poisoned (true/false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   227
	hat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   228
	hog level?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   229
TEAM MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   230
	name (can be randomly generated as above?) should there be an array of teams with an array of names
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   231
	colour
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   232
	grave
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   233
	fort
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   234
	voicepack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   235
	flag
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   236
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   237
-- this below stuff is less important
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   238
STICKY MINE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   239
	timer?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   240
MINE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   241
	timer / dud
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   242
MEDKIT MENU / EXPLOSIVE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   243
	health amount
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   244
WEP AND UTIL CRATE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   245
	contents
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   246
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   247
----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   248
-- MAP IDEAS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   249
----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   250
-- try to create a portal race (limit portal distance)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   251
-- for portal race, include barriers that you need to drill shoot through to get lazer site crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   252
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   253
-- try make a map that uses sinegun to jump between bouncy boxes (not easy until we get better control over landflags)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   254
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   255
-- how about a mission where you have to trap / freeze all the enemy hogs
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   256
-- and aren't allowed to kill them?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   257
-- can set it on the islands map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   258
-- landgun
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   259
-- girder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   260
-- mudball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   261
-- hammer
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   262
-- seduction? (call a hog who has firepunch into a ditch
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   263
-- icegun (do this so you can freeze guys in an area and then blowtorch/explode an obstacle)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   264
-- jump across a bridge that has been mined and then bat the enemy to the other side.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   265
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   266
-- possibly the same as part of the above, possibly different, what about a heist mission
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   267
-- the objective is to steal 3 enemy crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   268
-- the first one you have to fall through an invul tunnel of sticky mines and then parachute.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   269
-- the second one you have to drill rocket / portal.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   270
-- the third one you have to underwater ufo into, but only after opening it up with an underwater bee.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   271
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   272
]]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   273
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   274
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   275
-- HEDGE EDITOR, SCRIPT BEGINS (Hey yo, it's about time)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   276
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   277
11637
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   278
-- Tell other scripts that we exist
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   279
HedgeEditor = true
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   280
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   281
HedgewarsScriptLoad("/Scripts/Locale.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   282
HedgewarsScriptLoad("/Scripts/Tracker.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   283
HedgewarsScriptLoad("/Scripts/Params.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   284
HedgewarsScriptLoad("/Scripts/TechMaps.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   285
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   286
-- experimental crap
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   287
--local destroyMap = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   288
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   289
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   290
-- tracking vars for save/load purposes
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   291
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   292
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   293
local teamCounter = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   294
local lastRecordedTeam = ""
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   295
local hhs = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   296
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   297
local waypointList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   298
local girderList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   299
local rubberList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   300
local spriteList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   301
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   302
local mineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   303
local sMineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   304
local airMineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   305
local targetList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   306
local knifeList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   307
local explosivesList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   308
local healthCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   309
local wepCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   310
local utilCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   311
local hogDataList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   312
local AIHogDataList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   313
local hFlagList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   314
local previewDataList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   315
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   316
local shoppaPointList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   317
local shoppaPX = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   318
local shoppaPY = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   319
local shoppaPR = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   320
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   321
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   322
-- crates are made of this stuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   323
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   324
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   325
local atkArray =
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   326
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   327
				{amBazooka, 	"amBazooka",		2, 	loc("Bazooka")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   328
				{amBee, 		"amBee",			3, 	loc("Homing Bee")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   329
				{amMortar, 		"amMortar",			21, loc("Mortar")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   330
				{amDrill, 		"amDrill",			28, loc("Drill Rocket")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   331
				{amSnowball, 	"amSnowball",		50, loc("Mudball")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   332
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   333
				{amGrenade,		"amGrenade",		0, 	loc("Grenade")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   334
				{amClusterBomb,	"amClusterBomb",	1, 	loc("Cluster Bomb")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   335
				{amMolotov, 	"amMolotov",		39, loc("Molotov Cocktail")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   336
				{amWatermelon, 	"amWatermelon",		25, loc("Watermelon Bomb")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   337
				{amHellishBomb,	"amHellishBomb",	26, loc("Hellish Handgrenade")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   338
				{amGasBomb, 	"amGasBomb",		43, loc("Limburger")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   339
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   340
				{amShotgun,		"amShotgun",		4, 	loc("Shotgun")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   341
				{amDEagle,		"amDEagle",			9, 	loc("Desert Eagle")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   342
				{amFlamethrower,"amFlamethrower",	45, loc("Flamethrower")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   343
				{amSniperRifle,	"amSniperRifle",	37, loc("Sniper Rifle")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   344
				{amSineGun, 	"amSineGun",		44, loc("SineGun")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   345
				{amIceGun, 		"amIceGun",			53, loc("Freezer")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   346
				{amLandGun,		"amLandGun",		52, loc("Land Spray")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   347
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   348
				{amFirePunch, 	"amFirePunch",		11, loc("Shoryuken")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   349
				{amWhip,		"amWhip",			12, loc("Whip")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   350
				{amBaseballBat, "amBaseballBat",	13, loc("Baseball Bat")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   351
				{amKamikaze, 	"amKamikaze",		22, loc("Kamikaze")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   352
				{amSeduction, 	"amSeduction",		24, loc("Seduction")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   353
				{amHammer,		"amHammer",			47, loc("Hammer")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   354
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   355
				{amMine, 		"amMine",			8, 	loc("Mine")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   356
				{amDynamite, 	"amDynamite",		10, loc("Dynamite")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   357
				{amCake, 		"amCake",			23, loc("Cake")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   358
				{amBallgun, 	"amBallgun",		29, loc("Ballgun")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   359
				{amRCPlane,		"amRCPlane",		30, loc("RC Plane")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   360
				{amSMine,		"amSMine",			46, loc("Sticky Mine")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   361
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   362
				{amAirAttack,	"amAirAttack",		15, loc("Air Attack")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   363
				{amMineStrike,	"amMineStrike",		16, loc("Mine Strike")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   364
				{amDrillStrike,	"amDrillStrike",	49, loc("Drill Strike")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   365
				{amAirMine,		"amAirMine",		56, loc("Air Mine")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   366
				{amNapalm, 		"amNapalm",			27, loc("Napalm")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   367
				{amPiano,		"amPiano",			42, loc("Piano Strike")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   368
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   369
				{amKnife,		"amKnife",			54, loc("Cleaver")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   370
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   371
				{amBirdy,		"amBirdy",			40, loc("Birdy")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   372
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   373
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   374
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   375
local utilArray =
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   376
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   377
				{amBlowTorch, 		"amBlowTorch",		17, loc("BlowTorch")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   378
				{amPickHammer,		"amPickHammer",		5, 	loc("PickHammer")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   379
				{amGirder, 			"amGirder",			18, loc("Girder")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   380
				{amRubber, 			"amRubber",			55, loc("Rubber")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   381
				{amPortalGun,		"amPortalGun",		41, loc("Personal Portal Device")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   382
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   383
				{amRope, 			"amRope",			7, 	loc("Rope")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   384
				{amParachute, 		"amParachute",		14, loc("Parachute")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   385
				{amTeleport,		"amTeleport",		19, loc("Teleport")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   386
				{amJetpack,			"amJetpack",		38, loc("Flying Saucer")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   387
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   388
				{amInvulnerable,	"amInvulnerable",	33, loc("Invulnerable")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   389
				{amLaserSight,		"amLaserSight",		35, loc("Laser Sight")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   390
				{amVampiric,		"amVampiric",		36, loc("Vampirism")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   391
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   392
				{amLowGravity, 		"amLowGravity",		31, loc("Low Gravity")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   393
				{amExtraDamage, 	"amExtraDamage",	32, loc("Extra Damage")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   394
				{amExtraTime,		"amExtraTime",		34, loc("Extra Time")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   395
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   396
				{amResurrector, 	"amResurrector",	48, loc("Resurrector")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   397
				{amTardis, 			"amTardis",			51, loc("Tardis")},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   398
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   399
				{amSwitch,			"amSwitch",			20, loc("Switch Hog")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   400
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   401
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   402
				--skiphog is 6
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   403
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   404
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   405
-- hog and map editing junk
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   406
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   407
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   408
local preMadeTeam = 	{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   409
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   410
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   411
				"Clowns",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   412
				{"WhySoSerious","clown-copper","clown-crossed","clown","Joker"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   413
				{"Baggy","Bingo","Bobo","Bozo","Buster","Chester","Copper","Heckles","Giggles","Jingo","Molly","Loopy","Patches","Tatters"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   414
				"R","cm_birdy","Mobster","Rubberduck","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   415
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   416
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   417
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   418
				"Street Fighters",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   419
				{"sf_balrog","sf_blanka","sf_chunli","sf_guile","sf_honda","sf_ken","sf_ryu","sf_vega"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   420
				{"Balrog","Blanka","Chunli","Guile","Honda","Ken","Ryu","Vega"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   421
				"F","cm_balrog","Surfer","dragonball","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   422
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   423
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   424
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   425
				"Cybernetic Empire",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   426
				{"cyborg1","cyborg2"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   427
				{"Unit 189","Unit 234","Unit 333","Unit 485","Unit 527","Unit 638","Unit 709","Unit 883"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   428
				"R","cm_binary","Robot","Grave","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   429
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   430
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   431
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   432
				"Color Squad",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   433
				{"hair_blue","hair_green","hair_red","hair_yellow","hair_purple","hair_grey","hair_orange","hair_pink"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   434
				{"Blue","Green","Red","Yellow","Purple","Grey","Orange","Pink"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   435
				"F","cm_birdy","Singer","Grave","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   436
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   437
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   438
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   439
				"Fruit",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   440
				{"fr_apple","fr_banana","fr_lemon","fr_orange","fr_pumpkin","fr_tomato"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   441
				{"Juicy","Squishy","Sweet","Sour","Bitter","Ripe","Rotten","Fruity"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   442
				"R","cm_mog","Default","Cherry","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   443
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   444
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   445
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   446
				"The Police",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   447
				{"bobby","bobby2v","policecap","policegirl","royalguard"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   448
				{"Hightower","Lassard","Callahan","Jones","Harris","Thompson","Mahoney","Hooks","Tackleberry"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   449
				"R","cm_star","British","Statue","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   450
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   451
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   452
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   453
				"The Ninja-Samurai Alliance",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   454
				{"NinjaFull","NinjaStraight","NinjaTriangle","Samurai","StrawHat","StrawHatEyes","StrawHatFacial","naruto"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   455
				{"Bushi","Tatsujin","Itami","Arashi","Shinobi","Ukemi","Godai","Kenshi","Ninpo"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   456
				"R","japan","Default","octopus","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   457
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   458
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   459
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   460
				"Pokemon",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   461
				{"poke_ash","poke_charmander","poke_chikorita","poke_jigglypuff","poke_lugia","poke_mudkip","poke_pikachu","poke_slowpoke","poke_squirtle","poke_voltorb"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   462
				{"Ash","Charmander","Chikorita","Jigglypuff","Lugia","Mudkip","Pikachu","Slowpoke","Squirtle","Voltorb"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   463
				"FR","cm_pokemon","Default","pokeball","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   464
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   465
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   466
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   467
				"The Zoo",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   468
				{"zoo_Bat","zoo_Beaver","zoo_Bunny","zoo_Deer","zoo_Hedgehog","zoo_Moose","zoo_Pig","zoo_Porkey","zoo_Sheep","zoo_chicken","zoo_elephant","zoo_fish","zoo_frog","zoo_snail","zoo_turtle"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   469
				{"Batty","Tails","Bunny","Deer","Spikes","Horns","Bacon","Porkey","Sheepy","Chicken","Trunks","Fishy","Legs","Slimer","Roshi"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   470
				"FR","cm_hurrah","Default","Bone","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   471
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   472
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   473
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   474
				"The Devs",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   475
				{"ushanka","zoo_Sheep","bb_bob","Skull","poke_mudkip","lambda","WizardHat","sf_ryu","android","fr_lemon","mp3"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   476
				{"unC0Rr", "sheepluva", "nemo", "mikade", "koda", "burp","HeneK","Tiyuri","Xeli","Displacer","szczur"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   477
				"FR","hedgewars","Classic","Statue","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   478
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   479
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   480
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   481
				"Mushroom Kingdom",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   482
				{"sm_daisy","sm_luigi","sm_mario","sm_peach","sm_toad","sm_wario"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   483
				{"Daisy","Luigi","Mario","Princess Peach","Toad","Wario"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   484
				"FR","cm_birdy","Default","Badger","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   485
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   486
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   487
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   488
				"Pirates",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   489
				{"pirate_jack","pirate_jack_bandana"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   490
				{"Rusted Diego","Fuzzy Beard","Al.Kaholic","Morris","Yumme Gunpowder","Cutlass Cain","Jim Morgan","Silver","Dubloon Devil","Ugly Mug","Fair Wind","Scallywag","Salty Dog","Bearded Beast","Timbers","Both Barrels","Jolly Roger"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   491
				"R","cm_pirate","Pirate","chest","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   492
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   493
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   494
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   495
				"Gangsters",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   496
				{"Moustache","Cowboy","anzac","Bandit","thug","Jason","NinjaFull","chef"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   497
				{"The Boss","Jimmy","Frankie","Morris","Mooney","Knives","Tony","Meals"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   498
				"F","cm_anarchy","Mobster","deadhog","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   499
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   500
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   501
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   502
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   503
				"Twenty-Twenty",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   504
				{"Glasses","lambda","SunGlasses","Sniper","Terminator_Glasses","Moustache_glasses","doctor","punkman","rasta"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   505
				{"Specs","Speckles","Spectator","Glasses","Glassy","Harry Potter","Goggles","Clark Kent","Goggs","Lightbender","Specs Appeal","Four Eyes"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   506
				"R","cm_face","Default","eyecross","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   507
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   508
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   509
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   510
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   511
				"Monsters",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   512
				{"Skull","Jason","ShaggyYeti","Zombi","cyclops","Mummy","hogpharoah","vampirichog"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   513
				{"Bones","Jason","Yeti","Zombie","Old One Eye","Ramesses","Xerxes","Count Hogula"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   514
				"FR","cm_vampire","Default","octopus","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   515
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   516
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   517
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   518
				"The Iron Curtain",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   519
				{"ushanka","war_sovietcomrade1","war_sovietcomrade1","ushanka"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   520
				{"Alex","Sergey","Vladimir","Andrey","Dimitry","Ivan","Oleg","Kostya","Anton","Eugene"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   521
				"R","cm_soviet","Russian","skull","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   522
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   523
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   524
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   525
				"Desert Storm",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   526
				{"war_desertofficer","war_desertgrenadier1","war_desertmedic","war_desertsapper1","war_desertgrenadier2","war_desertgrenadier4","war_desertsapper2","war_desertgrenadier5"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   527
				{"Brigadier Briggs","Lt. Luke","Sgt. Smith","Corporal Calvin","Frank","Joe","Sam","Donald"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   528
				"F","cm_birdy","Default","Grave","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   529
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   530
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   531
				-- don't forget new additions need to be added to:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   532
				--pMode = {"Clowns","Street Fighters","Cybernetic Empire","Color Squad","Fruit","The Police","The Ninja-Samurai Alliance","Pokemon","The Zoo","The Devs","The Hospital"}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   533
				-- but maybe we can just get the size of this array and automatically generate a list instead
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   534
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   535
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   536
				{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   537
				"The Hospital",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   538
				{"doctor","nurse","war_britmedic","war_desertmedic","war_germanww2medic"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   539
				{"Dr. Blackwell","Dr. Drew","Dr. Harvey","Dr. Crushing","Dr. Jenner","Dr. Barnard","Dr. Parkinson","Dr. Banting","Dr. Horace","Dr. Hollows","Dr. Jung"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   540
				"R","cm_birdy","Default","heart","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   541
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   542
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   543
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   544
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   545
local colorArray = 	{
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
   546
					{0xff0204ff, "0xff0204ff", "Red"},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   547
					{0xff4980c1, "0xff4980c1", "Blue"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   548
					{0xff1de6ba, "0xff1de6ba", "Teal"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   549
					{0xffb541ef, "0xffb541ef", "Purple"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   550
					{0xffe55bb0, "0xffe55bb0", "Pink"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   551
					{0xff20bf00, "0xff20bf00", "Green"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   552
					{0xfffe8b0e, "0xfffe8b0e", "Orange"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   553
					{0xff5f3605, "0xff5f3605", "Brown"},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   554
					{0xffffff01, "0xffffff01", "Yellow"}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   555
					}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   556
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   557
local fortArray =	{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   558
					"Cake", "Castle", "Earth", "EvilChicken", "Flowerhog",
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
   559
					"Hydrant", "Lego", "Plane", "Statue", "SteelTower", "Tank",
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   560
					"UFO", "Wood"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   561
					}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   562
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   563
local gameFlagList =	{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   564
			{"gfMultiWeapon", false, gfMultiWeapon},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   565
			{"gfBorder", false, gfBorder},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   566
			{"gfSolidLand", false, gfSolidLand},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   567
			{"gfDivideTeams", false, gfDivideTeams},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   568
			{"gfLowGravity", false, gfLowGravity},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   569
			{"gfLaserSight", true, gfLaserSight},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   570
			{"gfInvulnerable", false, gfInvulnerable},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   571
			{"gfMines", false, gfMines},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   572
			{"gfVampiric", false, gfVampiric},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   573
			{"gfKarma", false, gfKarma},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   574
			{"gfArtillery", false, gfArtillery},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   575
			{"gfOneClanMode", false, gfOneClanMode},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   576
			{"gfRandomOrder", false, gfRandomOrder},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   577
			{"gfKing", false, gfKing},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   578
			{"gfPlaceHog", false, gfPlaceHog},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   579
			{"gfSharedAmmo", false, gfSharedAmmo},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   580
			{"gfDisableGirders", false, gfDisableGirders},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   581
			{"gfExplosives", false, gfExplosives},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   582
			{"gfDisableLandObjects", false, gfDisableLandObjects},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   583
			{"gfAISurvival", false, gfAISurvival},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   584
			{"gfInfAttack", true, gfInfAttack},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   585
			{"gfResetWeps", false, gfResetWeps},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   586
			{"gfResetHealth", false, gfResetHealth},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   587
			{"gfPerHogAmmo", false, gfPerHogAmmo},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   588
			{"gfDisableWind", false, gfDisableWind},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   589
			{"gfMoreWind", false, gfMoreWind},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   590
			{"gfTagTeam", false, gfTagTeam}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   591
			}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   592
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   593
 local reducedSpriteIDArray = {
11641
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   594
  sprAmRubber, sprAmGirder, sprAMSlot, sprAMAmmos, sprAMAmmosBW, sprAMCorners, sprHHTelepMask, sprTurnsLeft,
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   595
  sprSpeechCorner, sprSpeechEdge, sprSpeechTail, sprThoughtCorner, sprThoughtEdge, sprThoughtTail, sprShoutCorner,
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   596
  sprShoutEdge, sprShoutTail, sprBotlevels, sprIceTexture, sprCustom1, sprCustom2, }
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   597
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   598
 local reducedSpriteTextArray = {
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   599
  "sprAmRubber", "sprAmGirder", "sprAMSlot", "sprAMAmmos", "sprAMAmmosBW", "sprAMCorners", "sprHHTelepMask", "sprTurnsLeft",
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   600
  "sprSpeechCorner", "sprSpeechEdge", "sprSpeechTail", "sprThoughtCorner", "sprThoughtEdge", "sprThoughtTail", "sprShoutCorner",
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   601
  "sprShoutEdge", "sprShoutTail", "sprBotlevels", "sprIceTexture", "sprCustom1", "sprCustom2", }
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   602
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   603
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   604
-- placement shite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   605
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   606
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   607
local landType = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   608
local superDelete = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   609
local ufoGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   610
ufoFuel = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   611
mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   612
local portalDistance = 5000/5
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   613
local helpDisabled = false  --determines whether help popups pop up
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   614
local CG = nil -- this is the visual gear displayed at CursorX, CursorY
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   615
local crateSprite = nil-- this is a visual gear aid for crate placement
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   616
local tSpr = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   617
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   618
local cGear = nil -- detects placement of girders and objects (using airattack)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   619
local curWep = amNothing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   620
local leftHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   621
local rightHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   622
local preciseOn = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   623
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   624
-- primary placement categories
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   625
local cIndex = 1 -- category index
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   626
local cat = 	{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   627
				loc("Girder Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   628
				loc("Rubber Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   629
				loc("Mine Placement Mode"),
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
   630
				loc("Dud Mine Placement Mode"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   631
				loc("Sticky Mine Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   632
				loc("Air Mine Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   633
				loc("Barrel Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   634
				loc("Health Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   635
				loc("Weapon Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   636
				loc("Utility Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   637
				loc("Target Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   638
				loc("Cleaver Placement Mode"),
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
   639
				loc("Repositioning Mode"),
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
   640
				loc("Goal Mode"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   641
				loc("Hog Identity Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   642
				loc("Team Identity Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   643
				loc("Health Modification Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   644
				--loc("Sprite Testing Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   645
				loc("Sprite Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   646
				loc("Sprite Modification Mode"),
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
   647
				loc("Waypoint Mode")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   648
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   649
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   650
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   651
local pMode = {}	-- pMode contains custom subsets of the main categories
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   652
local pIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   653
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   654
local genTimer = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   655
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   656
local CGR = 1 -- current girder rotation, we actually need this as HW remembers what rotation you last used
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   657
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   658
local placedX = {} -- x coord of placed object
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   659
local placedY = {} -- y coord of placed object
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   660
local placedSpec = {} -- this is different depending on what was placed, for mines it is their time, for crates it is their content, (for girders/rubbers it used to be their rotation, and for sprites, their name, but this has been moved to different variables to allow more complex / smooth editing)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   661
local placedType = {} -- what kind of object was placed: mine, crate, girder, rubber, barrel, etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   662
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   663
local placedTint = {} -- only girders/rubbers/sprites use this, it is their tint / colouration
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   664
local placedSprite = {} -- what sprite was placed
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   665
local placedFrame = {} -- what frame of sprite was placed (rotation for girders / rubber)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   666
local placedLandFlags = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   667
local placedHWMapFlag = {} -- this is what HWMapConverter uses
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   668
local placedCount = 0 -- do we really need this?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   669
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   670
local sSprite -- sprite overlay that glows to show selected sprites
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   671
local sCirc -- circle that appears around selected gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   672
local sGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   673
local closestDist
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   674
local closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   675
local closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   676
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   677
------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   678
-- SOME GENERAL METHODS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   679
------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   680
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   681
function BoolToString(boo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   682
	if boo == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   683
		return("true")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   684
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   685
		return("false")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   686
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   687
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   688
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   689
function GetDistFromGearToXY(gear, g2X, g2Y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   690
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   691
	g1X, g1Y = GetGearPosition(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   692
	q = g1X - g2X
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   693
	w = g1Y - g2Y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   694
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   695
	return ( (q*q) + (w*w) )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   696
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   697
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   698
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   699
------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   700
-- STUFF FOR LOADING SPECIAL POINTS / HWMAP CONVERSION
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   701
------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   702
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   703
local specialPointsX = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   704
local specialPointsY = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   705
local specialPointsFlag = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   706
local specialPointsCount = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   707
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   708
function onSpecialPoint(x,y,flag)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   709
    specialPointsX[specialPointsCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   710
    specialPointsY[specialPointsCount] = y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   711
	specialPointsFlag[specialPointsCount] = flag
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   712
    specialPointsCount = specialPointsCount + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   713
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   714
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   715
-- you know you could probably add multiple layers to this to get more points
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   716
-- after the first set is expended have the last 1 be 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   717
-- and then increment some other counter so like
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   718
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   719
-- this function interprets special points that have been embedded into an HWPMAP
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   720
function InterpretPoints()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   721
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   722
	-- flags run from 0 to 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   723
	for i = 0, (specialPointsCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   724
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   725
		-- Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   726
		if specialPointsFlag[i] == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   727
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   728
		elseif specialPointsFlag[i] == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   729
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 1000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   730
		elseif specialPointsFlag[i] == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   731
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 2000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   732
		elseif specialPointsFlag[i] == 4 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   733
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 3000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   734
		elseif specialPointsFlag[i] == 5 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   735
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 4000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   736
		elseif specialPointsFlag[i] == 6 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   737
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 5000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   738
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   739
		-- Sticky Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   740
		elseif specialPointsFlag[i] == 7 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   741
			AddGear(specialPointsX[i], specialPointsY[i], gtSMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   742
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   743
		-- Air Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   744
		elseif specialPointsFlag[i] == 8 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   745
			AddGear(specialPointsX[i], specialPointsY[i], gtAirMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   746
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   747
		-- Health Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   748
		elseif specialPointsFlag[i] == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   749
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),25)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   750
		elseif specialPointsFlag[i] == 10 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   751
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),50)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   752
		elseif specialPointsFlag[i] == 11 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   753
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),75)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   754
		elseif specialPointsFlag[i] == 12 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   755
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   756
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   757
		-- Cleaver
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   758
		elseif specialPointsFlag[i] == 13 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   759
			AddGear(specialPointsX[i], specialPointsY[i], gtKnife, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   760
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   761
		-- Target
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   762
		elseif specialPointsFlag[i] == 14 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   763
			AddGear(specialPointsX[i], specialPointsY[i], gtTarget, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   764
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   765
		--Barrels
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   766
		elseif specialPointsFlag[i] == 15 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   767
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   768
		elseif specialPointsFlag[i] == 16 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   769
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),25)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   770
		elseif specialPointsFlag[i] == 17 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   771
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),50)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   772
		elseif specialPointsFlag[i] == 18 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   773
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),75)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   774
		elseif specialPointsFlag[i] == 19 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   775
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   776
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   777
		-- There are about 58+- weps / utils
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   778
		-- Weapon Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   779
		elseif (specialPointsFlag[i] >= 20) and (specialPointsFlag[i] < (#atkArray+20)) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   780
			tempG = SpawnAmmoCrate(specialPointsX[i],specialPointsY[i],atkArray[specialPointsFlag[i]-19][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   781
			setGearValue(tempG,"caseType","ammo")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   782
			setGearValue(tempG,"contents",atkArray[specialPointsFlag[i]-19][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   783
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   784
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   785
		-- Utility Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   786
		elseif (specialPointsFlag[i] >= (#atkArray+20)) and (specialPointsFlag[i] < (#atkArray+20+#utilArray)) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   787
			tempG = SpawnUtilityCrate(specialPointsX[i],specialPointsY[i],utilArray[specialPointsFlag[i]-19-#atkArray][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   788
			setGearValue(tempG,"caseType","util")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   789
			setGearValue(tempG,"contents",utilArray[specialPointsFlag[i]-19-#atkArray][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   790
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   791
		--79-82 (reserved for future wep crates)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   792
		--89,88,87,86 and 85,84,83,82 (reserved for the 2 custom sprites and their landflags)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   793
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   794
		--90-99 reserved for scripted structures
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   795
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   796
		elseif specialPointsFlag[i] == 98 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   797
			portalDistance = div(specialPointsX[i],5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   798
			ufoFuel = specialPointsY[i]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   799
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   800
		-- Normal Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   801
		elseif specialPointsFlag[i] == 100 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   802
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   803
		elseif specialPointsFlag[i] == 101 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   804
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   805
		elseif specialPointsFlag[i] == 102 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   806
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   807
		elseif specialPointsFlag[i] == 103 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   808
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   809
		elseif specialPointsFlag[i] == 104 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   810
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   811
		elseif specialPointsFlag[i] == 105 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   812
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   813
		elseif specialPointsFlag[i] == 106 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   814
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   815
		elseif specialPointsFlag[i] == 107 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   816
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 4294967295, nil, nil, nil, lfNormal)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   817
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   818
		-- Invulnerable Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   819
		elseif specialPointsFlag[i] == 108 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   820
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   821
		elseif specialPointsFlag[i] == 109 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   822
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   823
		elseif specialPointsFlag[i] == 110 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   824
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   825
		elseif specialPointsFlag[i] == 111 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   826
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   827
		elseif specialPointsFlag[i] == 112 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   828
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   829
		elseif specialPointsFlag[i] == 113 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   830
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   831
		elseif specialPointsFlag[i] == 114 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   832
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   833
		elseif specialPointsFlag[i] == 115 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   834
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 2516582650, nil, nil, nil, lfIndestructible)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   835
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   836
		-- Icy Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   837
		elseif specialPointsFlag[i] == 116 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   838
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   839
		elseif specialPointsFlag[i] == 117 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   840
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   841
		elseif specialPointsFlag[i] == 118 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   842
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   843
		elseif specialPointsFlag[i] == 119 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   844
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   845
		elseif specialPointsFlag[i] == 120 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   846
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   847
		elseif specialPointsFlag[i] == 121 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   848
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   849
		elseif specialPointsFlag[i] == 121 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   850
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   851
		elseif specialPointsFlag[i] == 123 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   852
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 16448250, nil, nil, nil, lfIce)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   853
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   854
		-- Rubber Bands
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   855
		elseif specialPointsFlag[i] == 124 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   856
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 0, 4294967295, nil, nil, nil, lfBouncy)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   857
		elseif specialPointsFlag[i] == 125 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   858
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 1, 4294967295, nil, nil, nil, lfBouncy)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   859
		elseif specialPointsFlag[i] == 126 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   860
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 2, 4294967295, nil, nil, nil, lfBouncy)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   861
		elseif specialPointsFlag[i] == 127 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   862
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 3, 4294967295, nil, nil, nil, lfBouncy)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   863
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   864
		-- Waypoints
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   865
		else -- 0 / no value
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   866
			PlaceWaypoint(specialPointsX[i],specialPointsY[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   867
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   868
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   869
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   870
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   871
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   872
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   873
--shoppabalance crap
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   874
function AddShoppaPoint(x,y,c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   875
	table.insert(shoppaPX, x)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   876
	table.insert(shoppaPY, y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   877
	table.insert(shoppaPR, c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   878
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   879
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   880
function GetRankedColour(r)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   881
	if r == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   882
		return(0xFF0000FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   883
	elseif r == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   884
		return(0xFFFF00FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   885
	elseif r == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   886
		return(0x00FF00FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   887
	elseif r == 4 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   888
		return(0x0000FFFF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   889
	elseif r == 5 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   890
		return(0xFF00FFFF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   891
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   892
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   893
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   894
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   895
-- PRIMARY HEDGE EDITOR PLACEMENT STUFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   896
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   897
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   898
function GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   899
	closestDist = 999999999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   900
	closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   901
	runOnGears(SelectGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   902
	return(closestGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   903
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   904
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   905
function SelectGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   906
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   907
	d = GetDistFromGearToXY(gear, placedX[placedCount], placedY[placedCount])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   908
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   909
	if d < closestDist then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   910
		closestDist = d
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   911
		closestGear = gear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   912
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   913
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   914
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   915
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   916
function PlaceWaypoint(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   917
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   918
	placedX[placedCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   919
	placedY[placedCount] = y
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
   920
	placedType[placedCount] = loc("Waypoint Mode")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   921
	placedLandFlags[placedCount] = nil -- use this to specify waypoint type maybe
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   922
	placedHWMapFlag[placedCount] = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   923
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   924
	placedSprite[placedCount] = vgtCircle
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   925
	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   926
	placedTint[placedCount] = 0xFF0000FF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   927
	placedFrame[placedCount] = 1										--rad is 450
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   928
	SetVisualGearValues(placedSpec[placedCount], x, y, 20, 100, 1, 10, 0, 450, 5, placedTint[placedCount])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   929
	placedCount = placedCount +1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   930
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   931
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   932
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   933
function LoadSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   934
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   935
	placedX[placedCount] = pX
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   936
	placedY[placedCount] = pY
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   937
	placedSpec[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   938
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   939
	if pSprite == sprAmGirder then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   940
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   941
		placedType[placedCount] = loc("Girder Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   942
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   943
		--newHWMapStuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   944
		if pLandFlags == lfIndestructible then	specialMod = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   945
		elseif pLandFlags == lfIce then	specialMod = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   946
		else specialMod = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   947
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   948
		placedHWMapFlag[placedCount] = pFrame+100+(8*specialMod)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   949
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   950
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   951
	elseif pSprite == sprAmRubber then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   952
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   953
		placedType[placedCount] = loc("Rubber Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   954
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   955
		--newHWMapStuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   956
		if pFrame == 0 then placedHWMapFlag[placedCount] = 124
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   957
		elseif pFrame == 1 then placedHWMapFlag[placedCount] = 125
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   958
		elseif pFrame == 2 then placedHWMapFlag[placedCount] = 126
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   959
		elseif pFrame == 3 then placedHWMapFlag[placedCount] = 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   960
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   961
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   962
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   963
		placedType[placedCount] = loc("Sprite Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   964
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   965
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   966
	if pLandFlags == lfIce then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   967
		placedLandFlags[placedCount] = "lfIce"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   968
	elseif pLandFlags == lfIndestructible then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   969
		placedLandFlags[placedCount] = "lfIndestructible"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   970
	elseif pLandFlags == lfBouncy then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   971
		placedLandFlags[placedCount] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   972
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   973
		placedLandFlags[placedCount] = "lfNormal"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   974
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   975
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   976
	placedTint[placedCount] = pTint
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   977
	placedFrame[placedCount] = pFrame
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   978
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   979
	placedSprite[placedCount] = pSprite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   980
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   981
	PlaceSprite(pX, pY, pSprite, pFrame, pTint,	nil, nil, nil, pLandFlags)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   982
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   983
	placedCount = placedCount + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   984
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   985
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   986
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   987
function CallPlaceSprite(pID)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   988
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   989
	if landType == lfIce then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   990
		placedLandFlags[pID] = "lfIce"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   991
		placedTint[pID] = 250 + (250*0x100) + (250*0x10000) + (0*0x1000000) -- A BGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   992
	elseif landType == lfIndestructible then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   993
		placedLandFlags[pID] = "lfIndestructible"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   994
		placedTint[pID] = 250 + (0*0x100) + (0*0x10000) + (150*0x1000000) -- A BGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   995
	elseif landType == lfBouncy then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   996
		placedLandFlags[pID] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   997
		placedTint[pID] = 250 + (0*0x100) + (250*0x10000) + (0*0x1000000) -- A BGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   998
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   999
		placedLandFlags[pID] = "lfNormal"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1000
		--placedTint[pID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1001
		placedTint[pID] = 255 + (255*0x100) + (255*0x10000) + (255*0x1000000) -- A BGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1002
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1003
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1004
	PlaceSprite(placedX[pID], placedY[pID], placedSprite[pID], placedFrame[pID],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1005
		placedTint[pID],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1006
		nil, -- overrite existing land
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1007
		nil, nil, -- this stuff specifies flipping
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1008
		landType)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1009
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1010
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1011
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1012
function SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1013
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1014
	closestDist = 999999999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1015
	closestSpriteID = nil -- just in case
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1016
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1017
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1018
		if (placedType[i] == loc("Girder Placement Mode"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1019
			or (placedType[i] == loc("Rubber Placement Mode"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1020
			or (placedType[i] == loc("Sprite Placement Mode"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1021
		then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1022
				q = placedX[i] - placedX[placedCount]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1023
				w = placedY[i] - placedY[placedCount]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1024
				d = ( (q*q) + (w*w) )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1025
				if d < closestDist then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1026
					closestDist = d
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1027
					closestSpriteID = i
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  1028
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1029
					newTint = 0xFF00FFFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1030
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  1031
					SetVisualGearValues(sSprite, placedX[i], placedY[i], 0, 0, nil, placedFrame[i], 10000, placedSprite[i], 10000, newTint )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1032
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1033
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1034
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1035
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1036
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1037
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1038
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1039
function EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1040
	if closestSpriteID ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1041
		EraseSprite(placedX[closestSpriteID], placedY[closestSpriteID], placedSprite[closestSpriteID], placedFrame[closestSpriteID],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1042
                    nil, -- erase land only where the pixels match the land flag provided
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1043
                    nil, -- only erase the provided land flags. don't touch other land flags or LandPixels
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1044
                    nil, -- flip sprite horizontally
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1045
                    nil, -- flip sprite vertically
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1046
                    placedLandFlags[closestSpriteID])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1047
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1048
		placedX[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1049
		placedY[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1050
		placedSpec[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1051
		placedType[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1052
		placedTint[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1053
		placedSprite[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1054
		placedFrame[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1055
		placedLandFlags[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1056
		closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1057
		SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1058
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1059
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1060
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1061
-- work this into the above two functions and edit them, later
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1062
function EraseClosestWaypoint()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1063
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1064
	closestDist = 999999999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1065
	closestSpriteID = nil -- just in case
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1066
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1067
	for i = 0, (placedCount-1) do
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1068
		if (placedType[i] == loc("Waypoint Mode")) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1069
				q = placedX[i] - placedX[placedCount]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1070
				w = placedY[i] - placedY[placedCount]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1071
				d = ( (q*q) + (w*w) )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1072
				if d < closestDist then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1073
					closestDist = d
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1074
					closestSpriteID = i
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1075
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  1076
					SetVisualGearValues(sSprite, placedX[i], placedY[i], 0, 0, nil, placedFrame[i], 10000, placedSprite[i], 10000, newTint )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1077
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1078
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1079
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1080
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1081
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1082
	if closestSpriteID ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1083
		DeleteVisualGear(placedSpec[closestSpriteID])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1084
		placedX[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1085
		placedY[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1086
		placedSpec[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1087
		placedType[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1088
		placedTint[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1089
		placedSprite[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1090
		placedFrame[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1091
		placedLandFlags[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1092
		closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1093
		SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1094
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1095
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1096
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1097
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1098
-- essentially called when user clicks the mouse
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1099
-- with girders or an airattack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1100
function PlaceObject(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1101
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1102
	placedX[placedCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1103
	placedY[placedCount] = y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1104
	placedType[placedCount] = cat[cIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1105
	placedSpec[placedCount] = pMode[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1106
	placedTint[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1107
	placedFrame[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1108
	placedLandFlags[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1109
	placedSprite[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1110
	placedHWMapFlag[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1111
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1112
	if cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1113
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1114
		if superDelete == false then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1115
			--lfObject and lfBasic
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1116
			placedFrame[placedCount] = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1117
			placedSprite[placedCount] = sprAmGirder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1118
			CallPlaceSprite(placedCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1119
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1120
			if landType == lfIndestructible then	specialMod = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1121
			elseif landType == lfIce then	specialMod = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1122
			else specialMod = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1123
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1124
			placedHWMapFlag[placedCount] = CGR+100+(8*specialMod)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1125
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1126
			placedType[placedCount] = "bogus" -- we need this so we don't think we've placed a new girder and are trying to erase the things we just placed??
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1127
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1128
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1129
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1130
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1131
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1132
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1133
		if superDelete == false then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1134
			placedFrame[placedCount] = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1135
			placedSprite[placedCount] = sprAmRubber
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1136
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1137
			--new ermagerd
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1138
			placedLandFlags[placedCount] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1139
			placedTint[placedCount] = 255 + (255*0x100) + (255*0x10000) + (255*0x1000000) -- A BGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1140
			PlaceSprite(placedX[placedCount], placedY[placedCount], placedSprite[placedCount], placedFrame[placedCount],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1141
				placedTint[placedCount],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1142
				nil,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1143
				nil, nil,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1144
				landType)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1145
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1146
			if CGR == 0 then placedHWMapFlag[placedCount] = 124
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1147
			elseif CGR == 1 then placedHWMapFlag[placedCount] = 125
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1148
			elseif CGR == 2 then placedHWMapFlag[placedCount] = 126
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1149
			elseif CGR == 3 then placedHWMapFlag[placedCount] = 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1150
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1151
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1152
			placedType[placedCount] = "bogus"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1153
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1154
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1155
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1156
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1157
	elseif cat[cIndex] == loc("Target Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1158
		gear = AddGear(x, y, gtTarget, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1159
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1160
		gear = AddGear(x, y, gtKnife, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1161
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1162
		gear = SpawnHealthCrate(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1163
		SetHealth(gear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1164
		setGearValue(gear,"caseType","med")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1165
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1166
		gear = SpawnAmmoCrate(x, y, atkArray[pIndex][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1167
		placedSpec[placedCount] = atkArray[pIndex][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1168
		setGearValue(gear,"caseType","ammo")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1169
		setGearValue(gear,"contents",atkArray[pIndex][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1170
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1171
		gear = SpawnUtilityCrate(x, y, utilArray[pIndex][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1172
		placedSpec[placedCount] = utilArray[pIndex][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1173
		setGearValue(gear,"caseType","util")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1174
		setGearValue(gear,"contents",utilArray[pIndex][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1175
	elseif cat[cIndex] == loc("Barrel Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1176
		gear = AddGear(x, y, gtExplosives, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1177
		SetHealth(gear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1178
	elseif cat[cIndex] == loc("Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1179
		gear = AddGear(x, y, gtMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1180
		SetTimer(gear, pMode[pIndex])
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1181
	elseif cat[cIndex] == loc("Dud Mine Placement Mode") then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1182
		gear = AddGear(x, y, gtMine, 0, 0, 0, 0)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1183
		SetHealth(gear, 0)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1184
		SetGearValues(gear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 36 - pMode[pIndex])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1185
	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1186
		gear = AddGear(x, y, gtSMine, 0, 0, 0, 0)
11989
a6f4e4265d2e HedgeEditor: Allow to set sticky mine timer
Wuzzy <almikes@aol.com>
parents: 11988
diff changeset
  1187
		SetTimer(gear, pMode[pIndex])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1188
	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1189
		gear = AddGear(x, y, gtAirMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1190
		SetTimer(gear, pMode[pIndex])
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1191
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1192
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1193
		if pMode[pIndex] == loc("Selection Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1194
			sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1195
		elseif pMode[pIndex] == loc("Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1196
			if sGear ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1197
				SetGearPosition(sGear, x, y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1198
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1199
		elseif pMode[pIndex] == loc("Deletion Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1200
			sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1201
			if (sGear ~= nil) and (GetGearType(sGear) ~= gtHedgehog) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1202
				DeleteGear(sGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1203
				sGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1204
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1205
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1206
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1207
	elseif (cat[cIndex] == loc("Hog Identity Mode")) or (cat[cIndex] == loc("Team Identity Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1208
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1209
		sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1210
		if (sGear ~= nil) and (GetGearType(sGear) == gtHedgehog) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1211
			if (cat[cIndex] == loc("Hog Identity Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1212
				SetHogProfile(sGear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1213
			else -- set for the whole team
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1214
				SetTeamIdentity(sGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1215
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1216
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1217
			AddCaption(loc("Please click on a hedgehog."),0xffba00ff,capgrpVolume)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1218
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1219
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1220
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1221
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1222
	elseif cat[cIndex] == loc("Health Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1223
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1224
		sGear = GetClosestGear()
11640
4865e715fb49 Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11639
diff changeset
  1225
		local gt = GetGearType(sGear)
4865e715fb49 Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11639
diff changeset
  1226
		if gt == gtHedgehog or gt == gtExplosives or (gt == gtCase and GetGearPos(sGear) == 0x2) then
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1227
			if pMode[pIndex][2] == "set" then
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1228
				SetHealth(sGear, pMode[pIndex][1])
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1229
			elseif pMode[pIndex][2] == "mod" then
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1230
				local newHealth = math.max(1, GetHealth(sGear) + tonumber(pMode[pIndex][1]))
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1231
				SetHealth(sGear, newHealth)
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1232
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1233
		else
11640
4865e715fb49 Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11639
diff changeset
  1234
			AddCaption(loc("Please click on a hedgehog, barrel or health crate."),0xffba00ff,capgrpVolume)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1235
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1236
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1237
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1238
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1239
		SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1240
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1241
		if closestSpriteID ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1242
			if pMode[pIndex] == loc("LandFlag Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1243
				EraseSprite(placedX[closestSpriteID], placedY[closestSpriteID], placedSprite[closestSpriteID], placedFrame[closestSpriteID], nil, nil, nil, nil, placedLandFlags[closestSpriteID])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1244
				CallPlaceSprite(closestSpriteID)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1245
				closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1246
				SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1247
			elseif pMode[pIndex] == loc("Sprite Erasure Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1248
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1249
				EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1250
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1251
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1252
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1253
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1254
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1255
	elseif cat[cIndex] == loc("Goal Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1256
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1257
		sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1258
		if sGear ~= nil then  -- used to be closestGear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1259
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1260
			if getGearValue(sGear,"tag") == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1261
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1262
				if pMode[pIndex] == loc("Victory Condition: Collect") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1263
					if GetGearType(sGear) == gtCase then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1264
						setGearValue(sGear, "tag","collection")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1265
					else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1266
						AddCaption(loc("Please click on a crate."),0xffba00ff,capgrpVolume)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1267
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1268
				else
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1269
					if pMode[pIndex] == loc("Victory Condition: Destroy") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1270
						setGearValue(sGear, "tag","victory")
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1271
					elseif pMode[pIndex] == loc("Losing Condition: Destroy") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1272
						setGearValue(sGear, "tag","failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1273
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1274
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1275
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1276
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1277
				-- remove tag and delete circ
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1278
				setGearValue(sGear, "tag", nil)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1279
				DeleteVisualGear(getGearValue(sGear,"tCirc"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1280
				setGearValue(sGear, "tCirc", nil)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1281
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1282
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1283
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1284
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1285
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1286
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1287
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1288
	elseif cat[cIndex] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1289
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1290
		if superDelete == false then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1291
			placedFrame[placedCount] = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1292
			placedSprite[placedCount] = reducedSpriteIDArray[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1293
			CallPlaceSprite(placedCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1294
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1295
			placedType[placedCount] = "bogus"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1296
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1297
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1298
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1299
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1300
	elseif cat[cIndex] == loc("Waypoint Mode") then
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1301
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1302
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1303
		if pMode[pIndex] == loc("Delete Waypoint") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1304
			EraseClosestWaypoint()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1305
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1306
			PlaceWaypoint(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1307
			placedCount = placedCount - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1308
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1309
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1310
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1311
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1312
	placedCount = placedCount + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1313
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1314
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1315
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1316
-- called when user changes primary selection
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1317
-- either via up/down keys
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1318
-- or selecting girder/airattack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1319
function RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1320
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1321
	superDelete = false -- fairly new addition
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1322
	landType = 0 --- fairly new addition
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1323
	pIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1324
	pMode = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1325
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1326
	if cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1327
		pIndex = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1328
		pMode = {loc("Girder")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1329
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1330
		pIndex = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1331
		pMode = {loc("Rubber")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1332
		landType = lfBouncy -- for now, let's not allow anything else (-- fairly new addition)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1333
	elseif cat[cIndex] == loc("Target Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1334
		pMode = {loc("Standard Target")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1335
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1336
		pMode = {loc("Standard Cleaver")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1337
	elseif cat[cIndex] == loc("Barrel Placement Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1338
		pMode = {60,80,100,120,160,200,240,1,10,20,30,40,50}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1339
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1340
		pMode = {25,30,40,50,75,100,150,200,5,10,15,20}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1341
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1342
		for i = 1, #atkArray do
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  1343
			pMode[i] = atkArray[i][4]
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1344
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1345
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1346
		for i = 1, #utilArray do
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  1347
			pMode[i] = utilArray[i][4]
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1348
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1349
	elseif cat[cIndex] == loc("Mine Placement Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1350
		pMode = {3000,4000,5000,0,1000,2000}
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1351
	elseif cat[cIndex] == loc("Dud Mine Placement Mode") then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1352
		pMode = {36,48,60,72,96,1,6,12,18,24}
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1353
	elseif cat[cIndex] == loc("Mine Placement Mode") then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1354
		pMode = {3000,4000,5000,0,1000,2000}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1355
	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1356
		pMode = {500,1000,1500,2000,2500,0}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1357
	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1358
		pMode = {750,1000,1250,0,250,500}
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1359
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1360
		pMode = {loc("Selection Mode"),loc("Placement Mode"), loc("Deletion Mode")}
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1361
	elseif cat[cIndex] == loc("Goal Mode") then
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1362
		pMode = {loc("Victory Condition: Destroy"),loc("Losing Condition: Destroy"),loc("Victory Condition: Collect")}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1363
	elseif cat[cIndex] == loc("Hog Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1364
		pMode = {loc("Soldier"),loc("Grenadier"),loc("Sniper"),loc("Pyro"),loc("Ninja"),loc("Commander"),loc("Chef"),loc("Engineer"),loc("Physicist"),loc("Trapper"),loc("Saint"),loc("Clown")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1365
	elseif cat[cIndex] == loc("Team Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1366
		pMode = {"Clowns","Street Fighters","Cybernetic Empire","Color Squad","Fruit","The Police","The Ninja-Samurai Alliance","Pokemon","The Zoo","The Devs","Mushroom Kingdom","Pirates","Gangsters","Twenty-Twenty","Monsters","The Iron Curtain","The Hospital"}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1367
	elseif cat[cIndex] == loc("Health Modification Mode") then
11990
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1368
		pMode = { {100, "set"}, {125, "set"}, {150, "set"}, {200, "set"}, {300, "set"}, {1000, "set"},
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1369
			{"-100", "mod"}, {"-10", "mod"}, {"-1", "mod"}, {"+1", "mod"}, {"+10", "mod"}, {"+100", "mod"},
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1370
			{1, "set"}, {10, "set"}, {15, "set"}, {20, "set"}, {25, "set"}, {30, "set"}, {40, "set"}, {50, "set"}, {75, "set"}, 
c3866ee03b82 HedgeEditor: Tweak and reorder health/timer selection numbers
Wuzzy <almikes@aol.com>
parents: 11989
diff changeset
  1371
} 
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1372
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1373
		pMode = {loc("LandFlag Modification Mode"),loc("Sprite Erasure Mode")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1374
	elseif cat[cIndex] == loc("Sprite Testing Mode") or cat[cIndex] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1375
		for i = 1, #reducedSpriteTextArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1376
			pMode[i] = reducedSpriteTextArray[i]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1377
		end
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1378
	elseif cat[cIndex] == loc("Waypoint Mode") then
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1379
		pMode = {loc("Place Waypoint"), loc("Delete Waypoint")}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1380
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1381
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1382
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1383
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1384
------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1385
-- LOADING AND SAVING DATA STUFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1386
------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1387
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1388
-- paste data you have saved previously here
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1389
function LoadLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1390
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1391
	if (mapID == nil) or (mapID == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1392
		LoadMap(1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1393
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1394
		LoadMap(mapID)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1395
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1396
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1397
	for i = 1, techCount-1 do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1398
		PlaceWaypoint(techX[i],techY[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1399
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1400
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1401
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1402
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1403
-- When you save your level, this function
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1404
-- generates the AddTeam and AddHog function calls for onGameInit()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1405
function GetDataForSavingHogs(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1406
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1407
	--this is a quick hack so that the human team(s) will always be
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1408
	--given the first move ahead of the AI
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1409
	local tempDataList = {}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1410
	if GetHogLevel(gear) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1411
		tempDataList = hogDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1412
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1413
		tempDataList = AIHogDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1414
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1415
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1416
	if GetHogTeamName(gear) ~= lastRecordedTeam then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1417
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1418
		teamCounter = teamCounter + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1419
		if teamCounter == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1420
			teamCounter = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1421
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1422
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1423
		-- try match team colour to the colours recorded in the colour array
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1424
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1425
		local tColor = 0x00000000
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1426
		for i = 1, #colorArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1427
			if GetClanColor(GetHogClan(gear)) == colorArray[i][1] then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1428
				tColor = colorArray[i][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1429
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1430
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1431
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1432
		-- no match, just give him a default colour from the array, then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1433
		if tColor == 0x00000000 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1434
			tColor = colorArray[teamCounter][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1435
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1436
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1437
		if getGearValue(gear,"grave") == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1438
			tFort = fortArray[1+GetRandom(#fortArray)]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1439
			tGrave = GetHogGrave(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1440
			tFlag = GetHogFlag(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1441
			tVoice = GetHogVoicepack(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1442
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1443
			tGrave = getGearValue(gear,"grave")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1444
			tFort = getGearValue(gear,"fort")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1445
			tFlag = getGearValue(gear,"flag")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1446
			tVoice = getGearValue(gear,"voice")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1447
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1448
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1449
		lastRecordedTeam = GetHogTeamName(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1450
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1451
		table.insert(tempDataList, "")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1452
		table.insert	(tempDataList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1453
						"	AddTeam(\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1454
						GetHogTeamName(gear) .."\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1455
						", " .. "\"" ..tColor .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1456
						", " .. "\"" .. tGrave .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1457
						", " .. "\"" .. tFort .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1458
						", " .. "\"" .. tVoice .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1459
						", " .. "\"" .. tFlag .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1460
						")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1461
						)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1462
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1463
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1464
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1465
	table.insert(hhs, gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1466
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1467
	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1468
					GetHogName(gear) .. "\", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1469
					GetHogLevel(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1470
					GetHealth(gear) .. ", \"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1471
					GetHogHat(gear) .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1472
					")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1473
			)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1474
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1475
	table.insert	(tempDataList,"	SetGearPosition(hhs[" .. #hhs .. "], " .. GetX(gear) .. ", " .. GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1476
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1477
	if getGearValue(gear,"tag") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1478
		table.insert	(tempDataList,"	setGearValue(hhs[" .. #hhs .. "], \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1479
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1480
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1481
	-- save the ammo values for each gear, we will call this later
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1482
	-- when we want to output it to console
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1483
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1484
	if getGearValue(gear,"ranking") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1485
		table.insert(shoppaPointList, "AddShoppaPoint(" .. GetX(gear) .. ", " .. GetY(gear) .. ", " .. getGearValue(gear,"ranking") .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1486
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1487
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1488
	for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1489
		setGearValue(gear, atkArray[i][1], GetAmmoCount(gear, atkArray[i][1]))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1490
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1491
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1492
	for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1493
		setGearValue(gear, utilArray[i][1], GetAmmoCount(gear, utilArray[i][1]))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1494
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1495
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1496
	if GetHogLevel(gear) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1497
		hogDataList = tempDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1498
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1499
		AIHogDataList = tempDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1500
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1501
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1502
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1503
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1504
-- output hog and team data to the console
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1505
function SaveHogData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1506
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1507
	teamCounter = 0
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1508
	lastRecordedTeam = ""
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1509
	hhs = {}
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1510
	shoppaPointList = {}
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1511
	hogDataList = {}
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1512
	AIHogDataList = {}
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1513
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1514
	runOnHogs(GetDataForSavingHogs)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1515
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1516
	WriteLnToConsole("	------ TEAM LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1517
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1518
	for i = 1, #hogDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1519
		WriteLnToConsole(hogDataList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1520
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1521
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1522
	for i = 1, #AIHogDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1523
		WriteLnToConsole(AIHogDataList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1524
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1525
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1526
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1527
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1528
	if #shoppaPointList > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1529
		WriteLnToConsole("	------ SHOPPA POINT LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1530
		for i = 1, #shoppaPointList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1531
			WriteLnToConsole(shoppaPointList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1532
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1533
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1534
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1535
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1536
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1537
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1538
-- generates an onGameInit() template with scheme data, team adds, and hogs
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1539
function SaveConfigData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1540
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1541
	WriteLnToConsole("function onGameInit()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1542
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1543
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1544
	temp = "	EnableGameFlags(gfDisableWind"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1545
	for i = 1, #gameFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1546
		if gameFlagList[i][2] == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1547
			temp = temp .. ", ".. gameFlagList[i][1]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1548
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1549
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1550
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1551
	WriteLnToConsole("	ClearGameFlags()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1552
	WriteLnToConsole(temp .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1553
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1554
	WriteLnToConsole("	Map = \"" .. Map .. "\"")
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1555
	WriteLnToConsole("	Seed = \"" .. Seed .. "\"")
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1556
	WriteLnToConsole("	Theme = " .. Theme .. "\"")
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1557
	WriteLnToConsole("	MapGen = " .. MapGen)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1558
	WriteLnToConsole("	MapFeatureSize = " .. MapFeatureSize)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1559
	WriteLnToConsole("	TemplateFilter = " .. TemplateFilter)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1560
	WriteLnToConsole("	TemplateNumber = " .. TemplateNumber)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1561
	WriteLnToConsole("	TurnTime = " .. TurnTime)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1562
	WriteLnToConsole("	Explosives = " .. Explosives)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1563
	WriteLnToConsole("	MinesNum = " .. MinesNum)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1564
	WriteLnToConsole("	CaseFreq = " .. CaseFreq)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1565
	WriteLnToConsole("	Delay = " .. Delay)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1566
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1567
	WriteLnToConsole("	HealthCaseProb = " .. HealthCaseProb)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1568
	WriteLnToConsole("	HealthCaseAmount = " .. HealthCaseAmount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1569
	WriteLnToConsole("	DamagePercent = " .. DamagePercent)
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1570
	WriteLnToConsole("	RopePercent = " .. RopePercent)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1571
	WriteLnToConsole("	MinesTime = " .. MinesTime)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1572
	WriteLnToConsole("	MineDudPercent  = " .. MineDudPercent)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1573
	WriteLnToConsole("	SuddenDeathTurns = " .. SuddenDeathTurns)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1574
	WriteLnToConsole("	WaterRise = " .. WaterRise)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1575
	WriteLnToConsole("	HealthDecrease = " .. HealthDecrease)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1576
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1577
	WriteLnToConsole("	Ready = " .. Ready)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1578
	WriteLnToConsole("	AirMinesNum = " .. AirMinesNum)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1579
	--WriteLnToConsole("	ScriptParam = " .. ScriptParam)
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1580
	WriteLnToConsole("	GetAwayTime = " .. GetAwayTime)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1581
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1582
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1583
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1584
	SaveHogData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1585
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1586
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1587
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1588
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1589
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1590
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1591
-- output gear data as special points to be placed in a converted HWMAP, readable by InterpretPoints()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1592
function ConvertGearDataToHWPText()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1593
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1594
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1595
	WriteLnToConsole("--BEGIN HWMAP CONVERTER POINTS--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1596
	WriteLnToConsole("-- You can paste this data into the HWMAP converter if needed.")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1597
	WriteLnToConsole("--[[")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1598
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1599
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1600
	for i = 1, #hFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1601
		WriteLnToConsole(hFlagList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1602
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1603
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1604
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1605
	WriteLnToConsole("]]")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1606
	WriteLnToConsole("--END HWMAP CONVERTER POINTS--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1607
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1608
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1609
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1610
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1611
-- sigh
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1612
-- gradually got more bloated with the addition of hwpoint tracking and
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1613
-- distinction betweeen the need to track victory/win conditions or not
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1614
function GetDataForGearSaving(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1615
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1616
	local temp = nil
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1617
	local specialFlag = nil
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1618
	local arrayList = nil
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1619
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1620
	if GetGearType(gear) == gtMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1621
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1622
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1623
			temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1624
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1625
				GetY(gear) .. ", gtMine, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1626
			table.insert(mineList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1627
			table.insert(mineList, "	SetTimer(tempG, " .. GetTimer(gear) .. ")")
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1628
			if (GetHealth(gear) == 0) then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1629
				table.insert(mineList, "	SetHealth(tempG, 0)")
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1630
				local _, damage
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1631
				_,_,_,_,_,_,_,_,_,_,_,damage = GetGearValues(gear)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1632
				if damage ~= 0 then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1633
					table.insert(mineList, "	SetGearValues(tempG, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "..damage..")")
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1634
				end
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1635
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1636
			table.insert(mineList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1637
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1638
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1639
			temp = 	"	tempG = AddGear(" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1640
				GetX(gear) .. ", " ..
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1641
				GetY(gear) .. ", gtMine, 0, 0, 0, "..GetTimer(gear) .. ")"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1642
			table.insert(mineList, temp)
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1643
			if (GetHealth(gear) == 0) then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1644
				table.insert(mineList, "	SetHealth(tempG, 0)")
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1645
				local _, damage
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1646
				_,_,_,_,_,_,_,_,_,_,_,damage = GetGearValues(gear)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1647
				if damage ~= 0 then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1648
					table.insert(mineList, "	SetGearValues(tempG, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "..damage..")")
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1649
				end
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1650
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1651
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1652
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1653
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1654
		if 		GetTimer(gear) == 0 then specialFlag = 1
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1655
		elseif	GetTimer(gear) == 1000 then specialFlag = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1656
		elseif	GetTimer(gear) == 2000 then specialFlag = 3
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1657
		elseif	GetTimer(gear) == 3000 then specialFlag = 4
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1658
		elseif	GetTimer(gear) == 4000 then specialFlag = 5
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1659
		elseif	GetTimer(gear) == 5000 then specialFlag = 6
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1660
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1661
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1662
	elseif GetGearType(gear) == gtSMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1663
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1664
		arrayList = sMineList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1665
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1666
				GetX(gear) .. ", " ..
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1667
				GetY(gear) .. ", gtSMine, 0, 0, 0, " ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1668
				GetTimer(gear) ..")"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1669
		table.insert(sMineList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1670
		specialFlag = 7
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1671
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1672
	elseif GetGearType(gear) == gtAirMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1673
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1674
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1675
			temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1676
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1677
				GetY(gear) .. ", gtAirMine, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1678
			table.insert(airMineList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1679
			table.insert(airMineList, "	SetTimer(tempG, " .. GetTimer(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1680
			table.insert(airMineList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1681
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1682
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1683
			temp = 	"	SetTimer(" .. "AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1684
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1685
				GetY(gear) .. ", gtAirMine, 0, 0, 0, 0)" .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1686
				GetTimer(gear) ..")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1687
			table.insert(airMineList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1688
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1689
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1690
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1691
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1692
		specialFlag = 8
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1693
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1694
	elseif GetGearType(gear) == gtExplosives then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1695
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1696
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1697
			temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1698
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1699
				GetY(gear) .. ", gtExplosives, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1700
			table.insert(explosivesList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1701
			table.insert(explosivesList, "	SetHealth(tempG, " .. GetHealth(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1702
			table.insert(explosivesList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1703
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1704
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1705
			temp = 	"	SetHealth(" .. "AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1706
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1707
				GetY(gear) .. ", gtExplosives, 0, 0, 0, 0)" .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1708
				GetHealth(gear) ..")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1709
			table.insert(explosivesList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1710
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1711
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1712
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1713
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1714
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1715
		if 		GetHealth(gear) == 1 then specialFlag = 15
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1716
		elseif	GetHealth(gear) == 25 then specialFlag = 16
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1717
		elseif	GetHealth(gear) == 50 then specialFlag = 17
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1718
		elseif	GetHealth(gear) == 75 then specialFlag = 18
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1719
		elseif	GetHealth(gear) == 100 then specialFlag = 19
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1720
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1721
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1722
	elseif GetGearType(gear) == gtTarget then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1723
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1724
		arrayList = targetList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1725
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1726
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1727
				GetY(gear) .. ", gtTarget, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1728
		table.insert(targetList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1729
		specialFlag = 14
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1730
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1731
	elseif GetGearType(gear) == gtKnife then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1732
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1733
		arrayList = knifeList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1734
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1735
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1736
				GetY(gear) .. ", gtKnife, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1737
		table.insert(knifeList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1738
		specialFlag = 13
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1739
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1740
	elseif GetGearType(gear) == gtCase then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1741
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1742
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1743
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1744
		if (GetHealth(gear) ~= nil) and (GetHealth(gear) ~= 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1745
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1746
			if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1747
				temp = 	"	tempG = SpawnHealthCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1748
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1749
					GetY(gear) ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1750
					")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1751
				table.insert(healthCrateList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1752
				table.insert(healthCrateList, "	SetHealth(tempG, " .. GetHealth(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1753
				table.insert(healthCrateList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1754
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1755
				temp = 	"	SetHealth(SpawnHealthCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1756
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1757
					GetY(gear) ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1758
					"), " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1759
					GetHealth(gear) ..")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1760
				table.insert(healthCrateList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1761
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1762
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1763
			if 		GetHealth(gear) == 25 then specialFlag = 9
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1764
			elseif	GetHealth(gear) == 50 then specialFlag = 10
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1765
			elseif	GetHealth(gear) == 75 then specialFlag = 11
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1766
			elseif	GetHealth(gear) == 100 then specialFlag = 12
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1767
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1768
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1769
		elseif getGearValue(gear,"caseType") == "ammo" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1770
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1771
			arrayList = wepCrateList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1772
			temp = 	"	tempG = SpawnAmmoCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1773
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1774
					GetY(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1775
					getGearValue(gear,"contents") ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1776
					")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1777
			table.insert(wepCrateList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1778
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1779
			tempV = getGearValue(gear,"contents")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1780
			for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1781
				if tempV == atkArray[i][2] then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1782
					specialFlag = i + 19
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1783
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1784
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1785
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1786
			--dammit, we probably need two more entries if we want to allow editing of existing maps
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1787
			table.insert(wepCrateList, "	setGearValue(tempG, \"caseType\", \"" .. getGearValue(gear,"caseType") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1788
			table.insert(wepCrateList, "	setGearValue(tempG, \"contents\", \"" .. getGearValue(gear,"contents") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1789
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1790
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1791
		elseif getGearValue(gear,"caseType") == "util" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1792
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1793
			arrayList = utilCrateList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1794
			temp = 	"	tempG = SpawnUtilityCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1795
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1796
					GetY(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1797
					getGearValue(gear,"contents") ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1798
					")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1799
			table.insert(utilCrateList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1800
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1801
			tempV = getGearValue(gear,"contents")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1802
			for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1803
				if tempV == utilArray[i][2] then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1804
					specialFlag = i + 19 + #atkArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1805
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1806
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1807
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1808
			--dammit, we probably need two more entries if we want to allow editing of existing maps
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1809
			table.insert(utilCrateList, "	setGearValue(tempG, \"caseType\", \"" .. getGearValue(gear,"caseType") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1810
			table.insert(utilCrateList, "	setGearValue(tempG, \"contents\", \"" .. getGearValue(gear,"contents") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1811
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1812
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1813
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1814
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1815
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1816
	-- add tracking of simple win/lose for simpler gears that have a tempG = listed above
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1817
	if (getGearValue(gear, "tag") ~= nil) and (arrayList ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1818
		table.insert(arrayList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1819
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1820
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1821
	-- this creates a big, messy list of special flags for use in hwmaps
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1822
	if specialFlag ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1823
		table.insert(hFlagList, "	" .. GetX(gear) .. " " .. GetY(gear) .. " " .. specialFlag)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1824
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1825
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1826
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1827
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1828
-- generate a title and list all the gears if there is at least 1 of them in the list
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1829
function AppendGearList(gearList, consoleLine)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1830
	if #gearList > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1831
		WriteLnToConsole(consoleLine)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1832
		for i = 1, #gearList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1833
			WriteLnToConsole(gearList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1834
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1835
		WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1836
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1837
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1838
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1839
-- new attempt at doing shit a bit cleaner:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1840
-- it may be a bit verbose, but this should generate a comprehensive, human-readable
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1841
-- list of gears, broken up into sections and output it to the console
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1842
function SaveGearData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1843
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1844
	runOnGears(GetDataForGearSaving)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1845
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1846
	AppendGearList(healthCrateList, "	------ HEALTH CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1847
	AppendGearList(wepCrateList, "	------ AMMO CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1848
	AppendGearList(utilCrateList, "	------ UTILITY CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1849
	AppendGearList(explosivesList, "	------ BARREL LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1850
	AppendGearList(mineList, "	------ MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1851
	AppendGearList(sMineList, "	------ STICKY MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1852
	AppendGearList(airMineList, "	------ AIR MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1853
	AppendGearList(targetList, "	------ TARGET LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1854
	AppendGearList(knifeList, "	------ CLEAVER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1855
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1856
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1857
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1858
function DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1859
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1860
	for x = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1861
		if getGearValue(hhs[i],atkArray[x][1]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1862
			WriteLnToConsole("	AddAmmo(hhs[" .. i .. "], " .. atkArray[x][2] .. ", " .. getGearValue(hhs[i],atkArray[x][1]) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1863
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1864
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1865
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1866
	for x = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1867
		if getGearValue(hhs[i],utilArray[x][1]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1868
			WriteLnToConsole("	AddAmmo(hhs[" .. i .. "], " .. utilArray[x][2] .. ", " .. getGearValue(hhs[i],utilArray[x][1]) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1869
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1870
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1871
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1872
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1873
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1874
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1875
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1876
-- this is called when a tagged gear is deleted during a mission
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1877
-- it determines if the game is ready to conclude in victory/defeat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1878
function CheckForConclusion(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1879
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1880
	-- failure gears must always all be protected, so if any of them are destroyed the player loses
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1881
	if getGearValue(gear,"tag") == "failure" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1882
		EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1883
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1884
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1885
		-- the presence of other tagged gears means that the goal of this mission is not
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1886
		-- simply to kill every hedgehog. Thus, we need to count the remaining tagged objects
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1887
		-- to see how close we are to completing the mission successfully.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1888
		victoryObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1889
		failObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1890
		collectObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1891
		runOnGears(CheckForConditions)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1892
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1893
		if GetGearType(gear) ~= gtCase then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1894
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1895
			-- non-crates can only be tagged as victory or failure, and as this wasn't tagged
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1896
			-- "failure" in our earlier check, this must be a victory tagged gear. Let's adust
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1897
			-- the number of objects accordingly as it's in the process of being destroyed.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1898
			victoryObj = victoryObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1899
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1900
			-- if there are no objectives left to complete, end the game in victory
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1901
			if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1902
				EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1903
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1904
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1905
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1906
			-- this crate was deleted, but was it collected or destroyed, and how does that match
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1907
			-- the goals of our mission?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1908
			if (GetGearMessage(gear) == 256) and (getGearValue(gear,"tag") == "collection") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1909
				if GetHogLevel(CurrentHedgehog) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1910
					-- the enemy stole our crate
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1911
					EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1912
				else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1913
					collectObj = collectObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1914
					if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1915
						EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1916
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1917
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1918
			elseif (GetGearMessage(gear) == 0) and (getGearValue(gear,"tag") == "victory") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1919
				victoryObj = victoryObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1920
				if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1921
					EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1922
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1923
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1924
				-- unfortunately, we messed up our mission.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1925
				EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1926
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1927
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1928
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1929
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1930
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1931
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1932
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1933
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1934
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1935
-- THE BIG ONE
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1936
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1937
-- saving process starts here
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1938
-- saves all level data to logs/game0.log and generates a simple script template
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1939
function SaveLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1940
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1941
	WriteLnToConsole("------ BEGIN SCRIPT ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1942
	WriteLnToConsole("-- Copy and Paste this text into an empty text file, and save it as")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1943
	WriteLnToConsole("-- YOURTITLEHERE.lua, in your Data/Missions/Training/ folder.")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1944
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1945
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1946
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1947
	WriteLnToConsole("HedgewarsScriptLoad(\"/Scripts/Locale.lua\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1948
	WriteLnToConsole("HedgewarsScriptLoad(\"/Scripts/Tracker.lua\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1949
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1950
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1951
	WriteLnToConsole("local hhs = {}")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1952
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1953
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1954
	WriteLnToConsole("local wepArray = {")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1955
	WriteLnToConsole("		amBazooka, amBee, amMortar, amDrill, amSnowball,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1956
	WriteLnToConsole("		amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1957
	WriteLnToConsole("		amShotgun, amDEagle, amSniperRifle, amSineGun, amLandGun, amIceGun,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1958
	WriteLnToConsole("		amFirePunch, amWhip, amBaseballBat, amKamikaze, amSeduction, amHammer,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1959
	WriteLnToConsole("		amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine, amAirMine,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1960
	WriteLnToConsole("		amAirAttack, amMineStrike, amDrillStrike, amNapalm, amPiano, amBirdy,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1961
	WriteLnToConsole("		amBlowTorch, amPickHammer, amGirder, amRubber, amPortalGun,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1962
	WriteLnToConsole("		amRope, amParachute, amTeleport, amJetpack,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1963
	WriteLnToConsole("		amInvulnerable, amLaserSight, amVampiric,")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1964
	WriteLnToConsole("		amLowGravity, amExtraDamage, amExtraTime, amResurrector, amTardis, amSwitch")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1965
	WriteLnToConsole("	}")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1966
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1967
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1968
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1969
	SaveConfigData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1970
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1971
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1972
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1973
	WriteLnToConsole("function LoadHogWeapons()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1974
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1975
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1976
	if band(GameFlags, gfPerHogAmmo) ~= 0 then -- per hog ammo
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1977
		for i = 1, #hhs do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1978
			DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1979
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1980
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1981
	else	-- team-based ammo
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1982
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1983
		teamCounter = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1984
		lastRecordedTeam = ""
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1985
		for i = 1, #hhs do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1986
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1987
			if GetHogTeamName(hhs[i]) ~= lastRecordedTeam then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1988
				lastRecordedTeam = GetHogTeamName(hhs[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1989
				teamCounter = teamCounter + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1990
				if teamCounter == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1991
					teamCounter = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1992
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1993
				DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1994
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1995
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1996
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1997
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1998
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2001
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2002
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2003
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2004
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2005
	WriteLnToConsole("function LoadSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2006
	WriteLnToConsole("	PlaceSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2007
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2008
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2009
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2010
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2011
	WriteLnToConsole("function LoadGearData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2012
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2013
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2014
	WriteLnToConsole("	--BEGIN CORE DATA--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2015
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2016
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2017
	WriteLnToConsole("	------ PORTAL DISTANCE and UFO FUEL ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2018
	WriteLnToConsole("	ufoFuel = " .. ufoFuel)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2019
	WriteLnToConsole("	portalDistance = " .. portalDistance*5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2020
	table.insert(hFlagList, "	" .. portalDistance*5 .. " " .. ufoFuel .. " " .. 98)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2021
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2022
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2023
	for i = 0, (placedCount-1) do
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2024
		if placedType[i] == loc("Waypoint Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2025
			table.insert(waypointList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2026
			"	AddWayPoint(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2027
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2028
				placedY[i] ..")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2029
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2030
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. "0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2031
			table.insert(previewDataList, "	PreviewWayPoint(" .. placedX[i] ..", " ..	placedY[i] .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2032
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2033
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2034
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2035
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2036
		if placedType[i] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2037
			table.insert(girderList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2038
			"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2039
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2040
				placedY[i] ..", sprAmGirder, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2041
				placedFrame[i] ..			-- the rotation/frame
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2042
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2043
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2044
				"nil, nil, nil, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2045
				placedLandFlags[i] .. ")" --the landType
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2046
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2047
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. placedHWMapFlag[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2048
			table.insert(previewDataList, "	PreviewGirder(" .. placedX[i] ..", " ..	placedY[i] .. ", " .. placedFrame[i] .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2049
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2050
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2051
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2052
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2053
		if placedType[i] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2054
			table.insert(rubberList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2055
				"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2056
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2057
				placedY[i] ..", sprAmRubber, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2058
				placedFrame[i] ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2059
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2060
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2061
				"nil, nil, nil, " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2062
				"lfBouncy)" --the landType
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2063
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2064
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. placedHWMapFlag[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2065
			table.insert(previewDataList, "	PreviewRubber(" .. placedX[i] ..", " ..	placedY[i] .. ", " .. placedFrame[i] .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2066
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2067
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2068
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2069
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2070
		if placedType[i] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2071
				table.insert(spriteList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2072
				"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2073
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2074
				placedY[i] ..", " .. placedSprite[i] .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2075
				placedFrame[i] .. -- I think this is the frame, can't remember
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2076
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2077
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2078
				"nil, nil, nil, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2079
				placedLandFlags[i] .. ")" --the landType
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2080
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2081
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2082
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2083
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2084
	AppendGearList(waypointList, "	------ WAYPOINT LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2085
	AppendGearList(girderList, "	------ GIRDER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2086
	AppendGearList(rubberList, "	------ RUBBER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2087
	AppendGearList(spriteList, "	------ SPRITE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2088
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2089
	SaveGearData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2090
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2091
	WriteLnToConsole("	--END CORE DATA--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2092
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2093
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2094
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2095
	WriteLnToConsole("	LoadHogWeapons()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2096
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2097
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2098
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2099
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2100
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2101
	WriteLnToConsole("function onGameStart()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2102
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2103
	WriteLnToConsole("	LoadGearData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2104
	WriteLnToConsole("	DetermineMissionGoal()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2105
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2106
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2107
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2108
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2109
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2110
	WriteLnToConsole("function onNewTurn()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2111
	WriteLnToConsole("	--insert code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2112
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2113
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2114
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2115
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2116
	WriteLnToConsole("function onGameTick()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2117
	WriteLnToConsole("	runOnGears(UpdateTagCircles)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2118
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2119
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2120
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2121
	WriteLnToConsole("function UpdateTagCircles(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2122
	WriteLnToConsole("	if getGearValue(gear,\"tag\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2123
	WriteLnToConsole("		if getGearValue(gear,\"tCirc\") == nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2124
	WriteLnToConsole("			setGearValue(gear, \"tCirc\",AddVisualGear(0,0,vgtCircle,0,true))")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2125
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2126
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2127
	WriteLnToConsole("		if getGearValue(gear,\"tag\") == \"victory\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2128
	WriteLnToConsole("			SetVisualGearValues(getGearValue(gear,\"tCirc\"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0xff0000ff)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2129
	WriteLnToConsole("		elseif getGearValue(gear,\"tag\") == \"failure\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2130
	WriteLnToConsole("			SetVisualGearValues(getGearValue(gear,\"tCirc\"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x00ff00ff)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2131
	WriteLnToConsole("		elseif getGearValue(gear,\"tag\") == \"collection\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2132
	WriteLnToConsole("			SetVisualGearValues(getGearValue(gear,\"tCirc\"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x0000ffff)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2133
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2134
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2135
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2136
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2137
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2138
	WriteLnToConsole("function CheckForConditions(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2139
	WriteLnToConsole("	if getGearValue(gear,\"tag\") == \"victory\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2140
	WriteLnToConsole("		victoryObj = victoryObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2141
	WriteLnToConsole("	elseif getGearValue(gear,\"tag\") == \"failure\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2142
	WriteLnToConsole("		failObj = failObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2143
	WriteLnToConsole("	elseif getGearValue(gear,\"tag\") == \"collection\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2144
	WriteLnToConsole("		collectObj = collectObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2145
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2146
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2147
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2148
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2149
	WriteLnToConsole("function CheckForConclusion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2150
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2151
	WriteLnToConsole("	if getGearValue(gear,\"tag\") == \"failure\" then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2152
	WriteLnToConsole("		EndGameIn(\"failure\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2153
	WriteLnToConsole("	else ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2154
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2155
	WriteLnToConsole("		victoryObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2156
	WriteLnToConsole("		failObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2157
	WriteLnToConsole("		collectObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2158
	WriteLnToConsole("		runOnGears(CheckForConditions)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2159
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2160
	WriteLnToConsole("		if GetGearType(gear) ~= gtCase then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2161
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2162
	WriteLnToConsole("			victoryObj = victoryObj - 1 ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2163
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2164
	WriteLnToConsole("			if (victoryObj == 0) and (collectObj == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2165
	WriteLnToConsole("				EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2166
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2167
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2168
	WriteLnToConsole("		else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2169
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2170
	WriteLnToConsole("			if (GetGearMessage(gear) == 256) and (getGearValue(gear,\"tag\") == \"collection\") then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2171
	WriteLnToConsole("				if GetHogLevel(CurrentHedgehog) ~= 0 then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2172
	WriteLnToConsole("					EndGameIn(\"failure\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2173
	WriteLnToConsole("				else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2174
	WriteLnToConsole("					collectObj = collectObj - 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2175
	WriteLnToConsole("					if (victoryObj == 0) and (collectObj == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2176
	WriteLnToConsole("						EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2177
	WriteLnToConsole("					end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2178
	WriteLnToConsole("				end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2179
	WriteLnToConsole("			elseif (GetGearMessage(gear) == 0) and (getGearValue(gear,\"tag\") == \"victory\") then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2180
	WriteLnToConsole("				victoryObj = victoryObj - 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2181
	WriteLnToConsole("				if (victoryObj == 0) and (collectObj == 0) then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2182
	WriteLnToConsole("					EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2183
	WriteLnToConsole("				end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2184
	WriteLnToConsole("			else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2185
	WriteLnToConsole("				EndGameIn(\"failure\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2186
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2187
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2188
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2189
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2190
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2191
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2192
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2193
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2194
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2195
	WriteLnToConsole("function DetermineMissionGoal()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2196
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2197
	WriteLnToConsole("	victoryObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2198
	WriteLnToConsole("	failObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2199
	WriteLnToConsole("	collectObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2200
	WriteLnToConsole("	vComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2201
	WriteLnToConsole("	fComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2202
	WriteLnToConsole("	collectComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2203
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2204
	WriteLnToConsole("	runOnGears(CheckForConditions)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2205
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2206
	WriteLnToConsole("	if victoryObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2207
	WriteLnToConsole("		if victoryObj == 1 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2208
	WriteLnToConsole("			vComment = loc(\"Destroy the red target\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2209
	WriteLnToConsole("		else ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2210
	WriteLnToConsole("			vComment = loc(\"Destroy the red targets\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2211
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2212
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2213
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2214
	WriteLnToConsole("	if collectObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2215
	WriteLnToConsole("		if collectObj == 1 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2216
	WriteLnToConsole("			collectComment = loc(\"Collect the blue target\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2217
	WriteLnToConsole("		else ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2218
	WriteLnToConsole("			collectComment = loc(\"Collect all the blue targets\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2219
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2220
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2221
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2222
	WriteLnToConsole("	if (collectObj == 0) and (victoryObj == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2223
	WriteLnToConsole("		vComment = loc(\"Destroy the enemy.\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2224
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2225
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2226
	WriteLnToConsole("	if failObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2227
	WriteLnToConsole("		if failObj == 1 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2228
	WriteLnToConsole("			fComment = loc(\"The green target must survive\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2229
	WriteLnToConsole("		else ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2230
	WriteLnToConsole("			fComment = loc(\"The green targets must survive\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2231
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2232
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2233
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2234
	WriteLnToConsole("	ShowMission(loc(\"User Challenge\"), loc(\"Mission Goals\") .. \":\", collectComment .. \"|\" .. vComment .. \"|\" .. fComment, 0, 0)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2235
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2236
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2237
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2238
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2239
	WriteLnToConsole("function isATrackedGear(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2240
	WriteLnToConsole("	if 	(GetGearType(gear) == gtHedgehog) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2241
	WriteLnToConsole("		(GetGearType(gear) == gtExplosives) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2242
	WriteLnToConsole("		(GetGearType(gear) == gtMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2243
	WriteLnToConsole("		(GetGearType(gear) == gtSMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2244
	WriteLnToConsole("		(GetGearType(gear) == gtAirMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2245
	WriteLnToConsole("		(GetGearType(gear) == gtTarget) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2246
	WriteLnToConsole("		(GetGearType(gear) == gtKnife) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2247
	WriteLnToConsole("		(GetGearType(gear) == gtPortal) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2248
	WriteLnToConsole("		(GetGearType(gear) == gtCase)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2249
	WriteLnToConsole("	then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2250
	WriteLnToConsole("		return(true)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2251
	WriteLnToConsole("	else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2252
	WriteLnToConsole("		return(false)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2253
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2254
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2255
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2256
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2257
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2258
	WriteLnToConsole("function onGearAdd(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2259
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2260
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2261
	WriteLnToConsole("	if isATrackedGear(gear) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2262
	WriteLnToConsole("		trackGear(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2263
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2264
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2265
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2266
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2267
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2268
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2269
	WriteLnToConsole("function EndGameIn(c)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2270
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2271
	WriteLnToConsole("	teamCounter = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2272
	WriteLnToConsole("	lastRecordedTeam = \"\" ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2273
	WriteLnToConsole("	for i = 1, #hhs do")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2274
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2275
	WriteLnToConsole("		if GetHogTeamName(hhs[i]) ~= lastRecordedTeam then --er, is this okay without nill checks?")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2276
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2277
	WriteLnToConsole("			lastRecordedTeam = GetHogTeamName(hhs[i])")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2278
	WriteLnToConsole("			teamCounter = teamCounter + 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2279
	WriteLnToConsole("			if teamCounter == 9 then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2280
	WriteLnToConsole("				teamCounter = 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2281
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2282
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2283
	WriteLnToConsole("			if (c ==  \"victory\") and (GetHogLevel(hhs[i]) ~= 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2284
	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2285
	WriteLnToConsole("				ShowMission(loc(\"User Challenge\"), loc(\"MISSION SUCCESSFUL\"), loc(\"Congratulations!\"), 0, 0)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2286
	WriteLnToConsole("			elseif (c ==  \"failure\") and (GetHogLevel(hhs[i]) == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2287
	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2288
	WriteLnToConsole("				ShowMission(loc(\"User Challenge\"), loc(\"MISSION FAILED\"), loc(\"Oh no! Just try again!\"), -amSkip, 0)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2289
	WriteLnToConsole("			elseif (c ==  \"victory\") and (GetHogLevel(hhs[i]) == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2290
	WriteLnToConsole("				PlaySound(sndVictory,hhs[i]) -- check if we actually need this")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2291
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2292
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2293
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2294
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2295
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2296
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2297
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2298
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2299
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2300
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2301
	WriteLnToConsole("function onGearDelete(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2302
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2303
	WriteLnToConsole("	--insert code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2304
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2305
	WriteLnToConsole("	if isATrackedGear(gear) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2306
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2307
	WriteLnToConsole("		if getGearValue(gear,\"tag\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2308
	WriteLnToConsole("			CheckForConclusion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2309
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2310
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2311
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2312
	WriteLnToConsole("		if getGearValue(gear, \"tCirc\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2313
	WriteLnToConsole("			DeleteVisualGear(getGearValue(gear, \"tCirc\"))")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2314
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2315
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2316
	WriteLnToConsole("		trackDeletion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2317
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2318
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2319
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2320
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2321
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2322
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2323
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2324
	WriteLnToConsole("--enable and/or alter code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2325
	WriteLnToConsole("function onAmmoStoreInit()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2326
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2327
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2328
	WriteLnToConsole("	for i = 1, #wepArray do")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2329
	WriteLnToConsole("		SetAmmo(wepArray[i], 0, 0, 0, 1)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2330
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2331
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2332
	WriteLnToConsole("	SetAmmo(amSkip, 9, 0, 0, 0)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2333
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2334
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2335
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2336
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2337
	WriteLnToConsole("------ END GENERATED MISSION ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2338
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2339
	-- at this point, generation for the missions/training output is intended to stop
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2340
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2341
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2342
	WriteLnToConsole("function GeneratePreviewData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2343
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2344
	for i = 1, #previewDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2345
		WriteLnToConsole(previewDataList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2346
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2347
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2348
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2349
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2350
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2351
	ConvertGearDataToHWPText()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2352
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2353
	WriteLnToConsole("------ END GENERATED SCRIPT ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2354
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2355
	AddCaption(loc("Level Data Saved!"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2356
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2357
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2358
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2359
----------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2360
-- some special effects handling
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2361
----------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2362
function SmokePuff(x,y,c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2363
	tempE = AddVisualGear(x, y, vgtSmoke, 0, false)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2364
	SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, 1, nil, c )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2365
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2366
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2367
function HandleGearBasedRankingEffects(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2368
	if getGearValue(gear, "ranking") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2369
		SmokePuff(GetX(gear), GetY(gear),GetRankedColour(getGearValue(gear, "ranking")))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2370
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2371
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2372
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2373
function HandleRankingEffects()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2374
	for i = 1, #shoppaPX do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2375
		SmokePuff(shoppaPX[i], shoppaPY[i], GetRankedColour(shoppaPR[i]))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2376
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2377
	runOnHogs(HandleGearBasedRankingEffects)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2378
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2379
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2380
function UpdateTagCircles(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2381
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2382
	if getGearValue(gear,"tag") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2383
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2384
		if cat[cIndex] == loc("Goal Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2385
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2386
			-- generate circs for tagged gears that don't have a circ yet (new)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2387
			if getGearValue(gear,"tCirc") == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2388
				setGearValue(gear, "tCirc",AddVisualGear(0,0,vgtCircle,0,true))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2389
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2390
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2391
			if getGearValue(gear,"tag") == "victory" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2392
				SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0xff0000ff)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2393
			elseif getGearValue(gear,"tag") == "failure" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2394
				SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x00ff00ff)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2395
			elseif getGearValue(gear,"tag") == "collection" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2396
				SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x0000ffff)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2397
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2398
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2399
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2400
			SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 0, 1, 1, 10, 0, 1, 1, 0x00000000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2401
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2402
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2403
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2404
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2405
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2406
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2407
-- handle short range portal gun
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2408
function PortalEffects(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2409
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2410
	if GetGearType(gear) == gtPortal then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2411
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2412
		tag = GetTag(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2413
		if tag == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2414
			col = 0xfab02aFF -- orange ball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2415
		elseif tag == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2416
			col = 0x00FF00FF -- orange portal
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2417
		elseif tag == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2418
			col = 0x364df7FF  -- blue ball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2419
		elseif tag == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2420
			col = 0xFFFF00FF  -- blue portal
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2421
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2422
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2423
		if (tag == 0) or (tag == 2) then -- i.e ball form
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2424
			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtDust, 0, true)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2425
			SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, 1, nil, col )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2426
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2427
			remLife = getGearValue(gear,"life")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2428
			remLife = remLife - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2429
			setGearValue(gear, "life", remLife)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2430
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2431
			if remLife == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2432
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2433
				tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2434
				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2435
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2436
				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2437
				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2438
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2439
				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2440
				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2441
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2442
				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2443
				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, col)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2444
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2445
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2446
				PlaySound(sndVaporize)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2447
				DeleteGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2448
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2449
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2450
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2451
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2452
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2453
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2454
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2455
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2456
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2457
function updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2458
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2459
	if (GetCurAmmoType() ~= amGirder) and (GetCurAmmoType() ~= amRubber) and (GetCurAmmoType() ~= amAirAttack) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2460
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  2461
		showHedgeEditorMissionPanel()
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  2462
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2463
	elseif cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2464
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2465
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2466
				loc("GIRDER PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2467
				loc("Use this mode to place girders"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2468
				loc("Place Girder: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2469
				loc("Change Rotation: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2470
				loc("Change LandFlag: [1], [2], [3], [4]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2471
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2472
				loc("1 - Normal Girder") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2473
				loc("2 - Indestructible Girder") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2474
				loc("3 - Icy Girder") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2475
				loc("4 - Bouncy Girder") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2476
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2477
				loc("Deletion Mode: [5]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2478
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2479
				"", -amGirder, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2480
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2481
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2482
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2483
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2484
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2485
				loc("RUBBER PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2486
				loc("Use this mode to place rubberbands"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2487
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2488
				loc("Change Rotation: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2489
				loc("1 - Normal Rubber") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2490
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2491
				loc("Deletion Mode: [5]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2492
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2493
				"", -amRubber, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2494
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2495
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2496
	elseif cat[cIndex] == loc("Barrel Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2497
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2498
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2499
				loc("BARREL PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2500
				loc("Use this mode to place barrels"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2501
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2502
				loc("Change Health: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2503
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2504
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2505
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2506
				"", 8, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2507
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2508
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2509
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2510
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2511
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2512
				loc("CLEAVER MINE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2513
				loc("Use this mode to place cleavers"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2514
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2515
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2516
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2517
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2518
				"", -amKnife, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2519
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2520
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2521
	elseif cat[cIndex] == loc("Target Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2522
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2523
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2524
				loc("TARGET MINE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2525
				loc("Use this mode to place targets"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2526
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2527
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2528
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2529
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2530
				"", 1, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2531
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2532
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2533
	elseif cat[cIndex] == loc("Waypoint Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2534
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2535
		ShowMission	(
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2536
				loc("WAYPOINT MODE"),
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2537
				loc("Use this mode to place or delete waypoints"),
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2538
				loc("Place/Delete Waypoint: [Left Click]") .. "|" ..
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2539
				loc("Toggle Placement/Deletion: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2540
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2541
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2542
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2543
				"", -amAirAttack, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2544
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2545
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2546
	elseif cat[cIndex] == loc("Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2547
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2548
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2549
				loc("MINE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2550
				loc("Use this mode to place mines"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2551
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2552
				loc("Change Timer (in milliseconds): [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2553
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2554
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2555
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2556
				"", -amMine, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2557
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2558
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2559
	elseif cat[cIndex] == loc("Dud Mine Placement Mode") then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2560
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2561
		ShowMission	(
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2562
				loc("DUD MINE PLACEMENT MODE"),
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2563
				loc("Use this mode to place dud mines"),
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2564
				loc("Place Object: [Left Click]") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2565
				loc("Change Health: [Left], [Right]") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2566
				" " .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2567
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2568
				loc("Toggle Help: Precise+1") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2569
				"", -amMine, 60000
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2570
				)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2571
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2572
	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2573
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2574
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2575
				loc("STiCKY MINE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2576
				loc("Use this mode to place sticky mines"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2577
				loc("Place Object: [Left Click]") .. "|" ..
11989
a6f4e4265d2e HedgeEditor: Allow to set sticky mine timer
Wuzzy <almikes@aol.com>
parents: 11988
diff changeset
  2578
				loc("Change Timer (in milliseconds): [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2579
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2580
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2581
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2582
				"", -amSMine, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2583
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2584
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2585
	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2586
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2587
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2588
				loc("AIR MINE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2589
				loc("Use this mode to place air mines"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2590
				loc("Place Object: [Left Click]") .. "|" ..
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2591
				loc("Change Timer (in milliseconds): [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2592
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2593
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2594
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2595
				"", -amAirMine, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2596
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2597
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2598
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2599
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2600
		ShowMission	(
11999
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2601
				loc("WEAPON CRATE PLACEMENT MODE"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2602
				loc("Use this mode to place weapon crates"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2603
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2604
				loc("Change Content: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2605
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2606
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2607
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2608
				"", 7, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2609
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2610
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2611
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2612
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2613
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2614
				loc("UTILITY CRATE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2615
				loc("Use this mode to place utility crates"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2616
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2617
				loc("Change Content: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2618
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2619
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2620
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2621
				"", 5, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2622
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2623
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2624
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2625
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2626
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2627
				loc("HEALTH CRATE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2628
				loc("Use this mode to place utility crates"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2629
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2630
				loc("Change Health Boost: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2631
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2632
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2633
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2634
				"", 6, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2635
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2636
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2637
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2638
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2639
		ShowMission	(
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2640
				loc("REPOSITIONING MODE"),
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2641
				loc("Use this mode to select, reposition and delete gears"),
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2642
				loc("Select/Place/Delete Gear: [Left Click]") .. "|" ..
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2643
				loc("Choose Selection/Placement/Deletion: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2644
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2645
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2646
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2647
				"", -amAirAttack, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2648
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2649
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2650
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2651
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2652
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2653
				loc("SPRITE MODIFICATION MODE"),
11999
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2654
				loc("Use to select, modify, or delete girders, rubbers, or sprites."),
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2655
				loc("Change modification mode: [Left], [Right]") .."|"..
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2656
				loc("While in modification mode, you can change|the LandFlag by clicking on an object.") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2657
				loc("Set LandFlag: [1], [2], [3], [4]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2658
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2659
				loc("1 - Normal Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2660
				loc("2 - Indestructible Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2661
				loc("3 - Icy Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2662
				loc("4 - Bouncy Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2663
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2664
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2665
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2666
				"", -amAirAttack, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2667
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2668
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2669
	elseif cat[cIndex] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2670
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2671
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2672
				loc("SPRITE PLACEMENT MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2673
				loc("Use this mode to place custom sprites."),
11999
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2674
				loc("Change sprite: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2675
				loc("Set LandFlag: [1], [2], [3], [4]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2676
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2677
				loc("1 - Normal Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2678
				loc("2 - Indestructible Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2679
				loc("3 - Icy Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2680
				loc("4 - Bouncy Land") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2681
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2682
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2683
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2684
				"", 2, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2685
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2686
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2687
	elseif cat[cIndex] == loc("Goal Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2688
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2689
		ShowMission	(
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2690
				loc("GOAL MODE"),
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2691
				loc("Use this mode to mark gears for win/lose conditions."),
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2692
				loc("Mark/unmark gear: [Left Click]") .. "|" ..
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2693
				loc("Select win/lose condition: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2694
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2695
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2696
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2697
				"", 3, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2698
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2699
	elseif cat[cIndex] == loc("Hog Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2700
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2701
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2702
				loc("HOG IDENTITY MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2703
				loc("Use this mode to give a hog a preset identity and weapons."),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2704
				loc("Set Identity: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2705
				loc("[Left], [Right]: Change between identities.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2706
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2707
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2708
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2709
				"", 3, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2710
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2711
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2712
	elseif cat[cIndex] == loc("Team Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2713
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2714
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2715
				loc("TEAM IDENTITY MODE"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2716
				loc("Use this mode to give an entire team themed hats and names."),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2717
				loc("Set Identity: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2718
				loc("[Left], [Right]: Change between identities.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2719
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2720
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2721
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2722
				"", 3, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2723
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2724
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2725
	elseif cat[cIndex] == loc("Health Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2726
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2727
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2728
				loc("HEALTH MODIFICATION MODE"),
11640
4865e715fb49 Hedge Editor: Also allow to set health of barrels and health crates in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11639
diff changeset
  2729
				loc("Use this mode to set the health of hogs, health crates and barrels."),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2730
				loc("Set Health: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2731
				loc("[Left], [Right]: Change health value.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2732
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2733
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2734
				loc("Toggle Help: Precise+1") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2735
				"", 3, 60000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2736
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2737
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2738
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2739
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2740
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2741
	if helpDisabled == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2742
		HideMission()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2743
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2744
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2745
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2746
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2747
-- called in onGameTick()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2748
function HandleHedgeEditor()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2749
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2750
	if CurrentHedgehog ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2751
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2752
		genTimer = genTimer + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2753
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2754
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2755
		tSprCol = 0x00000000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2756
		tempFrame = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2757
		xDisplacement = 42
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2758
		yDisplacement = 42
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2759
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2760
		if (curWep == amAirAttack) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2761
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2762
			--wowaweewa, holyeeeee shite this is badly hacked (please rewrite when less lazy/morefeatures)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2763
			dCol = 0xFFFFFFFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2764
			dFrame = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2765
			dAngle = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2766
			if (cat[cIndex] == loc("Mine Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2767
				dSprite = sprBotlevels--sprMineOff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2768
				dFrame = 1
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2769
			elseif (cat[cIndex] == loc("Dud Mine Placement Mode")) then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2770
				-- TODO: Use dud mine sprite instead of sprite of normal mine
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2771
				dSprite = sprBotlevels--sprMineOff
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2772
				dFrame = 1
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2773
			elseif (cat[cIndex] == loc("Sticky Mine Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2774
				dSprite = sprBotlevels--sprSMineOff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2775
				dFrame = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2776
			elseif (cat[cIndex] == loc("Air Mine Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2777
				dSprite = sprAirMine
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2778
			elseif (cat[cIndex] == loc("Barrel Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2779
				dSprite = sprExplosives
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2780
			elseif (cat[cIndex] == loc("Health Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2781
				dSprite = sprFAid
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2782
			elseif (cat[cIndex] == loc("Weapon Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2783
				dSprite = sprCase
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2784
			elseif (cat[cIndex] == loc("Utility Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2785
				dSprite = sprUtility
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2786
			elseif (cat[cIndex] == loc("Target Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2787
				dSprite = sprTarget
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2788
			elseif (cat[cIndex] == loc("Cleaver Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2789
				dAngle = 270
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2790
				dSprite = sprKnife
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2791
			elseif (cat[cIndex] == loc("Sprite Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2792
				dSprite = reducedSpriteIDArray[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2793
				dFrame = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2794
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2795
				dCol = 0xFFFFFF00
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2796
				dSprite = sprArrow
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2797
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2798
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2799
			if CG == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2800
				CG = AddVisualGear(CursorX, CursorY, vgtStraightShot,0,true,3)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2801
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2802
			SetVisualGearValues(CG, CursorX, CursorY, 0, 0, dAngle, dFrame, 1000, dSprite, 1000, dCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2803
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2804
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2805
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2806
			if crateSprite == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2807
				crateSprite = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2808
				for i = 1, 4 do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2809
					tSpr[i] = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2810
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2811
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2812
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2813
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2814
			if (cat[cIndex] == loc("Weapon Crate Placement Mode")) or (cat[cIndex] == loc("Utility Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2815
				if (cat[cIndex] == loc("Weapon Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2816
					tArr = atkArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2817
				else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2818
					tArr = utilArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2819
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2820
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2821
				tSprCol = 0xFFFFFFFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2822
				tempFrame = tArr[pIndex][3]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2823
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2824
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2825
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2826
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2827
			if CG ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2828
				SetVisualGearValues(CG, 0, 0, 0, 0, 0, 0, 1000, sprArrow, 1000, 0xFFFFFF00)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2829
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2830
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2831
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2832
		SetVisualGearValues(crateSprite, CursorX+xDisplacement, CursorY+yDisplacement, 0, 0, dAngle, tempFrame, 1000, sprAMAmmos, 1000, tSprCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2833
		SetVisualGearValues(tSpr[1], CursorX+xDisplacement-2, CursorY+yDisplacement-2, 0, 0, dAngle, 10, 1000, sprTarget, 1000, tSprCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2834
		SetVisualGearValues(tSpr[2], CursorX+xDisplacement-2, CursorY+yDisplacement+2, 0, 0, dAngle, 10, 1000, sprTarget, 1000, tSprCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2835
		SetVisualGearValues(tSpr[3], CursorX+xDisplacement+2, CursorY+yDisplacement-2, 0, 0, dAngle, 10, 1000, sprTarget, 1000, tSprCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2836
		SetVisualGearValues(tSpr[4], CursorX+xDisplacement+2, CursorY+yDisplacement+2, 0, 0, dAngle, 10, 1000, sprTarget, 1000, tSprCol)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2837
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2838
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2839
		if genTimer >= 100 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2840
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2841
			genTimer = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2842
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2843
			curWep = GetCurAmmoType()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2844
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2845
			HandleRankingEffects()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2846
			runOnGears(PortalEffects)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2847
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2848
			-- change to girder mode on weapon swap
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2849
			if (cIndex ~= 1) and (curWep == amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2850
				cIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2851
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2852
				updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2853
			elseif (cIndex ~=2) and (curWep == amRubber) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2854
				cIndex = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2855
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2856
				updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2857
			-- change to generic mode if girder no longer selected
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2858
			elseif (cIndex == 1) and (curWep ~= amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2859
				cIndex = 3 -- was 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2860
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2861
			elseif (cIndex == 2) and (curWep ~= amRubber) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2862
				cIndex = 3 --new
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2863
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2864
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2865
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2866
			-- update display selection criteria
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2867
			if (curWep == amGirder) or (curWep == amRubber) or (curWep == amAirAttack) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2868
				AddCaption(cat[cIndex],0xffba00ff,capgrpMessage)
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2869
				local caption2
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2870
				if type(pMode[pIndex]) == "table" then
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2871
					caption2 = tostring(pMode[pIndex][1])
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2872
				else
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2873
					caption2 = tostring(pMode[pIndex])
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2874
				end
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  2875
				AddCaption(caption2,0xffba00ff,capgrpMessage2)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2876
				if superDelete == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2877
					AddCaption(loc("Warning: Deletition Mode Active"),0xffba00ff,capgrpAmmoinfo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2878
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2879
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2880
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2881
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2882
			if sSprite ~= nil then
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2883
				SetVisualGearValues(sSprite, nil, nil, 0, 0, nil, nil, 10000, nil, 10000 )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2884
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2885
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2886
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2887
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2888
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2889
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2890
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2891
	if (ufoFuel ~= 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2892
		if ufoFuel == 2000 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2893
			SetHealth(ufoGear, 2000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2894
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2895
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2896
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2897
	-- kinda lazy, but at least we don't have to do elaborate tacking elsewhere
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2898
	SetVisualGearValues(sCirc, 0, 0, 0, 1, 1, 10, 0, 1, 1, 0x00000000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2899
	--update selected gear display
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2900
	if (cat[cIndex] == loc("Repositioning Mode")) and (sGear ~= nil) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2901
		SetVisualGearValues(sCirc, GetX(sGear), GetY(sGear), 100, 255, 1, 10, 0, 300, 3, 0xff00ffff)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2902
	elseif (cat[cIndex] == loc("Sprite Modification Mode")) and (sSprite ~= nil) then
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2903
		SetVisualGearValues(sSprite, nil, nil, 0, 0, nil, nil, 10000, nil, 10000)
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2904
	elseif (cat[cIndex] == loc("Goal Mode")) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2905
		if (sGear ~= nil) or (closestGear ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2906
			closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2907
			sGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2908
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2909
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2910
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2911
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2912
	runOnGears(UpdateTagCircles)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2913
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2914
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2915
	-- some kind of target detected, tell me your story
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2916
	if cGear ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2917
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2918
		x,y = GetGearTarget(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2919
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2920
		if GetGearType(cGear) == gtAirAttack then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2921
			DeleteGear(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2922
			PlaceObject(x, y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2923
		elseif GetGearType(cGear) == gtGirder then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2924
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2925
			CGR = GetState(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2926
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2927
			-- improve rectangle test based on CGR when you can be bothered
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2928
			PlaceObject(x, y)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2929
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2930
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2931
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2932
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2933
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2934
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2935
--------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2936
-- EVENT HANDLERS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2937
--------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2938
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2939
function commandMode()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2940
	if (preciseOn == true) and ((GetCurAmmoType() == amNothing) or (GetCurAmmoType() == amSkip)) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2941
		return(true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2942
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2943
		return(false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2944
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2945
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2946
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2947
function onTimer(s)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2948
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2949
	superDelete = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2950
	if (commandMode() == true) and (s == 4) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2951
		SaveLevelData() -- positions of crates, etc
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2952
	elseif (commandMode() == true) and (s == 2) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2953
		if GetAmmoCount(CurrentHedgehog, amAirAttack) == 100 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2954
			SetEditingWeps(0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2955
			AddCaption(loc("The editor weapons and tools have been removed!"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2956
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2957
			SetEditingWeps(100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2958
			AddCaption(loc("The editor weapons and tools have been added!"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2959
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2960
	elseif (preciseOn == true) and (s == 1) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2961
		if (GetCurAmmoType() == amGirder) or  (GetCurAmmoType() == amRubber) or  (GetCurAmmoType() == amAirAttack) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2962
			helpDisabled = not(helpDisabled)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2963
			AddCaption("Help Disabled: " .. BoolToString(helpDisabled),0xffba00ff,capgrpVolume)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2964
			updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2965
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2966
	elseif (cat[cIndex] == loc("Sprite Placement Mode")) or (cat[cIndex] == loc("Girder Placement Mode")) or (cat[cIndex] == loc("Rubber Placement Mode")) or (cat[cIndex] == loc("Sprite Modification Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2967
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2968
		if (cat[cIndex] == loc("Rubber Placement Mode")) and (s ~= 5) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2969
			landType = lfBouncy
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2970
			AddCaption(loc("Bouncy Land"),0xffba00ff,capgrpAmmoinfo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2971
		elseif s == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2972
			landType = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2973
			AddCaption(loc("Normal Land"),0xffba00ff,capgrpAmmoinfo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2974
		elseif s == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2975
			landType = lfIndestructible
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2976
			AddCaption(loc("Indestructible Land"),0xffba00ff,capgrpAmmoinfo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2977
		elseif s == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2978
			landType = lfIce
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2979
			AddCaption(loc("Icy Land"),0xffba00ff,capgrpAmmoinfo)
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2980
		elseif (s == 4) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2981
			landType = lfBouncy
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2982
			AddCaption(loc("Bouncy Land"),0xffba00ff,capgrpAmmoinfo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2983
		elseif (s == 5) and (cat[cIndex] ~= loc("Sprite Modification Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2984
			superDelete = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2985
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2986
	elseif pMode[pIndex] == loc("Selection Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2987
		setGearValue(sGear, "ranking", s)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2988
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2989
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2990
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2991
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2992
function onPrecise()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2993
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2994
	preciseOn = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2995
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2996
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2997
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2998
function onPreciseUp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2999
	preciseOn = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3000
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3001
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3002
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3003
-- Cycle through selection subsets (by changing pIndex, pMode)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3004
-- i.e 	health of barrels, medikits,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3005
--		timer of mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3006
--		contents of crates etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3007
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3008
function onLeft()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3009
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3010
	leftHeld = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3011
	rightHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3012
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3013
	pIndex = pIndex - 1
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3014
	if pIndex == 0 then
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3015
		pIndex = #pMode
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3016
	end
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3017
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3018
	if (curWep == amGirder) or (curWep == amRubber) or (curWep == amAirAttack) then
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3019
		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3020
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3021
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3022
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3023
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3024
function onRight()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3025
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3026
	leftHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3027
	rightHeld = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3028
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3029
	pIndex = pIndex + 1
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3030
	if pIndex > #pMode then
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3031
		pIndex = 1
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3032
	end
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3033
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3034
	if (curWep == amGirder) or (curWep == amRubber) or (curWep == amAirAttack) then
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3035
		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3036
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3038
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3039
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3040
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3041
-- Cycle through primary categories (by changing cIndex)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3042
-- i.e 	mine, sticky mine, barrels
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3043
--		health/weapon/utility crate, placement of gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3044
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3045
function onUp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3046
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3047
	if (curWep ~= amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3048
		cIndex = cIndex - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3049
		if (cIndex == 1) or (cIndex == 2) then --1	--we no longer hit girder by normal means
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3050
			cIndex = #cat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3051
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3052
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3053
		RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3054
		updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3055
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3056
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3057
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3058
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3059
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3060
function onDown()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3061
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3062
	if (curWep ~= amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3063
		cIndex = cIndex + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3064
		if cIndex > #cat then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3065
			cIndex = 3	 -- 2 ----we no longer hit girder by normal means
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3066
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3067
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3068
		RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3069
		updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3070
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3071
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3072
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3073
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3074
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3075
function onParameters()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3076
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3077
    parseParams()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3078
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3079
	ufoFuel = tonumber(params["ufoFuel"])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3080
	if ufoFuel == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3081
		ufoFuel = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3082
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3083
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3084
	mapID = tonumber(params["m"])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3085
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3086
	--15 is a good short range portal, for what it's worth
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3087
	if tonumber(params["portalDistance"]) ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3088
		portalDistance = div(tonumber(params["portalDistance"]),5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3089
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3090
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3091
	if portalDistance == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3092
		portalDistance = 5000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3093
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3094
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3095
	if params["helpDisabled"] == "true" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3096
		helpDisabled = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3097
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3098
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3099
	if mapID == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3100
		mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3101
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3102
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3103
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3104
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3105
function onGameInit()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3106
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3107
	-- perhaps we can get some of this better info in parsecommandoverride
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3108
	--Map = "Islands"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3109
	--Theme = "Deepspace"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3110
	--Seed = "{bacb2f87-f316-4691-a333-3bcfc4fb3d88}"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3111
	--MapGen = 0 -- 0:generated map, 1:generated maze, 2:hand drawn map
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3112
	--TemplateFilter = 5	-- small=1,med=2,large=3,cavern=4,wacky=5
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3113
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3114
	if mapID == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3115
		mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3116
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3117
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3118
	-- read gameflags and assign their values to the gameflaglist array
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3119
	for i = 1, #gameFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3120
		if band(GameFlags, gameFlagList[i][3]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3121
			gameFlagList[i][2] = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3122
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3123
			gameFlagList[i][2] = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3124
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3125
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3126
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3127
	Explosives = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3128
	MinesNum = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3129
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3130
	EnableGameFlags(gfInfAttack, gfDisableWind)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3131
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3132
	RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3133
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3134
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3135
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3136
function showHedgeEditorMissionPanel()
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3137
	ShowMission	(
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3138
		loc("HEDGEEDITOR"),
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3139
		loc("An experimental (and buggy!) editing tool for missions and more"),
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3140
		loc("Manual: https://hedgewars.org/hedgeeditor") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3141
		" " .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3142
		loc("Place Girder: Girder") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3143
		loc("Place Rubber: Rubber") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3144
		loc("Place Gears (and more): Air Attack") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3145
		loc("Change Selection: [Up], [Down], [Left], [Right]") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3146
		loc("Toggle Help: Precise+1 (While a tool is selected)") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3147
		" " .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3148
		loc("COMMANDS: (Use while no weapon is selected)") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3149
		loc("Save Level: Precise+4") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3150
		loc("Toggle Editing Weapons and Tools: Precise+2") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3151
		" " .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3152
		"", 4, 5000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3153
		)
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3154
end
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3155
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3156
function onGameStart()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3157
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3158
	trackTeams()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3159
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3160
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3161
	InterpretPoints()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3162
	LoadLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3163
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3164
	showHedgeEditorMissionPanel()
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3165
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3166
	sCirc = AddVisualGear(0,0,vgtCircle,0,true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3167
	SetVisualGearValues(sCirc, 0, 0, 100, 255, 1, 10, 0, 40, 3, 0xffba00ff)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3168
11996
936ac92cb67a HedgeEditor: Improve graphics on girder/rubber placement
Wuzzy <almikes@aol.com>
parents: 11995
diff changeset
  3169
	--[[ This is a small hack to disable Hedgewars' girder placement since we do it on our own;
936ac92cb67a HedgeEditor: Improve graphics on girder/rubber placement
Wuzzy <almikes@aol.com>
parents: 11995
diff changeset
  3170
	this will remove the "girder circle" and gets rid of the placement failure animation ]]
936ac92cb67a HedgeEditor: Improve graphics on girder/rubber placement
Wuzzy <almikes@aol.com>
parents: 11995
diff changeset
  3171
	SetMaxBuildDistance(1)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3172
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3173
	frameID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3174
	visualSprite = sprAmGirder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3175
	sSprite = AddVisualGear(0, 0, vgtStraightShot, 0, true,1)
11993
b061f4bae002 HedgeEditor: Fix girder sprite being displayed a top left
Wuzzy <almikes@aol.com>
parents: 11992
diff changeset
  3176
	SetVisualGearValues(sSprite, 1, 1, 0, 0, nil, frameID, 20000, visualSprite, 20000, 0 )
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3177
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3178
	SetAmmoDelay(amAirAttack,0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3179
	SetAmmoDelay(amGirder,0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3180
	SetAmmoDelay(amRubber,0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3181
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3182
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3183
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3184
function SetEditingWeps(ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3185
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3186
	AddAmmo(CurrentHedgehog, amAirAttack, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3187
	AddAmmo(CurrentHedgehog, amGirder, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3188
	AddAmmo(CurrentHedgehog, amRubber, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3189
	AddAmmo(CurrentHedgehog, amTeleport, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3190
	AddAmmo(CurrentHedgehog, amRope, ammoCount)
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3191
	AddAmmo(CurrentHedgehog, amSwitch, 100)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3192
	AddAmmo(CurrentHedgehog, amSkip, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3193
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3194
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3195
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3196
function clearAmmo(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3197
	for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3198
		AddAmmo(gear,atkArray[i][1],0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3199
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3200
	for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3201
		AddAmmo(gear,utilArray[i][1],0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3202
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3203
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3204
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3205
-- the below two functions allow you to set up a themed team.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3206
-- one day, it'd be nice to be able to set their voice/flag/grave
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3207
-- ingame at this point, too, but for now, this is impossible
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3208
function SetTeamIdentity(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3209
	tName = pMode[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3210
	hIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3211
	hArr = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3212
	for i = 1,#preMadeTeam[pIndex][2] do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3213
		table.insert(hArr,preMadeTeam[pIndex][2][i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3214
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3215
	nArr = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3216
	for i = 1,#preMadeTeam[pIndex][3] do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3217
		table.insert(nArr,preMadeTeam[pIndex][3][i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3218
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3219
	SetHogTeamName(gear, tName)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3220
	runOnHogs(AssignTeam)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3221
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3222
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3223
function AssignTeam(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3224
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3225
	if GetHogTeamName(gear) == tName then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3226
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3227
		setGearValue(gear,"flag",preMadeTeam[pIndex][5])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3228
		setGearValue(gear,"voice",preMadeTeam[pIndex][6])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3229
		setGearValue(gear,"grave",preMadeTeam[pIndex][7])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3230
		setGearValue(gear,"fort",preMadeTeam[pIndex][8])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3231
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3232
		if preMadeTeam[pIndex][4] == "R" then -- random team
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3233
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3234
			if #hArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3235
				--if there are unchosen hats left, choose one
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3236
				--then remove it from the available list of hats
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3237
				i = 1+GetRandom(#hArr)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3238
				SetHogHat(gear,hArr[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3239
				table.remove(hArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3240
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3241
				-- choose any hat randomly
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3242
				SetHogHat(gear,preMadeTeam[pIndex][2][1+GetRandom(#preMadeTeam[pIndex][2])])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3243
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3244
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3245
			if #nArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3246
				i = 1+GetRandom(#nArr)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3247
				SetHogName(gear,nArr[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3248
				table.remove(nArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3249
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3250
				SetHogName(gear,preMadeTeam[pIndex][3][1+GetRandom(#preMadeTeam[pIndex][3])])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3251
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3252
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3253
		elseif preMadeTeam[pIndex][4] == "F" then -- fixed team w/ exactly 8 guys
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3254
			SetHogName(gear,preMadeTeam[pIndex][3][hIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3255
			SetHogHat(gear,preMadeTeam[pIndex][2][hIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3256
			hIndex = hIndex +1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3257
		else -- FR fixed random team with more or less than 8 guys
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3258
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3259
			if #hArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3260
				i = 1+GetRandom(#hArr)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3261
				SetHogHat(gear,hArr[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3262
				SetHogName(gear,nArr[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3263
				table.remove(hArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3264
				table.remove(nArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3265
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3266
				SetHogHat(gear,"NoHat")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3267
				SetHogName(gear,"Uninspiring hog")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3268
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3269
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3270
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3271
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3272
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3273
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3274
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3275
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3276
-- allows you to set a sort of identity and weapon profile for a given hog
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3277
-- this should only really be used when perHogAmmo is enabled
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3278
function SetHogProfile(gear, pro)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3279
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3280
	clearAmmo(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3281
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3282
	if pro == loc("Sniper") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3283
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3284
		SetHogName(gear,"Sniper")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3285
		SetHogHat(gear, "Sniper")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3286
		SetHealth(gear, 50)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3287
		AddAmmo(gear, amSniperRifle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3288
		AddAmmo(gear, amDEagle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3289
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3290
	elseif pro == loc("Pyro") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3291
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3292
		SetHogName(gear,loc("Pyro"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3293
		SetHogHat(gear, "Gasmask")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3294
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3295
		AddAmmo(gear, amFlamethrower, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3296
		AddAmmo(gear, amMolotov, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3297
		AddAmmo(gear, amNapalm, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3298
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3299
	elseif pro == loc("Soldier") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3300
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3301
		SetHogName(gear,loc("Soldier"))
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3302
		SetHogHat(gear, "war_americanww2helmet")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3303
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3304
		AddAmmo(gear, amBazooka, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3305
		AddAmmo(gear, amShotgun, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3306
		AddAmmo(gear, amMortar, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3307
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3308
	elseif pro == loc("Grenadier") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3309
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3310
		SetHogName(gear,loc("Grenadier"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3311
		SetHogHat(gear, "war_desertgrenadier1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3312
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3313
		AddAmmo(gear, amGrenade, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3314
		AddAmmo(gear, amClusterBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3315
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3316
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3317
	elseif pro == loc("Chef") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3318
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3319
		SetHogName(gear,loc("Chef"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3320
		SetHogHat(gear, "chef")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3321
		SetHealth(gear, 65)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3322
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3323
		AddAmmo(gear, amKnife, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3324
		AddAmmo(gear, amCake, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3325
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3326
	elseif pro == loc("Ninja") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3327
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3328
		SetHogName(gear,loc("Ninja"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3329
		SetHogHat(gear, "NinjaFull")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3330
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3331
		AddAmmo(gear, amRope, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3332
		AddAmmo(gear, amFirePunch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3333
		AddAmmo(gear, amParachute, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3334
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3335
	elseif pro == loc("Commander") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3336
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3337
		SetHogName(gear,loc("Commander"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3338
		SetHogHat(gear, "sf_vega")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3339
		SetHealth(gear, 120)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3340
		AddAmmo(gear, amDEagle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3341
		AddAmmo(gear, amAirAttack, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3342
		AddAmmo(gear, amNapalm, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3343
		AddAmmo(gear, amDrillStrike, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3344
		AddAmmo(gear, amMineStrike, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3345
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3346
	elseif pro == loc("Engineer") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3347
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3348
		SetHogName(gear,loc("Engineer"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3349
		SetHogHat(gear, "Glasses")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3350
		SetHealth(gear, 45)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3351
		AddAmmo(gear, amGirder, 4)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3352
		AddAmmo(gear, amRubber, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3353
		AddAmmo(gear, amLandGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3354
		AddAmmo(gear, amBlowTorch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3355
		AddAmmo(gear, amPickHammer, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3356
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3357
	elseif pro == loc("Physicist") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3358
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3359
		SetHogName(gear,loc("Physicist"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3360
		SetHogHat(gear, "lambda")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3361
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3362
		AddAmmo(gear, amIceGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3363
		AddAmmo(gear, amSineGun, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3364
		AddAmmo(gear, amBee, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3365
		AddAmmo(gear, amLowGravity, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3366
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3367
	elseif pro == loc("Trapper") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3368
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3369
		SetHogName(gear,loc("Trapper"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3370
		SetHogHat(gear, "Skull")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3371
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3372
		AddAmmo(gear, amMine, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3373
		AddAmmo(gear, amSMine, 4)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3374
		AddAmmo(gear, amAirMine, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3375
		AddAmmo(gear, amMolotov, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3376
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3377
	elseif pro == loc("Saint") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3378
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3379
		SetHogName(gear,loc("Saint"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3380
		SetHogHat(gear, "angel")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3381
		SetHealth(gear, 200)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3382
		AddAmmo(gear, amSeduction, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3383
		AddAmmo(gear, amInvulnerable, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3384
		AddAmmo(gear, amIceGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3385
		AddAmmo(gear, amHammer, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3386
		AddAmmo(gear, amResurrector, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3387
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3388
	elseif pro == loc("Clown") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3389
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3390
		SetHogName(gear,loc("Clown"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3391
		SetHogHat(gear, "clown-copper")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3392
		SetHealth(gear, 70)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3393
		AddAmmo(gear, amBaseballBat, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3394
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3395
		AddAmmo(gear, amBallgun, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3396
		AddAmmo(gear, amKamikaze, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3397
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3398
	-- some other ideas/roles
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3399
	-- relocator: portal, teleport, tardis, extra time, lasersite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3400
	-- vampire: vampire, whip, birdy, extra damage, seduction
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3401
	-- flyboy: rc plane, deagle, whip, parachute, kamikaze
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3402
	-- demo: drill, dynamite, mine, smine, blowtorch
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3403
	-- alien: ufo, sine-gun, drill rocket
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3404
	-- terminator: tardis, shotgun, cake, girder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3405
	-- yeti: ice-gun, firepunch, blowtorch
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3406
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3407
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3408
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3409
	AddAmmo(gear, amSwitch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3410
	AddAmmo(gear, amSkip, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3411
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3412
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3413
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3414
function onNewTurn()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3415
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3416
	-- regardless of our other ammo, give stuff that is useful for editing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3417
	SetEditingWeps(100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3418
	if GetHogLevel(CurrentHedgehog) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3419
		TurnTimeLeft = -1	-- is that turntime in your pocket? :D
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3420
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3421
		TurnTimeLeft = 1 -- skip the computer's turn
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3422
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3423
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3424
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3425
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3426
function onGameTick()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3427
	HandleHedgeEditor()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3428
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3429
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3430
function isATrackedGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3431
	if 	(GetGearType(gear) == gtHedgehog) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3432
		(GetGearType(gear) == gtGrenade) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3433
		(GetGearType(gear) == gtExplosives) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3434
		(GetGearType(gear) == gtTarget) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3435
		(GetGearType(gear) == gtKnife) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3436
		(GetGearType(gear) == gtMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3437
		(GetGearType(gear) == gtSMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3438
		(GetGearType(gear) == gtPortal) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3439
		(GetGearType(gear) == gtAirMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3440
		(GetGearType(gear) == gtCase)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3441
	then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3442
		return(true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3443
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3444
		return(false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3445
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3446
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3447
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3448
-- track hedgehogs and placement gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3449
function onGearAdd(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3450
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3451
	if GetGearType(gear) == gtJetpack then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3452
		ufoGear = gear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3453
		if (ufoFuel ~= 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3454
			SetHealth(ufoGear, ufoFuel)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3455
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3456
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3457
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3458
	if (GetGearType(gear) == gtAirAttack) or (GetGearType(gear) == gtGirder) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3459
		cGear = gear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3460
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3461
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3462
	if isATrackedGear(gear) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3463
		trackGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3464
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3465
		if GetGearType(gear) == gtPortal then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3466
			setGearValue(gear,"life",portalDistance)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3467
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3468
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3469
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3470
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3471
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3472
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3473
function onGearDelete(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3474
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3475
	if GetGearType(gear) == gtJetpack then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3476
		ufoGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3477
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3478
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3479
	if (GetGearType(gear) == gtAirAttack) or (GetGearType(gear) == gtGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3480
		cGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3481
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3482
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3483
	if isATrackedGear(gear) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3484
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3485
		if getGearValue(gear, "tCirc") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3486
			DeleteVisualGear(getGearValue(gear, "tCirc"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3487
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3488
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3489
		trackDeletion(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3490
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3491
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3492
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3493
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3494