SDK help.

Joined
Sep 15, 2006
Messages
511
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
 
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)
 
This has been done. Check out my combat mod.
 
Back
Top Bottom