Instead of AND or OR prereqs, how about NOT?

zulu9812

The Newbie Nightmare
Joined
Jan 29, 2002
Messages
6,388
Location
Athens of the North
What I'd like to do is use the Promotions system to specialise units, so that having certain promotions will bar a unit from being able to promote to another ability. For example, units with Guerilla II shouldn't be able to get Woodsman II (although they could get Woodsman I). I'm guessing that this involves some SDK work. Can anyone advise?
 
zulu9812 said:
What I'd like to do is use the Promotions system to specialise units, so that having certain promotions will bar a unit from being able to promote to another ability. For example, units with Guerilla II shouldn't be able to get Woodsman II (although they could get Woodsman I). I'm guessing that this involves some SDK work. Can anyone advise?

Yeah, its all SDK work. Ideally I would love to see the addtion of a CanPromote and CannotPromote python function. But regardless of the method you will probably want to start in the following SDK function in CvUnit.cpp:

Code:
bool CvUnit::canPromote(PromotionTypes ePromotion) const
{
	if (ePromotion == NO_PROMOTION)
	{
		return false;
	}

	if (!canAcquirePromotion(ePromotion))
	{
		return false;
	}

	if (!isPromotionReady())
	{
		return false;
	}

	return true;
}
 
Back
Top Bottom