share/hedgewars/Data/Scripts/Multiplayer/Tumbler.lua
author mikade
Fri, 19 Aug 2011 06:08:06 +0200
changeset 5598 265429f7ba85
parent 5325 261b79ba22b1
child 5720 a962d0823f49
permissions -rw-r--r--
- Updates to Tumbler gameplay mode [may still need a lil work] - New User Mission. Is this one possible?
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
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     3
-- v.0.6
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
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
     6
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     7
loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
     8
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
     9
--local fMod = 1	--.15
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    10
local fMod = 1000000 -- use this for dev and .16+ games
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    11
local moveTimer = 0
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    12
local leftOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    13
local rightOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    14
local upOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    15
local downOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    16
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    17
local preciseOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    18
--local HJumpOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    19
--local LJumpON = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    20
local fireTimer = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    21
local scoreTag = nil
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    22
local wep = {}
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    23
local wepAmmo = {}
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    24
local wepIndex = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    25
local wepCount = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    26
local roundKills = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    27
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    28
local TimeLeftCounter = 0
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    29
local TimeLeft = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    30
local stopMovement = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    31
local tumbleStarted = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    32
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    33
local beam = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    34
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    35
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    36
-- version 0.4
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    37
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    38
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    39
-- removed some old code/comments
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    40
-- 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
    41
-- 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
    42
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    43
-- 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
    44
-- 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
    45
-- added support for primary fire being onAttackUp
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    46
-- 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
    47
-- 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
    48
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    49
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    50
-- version 0.5
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    51
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    52
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    53
-- changed some of the user feedback
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    54
-- i can't remember??
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    55
-- substituted onAttackUp for onPrecise()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    56
-- brought in line with new velocity changes
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    57
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    58
------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    59
-- version 0.6
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    60
------------------------
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    61
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    62
-- reduced starting "ammo"
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    63
-- 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
    64
-- updated user feedback
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    65
-- better locs and coloured addcaptions
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    66
-- added tag for turntime
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    67
-- removed tractor beam
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    68
-- 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
    69
-- 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
    70
-- 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
    71
-- 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
    72
-- modified crate frequencies a bit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    73
-- added some simple kill-based achievements, i think
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    74
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    75
---------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    76
-- some other ideas/things
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    77
---------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    78
--[[
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    79
-- fix "ammo extended" message to be non-generic
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    80
-- fix flamer "shots remaining" message on start or choose a standard versus %
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    81
-- add more sounds
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    82
-- make barrels always explode?
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    83
-- persistent ammo?
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    84
-- allow custom turntime?
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    85
-- dont hurt tumblers and restore their health at turn end?
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    86
]]
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    87
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    88
function DrawTags()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    89
	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    90
	zoomL = 1.3
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
    91
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    92
	DeleteVisualGear(scoreTag)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    93
	scoreTag = AddVisualGear(0, 0, vgtHealthTag, 0, false)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    94
	g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(scoreTag)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    95
	SetVisualGearValues	(	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    96
				scoreTag, 		--id
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    97
				-(ScreenWidth/2) + 45,	--xoffset
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    98
				ScreenHeight - 50, 	--yoffset
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
    99
				0, 			--dx
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   100
				0, 			--dy
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   101
				zoomL, 			--zoom
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   102
				1, 			--~= 0 means align to screen
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   103
				g7, 			--frameticks
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   104
				TimeLeft, 		--value
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   105
				240000, 		--timer
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   106
				0xffba00ff		--GetClanColor( GetHogClan(CurrentHedgehog) )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   107
				)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   108
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   109
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   110
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   111
function GetGearDistance(gear)
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
	g1X, g1Y = GetGearPosition(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   114
	g2X, g2Y = GetGearPosition(CurrentHedgehog)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   115
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   116
	q = g1X - g2X
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   117
	w = g1Y - g2Y
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   118
	return( (q*q) + (w*w) )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   119
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   120
end
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
-- 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
   123
-- 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
   124
function CheckProximityToExplosives(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   125
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   126
	if (GetGearDistance(gear) < 1300) then 
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   127
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   128
		if (GetGearType(gear) == gtExplosives) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   129
		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   130
			wepAmmo[0] = wepAmmo[0] + 1			
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   131
			PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   132
			DeleteGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   133
			AddCaption(loc("Ammo extended!"))
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   134
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   135
		elseif (GetGearType(gear) == gtMine) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   136
			wepAmmo[2] = wepAmmo[2] + 1			
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   137
			PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   138
			DeleteGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   139
			AddCaption(loc("Ammo extended!"))
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   140
		end 
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   141
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   142
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   143
	else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   144
		--AddCaption("There is nothing here...")
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   145
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   146
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   147
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   148
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   149
-- check proximity on crates
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   150
function CheckProximity(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   151
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   152
	dist = GetGearDistance(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   153
				--15000
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   154
	if ((dist < 15000) and (beam == true)) and
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   155
	( (GetGearType(gear) == gtMine) or (GetGearType(gear) == gtExplosives) ) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   156
	--	ndx, ndy = GetGearVelocity(CurrentHedgehog)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   157
	--	SetGearVelocity(gear, ndx, ndy)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   158
		--AddCaption("hello???")
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   159
	elseif (dist < 1600) and (GetGearType(gear) == gtCase) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   160
	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   161
		if GetHealth(gear) > 0 then		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   162
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   163
			AddCaption(loc("Tumbling Time Extended!"))
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   164
			TimeLeft = TimeLeft + 5 --5s
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   165
			DrawTags()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   166
			--PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   167
		else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   168
			wepAmmo[1] = wepAmmo[1] + 800	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   169
			PlaySound(sndShotgunReload)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   170
			AddCaption(loc("Ammo extended!"))
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   171
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   172
		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   173
		DeleteGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   174
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   175
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   176
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   177
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   178
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   179
--[[function ProjectileTrack(gear)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   180
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   181
	if (GetGearType(gear) == gtMine) or (GetGearType(gear) == gtExplosives) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   182
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   183
		dist = GetGearDistance(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   184
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   185
		alt = 1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   186
		if (dist < 30000) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   187
			alt = -1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   188
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   189
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   190
		if (dist < 60000)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   191
		--and (dist > 16000)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   192
		then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   193
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   194
			--if (GetGearType(gear) == gtShell) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   195
				turningSpeed = 0.1*fMod*alt
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   196
			--end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   197
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   198
			dx, dy = GetGearVelocity(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   199
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   200
			if GetX(gear) > GetX(CurrentHedgehog) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   201
				dx = dx - turningSpeed
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   202
			else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   203
				dx = dx + turningSpeed
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   204
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   205
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   206
			if GetY(gear) > GetY(CurrentHedgehog) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   207
				dy = dy - turningSpeed
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   208
			else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   209
				dy = dy + turningSpeed
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   210
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   211
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   212
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   213
			if (GetGearType(gear) == gtShell) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   214
				dxlimit = 0.4*fMod
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   215
				dylimit = 0.4*fMod
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   216
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   217
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   218
			if dx > dxlimit then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   219
				dx = dxlimit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   220
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   221
			if dy > dylimit then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   222
				dy = dylimit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   223
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   224
			if dx < -dxlimit then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   225
				dx = -dxlimit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   226
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   227
			if dy < -dylimit then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   228
				dy = -dylimit
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   229
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   230
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   231
			SetGearVelocity(gear, dx, dy)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   232
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   233
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   234
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   235
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   236
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   237
end]]
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   238
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   239
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   240
function ChangeWeapon()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   241
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   242
	--new
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   243
	wepIndex = wepIndex + 1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   244
	if wepIndex == wepCount then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   245
		wepIndex = 0	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   246
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   247
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   248
	AddCaption(wep[wepIndex] .. " " .. loc("selected!"), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpAmmoinfo )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   249
	AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   250
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   251
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   252
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   253
---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   254
-- action keys
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   255
---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   256
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   257
function onPrecise()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   258
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   259
	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) and (wepAmmo[wepIndex] > 0) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   260
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   261
		wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   262
		AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   263
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   264
		if wep[wepIndex] == loc("Barrel Launcher") then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   265
			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtExplosives, 0, 0, 0, 1)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   266
			CopyPV(CurrentHedgehog, morte) -- new addition
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   267
			x,y = GetGearVelocity(morte)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   268
			x = x*2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   269
			y = y*2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   270
			SetGearVelocity(morte, x, y)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   271
		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   272
		elseif wep[wepIndex] == loc("Mine Deployer") then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   273
			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtMine, 0, 0, 0, 0)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   274
			SetTimer(morte, 1000)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   275
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   276
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   277
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   278
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   279
	preciseOn = true
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   280
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   281
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   282
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   283
function onPreciseUp()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   284
	preciseOn = false
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   285
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   286
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   287
function onHJump()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   288
	-- pick up explosives if nearby them
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   289
	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
   290
		runOnGears(CheckProximityToExplosives)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   291
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   292
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   293
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   294
function onLJump()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   295
	-- for attracting mines and explosives if the beam is on
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   296
	--[[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
   297
		if beam == false then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   298
			beam = true
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   299
			AddCaption(loc("Mine-attractor on!"))
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   300
		else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   301
			beam = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   302
			AddCaption(loc("Mine-attractor off!"))
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   303
		end
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   304
	end]]
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   305
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   306
	ChangeWeapon()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   307
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   308
end
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   309
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   310
-----------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   311
-- movement keys
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   312
-----------------
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   313
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   314
function onLeft()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   315
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   316
		leftOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   317
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   318
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   319
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   320
function onRight()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   321
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   322
		rightOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   323
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   324
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   325
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   326
function onUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   327
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   328
		upOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   329
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   330
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   331
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   332
function onDown()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   333
	if (CurrentHedgehog ~= nil) and (stopMovement == false) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   334
		downOn = true
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   335
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   336
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   337
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   338
function onDownUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   339
	downOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   340
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   341
function onUpUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   342
	upOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   343
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   344
function onLeftUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   345
	leftOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   346
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   347
function onRightUp()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   348
	rightOn = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   349
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   350
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   351
--------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   352
-- other event handlers
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   353
--------------------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   354
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   355
function onGameInit()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   356
	--Theme = "Hell"
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   357
	CaseFreq = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   358
	HealthCaseProb = 0 
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   359
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   360
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   361
function onGameStart()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   362
	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   363
	ShowMission	(
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   364
			"TUMBLER",
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   365
			loc("a Hedgewars mini-game"),
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   366
			loc("Eliminate the enemy hogs to win.") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   367
			" " .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   368
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   369
			--loc("Round Limit") .. ": " .. roundLimit .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   370
			--loc("Turn Time") .. ": " .. (TurnTime/1000) .. loc("sec") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   371
			--" " .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   372
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   373
			loc("Movement: [Up], [Down], [Left], [Right]") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   374
			loc("Fire") .. ": " .. loc("[Left Shift]") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   375
			loc("Change Weapon") .. ": " .. loc("[Enter]") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   376
			loc("Grab Mines/Explosives") .. ": " .. loc("[Backspace]") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   377
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   378
			" " .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   379
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   380
			loc("Health crates extend your time.") .. "|" ..
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   381
			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
   382
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   383
			"", 4, 4000
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   384
			)	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   385
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   386
	scoreTag = AddVisualGear(0, 0, vgtHealthTag, 0, false)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   387
	--DrawTags()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   388
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   389
	SetVisualGearValues(scoreTag,0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   390
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   391
	wep[0] = loc("Barrel Launcher")
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   392
	wep[1] = loc("Flamer")
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   393
	wep[2] = loc("Mine Deployer")
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   394
	wepCount = 3
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   395
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   396
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   397
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   398
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   399
function onNewTurn()
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   400
	
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   401
	stopMovement = false
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   402
	tumbleStarted = false
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   403
	beam = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   404
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   405
	-- randomly create 2 new barrels and 3 mines on the map every turn
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   406
	for i = 0, 1 do
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   407
		gear = AddGear(0, 0, gtExplosives, 0, 0, 0, 0)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   408
		SetHealth(gear, 100)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   409
		FindPlace(gear, false, 0, LAND_WIDTH)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   410
		tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   411
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   412
	for i = 0, 2 do
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   413
		gear = AddGear(0, 0, gtMine, 0, 0, 0, 0)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   414
		FindPlace(gear, false, 0, LAND_WIDTH)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   415
		tempE = AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   416
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   417
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   418
	r = GetRandom(100)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   419
	if r > 50 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   420
		SpawnHealthCrate(0, 0)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   421
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   422
	r = GetRandom(100)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   423
	if r > 70 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   424
		SpawnAmmoCrate(0, 0, amSkip)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   425
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   426
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   427
	--DrawTags()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   428
	SetVisualGearValues(scoreTag,0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   429
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   430
	--reset ammo counts
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   431
	wepAmmo[0] = 2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   432
	wepAmmo[1] = 50
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   433
	wepAmmo[2] = 1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   434
	wepIndex = 2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   435
	ChangeWeapon()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   436
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   437
	roundKills = 0
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   438
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   439
end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   440
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   441
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   442
function DisableTumbler()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   443
	stopMovement = true
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   444
	beam = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   445
	upOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   446
	down = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   447
	leftOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   448
	rightOn = false
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   449
	SetVisualGearValues(scoreTag,0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   450
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   451
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   452
function onGameTick()
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   453
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   454
	-- 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
   455
	if tumbleStarted == false then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   456
		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   457
			--AddCaption(loc("Good to go!"))
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   458
			tumbleStarted = true
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   459
			TimeLeft = 30
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   460
			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   461
			DrawTags()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   462
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   463
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   464
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   465
	if (CurrentHedgehog ~= nil) and (tumbleStarted == true) then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   466
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   467
		--AddCaption(GetX(CurrentHedgehog) .. ";" .. GetY(CurrentHedgehog) )
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   468
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   469
		runOnGears(CheckProximity) -- crates and mines
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   470
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   471
		--if beam == true then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   472
		--	runOnGears(ProjectileTrack)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   473
		--end
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   474
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   475
		-- Calculate and display turn time
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   476
		TimeLeftCounter = TimeLeftCounter + 1
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   477
		if TimeLeftCounter == 1000 then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   478
			TimeLeftCounter = 0
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   479
			TimeLeft = TimeLeft - 1
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   480
		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   481
			
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   482
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   483
			if TimeLeft >= 0 then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   484
				--AddCaption(TimeLeft)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   485
				DrawTags()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   486
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   487
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   488
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   489
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   490
		if TimeLeft == 0 then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   491
			DisableTumbler()
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   492
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   493
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   494
		-- handle movement based on IO
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   495
		moveTimer = moveTimer + 1
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   496
		if moveTimer == 100 then -- 100
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   497
			moveTimer = 0
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   498
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   499
			---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   500
			-- new trail code
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   501
			---------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   502
			-- 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
   503
			if (TimeLeft <= 5) and (TimeLeft > 0) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   504
				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
   505
				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
   506
				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
   507
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   508
			--------------
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   509
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   510
			dx, dy = GetGearVelocity(CurrentHedgehog)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   511
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   512
			dxlimit = 0.4*fMod
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   513
			dylimit = 0.4*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   514
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   515
			if dx > dxlimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   516
				dx = dxlimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   517
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   518
			if dy > dylimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   519
				dy = dylimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   520
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   521
			if dx < -dxlimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   522
				dx = -dxlimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   523
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   524
			if dy < -dylimit then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   525
				dy = -dylimit
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   526
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   527
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   528
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   529
			if leftOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   530
				dx = dx - 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   531
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   532
			if rightOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   533
				dx = dx + 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   534
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   535
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   536
			if upOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   537
				dy = dy - 0.1*fMod
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
			if downOn == true then
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   540
				dy = dy + 0.1*fMod
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   541
			end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   542
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   543
		
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   544
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   545
			SetGearVelocity(CurrentHedgehog, dx, dy)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   546
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   547
		end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   548
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   549
		--
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   550
		--flamer
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   551
		--
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   552
		fireTimer = fireTimer + 1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   553
		if fireTimer == 5 then	-- 5 --10
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   554
			fireTimer = 0
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   555
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   556
			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
   557
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   558
				wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   559
				AddCaption(	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   560
						loc("Flamer") .. ": " .. 
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   561
						(wepAmmo[wepIndex]/800*100) - (wepAmmo[wepIndex]/800*100)%2 .. "%", 
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   562
						GetClanColor(GetHogClan(CurrentHedgehog)),
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   563
						capgrpMessage2
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   564
						)	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   565
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   566
				dx, dy = GetGearVelocity(CurrentHedgehog)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   567
				shell = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtFlame, 0, 0, 0, 0)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   568
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   569
				xdev = 1 + GetRandom(25)	--15
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   570
				xdev = xdev / 100
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   571
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   572
				r = GetRandom(2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   573
				if r == 1 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   574
					xdev = xdev*-1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   575
				end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   576
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   577
				ydev = 1 + GetRandom(25)	--15
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   578
				ydev = ydev / 100
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   579
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   580
				r = GetRandom(2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   581
				if r == 1 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   582
					ydev = ydev*-1
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   583
				end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   584
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   585
				--*13	--8
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   586
				SetGearVelocity(shell, (dx*4)+(xdev*fMod), (dy*4)+(ydev*fMod))	--10
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   587
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   588
			end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   589
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   590
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   591
		--
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   592
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   593
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   594
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
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   597
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
function isATrackedGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   601
	if 	(GetGearType(gear) == gtExplosives) or
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   602
		(GetGearType(gear) == gtMine) or
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   603
		(GetGearType(gear) == gtShell) or	-- new -- gtBall
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   604
		(GetGearType(gear) == gtCase)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   605
	then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   606
		return(true)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   607
	else
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   608
		return(false)
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   609
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   610
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   611
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   612
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   613
--[[function onGearDamage(gear, damage)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   614
	if gear == CurrentHedgehog then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   615
		-- You are now tumbling
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   616
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   617
end]]
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   618
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   619
function onGearAdd(gear)
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   620
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   621
	if isATrackedGear(gear) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   622
		trackGear(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   623
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   624
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   625
	--if GetGearType(gear) == gtBall then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   626
	--	SetTimer(gear, 15000)
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
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   629
end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   630
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   631
function onGearDelete(gear)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   632
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   633
	if isATrackedGear(gear) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   634
		trackDeletion(gear)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   635
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   636
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   637
	if CurrentHedgehog ~= nil then
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   638
		FollowGear(CurrentHedgehog)
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   639
	end
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   640
5598
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   641
	if gear == CurrentHedgehog then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   642
		DisableTumbler()
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   643
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   644
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   645
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   646
	-- achievements? prototype
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   647
	if GetGearType(gear) == gtHedgehog then	
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   648
		if GetHogTeamName(gear) ~= GetHogTeamName(CurrentHedgehog) then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   649
						
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   650
			roundKills = roundKills + 1 		
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   651
			if roundKills == 2 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   652
				AddCaption(loc("Double Kill!"),0xffba00ff,capgrpMessage2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   653
			elseif roundKills == 3 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   654
				AddCaption(loc("Killing spree!"),0xffba00ff,capgrpMessage2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   655
			elseif roundKills >= 4 then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   656
				AddCaption(loc("Unstoppable!"),0xffba00ff,capgrpMessage2)			
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   657
			end		
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
		elseif gear ~= CurrentHedgehog then
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   660
			AddCaption(loc("Friendly Fire!"),0xffba00ff,capgrpMessage2)
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   661
		end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   662
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   663
	end
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   664
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   665
265429f7ba85 - Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents: 5325
diff changeset
   666
4872
6b2fb9f0054a Two new gameplay modes: Tumbler and Racer.
mikade
parents:
diff changeset
   667
end