mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 15:27:19 +07:00
Charge stat for Item (#4392)
* Stat.discharge, discharge * Update Items.java * item.discharge * full container = somewhat more than 4 full batteries * Stat.discharge * stat.discharge = Discharge * Update core/src/mindustry/type/Item.java Co-authored-by: Antsiferov Andrew <summet.dev@gmail.com> * removed dis * oops * unit zap Co-authored-by: Antsiferov Andrew <summet.dev@gmail.com>
This commit is contained in:
@ -695,6 +695,7 @@ stat.lightningchance = Lightning Chance
|
||||
stat.lightningdamage = Lightning Damage
|
||||
stat.flammability = Flammability
|
||||
stat.radioactivity = Radioactivity
|
||||
stat.charge = Charge
|
||||
stat.heatcapacity = Heat Capacity
|
||||
stat.viscosity = Viscosity
|
||||
stat.temperature = Temperature
|
||||
|
@ -74,6 +74,7 @@ public class Items implements ContentList{
|
||||
|
||||
surgeAlloy = new Item("surge-alloy", Color.valueOf("f3e979")){{
|
||||
cost = 1.2f;
|
||||
charge = 0.75f;
|
||||
}};
|
||||
|
||||
sporePod = new Item("spore-pod", Color.valueOf("7457ce")){{
|
||||
|
@ -983,6 +983,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
int amount = items.get(item);
|
||||
explosiveness += item.explosiveness * amount;
|
||||
flammability += item.flammability * amount;
|
||||
power += item.charge * amount * 100f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -411,9 +411,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
|
||||
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
||||
float flammability = item().flammability * stack().amount / 1.9f;
|
||||
float power = item().charge * stack().amount * 160f;
|
||||
|
||||
if(!spawnedByCore){
|
||||
Damage.dynamicExplosion(x, y, flammability, explosiveness, 0f, bounds() / 2f, state.rules.damageExplosions, item().flammability > 1, team);
|
||||
Damage.dynamicExplosion(x, y, flammability, explosiveness, power, bounds() / 2f, state.rules.damageExplosions, item().flammability > 1, team);
|
||||
}
|
||||
|
||||
float shake = hitSize / 3f;
|
||||
|
@ -17,6 +17,8 @@ public class Item extends UnlockableContent{
|
||||
public float flammability = 0f;
|
||||
/** how radioactive this item is. 0=none, 1=chernobyl ground zero */
|
||||
public float radioactivity;
|
||||
/** how electrically potent this item is. */
|
||||
public float charge = 0f;
|
||||
/** drill hardness of the item */
|
||||
public int hardness = 0;
|
||||
/**
|
||||
@ -41,6 +43,7 @@ public class Item extends UnlockableContent{
|
||||
stats.addPercent(Stat.explosiveness, explosiveness);
|
||||
stats.addPercent(Stat.flammability, flammability);
|
||||
stats.addPercent(Stat.radioactivity, radioactivity);
|
||||
stats.addPercent(Stat.charge, charge);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -15,6 +15,7 @@ public enum Stat{
|
||||
explosiveness,
|
||||
flammability,
|
||||
radioactivity,
|
||||
charge,
|
||||
heatCapacity,
|
||||
viscosity,
|
||||
temperature,
|
||||
|
Reference in New Issue
Block a user