Commit fb68d14816f9cb170791261491235f7a8bc0e1b2

Authored by Carlos Picanco
1 parent 25fb7ecb
Exists in master

BasA fix. it must use a gscA message appendice

Showing 1 changed file with 22 additions and 7 deletions   Show diff stats
units/game_actors.pas
@@ -113,6 +113,7 @@ type @@ -113,6 +113,7 @@ type
113 property PlayerNicname : string read FNicname write FNicname; 113 property PlayerNicname : string read FNicname write FNicname;
114 property AppendiceSingular : string read FAppendiceSingular; 114 property AppendiceSingular : string read FAppendiceSingular;
115 property AppendicePlural : string read FAppendicePlural; 115 property AppendicePlural : string read FAppendicePlural;
  116 + property Style : TConsequenceStyle read FStyle;
116 property ConsequenseByPlayerID : TStringList read FConsequenceByPlayerID; 117 property ConsequenseByPlayerID : TStringList read FConsequenceByPlayerID;
117 end; 118 end;
118 119
@@ -458,7 +459,10 @@ end; @@ -458,7 +459,10 @@ end;
458 function TPrompt.AsString: TStringList; 459 function TPrompt.AsString: TStringList;
459 var 460 var
460 j,i : integer; 461 j,i : integer;
461 - LID,LConsequence : string; 462 + LAppendiceSingular,
  463 + LAppendicePlural,
  464 + LConsequence,
  465 + LID : string;
462 LCsqStyle : TConsequenceStyle; 466 LCsqStyle : TConsequenceStyle;
463 Pts : integer; 467 Pts : integer;
464 468
@@ -475,6 +479,8 @@ var @@ -475,6 +479,8 @@ var
475 479
476 procedure ApplyPointsConditions(IsMeta:Boolean); 480 procedure ApplyPointsConditions(IsMeta:Boolean);
477 var 481 var
  482 + i : integer;
  483 + LI,LS,LP,
478 S : string; 484 S : string;
479 begin 485 begin
480 Pts := StrToInt(ExtractDelimited(1,LConsequence, ['|'])); 486 Pts := StrToInt(ExtractDelimited(1,LConsequence, ['|']));
@@ -485,6 +491,15 @@ var @@ -485,6 +491,15 @@ var
485 begin 491 begin
486 LCsqStyle += [gscA]; 492 LCsqStyle += [gscA];
487 LCsqStyle -= [gscB]; 493 LCsqStyle -= [gscB];
  494 +
  495 + for i := 0 to Length(FPromptTargets) -1 do
  496 + if not FPromptTargets[i].Meta then
  497 + if gscA in FPromptTargets[i].Consequence.Style then
  498 + begin
  499 + LAppendiceSingular := FPromptTargets[i].Consequence.AppendiceSingular;
  500 + LAppendicePlural := FPromptTargets[i].Consequence.AppendicePlural;
  501 + Break;
  502 + end;
488 end; 503 end;
489 504
490 if IsMeta then 505 if IsMeta then
@@ -496,12 +511,12 @@ var @@ -496,12 +511,12 @@ var
496 IntToStr(Pts) +'|'+ 511 IntToStr(Pts) +'|'+
497 GetConsequenceStylesString(LCsqStyle) +'|'+ 512 GetConsequenceStylesString(LCsqStyle) +'|'+
498 ExtractDelimited(3,LConsequence, ['|']) +'|'+ 513 ExtractDelimited(3,LConsequence, ['|']) +'|'+
499 - ExtractDelimited(4,LConsequence, ['|']) +'|'+  
500 - ExtractDelimited(5,LConsequence, ['|']); 514 + LAppendiceSingular +'|'+
  515 + LAppendicePlural;
501 end; 516 end;
502 begin 517 begin
503 Result := TStringList.Create; 518 Result := TStringList.Create;
504 - // to do, sanitize FPromptStyle first 519 + // todo: sanitize FPromptStyle first
505 Pts:= 0; 520 Pts:= 0;
506 if (gsAll in FPromptStyle) and (gsYes in FPromptStyle) then 521 if (gsAll in FPromptStyle) and (gsYes in FPromptStyle) then
507 if AllPlayersClickedYes then 522 if AllPlayersClickedYes then
@@ -512,9 +527,9 @@ begin @@ -512,9 +527,9 @@ begin
512 LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID]; 527 LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID];
513 LCsqStyle := GetConsequenceStylesFromString(ExtractDelimited(2,LConsequence, ['|'])); 528 LCsqStyle := GetConsequenceStylesFromString(ExtractDelimited(2,LConsequence, ['|']));
514 529
515 - // TODO: should BasA revert appendices? right now reverting points only  
516 - //LAppendiceSingular:=  
517 - //LAppendicePlural:= 530 + // BasA must revert appendices
  531 + LAppendiceSingular := ExtractDelimited(4,LConsequence, ['|']);
  532 + LAppendicePlural := ExtractDelimited(5,LConsequence, ['|']);
518 533
519 if gsContingency in FPromptStyle then 534 if gsContingency in FPromptStyle then
520 if (FPromptTargets[i].Fired) and (not FPromptTargets[i].Meta) then 535 if (FPromptTargets[i].Fired) and (not FPromptTargets[i].Meta) then