KFNEXUS / KFNEXUS.github.io

GNU Lesser General Public License v3.0
3 stars 6 forks source link

Admiral Faction Penalty Issue #45

Closed SpinStabilized closed 6 years ago

SpinStabilized commented 6 years ago

From the Attack Wing Community Facebook Group:

Bryan Gillespie: Just noticed today that a few of the admirals are only adding +1pt for cross faction when it should be +3.

Brian McLaughlin: Do you have a list of who you’ve seen that on? Specifics help in tracking down the problem. Thanks!

Bryan Gillespie: At least all federation and the Vulcan admirals, not had a chance to look at all yet

Bryan Gillespie: Fed, Vulcan, Xindi and Ferengi admirals are all only +1pt on cross faction, the rest seem fine. Tested them on a Borg ship and a Romulan ship

SpinStabilized commented 6 years ago

Found the problem. The updates for faction penalty calculation has been giving many admirals only 1 SP rather than 3 because of the following code style:

"admiral:haden_72011":{
    factionPenalty: function(upgrade, ship, fleet) {
        return ship && $factions.hasFaction( ship, "bajoran", ship, fleet ) ? 0 : 1 && $factions.hasFaction( ship, "vulcan", ship, fleet ) ? 0 : 1;
}},

It should have 3 instead of 1. Need to clean up on a larger scale but changing these to 3 from 1 for the admirals should fix the problem as a quick fix.

"admiral:haden_72011":{
    factionPenalty: function(upgrade, ship, fleet) {
        return ship && $factions.hasFaction( ship, "bajoran", ship, fleet ) ? 0 : 3 && $factions.hasFaction( ship, "vulcan", ship, fleet ) ? 0 : 3;
}},
SpinStabilized commented 6 years ago

Fix pushed to KFNEXUS. Tested with Maxwell on a Borg ship (See screenshot). Proper 3 SP increase applied. (Test build: http://bit.ly/2vq5uxa)

screen shot 2018-04-19 at 12 49 55 pm