mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-10 04:40:10 +07:00
Min attack weight rule
This commit is contained in:
parent
27768b7451
commit
43aeb90eb9
@ -1082,6 +1082,7 @@ rules.waves = Waves
|
||||
rules.attack = Attack Mode
|
||||
rules.rtsai = RTS AI
|
||||
rules.rtsminsquadsize = Min Squad Size
|
||||
rules.rtsminattackweight = Min Attack Weight
|
||||
rules.cleanupdeadteams = Clean Up Defeated Team Buildings (PvP)
|
||||
rules.corecapture = Capture Core On Destruction
|
||||
rules.polygoncoreprotection = Polygonal Core Protection
|
||||
|
@ -28,8 +28,6 @@ public class RtsAI{
|
||||
static final IntSet assignedTargets = new IntSet();
|
||||
static final float squadRadius = 120f;
|
||||
static final int timeUpdate = 0, timerSpawn = 1;
|
||||
//TODO make configurable
|
||||
static final float minWeight = 1f;
|
||||
|
||||
//in order of priority??
|
||||
static final BlockFlag[] flags = {BlockFlag.generator, BlockFlag.factory, BlockFlag.core, BlockFlag.battery};
|
||||
@ -267,7 +265,7 @@ public class RtsAI{
|
||||
);
|
||||
|
||||
float weight = weights.get(result, 0f);
|
||||
if(weight < minWeight && total < Units.getCap(data.team)){
|
||||
if(weight < data.team.rules().minAttackWeight && total < Units.getCap(data.team)){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -226,6 +226,8 @@ public class Rules{
|
||||
public boolean rtsAi;
|
||||
/** Minimum size of attack squads. */
|
||||
public int rtsAiMinSquadSize = 4;
|
||||
/** Minimum "advantage" needed for a squad to attack. Higher -> more cautious. */
|
||||
public float minAttackWeight = 1.2f;
|
||||
|
||||
/** How fast unit factories build units. */
|
||||
public float unitBuildSpeedMultiplier = 1f;
|
||||
|
@ -255,6 +255,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
|
||||
check("@rules.rtsai", b -> teams.rtsAi = b, () -> teams.rtsAi, () -> team != rules.defaultTeam);
|
||||
numberi("@rules.rtsminsquadsize", f -> teams.rtsAiMinSquadSize = f, () -> teams.rtsAiMinSquadSize, () -> teams.rtsAi, 0, 100);
|
||||
number("@rules.rtsminattackweight", f -> teams.minAttackWeight = f, () -> teams.minAttackWeight, () -> teams.rtsAi);
|
||||
|
||||
check("@rules.infiniteresources", b -> teams.infiniteResources = b, () -> teams.infiniteResources);
|
||||
number("@rules.buildspeedmultiplier", f -> teams.buildSpeedMultiplier = f, () -> teams.buildSpeedMultiplier, 0.001f, 50f);
|
||||
|
@ -25,4 +25,4 @@ org.gradle.caching=true
|
||||
#used for slow jitpack builds; TODO see if this actually works
|
||||
org.gradle.internal.http.socketTimeout=100000
|
||||
org.gradle.internal.http.connectionTimeout=100000
|
||||
archash=99ceda8bf2
|
||||
archash=871de12b14
|
||||
|
Loading…
Reference in New Issue
Block a user