Open eriktorbjorn opened 5 years ago
It also checks VIEW-COUNT
in a couple of other cases, while there's only one case where it checks ORBIT-MATCHED
, and that's described above. Maybe we should change as little as possible here, i.e. only the COURSE-SELECTED
vs TRIP-COUNT
one, and the order in which things are checked?
The navigational computer handles both "SET COURSE FOR known mass" and "SET parameter TO value". But it responds a bit different when it won't (or can't) comply. This is all handled in
COMPUTER-FCN
.Here is the code for "SET COURSE FOR known mass":
And here is the one for "SET parameter TO value":
That they use slightly different messages is just fine, I think, but I do think they should use the same conditions. Right now, we have the following variables to look at:
COUNTDOWN
, which is set when you confirm the coordinates to the computer, and then cleared once the engines start.COURSE-SELECTED
, which is set if you survive the engines starting.TRIP-COUNT
, which start at 0 and is increased every time you're told that you journey towards your destination.ORBIT-MATCHED
, which is set when the computer tells you that your ship matches course with the artifact.VIEW-COUNT
, which is set to 1 whenORBIT-MATCHED
is set, and then increased as the artifact rotates.DOCKED?
, which is set when the ship is grabbed.Checking
ORBIT-MATCHED
andVIEW-COUNT
is the same thing. I would preferORBIT-MATCHED
though, since it's more obvious what it means.Checking
COURSE-SELECTED
andTRIP-COUNT
is not the same thing, becauseTRIP-COUNT
is still 0 the first turn afterCOURSE-SELECTED
is set, and apparently a few turns after that as well. You get the wrong reply if you try to change one of the parameters during that time.And of course, the order you check things in matter as well. Right now, "SET parameter TO value" will never trigger the
DOCKED?
case. I think the order should to check in should be:DOCKED?
ORBIT-MATCHED
COURSE-SELECTED
COUNTDOWN
I think that should work.