How to implement defense bonus agains barbarian units?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
3plus4i
Veteran
Posts: 58
Joined: Wed Aug 17, 2022 1:26 pm

How to implement defense bonus agains barbarian units?

Post by 3plus4i »

I wanted to extend the effect of the Grat Wall to also give an extra defense bonus against barbarian units. According to a comment in the effects.ruleset, that was also a part of Civ 2 rules. I'm struggling to implement it though. How do I check the nationgroup of an attacking unit? NationGroup checks the defender, not the attacker and I didn't find any unit related type that might include the nation.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: How to implement defense bonus agains barbarian units?

Post by Ignatus »

3plus4i wrote: Sat Oct 22, 2022 6:42 pm NationGroup checks the defender, not the attacker and I didn't find any unit related type that might include the nation.
Nay, "Defend_Bonus" effect player requirements are all about attacker. So, "NationGroup", "Barbarian", "Player" would work. Just in Civ2 the bonus depended on the difficulcy setting and Freeciv's difficulcy only changes AI behaviour.
3plus4i
Veteran
Posts: 58
Joined: Wed Aug 17, 2022 1:26 pm

Re: How to implement defense bonus agains barbarian units?

Post by 3plus4i »

Oh, I see. There is no hint about that on the wiki, for "NationGroup", unlike for "UnitType" and the like.
Post Reply