File size: 1,913 Bytes
b6a38d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- ========== GENERATED BY CharacterEffectCompositeDef Editor DO NOT EDIT MANUALLY! ==========

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, --[[CharacterEffectCompositeDef BuildingConfidence DisplayName]] "Find My Feet"),
	'Description', T(969057307540, --[[CharacterEffectCompositeDef BuildingConfidence Description]] "Can become <GameTerm('Inspired')> and increase the team's <GameTerm('Morale')> during combat."),
	'Icon', "UI/Icons/Perks/BuildingConfidence",
	'Tier', "Personal",
})