: There is no limitation. For example, try this code:
:
: MyOffer.nDeliver:=1;
: MyOffer.nCost:=1;
: MyOffer.Price[0]:=opTech+adBronzeWorking;
: MyOffer.Price[1]:=opTech+adAlphabet;
: MyAction:=scDipOffer;
:
:
: Steffen
:
I have tried the code but it does the same. I logged in a file OppoAction,OppoOffer.nCost and OppoOffer.nDeliver at the beggining of the procedure, and, MyAction,MyOffer.nCost and MyOffer.nDeliver at the end.
Log (at the end I attach the code used):
Turn (begin of procedure): Opponent->me OppoAction OppoOffer.nCost OppoOffer.nDeliver
Turn (end of procedure): me->Opponent MyAction MyOffer.nCost MyOffer.nDeliver
27: 6->1 4B00 0 0
27: 1->6 4B4E 0 1 PEACE TREATY OFFER
27: 1->6 4B4E 0 1 PEACE TREATY ACCEPTED
27: 6->1 4B20 0 0
27: 6->1 4B20 0 0
27: 1->6 4B4E 0 1 FRIENDLY CONTACT TREATY OFFER
27: 1->6 4B4E 0 1
27: 6->1 4B20 0 0
27: 6->1 4B20 0 0
27: 1->6 4B4E 0 1 ALLIANCE TREATY OFFER
27: 1->6 4B4E 0 1
27: 6->1 4B20 0 0
27: 6->1 4B20 0 0
27: 1->6 4B4E 0 1 CIVIL REPORT EXCHANGE OFFER
27: 1->6 4B4E 0 1
27: 6->1 4B20 0 0
27: 6->1 4B20 0 0
27: 1->6 4B4E 1 1 ADVANCE EXCHANGE OFFER
27: 1->6 4B4E 0 0 HERE THE ADVANCE EXCHANGE OFFER HAS TURN INTO A NULL EXCHANGE!!!
27: 6->1 4BF0 0 0
*********************** CODE ********************
procedure TAI.DoNegotiation;
var
ad,MyCnt,OppCnt,MyAdvance,OppAdvance:integer;
MyExchAdv, OppExchAdv: array [0..(nAdv - 1)] of Integer;
begin
case OppoAction of
scContact:
begin
MyAction:=scDipStart;
end;
scDipAccept,scDipStart,scDipNotice:
begin
if (RO.Treaty[Opponent]
begin
MyOffer.nCost:=0;
MyOffer.nDeliver:=1;
MyOffer.Price[0]:=opTreaty+trPeace; // offer peace in exchange of nothing
MyAction:=scDipOffer;
end
else
begin
MyAction:=scDipBreak;
end;
end
else if (RO.Treaty[Opponent]=trPeace) then begin
MyOffer.nCost:=0;
MyOffer.nDeliver:=1;
MyOffer.Price[0]:=opTreaty+trFriendlyContact; // offer peace in exchange of nothing
end
else if (RO.Treaty[Opponent]=trFriendlyContact) then begin
MyOffer.nCost:=0;
MyOffer.nDeliver:=1;
MyOffer.Price[0]:=opTreaty+trAlliance; // offer peace in exchange of nothing
end
else if (RO.Treaty[Opponent]=trAlliance) then begin
if RO.Turn-last_civil_report[Opponent]>40 then begin // Civil Report exchange
last_civil_report[Opponent]:=RO.Turn;
MyOffer.ncost:=0;
MyOffer.nDeliver:=1;
// MyOffer.Price[0]:=opCivilReport + Opponent shl 16;
MyOffer.Price[0]:=opCivilReport + me shl 16;
MyAction:=scDipOffer;
end
else //Advances exchange
begin
// MyOffer.nDeliver:=1;
// MyOffer.nCost:=1;
// MyOffer.Price[0]:=opTech+adBronzeWorking;
// MyOffer.Price[1]:=opTech+adAlphabet;
// MyAction:=scDipOffer;
MyCnt := 0;
OppCnt := 0;
for ad := adAdvancedFlight to adRefining do begin
if ((RO.Tech[ad] < tsSeen) and (RO.EnemyReport[Opponent].Tech[ad] >= tsApplicable)) then begin
OppExchAdv[OppCnt] := ad;
Inc(OppCnt);
end;
if ((RO.Tech[ad] >= tsApplicable) and (RO.EnemyReport[Opponent].Tech[ad] < tsSeen)) then begin
MyExchAdv[MyCnt] := ad;
Inc(MyCnt);
end;
end;
if ((MyCnt > 0) and (OppCnt > 0)) then begin
MyAdvance := MyExchAdv[Random(MyCnt)];
OppAdvance := OppExchAdv[Random(OppCnt)];
MyOffer.nCost:=1;
MyOffer.nDeliver:=0;
MyOffer.Price[0]:=opTech+OppAdvance ;
// MyOffer.Price[0]:=opTech+MyAdvance ;
MyAction:=scDipOffer;
end
else
MyAction:=scDipBreak;
end;
end
else
begin
MyAction:=scDipBreak;
end;
end;
scDipCancelTreaty:
begin
MyAction:=scDipNotice;
end;
scDipOffer:
begin
if (OppoOffer.nCost=0) and (OppoOffer.nDeliver=1)
and ((OppoOffer.Price[0] and opTreaty)=opTreaty) then
MyAction:=scDipAccept // accept peace
else if (OppoOffer.nCost=0) and (OppoOffer.nDeliver=1)
and ((OppoOffer.Price[0] and opCivilReport)=opCivilReport) then
MyAction:=scDipAccept
else if (OppoOffer.nCost=1) and (OppoOffer.nDeliver=1)
and ((OppoOffer.Price[0] and opTech)=opTech) and ((OppoOffer.Price[1] and opTech)=opTech) then
// else if (OppoOffer.nCost=1) and (OppoOffer.nDeliver=0)
// and ((OppoOffer.Price[0] and opTech)=opTech) then
MyAction:=scDipAccept // accept advance exchange
else if (OppoOffer.nCost=0) and (OppoOffer.nDeliver=0) then begin
MyAction:=scDipBreak;
end
else
MyAction:=scDipBreak;
end;
scDipBreak:
begin
MyAction:=scDipNotice;
end;
else
begin
MyAction:=scDipBreak;
end;
end;
end;
