to-boldly-go / tbg-shipdesigner

Ship designer webapp for To Boldly Go
2 stars 2 forks source link

Refit mode #45

Closed lbmaian closed 6 years ago

lbmaian commented 6 years ago

Implement refit mode using calculation described at https://forums.sufficientvelocity.com/threads/starfleet-ship-design-bureau-to-boldly-go.33039/page-184#post-9274965

lbmaian commented 6 years ago

Refit cost formula:

if part name is the same:
    if new cost >= old cost:
        new cost - old cost
    else:
        (new cost - old cost) / 2
else:
    new cost - old cost / 2

Important note: "part name" needs to also include phaser arrays and burst torps if applicable, since those virtually each double the number of phaser/torp parts.

lbmaian commented 6 years ago

Important note: "part name" needs to also include phaser arrays and burst torps if applicable, since those virtually each double the number of phaser/torp parts.

With #63 and #71, this is no longer necessary.

lbmaian commented 6 years ago

Refit and compare design modes have been implemented and deployed. Any bugs with the implementation will be addressed separately.

lbmaian commented 6 years ago

With #63 and #71, this is no longer necessary.

Even though this is the case, since the toggles still exist for the time being (and in case any future toggles might exist), adding code to treat phaser arrays and burst torp toggles as part of the "part name" when determining refit costs.