Richnes of colony based on what?

Started by Noobier, June 18, 2014, 09:22:55 AM

Previous topic - Next topic

Noobier

Hi,
I'm new to all of this but want to make my game a little bit easyer. So my plan was to lower the overall richnes of my colony by reducing the value of each item counted in the calculation.
Can anyone tell me what is calculated and where i maybe can edit the values?

Thx
Noobier

mrofa

Its in thingdefs .xml`s
Calculation uses resources needed for that item, so you basicly would need to lower cost of everything.
All i do is clutter all around.

iame6162013

Quote from: mrofa on June 18, 2014, 09:40:48 AM
Its in thingdefs .xml`s
Calculation uses resources needed for that item, so you basicly would need to lower cost of everything.
or make it negative o.0
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Robert J. Hanlon: "Never attribute to malice that which is adequately explained by stupidity."

Noobier

What about the calculation?
Is it possible to a some /2 to it somewhere?
Because lowering the costs of everything would make the colony prosper much faster therefore the difficulty would rise faster therefore no decreased difficulty.

mrofa

Well you would need to write new class to .dll for clalculation and thats only if your lucky an thers only one class with clalculation to begin with, didnt check it personaly.
All i do is clutter all around.

wootastic

I went ahead and checked for you.  Looks like it is just one class so it should be easy to make.  I'll post the whole class below and you would specifically want to change the first method "WealthTotal" to return something like "return (this.wealthItems + this.wealthBuildings)/2;"


using System;
using Verse;
public class StoryWatcher_Wealth
{
private const int MinCountInterval = 5000;
private const float BuildingPriceWealthFactor = 0.6f;
private float wealthItems;
private float wealthBuildings;
private float lastCountTick = -99999f;
public float WealthTotal
{
get
{
this.RecountIfNeeded();
return this.wealthItems + this.wealthBuildings;
}
}
public float WealthItems
{
get
{
this.RecountIfNeeded();
return this.wealthItems;
}
}
public float WealthBuildings
{
get
{
this.RecountIfNeeded();
return this.wealthBuildings;
}
}
private void RecountIfNeeded()
{
if ((float)Find.TickManager.tickCount - this.lastCountTick > 5000f)
{
this.ForceRecountWealth();
}
}
public void ForceRecountWealth()
{
this.wealthItems = 0f;
this.wealthBuildings = 0f;
foreach (Thing current in Find.ListerThings.ThingsInGroup(ThingRequestGroup.HaulableAlways))
{
Zone zone = Find.ZoneManager.ZoneAt(current.Position);
if ((zone != null && zone is Zone_Stockpile) || zone is Zone_Growing || Find.HomeRegionGrid.Get(current.Position))
{
this.wealthItems += (float)current.stackCount * current.def.basePrice;
}
}
foreach (Pawn current2 in Find.ListerPawns.FreeColonists)
{
foreach (Thing current3 in current2.equipment.AllEquipment)
{
this.wealthItems += (float)current3.stackCount * current3.def.basePrice;
}
foreach (Thing current4 in current2.apparel.WornApparel)
{
this.wealthItems += (float)current4.stackCount * current4.def.basePrice;
}
}
foreach (Thing current5 in Find.ListerThings.ThingsInGroup(ThingRequestGroup.BuildingArtificial))
{
if (current5.Faction == Faction.OfColony)
{
for (int i = 0; i < current5.def.costList.Count; i++)
{
this.wealthBuildings += (float)current5.def.costList[i].count * current5.def.costList[i].thingDef.basePrice * 0.6f;
}
}
}
}
}


StorymasterQ

This could be a cool idea for some sort of cloaking mod. So some sort of cloaking engine (perhaps a further research from that Shields Mod) that has a range, and all items inside that range is not counted (or halved or something) in the colony wealth calculation.

One could rationalize this as "hiding your wealth from the raiders so they have no intention to attack"
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here

mrofa

Well ther should be also some limit to that since like some other guy said he was 400 days ands was swarmed by 500 + raiders.

float totalwealth = this.wealthItems + this.wealthBuildings;
If( totalwealth >= 50000f)
this.wealthItems =25000f;
this.wealthBuildings =25000f;
return this.wealthItems + this.wealthBuildings;





All i do is clutter all around.