hedgewars/uChat.pas
changeset 13837 6e4e745f42bb
parent 13832 10a3b80130b5
child 13838 2b6702777c8c
equal deleted inserted replaced
13836:ff468792298a 13837:6e4e745f42bb
   359                     SpeechHogNumber:= byte(c) - 48;
   359                     SpeechHogNumber:= byte(c) - 48;
   360                 end;
   360                 end;
   361             // default to current hedgehog (if own) or first hedgehog
   361             // default to current hedgehog (if own) or first hedgehog
   362             if SpeechHogNumber = 0 then
   362             if SpeechHogNumber = 0 then
   363                 begin
   363                 begin
   364                 if not CurrentTeam^.ExtDriven then
   364                 if (not CurrentTeam^.ExtDriven) and (CurrentTeam^.Hedgehogs[0].BotLevel = 0) then
   365                     SpeechHogNumber:= CurrentTeam^.CurrHedgehog + 1
   365                     SpeechHogNumber:= CurrentTeam^.CurrHedgehog + 1
   366                 else
   366                 else
   367                     SpeechHogNumber:= 1;
   367                     SpeechHogNumber:= 1;
   368                 end;
   368                 end;
   369             end;
   369             end;
   447 
   447 
   448 // yelling bubble
   448 // yelling bubble
   449 else if (s[1] = '-') and (s[Length(s)] = '-') then
   449 else if (s[1] = '-') and (s[Length(s)] = '-') then
   450     x:= 3;
   450     x:= 3;
   451 
   451 
   452 if (not CurrentTeam^.ExtDriven) and (x <> 0) then
   452 if (not CurrentTeam^.ExtDriven) and (CurrentTeam^.Hedgehogs[0].BotLevel = 0) and (x <> 0) then
   453     for c:= 0 to Pred(TeamsCount) do
   453     for c:= 0 to Pred(TeamsCount) do
   454         if (TeamsArray[c] = CurrentTeam) then
   454         if (TeamsArray[c] = CurrentTeam) then
   455             t:= c;
   455             t:= c;
   456 
   456 
   457 if x <> 0 then
   457 if x <> 0 then
   475         exit;
   475         exit;
   476 
   476 
   477     // Speech bubble, but on next attack
   477     // Speech bubble, but on next attack
   478     if (copy(s, 2, 4) = 'hsa ') then
   478     if (copy(s, 2, 4) = 'hsa ') then
   479         begin
   479         begin
   480         if CurrentTeam^.ExtDriven then
   480         if (CurrentTeam^.ExtDriven or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0)) then
   481             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   481             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   482         else
   482         else
   483             SendHogSpeech(#4 + copy(s, 6, Length(s)-5));
   483             SendHogSpeech(#4 + copy(s, 6, Length(s)-5));
   484         exit
   484         exit
   485         end;
   485         end;
   486 
   486 
   487     // Thinking bubble, but on next attack
   487     // Thinking bubble, but on next attack
   488     if (copy(s, 2, 4) = 'hta ') then
   488     if (copy(s, 2, 4) = 'hta ') then
   489         begin
   489         begin
   490         if CurrentTeam^.ExtDriven then
   490         if (CurrentTeam^.ExtDriven or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0)) then
   491             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   491             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   492         else
   492         else
   493             SendHogSpeech(#5 + copy(s, 6, Length(s)-5));
   493             SendHogSpeech(#5 + copy(s, 6, Length(s)-5));
   494         exit
   494         exit
   495         end;
   495         end;
   496 
   496 
   497     // Yelling bubble, but on next attack
   497     // Yelling bubble, but on next attack
   498     if (copy(s, 2, 4) = 'hya ') then
   498     if (copy(s, 2, 4) = 'hya ') then
   499         begin
   499         begin
   500         if CurrentTeam^.ExtDriven then
   500         if (CurrentTeam^.ExtDriven or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0)) then
   501             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   501             ParseCommand('/say ' + copy(s, 6, Length(s)-5), true)
   502         else
   502         else
   503             SendHogSpeech(#6 + copy(s, 6, Length(s)-5));
   503             SendHogSpeech(#6 + copy(s, 6, Length(s)-5));
   504         exit
   504         exit
   505         end;
   505         end;