add a display field to weapons just like abilities (#7591)

* weapo

* that
This commit is contained in:
Mythril382
2022-09-18 07:50:27 -04:00
committed by GitHub
parent bc53275c50
commit 991d98b718
2 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -31,6 +31,8 @@ public class Weapon implements Cloneable{
public BulletType bullet = Bullets.placeholder;
/** shell ejection effect */
public Effect ejectEffect = Fx.none;
/** whether weapon should appear in the stats of a unit with this weapon */
public boolean display = true;
/** whether to consume ammo when ammo is enabled in rules */
public boolean useAmmo = true;
/** whether to create a flipped copy of this weapon upon initialization. default: true */
@@ -147,7 +149,7 @@ public class Weapon implements Cloneable{
}
public boolean hasStats(UnitType u){
return true;
return display;
}
public void addStats(UnitType u, Table t){
@@ -22,14 +22,10 @@ public class BuildWeapon extends Weapon{
rotate = true;
noAttack = true;
predictTarget = false;
display = false;
bullet = new BulletType();
}
@Override
public boolean hasStats(UnitType u){
return false;
}
@Override
public void update(Unit unit, WeaponMount mount){
mount.shoot = false;