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

ideas/gift.ods for Wild-Gifts

slime powers


git-svn-id: http://svn.net-core.org/repos/t-engine4@287 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1a1a01eb
No related branches found
No related tags found
No related merge requests found
Showing
with 199 additions and 15 deletions
require "engine.class"
--- Handles player hotkey interface
-- This provides methods to bind and manage hotkeys as well as using them<br/>
-- This interface is designed to work with the engine.HotkeysDisplay class to display current hotkeys to the player
module(..., package.seeall, class.make)
function _M:init(t)
self.hotkey = {}
self.hotkey_page = 1
end
--- Uses an hotkeyed talent
-- This requires the ActorTalents interface to use talents and a method player:playerUseItem(o, item) to use inventory objects
function _M:activateHotkey(id)
if self.hotkey[id] then
if self.hotkey[id][1] == "talent" then
self:useTalent(self.hotkey[id][2])
elseif self.hotkey[id][1] == "inventory" then
local o, item = self:findInInventory(self:getInven("INVEN"), self.hotkey[id][2])
if not o then
Dialog:simplePopup("Item not found", "You do not have any "..self.hotkey[id][2]..".")
else
self:playerUseItem(o, item)
end
end
else
Dialog:simplePopup("Hotkey not defined", "You may define a hotkey by pressing 'm' and following the inscructions there.")
end
end
--- Switch to previous hotkey page
function _M:prevHotkeyPage()
self.hotkey_page = util.boundWrap(self.hotkey_page - 1, 1, 3)
self.changed = true
end
--- Switch to next hotkey page
function _M:nextHotkeyPage()
self.hotkey_page = util.boundWrap(self.hotkey_page + 1, 1, 3)
self.changed = true
end
......@@ -32,10 +32,10 @@ newBirthDescriptor{
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["physical/shield"]={true, 0.3},
["physical/2hweapon"]={true, 0.3},
["physical/combat-training"]={true, 0.3},
["physical/weapon-training"]={true, 0.3},
["technique/shield"]={true, 0.3},
["technique/2hweapon"]={true, 0.3},
["technique/combat-training"]={true, 0.3},
["technique/weapon-training"]={true, 0.3},
},
talents = {
[ActorTalents.T_SHIELD_BASH] = 1,
......@@ -80,9 +80,9 @@ newBirthDescriptor{
},
stats = { dex=2, str=1, cun=3, },
talents_types = {
["physical/dualweapon"]={true, 0.3},
["physical/combat-training"]={true, 0},
["physical/weapon-training"]={true, 0},
["technique/dualweapon"]={true, 0.3},
["technique/combat-training"]={true, 0},
["technique/weapon-training"]={true, 0},
["cunning/stealth"]={true, 0.3},
["cunning/traps"]={true, 0.3},
["cunning/dirty"]={true, 0.3},
......
......@@ -231,6 +231,18 @@ newDamageType{
end,
}
-- Slime damage
newDamageType{
name = "slime", type = "SLIME",
projector = function(src, x, y, type, dam)
DamageType:get(DamageType.NATURE).projector(src, x, y, DamageType.NATURE, dam)
local target = game.level.map(x, y, Map.ACTOR)
if target then
target:setEffect(target.EFF_SLOW, 3, {power=0.3})
end
end,
}
-- Poisoning damage
newDamageType{
name = "dig", type = "DIG",
......
......@@ -16,7 +16,7 @@ newEntity{
combat_armor = 1, combat_def = 1,
combat = { dam=resolvers.rngavg(12,25), atk=10, apr=10, physspeed=2 },
life_rating = 13,
tmasteries = resolvers.tmasteries{ ["physical/other"]=0.25 },
tmasteries = resolvers.tmasteries{ ["technique/other"]=0.25 },
resists = { [DamageType.FIRE] = 20, [DamageType.COLD] = 20, [DamageType.POISON] = 20 },
}
......
......@@ -16,7 +16,7 @@ newEntity{
energy = { mod=1 },
stats = { str=14, dex=12, mag=10, con=12 },
tmasteries = resolvers.tmasteries{ ["physical/other"]=0.3, ["physical/2hweapon"]=0.3 },
tmasteries = resolvers.tmasteries{ ["technique/other"]=0.3, ["technique/2hweapon"]=0.3 },
blind_immune = 1,
see_invisible = 2,
......
......@@ -19,7 +19,7 @@ newEntity{
energy = { mod=1 },
stats = { str=20, dex=8, mag=6, con=16 },
tmasteries = resolvers.tmasteries{ ["physical/other"]=0.3 },
tmasteries = resolvers.tmasteries{ ["technique/other"]=0.3 },
resists = { [DamageType.FIRE] = -50 },
}
......
......@@ -159,10 +159,10 @@ newEntity{ base = "BASE_POTION",
cost = 0.01,
use_simple = { name="quaff", use = function(self, who)
game.logSeen(who, "%s quaff the slime juice. Yuck.", who.name:capitalize())
game.logSeen(who, "%s quaffs the slime juice. Yuck.", who.name:capitalize())
-- 1% chance of gaining slime mold powers
if rng.percent(1) then
who:learnTalentType("slime/slime", true)
who:learnTalentType("gift/slime", true)
game.logSeen(who, "%s is transformed by the slime mold juice.", who.name:capitalize())
game.logPlayer(who, "#00FF00#You gain an affinity for the molds. You can now learn new slime talents (press G).")
end
......
......@@ -23,6 +23,28 @@ newEntity{ base = "BASE_SCROLL",
end}
}
newEntity{ base = "BASE_SCROLL",
name = "scroll of identify",
level_range = {1, 50},
rarity = 6,
cost = 1,
use_simple = { name="identify one object (or all with high magic stat)", use = function(self, who)
if who:getMag() < 28 then
who:showInventory("Identify object", who:getInven(who.INVEN_INVEN), nil, function(o, item)
o:identify(true)
game.logPlayer(who, "You identify: "..o:getName())
end)
else
for i, o in ipairs(who:getInven("INVEN")) do
o:identify(true)
end
game.logPlayer(who, "You identify all your inventory.")
end
return "destroy", true
end}
}
newEntity{ base = "BASE_SCROLL",
name = "scroll of phase door",
level_range = {1, 30},
......
return {
base = 1000,
angle = { 0, 360 }, anglev = { 2000, 4000 }, anglea = { 20, 60 },
life = { 5, 10 },
size = { 4, 7 }, sizev = {0, 0}, sizea = {0, 0},
r = {0, 0}, rv = {0, 0}, ra = {0, 0},
g = {80, 200}, gv = {0, 10}, ga = {0, 0},
b = {0, 0}, bv = {0, 0}, ba = {0, 0},
a = {155, 255}, av = {0, 0}, aa = {0, 0},
}, function(self)
self.nb = (self.nb or 0) + 1
if self.nb < 6 then
self.ps:emit(100)
end
end
......@@ -12,17 +12,102 @@ newTalent{
message = "@Source@ releases poisonous spores at @target@.",
cooldown = 10,
range = 1,
require = {level = function(level) return 0 + (level-1) end,},
tactical = {
ATTACK = 10,
},
action = function(self, t)
local t = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(t)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self.combat_apr = self.combat_apr + 1000
self:attackTarget(target, DamageType.POISON, 1.5 + self:getTalentLevel(t) / 5, true)
self:attackTarget(target, DamageType.POISON, 1.5 + self:getTalentLevel(t) / 4, true)
self.combat_apr = self.combat_apr - 1000
return true
end,
info = function(self)
return ([[Releases poisonous spores at the target.]])
info = function(self, t)
return ([[Releases poisonous spores at the target doing %d%% weapon damage.]]):format(100 * (1.5 + self:getTalentLevel(t) / 4))
end,
}
newTalent{
name = "Acidic Skin",
type = {"gift/slime", 2},
points = 5,
mode = "sustained",
message = "The skin of @Source@ starts dripping acid.",
cooldown = 10,
range = 1,
require = {level = function(level) return 4 + (level-1) end,},
tactical = {
DEFEND = 10,
},
activate = function(self, t)
local power = 10 + 5 * self:getTalentLevel(t)
return {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.ACID]=power}),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("on_melee_hit", p.onhit)
return true
end,
info = function(self, t)
return ([[Your skin drips with acid, damaging all that hits your for %d acid damage.]]):format(10 + 5 * self:getTalentLevel(t))
end,
}
newTalent{
name = "Slime Spit",
type = {"gift/slime", 3},
points = 5,
cooldown = 30,
tactical = {
ATTACK = 10,
},
range = 20,
require = {level = function(level) return 8 + (level-1) end,},
action = function(self, t)
local tg = {type="bolt", range=self:getTalentRange(t)}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.SLIME, 20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, {type="slime"})
return true
end,
info = function(self, t)
return ([[Spit slime at your target doing %0.2f nature damage and slowing it down for 3 turns.
The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3)
end,
}
newTalent{
name = "Slime Roots",
type = {"gift/slime", 4},
points = 5,
cooldown = 20,
tactical = {
MOVEMENT = 10,
},
range = 20,
require = {level = function(level) return 12 + (level-1) end,},
action = function(self, t)
local x, y = self:getTarget{type="ball", range=20 + self:getTalentLevel(t), radius=7 - self:getTalentLevel(t)}
if not x then return nil end
-- Target code doesnot restrict the self coordinates to the range, it lets the poject function do it
-- but we cant ...
x, y = game.target:pointAtRange(self.x, self.y, x, y, 20 + self:getTalentLevel(t))
game.level.map:particleEmitter(self.x, self.y, 1, "slime")
self:teleportRandom(x, y, 7 - self:getTalentLevel(t))
game.level.map:particleEmitter(self.x, self.y, 1, "slime")
-- Stunned!
self:setEffect(self.EFF_STUNNED, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7), {})
return true
end,
info = function(self, t)
return ([[You extend slimy roots into the ground, follow them and re-appear somewhere else in a range of %d.
The process is quite a strain on your body and you will be stunned for %d turns.
The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7))
end,
}
......@@ -38,6 +38,7 @@ newTalent{
if self:getTalentLevel(t) < 3 then
self:showInventory("Identify object", self:getInven(self.INVEN_INVEN), nil, function(o, item)
o:identify(true)
game.logPlayer(who, "You identify: "..o:getName())
end)
return true
end
......@@ -46,14 +47,18 @@ newTalent{
for i, o in ipairs(self:getInven("INVEN")) do
o:identify(true)
end
game.logPlayer(who, "You identify all your inventory.")
end
if self:getTalentLevel(t) >= 4 then
local idx = 1
while true do
local o = game.level.map:getObject(self.x, self.y, idx)
if not o then break end
o:identify(true)
idx = idx + 1
end
game.logPlayer(who, "You identify everything around you.")
end
return true
......
No preview for this file type
File added
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