author | sheepluva |
Sat, 07 Dec 2019 16:18:20 +0100 | |
branch | hedgeroid |
changeset 15517 | 45d6806548e9 |
parent 15074 | e16f906224fd |
permissions | -rw-r--r-- |
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 |
12056
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 |
|
12056
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 | 52 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
53 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
12056
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 | 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 | 57 |
|
4872 | 58 |
local leftOn = false |
59 |
local rightOn = false |
|
60 |
local upOn = false |
|
61 |
local downOn = false |
|
5720 | 62 |
local preciseOn = false |
4872 | 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 | 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 | 69 |
local fGears = 0 |
70 |
||
71 |
local mineSpawn |
|
72 |
local barrelSpawn |
|
73 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
74 |
local roundKills = 0 |
4872 | 75 |
|
5720 | 76 |
local moveTimer = 0 |
77 |
local fireTimer = 0 |
|
4872 | 78 |
local TimeLeftCounter = 0 |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
79 |
local TimeLeft = 0 |
4872 | 80 |
local stopMovement = false |
81 |
local tumbleStarted = false |
|
82 |
||
5720 | 83 |
local vTag = {} |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
84 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
85 |
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
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
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
|
90 |
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
|
91 |
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
|
92 |
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
|
93 |
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
|
94 |
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
|
95 |
|
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 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
97 |
------------------------ |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
98 |
-- version 0.4 |
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 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
101 |
-- removed some old code/comments |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
102 |
-- 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
|
103 |
-- 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
|
104 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
105 |
-- 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
|
106 |
-- 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
|
107 |
-- added support for primary fire being onAttackUp |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
108 |
-- 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
|
109 |
-- 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
|
110 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
111 |
------------------------ |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
112 |
-- version 0.5 |
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 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
115 |
-- changed some of the user feedback |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
116 |
-- i can't remember?? |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
117 |
-- substituted onAttackUp for onPrecise() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
118 |
-- brought in line with new velocity changes |
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 |
------------------------ |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
121 |
-- version 0.6 |
4872 | 122 |
------------------------ |
123 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
124 |
-- reduced starting "ammo" |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
125 |
-- 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
|
126 |
-- updated user feedback |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
127 |
-- better locs and coloured addcaptions |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
128 |
-- added tag for turntime |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
129 |
-- removed tractor beam |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
130 |
-- 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
|
131 |
-- 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
|
132 |
-- 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
|
133 |
-- 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
|
134 |
-- modified crate frequencies a bit |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
135 |
-- added some simple kill-based achievements, i think |
4872 | 136 |
|
5720 | 137 |
------------------------ |
138 |
-- version 0.7 |
|
139 |
------------------------ |
|
140 |
||
141 |
-- a few code optimisations/performance tweaks |
|
142 |
-- removed some deprecated code |
|
143 |
-- fix a potential spawn bug |
|
144 |
||
145 |
-- improved HUD (now shows ammo counts) |
|
146 |
-- improved user feedback (less generic messages) |
|
147 |
-- colour-coded addcaptions to match hud :) |
|
148 |
||
149 |
-- base tumbling time now equals scheme turntime |
|
150 |
-- tumbling time extension is now based on the amount of health contained in crate |
|
151 |
-- new mines per turn based on minesnum |
|
152 |
-- new barrels per turn based on explosives |
|
153 |
||
154 |
-- added 2 more achievements: barrel eater and mine eater (like kills, don't do anything atm) |
|
155 |
-- slightly increased grab distance for explosives/mines |
|
156 |
-- slightly increased flamer velocity |
|
157 |
-- slightly decreased flamer volume |
|
158 |
-- added a flame vaporiser (based on number of flame gears?) |
|
159 |
-- give tumblers an extra 47 health on the start of their tumble to counter the grenade (exp) |
|
160 |
-- refocus camera on tumbler on newturn (not on crates, barrels etc) |
|
161 |
-- increase delay: yes, yes, eat your hearts out |
|
162 |
||
163 |
-- commit log |
|
164 |
-- Better HUD |
|
165 |
-- Allow more user customization |
|
166 |
-- Bugfix for new gear spawns |
|
167 |
-- Performance tweaks |
|
168 |
-- Variety of small gameplay changes |
|
169 |
||
5825
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
170 |
------------------------ |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
171 |
-- version 0.7.1 |
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 |
|
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
174 |
-- redraw HUD on screen resolution change |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
175 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
176 |
------------------------ |
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
177 |
-- 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
|
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 |
-- 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
|
180 |
-- 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
|
181 |
--- 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
|
182 |
--- 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
|
183 |
--- 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
|
184 |
-- 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
|
185 |
-- 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
|
186 |
-- 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
|
187 |
-- 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
|
188 |
--- 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
|
189 |
-- 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
|
190 |
-- 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
|
191 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
192 |
--------------------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
193 |
-- some other ideas/things |
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 |
--[[ |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
196 |
-- allow invulnerability mode (currently broken, thus disabled) |
5720 | 197 |
-- better barrel/minespawn effects |
198 |
-- separate grab distance for mines/barrels |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
199 |
-- 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
|
200 |
(but in different desired color) is shown in quick succession (i.e. "Out of ammo!" for all weapons) |
5720 | 201 |
-- [probably not] make barrels always explode? |
202 |
-- [probably not] persistent ammo? |
|
203 |
-- [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
|
204 |
]] |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
205 |
|
5720 | 206 |
|
207 |
---------------------------------------------------------------- |
|
208 |
---------------------------------------------------------------- |
|
209 |
||
210 |
local flames = {} |
|
211 |
local fGearValues = {} |
|
212 |
||
213 |
function runOnflames(func) |
|
214 |
for k, gear in ipairs(flames) do |
|
215 |
func(gear) |
|
216 |
end |
|
217 |
end |
|
218 |
||
219 |
function trackFGear(gear) |
|
220 |
table.insert(flames, gear) |
|
221 |
end |
|
222 |
||
223 |
function trackFGearDeletion(gear) |
|
224 |
fGearValues[gear] = nil |
|
225 |
for k, g in ipairs(flames) do |
|
226 |
if g == gear then |
|
227 |
table.remove(flames, k) |
|
228 |
break |
|
229 |
end |
|
230 |
end |
|
231 |
end |
|
232 |
||
233 |
function getFGearValue(gear, key) |
|
234 |
if fGearValues[gear] ~= nil then |
|
235 |
return fGearValues[gear][key] |
|
236 |
end |
|
237 |
return nil |
|
238 |
end |
|
239 |
||
240 |
function setFGearValue(gear, key, value) |
|
241 |
found = false |
|
242 |
for id, values in pairs(fGearValues) do |
|
243 |
if id == gear then |
|
244 |
values[key] = value |
|
245 |
found = true |
|
246 |
end |
|
247 |
end |
|
248 |
if not found then |
|
249 |
fGearValues[gear] = { [key] = value } |
|
250 |
end |
|
251 |
end |
|
252 |
||
253 |
function decreaseFGearValue(gear, key) |
|
254 |
for id, values in pairs(fGearValues) do |
|
255 |
if id == gear then |
|
256 |
values[key] = values[key] - 1 |
|
257 |
end |
|
258 |
end |
|
259 |
end |
|
260 |
||
261 |
function HandleLife(gear) |
|
262 |
||
263 |
decreaseFGearValue(gear, "L") |
|
264 |
if getFGearValue(gear, "L") == 0 then |
|
265 |
AddVisualGear(GetX(gear), GetY(gear), vgtSmoke, 0, false) |
|
266 |
DeleteGear(gear) |
|
267 |
end |
|
268 |
||
269 |
end |
|
270 |
||
271 |
---------------------------------------------------------------- |
|
272 |
---------------------------------------------------------------- |
|
273 |
||
274 |
function HideTags() |
|
275 |
||
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
276 |
for i = 0, 3 do |
5720 | 277 |
SetVisualGearValues(vTag[i],0,0,0,0,0,1,0, 0, 240000, 0xffffff00) |
278 |
end |
|
279 |
||
280 |
end |
|
281 |
||
282 |
function DrawTag(i) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
283 |
|
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
284 |
local zoomL = 1.3 |
4872 | 285 |
|
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
286 |
local xOffset, yOffset, tValue, tCol |
5720 | 287 |
|
288 |
if i == 0 then |
|
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
289 |
if INTERFACE == "touch" then |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
290 |
xOffset = 60 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
291 |
yOffset = ScreenHeight - 35 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
292 |
else |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
293 |
xOffset = 40 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
294 |
yOffset = 40 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
295 |
end |
12067
3d03e9294633
Use yellow clock color in Space Invasion and Tumbler
Wuzzy <almikes@aol.com>
parents:
12058
diff
changeset
|
296 |
tCol = 0xffee00ff |
5720 | 297 |
tValue = TimeLeft |
298 |
elseif i == 1 then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
299 |
zoomL = 1.1 |
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
300 |
if INTERFACE == "touch" then |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
301 |
xOffset = 126 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
302 |
yOffset = ScreenHeight - 37 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
303 |
else |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
304 |
xOffset = 40 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
305 |
yOffset = 70 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
306 |
end |
5720 | 307 |
tCol = wepCol[0] |
308 |
tValue = wepAmmo[0] |
|
309 |
elseif i == 2 then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
310 |
zoomL = 1.1 |
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
311 |
if INTERFACE == "touch" then |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
312 |
xOffset = 126 + 35 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
313 |
yOffset = ScreenHeight - 37 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
314 |
else |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
315 |
xOffset = 40 + 35 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
316 |
yOffset = 70 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
317 |
end |
5720 | 318 |
tCol = wepCol[1] |
319 |
tValue = wepAmmo[1] |
|
320 |
elseif i == 3 then |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
321 |
zoomL = 1.1 |
14306
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
322 |
if INTERFACE == "touch" then |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
323 |
xOffset = 126 + 70 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
324 |
yOffset = ScreenHeight - 37 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
325 |
else |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
326 |
xOffset = 40 + 70 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
327 |
yOffset = 70 |
8fc6ac47f00a
Tweak Construction Mode, HedgeEditor, Space Invasion and Tumbler to support touch interface
Wuzzy <Wuzzy2@mail.ru>
parents:
13692
diff
changeset
|
328 |
end |
5720 | 329 |
tCol = wepCol[2] |
330 |
tValue = wepAmmo[2] |
|
331 |
end |
|
332 |
||
333 |
DeleteVisualGear(vTag[i]) |
|
334 |
vTag[i] = AddVisualGear(0, 0, vgtHealthTag, 0, false) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
335 |
SetVisualGearValues ( |
5720 | 336 |
vTag[i], --id |
337 |
-(ScreenWidth/2) + xOffset, --xoffset |
|
338 |
ScreenHeight - yOffset, --yoffset |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
339 |
0, --dx |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
340 |
0, --dy |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
341 |
zoomL, --zoom |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
342 |
1, --~= 0 means align to screen |
13690
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
343 |
nil, --frameticks |
5720 | 344 |
tValue, --value |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
345 |
240000, --timer |
5720 | 346 |
tCol --GetClanColor( GetHogClan(CurrentHedgehog) ) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
347 |
) |
4872 | 348 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
349 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
350 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
351 |
function GetGearDistance(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
352 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
353 |
g1X, g1Y = GetGearPosition(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
354 |
g2X, g2Y = GetGearPosition(CurrentHedgehog) |
4872 | 355 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
356 |
q = g1X - g2X |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
357 |
w = g1Y - g2Y |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
358 |
return( (q*q) + (w*w) ) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
359 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
360 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
361 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
362 |
-- 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
|
363 |
-- 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
|
364 |
function CheckProximityToExplosives(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
365 |
|
5720 | 366 |
if (GetGearDistance(gear) < 1400) then |
5598
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 |
if (GetGearType(gear) == gtExplosives) then |
5720 | 369 |
|
370 |
wepAmmo[0] = wepAmmo[0] + 1 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
371 |
PlaySound(sndShotgunReload) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
372 |
DeleteGear(gear) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
373 |
AddCaption(loc("+1 barrel!"), wepCol[0], capgrpAmmoinfo ) |
5720 | 374 |
DrawTag(1) |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
375 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
376 |
elseif (GetGearType(gear) == gtMine) then |
5720 | 377 |
wepAmmo[1] = wepAmmo[1] + 1 |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
378 |
PlaySound(sndShotgunReload) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
379 |
DeleteGear(gear) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
380 |
AddCaption(loc("+1 mine!"), wepCol[1], capgrpAmmoinfo ) |
5720 | 381 |
DrawTag(2) |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
382 |
|
5720 | 383 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
384 |
|
4872 | 385 |
end |
386 |
||
387 |
end |
|
388 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
389 |
-- check proximity on crates |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
390 |
function CheckProximity(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
391 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
392 |
dist = GetGearDistance(gear) |
5720 | 393 |
|
394 |
if (dist < 1600) and (GetGearType(gear) == gtCase) then |
|
395 |
||
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
396 |
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
|
397 |
|
12067
3d03e9294633
Use yellow clock color in Space Invasion and Tumbler
Wuzzy <almikes@aol.com>
parents:
12058
diff
changeset
|
398 |
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
|
399 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
400 |
TimeLeft = TimeLeft + bonusTime |
5720 | 401 |
DrawTag(0) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
402 |
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
|
403 |
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
|
404 |
wepAmmo[2] = wepAmmo[2] + bonusFlames |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
405 |
PlaySound(sndShotgunReload) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
406 |
AddCaption(string.format(loc("+%d flamer fuel!"), bonusFlames), wepCol[2], capgrpAmmoinfo ) |
5720 | 407 |
DrawTag(3) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
408 |
end |
5720 | 409 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
410 |
DeleteGear(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
411 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
412 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
413 |
|
4872 | 414 |
end |
415 |
||
12056
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 |
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
|
417 |
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
|
418 |
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
|
419 |
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
|
420 |
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
|
421 |
if wepIndex == 2 then |
12057
144264948277
Change ammo display texts in Tumbler to avoid pluralization failures
Wuzzy <almikes@aol.com>
parents:
12056
diff
changeset
|
422 |
shotsMsg = loc("Fuel: %d") |
12056
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 |
else |
12057
144264948277
Change ammo display texts in Tumbler to avoid pluralization failures
Wuzzy <almikes@aol.com>
parents:
12056
diff
changeset
|
424 |
shotsMsg = loc("Ammo: %d") |
12056
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 |
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
|
426 |
end |
13586 | 427 |
AddCaption(string.format(shotsMsg, wepAmmo[wepIndex]), wepCol[wepIndex],capgrpAmmostate) |
12056
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 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
429 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
430 |
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
|
431 |
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
|
432 |
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
|
433 |
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
|
434 |
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
|
435 |
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
|
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 |
wepIndex = newIndex |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
438 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
439 |
|
12056
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 |
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
|
441 |
if wepIndex == 0 then |
13586 | 442 |
selText = loc("Barrel Launcher") |
12056
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 |
elseif wepIndex == 1 then |
13586 | 444 |
selText = loc("Mine Deployer") |
12056
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 |
else |
13586 | 446 |
selText = loc("Flamer") |
12056
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 |
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
|
448 |
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
|
449 |
|
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 |
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
|
451 |
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
|
452 |
|
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 |
--------------- |
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 |
-- 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
|
455 |
--------------- |
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 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
457 |
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
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
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
|
462 |
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
|
463 |
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
|
464 |
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
|
465 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
466 |
|
12056
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 |
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
|
468 |
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
|
469 |
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
|
470 |
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
|
471 |
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
|
472 |
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
|
473 |
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
|
474 |
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
|
475 |
|
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 |
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
|
477 |
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
|
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 |
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
|
480 |
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
|
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 |
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
|
483 |
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
|
484 |
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
|
485 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
486 |
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
|
487 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
488 |
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
|
489 |
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
|
490 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
491 |
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
|
492 |
chanceTime = parseNum("chancetime", chanceTime, 0, 100) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
493 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
494 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
495 |
--------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
496 |
-- action keys |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
497 |
--------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
498 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
499 |
function onPrecise() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
500 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
501 |
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
|
502 |
|
12056
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 |
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
|
504 |
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
|
505 |
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
|
506 |
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
|
507 |
|
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 |
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
|
509 |
shotsRemainingMessage() |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
510 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
511 |
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
|
512 |
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
|
513 |
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
|
514 |
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
|
515 |
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
|
516 |
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
|
517 |
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
|
518 |
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
|
519 |
PlaySound(sndThrowRelease) |
5720 | 520 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
521 |
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
|
522 |
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
|
523 |
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
|
524 |
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
|
525 |
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
|
526 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
527 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
528 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
529 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
530 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
531 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
532 |
preciseOn = true |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
533 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
534 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
535 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
536 |
function onPreciseUp() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
537 |
preciseOn = false |
4872 | 538 |
end |
539 |
||
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
540 |
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
|
541 |
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
|
542 |
|
4872 | 543 |
function onHJump() |
5720 | 544 |
-- 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
|
545 |
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
|
546 |
runOnGears(CheckProximityToExplosives) |
4872 | 547 |
end |
548 |
end |
|
549 |
||
12056
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 |
-- 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
|
552 |
------------------- |
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 |
|
4872 | 554 |
function onLJump() |
12056
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 |
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
|
556 |
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
|
557 |
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
|
558 |
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
|
559 |
|
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
560 |
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
|
561 |
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
|
562 |
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
|
563 |
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
|
564 |
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
|
565 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
566 |
end |
4872 | 567 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
568 |
----------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
569 |
-- movement keys |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
570 |
----------------- |
4872 | 571 |
|
572 |
function onLeft() |
|
573 |
if (CurrentHedgehog ~= nil) and (stopMovement == false) then |
|
574 |
leftOn = true |
|
575 |
end |
|
576 |
end |
|
577 |
||
578 |
function onRight() |
|
579 |
if (CurrentHedgehog ~= nil) and (stopMovement == false) then |
|
580 |
rightOn = true |
|
581 |
end |
|
582 |
end |
|
583 |
||
584 |
function onUp() |
|
585 |
if (CurrentHedgehog ~= nil) and (stopMovement == false) then |
|
586 |
upOn = true |
|
587 |
end |
|
588 |
end |
|
589 |
||
590 |
function onDown() |
|
591 |
if (CurrentHedgehog ~= nil) and (stopMovement == false) then |
|
592 |
downOn = true |
|
593 |
end |
|
594 |
end |
|
595 |
||
596 |
function onDownUp() |
|
597 |
downOn = false |
|
598 |
end |
|
599 |
function onUpUp() |
|
600 |
upOn = false |
|
601 |
end |
|
602 |
function onLeftUp() |
|
603 |
leftOn = false |
|
604 |
end |
|
605 |
function onRightUp() |
|
606 |
rightOn = false |
|
607 |
end |
|
608 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
609 |
-------------------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
610 |
-- other event handlers |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
611 |
-------------------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
612 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
613 |
function onGameInit() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
614 |
CaseFreq = 0 |
5720 | 615 |
HealthCaseProb = 0 |
616 |
Delay = 1000 |
|
617 |
||
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
618 |
for i = 0, 3 do |
13692
a8b2a5e7e9db
Clean up more visual gears stuff in scripts
Wuzzy <Wuzzy2@mail.ru>
parents:
13690
diff
changeset
|
619 |
vTag[i] = AddVisualGear(0, 0, vgtHealthTag, 0, false) |
5720 | 620 |
end |
621 |
||
622 |
HideTags() |
|
623 |
||
624 |
wep[0] = loc("Barrel Launcher") |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
625 |
wep[1] = loc("Mine Deployer") |
5720 | 626 |
wep[2] = loc("Flamer") |
627 |
||
628 |
wepCol[0] = 0x78818eff |
|
629 |
wepCol[1] = 0xa12a77ff |
|
630 |
wepCol[2] = 0xf49318ff |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
631 |
|
5720 | 632 |
wepCount = 3 |
633 |
||
12056
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 |
DisableGameFlags(gfArtillery + gfSharedAmmo + gfPerHogAmmo + gfTagTeam + gfPlaceHog + gfInvulnerable) |
14958
6c17ef373079
Mask sndFlyAway in Space Invasion and Tumbler
Wuzzy <Wuzzy2@mail.ru>
parents:
14306
diff
changeset
|
635 |
SetSoundMask(sndFlyAway, true) |
12056
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 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
637 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
638 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
639 |
function onGameStart() |
5720 | 640 |
|
12056
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 |
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
|
642 |
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
|
643 |
|
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 |
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
|
645 |
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
|
646 |
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
|
647 |
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
|
648 |
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
|
649 |
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
|
650 |
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
|
651 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
652 |
ShowMission ( |
12069 | 653 |
loc("Tumbler"), |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
654 |
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
|
655 |
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
|
656 |
loc("Eliminate the enemy hogs to win.") .. "|" .. |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
657 |
" " .. "|" .. |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
658 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
659 |
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
|
660 |
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
|
661 |
timeStr .. |
5720 | 662 |
" " .. "|" .. |
5598
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 |
loc("Movement: [Up], [Down], [Left], [Right]") .. "|" .. |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
665 |
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
|
666 |
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
|
667 |
loc("Grab mines/barrels: [High jump]") .. "|" .. |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
668 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
669 |
" " .. "|" .. |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
670 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
671 |
clockStr .. |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
672 |
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
|
673 |
|
15074
e16f906224fd
Change mission panel icons for a couple of game styles
Wuzzy <Wuzzy2@mail.ru>
parents:
14958
diff
changeset
|
674 |
"", -amMine, 4000 |
5720 | 675 |
) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
676 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
677 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
678 |
|
5825
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
679 |
function onScreenResize() |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
680 |
|
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
681 |
-- 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
|
682 |
if (CurrentHedgehog ~= nil) and (tumbleStarted == true) then |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
683 |
for i = 0, 3 do |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
684 |
DrawTag(i) |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
685 |
end |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
686 |
end |
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
687 |
|
a6eab1b7c00d
Scripting: Update screen dimensions on screen resize and introduce onScreenResize() event.
sheepluva
parents:
5720
diff
changeset
|
688 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
689 |
|
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
690 |
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
|
691 |
-- 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
|
692 |
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
|
693 |
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
|
694 |
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
|
695 |
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
|
696 |
|
4872 | 697 |
function onNewTurn() |
5720 | 698 |
|
4872 | 699 |
stopMovement = false |
700 |
tumbleStarted = false |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
701 |
|
5720 | 702 |
-- randomly create new barrels mines on the map every turn (can be disabled by setting mine/barrels to 0 in scheme) |
703 |
for i = 0, barrelSpawn-1 do |
|
704 |
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
|
705 |
SetHealth(gear, 100) |
5720 | 706 |
if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then |
13690
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
707 |
AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
5720 | 708 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
709 |
end |
5720 | 710 |
for i = 0, mineSpawn-1 do |
711 |
gear = AddGear(100, 100, gtMine, 0, 0, 0, 0) |
|
712 |
if FindPlace(gear, false, 0, LAND_WIDTH, false) ~= nil then |
|
13690
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
713 |
AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
5720 | 714 |
end |
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 | 717 |
-- 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
|
718 |
r = GetRandom(100) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
719 |
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
|
720 |
gear = SpawnFakeUtilityCrate(0, 0, false, false) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
721 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
722 |
r = GetRandom(100) |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
723 |
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
|
724 |
gear = SpawnFakeAmmoCrate(0, 0, false, false) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
725 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
726 |
|
5720 | 727 |
HideTags() |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
728 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
729 |
--reset ammo counts |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
730 |
wepAmmo[0] = 2 |
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
731 |
wepAmmo[1] = 1 |
5720 | 732 |
wepAmmo[2] = 50 -- 50000 -- 50 |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
733 |
wepIndex = 2 |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
734 |
ChangeWeapon() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
735 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
736 |
roundKills = 0 |
5720 | 737 |
|
738 |
FollowGear(CurrentHedgehog) |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
739 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
740 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
741 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
742 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
743 |
function DisableTumbler() |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
744 |
stopMovement = true |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
745 |
upOn = false |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
746 |
down = false |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
747 |
leftOn = false |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
748 |
rightOn = false |
5720 | 749 |
HideTags() |
4872 | 750 |
end |
751 |
||
752 |
function onGameTick() |
|
753 |
||
754 |
-- start the player tumbling with a boom once their turn has actually begun |
|
755 |
if tumbleStarted == false then |
|
756 |
if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then |
|
757 |
tumbleStarted = true |
|
5720 | 758 |
TimeLeft = (TurnTime/1000) |
4872 | 759 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) |
5720 | 760 |
SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog) + 47) -- new |
761 |
for i = 0, 3 do |
|
762 |
DrawTag(i) |
|
5827
a416f1070fdf
we don't need trailing whitespaces... I guess :P
sheepluva
parents:
5825
diff
changeset
|
763 |
end |
4872 | 764 |
end |
765 |
end |
|
766 |
||
767 |
if (CurrentHedgehog ~= nil) and (tumbleStarted == true) then |
|
768 |
||
5720 | 769 |
runOnGears(CheckProximity) -- crates |
4872 | 770 |
|
771 |
-- Calculate and display turn time |
|
772 |
TimeLeftCounter = TimeLeftCounter + 1 |
|
773 |
if TimeLeftCounter == 1000 then |
|
774 |
TimeLeftCounter = 0 |
|
775 |
TimeLeft = TimeLeft - 1 |
|
776 |
||
12058 | 777 |
-- Countdown sounds |
778 |
if TimeLeft == 5 then |
|
779 |
PlaySound(sndHurry, CurrentHedgehog) |
|
780 |
elseif TimeLeft <= 4 and TimeLeft >= 1 then |
|
781 |
PlaySound(_G["sndCountdown"..TimeLeft]) |
|
782 |
end |
|
783 |
||
4872 | 784 |
if TimeLeft >= 0 then |
5720 | 785 |
DrawTag(0) |
4872 | 786 |
end |
787 |
||
788 |
end |
|
789 |
||
790 |
if TimeLeft == 0 then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
791 |
DisableTumbler() |
4872 | 792 |
end |
793 |
||
794 |
-- handle movement based on IO |
|
795 |
moveTimer = moveTimer + 1 |
|
796 |
if moveTimer == 100 then -- 100 |
|
797 |
moveTimer = 0 |
|
798 |
||
5720 | 799 |
runOnflames(HandleLife) |
800 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
801 |
--------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
802 |
-- new trail code |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
803 |
--------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
804 |
-- 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
|
805 |
if (TimeLeft <= 5) and (TimeLeft > 0) then |
13690
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
806 |
local tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false) |
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13648
diff
changeset
|
807 |
SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, GetClanColor(GetHogClan(CurrentHedgehog)) ) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
808 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
809 |
-------------- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
810 |
|
4872 | 811 |
dx, dy = GetGearVelocity(CurrentHedgehog) |
812 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
813 |
dxlimit = 0.4*fMod |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
814 |
dylimit = 0.4*fMod |
4872 | 815 |
|
816 |
if dx > dxlimit then |
|
817 |
dx = dxlimit |
|
818 |
end |
|
819 |
if dy > dylimit then |
|
820 |
dy = dylimit |
|
821 |
end |
|
822 |
if dx < -dxlimit then |
|
823 |
dx = -dxlimit |
|
824 |
end |
|
825 |
if dy < -dylimit then |
|
826 |
dy = -dylimit |
|
827 |
end |
|
828 |
||
829 |
||
830 |
if leftOn == true then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
831 |
dx = dx - 0.1*fMod |
4872 | 832 |
end |
833 |
if rightOn == true then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
834 |
dx = dx + 0.1*fMod |
4872 | 835 |
end |
836 |
||
837 |
if upOn == true then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
838 |
dy = dy - 0.1*fMod |
4872 | 839 |
end |
840 |
if downOn == true then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
841 |
dy = dy + 0.1*fMod |
4872 | 842 |
end |
843 |
||
844 |
SetGearVelocity(CurrentHedgehog, dx, dy) |
|
845 |
||
846 |
end |
|
847 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
848 |
-- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
849 |
--flamer |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
850 |
-- |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
851 |
fireTimer = fireTimer + 1 |
5720 | 852 |
if fireTimer == 6 then -- 5 --10 |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
853 |
fireTimer = 0 |
4872 | 854 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
855 |
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
|
856 |
|
5720 | 857 |
wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1 |
12056
05a968518a56
Tumbler updates: Script params, select weaps via slots, more sounds, rewrite texts, ignore broken gameflags
Wuzzy <almikes@aol.com>
parents:
8043
diff
changeset
|
858 |
shotsRemainingMessage() |
5720 | 859 |
DrawTag(3) |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
860 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
861 |
dx, dy = GetGearVelocity(CurrentHedgehog) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
862 |
shell = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtFlame, 0, 0, 0, 0) |
4872 | 863 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
864 |
xdev = 1 + GetRandom(25) --15 |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
865 |
xdev = xdev / 100 |
4872 | 866 |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
867 |
r = GetRandom(2) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
868 |
if r == 1 then |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
869 |
xdev = xdev*-1 |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
870 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
871 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
872 |
ydev = 1 + GetRandom(25) --15 |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
873 |
ydev = ydev / 100 |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
874 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
875 |
r = GetRandom(2) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
876 |
if r == 1 then |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
877 |
ydev = ydev*-1 |
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 |
|
5720 | 880 |
--*13 --8 *-4 |
881 |
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
|
882 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
883 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
884 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
885 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
886 |
-- |
4872 | 887 |
|
888 |
end |
|
889 |
||
890 |
||
891 |
end |
|
892 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
893 |
function isATrackedGear(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
894 |
if (GetGearType(gear) == gtExplosives) or |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
895 |
(GetGearType(gear) == gtMine) or |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
896 |
(GetGearType(gear) == gtCase) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
897 |
then |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
898 |
return(true) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
899 |
else |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
900 |
return(false) |
4872 | 901 |
end |
902 |
end |
|
903 |
||
904 |
function onGearAdd(gear) |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
905 |
|
5720 | 906 |
if GetGearType(gear) == gtFlame then |
907 |
||
908 |
trackFGear(gear) |
|
909 |
||
910 |
fGears = fGears +1 |
|
911 |
||
912 |
if fGears < 80 then |
|
913 |
setFGearValue(gear,"L",30) |
|
914 |
else |
|
915 |
setFGearValue(gear,"L",5) --3 |
|
916 |
end |
|
917 |
||
918 |
elseif isATrackedGear(gear) then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
919 |
trackGear(gear) |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
920 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
921 |
|
4872 | 922 |
end |
923 |
||
924 |
function onGearDelete(gear) |
|
925 |
||
5720 | 926 |
if GetGearType(gear) == gtFlame then |
927 |
trackFGearDeletion(gear) |
|
928 |
fGears = fGears -1 |
|
929 |
||
930 |
elseif isATrackedGear(gear) then |
|
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
931 |
trackDeletion(gear) |
5720 | 932 |
|
933 |
-- achievements? prototype |
|
934 |
elseif GetGearType(gear) == gtHedgehog then |
|
935 |
||
936 |
if GetHogTeamName(gear) ~= GetHogTeamName(CurrentHedgehog) then |
|
937 |
||
938 |
roundKills = roundKills + 1 |
|
939 |
if roundKills == 2 then |
|
13648 | 940 |
AddCaption(loc("Double Kill!"),capcolDefault,capgrpMessage2) |
5720 | 941 |
elseif roundKills == 3 then |
13648 | 942 |
AddCaption(loc("Killing spree!"),capcolDefault,capgrpMessage2) |
5720 | 943 |
elseif roundKills >= 4 then |
13648 | 944 |
AddCaption(loc("Unstoppable!"),capcolDefault,capgrpMessage2) |
5720 | 945 |
end |
946 |
||
947 |
elseif gear == CurrentHedgehog then |
|
948 |
DisableTumbler() |
|
949 |
||
950 |
elseif gear ~= CurrentHedgehog then |
|
13648 | 951 |
AddCaption(loc("Friendly Fire!"),capcolDefault,capgrpMessage2) |
5720 | 952 |
end |
953 |
||
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
954 |
end |
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
955 |
|
4872 | 956 |
if CurrentHedgehog ~= nil then |
957 |
FollowGear(CurrentHedgehog) |
|
958 |
end |
|
959 |
||
5720 | 960 |
end |
5598
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
961 |
|
265429f7ba85
- Updates to Tumbler gameplay mode [may still need a lil work]
mikade
parents:
5325
diff
changeset
|
962 |