146 amGasBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtGasBomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer); |
148 amGasBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtGasBomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer); |
147 amBazooka: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Grenade, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
149 amBazooka: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Grenade, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
148 amBee: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtBee, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
150 amBee: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtBee, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
149 amShotgun: begin |
151 amShotgun: begin |
150 PlaySound(sndShotgunReload); |
152 PlaySound(sndShotgunReload); |
151 CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtShotgunShot, 0, xx * _0_5, yy * _0_5, 0); |
153 AddGear(hwRound(X), hwRound(Y), gtShotgunShot, 0, xx * _0_5, yy * _0_5, 0); |
152 end; |
154 end; |
153 amPickHammer: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + cHHRadius, gtPickHammer, 0, _0, _0, 0); |
155 amPickHammer: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + cHHRadius, gtPickHammer, 0, _0, _0, 0); |
154 amSkip: ParseCommand('/skip', true); |
156 amSkip: ParseCommand('/skip', true); |
155 amRope: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtRope, 0, xx, yy, 0); |
157 amRope: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtRope, 0, xx, yy, 0); |
156 amMine: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); |
158 amMine: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); |
157 amDEagle: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); |
159 amDEagle: AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); |
158 amSineGun: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); |
160 amSineGun: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); |
159 (* |
|
160 Ok. Here's where I plan to go with this. |
|
161 1) Restrict portal gun to X shots. |
|
162 2) If on first shot, delete all existing gtPortal |
|
163 3) On any other shot, delete any existing portals of type X%2, and spawn a new portal of type X%2 oriented at angle 180° from the portal gun. It might possibly be worth linking portals with a Gear reference, to save time on scanning through the Gear list every time we need a portal. |
|
164 *) |
|
165 amPortalGun: begin |
161 amPortalGun: begin |
166 //if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= MultiShootAttacks) then |
162 iterator:= GearsList; |
167 |
163 portal:= nil; |
168 |
164 while iterator <> nil do |
169 //CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 0); |
165 begin |
170 AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 0); |
166 if (iterator^.Kind = gtPortal) then |
171 |
167 begin |
172 |
168 newGear:= iterator; |
173 |
169 iterator:= iterator^.NextGear; |
|
170 if (portal <> nil) then |
|
171 begin |
|
172 if (portal^.uid < newGear^.uid) then |
|
173 begin |
|
174 DeleteGear(portal); |
|
175 portal:= newGear |
|
176 end |
|
177 else |
|
178 begin |
|
179 if newGear^.NextGear = nil then iterator:= nil; |
|
180 DeleteGear(newGear); |
|
181 end |
|
182 end |
|
183 else portal:= newGear |
|
184 end |
|
185 else iterator:= iterator^.NextGear |
|
186 end; |
|
187 |
|
188 newGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 0); |
|
189 if portal <> nil then |
|
190 begin |
|
191 newGear^.IntersectGear:= portal; |
|
192 if portal^.Tag < 2 then newGear^.Tag:= 2 |
|
193 end; |
|
194 newGear^.Angle:= Angle; |
|
195 newGear^.DirAngle:= Angle * 180 / cMaxAngle - 90; |
|
196 if Gear^.DirAngle < 0 then Gear^.DirAngle:= Gear^.DirAngle + 360 |
|
197 else if 360 < Gear^.DirAngle then Gear^.DirAngle:= Gear^.DirAngle - 360; |
|
198 Ammo^[CurSlot, CurAmmo].Timer:= 0 |
174 end; |
199 end; |
175 |
|
176 |
|
177 |
|
178 |
|
179 amSniperRifle: begin |
200 amSniperRifle: begin |
180 PlaySound(sndSniperReload); |
201 PlaySound(sndSniperReload); |
181 CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0); |
202 CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0); |
182 end; |
203 end; |
183 amDynamite: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000); |
204 amDynamite: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000); |