hedgewars/uChat.pas
changeset 2111 9be70514954c
parent 2017 7845c77c8d31
child 2112 1e1726fb6a90
equal deleted inserted replaced
2110:df2a1fe3617a 2111:9be70514954c
   133 var i: TWave;
   133 var i: TWave;
   134 begin
   134 begin
   135 // "Make hedgehog say something"
   135 // "Make hedgehog say something"
   136 if (s[1] = '"') and (s[Length(s)] = '"') then 
   136 if (s[1] = '"') and (s[Length(s)] = '"') then 
   137     begin
   137     begin
   138     ParseCommand('/hogsay '+#1+copy(s, 2, Length(s)-2), true);
   138     if CurrentTeam^.ExtDriven then
       
   139         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
       
   140     else
       
   141         ParseCommand('/hogsay '#1 + copy(s, 2, Length(s)-2), true);
   139     exit
   142     exit
   140     end;
   143     end;
   141 // 'Make hedgehog think something'
   144 // 'Make hedgehog think something'
   142 if (s[1] = '''') and (s[Length(s)] = '''') then 
   145 if (s[1] = '''') and (s[Length(s)] = '''') then 
   143     begin
   146     begin
   144     ParseCommand('/hogsay '+#2+copy(s, 2, Length(s)-2), true);
   147     if CurrentTeam^.ExtDriven then
       
   148         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
       
   149     else
       
   150         ParseCommand('/hogsay '#2 + copy(s, 2, Length(s)-2), true);
   145     exit
   151     exit
   146     end;
   152     end;
   147 // -Make hedgehog yell something-
   153 // -Make hedgehog yell something-
   148 if (s[1] = '-') and (s[Length(s)] = '-') then 
   154 if (s[1] = '-') and (s[Length(s)] = '-') then 
   149     begin
   155     begin
   150     ParseCommand('/hogsay '+#3+copy(s, 2, Length(s)-2), true);
   156     if CurrentTeam^.ExtDriven then
       
   157         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
       
   158     else
       
   159         ParseCommand('/hogsay '#3 + copy(s, 2, Length(s)-2), true);
   151     exit
   160     exit
   152     end;
   161     end;
   153 // These 3 are same as above, only are to make the hedgehog say it on next attack
   162 // These 3 are same as above, only are to make the hedgehog say it on next attack
   154 if (s[1] = '/') and (copy(s, 1, 5) = '/hsa ') then
   163 if (s[1] = '/') and (copy(s, 1, 5) = '/hsa ') then
   155     begin
   164     begin
   156     ParseCommand('/hogsay '+#4+copy(s, 6, Length(s)-5), true);
   165     if CurrentTeam^.ExtDriven then
       
   166         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
       
   167     else
       
   168         ParseCommand('/hogsay '#4 + copy(s, 2, Length(s)-2), true);
   157     exit
   169     exit
   158     end;
   170     end;
   159 if (s[1] = '/') and (copy(s, 1, 5) = '/hta ') then
   171 if (s[1] = '/') and (copy(s, 1, 5) = '/hta ') then
   160     begin
   172     begin
   161     ParseCommand('/hogsay '+#5+copy(s, 6, Length(s)-5), true);
   173     if CurrentTeam^.ExtDriven then
       
   174         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
       
   175     else
       
   176         ParseCommand('/hogsay '#5 + copy(s, 2, Length(s)-2), true);
   162     exit
   177     exit
   163     end;
   178     end;
   164 if (s[1] = '/') and (copy(s, 1, 5) = '/hya ') then
   179 if (s[1] = '/') and (copy(s, 1, 5) = '/hya ') then
   165     begin
   180     begin
   166     ParseCommand('/hogsay '+#6+copy(s, 6, Length(s)-5), true);
   181     if CurrentTeam^.ExtDriven then
   167     exit
   182         ParseCommand('/say ' + copy(s, 2, Length(s)-2), true)
   168     end;
   183     else
       
   184         ParseCommand('/hogsay '#6 + copy(s, 2, Length(s)-2), true);
       
   185     exit
       
   186     end;
       
   187 
   169 if (s[1] = '/') and (copy(s, 1, 4) <> '/me ') then
   188 if (s[1] = '/') and (copy(s, 1, 4) <> '/me ') then
   170 	begin
   189 	begin
   171 	if CurrentTeam^.ExtDriven then exit;
   190 	if CurrentTeam^.ExtDriven then exit;
   172 	
   191 	
   173 	for i:= Low(TWave) to High(TWave) do
   192 	for i:= Low(TWave) to High(TWave) do