More defense fields for modding(fixed) (#2490)
* lightningColor for Shock Mines Because various colored lightning is widely used in 6.0, this would be neat for modders. * doorSound * just...in case * oh no
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.defense;
|
package mindustry.world.blocks.defense;
|
||||||
|
|
||||||
|
import arc.audio.*;
|
||||||
import arc.Graphics.*;
|
import arc.Graphics.*;
|
||||||
import arc.Graphics.Cursor.*;
|
import arc.Graphics.Cursor.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
@@ -23,6 +24,7 @@ public class Door extends Wall{
|
|||||||
public final int timerToggle = timers++;
|
public final int timerToggle = timers++;
|
||||||
public Effect openfx = Fx.dooropen;
|
public Effect openfx = Fx.dooropen;
|
||||||
public Effect closefx = Fx.doorclose;
|
public Effect closefx = Fx.doorclose;
|
||||||
|
public Sound doorSound = Sounds.door;
|
||||||
public @Load("@-open") TextureRegion openRegion;
|
public @Load("@-open") TextureRegion openRegion;
|
||||||
|
|
||||||
public Door(String name){
|
public Door(String name){
|
||||||
@@ -32,7 +34,7 @@ public class Door extends Wall{
|
|||||||
consumesTap = true;
|
consumesTap = true;
|
||||||
|
|
||||||
config(Boolean.class, (DoorBuild base, Boolean open) -> {
|
config(Boolean.class, (DoorBuild base, Boolean open) -> {
|
||||||
Sounds.door.at(base);
|
doorSound.at(base);
|
||||||
|
|
||||||
for(DoorBuild entity : base.chained){
|
for(DoorBuild entity : base.chained){
|
||||||
//skip doors with things in them
|
//skip doors with things in them
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.defense;
|
package mindustry.world.blocks.defense;
|
||||||
|
|
||||||
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
@@ -15,6 +16,7 @@ public class ShockMine extends Block{
|
|||||||
public float damage = 13;
|
public float damage = 13;
|
||||||
public int length = 10;
|
public int length = 10;
|
||||||
public int tendrils = 6;
|
public int tendrils = 6;
|
||||||
|
public Color lightningColor = Pal.lancerLaser;
|
||||||
|
|
||||||
public ShockMine(String name){
|
public ShockMine(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -45,7 +47,7 @@ public class ShockMine extends Block{
|
|||||||
public void unitOn(Unit unit){
|
public void unitOn(Unit unit){
|
||||||
if(enabled && unit.team != team && timer(timerDamage, cooldown)){
|
if(enabled && unit.team != team && timer(timerDamage, cooldown)){
|
||||||
for(int i = 0; i < tendrils; i++){
|
for(int i = 0; i < tendrils; i++){
|
||||||
Lightning.create(team, Pal.lancerLaser, damage, x, y, Mathf.random(360f), length);
|
Lightning.create(team, lightningColor, damage, x, y, Mathf.random(360f), length);
|
||||||
}
|
}
|
||||||
damage(tileDamage);
|
damage(tileDamage);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user