hedgewars/uGearsUtils.pas
branchwebgl
changeset 8833 c13ebed437cb
parent 8330 aaefa587e277
parent 8763 988901d27abf
child 9127 e350500c4edb
equal deleted inserted replaced
8450:404ddce27b23 8833:c13ebed437cb
   135                                 if not Gear^.Invulnerable then
   135                                 if not Gear^.Invulnerable then
   136                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
   136                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
   137                                 Gear^.Active:= true;
   137                                 Gear^.Active:= true;
   138                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear
   138                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear
   139                                 end;
   139                                 end;
   140                             if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) then
   140                             if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) and ((Gear^.State and gstHHDeath) = 0) then
   141                                 Gear^.Hedgehog^.Effects[hePoisoned] := 1;
   141                                 Gear^.Hedgehog^.Effects[hePoisoned] := 1;
   142                             end;
   142                             end;
   143 
   143 
   144                         end;
   144                         end;
   145                 gtGrave: begin
   145                 gtGrave: begin
   180    King check should be in here instead of ApplyDamage since Tiy wants them kicked less
   180    King check should be in here instead of ApplyDamage since Tiy wants them kicked less
   181 *)
   181 *)
   182 i:= _1;
   182 i:= _1;
   183 if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then
   183 if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then
   184     i:= _1_5;
   184     i:= _1_5;
   185 if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King) then
   185 if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then
   186     ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5)
   186     ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5)
   187 else
   187 else
   188     ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent)
   188     ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent)
   189 end;
   189 end;
   190 
   190 
   578             while y < cWaterLine do
   578             while y < cWaterLine do
   579                 begin
   579                 begin
   580                 repeat
   580                 repeat
   581                     inc(y, 2);
   581                     inc(y, 2);
   582                 until (y >= cWaterLine) or
   582                 until (y >= cWaterLine) or
   583                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or
   583                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or 
   584                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) = 0));
   584                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) = 0));
   585 
   585 
   586                 sy:= y;
   586                 sy:= y;
   587 
   587 
   588                 repeat
   588                 repeat
   589                     inc(y);
   589                     inc(y);
   590                 until (y >= cWaterLine) or
   590                 until (y >= cWaterLine) or
   591                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or
   591                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or 
   592                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) <> 0));
   592                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) <> 0)); 
   593 
   593 
   594                 if (y - sy > Gear^.Radius * 2)
   594                 if (y - sy > Gear^.Radius * 2)
   595                     and (((Gear^.Kind = gtExplosives)
   595                     and (((Gear^.Kind = gtExplosives)
   596                     and (y < cWaterLine)
   596                     and (y < cWaterLine)
   597                     and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))
   597                     and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))