Okay much easier than I thought. First open the PlayerEntity.m file again and find the code I modified before:
Code: Select all
// Check if the GH Reverse Unit equipment is present:
if ([self hasEquipmentItem:@"EQ_GAL_DRIVE_REVERSE_UNIT"])
{
// Decrease galaxy number and do it in a safe way:
if (galaxy_number > 0)
{
galaxy_number--;
}
else // we are at galaxy 0, now we need to cycle to 7
{
galaxy_number = 7;
}
// Rotate Galaxy Seed right instead of left to change to previous Galaxy Seed:
galaxy_seed.a = rotate_byte_right(galaxy_seed.a);
galaxy_seed.b = rotate_byte_right(galaxy_seed.b);
galaxy_seed.c = rotate_byte_right(galaxy_seed.c);
galaxy_seed.d = rotate_byte_right(galaxy_seed.d);
galaxy_seed.e = rotate_byte_right(galaxy_seed.e);
galaxy_seed.f = rotate_byte_right(galaxy_seed.f);
// Remove the GH Reverse Unit equipment:
[self removeEquipmentItem:@"EQ_GAL_DRIVE_REVERSE_UNIT"];
}
else
{
galaxy_number++;
galaxy_number &= 7;
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
}
And replace it with the following code:
Code: Select all
// Check if going forward or backwards:
if (!galactic_witchjump_reverse)
{
galaxy_number++;
galaxy_number &= 7;
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
}
else
{
// Decrease galaxy number and do it in a safe way:
if (galaxy_number > 0)
{
galaxy_number--;
}
else // we are at galaxy 0, now we need to cycle to 7
{
galaxy_number = 7;
}
// Rotate Galaxy Seed right instead of left to change to previous Galaxy Seed:
galaxy_seed.a = rotate_byte_right(galaxy_seed.a);
galaxy_seed.b = rotate_byte_right(galaxy_seed.b);
galaxy_seed.c = rotate_byte_right(galaxy_seed.c);
galaxy_seed.d = rotate_byte_right(galaxy_seed.d);
galaxy_seed.e = rotate_byte_right(galaxy_seed.e);
galaxy_seed.f = rotate_byte_right(galaxy_seed.f);
// Ensure that the next gal-jump will not automatically go in reverse:
galactic_witchjump_reverse = NO;
}
Now noticed I've referenced a variable that hasn't yet been defined, 'galactic_witchjump_reverse'. We'll sort that in a moment.
Now open up the PlayerEntity.h file and go to line 404, finding the following code:
Code: Select all
OOKeyCode key_galactic_hyperspace;
And insert below this line:
Code: Select all
OOKeyCode key_galactic_hyperspace_rev;
Next go down to about line 495 and find the following code:
And insert below this line:
Now open the PlayerEntityControls.m file and go to line 226 finding the following code:
Code: Select all
LOAD_KEY_SETTING(key_galactic_hyperspace, 'g' );
And insert below this line:
Code: Select all
LOAD_KEY_SETTING(key_galactic_hyperspace_rev, 'G' );
Now go down to line 1228 and replace the following code:
Code: Select all
exceptionContext = @"galactic hyperspace";
// Galactic hyperspace 'g'
if (([gameView isDown:key_galactic_hyperspace] || joyButtonState[BUTTON_GALACTICDRIVE]) &&
([self hasEquipmentItem:@"EQ_GAL_DRIVE"]))// look for the 'g' key
{
if (!galhyperspace_pressed)
{
if ([self status] == STATUS_WITCHSPACE_COUNTDOWN)
{
// abort!
[self setStatus:STATUS_IN_FLIGHT];
[self playHyperspaceAborted];
// say it!
[UNIVERSE clearPreviousMessage];
if (galactic_witchjump)
{
galactic_witchjump = NO;
[UNIVERSE addMessage:DESC(@"witch-user-galactic-abort") forCount:3.0];
}
else
{
[UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
}
[self doScriptEvent:OOJSID("playerCancelledJumpCountdown")];
}
else
{
galactic_witchjump = YES;
// even if we don't have a witchspace motor, we can still do a default galactic jump (!)
if(EXPECT([self hasHyperspaceMotor])) witchspaceCountdown = hyperspaceMotorSpinTime;
else witchspaceCountdown = DEFAULT_HYPERSPACE_SPIN_TIME;
[self setStatus:STATUS_WITCHSPACE_COUNTDOWN];
[self playGalacticHyperspace];
// say it!
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"witch-galactic-in-f-seconds"), witchspaceCountdown] forCount:1.0];
// FIXME: how to preload target system for hyperspace jump?
[self doScriptEvent:OOJSID("playerStartedJumpCountdown")
withArguments:[NSArray arrayWithObjects:@"galactic", [NSNumber numberWithFloat:witchspaceCountdown], nil]];
}
}
galhyperspace_pressed = YES;
}
else
galhyperspace_pressed = NO;
With the following code:
Code: Select all
exceptionContext = @"galactic hyperspace";
// Galactic hyperspace 'g'
if (([gameView isDown:key_galactic_hyperspace] || joyButtonState[BUTTON_GALACTICDRIVE]) && ([self hasEquipmentItem:@"EQ_GAL_DRIVE"]))// look for the 'g' key
{
if (!galhyperspace_pressed)
{
if ([self status] == STATUS_WITCHSPACE_COUNTDOWN)
{
// abort!
[self setStatus:STATUS_IN_FLIGHT];
[self playHyperspaceAborted];
// say it!
[UNIVERSE clearPreviousMessage];
if (galactic_witchjump)
{
galactic_witchjump = NO;
[UNIVERSE addMessage:DESC(@"witch-user-galactic-abort") forCount:3.0];
}
else
{
[UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
}
[self doScriptEvent:OOJSID("playerCancelledJumpCountdown")];
}
else
{
galactic_witchjump = YES;
// even if we don't have a witchspace motor, we can still do a default galactic jump (!)
if(EXPECT([self hasHyperspaceMotor])) witchspaceCountdown = hyperspaceMotorSpinTime;
else witchspaceCountdown = DEFAULT_HYPERSPACE_SPIN_TIME;
[self setStatus:STATUS_WITCHSPACE_COUNTDOWN];
[self playGalacticHyperspace];
// say it!
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"witch-galactic-in-f-seconds"), witchspaceCountdown] forCount:1.0];
// FIXME: how to preload target system for hyperspace jump?
[self doScriptEvent:OOJSID("playerStartedJumpCountdown")
withArguments:[NSArray arrayWithObjects:@"galactic", [NSNumber numberWithFloat:witchspaceCountdown], nil]];
}
}
galhyperspace_pressed = YES;
}
else if (([gameView isDown:key_galactic_hyperspace_rev] && ([self hasEquipmentItem:@"EQ_GAL_DRIVE"])))// look for the 'G' key
{
if (!galhyperspace_pressed)
{
if ([self status] == STATUS_WITCHSPACE_COUNTDOWN)
{
// abort!
[self setStatus:STATUS_IN_FLIGHT];
[self playHyperspaceAborted];
// say it!
[UNIVERSE clearPreviousMessage];
if (galactic_witchjump)
{
galactic_witchjump = NO;
galactic_witchjump_reverse = NO;
[UNIVERSE addMessage:DESC(@"witch-user-galactic-abort") forCount:3.0];
}
else
{
[UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
}
[self doScriptEvent:OOJSID("playerCancelledJumpCountdown")];
}
else
{
galactic_witchjump = YES;
galactic_witchjump_reverse = YES;
// even if we don't have a witchspace motor, we can still do a default galactic jump (!)
if(EXPECT([self hasHyperspaceMotor])) witchspaceCountdown = hyperspaceMotorSpinTime;
else witchspaceCountdown = DEFAULT_HYPERSPACE_SPIN_TIME;
[self setStatus:STATUS_WITCHSPACE_COUNTDOWN];
[self playGalacticHyperspace];
// say it!
[UNIVERSE addMessage:[NSString stringWithFormat:DESC(@"witch-galactic-in-f-seconds"), witchspaceCountdown] forCount:1.0];
// FIXME: how to preload target system for hyperspace jump?
[self doScriptEvent:OOJSID("playerStartedJumpCountdown")
withArguments:[NSArray arrayWithObjects:@"galactic", [NSNumber numberWithFloat:witchspaceCountdown], nil]];
}
}
galhyperspace_pressed = YES;
}
else
{
galhyperspace_pressed = NO;
}
Finally, open the keyconfig.plist file in the Config directory and find the following line:
And insert below this line:
Code: Select all
key_galactic_hyperspace_rev = "G";
Now when you press Shift-G in game you should go in reverse rather than forward, and no extra equipment is required!