you see that AI gets the information if building is attackable from the "core". If the response was "false" it would do the trick, though I am not sure how would AI cope with changed status of such building (when you decide to change it with LUA)...
But the bottom line is where your new information (who is attackable for whom) should be stored...
Well if you look at:
https:/ /bazaar. launchpad. net/~widelands- dev/widelands/ trunk/view/ head:/src/ ai/defaultai_ warfare. cc#L167
you see that AI gets the information if building is attackable from the "core". If the response was "false" it would do the trick, though I am not sure how would AI cope with changed status of such building (when you decide to change it with LUA)...
But the bottom line is where your new information (who is attackable for whom) should be stored...