updated enemy event probabilities

This commit is contained in:
Vasyl Horbachenko 2018-06-19 03:15:37 +03:00
parent 78ab7cadd4
commit 584045f60d
2 changed files with 10 additions and 5 deletions

View File

@ -29,11 +29,11 @@ COMMISION_AMOUNTS_FACTORS = {
}
ENEMY_INTERCEPT_PROBABILITY_BASE = 8
ENEMY_INTERCEPT_GLOBAL_PROBABILITY_BASE = 5
ENEMY_INTERCEPT_PROBABILITY_BASE = 5
ENEMY_CAPTURE_PROBABILITY_BASE = 4
ENEMY_GROUNDINTERCEPT_PROBABILITY_BASE = 8
ENEMY_NAVALINTERCEPT_PROBABILITY_BASE = 8
ENEMY_GROUNDINTERCEPT_PROBABILITY_BASE = 5
ENEMY_NAVALINTERCEPT_PROBABILITY_BASE = 5
ENEMY_INTERCEPT_GLOBAL_PROBABILITY_BASE = 5
PLAYER_INTERCEPT_PROBABILITY_BASE = 35
PLAYER_GROUNDINTERCEPT_PROBABILITY_BASE = 35
@ -95,6 +95,9 @@ class Game:
if from_cp.base.total_units(CAP) == 0:
continue
if enemy_interception:
break
if self._roll(ENEMY_INTERCEPT_PROBABILITY_BASE, from_cp.base.strength):
self.events.append(InterceptEvent(attacker_name=self.enemy,
defender_name=self.player,
@ -252,7 +255,7 @@ class Game:
self.events = [] # type: typing.List[Event]
self._fill_cap_events()
#self._generate_enemy_caps(ignored_cps=ignored_cps)
self._generate_enemy_caps(ignored_cps=ignored_cps)
self._generate_interceptions()
self._generate_globalinterceptions()
self._generate_groundinterceptions()

View File

@ -142,6 +142,8 @@ class Base:
self.strength += amount
if self.strength > 1:
self.strength = 1
elif self.strength < 0:
self.strength = 0.001
def scramble_count(self) -> int:
count = int(self.total_planes * PLANES_SCRAMBLE_FACTOR * self.strength)