Commit 36e9020450df9f72ee8f2ed394eb4c553e56f9ce

Authored by DarkGod
2 parents 8645dcc3 94711afd

Merge branch 'update-jumpgate-descriptions-cooldown' into 'master'

Update Jumpgate to provide more information for the teleports

Update Jumpgate to provide more information for the teleports (range, cost, cooldown). Also makes the cooldown of the two sustains consistent.

See merge request !787
... ... @@ -51,11 +51,10 @@ newTalent{
51 51 tactical = { ESCAPE = 2 },
52 52 no_npc_use = true,
53 53 no_unlearn_last = true,
54   - getRange = function(self, t) return math.floor(self:combatTalentScale(t, 13, 18)) end,
55 54 -- Check distance in preUseTalent to grey out the talent
56 55 on_pre_use = function(self, t)
57 56 local eff = self.sustain_talents[self.T_JUMPGATE]
58   - return eff and core.fov.distance(self.x, self.y, eff.jumpgate_x, eff.jumpgate_y) <= t.getRange(self, t)
  57 + return eff and core.fov.distance(self.x, self.y, eff.jumpgate_x, eff.jumpgate_y) <= self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE))
59 58 end,
60 59 is_teleport = true,
61 60 action = function(self, t)
... ... @@ -71,7 +70,7 @@ newTalent{
71 70 return true
72 71 end,
73 72 info = function(self, t)
74   - return ([[Instantly travel to your jumpgate, as long as you are within %d tiles of it.]]):tformat(t.getRange(self, t))
  73 + return ([[Instantly travel to your jumpgate, as long as you are within %d tiles of it.]]):tformat(self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE)))
75 74 end,
76 75 }
77 76
... ... @@ -92,11 +91,11 @@ newTalent{
92 91 sustain_negative = 20,
93 92 no_npc_use = true,
94 93 tactical = { ESCAPE = 2 },
  94 + range = function(self, t) return math.floor(self:combatTalentScale(t, 13, 18)) end,
95 95 iconOverlay = function(self, t, p)
96 96 if not self.x or not self.y or not p.jumpgate_x or not p.jumpgate_y then return "" end
97 97 local val = math.floor(core.fov.distance(self.x, self.y, p.jumpgate_x, p.jumpgate_y))
98   - local jt = self:getTalentFromId(self.T_JUMPGATE_TELEPORT)
99   - local max = jt.getRange(self, jt)
  98 + local max = self:getTalentRange(t)
100 99 local fnt = "buff_font_small"
101 100 if val >= 1000 then fnt = "buff_font_smaller" end
102 101 if val <= max then
... ... @@ -143,11 +142,12 @@ newTalent{
143 142 return true
144 143 end,
145 144 info = function(self, t)
146   - local jumpgate_teleport = self:getTalentFromId(self.T_JUMPGATE_TELEPORT)
147   - local range = jumpgate_teleport.getRange(self, jumpgate_teleport)
148   - return ([[Create a shadow jumpgate at your current location. As long as you sustain this spell, you can use 'Jumpgate: Teleport' to instantly travel to the jumpgate, as long as you are within %d tiles of it.
  145 + local range = self:getTalentRange(t)
  146 + local cd = self:getTalentCooldown(self:getTalentFromId(self.T_JUMPGATE_TELEPORT))
  147 + local cost = self:getTalentFromId(self.T_JUMPGATE_TELEPORT).negative * ((100 + self:combatFatigue()) / 100)
  148 + return ([[Create a shadow jumpgate at your current location. As long as you sustain this spell, you can use 'Jumpgate: Teleport To' to instantly travel to the jumpgate, as long as you are within %d tiles of it.
149 149 Note that any stairs underneath the jumpgate will be unusable while the spell is sustained, and you may need to cancel this sustain in order to leave certain locations.
150   - At talent level 4, you learn to create and sustain a second jumpgate.]]):tformat(range)
  150 + At talent level 4, you learn to create and sustain a second jumpgate. Each teleport has a cooldown of %d and negative energy cost of %d.]]):tformat(range, cd, cost)
151 151 end,
152 152 }
153 153
... ... @@ -273,7 +273,14 @@ newTalent{
273 273 type = {"celestial/other", 1},
274 274 mode = "sustained", no_sustain_autoreset = true,
275 275 points = 1,
276   - cooldown = 20,
  276 + cooldown = function(self, t)
  277 + local tl = self:getTalentLevelRaw(self:getTalentFromId(self.T_JUMPGATE))
  278 + if tl < 4 then
  279 + return math.ceil(self:combatLimit(tl, 0, 20, 1, 8, 4))
  280 + else
  281 + return math.ceil(self:combatLimit(tl, 0, 8, 4, 4, 5)) --I5 Limit >0
  282 + end
  283 + end,
277 284 sustain_negative = 20,
278 285 no_npc_use = true,
279 286 type_no_req = true,
... ... @@ -292,8 +299,7 @@ newTalent{
292 299 iconOverlay = function(self, t, p)
293 300 if not self.x or not self.y or not p.jumpgate2_x or not p.jumpgate2_y then return "" end
294 301 local val = math.floor(core.fov.distance(self.x, self.y, p.jumpgate2_x, p.jumpgate2_y))
295   - local jt = self:getTalentFromId(self.T_JUMPGATE_TELEPORT_TWO)
296   - local max = jt.getRange(self, jt)
  302 + local max = self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE))
297 303 local fnt = "buff_font_small"
298 304 if val >= 1000 then fnt = "buff_font_smaller" end
299 305 if val <= max then
... ... @@ -328,9 +334,8 @@ newTalent{
328 334 return true
329 335 end,
330 336 info = function(self, t)
331   - local jumpgate_teleport = self:getTalentFromId(self.T_JUMPGATE_TELEPORT_TWO)
332   - local range = jumpgate_teleport.getRange(self, jumpgate_teleport)
333   - return ([[Create a second shadow jumpgate at your location. As long as you sustain this spell, you can use 'Jumpgate: Teleport' to instantly travel to the jumpgate, as long as you are within %d tiles of it.]]):tformat(range)
  337 + local range = self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE))
  338 + return ([[Create a second shadow jumpgate at your location. As long as you sustain this spell, you can use 'Jumpgate Two: Teleport To' to instantly travel to the jumpgate, as long as you are within %d tiles of it.]]):tformat(range)
334 339 end,
335 340 }
336 341
... ... @@ -343,13 +348,12 @@ newTalent{
343 348 type_no_req = true,
344 349 tactical = { ESCAPE = 2 },
345 350 no_npc_use = true,
346   - getRange = function(self, t) return self:callTalent(self.T_JUMPGATE_TELEPORT, "getRange") end,
347 351 -- Check distance in preUseTalent to grey out the talent
348 352 is_teleport = true,
349 353 no_unlearn_last = true,
350 354 on_pre_use = function(self, t)
351 355 local eff = self.sustain_talents[self.T_JUMPGATE_TWO]
352   - return eff and core.fov.distance(self.x, self.y, eff.jumpgate2_x, eff.jumpgate2_y) <= t.getRange(self, t)
  356 + return eff and core.fov.distance(self.x, self.y, eff.jumpgate2_x, eff.jumpgate2_y) <= self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE))
353 357 end,
354 358 action = function(self, t)
355 359 local eff = self.sustain_talents[self.T_JUMPGATE_TWO]
... ... @@ -364,6 +368,6 @@ newTalent{
364 368 return true
365 369 end,
366 370 info = function(self, t)
367   - return ([[Instantly travel to your second jumpgate, as long as you are within %d tiles of it.]]):tformat(t.getRange(self, t))
  371 + return ([[Instantly travel to your second jumpgate, as long as you are within %d tiles of it.]]):tformat(self:getTalentRange(self:getTalentFromId(self.T_JUMPGATE)))
368 372 end,
369   -}
  373 +}
\ No newline at end of file
... ...