Commit fb68d14816f9cb170791261491235f7a8bc0e1b2
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 | 113 | property PlayerNicname : string read FNicname write FNicname; |
114 | 114 | property AppendiceSingular : string read FAppendiceSingular; |
115 | 115 | property AppendicePlural : string read FAppendicePlural; |
116 | + property Style : TConsequenceStyle read FStyle; | |
116 | 117 | property ConsequenseByPlayerID : TStringList read FConsequenceByPlayerID; |
117 | 118 | end; |
118 | 119 | |
... | ... | @@ -458,7 +459,10 @@ end; |
458 | 459 | function TPrompt.AsString: TStringList; |
459 | 460 | var |
460 | 461 | j,i : integer; |
461 | - LID,LConsequence : string; | |
462 | + LAppendiceSingular, | |
463 | + LAppendicePlural, | |
464 | + LConsequence, | |
465 | + LID : string; | |
462 | 466 | LCsqStyle : TConsequenceStyle; |
463 | 467 | Pts : integer; |
464 | 468 | |
... | ... | @@ -475,6 +479,8 @@ var |
475 | 479 | |
476 | 480 | procedure ApplyPointsConditions(IsMeta:Boolean); |
477 | 481 | var |
482 | + i : integer; | |
483 | + LI,LS,LP, | |
478 | 484 | S : string; |
479 | 485 | begin |
480 | 486 | Pts := StrToInt(ExtractDelimited(1,LConsequence, ['|'])); |
... | ... | @@ -485,6 +491,15 @@ var |
485 | 491 | begin |
486 | 492 | LCsqStyle += [gscA]; |
487 | 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 | 503 | end; |
489 | 504 | |
490 | 505 | if IsMeta then |
... | ... | @@ -496,12 +511,12 @@ var |
496 | 511 | IntToStr(Pts) +'|'+ |
497 | 512 | GetConsequenceStylesString(LCsqStyle) +'|'+ |
498 | 513 | ExtractDelimited(3,LConsequence, ['|']) +'|'+ |
499 | - ExtractDelimited(4,LConsequence, ['|']) +'|'+ | |
500 | - ExtractDelimited(5,LConsequence, ['|']); | |
514 | + LAppendiceSingular +'|'+ | |
515 | + LAppendicePlural; | |
501 | 516 | end; |
502 | 517 | begin |
503 | 518 | Result := TStringList.Create; |
504 | - // to do, sanitize FPromptStyle first | |
519 | + // todo: sanitize FPromptStyle first | |
505 | 520 | Pts:= 0; |
506 | 521 | if (gsAll in FPromptStyle) and (gsYes in FPromptStyle) then |
507 | 522 | if AllPlayersClickedYes then |
... | ... | @@ -512,9 +527,9 @@ begin |
512 | 527 | LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID]; |
513 | 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 | 534 | if gsContingency in FPromptStyle then |
520 | 535 | if (FPromptTargets[i].Fired) and (not FPromptTargets[i].Meta) then | ... | ... |