mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-11 00:07:46 +07:00
Add wall stats + other changes
This commit is contained in:
@ -625,6 +625,9 @@ blocks.reload = Shots/Second
|
|||||||
blocks.ammo = Ammo
|
blocks.ammo = Ammo
|
||||||
blocks.shieldhealth = Shield Health
|
blocks.shieldhealth = Shield Health
|
||||||
blocks.cooldowntime = Cooldown Time
|
blocks.cooldowntime = Cooldown Time
|
||||||
|
blocks.basedeflectchance = Base Deflect Chance
|
||||||
|
blocks.lightningchance = Lightning Chance
|
||||||
|
blocks.lightningdamage = Lightning Damage
|
||||||
|
|
||||||
bar.drilltierreq = Better Drill Required
|
bar.drilltierreq = Better Drill Required
|
||||||
bar.noresources = Missing Resources
|
bar.noresources = Missing Resources
|
||||||
@ -1244,8 +1247,8 @@ block.plastanium-wall.description = A special type of wall that absorbs electric
|
|||||||
block.plastanium-wall-large.description = A special type of wall that absorbs electric arcs and blocks automatic power node connections.\nSpans multiple tiles.
|
block.plastanium-wall-large.description = A special type of wall that absorbs electric arcs and blocks automatic power node connections.\nSpans multiple tiles.
|
||||||
block.thorium-wall.description = A strong defensive block.\nDecent protection from enemies.
|
block.thorium-wall.description = A strong defensive block.\nDecent protection from enemies.
|
||||||
block.thorium-wall-large.description = A strong defensive block.\nDecent protection from enemies.\nSpans multiple tiles.
|
block.thorium-wall-large.description = A strong defensive block.\nDecent protection from enemies.\nSpans multiple tiles.
|
||||||
block.phase-wall.description = A wall coated with special phase-based reflective compound. Deflects most bullets upon impact.
|
block.phase-wall.description = A wall coated with special phase-based reflective compound. Deflection chance is equal to the ratio of bullet damage to base deflection chance.
|
||||||
block.phase-wall-large.description = A wall coated with special phase-based reflective compound. Deflects most bullets upon impact.\nSpans multiple tiles.
|
block.phase-wall-large.description = A wall coated with special phase-based reflective compound. Deflection chance is equal to the ratio of bullet damage to base deflection chance.\nSpans multiple tiles.
|
||||||
block.surge-wall.description = An extremely durable defensive block.\nBuilds up charge on bullet contact, releasing it randomly.
|
block.surge-wall.description = An extremely durable defensive block.\nBuilds up charge on bullet contact, releasing it randomly.
|
||||||
block.surge-wall-large.description = An extremely durable defensive block.\nBuilds up charge on bullet contact, releasing it randomly.\nSpans multiple tiles.
|
block.surge-wall-large.description = An extremely durable defensive block.\nBuilds up charge on bullet contact, releasing it randomly.\nSpans multiple tiles.
|
||||||
block.door.description = A small door. Can be opened or closed by tapping.
|
block.door.description = A small door. Can be opened or closed by tapping.
|
||||||
|
@ -792,14 +792,16 @@ public class Blocks implements ContentList{
|
|||||||
phaseWall = new Wall("phase-wall"){{
|
phaseWall = new Wall("phase-wall"){{
|
||||||
requirements(Category.defense, with(Items.phasefabric, 6));
|
requirements(Category.defense, with(Items.phasefabric, 6));
|
||||||
health = 150 * wallHealthMultiplier;
|
health = 150 * wallHealthMultiplier;
|
||||||
flashHit = deflect = true;
|
chanceDeflect = 10f;
|
||||||
|
flashHit = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
phaseWallLarge = new Wall("phase-wall-large"){{
|
phaseWallLarge = new Wall("phase-wall-large"){{
|
||||||
requirements(Category.defense, ItemStack.mult(phaseWall.requirements, 4));
|
requirements(Category.defense, ItemStack.mult(phaseWall.requirements, 4));
|
||||||
health = 150 * 4 * wallHealthMultiplier;
|
health = 150 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
flashHit = deflect = true;
|
chanceDeflect = 10f;
|
||||||
|
flashHit = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
surgeWall = new Wall("surge-wall"){{
|
surgeWall = new Wall("surge-wall"){{
|
||||||
|
@ -17,16 +17,17 @@ import static mindustry.Vars.*;
|
|||||||
public class Wall extends Block{
|
public class Wall extends Block{
|
||||||
public int variants = 0;
|
public int variants = 0;
|
||||||
|
|
||||||
public float lightningChance = -0.001f;
|
/** Lighting chance. -1 to disable */
|
||||||
|
public float lightningChance = -1f;
|
||||||
public float lightningDamage = 20f;
|
public float lightningDamage = 20f;
|
||||||
public int lightningLength = 17;
|
public int lightningLength = 17;
|
||||||
public Color lightningColor = Pal.surge;
|
public Color lightningColor = Pal.surge;
|
||||||
public Sound lightningSound = Sounds.spark;
|
public Sound lightningSound = Sounds.spark;
|
||||||
|
|
||||||
public float chanceDeflect = 10f;
|
/** Bullet deflection chance. -1 to disable */
|
||||||
|
public float chanceDeflect = -1f;
|
||||||
public boolean flashHit;
|
public boolean flashHit;
|
||||||
public Color flashColor = Color.white;
|
public Color flashColor = Color.white;
|
||||||
public boolean deflect;
|
|
||||||
public Sound deflectSound = Sounds.none;
|
public Sound deflectSound = Sounds.none;
|
||||||
|
|
||||||
public Wall(String name){
|
public Wall(String name){
|
||||||
@ -38,6 +39,17 @@ public class Wall extends Block{
|
|||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStats(){
|
||||||
|
super.setStats();
|
||||||
|
|
||||||
|
if(chanceDeflect > 0f) stats.add(BlockStat.baseDeflectChance, chanceDeflect, StatUnit.none);
|
||||||
|
if(lightningChance > 0f) {
|
||||||
|
stats.add(BlockStat.lightningChance, lightningChance * 100f, StatUnit.percent);
|
||||||
|
stats.add(BlockStat.lightningDamage, lightningDamage, StatUnit.none);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
@ -96,7 +108,7 @@ public class Wall extends Block{
|
|||||||
hit = 1f;
|
hit = 1f;
|
||||||
|
|
||||||
//create lightning if necessary
|
//create lightning if necessary
|
||||||
if(lightningChance > 0){
|
if(lightningChance > 0f){
|
||||||
if(Mathf.chance(lightningChance)){
|
if(Mathf.chance(lightningChance)){
|
||||||
Lightning.create(team, lightningColor, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
Lightning.create(team, lightningColor, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
||||||
lightningSound.at(tile, Mathf.random(0.9f, 1.1f));
|
lightningSound.at(tile, Mathf.random(0.9f, 1.1f));
|
||||||
@ -104,7 +116,7 @@ public class Wall extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//deflect bullets if necessary
|
//deflect bullets if necessary
|
||||||
if(deflect){
|
if(chanceDeflect > 0f){
|
||||||
//slow bullets are not deflected
|
//slow bullets are not deflected
|
||||||
if(bullet.vel().len() <= 0.1f || !bullet.type.reflectable) return true;
|
if(bullet.vel().len() <= 0.1f || !bullet.type.reflectable) return true;
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ public enum BlockStat{
|
|||||||
buildTime(StatCategory.general),
|
buildTime(StatCategory.general),
|
||||||
buildCost(StatCategory.general),
|
buildCost(StatCategory.general),
|
||||||
memoryCapacity(StatCategory.general),
|
memoryCapacity(StatCategory.general),
|
||||||
|
baseDeflectChance(StatCategory.general),
|
||||||
|
lightningChance(StatCategory.general),
|
||||||
|
lightningDamage(StatCategory.general),
|
||||||
|
|
||||||
itemCapacity(StatCategory.items),
|
itemCapacity(StatCategory.items),
|
||||||
itemsMoved(StatCategory.items),
|
itemsMoved(StatCategory.items),
|
||||||
|
Reference in New Issue
Block a user