hedgewars/GSHandlers.inc
changeset 2278 28519f4f3f21
parent 2267 ad372e549cc5
child 2280 786fb5d8107d
equal deleted inserted replaced
2277:a9c0b37955fa 2278:28519f4f3f21
  2241 //AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate);
  2241 //AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate);
  2242        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  2242        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  2243        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall)
  2243        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall)
  2244        end;
  2244        end;
  2245 
  2245 
       
  2246 if HHGear^.Message and (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then Gear^.State:= Gear^.State and not gsttmpFlag;
  2246 HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
  2247 HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
  2247 HHGear^.State:= HHGear^.State or gstMoving; 
  2248 HHGear^.State:= HHGear^.State or gstMoving; 
  2248 
  2249 
  2249 Gear^.X:= HHGear^.X;
  2250 Gear^.X:= HHGear^.X;
  2250 Gear^.Y:= HHGear^.Y;
  2251 Gear^.Y:= HHGear^.Y;
  2251 // For some reason I need to reapply followgear here, something else grabs it otherwise.
  2252 // For some reason I need to reapply followgear here, something else grabs it otherwise.
  2252 if not bShowAmmoMenu then FollowGear:= HHGear;
  2253 if not bShowAmmoMenu then FollowGear:= HHGear;
  2253 doStepHedgehogMoving(HHGear);
  2254 
       
  2255 if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear);
  2254 
  2256 
  2255 if  (Gear^.Health = 0)
  2257 if  (Gear^.Health = 0)
  2256     or (HHGear^.Damage <> 0)
  2258     or (HHGear^.Damage <> 0)
  2257 	or CheckGearDrowning(HHGear)
  2259 	or CheckGearDrowning(HHGear)
  2258     or (TurnTimeLeft = 0) 
  2260     or (TurnTimeLeft = 0) 
  2281 
  2283 
  2282 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
  2284 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
  2283 FollowGear:= HHGear;
  2285 FollowGear:= HHGear;
  2284 OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
  2286 OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
  2285 ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
  2287 ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
       
  2288 Gear^.State:= Gear^.State or gsttmpFlag;
  2286 with HHGear^ do
  2289 with HHGear^ do
  2287 	begin
  2290 	begin
  2288 	State:= State and not gstAttacking;
  2291 	State:= State and not gstAttacking;
  2289 	Message:= Message and not gm_Attack;
  2292 	Message:= Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right);
  2290     dY:= dY - _0_2
  2293     dY:= dY - _0_2
  2291 	end
  2294 	end
  2292 end;
  2295 end;