2010/5/16のペリク鯖バックアップ

インフレーション

最終更新:

civilization

- view
だれでも歓迎! 編集

Spoiler for Warlords Inflation:

Code: int CvPlayer::calculateInflationRate()

{ 
	int iTurns; 
	int iRate; 
 
	iTurns = ((GC.getGameINLINE().getGameTurn() + GC.getGameINLINE().getElapsedGameTurns()) / 2); 
	iTurns += GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getInflationOffset(); 
 
	if (iTurns < 0) 
	{ 
		return 0; 
	} 
 
	iRate = iTurns; 
 
	iRate *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getInflationPercent(); 
	iRate /= 100; 
 
	iRate *= GC.getHandicapInfo(getHandicapType()).getInflationPercent(); 
	iRate /= 100; 
 
	if (!isHuman() && !isBarbarian()) 
	{ 
		iRate *= GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIInflationPercent(); 
		iRate /= 100; 
 
		iRate *= max(0, ((GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIPerEraModifier() * getCurrentEra()) + 100)); 
		iRate /= 100; 
	} 
 
	FAssert(iRate >= 0); 
 
	return iRate; 
} 
 
 
int CvPlayer::calculateInflatedCosts() 
{ 
	int iCosts; 
 
	iCosts = calculatePreInflatedCosts(); 
 
	iCosts *= max(0, (calculateInflationRate() + 100)); 
	iCosts /= 100; 
 
	return iCosts; 
}

タグ:

+ タグ編集
  • タグ:
記事メニュー
ウィキ募集バナー