488 with HH^ do |
488 with HH^ do |
489 if (curhat <> nil) then |
489 if (curhat <> nil) then |
490 begin |
490 begin |
491 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
491 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
492 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
492 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
493 if curhat^.w > 64 then |
493 if (curhat^.w > 64) or ((curhat^.w = 64) and (curhat^.h = 32)) then |
494 begin |
494 begin |
|
495 if ((curhat^.w = 64) and (curhat^.h = 32)) then |
|
496 tx := 1 |
|
497 else |
|
498 tx := 32; |
495 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
499 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
496 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
500 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, tx, i, 32, 32, |
497 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
501 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
498 untint |
502 untint |
499 end |
503 end |
500 end |
504 end |
501 end; |
505 end; |
1034 amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0); |
1040 amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0); |
1035 end |
1041 end |
1036 end; *) |
1042 end; *) |
1037 if (CurAmmoGear = nil) then |
1043 if (CurAmmoGear = nil) then |
1038 begin |
1044 begin |
1039 if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0) |
1045 if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0) |
1040 and (Gear^.Message and (gmLeft or gmRight) = 0) then |
1046 and (Gear^.Message and (gmLeft or gmRight) = 0) then |
1041 begin |
1047 begin |
1042 amt:= CurrentHedgehog^.CurAmmoType; |
1048 amt:= CurrentHedgehog^.CurAmmoType; |
1043 case amt of |
1049 case amt of |
1044 amBaseballBat: DrawSpritePivotedF(sprHandBaseball, |
1050 amBaseballBat: DrawSpritePivotedF(sprHandBaseball, |
1045 sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle); |
1051 sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle); |
|
1052 amMinigun: DrawSpritePivotedF(sprMinigun, |
|
1053 sx + 20 * sign, sy + 4, 0, sign, -18, -2, aangle); |
|
1054 end; |
1046 end; |
1055 end; |
1047 end; |
|
1048 end |
1056 end |
1049 else |
1057 else |
1050 begin |
1058 begin |
1051 aangle:= Gear^.Angle * 180 / cMaxAngle - 90; |
1059 aangle:= Gear^.Angle * 180 / cMaxAngle - 90; |
1052 case CurAmmoGear^.Kind of |
1060 case CurAmmoGear^.Kind of |
1194 vg: PVisualGear; |
1205 vg: PVisualGear; |
1195 i: Longword; |
1206 i: Longword; |
1196 aAngle: real; |
1207 aAngle: real; |
1197 startX, endX, startY, endY: LongInt; |
1208 startX, endX, startY, endY: LongInt; |
1198 begin |
1209 begin |
1199 if Gear^.State and gstFrozen <> 0 then Tint($A0, $A0, $FF, $FF); |
1210 // airmine has its own sprite |
|
1211 if (Gear^.State and gstFrozen <> 0) and (Gear^.Kind <> gtAirMine) then Tint($A0, $A0, $FF, $FF); |
1200 //if Gear^.State and gstFrozen <> 0 then Tint(IceColor or $FF); |
1212 //if Gear^.State and gstFrozen <> 0 then Tint(IceColor or $FF); |
1201 if Gear^.Target.X <> NoPointX then |
1213 if Gear^.Target.X <> NoPointX then |
1202 if Gear^.AmmoType = amBee then |
1214 if Gear^.AmmoType = amBee then |
1203 DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
1215 DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
1204 else if Gear^.AmmoType = amIceGun then |
1216 else if Gear^.AmmoType = amIceGun then |
1225 untint; |
1237 untint; |
1226 DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) |
1238 DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) |
1227 end; |
1239 end; |
1228 gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
1240 gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
1229 |
1241 |
1230 gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
1242 gtPortal: begin |
|
1243 if ((Gear^.Tag and 1) = 0) // still moving? |
1231 or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked? |
1244 or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked? |
1232 or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving? |
1245 or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving? |
1233 DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
1246 DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
1234 else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
1247 else |
|
1248 DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
|
1249 |
|
1250 // Portal ball trace effects |
|
1251 if ((Gear^.Tag and 1) = 0) and ((GameTicks mod 4) = 0) and (not isPaused) then |
|
1252 begin |
|
1253 vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); |
|
1254 if vg <> nil then |
|
1255 if Gear^.Tag = 0 then |
|
1256 vg^.Tint:= $fab02ab0 |
|
1257 else if Gear^.Tag = 2 then |
|
1258 vg^.Tint:= $364df7b0; |
|
1259 end; |
|
1260 end; |
1235 |
1261 |
1236 gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then |
1262 gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then |
1237 DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
1263 DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
1238 else |
1264 else |
1239 DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1265 DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1241 gtHedgehog: DrawHH(Gear, x, y); |
1267 gtHedgehog: DrawHH(Gear, x, y); |
1242 |
1268 |
1243 gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1269 gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1244 |
1270 |
1245 gtGrave: begin |
1271 gtGrave: begin |
1246 DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 15, 1, 32, 32); |
1272 DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (RealTicks shr 7+Gear^.uid) and 15, 1, 32, 32); |
1247 if Gear^.Health > 0 then |
1273 if Gear^.Health > 0 then |
1248 begin |
1274 begin |
1249 //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750)))); |
1275 //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750)))); |
1250 Tint($f5, $db, $35, max($40, round($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health))))); |
1276 Tint($f5, $db, $35, max($40, round($FF * abs(1 - (RealTicks mod 1500) / (750 + Gear^.Health))))); |
1251 //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
1277 //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
1252 DrawSprite(sprVampiric, x - 24, y - 24, 0); |
1278 DrawSprite(sprVampiric, x - 24, y - 24, 0); |
1253 untint |
1279 untint |
1254 end |
1280 end |
1255 end; |
1281 end; |
1256 gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1282 gtBee: DrawSpriteRotatedF(sprBee, x, y, (RealTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1257 gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
1283 gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
1258 gtRope: DrawRope(Gear); |
1284 gtRope: DrawRope(Gear); |
1259 |
1285 |
1260 gtMine: begin |
1286 gtMine: begin |
1261 if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
1287 if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
1262 DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
1288 DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
1263 else if Gear^.Health <> 0 then |
1289 else if Gear^.Health <> 0 then |
1264 DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
1290 DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
1265 else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
1291 else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
1266 end; |
1292 end; |
1267 gtAirMine: if Gear^.State and gstTmpFlag = 0 then // mine is inactive |
1293 gtAirMine: |
1268 begin |
1294 if (Gear^.State and gstFrozen <> 0) then |
1269 Tint(150,150,150,255); |
1295 DrawSprite(sprFrozenAirMine, x-16, y-16, 15) |
|
1296 else if (Gear^.State and gstTmpFlag = 0) then // mine is inactive |
|
1297 begin |
|
1298 if (Gear^.State and gstTmpFlag = 0) then Tint(150,150,150,255); |
1270 DrawSprite(sprAirMine, x-16, y-16, 15); |
1299 DrawSprite(sprAirMine, x-16, y-16, 15); |
1271 untint |
1300 untint |
1272 end |
1301 end |
1273 else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then // mine is chasing a hog |
1302 else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then // mine is chasing a hog |
1274 DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25) mod 16) |
1303 DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25 + Gear^.Uid) mod 16) |
1275 else if Gear^.State and gstChooseTarget <> 0 then // mine is seeking for hogs |
1304 else if Gear^.State and gstChooseTarget <> 0 then // mine is seeking for hogs |
1276 DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125) mod 16) |
1305 DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125 + Gear^.Uid) mod 16) |
1277 else |
1306 else |
1278 DrawSprite(sprAirMine, x-16, y-16, 4); // mine is active but not seeking |
1307 DrawSprite(sprAirMine, x-16, y-16, 4); // mine is active but not seeking |
1279 |
1308 |
1280 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
1309 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
1281 DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
1310 DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
1291 begin |
1320 begin |
1292 if Gear^.State and gstFrozen <> 0 then |
1321 if Gear^.State and gstFrozen <> 0 then |
1293 DrawSprite(sprCase, x - 24, y - 28, 0) |
1322 DrawSprite(sprCase, x - 24, y - 28, 0) |
1294 else |
1323 else |
1295 begin |
1324 begin |
1296 i:= (GameTicks shr 6) mod 64; |
1325 i:= (RealTicks shr 6) mod 64; |
1297 if i > 18 then i:= 0; |
1326 if i > 18 then i:= 0; |
1298 DrawSprite(sprCase, x - 24, y - 24, i) |
1327 DrawSprite(sprCase, x - 24, y - 24, i) |
1299 end |
1328 end |
1300 end |
1329 end |
1301 else if ((Gear^.Pos and posCaseHealth) <> 0) then |
1330 else if ((Gear^.Pos and posCaseHealth) <> 0) then |
1302 begin |
1331 begin |
1303 if Gear^.State and gstFrozen <> 0 then |
1332 if Gear^.State and gstFrozen <> 0 then |
1304 DrawSprite(sprFAid, x - 24, y - 28, 0) |
1333 DrawSprite(sprFAid, x - 24, y - 28, 0) |
1305 else |
1334 else |
1306 begin |
1335 begin |
1307 i:= ((GameTicks shr 6) + 38) mod 64; |
1336 i:= ((RealTicks shr 6) + 38) mod 64; |
1308 if i > 13 then i:= 0; |
1337 if i > 13 then i:= 0; |
1309 DrawSprite(sprFAid, x - 24, y - 24, i) |
1338 DrawSprite(sprFAid, x - 24, y - 24, i) |
1310 end |
1339 end |
1311 end |
1340 end |
1312 else if ((Gear^.Pos and posCaseUtility) <> 0) then |
1341 else if ((Gear^.Pos and posCaseUtility) <> 0) then |
1313 begin |
1342 begin |
1314 if Gear^.State and gstFrozen <> 0 then |
1343 if Gear^.State and gstFrozen <> 0 then |
1315 DrawSprite(sprUtility, x - 24, y - 28, 0) |
1344 DrawSprite(sprUtility, x - 24, y - 28, 0) |
1316 else |
1345 else |
1317 begin |
1346 begin |
1318 i:= (GameTicks shr 6) mod 70; |
1347 i:= (RealTicks shr 6) mod 70; |
1319 if i > 23 then i:= 0; |
1348 if i > 23 then i:= 0; |
1320 i:= i mod 12; |
1349 i:= i mod 12; |
1321 DrawSprite(sprUtility, x - 24, y - 24, i) |
1350 DrawSprite(sprUtility, x - 24, y - 24, i) |
1322 end |
1351 end |
1323 end |
1352 end |
1367 |
1396 |
1368 end; |
1397 end; |
1369 gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
1398 gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
1370 gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
1399 gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
1371 gtFlame: if Gear^.Tag and 1 = 0 then |
1400 gtFlame: if Gear^.Tag and 1 = 0 then |
1372 DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) |
1401 DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (RealTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) |
1373 else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); |
1402 else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (RealTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); |
1374 gtParachute: begin |
1403 gtParachute: begin |
1375 DrawSprite(sprParachute, x - 24, y - 48, 0); |
1404 DrawSprite(sprParachute, x - 24, y - 48, 0); |
1376 DrawAltWeapon(Gear, x + 1, y - 3) |
1405 DrawAltWeapon(Gear, x + 1, y - 3) |
1377 end; |
1406 end; |
1378 gtAirAttack: begin |
1407 gtAirAttack: begin |
1389 if ((Gear^.State and gstAnimation) <> 0) then |
1418 if ((Gear^.State and gstAnimation) <> 0) then |
1390 DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
1419 DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
1391 DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0) |
1420 DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0) |
1392 end |
1421 end |
1393 end; |
1422 end; |
1394 gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
1423 gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (RealTicks shr 6) mod 12); |
1395 gtTarget: begin |
1424 gtTarget: begin |
1396 Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000)); |
1425 Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000)); |
1397 DrawSprite(sprTarget, x - 16, y - 16, 0); |
1426 DrawSprite(sprTarget, x - 16, y - 16, 0); |
1398 untint; |
1427 untint; |
1399 end; |
1428 end; |
1546 DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
1575 DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
1547 end; |
1576 end; |
1548 end |
1577 end |
1549 end |
1578 end |
1550 end; |
1579 end; |
1551 gtDuck: DrawSpriteRotatedF(sprDuck, x, y, 1, Gear^.Tag, Gear^.DirAngle); |
1580 gtDuck: DrawSpriteRotatedF(sprDuck, x, y, 1, Gear^.Tag, |
1552 gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF); // debug |
1581 // replace with something based on dx/dy? |
|
1582 Gear^.DirAngle + 10-round(20 * abs(1 - (RealTicks mod round(0.1/max(0.00005,cWindSpeedf))) / round(0.05/max(0.00005,cWindSpeedf))) )); |
|
1583 gtGenericFaller: begin |
|
1584 // DEBUG: draw gtGenericFaller |
|
1585 if Gear^.Tag <> 0 then |
|
1586 DrawCircle(x, y, max(3, Gear^.Radius), 3, $FF, $00, $00, $FF) |
|
1587 else |
|
1588 DrawCircle(x, y, max(3, Gear^.Radius), 3, $80, $FF, $80, $8F); |
|
1589 end; |
1553 end; |
1590 end; |
1554 if Gear^.State and gstFrozen <> 0 then untint |
1591 if Gear^.State and gstFrozen <> 0 then untint |
1555 end; |
1592 end; |
1556 |
1593 |
1557 procedure RenderGearTimer(Gear: PGear; x, y: LongInt); |
1594 procedure RenderGearTimer(Gear: PGear; x, y: LongInt); |