File: opinion.py

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (12 lines) | stat: -rw-r--r-- 668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# Policy Liberty doubles the stability malus from disliked buildings, policies and planetary foci
# Policy Conformance halves it
# Values are declared in common/named_values.focs.txt
from focs._effects import EmpireHasAdoptedPolicy, IsSource, NamedRealLookup, StatisticIf, Target

POLICY_DISLIKE_SCALING = (
    1.0
    * NamedRealLookup(name="PLC_LIBERTY_DISLIKE_FACTOR")
    ** (StatisticIf(float, condition=IsSource & EmpireHasAdoptedPolicy(empire=Target.Owner, name="PLC_LIBERTY")))
    * NamedRealLookup(name="PLC_CONFORMANCE_DISLIKE_FACTOR")
    ** (StatisticIf(float, condition=IsSource & EmpireHasAdoptedPolicy(empire=Target.Owner, name="PLC_CONFORMANCE")))
)