mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Town, mines and garrison now use GENERATE_RESOURCE bonus for income
This commit is contained in:
@@ -206,7 +206,11 @@ int CGTownInstance::getDwellingBonus(const std::vector<CreatureID>& creatureIds,
|
|||||||
|
|
||||||
TResources CGTownInstance::dailyIncome() const
|
TResources CGTownInstance::dailyIncome() const
|
||||||
{
|
{
|
||||||
TResources ret;
|
ResourceSet ret;
|
||||||
|
|
||||||
|
for (GameResID k : GameResID::ALL_RESOURCES())
|
||||||
|
ret[k] += valOfBonuses(BonusType::GENERATE_RESOURCE, BonusSubtypeID(k));
|
||||||
|
|
||||||
for(const auto & p : getTown()->buildings)
|
for(const auto & p : getTown()->buildings)
|
||||||
{
|
{
|
||||||
BuildingID buildingUpgrade;
|
BuildingID buildingUpgrade;
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ std::vector<CreatureID> CGMine::providedCreatures() const
|
|||||||
ResourceSet CGMine::dailyIncome() const
|
ResourceSet CGMine::dailyIncome() const
|
||||||
{
|
{
|
||||||
ResourceSet result;
|
ResourceSet result;
|
||||||
|
|
||||||
|
for (GameResID k : GameResID::ALL_RESOURCES())
|
||||||
|
result[k] += valOfBonuses(BonusType::GENERATE_RESOURCE, BonusSubtypeID(k));
|
||||||
|
|
||||||
result[producedResource] += defaultResProduction();
|
result[producedResource] += defaultResProduction();
|
||||||
|
|
||||||
const auto & playerSettings = cb->getPlayerSettings(getOwner());
|
const auto & playerSettings = cb->getPlayerSettings(getOwner());
|
||||||
@@ -867,7 +871,11 @@ const IOwnableObject * CGGarrison::asOwnable() const
|
|||||||
|
|
||||||
ResourceSet CGGarrison::dailyIncome() const
|
ResourceSet CGGarrison::dailyIncome() const
|
||||||
{
|
{
|
||||||
return {};
|
ResourceSet result;
|
||||||
|
for (GameResID k : GameResID::ALL_RESOURCES())
|
||||||
|
result[k] += valOfBonuses(BonusType::GENERATE_RESOURCE, BonusSubtypeID(k));
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<CreatureID> CGGarrison::providedCreatures() const
|
std::vector<CreatureID> CGGarrison::providedCreatures() const
|
||||||
|
|||||||
Reference in New Issue
Block a user