From 15004a036d57d0115b2ffa850fd2c329c9822751 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 21 Mar 2003 05:03:49 +0000 Subject: * Eggs regenerate faster * Human weapons stronger * Radically changed the alien evolution process * Buy menu now only shows things you are able to buy --- src/ui/ui_main.c | 123 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 55 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index c23867d1..a48b78bc 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -3322,56 +3322,6 @@ static void UI_LoadTremHumanItems( ) UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( WP_MACHINEGUN ) ) ); } -/* -=============== -UI_LoadTremHumanArmouryBuys -=============== -*/ -static void UI_LoadTremHumanArmouryBuys( ) -{ - int i, j = 0; - stage_t stage = UI_GetCurrentHumanStage( ); - - uiInfo.tremHumanArmouryBuyCount = 0; - - for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ ) - { - if( BG_FindTeamForWeapon( i ) == WUT_HUMANS && - BG_FindPurchasableForWeapon( i ) && - BG_FindStagesForWeapon( i, stage ) ) - { - uiInfo.tremHumanArmouryBuyList[ j ].text = - String_Alloc( BG_FindHumanNameForWeapon( i ) ); - uiInfo.tremHumanArmouryBuyList[ j ].cmd = - String_Alloc( va( "cmd buy %s", BG_FindNameForWeapon( i ) ) ); - uiInfo.tremHumanArmouryBuyList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); - - j++; - - uiInfo.tremHumanArmouryBuyCount++; - } - } - - for( i = UP_NONE +1; i < UP_NUM_UPGRADES; i++ ) - { - if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS && - BG_FindStagesForUpgrade( i, stage ) ) - { - uiInfo.tremHumanArmouryBuyList[ j ].text = - String_Alloc( BG_FindHumanNameForUpgrade( i ) ); - uiInfo.tremHumanArmouryBuyList[ j ].cmd = - String_Alloc( va( "cmd buy %s", BG_FindNameForUpgrade( i ) ) ); - uiInfo.tremHumanArmouryBuyList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); - - j++; - - uiInfo.tremHumanArmouryBuyCount++; - } - } -} - /* =============== UI_ParseCarriageList @@ -3432,6 +3382,74 @@ static void UI_ParseCarriageList( int *weapons, int *upgrades ) } } +/* +=============== +UI_LoadTremHumanArmouryBuys +=============== +*/ +static void UI_LoadTremHumanArmouryBuys( ) +{ + int i, j = 0; + stage_t stage = UI_GetCurrentHumanStage( ); + int weapons, upgrades; + int slots = 0; + + UI_ParseCarriageList( &weapons, &upgrades ); + + for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) + { + if( weapons & ( 1 << i ) ) + slots |= BG_FindSlotsForWeapon( i ); + } + + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) + { + if( upgrades & ( 1 << i ) ) + slots |= BG_FindSlotsForUpgrade( i ); + } + + uiInfo.tremHumanArmouryBuyCount = 0; + + for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ ) + { + if( BG_FindTeamForWeapon( i ) == WUT_HUMANS && + BG_FindPurchasableForWeapon( i ) && + BG_FindStagesForWeapon( i, stage ) && + !( BG_FindSlotsForWeapon( i ) & slots ) ) + { + uiInfo.tremHumanArmouryBuyList[ j ].text = + String_Alloc( BG_FindHumanNameForWeapon( i ) ); + uiInfo.tremHumanArmouryBuyList[ j ].cmd = + String_Alloc( va( "cmd buy %s", BG_FindNameForWeapon( i ) ) ); + uiInfo.tremHumanArmouryBuyList[ j ].infopane = + UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); + + j++; + + uiInfo.tremHumanArmouryBuyCount++; + } + } + + for( i = UP_NONE +1; i < UP_NUM_UPGRADES; i++ ) + { + if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS && + BG_FindStagesForUpgrade( i, stage ) && + !( BG_FindSlotsForUpgrade( i ) & slots ) ) + { + uiInfo.tremHumanArmouryBuyList[ j ].text = + String_Alloc( BG_FindHumanNameForUpgrade( i ) ); + uiInfo.tremHumanArmouryBuyList[ j ].cmd = + String_Alloc( va( "cmd buy %s", BG_FindNameForUpgrade( i ) ) ); + uiInfo.tremHumanArmouryBuyList[ j ].infopane = + UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); + + j++; + + uiInfo.tremHumanArmouryBuyCount++; + } + } +} + /* =============== UI_LoadTremHumanArmourySells @@ -3511,11 +3529,6 @@ static void UI_LoadTremAlienUpgrades( ) uiInfo.tremAlienUpgradeCount++; } } - - uiInfo.tremAlienUpgradeList[ j ].text = String_Alloc( "Store" ); - uiInfo.tremAlienUpgradeList[ j ].cmd = String_Alloc( "cmd class store" ); - uiInfo.tremAlienUpgradeList[ j++ ].infopane = UI_FindInfoPaneByName( "storeclass" ); - uiInfo.tremAlienUpgradeCount++; } /* -- cgit