author | nemo |
Sat, 01 Feb 2014 22:03:22 -0500 | |
changeset 10096 | 51d6b80ba43c |
parent 10088 | 6d4cd54dd343 |
child 10219 | bbeb1e9aaa65 |
permissions | -rw-r--r-- |
6349 | 1 |
-------------------------------- |
2 |
-- HIGHLANDER / HOGS OF WAR |
|
9085
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
3 |
-- version 0.4b |
6349 | 4 |
-- by mikade |
5 |
-------------------------------- |
|
6 |
||
7 |
----------- |
|
8 |
--0.1 |
|
9 |
----------- |
|
10 |
||
11 |
-- concept test |
|
12 |
||
13 |
----------- |
|
14 |
--0.2 |
|
15 |
----------- |
|
16 |
||
17 |
-- remove tardis till Henek fixes his tracker |
|
18 |
-- change wep crates to health crates |
|
19 |
-- reset arb turntimevalue |
|
20 |
-- include randomOrder |
|
21 |
-- Until fixed .17 methods come out, remove switches and resurrector |
|
22 |
-- on request, removed kamikaze and piano weapons |
|
23 |
-- provisional fixing of bugs that can't actually be fixed yet |
|
24 |
||
25 |
----------- |
|
26 |
--0.3 |
|
27 |
----------- |
|
28 |
||
29 |
-- meh, update incorrect display |
|
30 |
-- may change this in the future to have switches |
|
31 |
-- but for now people are used to it without, so~ |
|
32 |
||
33 |
-- mudball is now counted as a utility |
|
34 |
||
6378 | 35 |
----------- |
36 |
--0.3b |
|
37 |
----------- |
|
6349 | 38 |
|
6378 | 39 |
-- cleaned up code and got rid of unneccessary vars |
40 |
-- mudball is a weapon again |
|
41 |
-- landgun is now a utility |
|
42 |
-- extra time, vampirism utility removed |
|
43 |
-- hammer wep removed |
|
44 |
-- all hogs have kamikaze |
|
6349 | 45 |
|
6820
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
46 |
----------- |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
47 |
--0.3c |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
48 |
----------- |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
49 |
|
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
50 |
-- restructured some code |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
51 |
-- added napalm (whoops) to list of possible weapons you can get |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
52 |
-- hogs no longer recieve airstrike-related weps on border maps |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
53 |
|
8682 | 54 |
----------- |
55 |
--0.4 |
|
56 |
----------- |
|
57 |
-- fix same name/blank weapon transfer bug (issue 541) |
|
58 |
-- show next hog ammo set in full (issue 312) |
|
59 |
-- allow mid-kill multi-shot weapon transfers (issue 503) |
|
60 |
-- allow users to configure hog health |
|
61 |
-- remove 'switched to' message |
|
62 |
-- remove some extraeneous code |
|
63 |
-- add more whitespace |
|
64 |
-- break everything |
|
65 |
||
9085
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
66 |
----------- |
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
67 |
--0.4b |
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
68 |
----------- |
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
69 |
-- as per request, add ice-gun |
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
70 |
|
8682 | 71 |
------------------------- |
72 |
-- ideas for the future |
|
73 |
------------------------- |
|
9085
092051fda7e1
As per request, add ice-gun (untested!)
mikade <redgrinner@gmail.com>
parents:
8713
diff
changeset
|
74 |
-- add structure |
8682 | 75 |
-- allow switcher, resurrector |
76 |
-- add abuse |
|
77 |
-- nerf teleport |
|
78 |
-- allow more customization |
|
79 |
-- poison hogs using the default team? :/ |
|
80 |
-- balance weapon distribution across entire team / all teams |
|
81 |
-- add other inequalities/bonuses like... ??? |
|
82 |
-- some hogs start off with an extra 25 health? |
|
83 |
-- some hogs start off poisoned? |
|
84 |
-- some hogs start off with a rope and 2 drills but die after their turn? |
|
85 |
||
86 |
------------------------------- |
|
87 |
-- derp, script follows |
|
88 |
------------------------------- |
|
89 |
||
8713 | 90 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
91 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
6349 | 92 |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
93 |
-- These define weps allowed by the script. At present Tardis and Resurrection is banned for example |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
94 |
-- These were arbitrarily defined out-of-order in initial script, so that was preserved here, resulting |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
95 |
-- in a moderately odd syntax. |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
96 |
local atkWeps = { |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
97 |
[amBazooka]=true, [amBee]=true, [amMortar]=true, [amDrill]=true, [amSnowball]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
98 |
[amGrenade]=true, [amClusterBomb]=true, [amMolotov]=true, [amWatermelon]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
99 |
[amHellishBomb]=true, [amGasBomb]=true, [amShotgun]=true, [amDEagle]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
100 |
[amFlamethrower]=true, [amSniperRifle]=true, [amSineGun]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
101 |
[amFirePunch]=true, [amWhip]=true, [amBaseballBat]=true, [amKamikaze]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
102 |
[amSeduction]=true, [amHammer]=true, [amMine]=true, [amDynamite]=true, [amCake]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
103 |
[amBallgun]=true, [amSMine]=true, [amRCPlane]=true, [amBirdy]=true, [amKnife]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
104 |
[amAirAttack]=true, [amMineStrike]=true, [amNapalm]=true, [amDrillStrike]=true, [amPiano]=true |
6820
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
105 |
} |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
106 |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
107 |
local utilWeps = { |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
108 |
[amBlowTorch]=true, [amPickHammer]=true, [amGirder]=true, [amPortalGun]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
109 |
[amRope]=true, [amParachute]=true, [amTeleport]=true, [amJetpack]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
110 |
[amInvulnerable]=true, [amLaserSight]=true, [amVampiric]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
111 |
[amLowGravity]=true, [amExtraDamage]=true, [amExtraTime]=true, |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
112 |
[amLandGun]=true, [amSwitch]=true, [amRubber]=true, [amIceGun]=true, |
6820
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
113 |
} |
7db9e89b3f80
- don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents:
6378
diff
changeset
|
114 |
|
10088 | 115 |
local wepArray = {} |
6349 | 116 |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
117 |
local atkChoices = {} |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
118 |
local utilChoices = {} |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
119 |
|
8682 | 120 |
local currHog |
121 |
local lastHog |
|
6349 | 122 |
local started = false |
123 |
local switchStage = 0 |
|
124 |
||
8682 | 125 |
local lastWep = amNothing |
126 |
local shotsFired = 0 |
|
127 |
||
10088 | 128 |
local probability = {1,2,5,10,20,50,200,500,1000000}; |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
129 |
local atktot = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
130 |
local utiltot = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
131 |
local maxWep = 56 -- game crashes if you exceed supported # |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
132 |
|
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
133 |
local someHog = nil -- just for looking up the weps |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
134 |
|
8682 | 135 |
function CheckForWeaponSwap() |
136 |
if GetCurAmmoType() ~= lastWep then |
|
137 |
shotsFired = 0 |
|
138 |
end |
|
139 |
lastWep = GetCurAmmoType() |
|
140 |
end |
|
141 |
||
142 |
function onSlot() |
|
143 |
CheckForWeaponSwap() |
|
144 |
end |
|
145 |
||
146 |
function onSetWeapon() |
|
147 |
CheckForWeaponSwap() |
|
148 |
end |
|
149 |
||
150 |
function onHogAttack() |
|
151 |
CheckForWeaponSwap() |
|
152 |
shotsFired = shotsFired + 1 |
|
153 |
end |
|
154 |
||
6349 | 155 |
function StartingSetUp(gear) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
156 |
for i = 1,maxWep do |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
157 |
setGearValue(gear,i,0) |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
158 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
159 |
for w,c in pairs(wepArray) do |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
160 |
if c == 9 and (atkWeps[w] or utilWeps[w]) then |
10088 | 161 |
setGearValue(gear,w,1) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
162 |
end |
6349 | 163 |
end |
164 |
||
8682 | 165 |
setGearValue(gear,amSkip,100) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
166 |
|
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
167 |
local r = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
168 |
if atktot > 0 then |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
169 |
r = GetRandom(atktot)+1 |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
170 |
for i = 1,maxWep do |
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
171 |
--for w,c in pairs(atkChoices) do |
10088 | 172 |
--WriteLnToConsole(' c: '..c..' w:'..w..' r:'..r) |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
173 |
if atkChoices[i] >= r then |
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
174 |
setGearValue(gear,i,1) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
175 |
break |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
176 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
177 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
178 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
179 |
if utiltot > 0 then |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
180 |
r = GetRandom(utiltot)+1 |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
181 |
for i = 1,maxWep do |
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
182 |
-- for w,c in pairs(utilChoices) do |
10088 | 183 |
--WriteLnToConsole('util c: '..c..' w:'..w..' r:'..r) |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
184 |
if utilChoices[i] >= r then |
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
185 |
setGearValue(gear,i,1) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
186 |
break |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
187 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
188 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
189 |
end |
6349 | 190 |
end |
191 |
||
192 |
--[[function SaveWeapons(gear) |
|
8682 | 193 |
-- er, this has no 0 check so presumably if you use a weapon then when it saves you wont have it |
6349 | 194 |
|
6378 | 195 |
for i = 1, (#wepArray) do |
6349 | 196 |
setGearValue(gear, wepArray[i], GetAmmoCount(gear, wepArray[i]) ) |
197 |
--AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) ) |
|
198 |
end |
|
199 |
||
200 |
end]] |
|
201 |
||
202 |
function ConvertValues(gear) |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
203 |
for w,c in pairs(wepArray) do |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
204 |
AddAmmo(gear, w, getGearValue(gear,w) ) |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
205 |
end |
6349 | 206 |
end |
207 |
||
8682 | 208 |
-- this is called when a hog dies |
6349 | 209 |
function TransferWeps(gear) |
210 |
||
211 |
if CurrentHedgehog ~= nil then |
|
212 |
||
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
213 |
for w,c in pairs(wepArray) do |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
214 |
val = getGearValue(gear,w) |
10096
51d6b80ba43c
don't allow getting 2nd copy of wep you already have, prevent gaining banned weps even if set to infinite in scheme.
nemo
parents:
10088
diff
changeset
|
215 |
if val ~= 0 and wepArray[w] ~= 9 and getGearValue(CurrentHedgehog, w) == 0 then |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
216 |
setGearValue(CurrentHedgehog, w, val) |
8682 | 217 |
|
218 |
-- if you are using multi-shot weapon, gimme one more |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
219 |
if (GetCurAmmoType() == w) and (shotsFired ~= 0) then |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
220 |
AddAmmo(CurrentHedgehog, w, val+1) |
8682 | 221 |
-- assign ammo as per normal |
222 |
else |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
223 |
AddAmmo(CurrentHedgehog, w, val) |
8682 | 224 |
end |
225 |
||
6349 | 226 |
end |
227 |
end |
|
228 |
||
229 |
end |
|
230 |
||
231 |
end |
|
232 |
||
233 |
function onGameInit() |
|
10036 | 234 |
EnableGameFlags(gfInfAttack, gfRandomOrder, gfPerHogAmmo) |
6349 | 235 |
HealthCaseProb = 100 |
236 |
end |
|
237 |
||
238 |
function onGameStart() |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
239 |
utilChoices[amSkip] = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
240 |
local c = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
241 |
for i = 1,maxWep do |
10088 | 242 |
atkChoices[i] = 0 |
243 |
utilChoices[i] = 0 |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
244 |
if i ~= 7 then |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
245 |
wepArray[i] = 0 |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
246 |
c = GetAmmoCount(someHog, i) |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
247 |
if c > 8 then c = 9 end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
248 |
wepArray[i] = c |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
249 |
if c < 9 and c > 0 then |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
250 |
if atkWeps[i] then |
10088 | 251 |
--WriteLnToConsole('a c: '..c..' w:'..i) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
252 |
atktot = atktot + probability[c] |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
253 |
atkChoices[i] = atktot |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
254 |
elseif utilWeps[i] then |
10088 | 255 |
--WriteLnToConsole('u c: '..c..' w:'..i) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
256 |
utiltot = utiltot + probability[c] |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
257 |
utilChoices[i] = utiltot |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
258 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
259 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
260 |
end |
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
261 |
end |
6349 | 262 |
|
10088 | 263 |
--WriteLnToConsole('utiltot:'..utiltot..' atktot:'..atktot) |
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
264 |
|
6349 | 265 |
ShowMission ( |
266 |
loc("HIGHLANDER"), |
|
267 |
loc("Not all hogs are born equal."), |
|
268 |
||
269 |
"- " .. loc("Eliminate enemy hogs and take their weapons.") .. "|" .. |
|
270 |
"- " .. loc("Per-Hog Ammo") .. "|" .. |
|
271 |
"- " .. loc("Weapons reset.") .. "|" .. |
|
272 |
"- " .. loc("Unlimited Attacks") .. "|" .. |
|
273 |
"", 4, 4000 |
|
274 |
) |
|
275 |
||
276 |
runOnGears(StartingSetUp) |
|
277 |
runOnGears(ConvertValues) |
|
278 |
end |
|
279 |
||
8682 | 280 |
function CheckForHogSwitch() |
6349 | 281 |
|
282 |
if (CurrentHedgehog ~= nil) then |
|
283 |
||
8682 | 284 |
currHog = CurrentHedgehog |
285 |
||
286 |
if currHog ~= lastHog then |
|
6349 | 287 |
|
8682 | 288 |
-- re-assign ammo to this guy, so that his entire ammo set will |
289 |
-- be visible during another player's turn |
|
290 |
if lastHog ~= nil then |
|
291 |
ConvertValues(lastHog) |
|
292 |
end |
|
293 |
||
294 |
-- give the new hog what he is supposed to have, too |
|
6349 | 295 |
ConvertValues(CurrentHedgehog) |
8682 | 296 |
|
6349 | 297 |
end |
298 |
||
8682 | 299 |
lastHog = currHog |
300 |
||
6349 | 301 |
end |
302 |
||
303 |
end |
|
304 |
||
8682 | 305 |
function onNewTurn() |
306 |
CheckForHogSwitch() |
|
307 |
end |
|
308 |
||
309 |
--function onGameTick20() |
|
310 |
--CheckForHogSwitch() |
|
311 |
-- if we use gfPerHogAmmo is this even needed? Err, well, weapons reset, so... yes? |
|
312 |
-- orrrr, should we rather call the re-assignment of weapons onNewTurn()? probably not because |
|
313 |
-- then you cant switch hogs... unless we add a thing in onSwitch or whatever |
|
314 |
-- ye, that is probably better actually, but I'll add that when/if I add switch |
|
315 |
--end |
|
316 |
||
6349 | 317 |
--[[function onHogHide(gear) |
318 |
-- waiting for Henek |
|
319 |
end |
|
320 |
||
321 |
function onHogRestore(gear) |
|
322 |
-- waiting for Henek |
|
323 |
end]] |
|
324 |
||
325 |
function onGearAdd(gear) |
|
326 |
||
327 |
--if GetGearType(gear) == gtSwitcher then |
|
328 |
-- SaveWeapons(CurrentHedgehog) |
|
329 |
--end |
|
330 |
||
331 |
if (GetGearType(gear) == gtHedgehog) then |
|
332 |
trackGear(gear) |
|
10083
b20f9481e5cb
Make highlander configurable using weapons, commit weaponset mimicking old values
nemo
parents:
10036
diff
changeset
|
333 |
if someHog == nil then someHog = gear end |
6349 | 334 |
end |
335 |
||
336 |
end |
|
337 |
||
338 |
function onGearDelete(gear) |
|
339 |
||
340 |
if (GetGearType(gear) == gtHedgehog) then --or (GetGearType(gear) == gtResurrector) then |
|
341 |
TransferWeps(gear) |
|
342 |
trackDeletion(gear) |
|
343 |
end |
|
344 |
||
345 |
end |