mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
few minor fixes
This commit is contained in:
parent
f9e66dec21
commit
0b2e76e12b
@ -29,9 +29,9 @@ class GroundInterceptEvent(Event):
|
|||||||
destroyed_targets += count
|
destroyed_targets += count
|
||||||
|
|
||||||
if self.from_cp.captured:
|
if self.from_cp.captured:
|
||||||
return math.ceil(float(destroyed_targets) / total_targets) >= self.SUCCESS_TARGETS_HIT_PERCENTAGE
|
return float(destroyed_targets) / total_targets >= self.SUCCESS_TARGETS_HIT_PERCENTAGE
|
||||||
else:
|
else:
|
||||||
return math.ceil(float(destroyed_targets) / total_targets) < self.SUCCESS_TARGETS_HIT_PERCENTAGE
|
return float(destroyed_targets) / total_targets < self.SUCCESS_TARGETS_HIT_PERCENTAGE
|
||||||
|
|
||||||
def commit(self, debriefing: Debriefing):
|
def commit(self, debriefing: Debriefing):
|
||||||
super(GroundInterceptEvent, self).commit(debriefing)
|
super(GroundInterceptEvent, self).commit(debriefing)
|
||||||
|
|||||||
15
game/game.py
15
game/game.py
@ -33,12 +33,12 @@ PLAYER_INTERCEPT_GLOBAL_PROBABILITY_BASE = 25
|
|||||||
PLAYER_INTERCEPT_GLOBAL_PROBABILITY_LOG = 2
|
PLAYER_INTERCEPT_GLOBAL_PROBABILITY_LOG = 2
|
||||||
EVENT_PROBABILITIES = {
|
EVENT_PROBABILITIES = {
|
||||||
CaptureEvent: [100, 4],
|
CaptureEvent: [100, 4],
|
||||||
InterceptEvent: [35, 5],
|
InterceptEvent: [25, 5],
|
||||||
GroundInterceptEvent: [35, 5],
|
GroundInterceptEvent: [25, 5],
|
||||||
GroundAttackEvent: [0, 5],
|
GroundAttackEvent: [0, 5],
|
||||||
NavalInterceptEvent: [35, 5],
|
NavalInterceptEvent: [25, 5],
|
||||||
AntiAAStrikeEvent: [35, 5],
|
AntiAAStrikeEvent: [25, 5],
|
||||||
InfantryTransportEvent: [100, 0],
|
InfantryTransportEvent: [25, 0],
|
||||||
}
|
}
|
||||||
|
|
||||||
PLAYER_BASE_STRENGTH_RECOVERY = 0.2
|
PLAYER_BASE_STRENGTH_RECOVERY = 0.2
|
||||||
@ -174,7 +174,10 @@ class Game:
|
|||||||
if event.is_successfull(debriefing):
|
if event.is_successfull(debriefing):
|
||||||
self.budget += event.bonus()
|
self.budget += event.bonus()
|
||||||
|
|
||||||
self.events.remove(event)
|
if event in self.events:
|
||||||
|
self.events.remove(event)
|
||||||
|
else:
|
||||||
|
print("finish_event: event not in the events!")
|
||||||
|
|
||||||
def is_player_attack(self, event: Event):
|
def is_player_attack(self, event: Event):
|
||||||
return event.attacker_name == self.player
|
return event.attacker_name == self.player
|
||||||
|
|||||||
@ -25,8 +25,8 @@ INTERCEPT_ATTACKERS_HEADING = -45, 45
|
|||||||
INTERCEPT_DEFENDERS_HEADING = -10, 10
|
INTERCEPT_DEFENDERS_HEADING = -10, 10
|
||||||
INTERCEPT_ATTACKERS_DISTANCE = 60000
|
INTERCEPT_ATTACKERS_DISTANCE = 60000
|
||||||
INTERCEPT_DEFENDERS_DISTANCE = 30000
|
INTERCEPT_DEFENDERS_DISTANCE = 30000
|
||||||
INTERCEPT_MAX_DISTANCE = 80000
|
INTERCEPT_MAX_DISTANCE = 130000
|
||||||
INTERCEPT_MIN_DISTANCE = 45000
|
INTERCEPT_MIN_DISTANCE = 60000
|
||||||
|
|
||||||
NAVAL_INTERCEPT_DISTANCE_FACTOR = 0.4
|
NAVAL_INTERCEPT_DISTANCE_FACTOR = 0.4
|
||||||
NAVAL_INTERCEPT_DISTANCE_MAX = 40000
|
NAVAL_INTERCEPT_DISTANCE_MAX = 40000
|
||||||
@ -124,7 +124,7 @@ class Conflict:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
||||||
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 0.4
|
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 0.6
|
||||||
distance = max(min(raw_distance, INTERCEPT_MAX_DISTANCE), INTERCEPT_MIN_DISTANCE)
|
distance = max(min(raw_distance, INTERCEPT_MAX_DISTANCE), INTERCEPT_MIN_DISTANCE)
|
||||||
|
|
||||||
heading = _heading_sum(from_cp.position.heading_between_point(to_cp.position), random.choice([-1, 1]) * random.randint(60, 100))
|
heading = _heading_sum(from_cp.position.heading_between_point(to_cp.position), random.choice([-1, 1]) * random.randint(60, 100))
|
||||||
@ -213,7 +213,7 @@ class Conflict:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
||||||
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 0.4
|
raw_distance = from_cp.position.distance_to_point(to_cp.position)
|
||||||
distance = max(min(raw_distance, INTERCEPT_MAX_DISTANCE), INTERCEPT_MIN_DISTANCE)
|
distance = max(min(raw_distance, INTERCEPT_MAX_DISTANCE), INTERCEPT_MIN_DISTANCE)
|
||||||
|
|
||||||
heading = _heading_sum(from_cp.position.heading_between_point(to_cp.position), random.choice([-1, 1]) * random.randint(60, 100))
|
heading = _heading_sum(from_cp.position.heading_between_point(to_cp.position), random.choice([-1, 1]) * random.randint(60, 100))
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -72,7 +72,6 @@ class CaucasusTheater(ConflictTheater):
|
|||||||
|
|
||||||
self.carrier_1.captured = True
|
self.carrier_1.captured = True
|
||||||
self.soganlug.captured = True
|
self.soganlug.captured = True
|
||||||
self.beslan.base.strength = 0.25
|
|
||||||
|
|
||||||
def add_controlpoint(self, point: ControlPoint, connected_to: typing.Collection[ControlPoint] = []):
|
def add_controlpoint(self, point: ControlPoint, connected_to: typing.Collection[ControlPoint] = []):
|
||||||
point.name = " ".join(re.split(r" |-", point.name)[:1])
|
point.name = " ".join(re.split(r" |-", point.name)[:1])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user