/// How much is a Resource worth?
int CvDealAI::GetResourceValue(ResourceTypes eResource, int iResourceQuantity, int iNumTurns, bool bFromMe, PlayerTypes eOtherPlayer)
{
int iItemValue = 0;
const CvResourceInfo* pkResourceInfo = GC.getResourceInfo(eResource);
ResourceUsageTypes eUsage = pkResourceInfo->getResourceUsage();
// Strategic Resource
if(eUsage == RESOURCEUSAGE_STRATEGIC)
{
//tricksy humans trying to sploit us
if(!bFromMe)
{
// if we already have a big surplus of this resource
if(GetPlayer()->getNumResourceAvailable(eResource) > GetPlayer()->getNumCities())
iResourceQuantity = 0;
else
iResourceQuantity = min(max(5,GetPlayer()->getNumCities()), iResourceQuantity);
}
if(!GET_TEAM(GetPlayer()->getTeam()).IsResourceObsolete(eResource))
[B][COLOR="red"]iItemValue += (iResourceQuantity * iNumTurns * 150 / 100); // Ex: 5 Iron for 30 turns * 1.5 = value of 225[/COLOR][/B]
else
iItemValue = 0;
}
// Increase value if it's from us and we don't like the guy
if(bFromMe)
{
int iModifier = 0;
// Opinion also matters
// [B][COLOR="Red"]SNIP ... lots of hard-coded values[/COLOR][/B]
// Approach is important
// [B][COLOR="red"]SNIP ... lots of hard-coded values[/COLOR][/B]
iItemValue *= iModifier;
iItemValue /= 200; // 200 because we've added two mods together
}
return iItemValue;
}