I started work on the system today. Fortunately, we are now on summer schedule at the school, which means we start earlier but get extra breaks throughout the day. So, I had plenty of air-conditioned time to work on GearHead.
If no skill specialty can be found, a theme and specialty are assigned when a NPC's skill level is set. The skill specialty is picked from a list associated with the NPC's faction. After that, the theme is picked from a list based on the NPC's faction, job, personality traits, and skill specialty.
So far so good. Next, I've started work on the mecha customizer itself. The customizer procedure is given a mecha, a skill specialty, a theme, and a number of modification points. Modifications are added until the points run out.
I'm starting with a simplified case- only weapon upgrades are being applied. I'll add additional upgrade types one at a time. Here are the comments for the weapon upgrade procedure (I haven't started writing the code in between yet):
{ Step one- locate the weapon to remove. }
{ If no weapons can be found at all (degenerate!), cut to the AddWeapon }
{ procedure instead. }
Each weapon in the mecha records the number of times it has been upgraded. When a new upgrade is requested, one of the weapons with the lowest upgrade total is selected to be upgraded. The mecha's "primary weapon" should be chosen as the first weapon to upgrade, then not selected again until all other weapons have been upgraded as well.
Note that I now need a procedure to determine what counts as a mecha's primary weapon. This will usually be the most expensive non-intrinsic weapon, but I think the NPC's specialist skill should also have something to do with it. When modifying a BuruBuru, usually the Shaka Cannon will be selected as the primary weapon. A character specializing in Mecha Weapons should treat the Axe as the primary weapon instead.
Hmm.. Maybe I can dispense with the notion of primary weapons altogether. Just always select the weapon with the fewest modifications, or the most expensive one that uses the PC's preferred skill, or just the most expensive one.
{ Step two- locate a new weapon from the parts list which: }
{ 1) is of the same basic type as the weapon being replaced, }
{ 2) has a value greater than that of the weapon being replaced }
{ but smaller than any other weapon matching 1. }
Every Theme gear has an equipment list in its invcoms. Because the gears are selected by value, I don't think I need to sort the lists in any way, but it will be important to make sure that the graph of lowest to highest value not have any gaping holes in it.
{ Step three- perform the swap. }
{ Record the number of upgrades + 1 in the new weapon. }
{ Step four- check to make sure the MV is as good as it ever was. }
{ If the MV has improved, this modification costs one point extra! }
That's it. I'll be working out the implementation tonight and tomorrow. I'll let you know how that works out.