hedgewars/uChat.pas
changeset 2017 7845c77c8d31
parent 2003 41b3d00949ca
child 2111 9be70514954c
equal deleted inserted replaced
2016:73b0bcc4396d 2017:7845c77c8d31
   130 end;
   130 end;
   131 
   131 
   132 procedure AcceptChatString(s: shortstring);
   132 procedure AcceptChatString(s: shortstring);
   133 var i: TWave;
   133 var i: TWave;
   134 begin
   134 begin
       
   135 // "Make hedgehog say something"
       
   136 if (s[1] = '"') and (s[Length(s)] = '"') then 
       
   137     begin
       
   138     ParseCommand('/hogsay '+#1+copy(s, 2, Length(s)-2), true);
       
   139     exit
       
   140     end;
       
   141 // 'Make hedgehog think something'
       
   142 if (s[1] = '''') and (s[Length(s)] = '''') then 
       
   143     begin
       
   144     ParseCommand('/hogsay '+#2+copy(s, 2, Length(s)-2), true);
       
   145     exit
       
   146     end;
       
   147 // -Make hedgehog yell something-
       
   148 if (s[1] = '-') and (s[Length(s)] = '-') then 
       
   149     begin
       
   150     ParseCommand('/hogsay '+#3+copy(s, 2, Length(s)-2), true);
       
   151     exit
       
   152     end;
       
   153 // 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
       
   155     begin
       
   156     ParseCommand('/hogsay '+#4+copy(s, 6, Length(s)-5), true);
       
   157     exit
       
   158     end;
       
   159 if (s[1] = '/') and (copy(s, 1, 5) = '/hta ') then
       
   160     begin
       
   161     ParseCommand('/hogsay '+#5+copy(s, 6, Length(s)-5), true);
       
   162     exit
       
   163     end;
       
   164 if (s[1] = '/') and (copy(s, 1, 5) = '/hya ') then
       
   165     begin
       
   166     ParseCommand('/hogsay '+#6+copy(s, 6, Length(s)-5), true);
       
   167     exit
       
   168     end;
   135 if (s[1] = '/') and (copy(s, 1, 4) <> '/me ') then
   169 if (s[1] = '/') and (copy(s, 1, 4) <> '/me ') then
   136 	begin
   170 	begin
   137 	if CurrentTeam^.ExtDriven then exit;
   171 	if CurrentTeam^.ExtDriven then exit;
   138 	
   172 	
   139 	for i:= Low(TWave) to High(TWave) do
   173 	for i:= Low(TWave) to High(TWave) do
   141 			begin
   175 			begin
   142 			ParseCommand('/taunt ' + char(i), true);
   176 			ParseCommand('/taunt ' + char(i), true);
   143 			exit
   177 			exit
   144 			end;
   178 			end;
   145 	if (s = '/newgrave') then
   179 	if (s = '/newgrave') then
       
   180         begin
   146 	    ParseCommand('/newgrave', true);
   181 	    ParseCommand('/newgrave', true);
   147 	end
   182         exit
       
   183         end;
       
   184     end
   148 	else
   185 	else
   149 		ParseCommand('/say ' + s, true);
   186 		ParseCommand('/say ' + s, true);
   150 end;
   187 end;
   151 
   188 
   152 procedure KeyPressChat(Key: Longword);
   189 procedure KeyPressChat(Key: Longword);