hard limit to jump distance 7.0LY

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@463 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Giles Williams 2006-04-16 23:34:11 +00:00
parent 5ab0d9a295
commit bdf0a407c1
2 changed files with 18 additions and 2 deletions

View File

@ -401,6 +401,10 @@
<array>
<string>Insufficient fuel for witchspace jump.</string>
</array>
<key>witch-too-far</key>
<array>
<string>Engines incapable of witchspace jump to that target.</string>
</array>
<key>witch-engine-malfunction</key>
<array>
<string>Witchspace engine malfunction!</string>

View File

@ -1719,9 +1719,21 @@ double scoopSoundPlayTime = 0.0;
status = STATUS_IN_FLIGHT;
go = NO;
}
// check max distance permitted
double jump_distance = distanceBetweenPlanetPositions(target_system_seed.d,target_system_seed.b,galaxy_coordinates.x,galaxy_coordinates.y);
if (jump_distance > 7.0)
{
[universe clearPreviousMessage];
[universe addMessage:[universe expandDescription:@"[witch-too-far]" forSystem:system_seed] forCount: 4.5];
if (![universe playCustomSound:@"[witch-too-far]"])
[witchAbortSound play];
status = STATUS_IN_FLIGHT;
go = NO;
}
// check fuel level
double fuel_required = 10.0 * distanceBetweenPlanetPositions(target_system_seed.d,target_system_seed.b,galaxy_coordinates.x,galaxy_coordinates.y);
double fuel_required = 10.0 * jump_distance;
if (galactic_witchjump)
fuel_required = 0.0;
if (fuel < fuel_required)