;------------------------------------------
; Set x for forage. Set xest for estates
; level 1 code: forage 100 low inflation forage per 1/4 army
; Level 2 code estates 3000 with low inflation
;------------------------------------------
Trigger X_Factor1a_start
    WhenToTest CharacterTurnStart

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait x < 1

    Affects x  1  Chance  100
;------------------------------------------
Trigger X_Factor1b_start
    WhenToTest CharacterTurnStart

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait x > 1

    Affects xReset  1  Chance  100
;------------------------------------------
Trigger X_Factor1a_becomes
    WhenToTest BecomesFactionLeader

    Condition Trait x < 1

    Affects x  1  Chance  100
;------------------------------------------
Trigger X_Factor1b_becomes
    WhenToTest BecomesFactionLeader

    Condition Trait x > 1

    Affects xReset  1  Chance  100
;------------------------------------------
Trigger X_Factor1a
    WhenToTest CharacterTurnEnd

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait x < 1

    Affects x  1  Chance  100
;------------------------------------------
Trigger X_Factor1b
    WhenToTest CharacterTurnEnd

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait x > 1

    Affects xReset  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2a_start
    WhenToTest CharacterTurnStart

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2b_start
    WhenToTest CharacterTurnStart

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2a_becomes
    WhenToTest BecomesFactionLeader

    Condition Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2b_becomes
    WhenToTest BecomesFactionLeader

    Condition Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2a
    WhenToTest CharacterTurnEnd

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------
Trigger Xest_Factor2b
    WhenToTest CharacterTurnEnd

    Condition CharacterIsLocal
          and IsFactionLeader
          and Trait xest < 2

    Affects xest  1  Chance  100
;------------------------------------------