hedgewars/CCHandlers.inc
changeset 2990 b62e567f17b9
parent 2963 0f0789204802
child 3006 da6023c2745b
equal deleted inserted replaced
2989:b49d87499398 2990:b62e567f17b9
   390 procedure chNextTurn(var s: shortstring);
   390 procedure chNextTurn(var s: shortstring);
   391 begin
   391 begin
   392 TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
   392 TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
   393 
   393 
   394 if not CurrentTeam^.ExtDriven then SendIPC('N');
   394 if not CurrentTeam^.ExtDriven then SendIPC('N');
   395 TickTrigger(trigTurns);
       
   396 {$IFDEF DEBUGFILE}AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));{$ENDIF}
   395 {$IFDEF DEBUGFILE}AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));{$ENDIF}
   397 end;
   396 end;
   398 
   397 
   399 procedure chSay(var s: shortstring);
   398 procedure chSay(var s: shortstring);
   400 begin
   399 begin
   718 procedure chRotateMask(var s: shortstring);
   717 procedure chRotateMask(var s: shortstring);
   719 begin
   718 begin
   720 if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask];
   719 if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask];
   721 end;
   720 end;
   722 
   721 
   723 procedure chAddTrigger(var s: shortstring);
       
   724 const MAXPARAMS = 16;
       
   725 var params: array[0..Pred(MAXPARAMS)] of Longword;
       
   726     i: LongInt;
       
   727     c: char;
       
   728     tmp: shortstring;
       
   729 begin
       
   730 c:= s[1];
       
   731 Delete(s, 1, 1);
       
   732 
       
   733 i:= 0;
       
   734 while (i < MAXPARAMS) and
       
   735     (Length(s) > 0) do
       
   736     begin
       
   737     SplitBySpace(s, tmp);
       
   738     val(s, params[i]);
       
   739     s:= tmp;
       
   740     inc(i)
       
   741     end;
       
   742 
       
   743 case c of
       
   744 's': begin // sTYPE TICKS LIVES GEARTYPE X Y GEARTRIGGER
       
   745     TryDo(i = 7, errmsgWrongNumber, true);
       
   746     AddTriggerSpawner(params[0], params[1], params[2], TGearType(params[3]), params[4], params[5], params[6]);
       
   747     end;
       
   748 'C': begin
       
   749     TryDo(i = 3, errmsgWrongNumber, true);
       
   750     AddTriggerSuccess(params[0], params[1], params[2]);
       
   751     end;
       
   752 'F': begin
       
   753     TryDo(i = 3, errmsgWrongNumber, true);
       
   754     AddTriggerFail(params[0], params[1], params[2]);
       
   755     end;
       
   756 end
       
   757 end;
       
   758 
       
   759 procedure chSpeedup_p(var s: shortstring);
   722 procedure chSpeedup_p(var s: shortstring);
   760 begin
   723 begin
   761 isSpeed:= true
   724 isSpeed:= true
   762 end;
   725 end;
   763 
   726