|
|
|
|
|
PlaceObj('CharacterEffectCompositeDef', { |
|
'Group', "Perk-Personal", |
|
'Id', "BuildingConfidence", |
|
'Parameters', { |
|
PlaceObj('PresetParamNumber', { |
|
'Name', "turnToProc", |
|
'Value', 2, |
|
'Tag', "<turnToProc>", |
|
}), |
|
PlaceObj('PresetParamPercent', { |
|
'Name', "chanceToProc", |
|
'Value', 50, |
|
'Tag', "<chanceToProc>%", |
|
}), |
|
}, |
|
'Comment', "MD - Inspired and + Morale after multiple turns", |
|
'object_class', "Perk", |
|
'unit_reactions', { |
|
PlaceObj('UnitReaction', { |
|
Event = "OnUnitAttack", |
|
Handler = function (self, target, attacker, action, attack_target, results, attack_args) |
|
if target == attacker then |
|
self:SetParameter("attacked", true) |
|
end |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnCombatEnd", |
|
Handler = function (self, target) |
|
self:SetParameter("attacked", false) |
|
self:SetParameter("applied", false) |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnBeginTurn", |
|
Handler = function (self, target) |
|
if g_Combat.current_turn < self:ResolveValue("turnToProc") then return end |
|
if self:ResolveValue("attacked") and not self:ResolveValue("applied") then |
|
local chance = self:ResolveValue("chanceToProc") |
|
local roll = InteractionRand(100, "BuildingConfidence") |
|
if roll < chance then |
|
target:AddStatusEffect("Inspired") |
|
target.team:ChangeMorale(1, self.DisplayName) |
|
self:SetParameter("applied", true) |
|
end |
|
end |
|
end, |
|
}), |
|
}, |
|
'DisplayName', T(110292118081, "Find My Feet"), |
|
'Description', T(969057307540, "Can become <GameTerm('Inspired')> and increase the team's <GameTerm('Morale')> during combat."), |
|
'Icon', "UI/Icons/Perks/BuildingConfidence", |
|
'Tier', "Personal", |
|
}) |
|
|
|
|