Starsector API
Loading...
Searching...
No Matches
BattleCreationContext.java
Go to the documentation of this file.
1package com.fs.starfarer.api.combat;
2
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.campaign.CampaignFleetAPI;
5import com.fs.starfarer.api.fleet.FleetGoal;
6import com.fs.starfarer.api.impl.campaign.ids.Factions;
7import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
8
10
11 private float initialStepSize = 1f;
12 private float initialNumSteps = 0f;
13
14
15 private float initialDeploymentBurnDuration = 1f;
16 private float normalDeploymentBurnDuration = 6f;
17 private float escapeDeploymentBurnDuration = 1.5f;
18 private float standoffRange = 6000f;
19 private float initialEscapeRange = Global.getSettings().getFloat("escapeStartDistance");
20 private float flankDeploymentDistance = Global.getSettings().getFloat("escapeFlankDistance");
21
22
23 private CampaignFleetAPI playerFleet;
24 private FleetGoal playerGoal;
25 private CampaignFleetAPI otherFleet;
26 private FleetGoal otherGoal;
27
28 private float pursuitRangeModifier = 0f;
29
30 private int playerCommandPoints = 0;
31
32 public boolean aiRetreatAllowed = true;
33 public boolean objectivesAllowed = true;
34 public boolean enemyDeployAll = false;
35// public boolean playerDefendingStation = false;
36// public boolean enemyDefendingStation = false;
37
38 public boolean fightToTheLast = false;
39
40 public BattleCreationContext(CampaignFleetAPI playerFleet,
41 FleetGoal playerGoal, CampaignFleetAPI otherFleet,
42 FleetGoal otherGoal) {
43 this.playerFleet = playerFleet;
44 this.playerGoal = playerGoal;
45 this.otherFleet = otherFleet;
46 this.otherGoal = otherGoal;
47
48 if (otherFleet != null && otherFleet.getFaction() != null) {
49 boolean ftl = otherFleet.getFaction().getCustomBoolean(Factions.CUSTOM_FIGHT_TO_THE_LAST);
50 if (otherFleet.getMemoryWithoutUpdate().contains(MemFlags.FLEET_FIGHT_TO_THE_LAST)) {
51 ftl = otherFleet.getMemoryWithoutUpdate().getBoolean(MemFlags.FLEET_FIGHT_TO_THE_LAST);
52 }
53 fightToTheLast = ftl;
54 }
55 }
56
58 return playerCommandPoints;
59 }
60
61 public void setPlayerCommandPoints(int playerCommandPoints) {
62 this.playerCommandPoints = playerCommandPoints;
63 }
64
65 public CampaignFleetAPI getPlayerFleet() {
66 return playerFleet;
67 }
68
69 public FleetGoal getPlayerGoal() {
70 return playerGoal;
71 }
72
73 public CampaignFleetAPI getOtherFleet() {
74 return otherFleet;
75 }
76
77 public FleetGoal getOtherGoal() {
78 return otherGoal;
79 }
80
81 public float getPursuitRangeModifier() {
82 return pursuitRangeModifier;
83 }
84
85 public void setPursuitRangeModifier(float pursuitRangeModifier) {
86 this.pursuitRangeModifier = pursuitRangeModifier;
87 }
88
90 return initialDeploymentBurnDuration;
91 }
92
93 public void setInitialDeploymentBurnDuration(float initialDeploymentBurnDuration) {
94 this.initialDeploymentBurnDuration = initialDeploymentBurnDuration;
95 }
96
98 return normalDeploymentBurnDuration;
99 }
100
101 public void setNormalDeploymentBurnDuration(float normalDeploymentBurnDuration) {
102 this.normalDeploymentBurnDuration = normalDeploymentBurnDuration;
103 }
104
106 return escapeDeploymentBurnDuration;
107 }
108
109 public void setEscapeDeploymentBurnDuration(float escapeDeploymentBurnDuration) {
110 this.escapeDeploymentBurnDuration = escapeDeploymentBurnDuration;
111 }
112
113 public float getStandoffRange() {
114 return standoffRange;
115 }
116
117 public void setStandoffRange(float standoffRange) {
118 this.standoffRange = standoffRange;
119 }
120
121 public float getInitialEscapeRange() {
122 return initialEscapeRange;
123 }
124
125 public void setInitialEscapeRange(float initialEscapeRange) {
126 this.initialEscapeRange = initialEscapeRange;
127 }
128
130 return flankDeploymentDistance;
131 }
132
133 public void setFlankDeploymentDistance(float sideDeploymentDistance) {
134 this.flankDeploymentDistance = sideDeploymentDistance;
135 }
136
137 public float getInitialStepSize() {
138 return initialStepSize;
139 }
140
141 public void setInitialStepSize(float initialStepSize) {
142 this.initialStepSize = initialStepSize;
143 }
144
145 public float getInitialNumSteps() {
146 return initialNumSteps;
147 }
148
149 public void setInitialNumSteps(float initialNumSteps) {
150 this.initialNumSteps = initialNumSteps;
151 }
152
153
154}
155
156
157
158
static SettingsAPI getSettings()
Definition Global.java:51
void setInitialDeploymentBurnDuration(float initialDeploymentBurnDuration)
void setNormalDeploymentBurnDuration(float normalDeploymentBurnDuration)
void setEscapeDeploymentBurnDuration(float escapeDeploymentBurnDuration)
BattleCreationContext(CampaignFleetAPI playerFleet, FleetGoal playerGoal, CampaignFleetAPI otherFleet, FleetGoal otherGoal)
void setFlankDeploymentDistance(float sideDeploymentDistance)