diff --git a/main/source/mod/AvHBasePlayerWeapon.cpp b/main/source/mod/AvHBasePlayerWeapon.cpp index 64fe63cb..dc0db36b 100644 --- a/main/source/mod/AvHBasePlayerWeapon.cpp +++ b/main/source/mod/AvHBasePlayerWeapon.cpp @@ -1210,6 +1210,7 @@ void AvHBasePlayerWeapon::UpdateInventoryEnabledState(int inNumActiveHives) { // Process here int theEnabledState = 1; + bool theGameStarted = GetGameRules()->GetGameStarted(); ItemInfo theItemInfo; if(this->GetItemInfo(&theItemInfo) != 0) @@ -1218,8 +1219,23 @@ void AvHBasePlayerWeapon::UpdateInventoryEnabledState(int inNumActiveHives) AvHPlayer* thePlayer = dynamic_cast(this->m_pPlayer); ASSERT(thePlayer); + // Pregame alien abilities + if (!theGameStarted) + { + if (!thePlayer->GetIsAbleToAct() || + (thePlayer->pev->iuser3 == AVH_USER3_ALIEN_PLAYER5 && (theWeaponFlags & ONE_HIVE_REQUIRED)) || + (theWeaponFlags & TWO_HIVES_REQUIRED) || + (theWeaponFlags & THREE_HIVES_REQUIRED)) + { + //// Allow leap + //if (!(thePlayer->pev->iuser3 == AVH_USER3_ALIEN_PLAYER1 && (theWeaponFlags & TWO_HIVES_REQUIRED))) + //{ + theEnabledState = 0; + //} + } + } // If we don't have the hives required, or we're ensnared - if (/*thePlayer->GetIsTemporarilyInvulnerable() ||*/ + else if (/*thePlayer->GetIsTemporarilyInvulnerable() ||*/ !thePlayer->GetIsAbleToAct() || ((inNumActiveHives < 1) && (theWeaponFlags & ONE_HIVE_REQUIRED)) || ((inNumActiveHives < 2) && (theWeaponFlags & TWO_HIVES_REQUIRED)) || @@ -1230,9 +1246,8 @@ void AvHBasePlayerWeapon::UpdateInventoryEnabledState(int inNumActiveHives) theEnabledState = 0; } } - - // : 497 save the state for when we send the CurWeapon message - this->m_iEnabled = theEnabledState; + // : 497 save the state for when we send the CurWeapon message + this->m_iEnabled = theEnabledState; } void AvHBasePlayerWeapon::KeyValue(KeyValueData* pkvd) diff --git a/main/source/mod/AvHGamerules.cpp b/main/source/mod/AvHGamerules.cpp index 38406bea..3927ef62 100644 --- a/main/source/mod/AvHGamerules.cpp +++ b/main/source/mod/AvHGamerules.cpp @@ -4272,8 +4272,9 @@ int AvHGamerules::GetBaseHealthForMessageID(AvHMessageID inMessageID) const int AvHGamerules::GetBuildTimeForMessageID(AvHMessageID inMessageID) const { float time = 0.0f; - const float CO_Scalar = this->GetIsCombatMode() ? BALANCE_VAR(kCombatModeTimeScalar) : 1.0f; - const float CO_GScalar = this->GetIsCombatMode() ? BALANCE_VAR(kCombatModeGestationTimeScalar) : 1.0f; + bool theGameStarted = GetGameRules()->GetGameStarted(); + const float CO_Scalar = (this->GetIsCombatMode() || !theGameStarted) ? BALANCE_VAR(kCombatModeTimeScalar) : 1.0f; + const float CO_GScalar = (this->GetIsCombatMode() || !theGameStarted) ? BALANCE_VAR(kCombatModeGestationTimeScalar) : 1.0f; switch(inMessageID) { @@ -4410,18 +4411,6 @@ int AvHGamerules::GetCostForMessageID(AvHMessageID inMessageID) const break; } } - else if (!theGameStarted) - { - switch (inMessageID) - { - case ALIEN_LIFEFORM_TWO: - case ALIEN_LIFEFORM_THREE: - case ALIEN_LIFEFORM_FOUR: - case ALIEN_LIFEFORM_FIVE: - cost = 0; - break; - } - } else { switch(inMessageID) @@ -4490,11 +4479,11 @@ int AvHGamerules::GetCostForMessageID(AvHMessageID inMessageID) const case ALIEN_EVOLUTION_TWELVE: cost = BALANCE_VAR(kEvolutionCost); break; // Alien Lifeforms - case ALIEN_LIFEFORM_ONE: cost = BALANCE_VAR(kSkulkCost); break; - case ALIEN_LIFEFORM_TWO: cost = BALANCE_VAR(kGorgeCost); break; - case ALIEN_LIFEFORM_THREE: cost = BALANCE_VAR(kLerkCost); break; - case ALIEN_LIFEFORM_FOUR: cost = BALANCE_VAR(kFadeCost); break; - case ALIEN_LIFEFORM_FIVE: cost = BALANCE_VAR(kOnosCost); break; + case ALIEN_LIFEFORM_ONE: cost = BALANCE_VAR(kSkulkCost) * theGameStarted; break; + case ALIEN_LIFEFORM_TWO: cost = BALANCE_VAR(kGorgeCost) * theGameStarted; break; + case ALIEN_LIFEFORM_THREE: cost = BALANCE_VAR(kLerkCost) * theGameStarted; break; + case ALIEN_LIFEFORM_FOUR: cost = BALANCE_VAR(kFadeCost) * theGameStarted; break; + case ALIEN_LIFEFORM_FIVE: cost = BALANCE_VAR(kOnosCost) * theGameStarted; break; // Energy Costs case BUILD_SCAN: cost = BALANCE_VAR(kScanEnergyCost); break; diff --git a/main/source/mod/AvHPlayer.cpp b/main/source/mod/AvHPlayer.cpp index bd277cd4..6f1fbdd8 100644 --- a/main/source/mod/AvHPlayer.cpp +++ b/main/source/mod/AvHPlayer.cpp @@ -8200,6 +8200,7 @@ void AvHPlayer::SetUser3(AvHUser3 inUser3, bool inForceChange, bool inGiveWeapon this->SendMessageOnce(theMessage.c_str(), TOOLTIP); } this->LogEmitRoleChange(); + //ALERT(at_console, "resetbehavior newvangle0:%f newvangle1:%f newvangle2:%f\n", this->pev->v_angle[0], this->pev->v_angle[1], this->pev->v_angle[2]); } } @@ -8395,6 +8396,8 @@ void AvHPlayer::StartTopDownMode() VectorCopy(this->pev->angles, this->mAnglesBeforeTopDown); VectorCopy(this->pev->v_angle, this->mViewAnglesBeforeTopDown); VectorCopy(this->pev->view_ofs, this->mViewOfsBeforeTopDown); + //ALERT(at_console, "v_angle0:%f v_angle1:%f v_angle2:%f\n", this->pev->v_angle[0], this->pev->v_angle[1], this->pev->v_angle[2]); + //ALERT(at_console, "saving0:%f saving1:%f saving2:%f\n", this->mViewAnglesBeforeTopDown[0], this->mViewAnglesBeforeTopDown[1], this->mViewAnglesBeforeTopDown[2]); this->mAnimExtensionBeforeTopDown = this->m_szAnimExtention; this->HolsterCurrent(); @@ -8824,6 +8827,9 @@ bool AvHPlayer::StopTopDownMode() VectorCopy(this->mAnglesBeforeTopDown, this->pev->angles); VectorCopy(this->mViewAnglesBeforeTopDown, this->pev->v_angle); VectorCopy(this->mViewOfsBeforeTopDown, this->pev->view_ofs); + //ALERT(at_console, "saved0:%f saved1:%f saved2:%f\n", this->mViewAnglesBeforeTopDown[0], this->mViewAnglesBeforeTopDown[1], this->mViewAnglesBeforeTopDown[2]); + //ALERT(at_console, "newvangle0:%f newvangle1:%f newvangle2:%f\n", this->pev->v_angle[0], this->pev->v_angle[1], this->pev->v_angle[2]); + strcpy(this->m_szAnimExtention, this->mAnimExtensionBeforeTopDown.c_str()); VectorCopy(g_vecZero, this->pev->velocity); @@ -9933,6 +9939,7 @@ void AvHPlayer::UpdateTechNodes() { bool theIsCombatMode = GetGameRules()->GetIsCombatMode(); bool theIsNSMode = GetGameRules()->GetIsNSMode(); + bool theGameStarted = GetGameRules()->GetGameStarted(); if((this->GetUser3() == AVH_USER3_COMMANDER_PLAYER) || theIsCombatMode || this->GetIsAlien()) { AvHTeam* theTeam = this->GetTeamPointer(); @@ -9940,7 +9947,7 @@ void AvHPlayer::UpdateTechNodes() { // Propagate and use local tech nodes in combat mode, else use team nodes in NS mode AvHTechTree& theTechNodes = theIsCombatMode ? this->mCombatNodes : theTeam->GetTechNodes(); - + // Now customize nodes for aliens in NS if(theIsNSMode && this->GetIsAlien()) { @@ -9983,8 +9990,8 @@ void AvHPlayer::UpdateTechNodes() theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_ELEVEN, true); theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_TWELVE, true); - // If not Gorge, set buildables to be unavailable - if(theLifeform != ALIEN_LIFEFORM_TWO) + // If not Gorge or the game hasn't started, set buildables to be unavailable + if(theLifeform != ALIEN_LIFEFORM_TWO || !theGameStarted) { theTechNodes.SetIsResearchable(ALIEN_BUILD_HIVE, false); theTechNodes.SetIsResearchable(ALIEN_BUILD_RESOURCES, false); @@ -10052,7 +10059,10 @@ void AvHPlayer::UpdateTechNodes() } if(!AvHGetHasFreeUpgradeCategory(ALIEN_UPGRADE_CATEGORY_MOVEMENT, theUpgrades, this->pev->iuser4)) { - theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_SEVEN, false); + //if (theGameStarted) + //{ + theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_SEVEN, false); + //} theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_EIGHT, false); theTechNodes.SetIsResearchable(ALIEN_EVOLUTION_NINE, false); } @@ -10064,6 +10074,15 @@ void AvHPlayer::UpdateTechNodes() } } } + + if (UpdatedCosts && !theGameStarted) + UpdatedCosts = false; + + if (theGameStarted && !UpdatedCosts) + { + theTechNodes.processBalanceChange(); + UpdatedCosts = true; + } theTechNodes.GetDelta( this->mClientTechNodes,this->mClientTechDelta ); if( !mClientTechDelta.empty() ) diff --git a/main/source/mod/AvHPlayer.h b/main/source/mod/AvHPlayer.h index 2a08d67b..25bdc27d 100644 --- a/main/source/mod/AvHPlayer.h +++ b/main/source/mod/AvHPlayer.h @@ -692,6 +692,7 @@ private: AvHTechTree mClientTechNodes; MessageIDListType mClientTechDelta; AvHTechSlotListType mClientTechSlotList; + bool UpdatedCosts; AvHMessageID mClientResearchingTech;