Commit 76f03f0b1f5b4ee9076d78ea3e149cdc8d1a096f

Authored by dg
1 parent 90a0b3fa

Alchemist's golems can now self destruct when the alchemist is dead


git-svn-id: http://svn.net-core.org/repos/t-engine4@3369 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -876,7 +876,6 @@ function _M:display(nb_keyframes)
876 876 engine.GameTurnBased.display(self, nb_keyframes)
877 877
878 878 -- Tooltip is displayed over all else, even dialogs
879   -
880 879 local mx, my, button = core.mouse.get()
881 880
882 881 if self.tooltip.w and mx > self.w - self.tooltip.w and my > self.h - self.tooltip.h then
... ...
... ... @@ -446,3 +446,32 @@ newTalent{
446 446 The damage and resistance will increase with the Magic stat]]):format(damDesc(self, DamageType.FIRE, self:combatTalentSpellDamage(t, 12, 120)), 5 + self:getTalentLevel(t), 30 + self:combatTalentSpellDamage(t, 12, 60))
447 447 end,
448 448 }
  449 +
  450 +newTalent{
  451 + name = "Self-destruction", short_name = "GOLEM_DESTRUCT",
  452 + type = {"golem/golem", 1},
  453 + points = 1,
  454 + range = 0,
  455 + radius = 4,
  456 + target = function(self, t)
  457 + return {type="ball", range=self:getTalentRange(t), selffire=false, radius=self:getTalentRadius(t)}
  458 + end,
  459 + tactical = { ATTACKAREA = 3 },
  460 + no_npc_use = true,
  461 + on_pre_use = function(self, t)
  462 + return self.summoner and self.summoner.dead
  463 + end,
  464 + action = function(self, t)
  465 + local tg = self:getTalentTarget(t)
  466 + self:project(tg, self.x, self.y, DamageType.FIRE, 50 + 10 * self.level)
  467 + game.level.map:particleEmitter(self.x, self.y, tg.radius, "ball_fire", {radius=tg.radius})
  468 + game:playSoundNear(self, "talents/fireflash")
  469 + self:die(self)
  470 + return true
  471 + end,
  472 + info = function(self, t)
  473 + local rad = self:getTalentRadius(t)
  474 + return ([[The golem self-destructs, destroying itself and generating a blast of fire in a radius of %d, doing %0.2f fire damage.
  475 + This spell is only usable when the golem's master is dead.]]):format(rad, damDesc(self, DamageType.FIRE, 50 + 10 * self.level))
  476 + end,
  477 +}
... ...
... ... @@ -47,6 +47,7 @@ local function makeGolem()
47 47 [Talents.T_MANA_POOL]=1,
48 48 [Talents.T_STAMINA_POOL]=1,
49 49 [Talents.T_GOLEM_KNOCKBACK]=1,
  50 + [Talents.T_GOLEM_DESTRUCT]=1,
50 51 },
51 52
52 53 resolvers.equip{
... ...
... ... @@ -51,6 +51,7 @@ newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/st
51 51 newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/staff-combat", name = "staff combat", generic = true, description = "Harness the power of magical staves." }
52 52 newTalentType{ type="golem/fighting", name = "fighting", description = "Golem melee capacity." }
53 53 newTalentType{ type="golem/arcane", name = "arcane", description = "Golem arcane capacity." }
  54 +newTalentType{ type="golem/golem", name = "golem", description = "Golem basic capacity." }
54 55
55 56 -- Stone Warden spells
56 57 newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/arcane-shield", name = "arcane shield", description = "Infuse arcane forces in your shield." }
... ...