45 |
45 |
46 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); |
46 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); |
47 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS; |
47 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS; |
48 procedure SpawnBoxOfSmth; |
48 procedure SpawnBoxOfSmth; |
49 procedure ShotgunShot(Gear: PGear); |
49 procedure ShotgunShot(Gear: PGear); |
|
50 function CanUseTardis(HHGear: PGear): boolean; |
50 |
51 |
51 procedure SetAllToActive; |
52 procedure SetAllToActive; |
52 procedure SetAllHHToActive(Ice: boolean); |
53 procedure SetAllHHToActive(Ice: boolean); |
53 procedure SetAllHHToActive(); inline; |
54 procedure SetAllHHToActive(); inline; |
54 |
55 |
1170 end; |
1171 end; |
1171 if (GameFlags and gfSolidLand) = 0 then |
1172 if (GameFlags and gfSolidLand) = 0 then |
1172 DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cShotgunRadius) |
1173 DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cShotgunRadius) |
1173 end; |
1174 end; |
1174 |
1175 |
|
1176 // Returns true if the given hog gear can use the tardis |
|
1177 function CanUseTardis(HHGear: PGear): boolean; |
|
1178 var usable: boolean; |
|
1179 i, j, cnt: LongInt; |
|
1180 HH: PHedgehog; |
|
1181 begin |
|
1182 (* |
|
1183 Conditions for not activating. |
|
1184 1. Hog is last of his clan |
|
1185 2. Sudden Death is in play |
|
1186 3. Hog is a king |
|
1187 *) |
|
1188 usable:= true; |
|
1189 HH:= HHGear^.Hedgehog; |
|
1190 if HHGear <> nil then |
|
1191 if (HHGear = nil) or (HH^.King) or (SuddenDeathDmg) then |
|
1192 usable:= false; |
|
1193 cnt:= 0; |
|
1194 for j:= 0 to Pred(HH^.Team^.Clan^.TeamsNumber) do |
|
1195 for i:= 0 to Pred(HH^.Team^.Clan^.Teams[j]^.HedgehogsNumber) do |
|
1196 if (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear <> nil) |
|
1197 and ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0) |
|
1198 and (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health > HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then |
|
1199 inc(cnt); |
|
1200 if (cnt < 2) then |
|
1201 usable:= false; |
|
1202 CanUseTardis:= usable; |
|
1203 end; |
|
1204 |
1175 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); |
1205 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); |
1176 var t: PGearArray; |
1206 var t: PGearArray; |
1177 Gear: PGear; |
1207 Gear: PGear; |
1178 i, j, tmpDmg: LongInt; |
1208 i, j, tmpDmg: LongInt; |
1179 VGear: PVisualGear; |
1209 VGear: PVisualGear; |