View Full Version : SDK help.


ClassicThunder
Oct 28, 2006, 08:52 PM
I'm tring to get is to when you bombard an enemy city you hurt the defenders. I've found the CvUnit::bombard() function where the city is bombarded and the changeDefenseDamage() function that lowers the city's defence. In CvUnit::bombard() I was wondering how get all the units in the city and reduce thier health.

Thanks for any help,
ClassicThunder

Déja
Oct 29, 2006, 02:19 AM
Take a look in the CvCity class. Obviously, the bombard function already knows which city, since it reduces its defenses, and I'm pretty sure there's some method to either find the units in a city or, at the very least, find all the units by plot (which can be gotten from the city, as well)

Dale
Oct 29, 2006, 07:01 PM
This has been done. Check out my combat mod.