-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6025 from SJuliez/equipment-clean
Weapon Handler Comment cleanup
- Loading branch information
Showing
41 changed files
with
607 additions
and
840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
/** | ||
/* | ||
* MegaMek - Copyright (C) 2004 Ben Mazur ([email protected]) | ||
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* This file is part of MegaMek. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
/* | ||
* Created on Oct 15, 2017 | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megamek.common.weapons; | ||
|
||
import java.io.Serial; | ||
import java.util.Vector; | ||
|
||
import megamek.common.*; | ||
|
@@ -26,19 +29,11 @@ | |
/** | ||
* @author Dave Nawton | ||
*/ | ||
|
||
|
||
public class ACCaselessHandler extends ACWeaponHandler { | ||
|
||
@Serial | ||
private static final long serialVersionUID = -6614562346449113878L; | ||
|
||
/** | ||
* @param t | ||
* @param w | ||
* @param g | ||
*/ | ||
public ACCaselessHandler (ToHitData t, WeaponAttackAction w, | ||
Game g, TWGameManager m) { | ||
public ACCaselessHandler (ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) { | ||
super(t, w, g, m); | ||
} | ||
|
||
|
@@ -47,7 +42,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) { | |
if (doAmmoFeedProblemCheck(vPhaseReport)) { | ||
return true; | ||
} | ||
|
||
if ((roll.getIntValue() <= 2) && !ae.isConventionalInfantry()) { | ||
Roll diceRoll = Compute.rollD6(2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
/* | ||
* MegaMek - Copyright (C) 2005 Ben Mazur ([email protected]) | ||
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* This file is part of MegaMek. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megamek.common.weapons; | ||
|
||
|
@@ -18,18 +24,16 @@ | |
import megamek.common.actions.WeaponAttackAction; | ||
import megamek.server.totalwarfare.TWGameManager; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* @author Sebastian Brocks | ||
* @since Sep 5, 2004 | ||
*/ | ||
public class ACIncendiaryHandler extends ACWeaponHandler { | ||
@Serial | ||
private static final long serialVersionUID = 3301631731286472616L; | ||
|
||
/** | ||
* @param t | ||
* @param w | ||
* @param g | ||
*/ | ||
public ACIncendiaryHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) { | ||
super(t, w, g, m); | ||
damageType = DamageType.INCENDIARY; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
/* | ||
* MegaMek - Copyright (C) 2005 Ben Mazur ([email protected]) | ||
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* This file is part of MegaMek. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megamek.common.weapons; | ||
|
||
|
@@ -18,27 +24,19 @@ | |
import megamek.common.actions.WeaponAttackAction; | ||
import megamek.server.totalwarfare.TWGameManager; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* @author Sebastian Brocks | ||
*/ | ||
public class ACTracerHandler extends ACWeaponHandler { | ||
@Serial | ||
private static final long serialVersionUID = 7326881584091651519L; | ||
|
||
/** | ||
* @param t | ||
* @param w | ||
* @param g | ||
* @param m | ||
*/ | ||
public ACTracerHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) { | ||
super(t, w, g, m); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see megamek.common.weapons.WeaponHandler#calcDamagePerHit() | ||
*/ | ||
@Override | ||
protected int calcDamagePerHit() { | ||
return super.calcDamagePerHit() - 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
/* | ||
* MegaMek - Copyright (C) 2005 Ben Mazur ([email protected]) | ||
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* This file is part of MegaMek. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megamek.common.weapons; | ||
|
||
|
@@ -18,32 +24,23 @@ | |
import megamek.common.options.OptionsConstants; | ||
import megamek.server.totalwarfare.TWGameManager; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* @author Jason Tighe | ||
*/ | ||
public class ACWeaponHandler extends AmmoWeaponHandler { | ||
@Serial | ||
private static final long serialVersionUID = 7326881584091651519L; | ||
|
||
/** | ||
* @param t | ||
* @param w | ||
* @param g | ||
* @param m | ||
*/ | ||
public ACWeaponHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) { | ||
super(t, w, g, m); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see megamek.common.weapons.WeaponHandler#calcDamagePerHit() | ||
*/ | ||
@Override | ||
protected int calcDamagePerHit() { | ||
double toReturn = wtype.getDamage(); | ||
// during a swarm, all damage gets applied as one block to one | ||
// location | ||
// during a swarm, all damage gets applied as one block to one location | ||
if ((ae instanceof BattleArmor) | ||
&& (weapon.getLocation() == BattleArmor.LOC_SQUAD) | ||
&& !(weapon.isSquadSupportWeapon()) | ||
|
@@ -69,7 +66,7 @@ protected int calcDamagePerHit() { | |
if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_LOS_RANGE) | ||
&& (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME])) { | ||
toReturn = (int) Math.floor(toReturn * .5); | ||
} | ||
} | ||
|
||
return (int) toReturn; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
/* | ||
* MegaMek - Copyright (C) 2005 Ben Mazur ([email protected]) | ||
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* This file is part of MegaMek. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* MegaMek is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* MegaMek is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with MegaMek. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package megamek.common.weapons; | ||
|
||
import megamek.common.*; | ||
import megamek.common.actions.WeaponAttackAction; | ||
import megamek.server.totalwarfare.TWGameManager; | ||
|
||
import java.io.Serial; | ||
import java.util.Vector; | ||
|
||
/** | ||
|
@@ -29,24 +36,13 @@ | |
* AE damage and without rolling on the cluster table. | ||
*/ | ||
public class ADAMissileWeaponHandler extends MissileWeaponHandler { | ||
@Serial | ||
private static final long serialVersionUID = 6329291710822071023L; | ||
|
||
/** | ||
* @param t | ||
* @param w | ||
* @param g | ||
* @param m | ||
*/ | ||
public ADAMissileWeaponHandler(ToHitData t, WeaponAttackAction w, Game g, | ||
TWGameManager m) { | ||
public ADAMissileWeaponHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) { | ||
super(t, w, g, m); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see megamek.common.weapons.WeaponHandler#calcDamagePerHit() | ||
*/ | ||
@Override | ||
protected int calcDamagePerHit() { | ||
return 20; | ||
|
Oops, something went wrong.