Partisan question

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Partisan question

Post by MikeDuk »

Hi.

I would like to know more about partisan appearance. Does the number of partisans depend on the conquered city size? What other variables are involved (appart from the requirements of Guerrilla Warfare and Democracy/Communism)?

What is the GitHub source file that codes this effect?

Thanks!
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Partisan question

Post by Ignatus »

https://github.com/freeciv/freeciv/blob ... efault.lua:

Code: Select all

local partisans = random(0, 1 + (city.size + 1) / 2) + 1
  if partisans > 8 then
    partisans = 8
  end
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Re: Partisan question

Post by MikeDuk »

Thank you, Ignatus.

Two more questions regarding this.
- Is the division by 2 a "floor division", meaning it yields the "nearest lower integer"? That is, "7 / 2" would be "3".
- Is "city.size" computed before or after the city is conquered? Because conquering a city reduces the population by one.

Thanks.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Partisan question

Post by Ignatus »

MikeDuk wrote: - Is the division by 2 a "floor division", meaning it yields the "nearest lower integer"? That is, "7 / 2" would be "3".
- Is "city.size" computed before or after the city is conquered? Because conquering a city reduces the population by one.
- Lua always uses real numbers, rounds down only at pass to random(,) function
- The city size is reduced at the callback.
Post Reply