Page 1 of 1

How to implement defense bonus agains barbarian units?

Posted: Sat Oct 22, 2022 6:42 pm
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.

Re: How to implement defense bonus agains barbarian units?

Posted: Sat Oct 22, 2022 6:58 pm
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.

Re: How to implement defense bonus agains barbarian units?

Posted: Sat Oct 22, 2022 7:13 pm
by 3plus4i
Oh, I see. There is no hint about that on the wiki, for "NationGroup", unlike for "UnitType" and the like.