share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua
author Wuzzy <almikes@aol.com>
Thu, 24 Nov 2016 05:41:50 +0100
changeset 12062 3d03e9294633
parent 12053 281a4f33b08f
child 12064 54f53cf14ae4
permissions -rw-r--r--
Use yellow clock color in Space Invasion and Tumbler
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     1
------------------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     2
-- TUMBLER
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
     3
-- v.0.8.0
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     4
------------------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     5
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
     6
--[[
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
     7
SCRIPT PARAMETER
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
     8
The script is configured with the script parameter.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
     9
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    10
Additional configuration in the game scheme is permitted.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    11
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    12
The script parameter is a comma-separated list of key=value pairs.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    13
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    14
The values are always whole numbers, the keys are listed below.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    15
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    16
Key			Default	Description
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    17
----------------------------------------------------------------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    18
spawnbarrels		2	Number of barrels that spawn per turn
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    19
spawnmines		4	Number of mines that spawn per turn
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    20
ammoflamer		50	Initial fuel/ammo of Flamer
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    21
ammobarrel		2	Initial ammo of Barrel Launcher
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    22
ammomine		1	Initial ammo of Mine Deployer
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    23
minetimerplaced		1000	Mine timer of mines dropped from Mine Deployer (!) in milliseconds
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    24
bonustime		25	Bonus time in utility crates, in seconds
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    25
bonusflames		800	Flamer fuel bonus in ammo crates
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    26
chanceammo		30	Chance (in %) that an ammo crate will drop before a turn
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    27
chancetime		50	Chance (in %) that an utility crate (extra time) will drop before a turn
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    28
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    29
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    30
EXAMPLES:
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    31
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    32
ammoflamer=800, ammomine=5
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    33
--> Starts the game with 800 Flamer fuel and 5 Mine Deployer mines.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    34
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    35
chancetime=0
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    36
--> No clock crates.
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    37
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    38
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    39
GAME SCHEME CONFIGURATION
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    40
The script recognizes most game modifiers and settings, but changing the following game modifiers
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    41
will have no effect:
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    42
- Artillery
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    43
- Tag Team
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    44
- Shared ammo
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    45
- Per-hog ammo
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    46
- Place hogs
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    47
- Invulnerable
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    48
- Reset weapons
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    49
]]
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    50
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    51
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 5827
diff changeset
    52
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 5827
diff changeset
    53
HedgewarsScriptLoad("/Scripts/Tracker.lua")
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    54
HedgewarsScriptLoad("/Scripts/Params.lua")
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    55
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    56
local fMod = 1000000 -- use this for dev and .16+ games
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    57
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    58
local leftOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    59
local rightOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    60
local upOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    61
local downOn = false
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    62
local preciseOn = false
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    63
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    64
local wep = {}
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    65
local wepAmmo = {}
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    66
local wepCol = {}
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    67
local wepIndex = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    68
local wepCount = 0
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    69
local fGears = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    70
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    71
local mineSpawn
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    72
local barrelSpawn
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    73
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    74
local roundKills = 0
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    75
local barrelsEaten = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    76
local minesEaten = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    77
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    78
local moveTimer = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    79
local fireTimer = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    80
local TimeLeftCounter = 0
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    81
local TimeLeft = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    82
local stopMovement = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    83
local tumbleStarted = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    84
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
    85
local vTag = {}
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    86
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    87
local barrelSpawn = 2
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    88
local mineSpawn = 4
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    89
local initAmmoFlamer = 50
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    90
local initAmmoBarrel = 2
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    91
local initAmmoMine = 1
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    92
local placedMineTime = 1000
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    93
local bonusTime = 25
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    94
local bonusFlames = 800
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    95
local chanceAmmo = 30
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    96
local chanceTime = 50
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    97
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
    98
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    99
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   100
-- version 0.4
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   101
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   102
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   103
-- removed some old code/comments
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   104
-- removed both shell and mortar as the primary and secondary weapons
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   105
-- the primary weapon is now an explosive(barrel)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   106
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   107
-- added support for picking up barrels scattered about the map (backspace)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   108
-- added support for dragging around mines (enter toggles on/off)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   109
-- added support for primary fire being onAttackUp
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   110
-- added a trail to indicate when the player has 5s or less left to tumble
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   111
-- updated showmission to reflect changed controls and options
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   112
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   113
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   114
-- version 0.5
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   115
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   116
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   117
-- changed some of the user feedback
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   118
-- i can't remember??
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   119
-- substituted onAttackUp for onPrecise()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   120
-- brought in line with new velocity changes
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   121
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   122
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   123
-- version 0.6
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   124
------------------------
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   125
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   126
-- reduced starting "ammo"
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   127
-- randomly spawn new barrels/mines on new turn
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   128
-- updated user feedback
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   129
-- better locs and coloured addcaptions
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   130
-- added tag for turntime
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   131
-- removed tractor beam
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   132
-- added two new weapons and changed ammo handling
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   133
-- health crates now give tumbler time, and wep/utility give flamer ammo
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   134
-- explosives AND mines can be picked up to increase their relative ammo
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   135
-- replaced "no weapon" selected message that hw serves
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   136
-- modified crate frequencies a bit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   137
-- added some simple kill-based achievements, i think
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   138
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   139
------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   140
-- version 0.7
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   141
------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   142
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   143
-- a few code optimisations/performance tweaks
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   144
-- removed some deprecated code
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   145
-- fix a potential spawn bug
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   146
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   147
-- improved HUD (now shows ammo counts)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   148
-- improved user feedback (less generic messages)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   149
-- colour-coded addcaptions to match hud :)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   150
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   151
-- base tumbling time now equals scheme turntime
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   152
-- tumbling time extension is now based on the amount of health contained in crate
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   153
-- new mines per turn based on minesnum
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   154
-- new barrels per turn based on explosives
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   155
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   156
-- added 2 more achievements: barrel eater and mine eater (like kills, don't do anything atm)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   157
-- slightly increased grab distance for explosives/mines
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   158
-- slightly increased flamer velocity
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   159
-- slightly decreased flamer volume
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   160
-- added a flame vaporiser (based on number of flame gears?)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   161
-- give tumblers an extra 47 health on the start of their tumble to counter the grenade (exp)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   162
-- refocus camera on tumbler on newturn (not on crates, barrels etc)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   163
-- increase delay: yes, yes, eat your hearts out
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   164
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   165
-- commit log
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   166
-- Better HUD
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   167
-- Allow more user customization
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   168
-- Bugfix for new gear spawns
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   169
-- Performance tweaks
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   170
-- Variety of small gameplay changes
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   171
5825
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   172
------------------------
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   173
-- version 0.7.1
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   174
------------------------
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   175
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   176
-- redraw HUD on screen resolution change
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   177
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   178
------------------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   179
-- version 0.8.0
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   180
------------------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   181
-- Allow detailed configuration with script parameter (see above)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   182
-- Alternative weapon selection with slot keys
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   183
--- Slot 1: Barrel Launcher
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   184
--- Slot 2: Mine Deployer
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   185
--- Slot 3: Flamer
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   186
-- Add mine/barrel launch sounds
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   187
-- Improved ammo display
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   188
-- Denied sound + message when trying to fire empty ammo weapon
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   189
-- Slightly better mission description
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   190
--- The old hacks by (ab)using MinesNum, Explosives and HealthCaseAmount have been removed
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   191
-- Permanently disable some gameflags which currently won't work together with this script (see above)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   192
-- Show flamer ammo as fuel everywhere (no more percentage confusion)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   193
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   194
---------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   195
-- some other ideas/things
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   196
---------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   197
--[[
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   198
-- allow invulnerability mode (currently broken, thus disabled)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   199
-- better barrel/minespawn effects
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   200
-- separate grab distance for mines/barrels
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   201
-- bug: message color for remaining ammo does not change if two times the same message
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   202
   (but in different desired color) is shown in quick succession (i.e. "Out of ammo!" for all weapons)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   203
-- [probably not] make barrels always explode?
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   204
-- [probably not] persistent ammo?
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   205
-- [probably not] dont hurt tumblers and restore their health at turn end?
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   206
]]
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   207
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   208
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   209
----------------------------------------------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   210
----------------------------------------------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   211
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   212
local flames = {}
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   213
local fGearValues = {}
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   214
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   215
function runOnflames(func)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   216
    for k, gear in ipairs(flames) do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   217
        func(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   218
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   219
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   220
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   221
function trackFGear(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   222
    table.insert(flames, gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   223
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   224
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   225
function trackFGearDeletion(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   226
    fGearValues[gear] = nil
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   227
    for k, g in ipairs(flames) do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   228
        if g == gear then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   229
            table.remove(flames, k)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   230
            break
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   231
        end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   232
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   233
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   234
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   235
function getFGearValue(gear, key)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   236
    if fGearValues[gear] ~= nil then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   237
        return fGearValues[gear][key]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   238
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   239
    return nil
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   240
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   241
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   242
function setFGearValue(gear, key, value)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   243
    found = false
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   244
    for id, values in pairs(fGearValues) do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   245
        if id == gear then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   246
            values[key] = value
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   247
            found = true
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   248
        end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   249
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   250
    if not found then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   251
        fGearValues[gear] = { [key] = value }
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   252
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   253
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   254
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   255
function decreaseFGearValue(gear, key)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   256
    for id, values in pairs(fGearValues) do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   257
        if id == gear then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   258
            values[key] = values[key] - 1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   259
        end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   260
    end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   261
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   262
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   263
function HandleLife(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   264
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   265
	decreaseFGearValue(gear, "L")
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   266
	if getFGearValue(gear, "L") == 0 then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   267
		AddVisualGear(GetX(gear), GetY(gear), vgtSmoke, 0, false)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   268
		DeleteGear(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   269
	end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   270
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   271
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   272
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   273
----------------------------------------------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   274
----------------------------------------------------------------
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   275
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   276
function HideTags()
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   277
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   278
	for i = 0, 3 do
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   279
		SetVisualGearValues(vTag[i],0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   280
	end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   281
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   282
end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   283
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   284
function DrawTag(i)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   285
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   286
	zoomL = 1.3
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   287
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   288
	xOffset = 40
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   289
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   290
	if i == 0 then
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   291
		yOffset = 40
12062
3d03e9294633 Use yellow clock color in Space Invasion and Tumbler
Wuzzy <almikes@aol.com>
parents: 12053
diff changeset
   292
		tCol = 0xffee00ff
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   293
		tValue = TimeLeft
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   294
	elseif i == 1 then
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   295
		zoomL = 1.1
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   296
		yOffset = 70
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   297
		tCol = wepCol[0]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   298
		tValue = wepAmmo[0]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   299
	elseif i == 2 then
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   300
		zoomL = 1.1
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   301
		xOffset = 40 + 35
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   302
		yOffset = 70
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   303
		tCol = wepCol[1]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   304
		tValue = wepAmmo[1]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   305
	elseif i == 3 then
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   306
		zoomL = 1.1
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   307
		xOffset = 40 + 70
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   308
		yOffset = 70
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   309
		tCol = wepCol[2]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   310
		tValue = wepAmmo[2]
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   311
	end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   312
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   313
	DeleteVisualGear(vTag[i])
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   314
	vTag[i] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   315
	g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(vTag[i])
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   316
	SetVisualGearValues	(
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   317
				vTag[i], 		--id
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   318
				-(ScreenWidth/2) + xOffset,	--xoffset
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   319
				ScreenHeight - yOffset, --yoffset
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   320
				0, 			--dx
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   321
				0, 			--dy
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   322
				zoomL, 			--zoom
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   323
				1, 			--~= 0 means align to screen
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   324
				g7, 			--frameticks
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   325
				tValue, 		--value
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   326
				240000, 		--timer
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   327
				tCol		--GetClanColor( GetHogClan(CurrentHedgehog) )
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   328
				)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   329
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   330
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   331
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   332
function GetGearDistance(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   333
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   334
	g1X, g1Y = GetGearPosition(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   335
	g2X, g2Y = GetGearPosition(CurrentHedgehog)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   336
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   337
	q = g1X - g2X
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   338
	w = g1Y - g2Y
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   339
	return( (q*q) + (w*w) )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   340
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   341
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   342
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   343
-- add to your ammo ***WHEN YOU PUSH A KEY*** near them
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   344
-- yes that was my justification for a non generic method
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   345
function CheckProximityToExplosives(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   346
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   347
	if (GetGearDistance(gear) < 1400) then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   348
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   349
		if (GetGearType(gear) == gtExplosives) then
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   350
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   351
			wepAmmo[0] = wepAmmo[0] + 1
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   352
			PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   353
			DeleteGear(gear)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   354
			AddCaption(loc("+1 barrel!"), wepCol[0], capgrpAmmoinfo )
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   355
			DrawTag(1)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   356
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   357
			barrelsEaten = barrelsEaten + 1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   358
			if barrelsEaten == 5 then
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   359
				AddCaption(loc("Achievement obtained: Barrel Eater!"),0xffba00ff,capgrpMessage2)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   360
			end
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   361
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   362
		elseif (GetGearType(gear) == gtMine) then
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   363
			wepAmmo[1] = wepAmmo[1] + 1
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   364
			PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   365
			DeleteGear(gear)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   366
			AddCaption(loc("+1 mine!"), wepCol[1], capgrpAmmoinfo )
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   367
			DrawTag(2)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   368
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   369
			minesEaten = minesEaten + 1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   370
			if minesEaten == 5 then
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   371
				AddCaption(loc("Achievement obtained: Mine Eater!"),0xffba00ff,capgrpMessage2)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   372
			end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   373
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   374
		end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   375
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   376
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   377
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   378
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   379
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   380
-- check proximity on crates
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   381
function CheckProximity(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   382
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   383
	dist = GetGearDistance(gear)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   384
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   385
	if (dist < 1600) and (GetGearType(gear) == gtCase) then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   386
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   387
		if band(GetGearPos(gear), 0x4) ~= 0 then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   388
12062
3d03e9294633 Use yellow clock color in Space Invasion and Tumbler
Wuzzy <almikes@aol.com>
parents: 12053
diff changeset
   389
			AddCaption(string.format(loc("+%d seconds!"), bonusTime), 0xffee00ff, capgrpMessage2 )
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   390
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   391
			TimeLeft = TimeLeft + bonusTime
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   392
			DrawTag(0)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   393
			PlaySound(sndExtraTime)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   394
		elseif band(GetGearPos(gear), 0x1) ~= 0 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   395
			wepAmmo[2] = wepAmmo[2] + bonusFlames
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   396
			PlaySound(sndShotgunReload)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   397
			AddCaption(string.format(loc("+%d flamer fuel!"), bonusFlames), wepCol[2], capgrpAmmoinfo )
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   398
			DrawTag(3)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   399
		end
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   400
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   401
		DeleteGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   402
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   403
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   404
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   405
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   406
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   407
function shotsRemainingMessage()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   408
	local shotsMsg
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   409
	if wepAmmo[wepIndex] <= 0 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   410
		shotsMsg = loc("Out of ammo!")
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   411
	else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   412
		if wepIndex == 2 then
12052
144264948277 Change ammo display texts in Tumbler to avoid pluralization failures
Wuzzy <almikes@aol.com>
parents: 12051
diff changeset
   413
			shotsMsg = loc("Fuel: %d")
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   414
		else
12052
144264948277 Change ammo display texts in Tumbler to avoid pluralization failures
Wuzzy <almikes@aol.com>
parents: 12051
diff changeset
   415
			shotsMsg = loc("Ammo: %d")
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   416
		end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   417
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   418
	AddCaption(string.format(shotsMsg, wepAmmo[wepIndex]), wepCol[wepIndex],capgrpMessage2)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   419
end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   420
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   421
function ChangeWeapon(newIndex)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   422
	if newIndex == nil then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   423
		wepIndex = wepIndex + 1
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   424
		if wepIndex == wepCount then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   425
			wepIndex = 0
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   426
		end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   427
	else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   428
		wepIndex = newIndex
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   429
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   430
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   431
	local selText
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   432
	if wepIndex == 0 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   433
		selText = loc("Barrel Launcher selected!")
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   434
	elseif wepIndex == 1 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   435
		selText = loc("Mine Deployer selected!")
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   436
	else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   437
		selText = loc("Flamer selected!")
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   438
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   439
	AddCaption(selText, wepCol[wepIndex],capgrpAmmoinfo )
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   440
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   441
	shotsRemainingMessage()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   442
end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   443
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   444
---------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   445
-- Parse parameters
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   446
---------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   447
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   448
function parseNum(key, default, min, max)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   449
	local num = tonumber(params[key])
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   450
	if type(num) ~= "number" then 
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   451
		if default ~= nil then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   452
			return default
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   453
		else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   454
			return nil
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   455
		end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   456
	end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   457
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   458
	if min ~= nil then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   459
		num = math.max(min, num)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   460
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   461
	if max ~= nil then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   462
		num = math.min(max, num)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   463
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   464
	return num
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   465
end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   466
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   467
function onParameters()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   468
	parseParams()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   469
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   470
	barrelSpawn = parseNum("spawnbarrels", barrelSpawn, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   471
	mineSpawn = parseNum("spawnmines", mineSpawn, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   472
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   473
	initAmmoFlamer = parseNum("ammoflamer", initAmmoFlamer, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   474
	initAmmoBarrel = parseNum("ammobarrel", initAmmoBarrel, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   475
	initAmmoMine = parseNum("ammomine", initAmmoMine, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   476
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   477
	placedMineTime = parseNum("minetimeplaced", placedMineTime, 0, 5000)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   478
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   479
	bonusTime = parseNum("bonustime", bonusTime, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   480
	bonusFlames = parseNum("bonusflames", bonusFlames, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   481
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   482
	chanceAmmo = parseNum("chanceammo", chanceAmmo, 0, 100)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   483
	chanceTime = parseNum("chancetime", chanceTime, 0, 100)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   484
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   485
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   486
---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   487
-- action keys
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   488
---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   489
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   490
function onPrecise()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   491
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   492
	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   493
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   494
		if wepAmmo[wepIndex] <= 0 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   495
			PlaySound(sndDenied)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   496
			shotsRemainingMessage()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   497
		else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   498
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   499
			wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   500
			shotsRemainingMessage()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   501
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   502
			if wep[wepIndex] == loc("Barrel Launcher") then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   503
				morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtExplosives, 0, 0, 0, 1)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   504
				CopyPV(CurrentHedgehog, morte) -- new addition
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   505
				x,y = GetGearVelocity(morte)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   506
				x = x*2
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   507
				y = y*2
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   508
				SetGearVelocity(morte, x, y)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   509
				DrawTag(1)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   510
				PlaySound(sndThrowRelease)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   511
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   512
			elseif wep[wepIndex] == loc("Mine Deployer") then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   513
				morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtMine, 0, 0, 0, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   514
				SetTimer(morte, placedMineTime)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   515
				DrawTag(2)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   516
				PlaySound(sndThrowRelease)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   517
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   518
			end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   519
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   520
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   521
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   522
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   523
	preciseOn = true
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   524
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   525
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   526
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   527
function onPreciseUp()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   528
	preciseOn = false
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   529
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   530
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   531
onAttack = onPrecise
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   532
onAttackUp = onPreciseUp
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   533
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   534
function onHJump()
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   535
	-- pick up explosives/mines if nearby them
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   536
	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   537
		runOnGears(CheckProximityToExplosives)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   538
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   539
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   540
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   541
-------------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   542
-- Weapon selection
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   543
-------------------
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   544
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   545
function onLJump()
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   546
	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   547
		ChangeWeapon()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   548
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   549
end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   550
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   551
function onSlot(slot)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   552
	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   553
		if slot >= 0 and slot <= 2 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   554
			ChangeWeapon(slot)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   555
		end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   556
	end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   557
end
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   558
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   559
-----------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   560
-- movement keys
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   561
-----------------
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   562
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   563
function onLeft()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   564
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   565
		leftOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   566
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   567
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   568
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   569
function onRight()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   570
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   571
		rightOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   572
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   573
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   574
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   575
function onUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   576
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   577
		upOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   578
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   579
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   580
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   581
function onDown()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   582
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   583
		downOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   584
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   585
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   586
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   587
function onDownUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   588
	downOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   589
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   590
function onUpUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   591
	upOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   592
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   593
function onLeftUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   594
	leftOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   595
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   596
function onRightUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   597
	rightOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   598
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   599
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   600
--------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   601
-- other event handlers
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   602
--------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   603
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   604
function onGameInit()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   605
	CaseFreq = 0
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   606
	HealthCaseProb = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   607
	Delay = 1000
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   608
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   609
	for i = 0, 3 do
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   610
		vTag[0] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   611
	end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   612
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   613
	HideTags()
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   614
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   615
	wep[0] = loc("Barrel Launcher")
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   616
	wep[1] = loc("Mine Deployer")
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   617
	wep[2] = loc("Flamer")
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   618
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   619
	wepCol[0] = 0x78818eff
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   620
	wepCol[1] = 0xa12a77ff
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   621
	wepCol[2] = 0xf49318ff
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   622
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   623
	wepCount = 3
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   624
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   625
	DisableGameFlags(gfArtillery + gfSharedAmmo + gfPerHogAmmo + gfTagTeam + gfPlaceHog + gfInvulnerable)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   626
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   627
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   628
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   629
function onGameStart()
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   630
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   631
	local clockStr
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   632
	local timeStr
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   633
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   634
	if chanceTime > 0 then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   635
		clockStr = loc("Utility crates extend your time.") .. "|"
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   636
		timeStr = string.format(loc("Time extension: %ds"), bonusTime) .. "|"
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   637
	else
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   638
		clockStr = ""
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   639
		timeStr = ""
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   640
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   641
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   642
	ShowMission	(
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   643
			"Tumbler",
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   644
			loc("A Hedgewars mini-game"),
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   645
			loc("Fly around and hurl explosives to your enemies.") .."|"..
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   646
			loc("Eliminate the enemy hogs to win.") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   647
			" " .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   648
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   649
			string.format(loc("New mines per turn: %d"), mineSpawn) .. "|" ..
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   650
			string.format(loc("New barrels per turn: %d"), barrelSpawn) .. "|" ..
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   651
			timeStr ..
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   652
			" " .. "|" ..
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   653
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   654
			loc("Movement: [Up], [Down], [Left], [Right]") .. "|" ..
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   655
			loc("Fire: [Precise]") .. "|" ..
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   656
			loc("Change weapon: [Long jump] or [Slot 1]-[Slot 3]") .. "|" ..
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   657
			loc("Grab mines/barrels: [High jump]") .. "|" ..
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   658
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   659
			" " .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   660
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   661
			clockStr ..
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   662
			loc("Ammo is reset at the end of your turn.") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   663
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   664
			"", 4, 4000
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   665
			)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   666
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   667
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   668
5825
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   669
function onScreenResize()
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   670
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   671
	-- redraw Tags so that their screen locations are updated
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   672
	if (CurrentHedgehog ~= nil) and (tumbleStarted == true) then
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   673
		for i = 0, 3 do
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   674
			DrawTag(i)
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   675
		end
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   676
	end
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   677
a6eab1b7c00d Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents: 5720
diff changeset
   678
end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   679
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   680
function onAmmoStoreInit()
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   681
	-- Remove all conventional weapons
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   682
	for a=0, 56 do
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   683
		SetAmmo(a, 0, 0, 0, 0)
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   684
	end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   685
end
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   686
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   687
function onNewTurn()
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   688
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   689
	stopMovement = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   690
	tumbleStarted = false
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   691
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   692
	-- randomly create new barrels mines on the map every turn (can be disabled by setting mine/barrels to 0 in scheme)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   693
	for i = 0, barrelSpawn-1 do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   694
		gear = AddGear(100, 100, gtExplosives, 0, 0, 0, 0)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   695
		SetHealth(gear, 100)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   696
		if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   697
			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   698
		end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   699
	end
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   700
	for i = 0, mineSpawn-1 do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   701
		gear = AddGear(100, 100, gtMine, 0, 0, 0, 0)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   702
		if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   703
			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   704
		end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   705
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   706
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   707
	-- randomly spawn time extension crates / flamer fuel on the map
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   708
	r = GetRandom(100)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   709
	if r > 100-chanceTime then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   710
		gear = SpawnFakeUtilityCrate(0, 0, false, false)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   711
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   712
	r = GetRandom(100)
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   713
	if r > 100-chanceAmmo then
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   714
		gear = SpawnFakeAmmoCrate(0, 0, false, false)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   715
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   716
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   717
	HideTags()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   718
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   719
	--reset ammo counts
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   720
	wepAmmo[0] = 2
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   721
	wepAmmo[1] = 1
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   722
	wepAmmo[2] = 50 -- 50000 -- 50
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   723
	wepIndex = 2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   724
	ChangeWeapon()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   725
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   726
	roundKills = 0
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   727
	barrelsEaten = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   728
	minesEaten = 0
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   729
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   730
	FollowGear(CurrentHedgehog)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   731
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   732
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   733
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   734
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   735
function DisableTumbler()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   736
	stopMovement = true
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   737
	upOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   738
	down = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   739
	leftOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   740
	rightOn = false
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   741
	HideTags()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   742
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   743
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   744
function onGameTick()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   745
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   746
	-- start the player tumbling with a boom once their turn has actually begun
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   747
	if tumbleStarted == false then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   748
		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   749
			tumbleStarted = true
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   750
			TimeLeft = (TurnTime/1000)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   751
			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   752
			SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog) + 47) -- new
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   753
			for i = 0, 3 do
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   754
				DrawTag(i)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5825
diff changeset
   755
			end
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   756
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   757
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   758
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   759
	if (CurrentHedgehog ~= nil) and (tumbleStarted == true) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   760
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   761
		runOnGears(CheckProximity) -- crates
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   762
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   763
		-- Calculate and display turn time
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   764
		TimeLeftCounter = TimeLeftCounter + 1
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   765
		if TimeLeftCounter == 1000 then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   766
			TimeLeftCounter = 0
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   767
			TimeLeft = TimeLeft - 1
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   768
12053
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   769
			-- Countdown sounds
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   770
			if TimeLeft == 5 then
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   771
				PlaySound(sndHurry, CurrentHedgehog)
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   772
			elseif TimeLeft <= 4 and TimeLeft >= 1 then
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   773
				PlaySound(_G["sndCountdown"..TimeLeft])
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   774
			end
281a4f33b08f Add countdown sounds to Tumbler
Wuzzy <almikes@aol.com>
parents: 12052
diff changeset
   775
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   776
			if TimeLeft >= 0 then
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   777
				DrawTag(0)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   778
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   779
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   780
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   781
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   782
		if TimeLeft == 0 then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   783
			DisableTumbler()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   784
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   785
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   786
		-- handle movement based on IO
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   787
		moveTimer = moveTimer + 1
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   788
		if moveTimer == 100 then -- 100
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   789
			moveTimer = 0
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   790
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   791
			runOnflames(HandleLife)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   792
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   793
			---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   794
			-- new trail code
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   795
			---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   796
			-- the trail lets you know you have 5s left to pilot, akin to birdy feathers
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   797
			if (TimeLeft <= 5) and (TimeLeft > 0) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   798
				tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   799
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   800
				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   801
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   802
			--------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   803
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   804
			dx, dy = GetGearVelocity(CurrentHedgehog)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   805
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   806
			dxlimit = 0.4*fMod
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   807
			dylimit = 0.4*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   808
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   809
			if dx > dxlimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   810
				dx = dxlimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   811
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   812
			if dy > dylimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   813
				dy = dylimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   814
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   815
			if dx < -dxlimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   816
				dx = -dxlimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   817
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   818
			if dy < -dylimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   819
				dy = -dylimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   820
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   821
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   822
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   823
			if leftOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   824
				dx = dx - 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   825
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   826
			if rightOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   827
				dx = dx + 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   828
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   829
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   830
			if upOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   831
				dy = dy - 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   832
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   833
			if downOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   834
				dy = dy + 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   835
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   836
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   837
			SetGearVelocity(CurrentHedgehog, dx, dy)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   838
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   839
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   840
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   841
		--
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   842
		--flamer
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   843
		--
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   844
		fireTimer = fireTimer + 1
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   845
		if fireTimer == 6 then	-- 5 --10
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   846
			fireTimer = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   847
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   848
			if (wep[wepIndex] == loc("Flamer") ) and (preciseOn == true) and (wepAmmo[wepIndex] > 0) and (stopMovement == false) and (tumbleStarted == true) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   849
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   850
				wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
12051
05a968518a56 Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents: 8043
diff changeset
   851
				shotsRemainingMessage()
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   852
				DrawTag(3)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   853
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   854
				dx, dy = GetGearVelocity(CurrentHedgehog)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   855
				shell = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtFlame, 0, 0, 0, 0)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   856
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   857
				xdev = 1 + GetRandom(25)	--15
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   858
				xdev = xdev / 100
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   859
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   860
				r = GetRandom(2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   861
				if r == 1 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   862
					xdev = xdev*-1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   863
				end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   864
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   865
				ydev = 1 + GetRandom(25)	--15
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   866
				ydev = ydev / 100
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   867
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   868
				r = GetRandom(2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   869
				if r == 1 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   870
					ydev = ydev*-1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   871
				end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   872
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   873
				--*13	--8	*-4
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   874
				SetGearVelocity(shell, (dx*4.5)+(xdev*fMod), (dy*4.5)+(ydev*fMod))	--10
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   875
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   876
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   877
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   878
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   879
		--
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   880
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   881
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   882
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   883
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   884
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   885
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   886
function isATrackedGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   887
	if 	(GetGearType(gear) == gtExplosives) or
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   888
		(GetGearType(gear) == gtMine) or
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   889
		(GetGearType(gear) == gtCase)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   890
	then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   891
		return(true)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   892
	else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   893
		return(false)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   894
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   895
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   896
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   897
function onGearAdd(gear)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   898
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   899
	if GetGearType(gear) == gtFlame then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   900
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   901
		trackFGear(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   902
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   903
		fGears = fGears +1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   904
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   905
		if fGears < 80 then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   906
			setFGearValue(gear,"L",30)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   907
		else
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   908
			setFGearValue(gear,"L",5) --3
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   909
		end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   910
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   911
	elseif isATrackedGear(gear) then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   912
		trackGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   913
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   914
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   915
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   916
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   917
function onGearDelete(gear)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   918
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   919
	if GetGearType(gear) == gtFlame then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   920
		trackFGearDeletion(gear)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   921
		fGears = fGears -1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   922
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   923
	elseif isATrackedGear(gear) then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   924
		trackDeletion(gear)
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   925
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   926
	-- achievements? prototype
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   927
	elseif GetGearType(gear) == gtHedgehog then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   928
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   929
		if GetHogTeamName(gear) ~= GetHogTeamName(CurrentHedgehog) then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   930
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   931
			roundKills = roundKills + 1
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   932
			if roundKills == 2 then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   933
				AddCaption(loc("Double Kill!"),0xffba00ff,capgrpMessage2)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   934
			elseif roundKills == 3 then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   935
				AddCaption(loc("Killing spree!"),0xffba00ff,capgrpMessage2)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   936
			elseif roundKills >= 4 then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   937
				AddCaption(loc("Unstoppable!"),0xffba00ff,capgrpMessage2)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   938
			end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   939
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   940
		elseif gear == CurrentHedgehog then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   941
			DisableTumbler()
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   942
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   943
		elseif gear ~= CurrentHedgehog then
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   944
			AddCaption(loc("Friendly Fire!"),0xffba00ff,capgrpMessage2)
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   945
		end
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   946
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   947
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   948
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   949
	if CurrentHedgehog ~= nil then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   950
		FollowGear(CurrentHedgehog)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   951
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   952
5720
a962d0823f49 onHogAttack hook. Might reposition this later.
mikade
parents: 5598
diff changeset
   953
end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   954
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   955