@拓海
The chance to be hit when on high ground would be added to a unit definition. Buildings would have 100 percent chance by default, ground units 50 percent, but for example big or slow units would be easier to hit.
The catapults are not affected, not because of special range, but because of splash damage. Maybe I should affect splash damage too, and check the chances to hit for every ground unit in the area of effect of the splash damage.
replacing special_range 1 with range 12, minimal_range 4 and is_ballistic 1
Units with sight_range 1 are not affected, but in this case it makes sense because they are usually towers, I think.
replacing sight_range 1 with sight_range 12 and bonus_height 1
About offensive and defensive mode, I'm trying to simplify the interface. Defensive mode can be used to send units to potentially dangerous places, so they flee automatically. I'll think about it.