545 begin |
545 begin |
546 Message:= Message and not gm_Attack; |
546 Message:= Message and not gm_Attack; |
547 State:= State or gstFalling; |
547 State:= State or gstFalling; |
548 end; |
548 end; |
549 DeleteGear(Gear); |
549 DeleteGear(Gear); |
550 OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^.Ammo); |
550 OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
551 ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
551 ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
552 end; |
552 end; |
553 |
553 |
554 begin |
554 begin |
555 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
555 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1160 HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
1160 HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
1161 HHGear^.State:= HHGear^.State or gstFalling |
1161 HHGear^.State:= HHGear^.State or gstFalling |
1162 end; |
1162 end; |
1163 TargetPoint.X:= NoPointX |
1163 TargetPoint.X:= NoPointX |
1164 end; |
1164 end; |
|
1165 |
|
1166 //////////////////////////////////////////////////////////////////////////////// |
|
1167 procedure doStepSwitcherWork(Gear: PGear); |
|
1168 var HHGear: PGear; |
|
1169 Team: PTeam; |
|
1170 th: LongInt; |
|
1171 Msg, State: Longword; |
|
1172 begin |
|
1173 AllInactive:= false; |
|
1174 |
|
1175 if (Gear^.Message and not gm_Switch) <> 0 then |
|
1176 begin |
|
1177 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1178 Msg:= Gear^.Message and not gm_Switch; |
|
1179 DeleteGear(Gear); |
|
1180 OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^); |
|
1181 |
|
1182 HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1183 ApplyAmmoChanges(PHedgehog(Gear^.Hedgehog)^); |
|
1184 HHGear^.Message:= Msg; |
|
1185 exit |
|
1186 end; |
|
1187 |
|
1188 if (Gear^.Message and gm_Switch) <> 0 then |
|
1189 begin |
|
1190 HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1191 HHGear^.Message:= HHGear^.Message and not gm_Switch; |
|
1192 State:= HHGear^.State; |
|
1193 HHGear^.State:= 0; |
|
1194 HHGear^.Active:= false; |
|
1195 HHGear^.Z:= cHHZ; |
|
1196 RemoveGearFromList(HHGear); |
|
1197 InsertGearToList(HHGear); |
|
1198 |
|
1199 th:= CurrentTeam^.CurrHedgehog; |
|
1200 repeat |
|
1201 CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (cMaxHHIndex + 1); |
|
1202 until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (Gear^.Pos = th); |
|
1203 |
|
1204 HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1205 HHGear^.State:= State; |
|
1206 HHGear^.Active:= true; |
|
1207 FollowGear:= HHGear; |
|
1208 HHGear^.Z:= cCurrHHZ; |
|
1209 RemoveGearFromList(HHGear); |
|
1210 InsertGearToList(HHGear); |
|
1211 Gear^.X:= HHGear^.X; |
|
1212 Gear^.Y:= HHGear^.Y |
|
1213 end; |
|
1214 end; |
|
1215 |
|
1216 procedure doStepSwitcher(Gear: PGear); |
|
1217 var HHGear: PGear; |
|
1218 begin |
|
1219 Gear^.doStep:= @doStepSwitcherWork; |
|
1220 |
|
1221 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1222 with HHGear^ do |
|
1223 begin |
|
1224 State:= State and not gstAttacking; |
|
1225 Message:= Message and not gm_Attack |
|
1226 end |
|
1227 end; |