Commit ad28ec847aa3dfa80da9ad7c110e9f473bf043c0
1 parent
f0948cde
elemental harmony
git-svn-id: http://svn.net-core.org/repos/t-engine4@3377 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
4 changed files
with
81 additions
and
18 deletions
... | ... | @@ -52,6 +52,7 @@ newBirthDescriptor{ |
52 | 52 | stats = { wil=5, cun=3, dex=1, }, |
53 | 53 | talents_types = { |
54 | 54 | ["wild-gift/call"]={true, 0.2}, |
55 | + ["wild-gift/harmony"]={true, 0.1}, | |
55 | 56 | ["wild-gift/summon-melee"]={true, 0.3}, |
56 | 57 | ["wild-gift/summon-distance"]={true, 0.3}, |
57 | 58 | ["wild-gift/summon-utility"]={true, 0.3}, | ... | ... |
... | ... | @@ -156,6 +156,12 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) |
156 | 156 | t.doMadness(target, t, src) |
157 | 157 | end |
158 | 158 | |
159 | + if not target.dead and dam > 0 and target:attr("elemental_harmony") and not target:hasEffect(target.EFF_ELEMENTAL_HARMONY) then | |
160 | + if type == DamageType.FIRE or type == DamageType.COLD or type == DamageType.LIGHTNING or type == DamageType.ACID or type == DamageType.NATURE then | |
161 | + target:setEffect(target.EFF_ELEMENTAL_HARMONY, 5 + math.ceil(target:attr("elemental_harmony")), {power=target:attr("elemental_harmony"), type=type}) | |
162 | + end | |
163 | + end | |
164 | + | |
159 | 165 | return dam |
160 | 166 | end |
161 | 167 | return 0 | ... | ... |
... | ... | @@ -62,28 +62,34 @@ newTalent{ |
62 | 62 | name = "Elemental Harmony", |
63 | 63 | type = {"wild-gift/harmony", 2}, |
64 | 64 | require = gifts_req2, |
65 | - random_ego = "defensive", | |
66 | 65 | points = 5, |
67 | - equilibrium = 10, | |
68 | - cooldown = 20, | |
69 | - range = 1, | |
70 | - requires_target = true, | |
71 | - no_npc_use = true, | |
72 | - action = function(self, t) | |
73 | - local tg = {default_target=self, type="hit", nowarning=true, range=self:getTalentRange(t), first_target="friend"} | |
74 | - local x, y, target = self:getTarget(tg) | |
75 | - if not x or not y or not target then return nil end | |
76 | - if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end | |
77 | - if not target.undead then | |
78 | - target:heal(20 + self:getWil(50) * self:getTalentLevel(t)) | |
79 | - end | |
80 | - game:playSoundNear(self, "talents/heal") | |
66 | + mode = "sustained", | |
67 | + equilibrium = 20, | |
68 | + cooldown = 30, | |
69 | + activate = function(self, t) | |
70 | + return { | |
71 | + tmpid = self:addTemporaryValue("elemental_harmony", self:getTalentLevel(t)), | |
72 | + } | |
73 | + end, | |
74 | + deactivate = function(self, t, p) | |
75 | + self:removeTemporaryValue("elemental_harmony", p.tmpid) | |
81 | 76 | return true |
82 | 77 | end, |
83 | 78 | info = function(self, t) |
84 | - return ([[Touch a target (or yourself) to infuse it with Nature, healing it for %d(heal does not work on undead). | |
85 | - Heal will increase with your Willpower stat.]]): | |
86 | - format(20 + self:getWil(50) * self:getTalentLevel(t)) | |
79 | + local power = self:getTalentLevel(t) | |
80 | + local turns = 5 + math.ceil(power) | |
81 | + local fire = 100 * (0.1 + power / 11) | |
82 | + local cold = 3 + power * 2 | |
83 | + local lightning = math.floor(power) | |
84 | + local acid = 5 + power * 2 | |
85 | + local nature = 5 + power * 1.4 | |
86 | + return ([[Befriend the natural elements that constitute nature. Each time you are hit by one of the elements you gain a special effect for %d turns. This can only happen every %d turns. | |
87 | + Fire: +%d%% global speed | |
88 | + Cold: +%d armour | |
89 | + Lightning: +%d to all stats | |
90 | + Acid: +%0.2f life regen | |
91 | + Nature: +%d%% to all resists]]): | |
92 | + format(turns, turns, fire, cold, lightning, acid, nature) | |
87 | 93 | end, |
88 | 94 | } |
89 | 95 | ... | ... |
... | ... | @@ -3948,3 +3948,53 @@ newEffect{ |
3948 | 3948 | self:removeTemporaryValue("purify_disease", eff.diseid) |
3949 | 3949 | end, |
3950 | 3950 | } |
3951 | + | |
3952 | +newEffect{ | |
3953 | + name = "ELEMENTAL_HARMONY", | |
3954 | + desc = "Elemental Harmony", | |
3955 | + long_desc = function(self, eff) | |
3956 | + if eff.type == DamageType.FIRE then return ("Increases global speed by %d%%."):format(100 * (0.1 + eff.power / 11)) | |
3957 | + elseif eff.type == DamageType.COLD then return ("Increases armour by %d."):format(3 + eff.power *2) | |
3958 | + elseif eff.type == DamageType.LIGHTNING then return ("Increases all stats by %d."):format(math.floor(eff.power)) | |
3959 | + elseif eff.type == DamageType.ACID then return ("Increases life regen by %0.2f%%."):format(5 + eff.power * 2) | |
3960 | + elseif eff.type == DamageType.NATURE then return ("Increases all resists by %d%%."):format(5 + eff.power * 1.4) | |
3961 | + end | |
3962 | + end, | |
3963 | + type = "physical", | |
3964 | + status = "beneficial", | |
3965 | + parameters = { }, | |
3966 | + activate = function(self, eff) | |
3967 | + if eff.type == DamageType.FIRE then | |
3968 | + eff.tmpid = self:addTemporaryValue("global_speed", 0.1 + eff.power / 11) | |
3969 | + elseif eff.type == DamageType.COLD then | |
3970 | + eff.tmpid = self:addTemporaryValue("combat_armor", 3 + eff.power * 2) | |
3971 | + elseif eff.type == DamageType.LIGHTNING then | |
3972 | + eff.tmpid = self:addTemporaryValue("inc_stats", | |
3973 | + { | |
3974 | + [Stats.STAT_STR] = math.floor(eff.power), | |
3975 | + [Stats.STAT_DEX] = math.floor(eff.power), | |
3976 | + [Stats.STAT_MAG] = math.floor(eff.power), | |
3977 | + [Stats.STAT_WIL] = math.floor(eff.power), | |
3978 | + [Stats.STAT_CUN] = math.floor(eff.power), | |
3979 | + [Stats.STAT_CON] = math.floor(eff.power), | |
3980 | + }) | |
3981 | + elseif eff.type == DamageType.ACID then | |
3982 | + eff.tmpid = self:addTemporaryValue("life_regen", 5 + eff.power * 2) | |
3983 | + elseif eff.type == DamageType.NATURE then | |
3984 | + eff.tmpid = self:addTemporaryValue("resists", {all=5 + eff.power * 1.4}) | |
3985 | + end | |
3986 | + end, | |
3987 | + deactivate = function(self, eff) | |
3988 | + if eff.type == DamageType.FIRE then | |
3989 | + self:removeTemporaryValue("global_speed", eff.tmpid) | |
3990 | + elseif eff.type == DamageType.COLD then | |
3991 | + self:removeTemporaryValue("combat_armor", eff.tmpid) | |
3992 | + elseif eff.type == DamageType.LIGHTNING then | |
3993 | + self:removeTemporaryValue("inc_stats", eff.tmpid) | |
3994 | + elseif eff.type == DamageType.ACID then | |
3995 | + self:removeTemporaryValue("life_regen", eff.tmpid) | |
3996 | + elseif eff.type == DamageType.NATURE then | |
3997 | + self:removeTemporaryValue("resists", eff.tmpid) | |
3998 | + end | |
3999 | + end, | |
4000 | +} | ... | ... |
-
Please register or login to post a comment