|
|
|
|
|
UndefineClass('Conscience_Guilty') |
|
DefineClass.Conscience_Guilty = { |
|
__parents = { "StatusEffect" }, |
|
__generated_by_class = "CharacterEffectCompositeDef", |
|
|
|
|
|
object_class = "StatusEffect", |
|
unit_reactions = { |
|
PlaceObj('UnitReaction', { |
|
Event = "OnNewDay", |
|
Handler = function (self, target) |
|
Conscience_CheckExpiration(self, target, "guilty_start_time") |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnCalcPersonalMorale", |
|
Handler = function (self, target, value) |
|
return value - 1 |
|
end, |
|
}), |
|
}, |
|
DisplayName = T(374563958345, "Guilty"), |
|
Description = T(117856843594, "Morale decreased by 1 for a day."), |
|
AddEffectText = T(446826511839, "<em><DisplayName></em> is feeling guilty and lost Morale"), |
|
OnAdded = function (self, obj) |
|
self:SetParameter("guilty_start_time", Game.CampaignTime) |
|
end, |
|
OnRemoved = function (self, obj) |
|
|
|
local stats = UnitPropertiesStats:GetProperties() |
|
for i, stat in ipairs(stats) do |
|
obj:RemoveModifier("guilty_" .. stat.id, stat.id) |
|
end |
|
end, |
|
type = "Debuff", |
|
Icon = "UI/Hud/Status effects/encumbered", |
|
HasFloatingText = true, |
|
} |
|
|
|
|