hedgewars/uGearsHedgehog.pas
changeset 10105 8c5fa1d15bd5
parent 10015 4feced261c68
child 10108 c68cf030eded
equal deleted inserted replaced
10104:cb0b750bd8a3 10105:8c5fa1d15bd5
   183     if ((Gear^.Message and gmPrecise) <> 0) and ((CurWeapon^.Propz and ammoprop_SetBounce) <> 0) then
   183     if ((Gear^.Message and gmPrecise) <> 0) and ((CurWeapon^.Propz and ammoprop_SetBounce) <> 0) then
   184         begin
   184         begin
   185         color:= Gear^.Hedgehog^.Team^.Clan^.Color;
   185         color:= Gear^.Hedgehog^.Team^.Clan^.Color;
   186         case Gear^.MsgParam of
   186         case Gear^.MsgParam of
   187             1: begin
   187             1: begin
   188                AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce1]), color, capgrpAmmostate);
   188                AddCaption(FormatPChar(trmsg[sidBounce], trmsg[sidBounce1]), color, capgrpAmmostate);
   189                CurWeapon^.Bounciness:= 350;
   189                CurWeapon^.Bounciness:= 350;
   190                end;
   190                end;
   191             2: begin
   191             2: begin
   192                AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce2]), color, capgrpAmmostate);
   192                AddCaption(FormatPChar(trmsg[sidBounce], trmsg[sidBounce2]), color, capgrpAmmostate);
   193                CurWeapon^.Bounciness:= 700;
   193                CurWeapon^.Bounciness:= 700;
   194                end;
   194                end;
   195             3: begin
   195             3: begin
   196                AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce3]), color, capgrpAmmostate);
   196                AddCaption(FormatPChar(trmsg[sidBounce], trmsg[sidBounce3]), color, capgrpAmmostate);
   197                CurWeapon^.Bounciness:= 1000;
   197                CurWeapon^.Bounciness:= 1000;
   198                end;
   198                end;
   199             4: begin
   199             4: begin
   200                AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce4]), color, capgrpAmmostate);
   200                AddCaption(FormatPChar(trmsg[sidBounce], trmsg[sidBounce4]), color, capgrpAmmostate);
   201                CurWeapon^.Bounciness:= 2000;
   201                CurWeapon^.Bounciness:= 2000;
   202                end;
   202                end;
   203             5: begin
   203             5: begin
   204                AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce5]), color, capgrpAmmostate);
   204                AddCaption(FormatPChar(trmsg[sidBounce], trmsg[sidBounce5]), color, capgrpAmmostate);
   205                CurWeapon^.Bounciness:= 4000;
   205                CurWeapon^.Bounciness:= 4000;
   206                end
   206                end
   207             end
   207             end
   208         end
   208         end
   209     else if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
   209     else if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
   531         Inc(MultiShootAttacks);
   531         Inc(MultiShootAttacks);
   532 
   532 
   533         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
   533         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
   534             begin
   534             begin
   535             s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1);
   535             s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1);
   536             AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate);
   536             AddCaption(formatPChar(trmsg[sidRemaining], Str2Pchar(s)), cWhiteColor, capgrpAmmostate);
   537             end;
   537             end;
   538 
   538 
   539         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks)
   539         if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks)
   540         or ((GameFlags and gfMultiWeapon) <> 0) then
   540         or ((GameFlags and gfMultiWeapon) <> 0) then
   541             begin
   541             begin
   649         begin
   649         begin
   650         if cnt <> 0 then
   650         if cnt <> 0 then
   651             s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(cnt) + ')'
   651             s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(cnt) + ')'
   652         else
   652         else
   653             s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(Ammoz[ammo].NumberInCase) + ')';
   653             s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(Ammoz[ammo].NumberInCase) + ')';
   654         AddCaption(s, HH.Team^.Clan^.Color, capgrpAmmoinfo);
   654         AddCaption(Str2PChar(s), HH.Team^.Clan^.Color, capgrpAmmoinfo);
   655 
   655 
   656         // show ammo icon
   656         // show ammo icon
   657         vga:= AddVisualGear(X, Y, vgtAmmo);
   657         vga:= AddVisualGear(X, Y, vgtAmmo);
   658         if vga <> nil then
   658         if vga <> nil then
   659             vga^.Frame:= Longword(ammo);
   659             vga^.Frame:= Longword(ammo);
   712                     PlaySound(sndShotgunReload);
   712                     PlaySound(sndShotgunReload);
   713                     inc(HH^.Health, Gear^.Health);
   713                     inc(HH^.Health, Gear^.Health);
   714                     HH^.Hedgehog^.Effects[hePoisoned] := 0;
   714                     HH^.Hedgehog^.Effects[hePoisoned] := 0;
   715                     str(Gear^.Health, s);
   715                     str(Gear^.Health, s);
   716                     s:= '+' + s;
   716                     s:= '+' + s;
   717                     AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   717                     AddCaption(Str2PChar(s), HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   718                     RenderHealth(HH^.Hedgehog^);
   718                     RenderHealth(HH^.Hedgehog^);
   719                     RecountTeamHealth(HH^.Hedgehog^.Team);
   719                     RecountTeamHealth(HH^.Hedgehog^.Team);
   720 
   720 
   721                     i:= 0;
   721                     i:= 0;
   722                     while i < Gear^.Health do
   722                     while i < Gear^.Health do
  1266             else
  1266             else
  1267                 begin
  1267                 begin
  1268                 Gear^.State:= (Gear^.State or gstHHDeath) and (not gstAnimation);
  1268                 Gear^.State:= (Gear^.State or gstHHDeath) and (not gstAnimation);
  1269                 Gear^.doStep:= @doStepHedgehogDead;
  1269                 Gear^.doStep:= @doStepHedgehogDead;
  1270                 // Death message
  1270                 // Death message
  1271                 AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1271                 AddCaption(FormatPChar(GetEventString(eidDied), Str2PChar(Gear^.Hedgehog^.Name)), cWhiteColor, capgrpMessage);
  1272                 end;
  1272                 end;
  1273             end
  1273             end
  1274         else
  1274         else
  1275             begin
  1275             begin
  1276             Gear^.State:= Gear^.State and (not gstAnimation);
  1276             Gear^.State:= Gear^.State and (not gstAnimation);
  1277             Gear^.doStep:= @doStepHedgehogGone;
  1277             Gear^.doStep:= @doStepHedgehogGone;
  1278 
  1278 
  1279             // Gone message
  1279             // Gone message
  1280             AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
  1280             AddCaption(FormatPChar(GetEventString(eidGone), Str2PChar(Gear^.Hedgehog^.Name)), cWhiteColor, capgrpMessage);
  1281             end
  1281             end
  1282         end;
  1282         end;
  1283     exit
  1283     exit
  1284     end;
  1284     end;
  1285 
  1285