mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
unitHealth in logic
This commit is contained in:
parent
d85995f6fd
commit
ea27fa53bf
3 changed files with 4 additions and 2 deletions
|
|
@ -1433,12 +1433,13 @@ public class LExecutor{
|
|||
}
|
||||
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
|
||||
case solarMultiplier -> state.rules.solarMultiplier = exec.numf(value);
|
||||
case unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
case unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||
Team team = exec.team(p1);
|
||||
if(team != null){
|
||||
float num = exec.numf(value);
|
||||
switch(rule){
|
||||
case buildSpeed -> team.rules().buildSpeedMultiplier = Mathf.clamp(num, 0.001f, 50f);
|
||||
case unitHealth -> team.rules().unitHealthMultiplier = Math.max(num, 0.001f);
|
||||
case unitBuildSpeed -> team.rules().unitBuildSpeedMultiplier = Mathf.clamp(num, 0f, 50f);
|
||||
case unitCost -> team.rules().unitCostMultiplier = Math.max(num, 0f);
|
||||
case unitDamage -> team.rules().unitDamageMultiplier = Math.max(num, 0f);
|
||||
|
|
|
|||
|
|
@ -1370,7 +1370,7 @@ public class LStatements{
|
|||
fields(table, "w", p3, s -> p3 = s);
|
||||
fields(table, "h", p4, s -> p4 = s);
|
||||
}
|
||||
case buildSpeed, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, rtsMinSquad, rtsMinWeight -> {
|
||||
case buildSpeed, unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, rtsMinSquad, rtsMinWeight -> {
|
||||
if(p1.equals("0")){
|
||||
p1 = "@sharded";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public enum LogicRule{
|
|||
|
||||
//team specific
|
||||
buildSpeed,
|
||||
unitHealth,
|
||||
unitBuildSpeed,
|
||||
unitCost,
|
||||
unitDamage,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue