File size: 2,051 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
-- ========== GENERATED BY CharacterEffectCompositeDef Editor DO NOT EDIT MANUALLY! ==========

UndefineClass('BloodlustPerk')
DefineClass.BloodlustPerk = {
	__parents = { "Perk" },
	__generated_by_class = "CharacterEffectCompositeDef",


	object_class = "Perk",
	unit_reactions = {
		PlaceObj('UnitReaction', {
			Event = "OnBeginTurn",
			Handler = function (self, target)
				self:SetParameter("target", false)
			end,
		}),
		PlaceObj('UnitReaction', {
			Event = "OnUnitAttack",
			Handler = function (self, target, attacker, action, attack_target, results, attack_args)
				if target == attacker then
					if action.ActionType ~= "Melee Attack" or not IsKindOf(attack_target, "Unit") then
						self:SetParameter("target", false)
					else
						self:SetParameter("target", attack_target.handle)
					end
				end
			end,
		}),
		PlaceObj('UnitReaction', {
			Event = "OnCalcDamageAndEffects",
			Handler = function (self, target, attacker, attack_target, action, weapon, attack_args, hit, data)
				if target == attacker and action then
					local last_target = self:ResolveValue("target")
					if action.ActionType == "Melee Attack" and last_target and IsKindOf(attack_target, "Unit") and attack_target.handle ~= last_target then
						local bonus = MulDivRound(attacker.Strength, self:ResolveValue("Str_to_bonus_dmg_conversion"), 100)
						data.base_damage = MulDivRound(data.base_damage, 100 + bonus, 100)
						data.breakdown[#data.breakdown + 1] = { name = self.DisplayName, value = bonus }
					end
				end
			end,
		}),
	},
	DisplayName = T(700118302261, --[[CharacterEffectCompositeDef BloodlustPerk DisplayName]] "Killing Spree"),
	Description = T(419165368911, --[[CharacterEffectCompositeDef BloodlustPerk Description]] "Subsequent <em>Melee Attacks</em> against <em>different targets</em> during the same turn deal <em><percent(StatPercent('Strength', Str_to_bonus_dmg_conversion))></em> extra <em>Damage</em> (based on Strength)."),
	Icon = "UI/Icons/Perks/BloodlustPerk",
	Tier = "Bronze",
	Stat = "Strength",
	StatValue = 70,
}