hedgewars/uGearsUtils.pas
changeset 13647 3d14950641a4
parent 13634 c9a49d06f1a2
child 13778 effef930bd57
equal deleted inserted replaced
13646:007813b81f1b 13647:3d14950641a4
   188                                 (Gear^.State and gstHHDeath = 0) then
   188                                 (Gear^.State and gstHHDeath = 0) then
   189                                     begin
   189                                     begin
   190                                     if Gear^.Hedgehog^.Effects[hePoisoned] = 0 then
   190                                     if Gear^.Hedgehog^.Effects[hePoisoned] = 0 then
   191                                         begin
   191                                         begin
   192                                         s:= ansistring(Gear^.Hedgehog^.Name);
   192                                         s:= ansistring(Gear^.Hedgehog^.Name);
   193                                         AddCaption(FormatA(GetEventString(eidPoisoned), s), cWhiteColor, capgrpMessage);
   193                                         AddCaption(FormatA(GetEventString(eidPoisoned), s), capcolDefault, capgrpMessage);
   194                                         uStats.HedgehogPoisoned(Gear, AttackingHog)
   194                                         uStats.HedgehogPoisoned(Gear, AttackingHog)
   195                                         end;
   195                                         end;
   196                                     Gear^.Hedgehog^.Effects[hePoisoned] := 5;
   196                                     Gear^.Hedgehog^.Effects[hePoisoned] := 5;
   197                                     end
   197                                     end
   198                             end;
   198                             end;
   732                             begin
   732                             begin
   733                             DrownGear(Gear);
   733                             DrownGear(Gear);
   734                             Gear^.State := Gear^.State and (not gstHHDriven);
   734                             Gear^.State := Gear^.State and (not gstHHDriven);
   735                             s:= ansistring(Gear^.Hedgehog^.Name);
   735                             s:= ansistring(Gear^.Hedgehog^.Name);
   736                             if Gear^.Hedgehog^.King then
   736                             if Gear^.Hedgehog^.King then
   737                                 AddCaption(FormatA(GetEventString(eidKingDied), s), cWhiteColor, capgrpMessage)
   737                                 AddCaption(FormatA(GetEventString(eidKingDied), s), capcolDefault, capgrpMessage)
   738                             else
   738                             else
   739                                 AddCaption(FormatA(GetEventString(eidDrowned), s), cWhiteColor, capgrpMessage);
   739                                 AddCaption(FormatA(GetEventString(eidDrowned), s), capcolDefault, capgrpMessage);
   740                             end
   740                             end
   741                         end
   741                         end
   742                     else
   742                     else
   743                         DrownGear(Gear);
   743                         DrownGear(Gear);
   744                     if Gear^.Kind = gtFlake then
   744                     if Gear^.Kind = gtFlake then
  1578     FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1578     FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1579     FollowGear^.Health:= cHealthCaseAmount;
  1579     FollowGear^.Health:= cHealthCaseAmount;
  1580     FollowGear^.Pos:= posCaseHealth;
  1580     FollowGear^.Pos:= posCaseHealth;
  1581     // health crate is smaller than the other crates
  1581     // health crate is smaller than the other crates
  1582     FollowGear^.Radius := cCaseHealthRadius;
  1582     FollowGear^.Radius := cCaseHealthRadius;
  1583     AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
  1583     AddCaption(GetEventString(eidNewHealthPack), capcolDefault, capgrpAmmoInfo);
  1584     end
  1584     end
  1585 else if (t<a+h) then
  1585 else if (t<a+h) then
  1586     begin
  1586     begin
  1587     t:= aTot;
  1587     t:= aTot;
  1588     if (t > 0) then
  1588     if (t > 0) then
  1590         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1590         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1591         t:= GetRandom(t);
  1591         t:= GetRandom(t);
  1592         i:= Low(TAmmoType);
  1592         i:= Low(TAmmoType);
  1593         FollowGear^.Pos:= posCaseAmmo;
  1593         FollowGear^.Pos:= posCaseAmmo;
  1594         FollowGear^.AmmoType:= i;
  1594         FollowGear^.AmmoType:= i;
  1595         AddCaption(GetEventString(eidNewAmmoPack), cWhiteColor, capgrpAmmoInfo);
  1595         AddCaption(GetEventString(eidNewAmmoPack), capcolDefault, capgrpAmmoInfo);
  1596         end
  1596         end
  1597     end
  1597     end
  1598 else
  1598 else
  1599     begin
  1599     begin
  1600     t:= uTot;
  1600     t:= uTot;
  1603         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1603         FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1604         t:= GetRandom(t);
  1604         t:= GetRandom(t);
  1605         i:= Low(TAmmoType);
  1605         i:= Low(TAmmoType);
  1606         FollowGear^.Pos:= posCaseUtility;
  1606         FollowGear^.Pos:= posCaseUtility;
  1607         FollowGear^.AmmoType:= i;
  1607         FollowGear^.AmmoType:= i;
  1608         AddCaption(GetEventString(eidNewUtilityPack), cWhiteColor, capgrpAmmoInfo);
  1608         AddCaption(GetEventString(eidNewUtilityPack), capcolDefault, capgrpAmmoInfo);
  1609         end
  1609         end
  1610     end;
  1610     end;
  1611 
  1611 
  1612 // handles case of no ammo or utility crates - considered also placing booleans in uAmmos and altering probabilities
  1612 // handles case of no ammo or utility crates - considered also placing booleans in uAmmos and altering probabilities
  1613 if (FollowGear <> nil) then
  1613 if (FollowGear <> nil) then