Skip to content
Snippets Groups Projects
Commit a0fc70a7 authored by dg's avatar dg
Browse files

gem golem

git-svn-id: http://svn.net-core.org/repos/t-engine4@2330 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5b44a60b
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,26 @@ local change_armour = function(npc, player)
end)
end
local change_gem = function(npc, player, gemid)
local inven = player:getInven("INVEN")
player:showInventory("Select a gem for your golem.", inven, function(o) return o.type == "gem" and o.material_level and o.material_level <= player:getTalentLevelRaw(player.T_GEM_GOLEM) end, function(o, item)
player:removeObject(inven, item, true)
local gems = golem:getInven("GEM")
local old = golem:removeObject(gems, gemid, true)
if old then player:addObject(inven, old) end
-- Force "wield"
golem:addObject(gems, o)
game.logSeen(player, "%s sockets %s with %s.", player.name:capitalize(), golem.name, o:getName{do_color=true}:a_an())
player:sortInven()
player:useEnergy()
return true
end)
end
local change_gem1 = function(npc, player) return change_gem(npc, player, 1) end
local change_gem2 = function(npc, player) return change_gem(npc, player, 2) end
local change_name = function(npc, player)
local d = require("engine.dialogs.GetText").new("Change your golem's name", "Name", 2, 25, function(name)
if name then
......@@ -63,15 +83,24 @@ local change_name = function(npc, player)
game:registerDialog(d)
end
local ans = {
{"I want to change your weapon.", action=change_weapon},
{"I want to change your armour.", action=change_armour},
{"I want to change your name.", action=change_name},
{"Nothing, let's go."},
}
if player:knowTalent(player.T_GEM_GOLEM) then
local gem1 = golem:getInven("GEM")[1]
local gem2 = golem:getInven("GEM")[2]
table.insert(ans, 3, {("I want to change your first gem%s."):format(gem1 and "(currently: "..gem1:getName{}..")" or ""), action=change_gem1})
table.insert(ans, 4, {("I want to change your second gem%s."):format(gem2 and "(currently: "..gem2:getName{}..")" or ""), action=change_gem2})
end
newChat{ id="welcome",
text = [[#LIGHT_GREEN#*The golem talks in a monotonous voice*#WHITE#
Yes master.]],
answers = {
{"I want to change your weapon.", action=change_weapon},
{"I want to change your armour.", action=change_armour},
{"I want to change your name.", action=change_name},
{"Nothing, let's go."},
}
answers = ans
}
return "welcome"
......@@ -16,63 +16,44 @@
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local Chat = require "engine.Chat"
newTalent{
name = "Mana Tap",
type = {"spell/advanced-golemancy", 1},
mode = "passive",
require = spells_req_high1,
points = 5,
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_WEAPON_COMBAT, true)
self.alchemy_golem:learnTalent(Talents.T_WEAPONS_MASTERY, true)
end,
on_unlearn = function(self, t)
self.alchemy_golem:unlearnTalent(Talents.T_WEAPON_COMBAT, true)
self.alchemy_golem:unlearnTalent(Talents.T_WEAPONS_MASTERY, true)
mana = 0,
cooldown = 14,
getPower = function(self, t) return 40 + self:combatTalentSpellDamage(t, 15, 150) end,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
game.logPlayer(self, "Your golem is currently inactive.")
return
end
local power = math.min(t.getPower(self, t), golem:getMana())
golem:incMana(-power)
self:incMana(power)
game:playSoundNear(self, "talents/arcane")
return true
end,
info = function(self, t)
local attack = self:getTalentFromId(Talents.T_WEAPON_COMBAT).getAttack(self, t)
local damage = self:getTalentFromId(Talents.T_WEAPONS_MASTERY).getDamage(self, t)
return ([[Improves your golem proficiency with weapons. Increasing its attack by %d and damage by %d%%.]]):
format(attack, 100 * damage)
local power=t.getPower(self, t)
return ([[You tap into your golem's mana pool to replenish your own. Drains %d mana.]]):
format(power)
end,
}
newTalent{
name = "Life Tap", short_name = "GOLEMANCY_LIFE_TAP",
type = {"spell/advanced-golemancy", 2},
mode = "passive",
require = spells_req_high2,
points = 5,
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_HEALTH, true)
self.alchemy_golem:learnTalent(Talents.T_HEAVY_ARMOUR_TRAINING, true)
self.alchemy_golem:learnTalent(Talents.T_MASSIVE_ARMOUR_TRAINING, true)
end,
on_unlearn = function(self, t)
self.alchemy_golem:unlearnTalent(Talents.T_HEALTH, true)
self.alchemy_golem:unlearnTalent(Talents.T_HEAVY_ARMOUR_TRAINING, true)
self.alchemy_golem:unlearnTalent(Talents.T_MASSIVE_ARMOUR_TRAINING, true)
end,
info = function(self, t)
local health = self:getTalentFromId(Talents.T_HEALTH).getHealth(self, t)
local heavyarmor = self:getTalentFromId(Talents.T_HEAVY_ARMOUR_TRAINING).getArmor(self, t)
local massivearmor = self:getTalentFromId(Talents.T_MASSIVE_ARMOUR_TRAINING).getArmor(self, t)
return ([[Improves your golem armour training and health. Increases armor by %d when wearing heavy armor or by %d when wearing massive armor also increases health by %d.]]):
format(heavyarmor, massivearmor, health)
end,
}
newTalent{
name = "Gem Golem",
type = {"spell/advanced-golemancy",3},
require = spells_req3,
points = 5,
mana = 10,
cooldown = 20,
no_npc_use = true,
mana = 25,
cooldown = 12,
getPower = function(self, t) return 70 + self:combatTalentSpellDamage(t, 15, 450) end,
action = function(self, t)
local mover, golem = getGolem(self)
if not golem then
......@@ -80,27 +61,33 @@ newTalent{
return
end
-- Find space
local x, y = util.findFreeGrid(self.x, self.y, 5, true, {[Map.ACTOR]=true})
if not x then
game.logPlayer(self, "Not enough space to invoke!")
return
end
golem:setEffect(golem.EFF_MIGHTY_BLOWS, 5, {power=t.getPower(self, t)})
if golem == mover then
golem:move(x, y, true)
end
local power = math.min(t.getPower(self, t), golem.life)
golem.life = golem.life - power -- Direct hit, bypass all checks
golem.changed = true
self:heal(power)
game:playSoundNear(self, "talents/arcane")
return true
end,
info = function(self, t)
power=t.getPower(self, t)
return ([[You invoke your golem to your side, granting it a temporary melee power increase of %d for 5 turns.]]):
local power=t.getPower(self, t)
return ([[You tap into your golem's life energies to replenish your own. Drains %d life.]]):
format(power)
end,
}
newTalent{
name = "Gem Golem",
type = {"spell/advanced-golemancy",3},
require = spells_req3,
mode = "passive",
points = 5,
info = function(self, t)
return ([[Insert a pair of gems into your golem, providing it with the gem bonuses and changing its melee attack damage type.
Gem level usable: %d
Gem changing is done when refitting your golem (use Refit Golem at full life).]]):format(self:getTalentLevelRaw(t))
end,
}
newTalent{
name = "Runic Golem",
type = {"spell/advanced-golemancy",4},
......
......@@ -36,7 +36,7 @@ local function makeGolem()
combat = { dam=10, atk=10, apr=0, dammod={str=1} },
body = { INVEN = 50, MAINHAND=1, OFFHAND=1, BODY=1,},
body = { INVEN = 1000, MAINHAND=1, BODY=1, GEM=2 },
infravision = 20,
rank = 3,
size_category = 4,
......@@ -169,7 +169,7 @@ newTalent{
-- talk to the golem
if game.level:hasEntity(self.alchemy_golem) and self.alchemy_golem.life >= self.alchemy_golem.max_life then
local chat = Chat.new("alchemist-golem", self.alchemy_golem, self)
local chat = Chat.new("alchemist-golem", self.alchemy_golem, self, {golem=self.alchemy_golem, player=self})
chat:invoke()
-- heal the golem
......@@ -263,7 +263,6 @@ newTalent{
end,
}
newTalent{
name = "Invoke Golem",
type = {"spell/golemancy",3},
......@@ -295,7 +294,7 @@ newTalent{
return true
end,
info = function(self, t)
power=t.getPower(self, t)
local power=t.getPower(self, t)
return ([[You invoke your golem to your side, granting it a temporary melee power increase of %d for 5 turns.]]):
format(power)
end,
......
......@@ -59,6 +59,7 @@ function _M:use(item)
game.player.esp.range = 50
game.player.no_breath = 1
game.player.invulnerable = 1
game.player.money = 500
game.player.esp.all = 1
game.player.esp.range = 50
game.player.inc_damage.all = 100000
......
......@@ -81,6 +81,7 @@ ActorInventory:defineInventory("HANDS", "On hands", true, "Various gloves can be
ActorInventory:defineInventory("FEET", "On feet", true, "Sandals or boots can be worn on your feet.")
ActorInventory:defineInventory("TOOL", "Tool", true, "This is your readied tool, always available immediately.")
ActorInventory:defineInventory("QUIVER", "Quiver", true, "Your readied ammo.")
ActorInventory:defineInventory("GEM", "Socketed Gems", true, "Socketed gems.")
ActorInventory:defineInventory("MOUNT", "Mount", false, "Your mount.")
ActorInventory:defineInventory("QS_MAINHAND", "Second weapon set: In main hand", false, "Weapon Set 2: Most weapons are wielded in the main hand. Press 'x' to switch weapon sets.", true)
ActorInventory:defineInventory("QS_OFFHAND", "Second weapon set: In off hand", false, "Weapon Set 2: You can use shields or a second weapon in your off-hand, if you have the talents for it. Press 'x' to switch weapon sets.", true)
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment