"UnitClass" requirement working with "Veteran-Build" effect?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
User avatar
Corbeau
Elite
Posts: 834
Joined: Mon Jan 13, 2014 11:13 pm

"UnitClass" requirement working with "Veteran-Build" effect?

Postby Corbeau » Mon Sep 10, 2018 7:21 am

Editing Effects page says that "UnitClass" requirement works only with "Veteran_Combat" and "Defend_Bonus". So, officially, it shouldn't work with "Veteran_Build". But it seems it does because LT43 ruleset is using this combination and it definitely worked: Catapults, cannons and stuff were built non-veteran even if there was barracks present. Can someone clarify this?

User avatar
Caedo
Elite
Posts: 463
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: "UnitClass" requirement working with "Veteran-Build" effect?

Postby Caedo » Mon Sep 10, 2018 8:45 am

Veteran_Build has always worked with UnitClass requirements; otherwise the whole idea of having separate barracks, port facility and airport would've never worked. To be honest, I wouldn't look at the wiki for things like that (that page is outdated anyways), but instead look at README.effects, and if it doesn't say anything there, try to figure out what should work, test it, and if it doesn't work, submit a bug report, because most of the time, things should work the way you'd expect them to.
Also, there's no reason whatsoever why unit type, flag, class, and class flag requirements should not work with Veteran_Build.
~S.C. L.

User avatar
Corbeau
Elite
Posts: 834
Joined: Mon Jan 13, 2014 11:13 pm

Re: "UnitClass" requirement working with "Veteran-Build" effect?

Postby Corbeau » Mon Sep 10, 2018 9:16 am

Understood, thanks.

(Anyway, the only confusing point was that page explicitly saying that this works ONLY for stuff and stuff. If something is outdated, I expect it to lack information, not have wrong information.)

Akechi
Posts: 25
Joined: Thu Dec 07, 2017 12:17 pm

Re: "UnitClass" requirement working with "Veteran-Build" effect?

Postby Akechi » Mon Sep 10, 2018 12:46 pm

These effects use get_unittype_bonus:
Defend_Bonus, (3.0+)Attack_Bonus, Veteran_Build, Move_Bonus, Unit_Recover, (3.0+)Unit_Buy_Cost_Pct, Hp_Regen, Unit_Vision_Radius_Sq

These effects use get_unit_bonus:
(3.0+)Stealings_Ignore, Thiefs_Share_Pm, Veteran_Combat, (3.0+)Combat_Rounds, Unit_Recover, Hp_Regen, (3.0+)Conquest_Tech_Pct, Retire_Pct

(up to 2.6) These effects use get_tile_bonus (don't confuse with get_tile_output_bonus):
Irrig_Possible, Irrig_Tf_Possible, Mining_Possible, Mining_Tf_Possible, Transform_Possible

I think these effects can use UnitClass requirement.