Make crash damage a multiplier instead of a toggle (#8151)

* Switch unitCrashDamage to a multiplier

* Add to rules dialog
This commit is contained in:
MEEPofFaith
2023-01-11 05:56:29 -08:00
committed by GitHub
parent a9175d3ffe
commit 87949679f1
4 changed files with 16 additions and 7 deletions

View File

@@ -51,8 +51,6 @@ public class Rules{
public boolean damageExplosions = true;
/** Whether fire (and neoplasm spread) is enabled. */
public boolean fire = true;
/** Whether unit crash damage is enabled. */
public boolean unitCrashDamage = true;
/** Whether units use and require ammo. */
public boolean unitAmmo = false;
/** EXPERIMENTAL! If true, blocks will update in units and share power. */
@@ -67,8 +65,10 @@ public class Rules{
public float unitBuildSpeedMultiplier = 1f;
/** Multiplier of resources that units take to build. */
public float unitCostMultiplier = 1f;
/** How much damage any other units deal. */
/** How much damage units deal. */
public float unitDamageMultiplier = 1f;
/** How much damage unit crash damage deals. (Compounds with unitDamageMultiplier) */
public float unitCrashDamageMultiplier = 1f;
/** If true, ghost blocks will appear upon destruction, letting builder blocks/units rebuild them. */
public boolean ghostBlocks = true;
/** Whether to allow units to build with logic. */
@@ -224,6 +224,10 @@ public class Rules{
return unitDamageMultiplier * teams.get(team).unitDamageMultiplier;
}
public float unitCrashDamage(Team team){
return unitDamage(team) * unitCrashDamageMultiplier * teams.get(team).unitCrashDamageMultiplier;
}
public float blockHealth(Team team){
return blockHealthMultiplier * teams.get(team).blockHealthMultiplier;
}
@@ -266,8 +270,10 @@ public class Rules{
/** How fast unit factories build units. */
public float unitBuildSpeedMultiplier = 1f;
/** How much damage any other units deal. */
/** How much damage units deal. */
public float unitDamageMultiplier = 1f;
/** How much damage unit crash damage deals. (Compounds with unitDamageMultiplier) */
public float unitCrashDamageMultiplier = 1f;
/** Multiplier of resources that units take to build. */
public float unitCostMultiplier = 1f;
/** How much health blocks start with. */