mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Moved most of daily income handling to a separate method
This commit is contained in:
@@ -478,20 +478,6 @@ void CGTownInstance::newTurn(vstd::RNG & rand) const
|
||||
{
|
||||
if (cb->getDate(Date::DAY_OF_WEEK) == 1) //reset on new week
|
||||
{
|
||||
//give resources if there's a Mystic Pond
|
||||
if (hasBuilt(BuildingSubID::MYSTIC_POND)
|
||||
&& cb->getDate(Date::DAY) != 1
|
||||
&& (tempOwner.isValidPlayer())
|
||||
)
|
||||
{
|
||||
int resID = rand.nextInt(2, 5); //bonus to random rare resource
|
||||
resID = (resID==2)?1:resID;
|
||||
int resVal = rand.nextInt(1, 4);//with size 1..4
|
||||
cb->giveResource(tempOwner, static_cast<EGameResID>(resID), resVal);
|
||||
cb->setObjPropertyValue(id, ObjProperty::BONUS_VALUE_FIRST, resID);
|
||||
cb->setObjPropertyValue(id, ObjProperty::BONUS_VALUE_SECOND, resVal);
|
||||
}
|
||||
|
||||
if (tempOwner == PlayerColor::NEUTRAL) //garrison growth for neutral towns
|
||||
{
|
||||
std::vector<SlotID> nativeCrits; //slots
|
||||
|
Reference in New Issue
Block a user