mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
take off silencing WIP; fixes for blufor; fixed SAMs commision on samless campaigns
This commit is contained in:
@@ -160,6 +160,10 @@ TAKEOFF_BAN = [
|
||||
AV8BNA,
|
||||
]
|
||||
|
||||
CARRIER_TAKEOFF_BAN = [
|
||||
Su_33,
|
||||
]
|
||||
|
||||
EXTRA_AA = {
|
||||
"Russia": AirDefence.SAM_SA_9_Strela_1_9P31,
|
||||
"USA": AirDefence.SAM_Patriot_EPP_III,
|
||||
@@ -252,6 +256,11 @@ PLANE_PAYLOAD_OVERRIDES = {
|
||||
"*": "AIM-9M*6, AIM-7M*2, FUEL*3",
|
||||
},
|
||||
|
||||
Su_33: {
|
||||
"*": "R-73*4,R-27R*2,R-27ER*6",
|
||||
"_carrier": "R-73*4",
|
||||
},
|
||||
|
||||
AV8BNA: {
|
||||
CAS: "AS 2",
|
||||
},
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -130,7 +130,12 @@ class Game:
|
||||
points_to_spend = cp.base.append_commision_points(for_task, awarded_points)
|
||||
if points_to_spend > 0:
|
||||
importance_factor = (cp.importance - IMPORTANCE_LOW) / (IMPORTANCE_HIGH - IMPORTANCE_LOW)
|
||||
unittypes = db.choose_units(for_task, importance_factor, COMMISION_UNIT_VARIETY, self.enemy)
|
||||
|
||||
if for_task == AirDefence and not self.settings.sams:
|
||||
unittypes = [x for x in db.find_unittype(AirDefence, self.enemy) if x not in db.SAM_BAN]
|
||||
else:
|
||||
unittypes = db.choose_units(for_task, importance_factor, COMMISION_UNIT_VARIETY, self.enemy)
|
||||
|
||||
d = {random.choice(unittypes): points_to_spend}
|
||||
print("Commision {}: {}".format(cp, d))
|
||||
cp.base.commision_units(d)
|
||||
|
||||
@@ -5,3 +5,4 @@ class Settings:
|
||||
only_player_takeoff = False
|
||||
night_disabled = False
|
||||
multiplier = 1
|
||||
sams = True
|
||||
|
||||
Reference in New Issue
Block a user