share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
author Wuzzy <Wuzzy2@mail.ru>
Tue, 14 Aug 2018 09:26:32 +0200
changeset 13662 841ad2ad341d
parent 13661 21a05ef25328
child 13664 85506d95977d
permissions -rw-r--r--
Update list of supported GameFlags in HedgeEditor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12646
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     1
-----------------------------------------------------------
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     2
--- HEDGE EDITOR (for use with Hedgewars 0.9.22 and up) ---
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     3
-----------------------------------------------------------
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     4
-- A not-so-horrible mission editor.
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     5
-- Place gears like a boss!
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     6
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
     7
-- Original author: mikade
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     8
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
     9
-- feel free to shower me with your adoration and/or hate mail
13506
36f3f77e9b1b Switch from http:// to https:// URLs where possible
Wuzzy <Wuzzy2@mail.ru>
parents: 13462
diff changeset
    10
-- more info can be found at https://hedgewars.org/HedgeEditor
11037
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
-- 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
    13
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
-- GETTING STARTED (for best results!)
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
-- 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
    18
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    19
-- (optional) copy GameLogExtractor.html, jquery-1.js
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    20
-- into your Documents/Hedgewars/Logs folder
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) copy hwpmapconverter somewhere easily accessible
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
-- (optional) profit??
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    25
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
-- CORE FEATURES as of latest version
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    28
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    29
-- 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
    30
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    31
-- 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
    32
-- 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
    33
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    34
-- 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
    35
-- health crates, targets, and cleavers anywhere on the map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    36
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    37
-- select, reposition, modify, or delete placed objects.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    38
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    39
-- 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
    40
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    41
-- contextual cursor and menu graphics
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    42
-- placement sounds that are slightly more soothing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    43
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    44
-- 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
    45
-- 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
    46
-- 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
    47
-- 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
    48
-- 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
    49
-- (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
    50
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    51
--------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    52
-- MODE SPECIFIC SUPPORT
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
-- FOR CUSTOM MISSIONS/CAMPAIGN LEVELS:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    55
-- 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
    56
-- 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
    57
-- 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
    58
-- 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
    59
-- 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
    60
-- 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
    61
-- 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
    62
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    63
-- SHOPPA BALANCE / CONSTRUCTION MODE (partial and/or possibly decremented):
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    64
-- 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
    65
-- 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
    66
-- 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
    67
-- 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
    68
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    69
-- TECH RACER / HEDGE EDITOR / POINT INTERPRETER:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    70
-- place/remove waypoints/special points
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    71
-- 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
    72
-- 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
    73
-- 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
    74
-- 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
    75
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    76
-- 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
    77
-- 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
    78
-- 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
    79
-- 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
    80
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    81
---------------------------------------
12646
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
    82
-- MIKADE'S DISCLAIMER
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    83
---------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    84
-- 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
    85
-- 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
    86
-- 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
    87
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    88
-- 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
    89
-- 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
    90
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
-- GIANT "TO DO" LIST / OTHER NOTES
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
    93
-----------------------------------------
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
-- 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
    96
-- for gamelog extractor
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
-- 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
    99
-- 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
   100
-- just destroy all hogs to win map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   101
-- (what happens if we lose all our hogs?)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   102
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   103
-- 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
   104
-- checking if there is only 1 hog, etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   105
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   106
-- 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
   107
-- using girders / rubbers.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   108
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   109
-- 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
   110
-- 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
   111
12646
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
   112
-- [high]       check if we lose a mission when the enemy collects our crate (we should)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   113
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   114
-- [high] 	waypoints don't reload yet
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   115
12646
28183c98a3a9 Clean up internal HedgeEditor TODO list
Wuzzy <almikes@aol.com>
parents: 12627
diff changeset
   116
-- [high] 	add missing ammo types as they appear
11037
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
-- [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
   119
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   120
-- [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
   121
-- 			you want the missions to use it
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   122
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   123
-- [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
   124
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   125
-- [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
   126
			--[[
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   127
			girder =		"Girder Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   128
			rubber =		"Rubber Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   129
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   130
			airstrike =		(target sprite) (gear placement)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   131
							"Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   132
							"Sticky Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   133
							"Air Mine Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   134
							"Barrel Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   135
							"Target Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   136
							"Cleaver Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   137
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   138
			drillstrike =	crate sprite (crate placement mode)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   139
							"Health Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   140
							"Weapon Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   141
							"Utility Crate Placement Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   142
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
			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
   145
							"Repositioning Mode",  -- also include a delete
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
   146
							"Goal Editing Mode",
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   147
							"Hog Identity Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   148
							"Team Identity Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   149
							"Health Modification Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   150
							"Sprite Testing Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   151
							"Sprite Modification Mode",
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   152
							"Sprite Placement Mode",
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
   153
							"Waypoint Editing Mode"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   154
							}]]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   155
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   156
-- [low]	improve support for ShoppaBalance and ConstructionMode, see ranking)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   157
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   158
-- [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
   159
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   160
-- [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
   161
-- 			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
   162
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   163
-- [never?] more detailed goal tagging and multi-stage triggers
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   164
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   165
-- [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
   166
--			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
   167
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   168
-- [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
   169
-- 			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
   170
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   171
--[[ gui menu ideas that have long since been abandoned
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   172
INITIALISATION MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   173
	--gameFlags, etc
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
	Map
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   176
	Theme
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   177
	TurnTime
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   178
	Explosives
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   179
	MinesNum
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   180
	CaseFreq
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   181
	Delay
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
	HealthCaseProb
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   184
	HealthCaseAmount
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   185
	DamagePercent
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   186
	MinesTime
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   187
	MineDudPercent
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   188
	SuddenDeathTurns
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   189
	WaterRise
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   190
	HealthDecrease
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   191
HOG MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   192
	health
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   193
	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
   194
	poisoned (true/false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   195
	hat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   196
	hog level?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   197
TEAM MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   198
	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
   199
	colour
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   200
	grave
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   201
	fort
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   202
	voicepack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   203
	flag
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   204
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   205
-- this below stuff is less important
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   206
STICKY MINE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   207
	timer?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   208
MINE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   209
	timer / dud
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   210
MEDKIT MENU / EXPLOSIVE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   211
	health amount
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   212
WEP AND UTIL CRATE MENU
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   213
	contents
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
----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   216
-- MAP IDEAS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   217
----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   218
-- try to create a portal race (limit portal distance)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   219
-- 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
   220
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   221
-- 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
   222
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   223
-- 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
   224
-- and aren't allowed to kill them?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   225
-- can set it on the islands map.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   226
-- landgun
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   227
-- girder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   228
-- mudball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   229
-- hammer
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   230
-- 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
   231
-- 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
   232
-- 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
   233
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   234
-- 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
   235
-- the objective is to steal 3 enemy crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   236
-- 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
   237
-- the second one you have to drill rocket / portal.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   238
-- 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
   239
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   240
]]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   241
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   242
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   243
-- 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
   244
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   245
11637
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   246
-- Tell other scripts that we exist
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   247
HedgeEditor = true
45316b6eb4a0 Fix broken HedgeEditor map preview
Wuzzy <almikes@aol.com>
parents: 11037
diff changeset
   248
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   249
HedgewarsScriptLoad("/Scripts/Locale.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   250
HedgewarsScriptLoad("/Scripts/Tracker.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   251
HedgewarsScriptLoad("/Scripts/Params.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   252
HedgewarsScriptLoad("/Scripts/TechMaps.lua")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   253
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
   254
-- Fake ammo type for the gear placement tool
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
   255
local amCMGearPlacementTool = amAirAttack
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
   256
12329
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   257
-- Special frames in Ammos.png/Ammos_bw.png
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   258
local ammoFrameAirAttack = 63
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   259
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   260
-- Caption colors
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   261
local colorErrorMessage = 0xFFFFFFFF
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   262
local colorInfoMessage = 0xFFFFFFFF
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   263
local colorPlaceMode1 = 0xFFBA00FF -- Main placement mode
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   264
local colorPlaceMode2 = 0xFFDE85FF -- Secondary mode
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
   265
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   266
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   267
-- tracking vars for save/load purposes
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   268
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   269
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   270
local teamCounter = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   271
local lastRecordedTeam = ""
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   272
local hhs = {}
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
local waypointList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   275
local girderList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   276
local rubberList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   277
local spriteList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   278
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   279
local mineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   280
local sMineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   281
local airMineList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   282
local targetList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   283
local knifeList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   284
local explosivesList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   285
local healthCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   286
local wepCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   287
local utilCrateList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   288
local hogDataList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   289
local AIHogDataList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   290
local hFlagList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   291
local previewDataList = {}
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 shoppaPointList = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   294
local shoppaPX = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   295
local shoppaPY = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   296
local shoppaPR = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   297
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
   298
-- Misc. state variables
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
   299
local hedgeEditorMissionPanelShown = false
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
   300
local tagGears = {}
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
   301
local showGearTags = true
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
   302
13033
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
   303
local tagCursorX, tagCursorY
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
   304
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   305
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   306
-- crates are made of this stuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   307
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   308
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   309
local atkArray =
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   310
				{
12028
cfc2f087dccf HedgeEditor: Make landgun spawn in utility crates and sort list of ammo types to reflect the ammo menu ordering
Wuzzy <almikes@aol.com>
parents: 12027
diff changeset
   311
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   312
				{amBazooka, 	"amBazooka"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   313
				{amBee, 	"amBee"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   314
				{amMortar, 	"amMortar"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   315
				{amDrill, 	"amDrill"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   316
				{amSnowball, 	"amSnowball"},
12956
89930daecaab Add minigun to scripts. Also add a few missing ammos to BRW and RW
Wuzzy <Wuzzy2@mail.ru>
parents: 12941
diff changeset
   317
				{amDuck,	"amDuck"},
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   318
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   319
				{amGrenade,	"amGrenade"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   320
				{amClusterBomb,	"amClusterBomb"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   321
				{amWatermelon, 	"amWatermelon"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   322
				{amHellishBomb,	"amHellishBomb"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   323
				{amMolotov, 	"amMolotov"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   324
				{amGasBomb, 	"amGasBomb"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   325
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   326
				{amShotgun,	"amShotgun"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   327
				{amDEagle,	"amDEagle"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   328
				{amSniperRifle,	"amSniperRifle"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   329
				{amSineGun, 	"amSineGun"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   330
				{amFlamethrower,"amFlamethrower"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   331
				{amIceGun, 	"amIceGun"},
12956
89930daecaab Add minigun to scripts. Also add a few missing ammos to BRW and RW
Wuzzy <Wuzzy2@mail.ru>
parents: 12941
diff changeset
   332
				{amMinigun, 	"amMinigun"},
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   333
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   334
				{amFirePunch, 	"amFirePunch"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   335
				{amWhip,	"amWhip"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   336
				{amBaseballBat, "amBaseballBat"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   337
				{amKamikaze, 	"amKamikaze"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   338
				{amSeduction, 	"amSeduction"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   339
				{amHammer,	"amHammer"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   340
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   341
				{amMine, 	"amMine"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   342
				{amDynamite, 	"amDynamite"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   343
				{amCake, 	"amCake"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   344
				{amBallgun, 	"amBallgun"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   345
				{amRCPlane,	"amRCPlane"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   346
				{amSMine,	"amSMine"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   347
12329
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   348
				{amAirAttack,	"amAirAttack", ammoFrameAirAttack}, -- overwritten icon in Ammos.png
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   349
				{amMineStrike,	"amMineStrike"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   350
				{amNapalm, 	"amNapalm"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   351
				{amPiano,	"amPiano"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   352
				{amDrillStrike,	"amDrillStrike"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   353
				{amAirMine,	"amAirMine"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   354
12357
ae6503e17764 HedgeEditor: Fix blow torch / pick hammer in wrong crate type
Wuzzy <almikes@aol.com>
parents: 12356
diff changeset
   355
				{amPickHammer,	"amPickHammer"},
ae6503e17764 HedgeEditor: Fix blow torch / pick hammer in wrong crate type
Wuzzy <almikes@aol.com>
parents: 12356
diff changeset
   356
				{amBlowTorch, 	"amBlowTorch"},
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   357
				{amKnife,	"amKnife"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   358
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   359
				{amBirdy,	"amBirdy"},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   360
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   363
local utilArray =
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   364
				{
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   365
				{amGirder, 	"amGirder"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   366
				{amLandGun,	"amLandGun"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   367
				{amRubber, 	"amRubber"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   368
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   369
				{amRope, 	"amRope"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   370
				{amParachute, 	"amParachute"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   371
				{amTeleport,	"amTeleport"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   372
				{amJetpack,	"amJetpack"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   373
				{amPortalGun,	"amPortalGun"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   374
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   375
				{amInvulnerable,"amInvulnerable"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   376
				{amLaserSight,	"amLaserSight"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   377
				{amVampiric,	"amVampiric"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   378
				{amResurrector, "amResurrector"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   379
				{amTardis, 	"amTardis"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   380
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   381
				{amSwitch,	"amSwitch"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   382
				{amLowGravity, 	"amLowGravity"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   383
				{amExtraDamage, "amExtraDamage"},
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
   384
				{amExtraTime,	"amExtraTime"},
12028
cfc2f087dccf HedgeEditor: Make landgun spawn in utility crates and sort list of ammo types to reflect the ammo menu ordering
Wuzzy <almikes@aol.com>
parents: 12027
diff changeset
   385
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   386
				}
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
				--skiphog is 6
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   389
12647
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
   390
local effectArray = { heInvulnerable, hePoisoned, heResurrectable, heResurrected, heFrozen }
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
   391
local effectStr = { "heInvulnerable", "hePoisoned", "heResurrectable", "heResurrected", "heFrozen" }
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
   392
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   393
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   394
-- hog and map editing junk
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   397
local preMadeTeam = 	{
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
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   400
				loc_noop("Clowns"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   401
				{"WhySoSerious","clown-copper","clown-crossed","clown","Joker"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   402
				{loc_noop("Baggy"),loc_noop("Bingo"),loc_noop("Bobo"),loc_noop("Bozo"),loc_noop("Buster"),loc_noop("Chester"),loc_noop("Copper"),loc_noop("Heckles"),loc_noop("Giggles"),loc_noop("Jingo"),loc_noop("Molly"),loc_noop("Loopy"),loc_noop("Patches"),loc_noop("Tatters")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   403
				"R","cm_balls","Mobster","Rubberduck","Castle"
11037
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   406
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   407
				loc_noop("Street Fighters"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   408
				{"sf_balrog","sf_blanka","sf_chunli","sf_guile","sf_honda","sf_ken","sf_ryu","sf_vega"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   409
				{loc_noop("Balrog"),loc_noop("Blanka"),loc_noop("Chunli"),loc_noop("Guile"),loc_noop("Honda"),loc_noop("Ken"),loc_noop("Ryu"),loc_noop("Vega")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   410
				"F","cm_balrog","Surfer","dragonball","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   411
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   412
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   413
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   414
				loc_noop("Cybernetic Empire"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   415
				{"cyborg1","cyborg2"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   416
				{loc_noop("Unit 189"),loc_noop("Unit 234"),loc_noop("Unit 333"),loc_noop("Unit 485"),loc_noop("Unit 527"),loc_noop("Unit 638"),loc_noop("Unit 709"),loc_noop("Unit 883")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   417
				"R","cm_binary","Robot","Grave","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   418
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   419
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   420
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   421
				loc_noop("Color Squad"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   422
				{"hair_blue","hair_green","hair_red","hair_yellow","hair_purple","hair_grey","hair_orange","hair_pink"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   423
				{loc_noop("Blue"),loc_noop("Green"),loc_noop("Red"),loc_noop("Yellow"),loc_noop("Purple"),loc_noop("Grey"),loc_noop("Orange"),loc_noop("Pink")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   424
				"F","mauritius","Singer","Grave","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   425
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   426
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   427
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   428
				loc_noop("Fruit"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   429
				{"fr_apple","fr_banana","fr_lemon","fr_orange","fr_pumpkin","fr_tomato"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   430
				{loc_noop("Juicy"),loc_noop("Squishy"),loc_noop("Sweet"),loc_noop("Sour"),loc_noop("Bitter"),loc_noop("Ripe"),loc_noop("Rotten"),loc_noop("Fruity")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   431
				"R","cm_mog","Default","Cherry","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   432
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   433
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   434
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   435
				loc_noop("The Police"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   436
				{"bobby","bobby2v","policecap","policegirl","royalguard"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   437
				{loc_noop("Hightower"),loc_noop("Lassard"),loc_noop("Callahan"),loc_noop("Jones"),loc_noop("Harris"),loc_noop("Thompson"),loc_noop("Mahoney"),loc_noop("Hooks"),loc_noop("Tackleberry")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   438
				"R","cm_star","British","Statue","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   439
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   440
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   441
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   442
				loc_noop("The Ninja-Samurai Alliance"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   443
				{"NinjaFull","NinjaStraight","NinjaTriangle","Samurai","StrawHat","StrawHatEyes","StrawHatFacial","naruto"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   444
				{loc_noop("Bushi"),loc_noop("Tatsujin"),loc_noop("Itami"),loc_noop("Arashi"),loc_noop("Shinobi"),loc_noop("Ukemi"),loc_noop("Godai"),loc_noop("Kenshi"),loc_noop("Ninpo")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   445
				"R","japan","Default","octopus","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   446
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   447
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   448
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   449
				loc_noop("Pokémon"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   450
				{"poke_ash","poke_charmander","poke_chikorita","poke_jigglypuff","poke_lugia","poke_mudkip","poke_pikachu","poke_slowpoke","poke_squirtle","poke_voltorb"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   451
				{loc_noop("Ash"),loc_noop("Charmander"),loc_noop("Chikorita"),loc_noop("Jigglypuff"),loc_noop("Lugia"),loc_noop("Mudkip"),loc_noop("Pikachu"),loc_noop("Slowpoke"),loc_noop("Squirtle"),loc_noop("Voltorb")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   452
				"FR","cm_pokemon","Default","pokeball","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   453
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   454
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   455
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   456
				loc_noop("The Zoo"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   457
				{"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"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   458
				{loc_noop("Batty"),loc_noop("Tails"),loc_noop("Bunny"),loc_noop("Deer"),loc_noop("Spikes"),loc_noop("Horns"),loc_noop("Bacon"),loc_noop("Porkey"),loc_noop("Sheepy"),loc_noop("Chicken"),loc_noop("Trunks"),loc_noop("Fishy"),loc_noop("Legs"),loc_noop("Slimer"),loc_noop("Roshi")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   459
				"FR","cm_birdy","Default","Bone","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   460
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   461
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   462
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   463
				loc_noop("The Devs"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   464
				{"ushanka","zoo_Sheep","bb_bob","Skull","poke_mudkip","lambda","WizardHat","sf_ryu","android","fr_lemon","mp3"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   465
				{loc_noop("unC0Rr"), loc_noop("sheepluva"), loc_noop("nemo"), loc_noop("mikade"), loc_noop("koda"), loc_noop("burp"),loc_noop("HeneK"),loc_noop("Tiyuri"),loc_noop("Xeli"),loc_noop("Displacer"),loc_noop("szczur")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   466
				"FR","cm_hw","Classic","Statue","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   467
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   468
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   469
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   470
				loc_noop("Mushroom Kingdom"),
12429
90e43d1bcd5b HedgeEditor: Add 2 names to Mushroom Kingdom team identidy to get a full set of 8 hogs
Wuzzy <almikes@aol.com>
parents: 12357
diff changeset
   471
				{"sm_daisy","sm_luigi","sm_mario","sm_peach","sm_toad","sm_wario","NoHat","NoHat"},
90e43d1bcd5b HedgeEditor: Add 2 names to Mushroom Kingdom team identidy to get a full set of 8 hogs
Wuzzy <almikes@aol.com>
parents: 12357
diff changeset
   472
				{loc_noop("Daisy"),loc_noop("Luigi"),loc_noop("Mario"),loc_noop("Princess Peach"),loc_noop("Toad"),loc_noop("Wario"),loc_noop("Yoshi"),loc_noop("Waluigi")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   473
				"FR","comoros","Default","Badger","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   474
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   475
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   476
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   477
				loc_noop("Pirates"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   478
				{"pirate_jack","pirate_jack_bandana"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   479
				{loc_noop("Rusted Diego"),loc_noop("Fuzzy Beard"),loc_noop("Al.Kaholic"),loc_noop("Morris"),loc_noop("Yumme Gunpowder"),loc_noop("Cutlass Cain"),loc_noop("Jim Morgan"),loc_noop("Silver"),loc_noop("Dubloon Devil"),loc_noop("Ugly Mug"),loc_noop("Fair Wind"),loc_noop("Scallywag"),loc_noop("Salty Dog"),loc_noop("Bearded Beast"),loc_noop("Timbers"),loc_noop("Both Barrels"),loc_noop("Jolly Roger")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   480
				"R","cm_pirate","Pirate","chest","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   481
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   482
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   483
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   484
				loc_noop("Gangsters"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   485
				{"Moustache","Cowboy","anzac","Bandit","thug","Jason","NinjaFull","chef"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   486
				{loc_noop("The Boss"),loc_noop("Jimmy"),loc_noop("Frankie"),loc_noop("Morris"),loc_noop("Mooney"),loc_noop("Knives"),loc_noop("Tony"),loc_noop("Meals")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   487
				"F","cm_anarchy","Mobster","deadhog","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   488
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   489
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   490
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   491
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   492
				loc_noop("Twenty-Twenty"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   493
				{"Glasses","lambda","SunGlasses","Sniper","Terminator_Glasses","Moustache_glasses","doctor","punkman","rasta"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   494
				{loc_noop("Specs"),loc_noop("Speckles"),loc_noop("Spectator"),loc_noop("Glasses"),loc_noop("Glassy"),loc_noop("Harry Potter"),loc_noop("Goggles"),loc_noop("Clark Kent"),loc_noop("Goggs"),loc_noop("Lightbender"),loc_noop("Specs Appeal"),loc_noop("Four Eyes")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   495
				"R","cm_face","Default","eyecross","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   496
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   497
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   498
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   499
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   500
				loc_noop("Monsters"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   501
				{"Skull","Jason","ShaggyYeti","Zombi","cyclops","Mummy","hogpharoah","vampirichog"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   502
				{loc_noop("Bones"),loc_noop("Jason"),loc_noop("Yeti"),loc_noop("Zombie"),loc_noop("Old One Eye"),loc_noop("Ramesses"),loc_noop("Xerxes"),loc_noop("Count Hogula")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   503
				"FR","cm_vampire","Default","octopus","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   504
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   505
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   506
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   507
				loc_noop("The Iron Curtain"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   508
				{"ushanka","war_sovietcomrade1","war_sovietcomrade1","ushanka"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   509
				{loc_noop("Alex"),loc_noop("Sergey"),loc_noop("Vladimir"),loc_noop("Andrey"),loc_noop("Dimitry"),loc_noop("Ivan"),loc_noop("Oleg"),loc_noop("Kostya"),loc_noop("Anton"),loc_noop("Eugene")},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   510
				"R","cm_soviet","Russian","skull","Castle"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   511
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   512
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   513
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   514
				loc_noop("Desert Storm"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   515
				{"war_desertofficer","war_desertgrenadier1","war_desertmedic","war_desertsapper1","war_desertgrenadier2","war_desertgrenadier4","war_desertsapper2","war_desertgrenadier5"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   516
				{loc_noop("Brigadier Briggs"),loc_noop("Lt. Luke"),loc_noop("Sgt. Smith"),loc_noop("Corporal Calvin"),loc_noop("Frank"),loc_noop("Joe"),loc_noop("Sam"),loc_noop("Donald")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   517
				"F","bhutan","Default","Grave","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   518
				},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   519
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   520
				{
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   521
				loc_noop("The Hospital"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   522
				{"doctor","nurse","war_britmedic","war_desertmedic","war_germanww2medic"},
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   523
				{loc_noop("Dr. Blackwell"),loc_noop("Dr. Drew"),loc_noop("Dr. Harvey"),loc_noop("Dr. Crushing"),loc_noop("Dr. Jenner"),loc_noop("Dr. Barnard"),loc_noop("Dr. Parkinson"),loc_noop("Dr. Banting"),loc_noop("Dr. Horace"),loc_noop("Dr. Hollows"),loc_noop("Dr. Jung")},
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 12047
diff changeset
   524
				"R","cm_firstaid","Default","heart","Castle"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   525
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   526
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   527
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   528
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   529
local preMadeTeamNamesTranslated = {}
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   530
local preMadeTeamNamesOriginal = {}
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   531
for i=1, #preMadeTeam do
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   532
	table.insert(preMadeTeamNamesOriginal, preMadeTeam[i][1])
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   533
	table.insert(preMadeTeamNamesTranslated, loc(preMadeTeam[i][1]))
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
   534
end
11037
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
local gameFlagList =	{
13662
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   537
			{"gfOneClanMode", false, gfOneClanMode},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   538
			{"gfMultiWeapon", false, gfMultiWeapon},
13662
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   539
			{"gfSolidLand", false, gfSolidLand},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   540
			{"gfBorder", false, gfBorder},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   541
			{"gfDivideTeams", false, gfDivideTeams},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   542
			{"gfLowGravity", false, gfLowGravity},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   543
			{"gfLaserSight", true, gfLaserSight},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   544
			{"gfInvulnerable", false, gfInvulnerable},
13662
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   545
			{"gfResetHealth", false, gfResetHealth},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   546
			{"gfVampiric", false, gfVampiric},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   547
			{"gfKarma", false, gfKarma},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   548
			{"gfArtillery", false, gfArtillery},
13662
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   549
			{"gfSwitchHog", false, gfSwitchHog},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   550
			{"gfRandomOrder", false, gfRandomOrder},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   551
			{"gfKing", false, gfKing},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   552
			{"gfPlaceHog", false, gfPlaceHog},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   553
			{"gfSharedAmmo", false, gfSharedAmmo},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   554
			{"gfDisableGirders", false, gfDisableGirders},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   555
			{"gfDisableLandObjects", false, gfDisableLandObjects},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   556
			{"gfAISurvival", false, gfAISurvival},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   557
			{"gfInfAttack", true, gfInfAttack},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   558
			{"gfResetWeps", false, gfResetWeps},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   559
			{"gfPerHogAmmo", false, gfPerHogAmmo},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   560
			{"gfDisableWind", false, gfDisableWind},
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   561
			{"gfMoreWind", false, gfMoreWind},
13662
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   562
			{"gfTagTeam", false, gfTagTeam},
841ad2ad341d Update list of supported GameFlags in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13661
diff changeset
   563
			{"gfShoppaBorder", false, gfShoppaBorder},
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   564
			}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   565
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   566
 local reducedSpriteIDArray = {
12338
43eb886f479b HedgeEditor: Make sprTargetBee the first selected sprite
Wuzzy <almikes@aol.com>
parents: 12329
diff changeset
   567
  sprTargetBee, sprAmGirder, sprAmRubber, sprIceTexture, sprHHTelepMask,
12011
6540fcfad01c HedgeEditor: Resort sprite array, add sprTargetBee
Wuzzy <almikes@aol.com>
parents: 12010
diff changeset
   568
  sprAMAmmos, sprAMAmmosBW, sprAMSlot, sprAMCorners, sprTurnsLeft, sprBotlevels,
6540fcfad01c HedgeEditor: Resort sprite array, add sprTargetBee
Wuzzy <almikes@aol.com>
parents: 12010
diff changeset
   569
  sprSpeechCorner, sprSpeechEdge, sprSpeechTail, sprThoughtCorner, sprThoughtEdge, sprThoughtTail,
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
   570
  sprShoutCorner, sprShoutEdge, sprShoutTail, }
11641
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   571
12310
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
   572
 -- Set in onGameInit
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
   573
 local reducedSpriteIDArrayFrames
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
   574
11641
9edd7d5e32ac HedgeEditor: Fix list of available sprites
Wuzzy <almikes@aol.com>
parents: 11640
diff changeset
   575
 local reducedSpriteTextArray = {
12338
43eb886f479b HedgeEditor: Make sprTargetBee the first selected sprite
Wuzzy <almikes@aol.com>
parents: 12329
diff changeset
   576
  "sprTargetBee", "sprAmGirder", "sprAmRubber", "sprIceTexture", "sprHHTelepMask",
12011
6540fcfad01c HedgeEditor: Resort sprite array, add sprTargetBee
Wuzzy <almikes@aol.com>
parents: 12010
diff changeset
   577
  "sprAMAmmos", "sprAMAmmosBW", "sprAMSlot",  "sprAMCorners", "sprTurnsLeft", "sprBotlevels",
6540fcfad01c HedgeEditor: Resort sprite array, add sprTargetBee
Wuzzy <almikes@aol.com>
parents: 12010
diff changeset
   578
  "sprSpeechCorner", "sprSpeechEdge", "sprSpeechTail", "sprThoughtCorner", "sprThoughtEdge", "sprThoughtTail",
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
   579
  "sprShoutCorner", "sprShoutEdge", "sprShoutTail", }
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   580
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   581
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   582
-- placement shite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   583
----------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   584
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   585
local landType = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   586
local superDelete = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   587
local ufoGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   588
ufoFuel = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   589
mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   590
local portalDistance = 5000/5
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   591
local helpDisabled = false  --determines whether help popups pop up
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   592
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
   593
local crateSprite = nil-- this is a visual gear aid for crate placement
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
   594
local crateSpriteBorer = nil
13127
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
   595
local waypointPreviewSprite = nil
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   596
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   597
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
   598
local curWep = amNothing
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   599
local leftHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   600
local rightHeld = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   601
local preciseOn = false
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
-- primary placement categories
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   604
local cIndex = 1 -- category index
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   605
local cat = 	{
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   606
				loc("Girder Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   607
				loc("Rubber Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   608
				loc("Mine Placement Mode"),
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
   609
				loc("Dud Mine Placement Mode"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   610
				loc("Sticky Mine Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   611
				loc("Air Mine Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   612
				loc("Barrel Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   613
				loc("Health Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   614
				loc("Weapon Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   615
				loc("Utility Crate Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   616
				loc("Target Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   617
				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
   618
				loc("Repositioning Mode"),
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
   619
				loc("Goal Definition Mode"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   620
				loc("Hog Identity Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   621
				loc("Team Identity Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   622
				loc("Health Modification Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   623
				loc("Sprite Placement Mode"),
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   624
				loc("Sprite Modification Mode"),
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
   625
				loc("Waypoint Editing Mode")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   626
				}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   627
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   628
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   629
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
   630
local pIndex = 1
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
   631
local sFrame = 0	-- frame in sprite placement mode
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   632
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   633
local genTimer = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   634
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   635
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
   636
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   637
local placedX = {} -- x coord of placed object
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   638
local placedY = {} -- y coord of placed object
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   639
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
   640
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
   641
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   642
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
   643
local placedSprite = {} -- what sprite was placed
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   644
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
   645
local placedLandFlags = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   646
local placedHWMapFlag = {} -- this is what HWMapConverter uses
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   647
local placedCount = 0 -- do we really need this?
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
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
   650
local sCirc -- circle that appears around selected gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   651
local sGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   652
local closestDist
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   653
local closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   654
local closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   655
13127
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
   656
local wpRadius = 450
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
   657
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   658
------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   659
-- SOME GENERAL METHODS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   660
------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   661
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   662
function BoolToString(boo)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   663
	if boo == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   664
		return("true")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   665
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   666
		return("false")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   667
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   668
end
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
function GetDistFromGearToXY(gear, g2X, g2Y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   671
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   672
	g1X, g1Y = GetGearPosition(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   673
	q = g1X - g2X
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   674
	w = g1Y - g2Y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   675
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   676
	return ( (q*q) + (w*w) )
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
end
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
-- STUFF FOR LOADING SPECIAL POINTS / HWMAP CONVERSION
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   682
------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   683
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   684
local specialPointsX = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   685
local specialPointsY = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   686
local specialPointsFlag = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   687
local specialPointsCount = 0
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 onSpecialPoint(x,y,flag)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   690
    specialPointsX[specialPointsCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   691
    specialPointsY[specialPointsCount] = y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   692
	specialPointsFlag[specialPointsCount] = flag
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   693
    specialPointsCount = specialPointsCount + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   694
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   695
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   696
-- 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
   697
-- 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
   698
-- and then increment some other counter so like
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
-- 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
   701
function InterpretPoints()
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
	-- flags run from 0 to 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   704
	for i = 0, (specialPointsCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   705
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   706
		-- Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   707
		if specialPointsFlag[i] == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   708
			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
   709
		elseif specialPointsFlag[i] == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   710
			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
   711
		elseif specialPointsFlag[i] == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   712
			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
   713
		elseif specialPointsFlag[i] == 4 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   714
			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
   715
		elseif specialPointsFlag[i] == 5 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   716
			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
   717
		elseif specialPointsFlag[i] == 6 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   718
			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
   719
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   720
		-- Sticky Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   721
		elseif specialPointsFlag[i] == 7 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   722
			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
   723
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   724
		-- Air Mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   725
		elseif specialPointsFlag[i] == 8 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   726
			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
   727
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   728
		-- Health Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   729
		elseif specialPointsFlag[i] == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   730
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),25)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   731
		elseif specialPointsFlag[i] == 10 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   732
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),50)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   733
		elseif specialPointsFlag[i] == 11 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   734
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),75)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   735
		elseif specialPointsFlag[i] == 12 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   736
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   737
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   738
		-- Cleaver
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   739
		elseif specialPointsFlag[i] == 13 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   740
			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
   741
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   742
		-- Target
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   743
		elseif specialPointsFlag[i] == 14 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   744
			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
   745
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   746
		--Barrels
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   747
		elseif specialPointsFlag[i] == 15 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   748
			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
   749
		elseif specialPointsFlag[i] == 16 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   750
			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
   751
		elseif specialPointsFlag[i] == 17 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   752
			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
   753
		elseif specialPointsFlag[i] == 18 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   754
			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
   755
		elseif specialPointsFlag[i] == 19 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   756
			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
   757
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   758
		-- There are about 58+- weps / utils
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   759
		-- Weapon Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   760
		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
   761
			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
   762
			setGearValue(tempG,"contents",atkArray[specialPointsFlag[i]-19][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   763
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
		-- Utility Crates
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   766
		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
   767
			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
   768
			setGearValue(tempG,"contents",utilArray[specialPointsFlag[i]-19-#atkArray][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   769
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   770
		--79-82 (reserved for future wep crates)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   771
		--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
   772
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   773
		--90-99 reserved for scripted structures
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   774
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   775
		elseif specialPointsFlag[i] == 98 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   776
			portalDistance = div(specialPointsX[i],5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   777
			ufoFuel = specialPointsY[i]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   778
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   779
		-- Normal Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   780
		elseif specialPointsFlag[i] == 100 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   781
			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
   782
		elseif specialPointsFlag[i] == 101 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   783
			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
   784
		elseif specialPointsFlag[i] == 102 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   785
			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
   786
		elseif specialPointsFlag[i] == 103 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   787
			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
   788
		elseif specialPointsFlag[i] == 104 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   789
			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
   790
		elseif specialPointsFlag[i] == 105 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   791
			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
   792
		elseif specialPointsFlag[i] == 106 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   793
			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
   794
		elseif specialPointsFlag[i] == 107 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   795
			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
   796
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   797
		-- Invulnerable Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   798
		elseif specialPointsFlag[i] == 108 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   799
			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
   800
		elseif specialPointsFlag[i] == 109 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   801
			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
   802
		elseif specialPointsFlag[i] == 110 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   803
			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
   804
		elseif specialPointsFlag[i] == 111 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   805
			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
   806
		elseif specialPointsFlag[i] == 112 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   807
			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
   808
		elseif specialPointsFlag[i] == 113 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   809
			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
   810
		elseif specialPointsFlag[i] == 114 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   811
			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
   812
		elseif specialPointsFlag[i] == 115 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   813
			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
   814
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   815
		-- Icy Girders
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   816
		elseif specialPointsFlag[i] == 116 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   817
			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
   818
		elseif specialPointsFlag[i] == 117 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   819
			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
   820
		elseif specialPointsFlag[i] == 118 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   821
			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
   822
		elseif specialPointsFlag[i] == 119 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   823
			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
   824
		elseif specialPointsFlag[i] == 120 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   825
			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
   826
		elseif specialPointsFlag[i] == 121 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   827
			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
   828
		elseif specialPointsFlag[i] == 121 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   829
			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
   830
		elseif specialPointsFlag[i] == 123 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   831
			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
   832
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   833
		-- Rubber Bands
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   834
		elseif specialPointsFlag[i] == 124 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   835
			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
   836
		elseif specialPointsFlag[i] == 125 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   837
			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
   838
		elseif specialPointsFlag[i] == 126 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   839
			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
   840
		elseif specialPointsFlag[i] == 127 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   841
			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
   842
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   843
		-- Waypoints
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   844
		else -- 0 / no value
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   845
			PlaceWaypoint(specialPointsX[i],specialPointsY[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   846
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   847
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   848
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   849
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   850
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   851
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   852
--shoppabalance crap
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   853
function AddShoppaPoint(x,y,c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   854
	table.insert(shoppaPX, x)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   855
	table.insert(shoppaPY, y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   856
	table.insert(shoppaPR, c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   857
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   858
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   859
function GetRankedColour(r)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   860
	if r == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   861
		return(0xFF0000FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   862
	elseif r == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   863
		return(0xFFFF00FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   864
	elseif r == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   865
		return(0x00FF00FF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   866
	elseif r == 4 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   867
		return(0x0000FFFF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   868
	elseif r == 5 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   869
		return(0xFF00FFFF)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   870
	end
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
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   874
-- PRIMARY HEDGE EDITOR PLACEMENT STUFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   875
-----------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   876
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   877
function GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   878
	closestDist = 999999999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   879
	closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   880
	runOnGears(SelectGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   881
	return(closestGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   882
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   883
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   884
function SelectGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   885
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   886
	d = GetDistFromGearToXY(gear, placedX[placedCount], placedY[placedCount])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   887
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   888
	if d < closestDist then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   889
		closestDist = d
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   890
		closestGear = gear
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   893
end
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
function PlaceWaypoint(x,y)
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
	placedX[placedCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   898
	placedY[placedCount] = y
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
   899
	placedType[placedCount] = loc("Waypoint Editing Mode")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   900
	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
   901
	placedHWMapFlag[placedCount] = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   902
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   903
	placedSprite[placedCount] = vgtCircle
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   904
	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   905
	placedTint[placedCount] = 0xFF0000FF
13127
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
   906
	placedFrame[placedCount] = 1
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
   907
	SetVisualGearValues(placedSpec[placedCount], x, y, 164, 224, 1, 10, 0, wpRadius, 5, placedTint[placedCount])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   908
	placedCount = placedCount +1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   909
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   910
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   911
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   912
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
   913
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   914
	placedX[placedCount] = pX
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   915
	placedY[placedCount] = pY
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   916
	placedSpec[placedCount] = nil
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
	if pSprite == sprAmGirder then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   919
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   920
		placedType[placedCount] = loc("Girder Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   921
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   922
		--newHWMapStuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   923
		if pLandFlags == lfIndestructible then	specialMod = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   924
		elseif pLandFlags == lfIce then	specialMod = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   925
		else specialMod = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   926
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   927
		placedHWMapFlag[placedCount] = pFrame+100+(8*specialMod)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   928
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   929
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   930
	elseif pSprite == sprAmRubber then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   931
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   932
		placedType[placedCount] = loc("Rubber Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   933
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   934
		--newHWMapStuff
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   935
		if pFrame == 0 then placedHWMapFlag[placedCount] = 124
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   936
		elseif pFrame == 1 then placedHWMapFlag[placedCount] = 125
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   937
		elseif pFrame == 2 then placedHWMapFlag[placedCount] = 126
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   938
		elseif pFrame == 3 then placedHWMapFlag[placedCount] = 127
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   939
		end
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
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   942
		placedType[placedCount] = loc("Sprite Placement Mode")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   943
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   944
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   945
	if pLandFlags == lfIce then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   946
		placedLandFlags[placedCount] = "lfIce"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   947
	elseif pLandFlags == lfIndestructible then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   948
		placedLandFlags[placedCount] = "lfIndestructible"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   949
	elseif pLandFlags == lfBouncy then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   950
		placedLandFlags[placedCount] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   951
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   952
		placedLandFlags[placedCount] = "lfNormal"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   953
	end
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
	placedTint[placedCount] = pTint
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   956
	placedFrame[placedCount] = pFrame
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   957
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   958
	placedSprite[placedCount] = pSprite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   959
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
   960
	local success = PlaceSprite(pX, pY, pSprite, pFrame, pTint, nil, nil, nil, pLandFlags)
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
   961
	if succcess then
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
   962
		placedCount = placedCount + 1
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
   963
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   964
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   965
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   966
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   967
function CallPlaceSprite(pID, silent)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   968
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   969
	if silent == nil then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   970
		silent = false
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   971
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   972
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   973
	if landType == lfIce then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   974
		placedLandFlags[pID] = "lfIce"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   975
		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
   976
	elseif landType == lfIndestructible then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   977
		placedLandFlags[pID] = "lfIndestructible"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   978
		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
   979
	elseif landType == lfBouncy then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   980
		placedLandFlags[pID] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   981
		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
   982
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   983
		placedLandFlags[pID] = "lfNormal"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   984
		--placedTint[pID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   985
		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
   986
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   987
12329
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   988
	-- Special case: Placing amAirAttack of the ammos sprite (since this one is overwritten)
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   989
	local actualDisplayedImage = placedFrame[pID]
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   990
	if (placedSprite[pID] == sprAMAmmos or placedSprite[pID] == sprAMAmmosBW) and (actualDisplayedImage == (amAirAttack - 1)) then
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   991
		actualDisplayedImage = ammoFrameAirAttack
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   992
	end
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
   993
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
   994
	local success = PlaceSprite(placedX[pID], placedY[pID], placedSprite[pID], actualDisplayedImage,
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   995
		placedTint[pID],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   996
		nil, -- overrite existing land
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   997
		nil, nil, -- this stuff specifies flipping
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   998
		landType)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
   999
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1000
	if not silent then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1001
		if success then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1002
			PlaySound(sndPlaced)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1003
		else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1004
			PlaySound(sndDenied)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1005
		end
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1006
	end
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1007
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1008
	return success
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1009
11037
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
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1048
                PlaySound(sndBump)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1049
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1050
		placedX[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1051
		placedY[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1052
		placedSpec[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1053
		placedType[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1054
		placedTint[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1055
		placedSprite[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1056
		placedFrame[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1057
		placedLandFlags[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1058
		closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1059
		SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1060
	else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1061
		PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1062
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1063
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1064
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1065
-- 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
  1066
function EraseClosestWaypoint()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1067
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1068
	closestDist = 999999999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1069
	closestSpriteID = nil -- just in case
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1070
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1071
	for i = 0, (placedCount-1) do
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  1072
		if (placedType[i] == loc("Waypoint Editing Mode")) then
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1073
			local q = placedX[i] - placedX[placedCount]
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1074
			local w = placedY[i] - placedY[placedCount]
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1075
			local d = ( (q*q) + (w*w) )
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1076
			if d < closestDist then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1077
				closestDist = d
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1078
				closestSpriteID = i
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1079
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1080
				SetVisualGearValues(sSprite, placedX[i], placedY[i], 0, 0, nil, placedFrame[i], 10000, placedSprite[i], 10000, newTint )
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1081
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1082
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1083
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1084
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1085
	if closestSpriteID ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1086
		DeleteVisualGear(placedSpec[closestSpriteID])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1087
		placedX[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1088
		placedY[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1089
		placedSpec[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1090
		placedType[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1091
		placedTint[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1092
		placedSprite[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1093
		placedFrame[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1094
		placedLandFlags[closestSpriteID] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1095
		closestSpriteID = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1096
		SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1097
		PlaySound(sndBump)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1098
	else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1099
		PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1100
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1101
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1102
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1103
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1104
-- essentially called when user clicks the mouse
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1105
-- with girders or an airattack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1106
function PlaceObject(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1107
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1108
	placedX[placedCount] = x
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1109
	placedY[placedCount] = y
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1110
	placedType[placedCount] = cat[cIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1111
	placedSpec[placedCount] = pMode[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1112
	placedTint[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1113
	placedFrame[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1114
	placedLandFlags[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1115
	placedSprite[placedCount] = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1116
	placedHWMapFlag[placedCount] = nil
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1117
	placementSucceeded = true		-- We assume success unless the placement logic said otherwise
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1118
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1119
	if cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1120
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1121
		if superDelete == false then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1122
			--lfObject and lfBasic
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1123
			placedFrame[placedCount] = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1124
			placedSprite[placedCount] = sprAmGirder
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1125
			placementSucceeded = CallPlaceSprite(placedCount)
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1126
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1127
			if placementSucceeded then
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1128
				if landType == lfIndestructible then	specialMod = 1
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1129
				elseif landType == lfIce then	specialMod = 2
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1130
				else specialMod = 0
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1131
				end
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1132
				placedHWMapFlag[placedCount] = CGR+100+(8*specialMod)
12006
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1133
			else
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1134
				placedType[placedCount] = "bogus"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1135
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1136
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1137
			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
  1138
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1139
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1140
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1141
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1142
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1143
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1144
		if superDelete == false then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1145
			placedFrame[placedCount] = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1146
			placedSprite[placedCount] = sprAmRubber
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1147
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1148
			--new ermagerd
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1149
			placedLandFlags[placedCount] = "lfBouncy"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1150
			placedTint[placedCount] = 255 + (255*0x100) + (255*0x10000) + (255*0x1000000) -- A BGR
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1151
			placementSucceeded = PlaceSprite(placedX[placedCount], placedY[placedCount], placedSprite[placedCount], placedFrame[placedCount],
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1152
				placedTint[placedCount],
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1153
				nil,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1154
				nil, nil,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1155
				landType)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1156
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1157
			if placementSucceeded then
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1158
				if CGR == 0 then placedHWMapFlag[placedCount] = 124
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1159
				elseif CGR == 1 then placedHWMapFlag[placedCount] = 125
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1160
				elseif CGR == 2 then placedHWMapFlag[placedCount] = 126
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1161
				elseif CGR == 3 then placedHWMapFlag[placedCount] = 127
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1162
				end
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1163
				PlaySound(sndPlaced)
12006
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1164
			else
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1165
				placedType[placedCount] = "bogus"
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1166
				PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1167
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1168
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1169
			placedType[placedCount] = "bogus"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1170
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1171
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1172
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1173
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1174
	elseif cat[cIndex] == loc("Target Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1175
		gear = AddGear(x, y, gtTarget, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1176
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1177
		gear = AddGear(x, y, gtKnife, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1178
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1179
		gear = SpawnHealthCrate(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1180
		SetHealth(gear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1181
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1182
		gear = SpawnAmmoCrate(x, y, atkArray[pIndex][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1183
		placedSpec[placedCount] = atkArray[pIndex][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1184
		setGearValue(gear,"contents",atkArray[pIndex][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1185
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1186
		gear = SpawnUtilityCrate(x, y, utilArray[pIndex][1])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1187
		placedSpec[placedCount] = utilArray[pIndex][2]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1188
		setGearValue(gear,"contents",utilArray[pIndex][2])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1189
	elseif cat[cIndex] == loc("Barrel Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1190
		gear = AddGear(x, y, gtExplosives, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1191
		SetHealth(gear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1192
	elseif cat[cIndex] == loc("Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1193
		gear = AddGear(x, y, gtMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1194
		SetTimer(gear, pMode[pIndex])
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1195
	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
  1196
		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
  1197
		SetHealth(gear, 0)
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1198
		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
  1199
	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1200
		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
  1201
		SetTimer(gear, pMode[pIndex])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1202
	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1203
		gear = AddGear(x, y, gtAirMine, 0, 0, 0, 0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1204
		SetTimer(gear, pMode[pIndex])
12044
75f56c1198c3 HedgeEditor: Fix air mines timer being falsely exported and displayed
Wuzzy <almikes@aol.com>
parents: 12043
diff changeset
  1205
		SetGearValues(gear, nil, nil, pMode[pIndex])
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1206
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1207
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1208
		if pMode[pIndex] == loc("Selection Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1209
			sGear = GetClosestGear()
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1210
			if sGear ~= nil then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1211
				PlaySound(sndPortalSwitch)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1212
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1213
		elseif pMode[pIndex] == loc("Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1214
			if sGear ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1215
				SetGearPosition(sGear, x, y)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1216
				PlaySound(sndWarp)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1217
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1218
		elseif pMode[pIndex] == loc("Deletion Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1219
			sGear = GetClosestGear()
12021
c7c0be04ee36 HedgeEditor: Proper error handling when attempting to delete hedgehogs
Wuzzy <almikes@aol.com>
parents: 12020
diff changeset
  1220
			if (sGear == nil) then
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  1221
				AddCaption(loc("Please click on a gear."), colorErrorMessage, capgrpVolume)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1222
				PlaySound(sndDenied)
12021
c7c0be04ee36 HedgeEditor: Proper error handling when attempting to delete hedgehogs
Wuzzy <almikes@aol.com>
parents: 12020
diff changeset
  1223
			elseif (GetGearType(sGear) == gtHedgehog) then
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  1224
				AddCaption(loc("Hedgehogs can not be deleted."), colorErrorMessage, capgrpVolume)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1225
				PlaySound(sndDenied)
12021
c7c0be04ee36 HedgeEditor: Proper error handling when attempting to delete hedgehogs
Wuzzy <almikes@aol.com>
parents: 12020
diff changeset
  1226
			else
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1227
				DeleteGear(sGear)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1228
				PlaySound(sndBump)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1229
			end
12021
c7c0be04ee36 HedgeEditor: Proper error handling when attempting to delete hedgehogs
Wuzzy <almikes@aol.com>
parents: 12020
diff changeset
  1230
			sGear = nil
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1231
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1232
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1233
	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
  1234
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1235
		sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1236
		if (sGear ~= nil) and (GetGearType(sGear) == gtHedgehog) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1237
			if (cat[cIndex] == loc("Hog Identity Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1238
				SetHogProfile(sGear, pMode[pIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1239
			else -- set for the whole team
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1240
				SetTeamIdentity(sGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1241
			end
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1242
			PlaySound(sndHello, sGear)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1243
		else
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  1244
			AddCaption(loc("Please click on a hedgehog."), colorErrorMessage, capgrpVolume)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1245
			PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1246
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1247
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1250
	elseif cat[cIndex] == loc("Health Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1251
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1252
		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
  1253
		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
  1254
		if gt == gtHedgehog or gt == gtExplosives or (gt == gtCase and GetGearPos(sGear) == 0x2) then
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1255
			local oldHealth, hDiff = GetHealth(sGear)
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1256
			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
  1257
				SetHealth(sGear, pMode[pIndex][1])
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1258
				hDiff = pMode[pIndex][1] - oldHealth
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1259
			elseif pMode[pIndex][2] == "mod" then
12025
325b39ee6bc8 HedgeEditor: Allow health crates with 0 health
Wuzzy <almikes@aol.com>
parents: 12024
diff changeset
  1260
				local min
325b39ee6bc8 HedgeEditor: Allow health crates with 0 health
Wuzzy <almikes@aol.com>
parents: 12024
diff changeset
  1261
				if gt == gtCase then min = 0 else min = 1 end
325b39ee6bc8 HedgeEditor: Allow health crates with 0 health
Wuzzy <almikes@aol.com>
parents: 12024
diff changeset
  1262
				local newHealth = math.max(min, GetHealth(sGear) + tonumber(pMode[pIndex][1]))
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1263
				SetHealth(sGear, newHealth)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1264
				hDiff = newHealth - oldHealth
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1265
			end
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1266
			PlaySound(sndPortalSwitch)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1267
			if gt == gtHedgehog and hDiff < 0 then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1268
				local snd = { sndOw1, sndOw2, sndOw3 }
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1269
				PlaySound(snd[math.random(1, #snd)], sGear)
11638
df8fbbbcd775 Hedge Editor: Allow to add/subtract health in Health Modification Mode
Wuzzy <almikes@aol.com>
parents: 11637
diff changeset
  1270
			end
12002
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1271
		elseif gt == gtMine and GetHealth(sGear) == 0 then
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1272
			local newHealth 
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1273
			if pMode[pIndex][2] == "set" then
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1274
				newHealth =  pMode[pIndex][1]
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1275
			elseif pMode[pIndex][2] == "mod" then
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1276
				local _, oldHealth
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1277
				_,_,_,_,_,_,_,_,_,_,_, oldHealth = GetGearValues(sGear)
12029
6191d8828254 HedgeEditor: Fix health add/subtract not working for dud mines
Wuzzy <almikes@aol.com>
parents: 12028
diff changeset
  1278
				oldHealth = 36 - oldHealth
6191d8828254 HedgeEditor: Fix health add/subtract not working for dud mines
Wuzzy <almikes@aol.com>
parents: 12028
diff changeset
  1279
				newHealth = math.max(1, oldHealth + tonumber(pMode[pIndex][1]))
12002
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1280
			end
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1281
			if newHealth ~= nil then
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1282
				SetGearValues(sGear, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 36 - newHealth)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1283
				PlaySound(sndPortalSwitch)
12002
a2f0c0d0e534 HedgeEditor: Allow to modify dud mine health
Wuzzy <almikes@aol.com>
parents: 12001
diff changeset
  1284
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1285
		else
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  1286
			AddCaption(loc("Please click on a hedgehog, barrel, health crate or dud mine."), colorErrorMessage, capgrpVolume)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1287
			PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1288
		end
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
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1291
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1292
		SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1293
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1294
		if closestSpriteID ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1295
			if pMode[pIndex] == loc("LandFlag Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1296
				EraseSprite(placedX[closestSpriteID], placedY[closestSpriteID], placedSprite[closestSpriteID], placedFrame[closestSpriteID], nil, nil, nil, nil, placedLandFlags[closestSpriteID])
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1297
				placementSucceeded = CallPlaceSprite(closestSpriteID, true)
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1298
				if placementSucceeded then
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1299
					closestSpriteID = nil
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1300
					SetVisualGearValues(sSprite, 0, 0, 0, 0, 0, 1, 10000, sprAmGirder, 10000, 0x00000000 )
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1301
					PlaySound(sndPortalSwitch)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1302
				else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1303
					PlaySound(sndDenied)
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1304
				end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1305
			elseif pMode[pIndex] == loc("Sprite Erasure Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1306
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1307
				EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1308
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1309
			end
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1310
		else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1311
			PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1312
		end
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
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  1315
	elseif cat[cIndex] == loc("Goal Definition Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1316
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1317
		sGear = GetClosestGear()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1318
		if sGear ~= nil then  -- used to be closestGear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1319
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1320
			if getGearValue(sGear,"tag") == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1321
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1322
				if pMode[pIndex] == loc("Victory Condition: Collect") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1323
					if GetGearType(sGear) == gtCase then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1324
						setGearValue(sGear, "tag","collection")
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1325
						PlaySound(sndPortalSwitch)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1326
					else
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  1327
						AddCaption(loc("Please click on a crate."), colorErrorMessage, capgrpVolume)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1328
						PlaySound(sndDenied)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1329
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1330
				else
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1331
					if pMode[pIndex] == loc("Victory Condition: Destroy") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1332
						setGearValue(sGear, "tag","victory")
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1333
						PlaySound(sndPortalSwitch)
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1334
					elseif pMode[pIndex] == loc("Losing Condition: Destroy") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1335
						setGearValue(sGear, "tag","failure")
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1336
						PlaySound(sndPortalSwitch)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1337
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1338
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1339
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1340
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1341
				-- remove tag and delete circ
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1342
				setGearValue(sGear, "tag", nil)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1343
				DeleteVisualGear(getGearValue(sGear,"tCirc"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1344
				setGearValue(sGear, "tCirc", nil)
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  1345
				PlaySound(sndBump)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1346
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1347
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1348
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1349
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1350
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1351
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1352
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1353
	elseif cat[cIndex] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1354
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1355
		if superDelete == false then
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  1356
			placedFrame[placedCount] = sFrame
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1357
			placedSprite[placedCount] = reducedSpriteIDArray[pIndex]
12004
a3e2f9408799 HedgeEditor: Don't count sprites failed to place
Wuzzy <almikes@aol.com>
parents: 12003
diff changeset
  1358
			placementSucceeded = CallPlaceSprite(placedCount)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1359
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1360
			placedType[placedCount] = "bogus"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1361
			SelectClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1362
			EraseClosestSprite()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1363
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1364
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  1365
	elseif cat[cIndex] == loc("Waypoint Editing Mode") then
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1366
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1367
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1368
		if pMode[pIndex] == loc("Delete Waypoint") then
12006
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1369
			placedType[placedCount] = "bogus"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1370
			EraseClosestWaypoint()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1371
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1372
			PlaceWaypoint(x,y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1373
			placedCount = placedCount - 1
12022
34fdc3d70aca HedgeEditor: Play placement sound more often
Wuzzy <almikes@aol.com>
parents: 12021
diff changeset
  1374
			PlaySound(sndPlaced)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1375
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1376
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1377
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1378
12006
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1379
	placedCount = placedCount + 1
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
-- called when user changes primary selection
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1383
-- either via up/down keys
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1384
-- or selecting girder/airattack
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1385
function RedefineSubset()
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
	superDelete = false -- fairly new addition
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1388
	landType = 0 --- fairly new addition
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1389
	pIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1390
	pMode = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1391
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1392
	if cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1393
		pIndex = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1394
		pMode = {loc("Girder")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1395
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1396
		pIndex = CGR
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1397
		pMode = {loc("Rubber")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1398
		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
  1399
	elseif cat[cIndex] == loc("Target Placement Mode") then
12041
4cdea287bbf9 HedgeEditor: Rename “Standard” target and cleaver to just target and cleaver
Wuzzy <almikes@aol.com>
parents: 12040
diff changeset
  1400
		pMode = {loc("Target")}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1401
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
12041
4cdea287bbf9 HedgeEditor: Rename “Standard” target and cleaver to just target and cleaver
Wuzzy <almikes@aol.com>
parents: 12040
diff changeset
  1402
		pMode = {loc("Cleaver")}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1403
	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
  1404
		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
  1405
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
12025
325b39ee6bc8 HedgeEditor: Allow health crates with 0 health
Wuzzy <almikes@aol.com>
parents: 12024
diff changeset
  1406
		pMode = {25,30,40,50,75,100,150,200,0,5,10,15,20}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1407
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1408
		for i = 1, #atkArray do
12035
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  1409
			pMode[i] = GetAmmoName(atkArray[i][1], true)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1410
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1411
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1412
		for i = 1, #utilArray do
12035
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  1413
			pMode[i] = GetAmmoName(utilArray[i][1], true)
11037
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
	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
  1416
		pMode = {3000,4000,5000,0,1000,2000}
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1417
	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
  1418
		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
  1419
	elseif cat[cIndex] == loc("Mine Placement Mode") then
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1420
		pMode = {3000,4000,5000,0,1000,2000}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1421
	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
  1422
		pMode = {500,1000,1500,2000,2500,0}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1423
	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
  1424
		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
  1425
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1426
		pMode = {loc("Selection Mode"),loc("Placement Mode"), loc("Deletion Mode")}
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  1427
	elseif cat[cIndex] == loc("Goal Definition Mode") then
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  1428
		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
  1429
	elseif cat[cIndex] == loc("Hog Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1430
		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
  1431
	elseif cat[cIndex] == loc("Team Identity Mode") then
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1432
		pMode = preMadeTeamNamesTranslated
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1433
	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
  1434
		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
  1435
			{"-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
  1436
			{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
  1437
} 
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1438
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1439
		pMode = {loc("LandFlag Modification Mode"),loc("Sprite Erasure Mode")}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1440
	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
  1441
		for i = 1, #reducedSpriteTextArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1442
			pMode[i] = reducedSpriteTextArray[i]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1443
		end
12016
e93ee0bedad8 HedgeEditor: Fix nil bugs related to sprite placement mode
Wuzzy <almikes@aol.com>
parents: 12015
diff changeset
  1444
		sFrame = 0
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  1445
	elseif cat[cIndex] == loc("Waypoint Editing Mode") then
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  1446
		pMode = {loc("Place Waypoint"), loc("Delete Waypoint")}
11037
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
end
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
------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1452
-- LOADING AND SAVING DATA STUFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1453
------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1454
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1455
-- paste data you have saved previously here
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1456
function LoadLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1457
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1458
	if (mapID == nil) or (mapID == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1459
		LoadMap(1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1460
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1461
		LoadMap(mapID)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1462
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1463
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1464
	for i = 1, techCount-1 do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1465
		PlaceWaypoint(techX[i],techY[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1466
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1467
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1468
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1469
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1470
-- When you save your level, this function
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1471
-- generates the AddTeam and AddHog function calls for onGameInit()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1472
function GetDataForSavingHogs(gear)
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
	--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
  1475
	--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
  1476
	local tempDataList = {}
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1477
	if GetHogLevel(gear) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1478
		tempDataList = hogDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1479
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1480
		tempDataList = AIHogDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1481
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1482
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1483
	if GetHogTeamName(gear) ~= lastRecordedTeam then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1484
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1485
		teamCounter = teamCounter + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1486
		if teamCounter == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1487
			teamCounter = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1488
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1489
13585
72515cd20984 HedgeEditor: Use default clan color in AddTeam in mission export
Wuzzy <Wuzzy2@mail.ru>
parents: 13506
diff changeset
  1490
		-- Color argument for AddTeam; using the
72515cd20984 HedgeEditor: Use default clan color in AddTeam in mission export
Wuzzy <Wuzzy2@mail.ru>
parents: 13506
diff changeset
  1491
		-- default clan color format.
72515cd20984 HedgeEditor: Use default clan color in AddTeam in mission export
Wuzzy <Wuzzy2@mail.ru>
parents: 13506
diff changeset
  1492
		local tColor = -(GetHogClan(gear)+1)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1493
12792
8fa21750470f HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
Wuzzy <Wuzzy2@mail.ru>
parents: 12791
diff changeset
  1494
		local tFort, tGrave, tFlag, tVoice
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1495
		if getGearValue(gear,"grave") == nil then
12047
7163626748e0 Use GetHogFort in HedgeEditor
Wuzzy <almikes@aol.com>
parents: 12045
diff changeset
  1496
			tFort = GetHogFort(gear)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1497
			tGrave = GetHogGrave(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1498
			tFlag = GetHogFlag(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1499
			tVoice = GetHogVoicepack(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1500
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1501
			tGrave = getGearValue(gear,"grave")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1502
			tFort = getGearValue(gear,"fort")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1503
			tFlag = getGearValue(gear,"flag")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1504
			tVoice = getGearValue(gear,"voice")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1505
		end
12792
8fa21750470f HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
Wuzzy <Wuzzy2@mail.ru>
parents: 12791
diff changeset
  1506
		if not tFort then tFort = "Castle" end
8fa21750470f HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
Wuzzy <Wuzzy2@mail.ru>
parents: 12791
diff changeset
  1507
		if not tGrave then tGrave = "Statue" end
8fa21750470f HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
Wuzzy <Wuzzy2@mail.ru>
parents: 12791
diff changeset
  1508
		if not tFlag then tFlag= "hedgewars" end
8fa21750470f HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
Wuzzy <Wuzzy2@mail.ru>
parents: 12791
diff changeset
  1509
		if not tVoice then tVoice = "Default" end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1510
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1511
		lastRecordedTeam = GetHogTeamName(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1512
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1513
		table.insert(tempDataList, "")
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1514
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1515
		local oTeamName = getGearValue(gear, "originalTeamName")
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1516
		if oTeamName == nil or oTeamName == "" then
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1517
			oTeamName = GetHogTeamName(gear)
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1518
		end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1519
		table.insert	(tempDataList,
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  1520
						"	AddTeam(loc(\"" ..
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1521
						oTeamName  .. "\")" ..
12008
9b4abde68e3b HedgeEditor: Fix broken export of team colors
Wuzzy <almikes@aol.com>
parents: 12007
diff changeset
  1522
						", " .. tColor ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1523
						", " .. "\"" .. tGrave .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1524
						", " .. "\"" .. tFort .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1525
						", " .. "\"" .. tVoice .. "\"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1526
						", " .. "\"" .. tFlag .. "\"" ..
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
						)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1529
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1530
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1531
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1532
	table.insert(hhs, gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1533
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1534
	local oName = getGearValue(gear, "originalName")
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1535
	if oName == nil or oName == "" then
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1536
		oName = GetHogName(gear)
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1537
	end
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  1538
	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(loc(\"" ..
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  1539
					oName .. "\"), " ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1540
					GetHogLevel(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1541
					GetHealth(gear) .. ", \"" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1542
					GetHogHat(gear) .. "\"" ..
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
			)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1545
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1546
	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
  1547
12647
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1548
	for e=1, #effectArray do
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1549
		if GetEffect(gear, effectArray[e]) ~= 0 then
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1550
			table.insert	(tempDataList,"	SetEffect(hhs[" .. #hhs .. "], " .. effectStr[e] .. ", " .. GetEffect(gear, effectArray[e]) .. ")")
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1551
		end
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1552
	end
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1553
	local dX, _ = GetGearVelocity(gear)
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1554
	if dX < 0 then
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1555
		table.insert	(tempDataList,"	HogTurnLeft(hhs[" .. #hhs .. "], true)")
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1556
	end
f190ed9df875 HedgeEditor: Also save hog effects (e.g. poison) and looking direction
Wuzzy <almikes@aol.com>
parents: 12646
diff changeset
  1557
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1558
	if getGearValue(gear,"tag") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1559
		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
  1560
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1561
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1562
	-- 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
  1563
	-- when we want to output it to console
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1564
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1565
	if getGearValue(gear,"ranking") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1566
		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
  1567
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1568
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1569
	for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1570
		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
  1571
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1572
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1573
	for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1574
		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
  1575
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1576
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1577
	if GetHogLevel(gear) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1578
		hogDataList = tempDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1579
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1580
		AIHogDataList = tempDataList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1581
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1582
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1583
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1584
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1585
-- output hog and team data to the console
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1586
function SaveHogData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1587
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1588
	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
  1589
	lastRecordedTeam = ""
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1590
	hhs = {}
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1591
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1592
	runOnHogs(GetDataForSavingHogs)
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("	------ TEAM LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1595
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1596
	for i = 1, #hogDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1597
		WriteLnToConsole(hogDataList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1598
	end
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, #AIHogDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1601
		WriteLnToConsole(AIHogDataList[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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1606
	if #shoppaPointList > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1607
		WriteLnToConsole("	------ SHOPPA POINT LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1608
		for i = 1, #shoppaPointList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1609
			WriteLnToConsole(shoppaPointList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1610
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1611
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1612
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1613
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1614
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1615
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1616
-- 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
  1617
function SaveConfigData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1618
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1619
	WriteLnToConsole("function onGameInit()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1620
	WriteLnToConsole("")
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
	temp = "	EnableGameFlags(gfDisableWind"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1623
	for i = 1, #gameFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1624
		if gameFlagList[i][2] == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1625
			temp = temp .. ", ".. gameFlagList[i][1]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1626
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1627
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1628
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1629
	WriteLnToConsole("	ClearGameFlags()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1630
	WriteLnToConsole(temp .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1631
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1632
	WriteLnToConsole("	Map = \"" .. Map .. "\"")
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1633
	WriteLnToConsole("	Seed = \"" .. Seed .. "\"")
12043
76285ad6fa7f HedgeEditor: Export WorldEdge, fix export of Theme
Wuzzy <almikes@aol.com>
parents: 12042
diff changeset
  1634
	WriteLnToConsole("	Theme = \"" .. Theme .. "\"")
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1635
	WriteLnToConsole("	MapGen = " .. MapGen)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1636
	WriteLnToConsole("	MapFeatureSize = " .. MapFeatureSize)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1637
	WriteLnToConsole("	TemplateFilter = " .. TemplateFilter)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1638
	WriteLnToConsole("	TemplateNumber = " .. TemplateNumber)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1639
	WriteLnToConsole("	TurnTime = " .. TurnTime)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1640
	WriteLnToConsole("	Explosives = " .. Explosives)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1641
	WriteLnToConsole("	MinesNum = " .. MinesNum)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1642
	WriteLnToConsole("	CaseFreq = " .. CaseFreq)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1643
	WriteLnToConsole("	Delay = " .. Delay)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1644
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1645
	WriteLnToConsole("	HealthCaseProb = " .. HealthCaseProb)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1646
	WriteLnToConsole("	HealthCaseAmount = " .. HealthCaseAmount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1647
	WriteLnToConsole("	DamagePercent = " .. DamagePercent)
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1648
	WriteLnToConsole("	RopePercent = " .. RopePercent)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1649
	WriteLnToConsole("	MinesTime = " .. MinesTime)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1650
	WriteLnToConsole("	MineDudPercent  = " .. MineDudPercent)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1651
	WriteLnToConsole("	SuddenDeathTurns = " .. SuddenDeathTurns)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1652
	WriteLnToConsole("	WaterRise = " .. WaterRise)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1653
	WriteLnToConsole("	HealthDecrease = " .. HealthDecrease)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1654
11988
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1655
	WriteLnToConsole("	Ready = " .. Ready)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1656
	WriteLnToConsole("	AirMinesNum = " .. AirMinesNum)
46bd207d1b17 Update outdated onGameInit variables in HedgeEditor map export, fixes various bugs
Wuzzy <almikes@aol.com>
parents: 11881
diff changeset
  1657
	WriteLnToConsole("	GetAwayTime = " .. GetAwayTime)
12043
76285ad6fa7f HedgeEditor: Export WorldEdge, fix export of Theme
Wuzzy <almikes@aol.com>
parents: 12042
diff changeset
  1658
	WriteLnToConsole("	WorldEdge = " .. WorldEdge)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1659
12648
c755afd8fb6b Remove ScriptParam from HedgeEditor
Wuzzy <almikes@aol.com>
parents: 12647
diff changeset
  1660
	-- ScriptParam intentionally left out, it doesn't make sense for missions.
c755afd8fb6b Remove ScriptParam from HedgeEditor
Wuzzy <almikes@aol.com>
parents: 12647
diff changeset
  1661
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1662
	WriteLnToConsole("")
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
	SaveHogData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1665
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1666
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1667
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1668
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1669
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1670
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1671
-- 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
  1672
function ConvertGearDataToHWPText()
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
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1675
	WriteLnToConsole("--BEGIN HWMAP CONVERTER POINTS--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1676
	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
  1677
	WriteLnToConsole("--[[")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1678
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1679
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1680
	for i = 1, #hFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1681
		WriteLnToConsole(hFlagList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1682
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1683
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1684
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1685
	WriteLnToConsole("]]")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1686
	WriteLnToConsole("--END HWMAP CONVERTER POINTS--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1687
	WriteLnToConsole("")
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
-- sigh
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1692
-- 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
  1693
-- 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
  1694
function GetDataForGearSaving(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1695
11992
c3c7c036c521 HedgeEditor: Fix teams being exported multiple times when saving multiple times in same session
Wuzzy <almikes@aol.com>
parents: 11991
diff changeset
  1696
	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
  1697
	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
  1698
	local arrayList = nil
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1699
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1700
	if GetGearType(gear) == gtMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1701
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1702
		temp = 	"	tempG = AddGear(" ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1703
			GetX(gear) .. ", " ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1704
			GetY(gear) .. ", gtMine, 0, 0, 0, 0)"
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1705
		table.insert(mineList, temp)
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1706
		table.insert(mineList, "	SetTimer(tempG, " .. GetTimer(gear) .. ")")
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1707
		if (GetHealth(gear) == 0) then
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1708
			table.insert(mineList, "	SetHealth(tempG, 0)")
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1709
			local _, damage
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1710
			_,_,_,_,_,_,_,_,_,_,_,damage = GetGearValues(gear)
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1711
			if damage ~= 0 then
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1712
				table.insert(mineList, "	SetGearValues(tempG, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "..damage..")")
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1713
			end
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1714
		end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1715
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1716
			table.insert(mineList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1717
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1718
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  1719
		if 		GetTimer(gear) == 0 then specialFlag = 1
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1720
		elseif	GetTimer(gear) == 1000 then specialFlag = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1721
		elseif	GetTimer(gear) == 2000 then specialFlag = 3
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1722
		elseif	GetTimer(gear) == 3000 then specialFlag = 4
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1723
		elseif	GetTimer(gear) == 4000 then specialFlag = 5
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1724
		elseif	GetTimer(gear) == 5000 then specialFlag = 6
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1725
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1726
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1727
	elseif GetGearType(gear) == gtSMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1728
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1729
		arrayList = sMineList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1730
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1731
				GetX(gear) .. ", " ..
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1732
				GetY(gear) .. ", gtSMine, 0, 0, 0, 0)"
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1733
		table.insert(sMineList, temp)
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1734
		table.insert(sMineList, "	SetTimer(tempG, " .. GetTimer(gear) .. ")")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1735
		specialFlag = 7
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1736
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1737
	elseif GetGearType(gear) == gtAirMine then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1738
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1739
		temp = 	"	tempG = AddGear(" ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1740
			GetX(gear) .. ", " ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1741
			GetY(gear) .. ", gtAirMine, 0, 0, 0, 0)"
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1742
		table.insert(airMineList, temp)
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1743
		table.insert(airMineList, "	SetTimer(tempG, " .. GetTimer(gear) .. ")")
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1744
		table.insert(airMineList, "	SetGearValues(tempG, nil, nil, " .. GetTimer(gear) .. ")")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1745
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1746
			table.insert(airMineList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1747
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1748
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1749
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1750
		specialFlag = 8
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1751
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1752
	elseif GetGearType(gear) == gtExplosives then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1753
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1754
		temp = 	"	tempG = AddGear(" ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1755
			GetX(gear) .. ", " ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1756
			GetY(gear) .. ", gtExplosives, 0, 0, 0, 0)"
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1757
		table.insert(explosivesList, temp)
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1758
		table.insert(explosivesList, "	SetHealth(tempG, " .. GetHealth(gear) .. ")")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1759
		if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1760
			table.insert(explosivesList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
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
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1764
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1765
		if 		GetHealth(gear) == 1 then specialFlag = 15
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1766
		elseif	GetHealth(gear) == 25 then specialFlag = 16
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1767
		elseif	GetHealth(gear) == 50 then specialFlag = 17
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1768
		elseif	GetHealth(gear) == 75 then specialFlag = 18
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1769
		elseif	GetHealth(gear) == 100 then specialFlag = 19
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1770
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1771
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1772
	elseif GetGearType(gear) == gtTarget then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1773
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1774
		arrayList = targetList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1775
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1776
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1777
				GetY(gear) .. ", gtTarget, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1778
		table.insert(targetList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1779
		specialFlag = 14
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1780
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1781
	elseif GetGearType(gear) == gtKnife then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1782
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1783
		arrayList = knifeList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1784
		temp = 	"	tempG = AddGear(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1785
				GetX(gear) .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1786
				GetY(gear) .. ", gtKnife, 0, 0, 0, 0)"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1787
		table.insert(knifeList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1788
		specialFlag = 13
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
	elseif GetGearType(gear) == gtCase then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1791
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1792
		table.insert(previewDataList, "	PreviewPlacedGear(" .. GetX(gear) ..", " ..	GetY(gear) .. ")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1793
12356
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1794
		-- Health crate
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1795
		if band(GetGearPos(gear), 0x2) ~= 0 then
12045
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1796
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1797
			temp = 	"	tempG = SpawnHealthCrate(" ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1798
				GetX(gear) ..", " ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1799
				GetY(gear) ..", " ..
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1800
				GetHealth(gear) .. ")"
f71e34babe8c HedgeEditor: Fix mine, sticky mine, health crate, air mine sometimes being incorrectly exported
Wuzzy <almikes@aol.com>
parents: 12044
diff changeset
  1801
			table.insert(healthCrateList, temp)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1802
			if (getGearValue(gear, "tag") ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1803
				table.insert(healthCrateList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1804
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1805
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1806
			if 		GetHealth(gear) == 25 then specialFlag = 9
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1807
			elseif	GetHealth(gear) == 50 then specialFlag = 10
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1808
			elseif	GetHealth(gear) == 75 then specialFlag = 11
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1809
			elseif	GetHealth(gear) == 100 then specialFlag = 12
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1810
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1811
12356
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1812
		-- Ammo crate
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1813
		elseif band(GetGearPos(gear), 0x1) ~= 0 then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1814
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1815
			arrayList = wepCrateList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1816
			temp = 	"	tempG = SpawnAmmoCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1817
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1818
					GetY(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1819
					getGearValue(gear,"contents") ..
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
			table.insert(wepCrateList, temp)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1822
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1823
			tempV = getGearValue(gear,"contents")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1824
			for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1825
				if tempV == atkArray[i][2] then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1826
					specialFlag = i + 19
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1827
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1828
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1829
12356
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1830
			--dammit, we probably need more entries if we want to allow editing of existing maps
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1831
			table.insert(wepCrateList, "	setGearValue(tempG, \"contents\", \"" .. getGearValue(gear,"contents") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1832
12356
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1833
		-- Utility crate
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1834
		elseif band(GetGearPos(gear), 0x4) ~= 0 then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1835
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1836
			arrayList = utilCrateList
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1837
			temp = 	"	tempG = SpawnUtilityCrate(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1838
					GetX(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1839
					GetY(gear) ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1840
					getGearValue(gear,"contents") ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1841
					")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1842
			table.insert(utilCrateList, temp)
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
			tempV = getGearValue(gear,"contents")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1845
			for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1846
				if tempV == utilArray[i][2] then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1847
					specialFlag = i + 19 + #atkArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1848
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1849
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1850
12356
d1448cc0b8c2 Fix broken HedgeEditor export of utility and ammo crates
Wuzzy <almikes@aol.com>
parents: 12355
diff changeset
  1851
			--dammit, we probably need more entries if we want to allow editing of existing maps
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1852
			table.insert(utilCrateList, "	setGearValue(tempG, \"contents\", \"" .. getGearValue(gear,"contents") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1853
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1854
		end
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
	-- 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
  1859
	if (getGearValue(gear, "tag") ~= nil) and (arrayList ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1860
		table.insert(arrayList, "	setGearValue(tempG, \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1861
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1862
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1863
	-- 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
  1864
	if specialFlag ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1865
		table.insert(hFlagList, "	" .. GetX(gear) .. " " .. GetY(gear) .. " " .. specialFlag)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1866
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1867
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1868
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1869
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1870
-- 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
  1871
function AppendGearList(gearList, consoleLine)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1872
	if #gearList > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1873
		WriteLnToConsole(consoleLine)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1874
		for i = 1, #gearList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1875
			WriteLnToConsole(gearList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1876
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1877
		WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1878
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1879
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1880
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1881
-- new attempt at doing shit a bit cleaner:
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1882
-- 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
  1883
-- 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
  1884
function SaveGearData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1885
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1886
	runOnGears(GetDataForGearSaving)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1887
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1888
	AppendGearList(healthCrateList, "	------ HEALTH CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1889
	AppendGearList(wepCrateList, "	------ AMMO CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1890
	AppendGearList(utilCrateList, "	------ UTILITY CRATE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1891
	AppendGearList(explosivesList, "	------ BARREL LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1892
	AppendGearList(mineList, "	------ MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1893
	AppendGearList(sMineList, "	------ STICKY MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1894
	AppendGearList(airMineList, "	------ AIR MINE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1895
	AppendGearList(targetList, "	------ TARGET LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1896
	AppendGearList(knifeList, "	------ CLEAVER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1897
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1898
end
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
function DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1901
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1902
	for x = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1903
		if getGearValue(hhs[i],atkArray[x][1]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1904
			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
  1905
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1906
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1907
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1908
	for x = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1909
		if getGearValue(hhs[i],utilArray[x][1]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1910
			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
  1911
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1912
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1913
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1914
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1915
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1918
-- 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
  1919
-- 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
  1920
function CheckForConclusion(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1921
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1922
	-- 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
  1923
	if getGearValue(gear,"tag") == "failure" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1924
		EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1925
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1926
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1927
		-- 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
  1928
		-- 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
  1929
		-- 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
  1930
		victoryObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1931
		failObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1932
		collectObj = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1933
		runOnGears(CheckForConditions)
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
		if GetGearType(gear) ~= gtCase then
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
			-- 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
  1938
			-- "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
  1939
			-- 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
  1940
			victoryObj = victoryObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1941
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1942
			-- 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
  1943
			if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1944
				EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1945
			end
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
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1948
			-- 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
  1949
			-- the goals of our mission?
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1950
			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
  1951
				if GetHogLevel(CurrentHedgehog) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1952
					-- the enemy stole our crate
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1953
					EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1954
				else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1955
					collectObj = collectObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1956
					if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1957
						EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1958
					end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1959
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1960
			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
  1961
				victoryObj = victoryObj - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1962
				if (victoryObj == 0) and (collectObj == 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1963
					EndGameIn("victory")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1964
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1965
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1966
				-- unfortunately, we messed up our mission.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1967
				EndGameIn("failure")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1968
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1969
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1970
		end
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
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1973
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1974
end
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
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1977
-- THE BIG ONE
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1978
---------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1979
-- saving process starts here
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1980
-- 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
  1981
function SaveLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1982
12006
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1983
	waypointList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1984
	girderList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1985
	rubberList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1986
	spriteList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1987
	mineList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1988
	sMineList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1989
	airMineList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1990
	targetList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1991
	knifeList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1992
	explosivesList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1993
	healthCrateList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1994
	wepCrateList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1995
	utilCrateList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1996
	hFlagList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1997
	previewDataList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1998
	shoppaPointList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  1999
	hogDataList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  2000
	AIHogDataList = {}
86cd92f64979 HedgeEditor: Fix stuff being exported multiple times on multiple saves
Wuzzy <almikes@aol.com>
parents: 12005
diff changeset
  2001
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2002
	WriteLnToConsole("------ BEGIN SCRIPT ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2003
	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
  2004
	WriteLnToConsole("-- YOURTITLEHERE.lua, in your Data/Missions/Training/ folder.")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2005
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2006
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2007
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2008
	WriteLnToConsole("HedgewarsScriptLoad(\"/Scripts/Locale.lua\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2009
	WriteLnToConsole("HedgewarsScriptLoad(\"/Scripts/Tracker.lua\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2010
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2011
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2012
	WriteLnToConsole("local hhs = {}")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2013
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2014
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2015
	SaveConfigData()
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2018
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2019
	WriteLnToConsole("function LoadHogWeapons()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2020
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2021
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2022
	if band(GameFlags, gfPerHogAmmo) ~= 0 then -- per hog ammo
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2023
		for i = 1, #hhs do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2024
			DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2025
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2026
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2027
	else	-- team-based ammo
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2028
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2029
		teamCounter = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2030
		lastRecordedTeam = ""
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2031
		for i = 1, #hhs do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2032
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2033
			if GetHogTeamName(hhs[i]) ~= lastRecordedTeam then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2034
				lastRecordedTeam = GetHogTeamName(hhs[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2035
				teamCounter = teamCounter + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2036
				if teamCounter == 9 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2037
					teamCounter = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2038
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2039
				DoAmmoLoop(i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2040
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2041
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2042
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2043
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2044
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2045
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
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2048
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2049
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2050
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2051
	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
  2052
	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
  2053
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2054
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2055
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2056
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2057
	WriteLnToConsole("function LoadGearData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2058
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2059
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2060
	WriteLnToConsole("	--BEGIN CORE DATA--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2061
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2062
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2063
	WriteLnToConsole("	------ PORTAL DISTANCE and UFO FUEL ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2064
	WriteLnToConsole("	ufoFuel = " .. ufoFuel)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2065
	WriteLnToConsole("	portalDistance = " .. portalDistance*5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2066
	table.insert(hFlagList, "	" .. portalDistance*5 .. " " .. ufoFuel .. " " .. 98)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2067
	WriteLnToConsole("")
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
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2070
		if placedType[i] == loc("Waypoint Editing Mode") then
12339
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2071
			--[[ TODO/FIXME: Somehow incorporate the waypoints in an actual useful manner.
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2072
			The functions AddWayPoint and PreviewWayPoint do not exist and will thus be commented-out
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2073
			in the output code. They are added anyway so the user sees the coordinates
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2074
			]]
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2075
			table.insert(waypointList,
12339
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2076
			"--	AddWayPoint(" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2077
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2078
				placedY[i] ..")"
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2079
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2080
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. "0")
12339
ae699a0b054b HedgeEditor: Disable waypoint export because output scripts break when waypoints have been added
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
  2081
			table.insert(previewDataList, "--	PreviewWayPoint(" .. placedX[i] ..", " ..	placedY[i] .. ")")
11037
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
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2084
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2085
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2086
		if placedType[i] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2087
			table.insert(girderList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2088
			"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2089
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2090
				placedY[i] ..", sprAmGirder, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2091
				placedFrame[i] ..			-- the rotation/frame
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2092
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2093
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2094
				"nil, nil, nil, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2095
				placedLandFlags[i] .. ")" --the landType
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2096
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2097
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. placedHWMapFlag[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2098
			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
  2099
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2100
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2101
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2102
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2103
		if placedType[i] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2104
			table.insert(rubberList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2105
				"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2106
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2107
				placedY[i] ..", sprAmRubber, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2108
				placedFrame[i] ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2109
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2110
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2111
				"nil, nil, nil, " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2112
				"lfBouncy)" --the landType
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2113
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2114
			table.insert(hFlagList, "	" .. placedX[i] .. " " .. placedY[i] .. " " .. placedHWMapFlag[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2115
			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
  2116
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2117
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2118
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2119
	for i = 0, (placedCount-1) do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2120
		if placedType[i] == loc("Sprite Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2121
				table.insert(spriteList,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2122
				"	LoadSprite(" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2123
				placedX[i] ..", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2124
				placedY[i] ..", " .. placedSprite[i] .. ", " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2125
				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
  2126
				", " ..
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  2127
				placedTint[i] ..", " .. -- color
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2128
				"nil, nil, nil, " ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2129
				placedLandFlags[i] .. ")" --the landType
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2130
				)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2131
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2132
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2133
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2134
	AppendGearList(waypointList, "	------ WAYPOINT LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2135
	AppendGearList(girderList, "	------ GIRDER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2136
	AppendGearList(rubberList, "	------ RUBBER LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2137
	AppendGearList(spriteList, "	------ SPRITE LIST ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2138
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2139
	SaveGearData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2140
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2141
	WriteLnToConsole("	--END CORE DATA--")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2142
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2143
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2144
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2145
	WriteLnToConsole("	LoadHogWeapons()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2146
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2147
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2148
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2149
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("function onGameStart()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2152
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2153
	WriteLnToConsole("	LoadGearData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2154
	WriteLnToConsole("	DetermineMissionGoal()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2155
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2156
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2157
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2158
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("function onNewTurn()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2161
	WriteLnToConsole("	--insert code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2162
	WriteLnToConsole("end")
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2165
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2166
	WriteLnToConsole("function onGameTick()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2167
	WriteLnToConsole("	runOnGears(UpdateTagCircles)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2168
	WriteLnToConsole("end")
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2171
	WriteLnToConsole("function UpdateTagCircles(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2172
	WriteLnToConsole("	if getGearValue(gear,\"tag\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2173
	WriteLnToConsole("		if getGearValue(gear,\"tCirc\") == nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2174
	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
  2175
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2176
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2177
	WriteLnToConsole("		if getGearValue(gear,\"tag\") == \"victory\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2178
	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
  2179
	WriteLnToConsole("		elseif getGearValue(gear,\"tag\") == \"failure\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2180
	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
  2181
	WriteLnToConsole("		elseif getGearValue(gear,\"tag\") == \"collection\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2182
	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
  2183
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2184
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2185
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2186
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2187
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2188
	WriteLnToConsole("function CheckForConditions(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2189
	WriteLnToConsole("	if getGearValue(gear,\"tag\") == \"victory\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2190
	WriteLnToConsole("		victoryObj = victoryObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2191
	WriteLnToConsole("	elseif getGearValue(gear,\"tag\") == \"failure\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2192
	WriteLnToConsole("		failObj = failObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2193
	WriteLnToConsole("	elseif getGearValue(gear,\"tag\") == \"collection\" then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2194
	WriteLnToConsole("		collectObj = collectObj +1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2195
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2196
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2197
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2198
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2199
	WriteLnToConsole("function CheckForConclusion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2200
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2201
	WriteLnToConsole("	if getGearValue(gear,\"tag\") == \"failure\" then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2202
	WriteLnToConsole("		EndGameIn(\"failure\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2203
	WriteLnToConsole("	else ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2204
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2205
	WriteLnToConsole("		victoryObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2206
	WriteLnToConsole("		failObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2207
	WriteLnToConsole("		collectObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2208
	WriteLnToConsole("		runOnGears(CheckForConditions)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2209
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2210
	WriteLnToConsole("		if GetGearType(gear) ~= gtCase then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2211
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2212
	WriteLnToConsole("			victoryObj = victoryObj - 1 ")
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 (victoryObj == 0) and (collectObj == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2215
	WriteLnToConsole("				EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2216
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2217
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2218
	WriteLnToConsole("		else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2219
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2220
	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
  2221
	WriteLnToConsole("				if GetHogLevel(CurrentHedgehog) ~= 0 then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2222
	WriteLnToConsole("					EndGameIn(\"failure\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2223
	WriteLnToConsole("				else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2224
	WriteLnToConsole("					collectObj = collectObj - 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2225
	WriteLnToConsole("					if (victoryObj == 0) and (collectObj == 0) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2226
	WriteLnToConsole("						EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2227
	WriteLnToConsole("					end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2228
	WriteLnToConsole("				end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2229
	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
  2230
	WriteLnToConsole("				victoryObj = victoryObj - 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2231
	WriteLnToConsole("				if (victoryObj == 0) and (collectObj == 0) then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2232
	WriteLnToConsole("					EndGameIn(\"victory\")")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2233
	WriteLnToConsole("				end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2234
	WriteLnToConsole("			else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2235
	WriteLnToConsole("				EndGameIn(\"failure\")")
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
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2238
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2239
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2240
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2241
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2242
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2243
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2244
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2245
	WriteLnToConsole("function DetermineMissionGoal()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2246
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2247
	WriteLnToConsole("	victoryObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2248
	WriteLnToConsole("	failObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2249
	WriteLnToConsole("	collectObj = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2250
	WriteLnToConsole("	vComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2251
	WriteLnToConsole("	fComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2252
	WriteLnToConsole("	collectComment = \"\"")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2253
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2254
	WriteLnToConsole("	runOnGears(CheckForConditions)")
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
	WriteLnToConsole("	if victoryObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2257
	WriteLnToConsole("		if victoryObj == 1 then ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2258
	WriteLnToConsole("			vComment = loc(\"- Destroy the red target\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2259
	WriteLnToConsole("		else ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2260
	WriteLnToConsole("			vComment = loc(\"- Destroy the red targets\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2261
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2262
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2263
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2264
	WriteLnToConsole("	if collectObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2265
	WriteLnToConsole("		if collectObj == 1 then ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2266
	WriteLnToConsole("			collectComment = loc(\"- Collect the blue crate\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2267
	WriteLnToConsole("		else ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2268
	WriteLnToConsole("			collectComment = loc(\"- Collect all the blue crates\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2269
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2270
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2271
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2272
	WriteLnToConsole("	if (collectObj == 0) and (victoryObj == 0) then")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2273
	WriteLnToConsole("		vComment = loc(\"- Destroy the enemy\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2274
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2275
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2276
	WriteLnToConsole("	if failObj > 0 then ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2277
	WriteLnToConsole("		if failObj == 1 then ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2278
	WriteLnToConsole("			fComment = loc(\"- The green target must survive\") .. \"|\"")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2279
	WriteLnToConsole("		else ")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2280
	WriteLnToConsole("			fComment = loc(\"- The green targets must survive\") .. \"|\"")
11037
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("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2283
	WriteLnToConsole("")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2284
	WriteLnToConsole("	ShowMission(loc(\"User Mission\"), loc(\"Mission\"), collectComment .. vComment .. fComment, 1, 0)")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2285
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2286
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2287
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2288
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2289
	WriteLnToConsole("function isATrackedGear(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2290
	WriteLnToConsole("	if 	(GetGearType(gear) == gtHedgehog) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2291
	WriteLnToConsole("		(GetGearType(gear) == gtExplosives) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2292
	WriteLnToConsole("		(GetGearType(gear) == gtMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2293
	WriteLnToConsole("		(GetGearType(gear) == gtSMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2294
	WriteLnToConsole("		(GetGearType(gear) == gtAirMine) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2295
	WriteLnToConsole("		(GetGearType(gear) == gtTarget) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2296
	WriteLnToConsole("		(GetGearType(gear) == gtKnife) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2297
	WriteLnToConsole("		(GetGearType(gear) == gtPortal) or")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2298
	WriteLnToConsole("		(GetGearType(gear) == gtCase)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2299
	WriteLnToConsole("	then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2300
	WriteLnToConsole("		return(true)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2301
	WriteLnToConsole("	else")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2302
	WriteLnToConsole("		return(false)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2303
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2304
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2305
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2306
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2307
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2308
	WriteLnToConsole("function onGearAdd(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2309
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("	if isATrackedGear(gear) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2312
	WriteLnToConsole("		trackGear(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2313
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("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2316
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2317
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2318
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2319
	WriteLnToConsole("function EndGameIn(c)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2320
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2321
	WriteLnToConsole("	teamCounter = 0")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2322
	WriteLnToConsole("	lastRecordedTeam = \"\" ")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2323
	WriteLnToConsole("	for i = 1, #hhs do")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2324
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2325
	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
  2326
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2327
	WriteLnToConsole("			lastRecordedTeam = GetHogTeamName(hhs[i])")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2328
	WriteLnToConsole("			teamCounter = teamCounter + 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2329
	WriteLnToConsole("			if teamCounter == 9 then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2330
	WriteLnToConsole("				teamCounter = 1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2331
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2332
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2333
	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
  2334
	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13599
diff changeset
  2335
	WriteLnToConsole("				AddCaption(loc(\"Victory!\"), capcolDefault, capgrpGameState)")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2336
	WriteLnToConsole("				ShowMission(loc(\"User Mission\"), loc(\"Mission\"), loc(\"Mission succeeded!\"), 0, 0)")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2337
	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
  2338
	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13599
diff changeset
  2339
	WriteLnToConsole("				AddCaption(loc(\"Defeat!\"), capcolDefault, capgrpGameState)")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  2340
	WriteLnToConsole("				ShowMission(loc(\"User Mission\"), loc(\"Mission\"), loc(\"Mission failed!\"), -amSkip, 0)")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2341
	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
  2342
	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
  2343
	WriteLnToConsole("			end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2344
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2345
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2346
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2347
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2348
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2349
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2350
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2351
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2352
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2353
	WriteLnToConsole("function onGearDelete(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2354
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2355
	WriteLnToConsole("	--insert code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2356
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2357
	WriteLnToConsole("	if isATrackedGear(gear) then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2358
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2359
	WriteLnToConsole("		if getGearValue(gear,\"tag\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2360
	WriteLnToConsole("			CheckForConclusion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2361
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2362
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2363
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2364
	WriteLnToConsole("		if getGearValue(gear, \"tCirc\") ~= nil then")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2365
	WriteLnToConsole("			DeleteVisualGear(getGearValue(gear, \"tCirc\"))")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2366
	WriteLnToConsole("		end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2367
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2368
	WriteLnToConsole("		trackDeletion(gear)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2369
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2370
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2371
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2372
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2373
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2374
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2375
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2376
	WriteLnToConsole("--enable and/or alter code according to taste")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2377
	WriteLnToConsole("function onAmmoStoreInit()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2378
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2379
12355
37ed9df448fa Refactor HedgeEditor output, get rid of wepArray in favor of simpler ammo iteration
Wuzzy <almikes@aol.com>
parents: 12339
diff changeset
  2380
	WriteLnToConsole("	for i = 0, AmmoTypeMax do")
37ed9df448fa Refactor HedgeEditor output, get rid of wepArray in favor of simpler ammo iteration
Wuzzy <almikes@aol.com>
parents: 12339
diff changeset
  2381
	WriteLnToConsole("		if i ~= amNothing then")
37ed9df448fa Refactor HedgeEditor output, get rid of wepArray in favor of simpler ammo iteration
Wuzzy <almikes@aol.com>
parents: 12339
diff changeset
  2382
	WriteLnToConsole("			SetAmmo(i, 0, 0, 0, 1)")
37ed9df448fa Refactor HedgeEditor output, get rid of wepArray in favor of simpler ammo iteration
Wuzzy <almikes@aol.com>
parents: 12339
diff changeset
  2383
	WriteLnToConsole("		end")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2384
	WriteLnToConsole("	end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2385
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2386
	WriteLnToConsole("	SetAmmo(amSkip, 9, 0, 0, 0)")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2387
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2388
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2389
	WriteLnToConsole("")
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
	WriteLnToConsole("------ END GENERATED MISSION ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2392
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2393
	-- 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
  2394
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2395
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2396
	WriteLnToConsole("function GeneratePreviewData()")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2397
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2398
	for i = 1, #previewDataList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2399
		WriteLnToConsole(previewDataList[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2400
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2401
	WriteLnToConsole("")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2402
	WriteLnToConsole("end")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2403
	WriteLnToConsole("")
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
	ConvertGearDataToHWPText()
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
	WriteLnToConsole("------ END GENERATED SCRIPT ------")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2408
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  2409
	AddCaption(loc("Level Data Saved!"), colorInfoMessage, capgrpGameState)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2410
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2411
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2412
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2413
----------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2414
-- some special effects handling
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2415
----------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2416
function SmokePuff(x,y,c)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2417
	tempE = AddVisualGear(x, y, vgtSmoke, 0, false)
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  2418
	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
  2419
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2420
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2421
function HandleGearBasedRankingEffects(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2422
	if getGearValue(gear, "ranking") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2423
		SmokePuff(GetX(gear), GetY(gear),GetRankedColour(getGearValue(gear, "ranking")))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2424
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2425
end
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
function HandleRankingEffects()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2428
	for i = 1, #shoppaPX do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2429
		SmokePuff(shoppaPX[i], shoppaPY[i], GetRankedColour(shoppaPR[i]))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2430
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2431
	runOnHogs(HandleGearBasedRankingEffects)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2432
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2433
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2434
function UpdateTagCircles(gear)
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
	if getGearValue(gear,"tag") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2437
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2438
		if cat[cIndex] == loc("Goal Definition Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2439
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2440
			-- 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
  2441
			if getGearValue(gear,"tCirc") == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2442
				setGearValue(gear, "tCirc",AddVisualGear(0,0,vgtCircle,0,true))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2443
			end
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
			if getGearValue(gear,"tag") == "victory" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2446
				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
  2447
			elseif getGearValue(gear,"tag") == "failure" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2448
				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
  2449
			elseif getGearValue(gear,"tag") == "collection" then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2450
				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
  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
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2454
			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
  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
	end
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
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2460
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2461
-- handle short range portal gun
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2462
function PortalEffects(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2463
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2464
	if GetGearType(gear) == gtPortal then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2465
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2466
		local tag = GetTag(gear)
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2467
		local col
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2468
		if tag == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2469
			col = 0xfab02aFF -- orange ball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2470
		elseif tag == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2471
			col = 0x00FF00FF -- orange portal
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2472
		elseif tag == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2473
			col = 0x364df7FF  -- blue ball
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2474
		elseif tag == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2475
			col = 0xFFFF00FF  -- blue portal
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2476
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2477
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2478
		if (tag == 0) or (tag == 2) then -- i.e ball form
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2479
			local remLife = getGearValue(gear,"life")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2480
			remLife = remLife - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2481
			setGearValue(gear, "life", remLife)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2482
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2483
			-- Destroy portal ball when max. distance reached
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2484
			if remLife == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2485
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2486
				local tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2487
				SetVisualGearValues(tempE, nil, 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
  2488
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2489
				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2490
				SetVisualGearValues(tempE, nil, 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
  2491
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2492
				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2493
				SetVisualGearValues(tempE, nil, 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
  2494
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2495
				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
13282
b13071610c07 Flying portal balls now spawn a few spark effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13277
diff changeset
  2496
				SetVisualGearValues(tempE, nil, 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
  2497
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2498
				PlaySound(sndVaporize)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2499
				DeleteGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2500
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2501
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2502
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2503
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2504
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2505
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2506
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2507
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2508
12007
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2509
function updateHelp(curAmmoType)
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2510
	if curAmmoType == nil then
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2511
		curAmmoType = GetCurAmmoType()
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2512
	end
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2513
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  2514
	if (curAmmoType ~= amGirder) and (curAmmoType ~= amRubber) and (curAmmoType ~= amCMGearPlacementTool) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2515
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2516
		if not hedgeEditorMissionPanelShown then
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2517
			showHedgeEditorMissionPanel()
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2518
		end
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  2519
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2520
	elseif cat[cIndex] == loc("Girder Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2521
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2522
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2523
				loc("GIRDER PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2524
				loc("Place girders"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2525
				loc("Place Girder: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2526
				loc("Change Rotation: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2527
				" " .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2528
				loc("Normal Girder: [1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2529
				loc("Indestructible Girder: [2]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2530
				loc("Icy Girder: [3]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2531
				loc("Bouncy Girder: [4]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2532
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2533
				loc("Deletion Mode: [5]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2534
				" " .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2535
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2536
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2537
				"", -amGirder, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2538
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2539
		hedgeEditorMissionPanelShown = false
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
	elseif cat[cIndex] == loc("Rubber Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2542
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2543
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2544
				loc("RUBBER PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2545
				loc("Place rubber"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2546
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2547
				loc("Change Rotation: [Left], [Right]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2548
				" " .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2549
				loc("Normal Rubber: [1]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2550
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2551
				loc("Deletion Mode: [5]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2552
				" " .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2553
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2554
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2555
				"", -amRubber, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2556
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2557
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2558
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2559
	elseif cat[cIndex] == loc("Barrel Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2560
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2561
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2562
				loc("BARREL PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2563
				loc("Place barrels"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2564
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2565
				loc("Change Health: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2566
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2567
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2568
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2569
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2570
				"", 8, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2571
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2572
		hedgeEditorMissionPanelShown = false
11037
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
	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2575
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2576
		ShowMission	(
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2577
				loc("CLEAVER PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2578
				loc("Place cleavers"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2579
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2580
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2581
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2582
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2583
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2584
				"", -amKnife, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2585
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2586
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2587
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2588
	elseif cat[cIndex] == loc("Target Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2589
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2590
		ShowMission	(
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2591
				loc("TARGET PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2592
				loc("Place targets"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2593
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2594
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2595
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2596
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2597
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2598
				"", 1, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2599
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2600
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2601
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2602
	elseif cat[cIndex] == loc("Waypoint Editing Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2603
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2604
		ShowMission	(
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2605
				loc("WAYPOINT EDITING MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2606
				loc("Place or delete waypoints"),
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2607
				loc("Place/Delete Waypoint: [Left Click]") .. "|" ..
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2608
				loc("Toggle Placement/Deletion: [Left], [Right]") .. "|" ..
11037
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
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2611
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2612
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2613
				"", -amCMGearPlacementTool, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2614
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2615
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2616
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2617
	elseif cat[cIndex] == loc("Mine Placement Mode") then
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
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2620
				loc("MINE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2621
				loc("Place mines"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2622
				loc("Place Object: [Left Click]") .. "|" ..
12026
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  2623
				loc("Change Timer: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2624
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2625
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2626
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2627
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2628
				"", -amMine, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2629
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2630
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2631
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2632
	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
  2633
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2634
		ShowMission	(
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2635
				loc("DUD MINE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2636
				loc("Place dud mines"),
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2637
				loc("Place Object: [Left Click]") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2638
				loc("Change Health: [Left], [Right]") .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2639
				" " .. "|" ..
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2640
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2641
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2642
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2643
				"", 9, 60000, not helpDisabled
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2644
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2645
		hedgeEditorMissionPanelShown = false
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2646
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2647
	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
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
		ShowMission	(
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2650
				loc("STICKY MINE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2651
				loc("Place sticky mines"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2652
				loc("Place Object: [Left Click]") .. "|" ..
12026
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  2653
				loc("Change Timer: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2654
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2655
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2656
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2657
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2658
				"", -amSMine, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2659
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2660
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2661
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2662
	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
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
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2665
				loc("AIR MINE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2666
				loc("Place air mines"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2667
				loc("Place Object: [Left Click]") .. "|" ..
12026
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  2668
				loc("Change Timer: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2669
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2670
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2671
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2672
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2673
				"", -amAirMine, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2674
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2675
		hedgeEditorMissionPanelShown = false
11037
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
	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2678
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2679
		ShowMission	(
11999
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2680
				loc("WEAPON CRATE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2681
				loc("Place weapon crates"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2682
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2683
				loc("Change Content: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2684
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2685
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2686
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2687
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2688
				"", 7, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2689
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2690
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2691
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2692
	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2693
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2694
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2695
				loc("UTILITY CRATE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2696
				loc("Place utility crates"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2697
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2698
				loc("Change Content: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2699
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2700
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2701
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2702
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2703
				"", 5, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2704
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2705
		hedgeEditorMissionPanelShown = false
11037
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
	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2708
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2709
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2710
				loc("HEALTH CRATE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2711
				loc("Place health crates"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2712
				loc("Place Object: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2713
				loc("Change Health Boost: [Left], [Right]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2714
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2715
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2716
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2717
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2718
				"", 6, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2719
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2720
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2721
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2722
	elseif cat[cIndex] == loc("Repositioning Mode") then
11037
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
		ShowMission	(
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2725
				loc("REPOSITIONING MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2726
				loc("Select, reposition and delete gears"),
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2727
				loc("Select/Place/Delete Gear: [Left Click]") .. "|" ..
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2728
				loc("Choose Selection/Placement/Deletion: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2729
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2730
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2731
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2732
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2733
				"", -amCMGearPlacementTool, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2734
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2735
		hedgeEditorMissionPanelShown = false
11037
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
	elseif cat[cIndex] == loc("Sprite Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2738
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2739
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2740
				loc("SPRITE MODIFICATION MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2741
				loc("Select, modify, or delete girders, rubbers and sprites"),
12034
6ef8e01bd01c HedgeEditor: Add missing Left click help texts
Wuzzy <almikes@aol.com>
parents: 12033
diff changeset
  2742
				loc("Modify Sprite under Cursor: [Left Click]") .. "|" ..
11999
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2743
				loc("Change modification mode: [Left], [Right]") .."|"..
2193619b6b13 HedgeEditor: Add loc() to some forgotten strings, minor cleanup
Wuzzy <almikes@aol.com>
parents: 11998
diff changeset
  2744
				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
  2745
				" " .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2746
				loc("Normal Land: [1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2747
				loc("Indestructible Land: [2]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2748
				loc("Icy Land: [3]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2749
				loc("Bouncy Land: [4]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2750
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2751
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2752
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2753
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2754
				"", 2, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2755
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2756
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2757
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2758
	elseif cat[cIndex] == loc("Sprite Placement Mode") then
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
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2761
				loc("SPRITE PLACEMENT MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2762
				loc("Place sprites to build land"),
12034
6ef8e01bd01c HedgeEditor: Add missing Left click help texts
Wuzzy <almikes@aol.com>
parents: 12033
diff changeset
  2763
				loc("Place Sprite: [Left Click]") .. "|" ..
6ef8e01bd01c HedgeEditor: Add missing Left click help texts
Wuzzy <almikes@aol.com>
parents: 12033
diff changeset
  2764
				loc("Change Sprite: [Left], [Right]") .. "|" ..
6ef8e01bd01c HedgeEditor: Add missing Left click help texts
Wuzzy <almikes@aol.com>
parents: 12033
diff changeset
  2765
				loc("Change Sprite Frame: [Precise]+[Left], [Precise]+[Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2766
				" " .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2767
				loc("Normal Land: [1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2768
				loc("Indestructible Land: [2]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2769
				loc("Icy Land: [3]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2770
				loc("Bouncy Land: [4]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2771
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2772
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2773
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2774
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2775
				"", -amCMGearPlacementTool, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2776
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2777
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2778
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2779
	elseif cat[cIndex] == loc("Goal Definition Mode") then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2780
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2781
		ShowMission	(
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  2782
				loc("GOAL DEFINITION MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2783
				loc("Mark gears for win/lose conditions"),
11997
6a67e76d0f1d HedgeEditor: Better naming and explanation of tagging mode and advanced repositioning mode
Wuzzy <almikes@aol.com>
parents: 11996
diff changeset
  2784
				loc("Mark/unmark gear: [Left Click]") .. "|" ..
11998
7d8dcac2eae1 HedgeEditor: Generally improve menu help texts
Wuzzy <almikes@aol.com>
parents: 11997
diff changeset
  2785
				loc("Select win/lose condition: [Left], [Right]") .. "|" ..
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2786
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2787
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2788
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2789
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2790
				"", 0, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2791
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2792
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2793
	elseif cat[cIndex] == loc("Hog Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2794
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2795
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2796
				loc("HOG IDENTITY MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2797
				loc("Give a hog a preset identity and weapons"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2798
				loc("Set Identity: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2799
				loc("[Left], [Right]: Change between identities.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2800
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2801
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2802
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2803
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2804
				"", 3, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2805
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2806
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2807
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2808
	elseif cat[cIndex] == loc("Team Identity Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2809
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2810
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2811
				loc("TEAM IDENTITY MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2812
				loc("Give an entire team themed hats and names"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2813
				loc("Set Identity: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2814
				loc("[Left], [Right]: Change between identities.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2815
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2816
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2817
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2818
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2819
				"", 3, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2820
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2821
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2822
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2823
	elseif cat[cIndex] == loc("Health Modification Mode") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2824
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2825
		ShowMission	(
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2826
				loc("HEALTH MODIFICATION MODE"),
12040
8c8dd8eb775e HedgeEditor: Simplify placement mode description
Wuzzy <almikes@aol.com>
parents: 12035
diff changeset
  2827
				loc("Set the health of hogs, health crates, barrels and duds"),
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2828
				loc("Set Health: [Left Click]") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2829
				loc("[Left], [Right]: Change health value.") .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2830
				" " .. "|" ..
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2831
				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2832
				loc("Toggle Help: [Precise]+[1]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  2833
				loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
13462
4c47a480009b Prevent manual hiding of some special mission panels
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
  2834
				"", 2, 60000, not helpDisabled
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2835
				)
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  2836
		hedgeEditorMissionPanelShown = false
11037
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
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2839
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
	if helpDisabled == true then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2842
		HideMission()
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  2843
		hedgeEditorMissionPanelShown = false
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2844
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2845
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2846
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2847
12007
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2848
function onSetWeapon(ammoType)
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2849
	curWep = ammoType
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2850
	updateHelp(ammoType)
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2851
end
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2852
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2853
function onSlot()
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2854
	curWep = GetCurAmmoType()
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2855
	updateHelp(ammoType)
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2856
end
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  2857
13033
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2858
function onScreenResize()
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2859
	updateCursorCoords()
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2860
end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2861
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2862
-- Display the X and Y coordinates of the cursor while the cursor is active
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2863
function updateCursorCoords()
13599
11497a930b29 Whoops. Fix NoPointX typo in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 13596
diff changeset
  2864
	if band(GetState(CurrentHedgehog), gstChooseTarget) ~= 0 and CursorX ~= NoPointX then
13033
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2865
		local x1, y = 12, 24
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2866
		if tagCursorX then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2867
			DeleteVisualGear(tagCursorX)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2868
		end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2869
		tagCursorX = AddVisualGear(-div(ScreenWidth, 2)+x1, y, vgtHealthTag, CursorX, true)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2870
		SetVisualGearValues(tagCursorX, nil, nil, 0, 0, nil, 1, nil, nil, 240000, 0xFFFFFFFF)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2871
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2872
		local x2
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2873
		if string.len(tostring(CursorX)) > 6 then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2874
			x2 = x1 + 100
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2875
		else
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2876
			x2 = x1 + 60
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2877
		end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2878
		if tagCursorY then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2879
			DeleteVisualGear(tagCursorY)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2880
		end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2881
		tagCursorY = AddVisualGear(-div(ScreenWidth, 2)+x2, y, vgtHealthTag, CursorY, true)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2882
		SetVisualGearValues(tagCursorY, nil, nil, 0, 0, nil, 1, nil, nil, 240000, 0xFFFFFFFF)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2883
	else
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2884
		if tagCursorX then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2885
			DeleteVisualGear(tagCursorX)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2886
		end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2887
		if tagCursorY then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2888
			DeleteVisualGear(tagCursorY)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2889
		end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2890
	end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2891
end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  2892
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2893
-- called in onGameTick()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2894
function HandleHedgeEditor()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2895
	if CurrentHedgehog ~= nil then
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
		genTimer = genTimer + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2898
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2899
		tSprCol = 0x00000000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2900
		tempFrame = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2901
		xDisplacement = 42
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2902
		yDisplacement = 42
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2903
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  2904
		if (curWep == amCMGearPlacementTool) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2905
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  2906
			SetSoundMask(sndIncoming, true)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  2907
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2908
			--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
  2909
			dCol = 0xFFFFFFFF
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2910
			dFrame = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2911
			dAngle = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2912
			if (cat[cIndex] == loc("Mine Placement Mode")) then
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
  2913
				dSprite = sprCustom2
11991
5a51bca7eeaa Add dud mine placement mode to HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11990
diff changeset
  2914
			elseif (cat[cIndex] == loc("Dud Mine Placement Mode")) then
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
  2915
				dSprite = sprCustom4
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2916
			elseif (cat[cIndex] == loc("Sticky Mine Placement Mode")) then
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
  2917
				dSprite = sprCustom3
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2918
			elseif (cat[cIndex] == loc("Air Mine Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2919
				dSprite = sprAirMine
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2920
			elseif (cat[cIndex] == loc("Barrel Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2921
				dSprite = sprExplosives
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2922
			elseif (cat[cIndex] == loc("Health Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2923
				dSprite = sprFAid
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2924
			elseif (cat[cIndex] == loc("Weapon Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2925
				dSprite = sprCase
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2926
			elseif (cat[cIndex] == loc("Utility Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2927
				dSprite = sprUtility
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2928
			elseif (cat[cIndex] == loc("Target Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2929
				dSprite = sprTarget
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2930
			elseif (cat[cIndex] == loc("Cleaver Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2931
				dAngle = 270
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2932
				dSprite = sprKnife
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2933
			elseif (cat[cIndex] == loc("Sprite Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2934
				dSprite = reducedSpriteIDArray[pIndex]
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  2935
				dFrame = sFrame
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  2936
				if ((dSprite == sprAMAmmos) or (dSprite == sprAMAmmosBW)) and (dFrame == (amCMGearPlacementTool - 1)) then
12329
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
  2937
					-- Special case: Air attack icon of ammos sprite needs to be fixed (since this icon is overwritten)
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
  2938
					dFrame = ammoFrameAirAttack
f88eebcf22c5 HedgeEditor: Fix incorrect preview of air attack icon in sprAMAmmos/sprAMAmmosBW
Wuzzy <almikes@aol.com>
parents: 12328
diff changeset
  2939
				end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2940
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2941
				dCol = 0xFFFFFF00
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2942
				dSprite = sprArrow
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2943
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2944
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2945
			if CG == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2946
				CG = AddVisualGear(CursorX, CursorY, vgtStraightShot,0,true,3)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2947
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2948
			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
  2949
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2950
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2951
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2952
			if crateSprite == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2953
				crateSprite = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
  2954
				crateSpriteBorder = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2955
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2956
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2957
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2958
			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
  2959
				if (cat[cIndex] == loc("Weapon Crate Placement Mode")) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2960
					tArr = atkArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2961
				else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2962
					tArr = utilArray
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2963
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2964
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2965
				tSprCol = 0xFFFFFFFF
12327
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2966
				-- Get ammo icon
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2967
				if tArr[pIndex][3] then
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2968
					-- Overwritten ammo icon
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2969
					tempFrame = tArr[pIndex][3]
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2970
				else
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2971
					-- Use default ammo icon
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2972
					tempFrame = tArr[pIndex][1] - 1
8ab7572e074b Clean up HedgeEditor HWP mess, fix broken/outdated graphics
Wuzzy <almikes@aol.com>
parents: 12310
diff changeset
  2973
				end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2974
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2975
13127
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2976
			-- Waypoint outline
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2977
			if (cat[cIndex] == loc("Waypoint Editing Mode")) and (pMode[pIndex] == loc("Place Waypoint")) then
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2978
				if not waypointPreviewSprite then
13129
9a328734e469 Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents: 13127
diff changeset
  2979
					waypointPreviewSprite = AddVisualGear(CursorX, CursorY, vgtCircle, 0, true)
9a328734e469 Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents: 13127
diff changeset
  2980
					SetVisualGearValues(waypointPreviewSprite, CursorX, CursorY, 244, 224, 0, 0, 0, div(wpRadius, 5), 5, 0xFF0000FF)
13127
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2981
				end
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2982
			elseif waypointPreviewSprite then
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2983
				DeleteVisualGear(waypointPreviewSprite)
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2984
				waypointPreviewSprite = nil
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2985
			end
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2986
			if waypointPreviewSprite then
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2987
				SetVisualGearValues(waypointPreviewSprite, CursorX, CursorY)
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2988
			end
a7b67247784d HedgeEditor: Show waypoint preview
Wuzzy <Wuzzy2@mail.ru>
parents: 13126
diff changeset
  2989
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2990
		else
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  2991
			SetSoundMask(sndIncoming, false)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2992
			if CG ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2993
				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
  2994
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2995
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2996
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2997
		SetVisualGearValues(crateSprite, CursorX+xDisplacement, CursorY+yDisplacement, 0, 0, dAngle, tempFrame, 1000, sprAMAmmos, 1000, tSprCol)
13125
c8c8f856e236 HedgeEditor: Clean up messy HWP overwrites
Wuzzy <Wuzzy2@mail.ru>
parents: 13033
diff changeset
  2998
		SetVisualGearValues(crateSpriteBorder, CursorX+xDisplacement, CursorY+yDisplacement, 0, 0, 0, 0, 1000, sprCustom1, 1000, tSprCol)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  2999
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3000
		if genTimer >= 100 then
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
			genTimer = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3003
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3004
			curWep = GetCurAmmoType()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3005
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3006
			HandleRankingEffects()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3007
			runOnGears(PortalEffects)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3008
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3009
			-- change to girder mode on weapon swap
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3010
			if (cIndex ~= 1) and (curWep == amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3011
				cIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3012
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3013
				updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3014
			elseif (cIndex ~=2) and (curWep == amRubber) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3015
				cIndex = 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3016
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3017
				updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3018
			-- change to generic mode if girder no longer selected
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3019
			elseif (cIndex == 1) and (curWep ~= amGirder) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3020
				cIndex = 3 -- was 2
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3021
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3022
			elseif (cIndex == 2) and (curWep ~= amRubber) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3023
				cIndex = 3 --new
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3024
				RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3025
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3026
13126
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3027
			if curWep == amGirder or curWep == amRubber then
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3028
				SetSoundMask(sndDenied, true)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3029
			else
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3030
				SetSoundMask(sndDenied, false)
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3031
			end
b1de2f84e130 HedgeEditor: Fix sndIncoming playing for placing stuff, add many sound effects
Wuzzy <Wuzzy2@mail.ru>
parents: 13125
diff changeset
  3032
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3033
			-- update display selection criteria
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3034
			if (curWep == amGirder) or (curWep == amRubber) or (curWep == amCMGearPlacementTool) then
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3035
				AddCaption(cat[cIndex], colorPlaceMode1, capgrpMessage)
12020
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3036
				showSecondaryMessage()
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3037
				if superDelete == true then
13354
f9a15dcd857c Fix a couple of English typos
Wuzzy <Wuzzy2@mail.ru>
parents: 13282
diff changeset
  3038
					AddCaption(loc("Deletion Mode"), colorPlaceMode1, capgrpAmmoinfo)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3039
				end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3040
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3041
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3042
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3043
			if sSprite ~= nil then
11994
6fd96a5d4e6f HedgeEditor: Refactor legacy GetVisualGearValues code
Wuzzy <almikes@aol.com>
parents: 11993
diff changeset
  3044
				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
  3045
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3046
12007
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  3047
			updateHelp()
ad7205e66578 HedgeEditor: Reliably change mission text on weapon switch
Wuzzy <almikes@aol.com>
parents: 12006
diff changeset
  3048
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3049
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3050
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3054
	if (ufoFuel ~= 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3055
		if ufoFuel == 2000 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3056
			SetHealth(ufoGear, 2000)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3057
		end
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
	-- 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
  3061
	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
  3062
	--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
  3063
	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
  3064
		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
  3065
	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
  3066
		SetVisualGearValues(sSprite, nil, nil, 0, 0, nil, nil, 10000, nil, 10000)
12015
37787ab00853 HedgeEditor: Clean up some incorrect menu texts
Wuzzy <almikes@aol.com>
parents: 12014
diff changeset
  3067
	elseif (cat[cIndex] == loc("Goal Definition Mode")) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3068
		if (sGear ~= nil) or (closestGear ~= nil) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3069
			closestGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3070
			sGear = nil
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
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3073
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
	runOnGears(UpdateTagCircles)
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
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3078
	-- some kind of target detected, tell me your story
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3079
	if cGear ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3080
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3081
		x,y = GetGearTarget(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3082
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3083
		if GetGearType(cGear) == gtAirAttack and GetCurAmmoType() == amCMGearPlacementTool then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3084
			DeleteGear(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3085
			PlaceObject(x, y)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3086
		elseif GetGearType(cGear) == gtGirder then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3087
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3088
			CGR = GetState(cGear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3089
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3090
			-- 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
  3091
			PlaceObject(x, y)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3092
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3093
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3094
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3095
13033
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3096
	-- Show cursor coords
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3097
	updateCursorCoords()
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3098
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3099
	-- Barrel health tags, mine timer tags and health crate health tags
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3100
	do
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3101
		local actualValue	-- internal value
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3102
		local printedValue	-- value exposed to HUD
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3103
		for g, v in pairs(tagGears) do
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3104
			local gt = GetGearType(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3105
			if v == -1 then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3106
				if gt == gtCase then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3107
					if(band(GetGearPos(g), 0x2) ~= 0) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3108
						v = AddVisualGear(0, 0, vgtHealthTag, GetHealth(g), true)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3109
						SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, 0x808080FF)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3110
						tagGears[g] = v
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3111
					else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3112
						tagGears[g] = nil
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3113
					end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3114
				else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3115
					if gt == gtMine and GetHealth(g) == 0 then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3116
						local _, damage, health
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3117
						_, _, _, _, _, _, _, _, _, _, _, damage = GetGearValues(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3118
						health = 36 - damage
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3119
						v = AddVisualGear(0, 0, vgtHealthTag, health, true)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3120
						SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, 0x808080FF)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3121
						tagGears[g] = v
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3122
					end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3123
				end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3124
			end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3125
			-- Delete tag for drowning gears
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3126
			if(band(GetState(g), gstDrowning) ~= 0) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3127
				DeleteVisualGear(v)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3128
				tagGears[g] = nil
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3129
			elseif(tagGears[g] ~= nil and tagGears[g] ~= -1) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3130
				local tag, actualvalue, offset_x, offset_y
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3131
				tag = GetState(v)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3132
				if(gt == gtExplosives) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3133
					actualValue = GetHealth(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3134
					printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3135
					offset_y = -20
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3136
					offset_x = 0
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3137
				elseif(gt == gtAirMine) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3138
					if(band(GetState(g), gstAttacking) ~= 0) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3139
						actualValue = GetTimer(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3140
						printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3141
					else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3142
						local _
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3143
						_, _, actualValue = GetGearValues(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3144
						printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3145
					end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3146
					offset_y = 28
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3147
					offset_x = 16
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3148
				elseif(gt == gtCase) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3149
					actualValue = GetHealth(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3150
					printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3151
					offset_y = -20
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3152
					offset_x = 1
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3153
				elseif(gt == gtMine) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3154
					if(GetHealth(g) ~= 0) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3155
						-- Non-dud: Show timer
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3156
						actualValue = GetTimer(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3157
						printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3158
						offset_y = 28
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3159
						offset_x = 16
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3160
					else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3161
						-- Dud: Show health
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3162
						local _
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3163
						_, _, _, _, _, _, _, _, _, _, _, actualValue = GetGearValues(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3164
						printedValue = 36 - actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3165
						offset_y = -12
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3166
						offset_x = 0
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3167
					end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3168
				elseif(gt == gtSMine) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3169
					actualValue = GetTimer(g)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3170
					printedValue = actualValue
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3171
					offset_y = 28
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3172
					offset_x = 16
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3173
				end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3174
				--[[ The timer tag normally disappears near the water line, this is a really
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3175
				ugly hack to adjust the position of the tag so it is always displayed.
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3176
				FIXME: Find a better solution to fix this. ]]
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3177
				if (GetY(g) + offset_y) > WaterLine and (GetY(g) + offset_y) < WaterLine + 30 then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3178
					offset_y = (WaterLine - GetY(g))
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3179
				end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3180
				local tint
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3181
				if(not showGearTags) then
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3182
					-- Hide the tags
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3183
					tint = 0x00000000
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3184
				elseif(gt == gtCase) then
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3185
					tint = 0x80FF80FF
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3186
				elseif(gt == gtExplosives or (gt == gtMine and GetHealth(g) == 0)) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3187
					tint = 0x808080FF
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3188
				elseif(band(GetState(g), gstAttacking) ~= 0) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3189
					if(actualValue % 1000 > 500) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3190
						tint = 0xFFA0A0FF
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3191
					else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3192
						tint = 0xFF4040FF
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3193
					end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3194
				else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3195
					tint = 0xFFFFFFFF
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3196
				end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3197
				if(actualValue ~= tag) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3198
					--[[ If timer/health changed, delete visual gear and add it again.
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3199
					Changing the visual gear state does not have any effect, so we need this hack ]]
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3200
					DeleteVisualGear(v)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3201
					v = AddVisualGear(GetX(g)+offset_x, GetY(g)+offset_y, vgtHealthTag, printedValue, true)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3202
					SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, tint)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3203
					tagGears[g] = v
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3204
				else
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3205
					-- Just update position if the health did not change
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3206
					SetVisualGearValues(v, GetX(g)+offset_x, GetY(g)+offset_y, 0, 0, nil, nil, nil, nil, 240000, tint)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3207
				end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3208
			end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3209
		end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3210
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3211
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3212
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3213
--------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3214
-- EVENT HANDLERS
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3215
--------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3216
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3217
function commandMode()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3218
	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
  3219
		return(true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3220
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3221
		return(false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3222
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3223
end
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
function onTimer(s)
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
	superDelete = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3228
	if (commandMode() == true) and (s == 4) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3229
		SaveLevelData() -- positions of crates, etc
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3230
	elseif (commandMode() == true) and (s == 2) then
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3231
		if GetAmmoCount(CurrentHedgehog, amCMGearPlacementTool) == 100 then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3232
			SetEditingWeps(0)
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3233
			AddCaption(loc("The editor weapons and tools have been removed!"), colorInfoMessage, capgrpGameState)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3234
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3235
			SetEditingWeps(100)
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3236
			AddCaption(loc("The editor weapons and tools have been added!"), colorInfoMessage, capgrpGameState)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3237
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3238
	elseif (preciseOn == true) and (s == 1) then
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3239
		helpDisabled = not(helpDisabled)
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3240
		if helpDisabled then
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3241
			AddCaption(loc("Help Disabled"), colorInfoMessage, capgrpVolume)
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3242
		else
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3243
			AddCaption(loc("Help Enabled"), colorInfoMessage, capgrpVolume)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3244
		end
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3245
		updateHelp()
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3246
	elseif (preciseOn == true) and (s == 3) then
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3247
		showGearTags = not(showGearTags)
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3248
		if showGearTags then
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3249
			AddCaption(loc("Gear information shown"), colorInfoMessage, capgrpVolume)
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3250
		else
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3251
			AddCaption(loc("Gear information hidden"), colorInfoMessage, capgrpVolume)
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3252
		end
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3253
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3254
	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
  3255
12031
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3256
		if (cat[cIndex] == loc("Rubber Placement Mode")) then
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3257
			if s == 1 then
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3258
				landType = lfBouncy
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3259
				AddCaption(loc("Bouncy Land"), colorPlaceMode1, capgrpAmmoinfo)
12031
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3260
			elseif s == 5 then
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3261
				superDelete = true
0b0578c25470 HedgeEditor: Disable timer keys 2-4 in rubber placement mode
Wuzzy <almikes@aol.com>
parents: 12030
diff changeset
  3262
			end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3263
		elseif s == 1 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3264
			landType = 0
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3265
			AddCaption(loc("Normal Land"), colorPlaceMode1, capgrpAmmoinfo)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3266
		elseif s == 2 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3267
			landType = lfIndestructible
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3268
			AddCaption(loc("Indestructible Land"), colorPlaceMode1, capgrpAmmoinfo)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3269
		elseif s == 3 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3270
			landType = lfIce
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3271
			AddCaption(loc("Icy Land"), colorPlaceMode1, capgrpAmmoinfo)
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3272
		elseif (s == 4) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3273
			landType = lfBouncy
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3274
			AddCaption(loc("Bouncy Land"), colorPlaceMode1, capgrpAmmoinfo)
12003
9790a4c72d7b HedgeEditor: Disable delete mode for sprite placement mode
Wuzzy <almikes@aol.com>
parents: 12002
diff changeset
  3275
		elseif (s == 5) and (cat[cIndex] ~= loc("Sprite Modification Mode")) and (cat[cIndex] ~= loc("Sprite Placement Mode")) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3276
			superDelete = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3277
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3278
	elseif pMode[pIndex] == loc("Selection Mode") then
12018
7fdf381303b1 HedgeEditor: Fix Lua error when trying to set ShoppaBalance rank without anything being selected
Wuzzy <almikes@aol.com>
parents: 12017
diff changeset
  3279
		if sGear ~= nil and GetGearType(sGear) == gtHedgehog then
7fdf381303b1 HedgeEditor: Fix Lua error when trying to set ShoppaBalance rank without anything being selected
Wuzzy <almikes@aol.com>
parents: 12017
diff changeset
  3280
			setGearValue(sGear, "ranking", s)
7fdf381303b1 HedgeEditor: Fix Lua error when trying to set ShoppaBalance rank without anything being selected
Wuzzy <almikes@aol.com>
parents: 12017
diff changeset
  3281
		end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3282
	end
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
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3285
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3286
function onPrecise()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3287
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3288
	preciseOn = true
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
end
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
function onPreciseUp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3293
	preciseOn = false
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3294
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3295
12020
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3296
function showSecondaryMessage()
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3297
	local caption2
12026
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3298
	if curWep == amGirder then
12020
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3299
		caption2 = loc("Girder")
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3300
	elseif curWep == amRubber then
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3301
		caption2 = loc("Rubber")
12026
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3302
	elseif cat[cIndex] == loc("Mine Placement Mode") or cat[cIndex] == loc("Sticky Mine Placement Mode") or cat[cIndex] == loc("Air Mine Placement Mode") then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3303
		caption2 = string.format(loc("%d ms"), pMode[pIndex])
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3304
	elseif cat[cIndex] == loc("Dud Mine Placement Mode") or cat[cIndex] == loc("Barrel Placement Mode") or cat[cIndex] == loc("Health Crate Placement Mode") then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3305
		caption2 = string.format(loc("Health: %d"), pMode[pIndex])
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3306
	elseif cat[cIndex] == loc("Health Modification Mode") then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3307
		local health = tonumber(pMode[pIndex][1])
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3308
		local mode = pMode[pIndex][2]
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3309
		if mode == "set" then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3310
			caption2 = string.format(loc("Set to %d"), health)
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3311
		elseif mode == "mod" then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3312
			if health < 0 then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3313
				caption2 = string.format(loc("Subtract %d"), math.abs(health))
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3314
			else
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3315
				caption2 = string.format(loc("Add %d"), health)
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3316
			end
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3317
		else
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3318
			caption2 = "ERROR"
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3319
		end
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3320
	elseif type(pMode[pIndex]) == "table" then
6bc9a499c60b HedgeEditor: Improve secondary message
Wuzzy <almikes@aol.com>
parents: 12025
diff changeset
  3321
		caption2 = tostring(pMode[pIndex][1])
12020
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3322
	else
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3323
		caption2 = tostring(pMode[pIndex])
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3324
	end
12976
4772eb3c9929 HedgeEditor: Tweak caption colors
Wuzzy <Wuzzy2@mail.ru>
parents: 12962
diff changeset
  3325
	AddCaption(caption2, colorPlaceMode2, capgrpMessage2)
12020
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3326
end
da843fffe020 HedgeEditor: Fix girder/rubber mods sometimes show nil in 2nd message
Wuzzy <almikes@aol.com>
parents: 12019
diff changeset
  3327
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3328
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3329
-- Cycle through selection subsets (by changing pIndex, pMode)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3330
-- i.e 	health of barrels, medikits,
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3331
--		timer of mines
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3332
--		contents of crates etc.
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3333
---------------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3334
function onLeft()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3335
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3336
	if (curWep == amCMGearPlacementTool) then
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3337
		leftHeld = true
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3338
		rightHeld = false
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3339
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3340
		if preciseOn then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3341
			if cat[cIndex] == loc("Sprite Placement Mode") then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3342
				sFrame = sFrame - 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3343
				if sFrame < 0 then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3344
					sFrame = reducedSpriteIDArrayFrames[pIndex] - 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3345
				end
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  3346
			end
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3347
		else
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3348
			pIndex = pIndex - 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3349
			if pIndex == 0 then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3350
				pIndex = #pMode
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3351
			end
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3352
			if cat[cIndex] == loc("Sprite Placement Mode") then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3353
				sFrame = math.min(sFrame, reducedSpriteIDArrayFrames[pIndex] - 1)
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3354
			end
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3355
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3356
			if (curWep == amGirder) or (curWep == amRubber) or (curWep == amCMGearPlacementTool) then
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3357
				showSecondaryMessage()
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3358
			end
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  3359
		end
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3360
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3361
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3362
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3363
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3364
function onRight()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3365
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3366
	if (curWep == amCMGearPlacementTool) then
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3367
		leftHeld = false
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3368
		rightHeld = true
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3369
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3370
		if preciseOn then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3371
			if cat[cIndex] == loc("Sprite Placement Mode") then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3372
				sFrame = sFrame + 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3373
				if sFrame >= reducedSpriteIDArrayFrames[pIndex] then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3374
					sFrame = 0
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3375
				end
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  3376
			end
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3377
		else
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3378
			pIndex = pIndex + 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3379
			if pIndex > #pMode then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3380
				pIndex = 1
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3381
			end
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3382
			if cat[cIndex] == loc("Sprite Placement Mode") then
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3383
				sFrame = math.min(sFrame, reducedSpriteIDArrayFrames[pIndex] - 1)
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3384
			end
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3385
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3386
			if (curWep == amGirder) or (curWep == amRubber) or (curWep == amCMGearPlacementTool) then
12791
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3387
				showSecondaryMessage()
a19ae0db7ab5 HedgeEditor: Don't change mode in background when pressing left/right w/o amAirAttack selected
Wuzzy <Wuzzy2@mail.ru>
parents: 12740
diff changeset
  3388
			end
12010
e020e1ce4739 HedgeEditor: Implement frame selection for sprites
Wuzzy <almikes@aol.com>
parents: 12009
diff changeset
  3389
		end
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3390
	end
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3391
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3392
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3393
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3394
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3395
-- Cycle through primary categories (by changing cIndex)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3396
-- i.e 	mine, sticky mine, barrels
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3397
--		health/weapon/utility crate, placement of gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3398
---------------------------------------------------------
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3399
function onUp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3400
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3401
	if (curWep == amCMGearPlacementTool) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3402
		cIndex = cIndex - 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3403
		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
  3404
			cIndex = #cat
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3405
		end
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
		RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3408
		updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3409
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3410
	end
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 onDown()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3415
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3416
	if (curWep == amCMGearPlacementTool) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3417
		cIndex = cIndex + 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3418
		if cIndex > #cat then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3419
			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
  3420
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3421
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3422
		RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3423
		updateHelp()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3424
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3425
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3426
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3427
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3428
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3429
function onParameters()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3430
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3431
    parseParams()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3432
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3433
	ufoFuel = tonumber(params["ufoFuel"])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3434
	if ufoFuel == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3435
		ufoFuel = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3436
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3437
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3438
	mapID = tonumber(params["m"])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3439
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3440
	--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
  3441
	if tonumber(params["portalDistance"]) ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3442
		portalDistance = div(tonumber(params["portalDistance"]),5)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3443
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3444
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3445
	if portalDistance == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3446
		portalDistance = 5000
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3447
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3448
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3449
	if mapID == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3450
		mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3451
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3452
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3453
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3454
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3455
function onGameInit()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3456
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3457
	-- 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
  3458
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3459
	if mapID == nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3460
		mapID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3461
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3462
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3463
	-- 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
  3464
	for i = 1, #gameFlagList do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3465
		if band(GameFlags, gameFlagList[i][3]) ~= 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3466
			gameFlagList[i][2] = true
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3467
		else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3468
			gameFlagList[i][2] = false
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
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3471
12310
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3472
	reducedSpriteIDArrayFrames = {
12338
43eb886f479b HedgeEditor: Make sprTargetBee the first selected sprite
Wuzzy <almikes@aol.com>
parents: 12329
diff changeset
  3473
		1, 8, 4, 1, 1,
12310
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3474
		AmmoTypeMax, AmmoTypeMax, 3, 4, 8, 1,
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3475
		1, 1, 1, 1, 1, 1,
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3476
		1, 1, 1, 1, 1,
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3477
	}
a2049a645e29 HedgeEditor: Fix maximum ammos sprite ID being 1 too low
Wuzzy <almikes@aol.com>
parents: 12287
diff changeset
  3478
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3479
	Explosives = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3480
	MinesNum = 0
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3481
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3482
	EnableGameFlags(gfInfAttack, gfDisableWind)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3483
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3484
	RedefineSubset()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3485
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3486
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3487
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3488
function showHedgeEditorMissionPanel()
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3489
	ShowMission	(
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3490
		loc("HEDGEEDITOR"),
13661
21a05ef25328 HedgeEditor should be fairly stable by now
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
  3491
		loc("An experimental editing tool for missions and more"),
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3492
		loc("Manual: https://hedgewars.org/hedgeeditor") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3493
		" " .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3494
		loc("Place Girder: Girder") .. "|" ..
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3495
		loc("Place Rubber: Rubber") .. "|" ..
12035
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3496
		loc("Place Gears (and more): Gear Placement Tool") .. "|" ..
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3497
		loc("Toggle Help: [Precise]+[1]") .. "|" ..
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3498
		loc("Toggle Gear Information: [Precise]+[3]") .. "|" ..
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3499
		" " .. "|" ..
12032
7339122bad35 HedgeEditor: Make toggle help and toggle gear info work everywhere
Wuzzy <almikes@aol.com>
parents: 12031
diff changeset
  3500
		loc("Editing Commands: (Use while no weapon is selected)") .. "|" ..
12030
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  3501
		loc("Save Level: [Precise]+[4]") .. "|" ..
0d8c4e4ead8a HedgeEditor: Unify key combination help
Wuzzy <almikes@aol.com>
parents: 12029
diff changeset
  3502
		loc("Toggle Editing Weapons and Tools: [Precise]+[2]")
12009
c69b36964374 Tweak HedgeEditor output: loc() hog/team names and tweak mission text
Wuzzy <almikes@aol.com>
parents: 12008
diff changeset
  3503
		, 4, 5000
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3504
		)
12035
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3505
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3506
	SetAmmoTexts(amCMGearPlacementTool,
12035
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3507
		loc("Gear Placement Tool"),
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3508
		loc("HedgeEditor tool"),
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3509
		loc("Place, modify and delete gears (e.g. objects)|and waypoints, edit hedgehog settings, values,|victory conditions, and more.") .. "|" ..
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3510
		loc("Select a placement mode and read the infos|in the mission panel to learn how to use it.") .. "|" ..
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3511
		loc("Up/Down: Change placement mode") .. "|" ..
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3512
		loc("Cursor: Mode action"))
44adf110f73b Use SetAmmoTexts in HedgeEditor to describe overwritten air attack (gear placement tool)
Wuzzy <almikes@aol.com>
parents: 12034
diff changeset
  3513
12005
38563aa129c1 Don't agressively show HedgeEditor mission panel
Wuzzy <almikes@aol.com>
parents: 12004
diff changeset
  3514
	hedgeEditorMissionPanelShown = true
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3515
end
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3516
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3517
function onGameStart()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3518
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3519
	trackTeams()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3520
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3521
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3522
	InterpretPoints()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3523
	LoadLevelData()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3524
12000
132ffe52d943 Write better “greeting” message for HedgeEditor
Wuzzy <almikes@aol.com>
parents: 11999
diff changeset
  3525
	showHedgeEditorMissionPanel()
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3526
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3527
	sCirc = AddVisualGear(0,0,vgtCircle,0,true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3528
	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
  3529
11996
936ac92cb67a HedgeEditor: Improve graphics on girder/rubber placement
Wuzzy <almikes@aol.com>
parents: 11995
diff changeset
  3530
	--[[ 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
  3531
	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
  3532
	SetMaxBuildDistance(1)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3533
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3534
	frameID = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3535
	visualSprite = sprAmGirder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3536
	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
  3537
	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
  3538
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3539
	SetAmmoDelay(amCMGearPlacementTool,0)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3540
	SetAmmoDelay(amGirder,0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3541
	SetAmmoDelay(amRubber,0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3542
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3543
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3544
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3545
function SetEditingWeps(ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3546
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3547
	AddAmmo(CurrentHedgehog, amCMGearPlacementTool, ammoCount)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3548
	AddAmmo(CurrentHedgehog, amGirder, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3549
	AddAmmo(CurrentHedgehog, amRubber, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3550
	AddAmmo(CurrentHedgehog, amTeleport, ammoCount)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3551
	AddAmmo(CurrentHedgehog, amRope, ammoCount)
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3552
	AddAmmo(CurrentHedgehog, amSwitch, 100)
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3553
	AddAmmo(CurrentHedgehog, amSkip, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3554
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3555
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3556
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3557
function clearAmmo(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3558
	for i = 1, #atkArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3559
		AddAmmo(gear,atkArray[i][1],0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3560
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3561
	for i = 1, #utilArray do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3562
		AddAmmo(gear,utilArray[i][1],0)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3563
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3564
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3565
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3566
-- 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
  3567
-- 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
  3568
-- 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
  3569
function SetTeamIdentity(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3570
	tName = pMode[pIndex]
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3571
	hIndex = 1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3572
	hArr = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3573
	for i = 1,#preMadeTeam[pIndex][2] do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3574
		table.insert(hArr,preMadeTeam[pIndex][2][i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3575
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3576
	nArr = {}
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3577
	for i = 1,#preMadeTeam[pIndex][3] do
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3578
		table.insert(nArr,preMadeTeam[pIndex][3][i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3579
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3580
	SetHogTeamName(gear, tName)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3581
	runOnHogs(AssignTeam)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3582
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3583
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3584
function AssignTeam(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3585
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3586
	if GetHogTeamName(gear) == tName then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3587
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3588
		setGearValue(gear,"flag",preMadeTeam[pIndex][5])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3589
		setGearValue(gear,"voice",preMadeTeam[pIndex][6])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3590
		setGearValue(gear,"grave",preMadeTeam[pIndex][7])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3591
		setGearValue(gear,"fort",preMadeTeam[pIndex][8])
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3592
		setGearValue(gear,"originalTeamName",preMadeTeamNamesOriginal[pIndex])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3593
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3594
		if preMadeTeam[pIndex][4] == "R" then -- random team
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3595
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3596
			if #hArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3597
				--if there are unchosen hats left, choose one
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3598
				--then remove it from the available list of hats
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3599
				i = 1+GetRandom(#hArr)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3600
				SetHogHat(gear,hArr[i])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3601
				table.remove(hArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3602
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3603
				-- choose any hat randomly
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3604
				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
  3605
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3606
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3607
			if #nArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3608
				i = 1+GetRandom(#nArr)
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3609
				SetHogNameAndTranslate(gear, nArr[i])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3610
				table.remove(nArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3611
			else
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3612
				SetHogNameAndTranslate(gear, preMadeTeam[pIndex][3][1+GetRandom(#preMadeTeam[pIndex][3])])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3613
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3614
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3615
		elseif preMadeTeam[pIndex][4] == "F" then -- fixed team w/ exactly 8 guys
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3616
			SetHogNameAndTranslate(gear, preMadeTeam[pIndex][3][hIndex])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3617
			SetHogHat(gear,preMadeTeam[pIndex][2][hIndex])
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3618
			hIndex = hIndex +1
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3619
		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
  3620
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3621
			if #hArr > 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3622
				i = 1+GetRandom(#hArr)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3623
				SetHogHat(gear,hArr[i])
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3624
				SetHogNameAndTranslate(gear, nArr[i])
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3625
				table.remove(hArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3626
				table.remove(nArr,i)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3627
			else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3628
				SetHogHat(gear,"NoHat")
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3629
				SetHogNameAndTranslate(gear,loc_noop("Hedgehog"))
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3630
			end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3631
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3632
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3633
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3634
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3635
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3636
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3637
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3638
-- 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
  3639
-- 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
  3640
function SetHogProfile(gear, pro)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3641
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3642
	clearAmmo(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3643
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3644
	if pro == loc("Sniper") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3645
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3646
		SetHogNameAndTranslate(gear, "Sniper")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3647
		SetHogHat(gear, "Sniper")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3648
		SetHealth(gear, 50)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3649
		AddAmmo(gear, amSniperRifle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3650
		AddAmmo(gear, amDEagle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3651
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3652
	elseif pro == loc("Pyro") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3653
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3654
		SetHogNameAndTranslate(gear, "Pyro")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3655
		SetHogHat(gear, "Gasmask")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3656
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3657
		AddAmmo(gear, amFlamethrower, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3658
		AddAmmo(gear, amMolotov, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3659
		AddAmmo(gear, amNapalm, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3660
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3661
	elseif pro == loc("Soldier") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3662
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3663
		SetHogNameAndTranslate(gear, "Soldier")
11995
ec3fe3068932 HedgeEditor: Throw away code in comments and unused variables
Wuzzy <almikes@aol.com>
parents: 11994
diff changeset
  3664
		SetHogHat(gear, "war_americanww2helmet")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3665
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3666
		AddAmmo(gear, amBazooka, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3667
		AddAmmo(gear, amShotgun, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3668
		AddAmmo(gear, amMortar, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3669
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3670
	elseif pro == loc("Grenadier") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3671
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3672
		SetHogNameAndTranslate(gear, "Grenadier")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3673
		SetHogHat(gear, "war_desertgrenadier1")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3674
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3675
		AddAmmo(gear, amGrenade, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3676
		AddAmmo(gear, amClusterBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3677
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3678
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3679
	elseif pro == loc("Chef") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3680
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3681
		SetHogNameAndTranslate(gear, "Chef")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3682
		SetHogHat(gear, "chef")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3683
		SetHealth(gear, 65)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3684
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3685
		AddAmmo(gear, amKnife, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3686
		AddAmmo(gear, amCake, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3687
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3688
	elseif pro == loc("Ninja") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3689
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3690
		SetHogNameAndTranslate(gear, "Ninja")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3691
		SetHogHat(gear, "NinjaFull")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3692
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3693
		AddAmmo(gear, amRope, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3694
		AddAmmo(gear, amFirePunch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3695
		AddAmmo(gear, amParachute, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3696
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3697
	elseif pro == loc("Commander") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3698
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3699
		SetHogNameAndTranslate(gear, "Commander")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3700
		SetHogHat(gear, "sf_vega")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3701
		SetHealth(gear, 120)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3702
		AddAmmo(gear, amDEagle, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3703
		AddAmmo(gear, amAirAttack, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3704
		AddAmmo(gear, amNapalm, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3705
		AddAmmo(gear, amDrillStrike, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3706
		AddAmmo(gear, amMineStrike, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3707
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3708
	elseif pro == loc("Engineer") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3709
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3710
		SetHogNameAndTranslate(gear, "Engineer")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3711
		SetHogHat(gear, "Glasses")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3712
		SetHealth(gear, 45)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3713
		AddAmmo(gear, amGirder, 4)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3714
		AddAmmo(gear, amRubber, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3715
		AddAmmo(gear, amLandGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3716
		AddAmmo(gear, amBlowTorch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3717
		AddAmmo(gear, amPickHammer, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3718
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3719
	elseif pro == loc("Physicist") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3720
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3721
		SetHogNameAndTranslate(gear, "Physicist")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3722
		SetHogHat(gear, "lambda")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3723
		SetHealth(gear, 80)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3724
		AddAmmo(gear, amIceGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3725
		AddAmmo(gear, amSineGun, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3726
		AddAmmo(gear, amBee, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3727
		AddAmmo(gear, amLowGravity, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3728
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3729
	elseif pro == loc("Trapper") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3730
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3731
		SetHogNameAndTranslate(gear, "Trapper")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3732
		SetHogHat(gear, "Skull")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3733
		SetHealth(gear, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3734
		AddAmmo(gear, amMine, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3735
		AddAmmo(gear, amSMine, 4)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3736
		AddAmmo(gear, amAirMine, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3737
		AddAmmo(gear, amMolotov, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3738
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3739
	elseif pro == loc("Saint") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3740
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3741
		SetHogNameAndTranslate(gear, "Saint")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3742
		SetHogHat(gear, "angel")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3743
		SetHealth(gear, 200)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3744
		AddAmmo(gear, amSeduction, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3745
		AddAmmo(gear, amInvulnerable, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3746
		AddAmmo(gear, amIceGun, 2)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3747
		AddAmmo(gear, amHammer, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3748
		AddAmmo(gear, amResurrector, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3749
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3750
	elseif pro == loc("Clown") then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3751
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3752
		SetHogNameAndTranslate(gear, "Clown")
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3753
		SetHogHat(gear, "clown-copper")
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3754
		SetHealth(gear, 70)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3755
		AddAmmo(gear, amBaseballBat, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3756
		AddAmmo(gear, amGasBomb, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3757
		AddAmmo(gear, amBallgun, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3758
		AddAmmo(gear, amKamikaze, 1)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3759
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3760
	-- some other ideas/roles
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3761
	-- relocator: portal, teleport, tardis, extra time, lasersite
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3762
	-- vampire: vampire, whip, birdy, extra damage, seduction
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3763
	-- flyboy: rc plane, deagle, whip, parachute, kamikaze
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3764
	-- demo: drill, dynamite, mine, smine, blowtorch
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3765
	-- alien: ufo, sine-gun, drill rocket
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3766
	-- terminator: tardis, shotgun, cake, girder
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3767
	-- yeti: ice-gun, firepunch, blowtorch
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3768
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3769
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3770
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3771
	AddAmmo(gear, amSwitch, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3772
	AddAmmo(gear, amSkip, 100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3773
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3774
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3775
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3776
function onNewTurn()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3777
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3778
	-- 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
  3779
	SetEditingWeps(100)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3780
	if GetHogLevel(CurrentHedgehog) == 0 then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3781
		TurnTimeLeft = -1	-- is that turntime in your pocket? :D
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3782
	else
13170
98a0edb4bb5a Lua API: Add SkipTurn() to replace ParseCommand("skip")
Wuzzy <Wuzzy2@mail.ru>
parents: 13129
diff changeset
  3783
		SkipTurn() -- skip the computer's turn
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3784
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3785
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3786
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3787
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3788
function onGameTick()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3789
	HandleHedgeEditor()
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3790
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3791
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3792
function isATrackedGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3793
	if 	(GetGearType(gear) == gtHedgehog) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3794
		(GetGearType(gear) == gtGrenade) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3795
		(GetGearType(gear) == gtExplosives) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3796
		(GetGearType(gear) == gtTarget) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3797
		(GetGearType(gear) == gtKnife) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3798
		(GetGearType(gear) == gtMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3799
		(GetGearType(gear) == gtSMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3800
		(GetGearType(gear) == gtPortal) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3801
		(GetGearType(gear) == gtAirMine) or
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3802
		(GetGearType(gear) == gtCase)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3803
	then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3804
		return(true)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3805
	else
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3806
		return(false)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3807
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3808
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3809
12014
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3810
function SetHogNameAndTranslate(gear, originalName)
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3811
	SetHogName(gear, loc(originalName))
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3812
	--[[ Store the original (usually English) hog name, since we need it for exporting.
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3813
	This way, we can display the translated name in the editor and export the properly
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3814
	loc()'ed original name afterwards ]]
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3815
	setGearValue(gear, "originalName", originalName)
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3816
end
9937075bbfd5 HedgeEditor: Make all hog and team names translatable and export them properly
Wuzzy <almikes@aol.com>
parents: 12012
diff changeset
  3817
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3818
-- track hedgehogs and placement gears
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3819
function onGearAdd(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3820
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3821
	if GetGearType(gear) == gtJetpack then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3822
		ufoGear = gear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3823
		if (ufoFuel ~= 0) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3824
			SetHealth(ufoGear, ufoFuel)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3825
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3826
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3827
12941
ffbd31afed96 HedgeEditor, Construction Mode: Refactor code by adding fake ammo type variables
Wuzzy <Wuzzy2@mail.ru>
parents: 12792
diff changeset
  3828
	if (GetGearType(gear) == gtAirAttack and GetCurAmmoType() == amCMGearPlacementTool) or (GetGearType(gear) == gtGirder) then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3829
		cGear = gear
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3830
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3831
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3832
	local tagTint
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3833
	if showGearTags then
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3834
		tagTint = 0xFFFFFFFF
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3835
	else
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3836
		tagTint = 0x00000000
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3837
	end
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3838
	if ((GetGearType(gear) == gtMine and GetHealth(gear) ~= 0) or GetGearType(gear) == gtSMine) then
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3839
		local v = AddVisualGear(0, 0, vgtHealthTag, GetTimer(gear), true)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3840
		SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, tagTint)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3841
		tagGears[gear] = v
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3842
	elseif ((GetGearType(gear) == gtMine and GetHealth(gear) == 0)) then
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3843
		local _, dmg
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3844
		_, _, _, _, _, _, _, _, _, _, dmg = GetGearValues(gear)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3845
		local v = AddVisualGear(0, 0, vgtHealthTag, 36 - dmg, true)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3846
		SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, tagTint)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3847
		tagGears[gear] = v
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3848
	elseif (GetGearType(gear) == gtAirMine) then
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3849
		local _, wdTimer
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3850
		_, _, wdTimer = GetGearValues(gear)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3851
		local v = AddVisualGear(0, 0, vgtHealthTag, wdTimer, true)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3852
		SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, tagTint)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3853
		tagGears[gear] = v
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3854
	elseif (GetGearType(gear) == gtCase) then
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3855
		tagGears[gear] = -1
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3856
	elseif (GetGearType(gear) == gtExplosives) then 
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3857
		local v = AddVisualGear(0, 0, vgtHealthTag, GetHealth(gear), true)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3858
		SetVisualGearValues(v, nil, nil, 0, 0, nil, nil, nil, nil, 240000, tagTint)
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3859
		tagGears[gear] = v
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3860
	end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3861
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3862
	if isATrackedGear(gear) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3863
		trackGear(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3864
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3865
		if GetGearType(gear) == gtPortal then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3866
			setGearValue(gear,"life",portalDistance)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3867
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3868
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3869
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3870
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3871
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3872
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3873
function onGearDelete(gear)
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3874
	local gt = GetGearType(gear)
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3875
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3876
	if gt == gtJetpack then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3877
		ufoGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3878
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3879
12740
cae0b3139ff7 HedgeEditor: Fix broken napalm/mine strike/drill strike
Wuzzy <Wuzzy2@mail.ru>
parents: 12648
diff changeset
  3880
	if (gt == gtAirAttack and GetGearPos(gear) == 0) or gt == gtGirder then
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3881
		cGear = nil
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3882
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3883
12024
16dbc3a92d14 HedgeEditor: Make health/timer tags toggable with Precise+3
Wuzzy <almikes@aol.com>
parents: 12023
diff changeset
  3884
	if (gt == gtMine or gt == gtSMine or gt == gtAirMine or gt == gtExplosives or gt == gtCase) then 
12023
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3885
		if(tagGears[gear] ~= -1) then
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3886
			DeleteVisualGear(tagGears[gear])
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3887
		end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3888
		tagGears[gear] = nil
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3889
	end
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3890
ba71454538d0 HedgeEditor: Show tags for gear timers and health
Wuzzy <almikes@aol.com>
parents: 12022
diff changeset
  3891
11037
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3892
	if isATrackedGear(gear) then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3893
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3894
		if getGearValue(gear, "tCirc") ~= nil then
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3895
			DeleteVisualGear(getGearValue(gear, "tCirc"))
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3896
		end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3897
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3898
		trackDeletion(gear)
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3899
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3900
	end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3901
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3902
end
599bb42d7448 HedgeEditor (bring on the bug reports, wahey!)
mikade <redgrinner@gmail.com>
parents:
diff changeset
  3903
13033
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3904
function onVisualGearDelete(vGear)
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3905
	if vGear == tagCursorX then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3906
		tagCursorX = nil
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3907
	end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3908
	if vGear == tagCursorY then
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3909
		tagCursorY = nil
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3910
	end
a823de31240e Display cursor coordinates in HedgeEditor
Wuzzy <Wuzzy2@mail.ru>
parents: 12976
diff changeset
  3911
end