mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-18 03:37:44 +07:00
@ -628,6 +628,9 @@ stat.ammo = Ammo
|
|||||||
stat.shieldhealth = Shield Health
|
stat.shieldhealth = Shield Health
|
||||||
stat.cooldowntime = Cooldown Time
|
stat.cooldowntime = Cooldown Time
|
||||||
stat.explosiveness = Explosiveness
|
stat.explosiveness = Explosiveness
|
||||||
|
stat.basedeflectchance = Base Deflect Chance
|
||||||
|
stat.lightningchance = Lightning Chance
|
||||||
|
stat.lightningdamage = Lightning Damage
|
||||||
stat.flammability = Flammability
|
stat.flammability = Flammability
|
||||||
stat.radioactivity = Radioactivity
|
stat.radioactivity = Radioactivity
|
||||||
stat.heatcapacity = HeatCapacity
|
stat.heatcapacity = HeatCapacity
|
||||||
|
@ -794,14 +794,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(Stat.baseDeflectChance, chanceDeflect, StatUnit.none);
|
||||||
|
if(lightningChance > 0f){
|
||||||
|
stats.add(Stat.lightningChance, lightningChance * 100f, StatUnit.percent);
|
||||||
|
stats.add(Stat.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;
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@ public enum Stat{
|
|||||||
buildSpeed,
|
buildSpeed,
|
||||||
mineSpeed,
|
mineSpeed,
|
||||||
mineTier,
|
mineTier,
|
||||||
|
baseDeflectChance,
|
||||||
|
lightningChance,
|
||||||
|
lightningDamage,
|
||||||
|
|
||||||
itemCapacity(StatCat.items),
|
itemCapacity(StatCat.items),
|
||||||
itemsMoved(StatCat.items),
|
itemsMoved(StatCat.items),
|
||||||
|
Reference in New Issue
Block a user