That's it, as very few people are aware, I'm creating a mod that stays pretty big with a certain number of components. It will be 3 years that I try to finish it (at least try to get it out
But in short, this is not the subject of the day (or not yet...
To put it simply, when the party receives the negative condition "cold", they must be equipped with light or heavy armor to remove the condition. I thought that the function will be rather simple and oddly, when I do it rightly, nothing happens and the condition has still not been removed from the party.
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onReceiveCondition = function(self, champion, condition)
local helmet = champion:getItem(ItemSlot.Head)
local cuirass = champion:getItem(ItemSlot.Chest)
local cuisse = champion:getItem(ItemSlot.Legs)
local greaves = champion:getItem(ItemSlot.Feet)
if condition == "cold" then
if (helmet and helmet:hasTrait("light_armor")) and
(cuirass and cuirass:hasTrait("light_armor")) and
(cuisse and cuisse:hasTrait("light_armor")) and
(greaves and greaves:hasTrait("light_armor")) then
champion:removeCondition("cold")
end
end
end,
},
},
editorIcon = 32,
placement = "floor",
}
Someone has an explanation or answer due to this problem?