View Full Version : Values for plundering?
vormuir Feb 27, 2007, 11:19 PM Does anyone know exactly how much gold we get from plundering?
I mean, I can sort of tell from experimentation... a farm seems to be 1d4 gold, for instance. But it's clear there are different values for the different terrain improvements, and it would be useful to know what they are.
Has anyone ever measured this? Is there a chart somewhere?
thanks in advance,
Waldo
ori Feb 28, 2007, 04:42 AM The Game (CvUnit.cpp) uses the iPillageGold value for that improvement from CIV4ImprovementInfos.xml and does two random rolls to determine the Gold pillaged from that improvement, i.e. with a iPillageGold Value of 5 the game randomly choses a value of 0 to 5 for the first roll and another 0 to 5 for the second roll and adds those two values to get 0 to 10 gold pillaged. The values in Vanilla (I have not checked Warlords but don't think its been changed) are:
Road, Railroad, CityRuins, Forts PillageGold=0
Farm, FishingBoat, WhalingBoat, Workshop, Lumbermill, Windmill, Watermill, Plantation, Quarry, Pasture, Camp PillageGold=5
Mine, OilWell, OffshorePlatform, Winery, Cottage PillageGold=10
Hamlet PillageGold=15
Village PillageGold=20
Town PillageGold=25
So you can get a maximum of 10 gold from farm etc., 20 gold from mine etc., 30 gold from hamlet, 40 gold from village and 50 gold from town...
cabert Feb 28, 2007, 05:14 AM Isn't it a "bonus" for plundering special resources?
I think (but it's a bit faraway, and could have been a coincidence) I had more gold from pillaging gold/gem/silver mines than just from normal mines.
ori Feb 28, 2007, 05:24 AM Isn't it a "bonus" for plundering special resources?
I think (but it's a bit faraway, and could have been a coincidence) I had more gold from pillaging gold/gem/silver mines than just from normal mines.
I thought so as well - and looked into the code just now there is nothing that would account for the resource (neither in the .xml nor in the SDK)
as you can see from the whole code:
bool CvUnit::pillage()
{
CvPlot* pPlot;
CvWString szBuffer;
int iPillageGold;
if (!canPillage(plot()))
{
return false;
}
pPlot = plot();
if (pPlot->getImprovementType() != NO_IMPROVEMENT)
{
if (pPlot->getTeam() != getTeam())
{
iPillageGold = GC.getGameINLINE().getSorenRandNum(GC.getImproveme ntInfo(pPlot->getImprovementType()).getPillageGold(), "Pillage Gold 1");
iPillageGold += GC.getGameINLINE().getSorenRandNum(GC.getImproveme ntInfo(pPlot->getImprovementType()).getPillageGold(), "Pillage Gold 2");
if (iPillageGold > 0)
{
GET_PLAYER(getOwnerINLINE()).changeGold(iPillageGo ld);
szBuffer = gDLL->getText("TXT_KEY_MISC_PLUNDERED_GOLD_FROM_IMP", iPillageGold, GC.getImprovementInfo(pPlot->getImprovementType()).getTextKeyWide());
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, "AS2D_PILLAGE", MESSAGE_TYPE_INFO, GC.getUnitInfo(getUnitType()).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), pPlot->getX_INLINE(), pPlot->getY_INLINE());
if (pPlot->isOwned())
{
szBuffer = gDLL->getText("TXT_KEY_MISC_IMP_DESTROYED", GC.getImprovementInfo(pPlot->getImprovementType()).getTextKeyWide(), getNameKey(), GET_PLAYER(getOwnerINLINE()).getCivilizationAdject iveKey());
gDLL->getInterfaceIFace()->addMessage(pPlot->getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, "AS2D_PILLAGED", MESSAGE_TYPE_INFO, GC.getUnitInfo(getUnitType()).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pPlot->getX_INLINE(), pPlot->getY_INLINE(), true, true);
}
}
}
pPlot->setImprovementType((ImprovementTypes)(GC.getImprov ementInfo(pPlot->getImprovementType()).getImprovementPillage()));
}
else if (pPlot->isRoute())
{
pPlot->setRouteType(NO_ROUTE); // XXX downgrade rail???
}
changeMoves(GC.getMOVE_DENOMINATOR());
if (pPlot->isActiveVisible(false))
{
// Pillage entity mission
CvMissionDefinition kDefiniton;
kDefiniton.fMissionTime = GC.getMissionInfo(MISSION_PILLAGE).getTime() * gDLL->getSecsPerTurn();
kDefiniton.eMissionType = MISSION_PILLAGE;
kDefiniton.pkPlot = pPlot;
kDefiniton.pkUnits[BDU_ATTACKER] = this;
kDefiniton.pkUnits[BDU_DEFENDER] = NULL;
gDLL->getEntityIFace()->AddMission(kDefiniton);
}
return true;
}
the pillage code is simply:
if (pPlot->getTeam() != getTeam())
{
iPillageGold = GC.getGameINLINE().getSorenRandNum(GC.getImproveme ntInfo(pPlot->getImprovementType()).getPillageGold(), "Pillage Gold 1");
iPillageGold += GC.getGameINLINE().getSorenRandNum(GC.getImproveme ntInfo(pPlot->getImprovementType()).getPillageGold(), "Pillage Gold 2");
if (iPillageGold > 0)
{
GET_PLAYER(getOwnerINLINE()).changeGold(iPillageGo ld);
vormuir Feb 28, 2007, 05:37 AM Awesome!
Thanks, Ori!
Waldo
Giaur Feb 28, 2007, 06:09 AM I never plundered before except the Warlords Barbarian Scenario. Awesome one.
feldmarshall Feb 28, 2007, 07:45 AM sometime during a war i received message "you get 5gold from plundering the farm" etc when i did not order my troop to pillage anything? what causes this?
JimT Feb 28, 2007, 07:55 AM sometime during a war i received message "you get 5gold from plundering the farm" etc when i did not order my troop to pillage anything? what causes this?
autoexplore or bug in a mod
JIM G Feb 28, 2007, 08:09 AM Not quite the same as feldmarshall, but I often don't get the message about pillaging farms until the next turn - but its only farms this happens on...
|
|