To add a flag do
player.flags[BF_ENVIROSAFE] = true
If you are doing this in OnEquip, OnRemove, it is possible for there to be strange interactions. For example, the player can equip your item, then equip the phaseshift set which also grants to the flag. Then if the player unequips the phaseshift set, that will remove the flag even though your item is still equipped. The only reason the phaseshift wet works is that there is no other way of changing this flag. The classic way of solving this problem is to do something like
OnEquip(self, player)
if not player:has_property("envirosafe") then
player:add_property("envirosafe", 0)
end
player.envirosafe = player.envirosafe + 1
player.flags[BF_ENVIROSAFE] = true
end,
...
OnRemove(self, player)
if not player:has_property("envirosafe") then
player:add_property("envirosafe", 0)
end
player.envirosafe = player.envirosafe - 1
if player.envirosafe <= 0 then
player.flags[BF_ENVIROSAFE] = false
end
end,
However, this requires all things modifying this flag to use this protocol. Or you can just ignore it since it's usually an edge case.
damage_add is a valid item property that just effects that particular item. The corresponding prototype property isn't accepted by the blueprint because it is intended to be parsed from the damage string, as you discovered.
Weapon resistances are used in DoomRL by the Acid Spitter, so they are officially supported (if not widely used).