Commit 589b4a8cd054bc8b0c16405d3a5c37f039800249
Merge branch 'master' of git.net-core.org:tome/t-engine4
Showing
8 changed files
with
36 additions
and
31 deletions
... | ... | @@ -6073,6 +6073,7 @@ local sustainCallbackCheck = { |
6073 | 6073 | callbackOnPartyRemove = "talents_on_party_remove", |
6074 | 6074 | callbackOnTargeted = "talents_on_targeted", |
6075 | 6075 | callbackOnCloned = "talents_on_cloned", |
6076 | + callbackOnAITalentTactics = "talents_on_ai_talent_tactics", | |
6076 | 6077 | } |
6077 | 6078 | _M.sustainCallbackCheck = sustainCallbackCheck |
6078 | 6079 | ... | ... |
... | ... | @@ -1386,6 +1386,10 @@ function _M:aiTalentTactics(t, aitarget, target_list, tactic, tg, wt_mod) |
1386 | 1386 | end --(DEBUGGING transitional) |
1387 | 1387 | if type(tactical) == "function" then tactical = tactical(self, t, aitarget) end |
1388 | 1388 | end |
1389 | + local hd = {"ActorAI:aiTalentTactics", tactical=table.clone(tactical, true), t=t, ai_target=ai_target} | |
1390 | + self:triggerHook(hd) | |
1391 | + self:fireTalentCheck("callbackOnAITalentTactics", hd) | |
1392 | + tactical = hd.tactical | |
1389 | 1393 | if log_detail >= 2 then print("[aiTalentTactics]__ using talent tactical table for", t.id) table.print(tactical, "\t___") end |
1390 | 1394 | if not tactical then return false end |
1391 | 1395 | ... | ... |
... | ... | @@ -40,10 +40,11 @@ newTalent{ |
40 | 40 | local hit = self:attackTarget(target, nil, t.getDamage(self, t), true) |
41 | 41 | |
42 | 42 | if hit then |
43 | + target:setEffect(target.EFF_BRUTALIZED, t.getDuration(self, t), {apply_power=self:combatPhysicalpower()}) | |
43 | 44 | if target:canBe("stun") then |
44 | - target:setEffect(target.EFF_BRUTALIZED, t.getDuration(self, t), {apply_power=self:combatPhysicalpower()}) | |
45 | + target:setEffect(target.EFF_STUNNED, t.getDuration(self, t), {apply_power=self:combatPhysicalpower()}) | |
45 | 46 | else |
46 | - game.logSeen(target, "%s resists the brutality!", target.name:capitalize()) | |
47 | + game.logSeen(target, "%s resists the stun!", target.name:capitalize()) | |
47 | 48 | end |
48 | 49 | end |
49 | 50 | ... | ... |
... | ... | @@ -316,7 +316,7 @@ local function createShadow(self, level, tCallShadows, tShadowWarriors, tShadowM |
316 | 316 | value = value * self.avoid_master_damage |
317 | 317 | end |
318 | 318 | |
319 | - if self:knowTalent(self.T_SHADOW_FADE) and not self:isTalentCoolingDown(self.T_SHADOW_FADE) and not (self.avoid_master_damage == 0) then | |
319 | + if self:knowTalent(self.T_SHADOW_FADE) and not self:isTalentCoolingDown(self.T_SHADOW_FADE) and (value > 0) then | |
320 | 320 | self:forceUseTalent(self.T_SHADOW_FADE, {ignore_energy=true}) |
321 | 321 | end |
322 | 322 | ... | ... |
... | ... | @@ -28,7 +28,7 @@ newTalent{ |
28 | 28 | range = 1, |
29 | 29 | stamina = 20, |
30 | 30 | require = spells_req1, |
31 | - tactical = { ATTACK = 0.2 }, | |
31 | + tactical = { ATTACK = {weapon = 2} }, | |
32 | 32 | is_melee = true, |
33 | 33 | on_pre_use = function(self, t, silent) if not self:hasMHWeapon() then if not silent then game.logPlayer(self, "You require a weapon to use this talent.") end return false end return true end, |
34 | 34 | requires_target = true, | ... | ... |
... | ... | @@ -29,6 +29,23 @@ newTalent{ |
29 | 29 | cooldown = 5, |
30 | 30 | tactical = { BUFF = 2 }, |
31 | 31 | getChance = function(self, t) return self:combatLimit(self:getTalentLevel(t) * (1 + self:getCun(9, true)), 100, 20, 0, 70, 50) end, -- Limit < 100% |
32 | + callbackOnAITalentTactics = function(self, t, hd) | |
33 | + local p = self:isTalentActive(t.id) | |
34 | + if not p then return end | |
35 | + if hd.t.allow_for_arcane_combat then | |
36 | + hd.tactical = {} | |
37 | + end | |
38 | + if hd.tactical then | |
39 | + local tactical = hd.tactical | |
40 | + if tactical.attack and type(tactical.attack) == "table" and tactical.attack.weapon then | |
41 | + tactical.attack.weapon = tactical.attack.weapon + 1 | |
42 | + end | |
43 | + if tactical.attackarea and type(tactical.attackarea) == "table" and tactical.attackarea.weapon then | |
44 | + tactical.attackarea.weapon = tactical.attackarea.weapon + 1 | |
45 | + end | |
46 | + end | |
47 | + return true | |
48 | + end, | |
32 | 49 | canUseTalent = function(self, t, proc) -- Returns true if the actor can currently trigger the "proc" talent with Arcane Combat |
33 | 50 | local talent = self:getTalentFromId(proc) |
34 | 51 | if not talent or not talent.allow_for_arcane_combat then return false end | ... | ... |
... | ... | @@ -292,7 +292,7 @@ local function createLichShadow(self, level, tCallShadows, tShadowWarriors, tSha |
292 | 292 | value = value * self.avoid_master_damage |
293 | 293 | end |
294 | 294 | |
295 | - if self:knowTalent(self.T_SHADOW_FADE) and not self:isTalentCoolingDown(self.T_SHADOW_FADE) and not (self.avoid_master_damage == 0) then | |
295 | + if self:knowTalent(self.T_SHADOW_FADE) and not self:isTalentCoolingDown(self.T_SHADOW_FADE) and (value > 0) then | |
296 | 296 | self:forceUseTalent(self.T_SHADOW_FADE, {ignore_energy=true}) |
297 | 297 | end |
298 | 298 | ... | ... |
... | ... | @@ -4338,35 +4338,17 @@ newEffect{ |
4338 | 4338 | newEffect{ |
4339 | 4339 | name = "Brutalized", image = "effects/stunned.png", |
4340 | 4340 | desc = _t"Brutalized", |
4341 | - long_desc = function(self, eff) return ("The target is brutally stunned, reducing damage by 50%%, movement speed by 50%%, bleed resist by 50%%, and halving talent cooldown."):tformat() end, | |
4341 | + long_desc = function(self, eff) return ("The target is brutalized, reducing bleed resist by 50%%."):tformat() end, | |
4342 | 4342 | type = "physical", |
4343 | - subtype = { stun=true }, | |
4343 | + subtype = { }, | |
4344 | 4344 | status = "detrimental", |
4345 | 4345 | parameters = { }, |
4346 | - on_gain = function(self, err) return _t"#Target# is stunned by the brutal strike!", _t"+Brutalized" end, | |
4347 | - on_lose = function(self, err) return _t"#Target# is not stunned anymore.", _t"-Brutalized" end, | |
4346 | + on_gain = function(self, err) return _t"#Target# is brutalized!", _t"+Brutalized" end, | |
4347 | + on_lose = function(self, err) return _t"#Target# is not brutalized anymore.", _t"-Brutalized" end, | |
4348 | 4348 | activate = function(self, eff) |
4349 | - eff.tmpid = self:addTemporaryValue("stunned", 1) | |
4350 | - eff.lockid = self:addTemporaryValue("half_talents_cooldown", 1) | |
4351 | - eff.speedid = self:addTemporaryValue("movement_speed", -0.5) | |
4352 | - eff.bleedid = self:addTemporaryValue("cut_immune", -0.5) | |
4353 | - | |
4354 | - local tids = {} | |
4355 | - for tid, lev in pairs(self.talents) do | |
4356 | - local t = self:getTalentFromId(tid) | |
4357 | - if t and not self.talents_cd[tid] and t.mode == "activated" and not t.innate and util.getval(t.no_energy, self, t) ~= true then tids[#tids+1] = t end | |
4358 | - end | |
4359 | - for i = 1, 3 do | |
4360 | - local t = rng.tableRemove(tids) | |
4361 | - if not t then break end | |
4362 | - self:startTalentCooldown(t.id, 1) | |
4363 | - end | |
4364 | - end, | |
4365 | - deactivate = function(self, eff) | |
4366 | - self:removeTemporaryValue("stunned", eff.tmpid) | |
4367 | - self:removeTemporaryValue("half_talents_cooldown", eff.lockid) | |
4368 | - self:removeTemporaryValue("movement_speed", eff.speedid) | |
4369 | - self:removeTemporaryValue("cut_immune", eff.bleedid) | |
4370 | - end, | |
4349 | + self:effectTemporaryValue(eff, "cut_immune", -0.5) | |
4350 | + end, | |
4351 | + deactivate = function(self, eff) | |
4352 | + end, | |
4371 | 4353 | } |
4372 | 4354 | ... | ... |
-
Please register or login to post a comment