[FUN] Random ships of the Ooniverse in menu screen

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
pleiadian
Deadly
Deadly
Posts: 143
Joined: Mon Feb 20, 2017 2:14 pm

[FUN] Random ships of the Ooniverse in menu screen

Post by pleiadian »

I know that the spinning Cobra appears to be some kind of trademark of the Elite/Oolite project and name. But maybe, for some of you, this is a little bit boring, so I decided to shape things up a little, by adding a list of the default ships to the start routine, and have it pick one, then spin that on the screen.

I changed the justCobra switch in the setupIntroFirstGo: method of src/Core/Universe.m into this bit:

Code: Select all

if (justCobra)
	{
		// Lets get an array of all possible ships and entities, then show one
		// at random.
		NSMutableArray *ships = [[NSMutableArray alloc] init];
		[ships addObject: PLAYER_SHIP_DESC];
		[ships addObject: @"adder"];
		[ships addObject: @"anaconda"];
		[ships addObject: @"asp"];
		[ships addObject: @"boa"];
		[ships addObject: @"boa-mk2"];
		[ships addObject: @"cobra-mk1"];
		[ships addObject: @"constrictor"];
		[ships addObject: @"coriolis-station"];
		[ships addObject: @"dodecahedron-station"];
		[ships addObject: @"ferdelance"];
		[ships addObject: @"gecko"];
		[ships addObject: @"icosahedron-station"];
		[ships addObject: @"krait"];
		[ships addObject: @"mamba"];
		[ships addObject: @"moray"];
		[ships addObject: @"python"];
		[ships addObject: @"rock-hermit"];
		[ships addObject: @"tharglet"];
		[ships addObject: @"thargoid"];
		[ships addObject: @"transporter"];
		[ships addObject: @"viper"];
		[ships addObject: @"viper-interceptor"];
		[ships addObject: @"worm"];

		srand(time(NULL));
		int r = rand() % 22;

		/*- cobra - intro1 -*/
		//ship = [self newShipWithName:PLAYER_SHIP_DESC usePlayerProxy:YES];
		ship = [self newShipWithName:[ships objectAtIndex: r] usePlayerProxy:YES];
	}



Recompiled... aaaaaand:

Image

Image

Image

Enjoy 8)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: [FUN] Random ships of the Ooniverse in menu screen

Post by another_commander »

Image
terry
Above Average
Above Average
Posts: 17
Joined: Mon Mar 06, 2017 8:26 am

Re: [FUN] Random ships of the Ooniverse in menu screen

Post by terry »

Niiiice! A bit of variety! :D
User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 979
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Re: [FUN] Random ships of the Ooniverse in menu screen

Post by Getafix »

@another_commander
Just like the queen, disguised as a farmer's wife, offering the poisoned apple to Snow White. :lol:

EDIT
terry wrote: Mon Mar 20, 2017 3:01 pm
Niiiice! A bit of variety! :D
@terry
Indeed! I also got tired of the almond cookies! :lol:
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]
Post Reply