take off silencing WIP; fixes for blufor; fixed SAMs commision on samless campaigns

This commit is contained in:
Vasyl Horbachenko
2018-06-26 03:31:29 +03:00
parent 0b2e76e12b
commit c329c806df
11 changed files with 84 additions and 28 deletions

View File

@@ -12,12 +12,15 @@ from .event import Event
class CaptureEvent(Event):
silent = True
BONUS_BASE = 7
BONUS_BASE = 10
STRENGTH_RECOVERY = 0.35
def __str__(self):
return "Attack from {} to {}".format(self.from_cp, self.to_cp)
def bonus(self):
return
@property
def threat_description(self):
descr = "{} aircraft + CAS, {} vehicles".format(
@@ -33,7 +36,7 @@ class CaptureEvent(Event):
def is_successfull(self, debriefing: Debriefing):
alive_attackers = sum([v for k, v in debriefing.alive_units[self.attacker_name].items() if db.unit_task(k) == PinpointStrike])
alive_defenders = sum([v for k, v in debriefing.alive_units[self.defender_name].items() if db.unit_task(k) == PinpointStrike])
attackers_success = alive_attackers > alive_defenders
attackers_success = alive_attackers >= alive_defenders
if self.from_cp.captured:
return attackers_success
else:

View File

@@ -5,7 +5,7 @@ from theater import *
from userdata.debriefing import Debriefing
DIFFICULTY_LOG_BASE = 1.5
DIFFICULTY_LOG_BASE = 1.1
class Event:
@@ -15,7 +15,7 @@ class Event:
operation = None # type: Operation
difficulty = 1 # type: int
game = None # type: Game
BONUS_BASE = 0
BONUS_BASE = 3
def __init__(self, attacker_name: str, defender_name: str, from_cp: ControlPoint, to_cp: ControlPoint, game):
self.attacker_name = attacker_name
@@ -40,7 +40,7 @@ class Event:
return ""
def bonus(self) -> int:
return math.ceil(math.log(self.difficulty, DIFFICULTY_LOG_BASE) * self.BONUS_BASE)
return int(math.log(self.to_cp.importance + 1, DIFFICULTY_LOG_BASE) * self.BONUS_BASE)
def is_successfull(self, debriefing: Debriefing) -> bool:
return self.operation.is_successfull(debriefing)