use of megamek.common.weapons.lasers.ISVariableSpeedPulseLaserMedium in project megameklab by MegaMek.
the class StringUtils method getEquipmentInfo.
public static String getEquipmentInfo(Aero unit, Mounted mount) {
String info = "";
if (mount.getType() instanceof WeaponType) {
WeaponType weapon = (WeaponType) mount.getType();
if (weapon instanceof InfantryWeapon) {
info = Integer.toString(weapon.getDamage());
if (weapon.hasFlag(WeaponType.F_BALLISTIC)) {
info += " (B)";
} else if (weapon.hasFlag(WeaponType.F_ENERGY)) {
info += " (E)";
} else if (weapon.hasFlag(WeaponType.F_MISSILE)) {
info += " (M)";
} else if (weapon.hasFlag(WeaponType.F_INF_POINT_BLANK)) {
info += " (P)";
}
if (weapon.hasFlag(WeaponType.F_INF_BURST)) {
info += "B";
}
if (weapon.hasFlag(WeaponType.F_INF_AA)) {
info += "A";
}
if (weapon.hasFlag(WeaponType.F_FLAMER)) {
info += "F";
}
if (weapon.hasFlag(WeaponType.F_INF_NONPENETRATING)) {
info += "N";
}
} else if (weapon.hasFlag(WeaponType.F_MGA)) {
info = "[T]";
} else if (weapon instanceof ISC3M) {
info = "[E]";
} else if (weapon.getDamage() < 0) {
if (weapon instanceof SRMWeapon) {
info = "[M,C]";
} else if ((weapon instanceof LRMWeapon) || (weapon instanceof MekMortarWeapon)) {
info = "[M,C,S]";
} else if ((weapon instanceof MRMWeapon) || (weapon instanceof RLWeapon)) {
info = "[M,C]";
} else if ((weapon instanceof ISSnubNosePPC) || (weapon instanceof ISBombastLaser)) {
info = "[DE,V]";
} else if (weapon instanceof ISVariableSpeedPulseLaserSmall) {
info = "[P,V]";
} else if (weapon instanceof ISVariableSpeedPulseLaserMedium) {
info = "[P,V]";
} else if (weapon instanceof ISVariableSpeedPulseLaserLarge) {
info = "[P,V]";
} else if (weapon instanceof ISHGaussRifle) {
info = "[DB,X]";
} else if (weapon instanceof ISPlasmaRifle) {
info = "[DE,H,AI]";
} else if (weapon instanceof CLPlasmaCannon) {
info = "[DE,H,AI]";
} else if (weapon instanceof HAGWeapon) {
info = "[C,F]";
} else if (weapon instanceof ArtilleryWeapon) {
info = "[AE,S,F]";
} else if (weapon instanceof ArtilleryCannonWeapon) {
info = "[DB,AE]";
} else if (weapon instanceof ThunderBoltWeapon) {
info = "[M]";
} else if (weapon instanceof NarcWeapon) {
info = "[M]";
} else {
info = "";
}
} else if (weapon instanceof UACWeapon) {
info = "[DB,R/C]";
} else {
info = " [";
if (weapon.hasFlag(WeaponType.F_BALLISTIC)) {
info += "DB,";
}
if (UnitUtil.isAMS(weapon) || (weapon instanceof BPodWeapon)) {
info += "PD,";
} else if (weapon.hasFlag(WeaponType.F_PULSE)) {
info += "P,";
} else if (weapon.hasFlag(WeaponType.F_ENERGY)) {
info += "DE,";
}
if ((weapon instanceof LBXACWeapon) || (weapon instanceof ISSilverBulletGauss)) {
info += "C/F,";
}
if (UnitUtil.hasSwitchableAmmo(weapon)) {
info += "S,";
}
if ((weapon instanceof MGWeapon) || (weapon instanceof BPodWeapon) || (weapon instanceof CLERPulseLaserSmall) || (weapon instanceof ISXPulseLaserSmall) || (weapon instanceof ISPulseLaserSmall) || (weapon instanceof CLPulseLaserSmall) || (weapon instanceof CLPulseLaserMicro)) {
info += "AI,";
}
if (weapon instanceof FlamerWeapon) {
info += "H,AI,";
}
if (weapon.isExplosive(mount) && !(weapon instanceof ACWeapon) && (!(weapon instanceof PPCWeapon) || ((mount.getLinkedBy() != null) && mount.getLinkedBy().getType().hasFlag(MiscType.F_PPC_CAPACITOR)))) {
info += "X,";
}
if (weapon.hasFlag(WeaponType.F_ONESHOT)) {
info += "OS,";
}
info = info.substring(0, info.length() - 1) + "]";
}
} else {
info = "[E]";
}
return info;
}
Aggregations