add a display field to weapons just like abilities (#7591)
* weapo * that
This commit is contained in:
@@ -31,6 +31,8 @@ public class Weapon implements Cloneable{
|
|||||||
public BulletType bullet = Bullets.placeholder;
|
public BulletType bullet = Bullets.placeholder;
|
||||||
/** shell ejection effect */
|
/** shell ejection effect */
|
||||||
public Effect ejectEffect = Fx.none;
|
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 */
|
/** whether to consume ammo when ammo is enabled in rules */
|
||||||
public boolean useAmmo = true;
|
public boolean useAmmo = true;
|
||||||
/** whether to create a flipped copy of this weapon upon initialization. default: 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){
|
public boolean hasStats(UnitType u){
|
||||||
return true;
|
return display;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addStats(UnitType u, Table t){
|
public void addStats(UnitType u, Table t){
|
||||||
|
|||||||
@@ -22,14 +22,10 @@ public class BuildWeapon extends Weapon{
|
|||||||
rotate = true;
|
rotate = true;
|
||||||
noAttack = true;
|
noAttack = true;
|
||||||
predictTarget = false;
|
predictTarget = false;
|
||||||
|
display = false;
|
||||||
bullet = new BulletType();
|
bullet = new BulletType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasStats(UnitType u){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit, WeaponMount mount){
|
public void update(Unit unit, WeaponMount mount){
|
||||||
mount.shoot = false;
|
mount.shoot = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user