001package com.fs.starfarer.api.combat; 002 003import com.fs.starfarer.api.Global; 004import com.fs.starfarer.api.campaign.CampaignFleetAPI; 005import com.fs.starfarer.api.fleet.FleetGoal; 006import com.fs.starfarer.api.impl.campaign.ids.Factions; 007import com.fs.starfarer.api.impl.campaign.ids.MemFlags; 008 009public class BattleCreationContext { 010 011 private float initialStepSize = 1f; 012 private float initialNumSteps = 0f; 013 014 015 private float initialDeploymentBurnDuration = 1f; 016 private float normalDeploymentBurnDuration = 6f; 017 private float escapeDeploymentBurnDuration = 1.5f; 018 private float standoffRange = 6000f; 019 private float initialEscapeRange = Global.getSettings().getFloat("escapeStartDistance"); 020 private float flankDeploymentDistance = Global.getSettings().getFloat("escapeFlankDistance"); 021 022 023 private CampaignFleetAPI playerFleet; 024 private FleetGoal playerGoal; 025 private CampaignFleetAPI otherFleet; 026 private FleetGoal otherGoal; 027 028 private float pursuitRangeModifier = 0f; 029 030 public float extraEnemyStandoffRange = 0f; 031 032 private int playerCommandPoints = 0; 033 034 public boolean aiRetreatAllowed = true; 035 public boolean objectivesAllowed = true; 036 public boolean forceObjectivesOnMap = false; 037 public boolean enemyDeployAll = false; 038// public boolean playerDefendingStation = false; 039// public boolean enemyDefendingStation = false; 040 041 public boolean fightToTheLast = false; 042 043 public BattleCreationContext(CampaignFleetAPI playerFleet, 044 FleetGoal playerGoal, CampaignFleetAPI otherFleet, 045 FleetGoal otherGoal) { 046 this.playerFleet = playerFleet; 047 this.playerGoal = playerGoal; 048 this.otherFleet = otherFleet; 049 this.otherGoal = otherGoal; 050 051 if (otherFleet != null && otherFleet.getFaction() != null) { 052 boolean ftl = otherFleet.getFaction().getCustomBoolean(Factions.CUSTOM_FIGHT_TO_THE_LAST); 053 if (otherFleet.getMemoryWithoutUpdate().contains(MemFlags.FLEET_FIGHT_TO_THE_LAST)) { 054 ftl = otherFleet.getMemoryWithoutUpdate().getBoolean(MemFlags.FLEET_FIGHT_TO_THE_LAST); 055 } 056 fightToTheLast = ftl; 057 } 058 } 059 060 public int getPlayerCommandPoints() { 061 return playerCommandPoints; 062 } 063 064 public void setPlayerCommandPoints(int playerCommandPoints) { 065 this.playerCommandPoints = playerCommandPoints; 066 } 067 068 public CampaignFleetAPI getPlayerFleet() { 069 return playerFleet; 070 } 071 072 public FleetGoal getPlayerGoal() { 073 return playerGoal; 074 } 075 076 public CampaignFleetAPI getOtherFleet() { 077 return otherFleet; 078 } 079 080 public FleetGoal getOtherGoal() { 081 return otherGoal; 082 } 083 084 public float getPursuitRangeModifier() { 085 return pursuitRangeModifier; 086 } 087 088 public void setPursuitRangeModifier(float pursuitRangeModifier) { 089 this.pursuitRangeModifier = pursuitRangeModifier; 090 } 091 092 public float getInitialDeploymentBurnDuration() { 093 return initialDeploymentBurnDuration; 094 } 095 096 public void setInitialDeploymentBurnDuration(float initialDeploymentBurnDuration) { 097 this.initialDeploymentBurnDuration = initialDeploymentBurnDuration; 098 } 099 100 public float getNormalDeploymentBurnDuration() { 101 return normalDeploymentBurnDuration; 102 } 103 104 public void setNormalDeploymentBurnDuration(float normalDeploymentBurnDuration) { 105 this.normalDeploymentBurnDuration = normalDeploymentBurnDuration; 106 } 107 108 public float getEscapeDeploymentBurnDuration() { 109 return escapeDeploymentBurnDuration; 110 } 111 112 public void setEscapeDeploymentBurnDuration(float escapeDeploymentBurnDuration) { 113 this.escapeDeploymentBurnDuration = escapeDeploymentBurnDuration; 114 } 115 116 public float getStandoffRange() { 117 return standoffRange; 118 } 119 120 public void setStandoffRange(float standoffRange) { 121 this.standoffRange = standoffRange; 122 } 123 124 public float getInitialEscapeRange() { 125 return initialEscapeRange; 126 } 127 128 public void setInitialEscapeRange(float initialEscapeRange) { 129 this.initialEscapeRange = initialEscapeRange; 130 } 131 132 public float getFlankDeploymentDistance() { 133 return flankDeploymentDistance; 134 } 135 136 public void setFlankDeploymentDistance(float sideDeploymentDistance) { 137 this.flankDeploymentDistance = sideDeploymentDistance; 138 } 139 140 public float getInitialStepSize() { 141 return initialStepSize; 142 } 143 144 public void setInitialStepSize(float initialStepSize) { 145 this.initialStepSize = initialStepSize; 146 } 147 148 public float getInitialNumSteps() { 149 return initialNumSteps; 150 } 151 152 public void setInitialNumSteps(float initialNumSteps) { 153 this.initialNumSteps = initialNumSteps; 154 } 155 156 public float getExtraEnemyStandoffRange() { 157 return extraEnemyStandoffRange; 158 } 159 160} 161 162 163 164