 |
|  |
 |
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:24
|
|
That should kill of 10% of the population, though you'd need to put it into an event handler, depending on when you wanted them to die. If it's every turn, you need a handler that fires every turn. For simplicity's sake, if you wanted to do every city, the line:
code:
HandleEvent(BeginCityTurn) 'kill10pcpt' pre{
// kill stuff code as above
}
at the beginning would kill of 10% from every city in the game.
If you want a specific city (Don't know how you want to choose which one) you'll need either its name or its index. eg. for the capital, use this:
code:
HandleEvent(BeginCityTurn) 'kill10pcpt' pre{
if(IsHumanPlayer(player[0])) // the human
city_t tmpCity;
GetCityByIndex(player[0], 0, tmpCity); // store your capital
if(tmpCity == city[0]){
// insert kill stuff code here
}
}
}
If you want to kill 7 citizens, simply use your code, but replace
code:
tmpDead = city[0].population/10;
with
code:
tmpDead = 7;
To get 7%, use:
code:
tmpDead = city[0].population*7;
tmpDead = tmpDead/100;
Done separately to avoid rounding errors when SLIC tries to do fractions (it can't).
hope this helps, and is comprehensible
|
|
|  |
 |
|  |
 |
|  |
 |
|  |
All times are GMT. The time now is 05:24. Apolyton Time is 00:24. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|