1574 if i > 23 then i:= 0; |
1580 if i > 23 then i:= 0; |
1575 i:= i mod 12; |
1581 i:= i mod 12; |
1576 DrawSprite(sprUtility, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
1582 DrawSprite(sprUtility, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
1577 end; |
1583 end; |
1578 end; |
1584 end; |
|
1585 gtExplosives: begin |
|
1586 i:= (GameTicks shr 6) mod 64; |
|
1587 if i > 18 then i:= 0; |
|
1588 DrawSprite(sprExplosives, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
|
1589 end; |
1579 gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1); |
1590 gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1); |
1580 gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
1591 gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
1581 gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0); |
1592 gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0); |
1582 gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 128 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); |
1593 gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 128 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); |
1583 gtParachute: begin |
1594 gtParachute: begin |
1631 var i: LongInt; |
1642 var i: LongInt; |
1632 Gear: PGear; |
1643 Gear: PGear; |
1633 begin |
1644 begin |
1634 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000); |
1645 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000); |
1635 |
1646 |
|
1647 // HACK: just for testing explosives! |
|
1648 if (GameFlags and gfMines) <> 0 then |
|
1649 GameFlags:= (GameFlags or gfExplosives) and not gfMines; |
|
1650 |
1636 if (TrainingFlags and tfSpawnTargets) <> 0 then |
1651 if (TrainingFlags and tfSpawnTargets) <> 0 then |
1637 begin |
1652 begin |
1638 TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
1653 TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
1639 FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
1654 FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
1640 end; |
1655 end; |
1641 |
1656 |
1642 if ((GameFlags and gfForts) = 0) and ((GameFlags and gfMines) <> 0) then |
1657 if ((GameFlags and gfForts) = 0) then |
1643 for i:= 0 to Pred(cLandAdditions) do |
1658 begin |
1644 begin |
1659 // TODO: exclude each other or allow both, mines and explosives, on same map? |
1645 Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0); |
1660 if ((GameFlags and gfMines) <> 0) then |
1646 Gear^.TriggerId:= i + 1; |
1661 for i:= 0 to Pred(cLandAdditions) do |
1647 FindPlace(Gear, false, 0, LAND_WIDTH); |
1662 begin |
1648 { if(Gear <> nil) then |
1663 Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0); |
1649 ParseCommand('addtrig s' + inttostr(Gear^.TriggerId) + ' 1 5 11 ' + |
1664 Gear^.TriggerId:= i + 1; |
1650 inttostr(hwRound(Gear^.X)) + ' ' + inttostr(hwRound(Gear^.Y)) + |
1665 FindPlace(Gear, false, 0, LAND_WIDTH); |
1651 ' ' + inttostr(Gear^.TriggerId), true); |
1666 end; |
1652 } end; |
1667 if ((GameFlags and gfExplosives) <> 0) then |
|
1668 for i:= 0 to Pred(cLandAdditions) do |
|
1669 begin |
|
1670 Gear:= AddGear(0, 0, gtExplosives, 0, _0, _0, 0); |
|
1671 Gear^.TriggerId:= i + 1; |
|
1672 FindPlace(Gear, false, 0, LAND_WIDTH); |
|
1673 end; |
|
1674 end; |
1653 |
1675 |
1654 if (GameFlags and gfLowGravity) <> 0 then |
1676 if (GameFlags and gfLowGravity) <> 0 then |
1655 cGravity:= cMaxWindSpeed / 2; |
1677 cGravity:= cMaxWindSpeed / 2; |
1656 |
1678 |
1657 if (GameFlags and gfVampiric) <> 0 then |
1679 if (GameFlags and gfVampiric) <> 0 then |
2095 inc(y); |
2120 inc(y); |
2096 until (y >= LAND_HEIGHT) or (CountNonZeroz(x, y, Gear^.Radius - 1, 1) <> 0); |
2121 until (y >= LAND_HEIGHT) or (CountNonZeroz(x, y, Gear^.Radius - 1, 1) <> 0); |
2097 |
2122 |
2098 if (y - sy > Gear^.Radius * 2) |
2123 if (y - sy > Gear^.Radius * 2) |
2099 and (y < LAND_HEIGHT) |
2124 and (y < LAND_HEIGHT) |
2100 and (CheckGearsNear(x, y - Gear^.Radius, [gtFlame, gtHedgehog, gtMine, gtCase], 110, 110) = nil) then |
2125 and (CheckGearsNear(x, y - Gear^.Radius, [gtFlame, gtHedgehog, gtMine, gtCase, gtExplosives], 110, 110) = nil) then |
2101 begin |
2126 begin |
2102 ar[cnt].X:= x; |
2127 ar[cnt].X:= x; |
2103 if withFall then ar[cnt].Y:= sy + Gear^.Radius |
2128 if withFall then ar[cnt].Y:= sy + Gear^.Radius |
2104 else ar[cnt].Y:= y - Gear^.Radius; |
2129 else ar[cnt].Y:= y - Gear^.Radius; |
2105 inc(cnt) |
2130 inc(cnt) |