Developer's Diary
Software development, with Terry Ebdon
17-Mar-2019 Slow warp & counter attack

Can't enter a warp factor of 0.2 when the engines are damaged

This is odd as the code looks OK, from a quick glance. (Ignore the hard-coded messages and keys, they're logged as separate issues.)

image

Despite the above test a warp factor of .2 is rejected:

image

This may be related to issue #6 - Minimum warp factor should be 0.125, not 0.25, though that issue is closed.

Enemy fleet should not counter-attack when the ship is docked

While docked the ship should be protected from all enemy attacks, but this is not always the case. The enemy fleet will attack under two conditions:

  1. Immediately before executing a user-requested manoeuvre.
  2. As a counter-attack in response to phaser fire or a torpedo launch.

In scenario 1 the ship is protected, and this prevents the fleet from attacking. A check in Trek.enemyAttacksBeforeShipCanMove() enables this protection.

In scenario 2 the battle computer initiates a fleet counter-attack without asking the ship if it is protected. This is a bug. A fix is required in Battle.enemyCounterAttacks().

image

16-MAR-2019 👈 Top of page 👉 08-MAY-2019

© 2020 Terry Ebdon.

Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.