moss.lua
8.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local function activate_moss(self, btid)
for tid, lev in pairs(self.talents) do
if tid ~= btid and self.talents_def[tid].type[1] == "wild-gift/moss" and not self.talents_cd[tid] then
self.talents_cd[tid] = 3
end
end
end
newTalent{
name = "Grasping Moss",
type = {"wild-gift/moss", 1},
require = gifts_req1,
points = 5,
cooldown = 16,
equilibrium = 5,
no_energy = true,
tactical = { ATTACKAREA = {NATURE=1}, DISABLE = {pin = 1} },
getDamage = function(self, t) return self:combatTalentMindDamage(t, 6, 40) end,
getDuration = function(self, t) return 3 + math.ceil(self:getTalentLevel(t)) end,
getSlow = function(self, t) return 30 + math.ceil(self:getTalentLevel(t) * 6) end,
getPin = function(self, t) return 20 + math.ceil(self:getTalentLevel(t) * 5) end,
range = 0,
radius = function(self, t)
return 2 + math.floor(self:getTalentLevelRaw(t)/2)
end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
end,
action = function(self, t)
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, self:spellCrit(t.getDuration(self, t)),
DamageType.GRASPING_MOSS, {dam=self:mindCrit(t.getDamage(self, t)), pin=t.getPin(self, t), slow=t.getSlow(self, t)},
self:getTalentRadius(t),
5, nil,
{type="moss"},
nil, false, false
)
activate_moss(self, t.id)
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getDuration(self, t)
local slow = t.getSlow(self, t)
local pin = t.getPin(self, t)
local radius = self:getTalentRadius(t)
return ([[Instantly grow a moss circle of radius %d at your feet.
Each turn the moss deals %0.2f nature damage to any foes with in its radius.
This moss is very thick and sticky, all foes passing through it have their movement speed reduced by %d%% and have %d%% chances to be stuck on the ground for 4 turns.
The moss lasts %d turns.
Using a moss talent takes no turn but places all other moss talents on a 3 turns cooldown.
The damage will increase with your Mindpower.]]):
format(radius, damDesc(self, DamageType.NATURE, damage), slow, pin, duration)
end,
}
newTalent{
name = "Nurishing Moss",
type = {"wild-gift/moss", 2},
require = gifts_req2,
points = 5,
cooldown = 16,
equilibrium = 5,
no_energy = true,
tactical = { ATTACKAREA = {NATURE=1}, DISABLE = {pin = 1} },
getDamage = function(self, t) return self:combatTalentMindDamage(t, 6, 40) end,
getDuration = function(self, t) return 3 + math.ceil(self:getTalentLevel(t)) end,
getHeal = function(self, t) return 50 + math.ceil(self:getTalentLevel(t) * 15) end,
range = 0,
radius = function(self, t)
return 2 + math.floor(self:getTalentLevelRaw(t)/2)
end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
end,
action = function(self, t)
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, self:spellCrit(t.getDuration(self, t)),
DamageType.NURISHING_MOSS, {dam=self:mindCrit(t.getDamage(self, t)), factor=t.getHeal(self, t)/100},
self:getTalentRadius(t),
5, nil,
{type="moss"},
nil, false, false
)
activate_moss(self, t.id)
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getDuration(self, t)
local heal = t.getHeal(self, t)
local radius = self:getTalentRadius(t)
return ([[Instantly grow a moss circle of radius %d at your feet.
Each turn the moss deals %0.2f nature damage to any foes with in its radius.
This moss has vampiric properties, all damage it deals also heals the user for %d%% of the damage done.
The moss lasts %d turns.
Using a moss talent takes no turn but places all other moss talents on a 3 turns cooldown.
The damage will increase with your Mindpower.]]):
format(radius, damDesc(self, DamageType.NATURE, damage), heal, duration)
end,
}
newTalent{
name = "Slippery Moss",
type = {"wild-gift/moss", 3},
require = gifts_req3,
points = 5,
cooldown = 16,
equilibrium = 5,
no_energy = true,
tactical = { ATTACKAREA = {NATURE=1}, DISABLE = {pin = 1} },
getDamage = function(self, t) return self:combatTalentMindDamage(t, 6, 40) end,
getDuration = function(self, t) return 3 + math.ceil(self:getTalentLevel(t)) end,
getFail = function(self, t) return 20 + math.ceil(self:getTalentLevel(t) * 6) end,
range = 0,
radius = function(self, t)
return 2 + math.floor(self:getTalentLevelRaw(t)/2)
end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
end,
action = function(self, t)
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, self:spellCrit(t.getDuration(self, t)),
DamageType.SLIPPERY_MOSS, {dam=self:mindCrit(t.getDamage(self, t)), fail=t.getFail(self, t)},
self:getTalentRadius(t),
5, nil,
{type="moss"},
nil, false, false
)
activate_moss(self, t.id)
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getDuration(self, t)
local fail = t.getFail(self, t)
local radius = self:getTalentRadius(t)
return ([[Instantly grow a moss circle of radius %d at your feet.
Each turn the moss deals %0.2f nature damage to any foes with in its radius.
This moss is very slippery, any foes trying to perform complex actions has %d%% chances of failing.
The moss lasts %d turns.
Using a moss talent takes no turn but places all other moss talents on a 3 turns cooldown.
The damage will increase with your Mindpower.]]):
format(radius, damDesc(self, DamageType.NATURE, damage), fail, duration)
end,
}
newTalent{
name = "Hallucinogenic Moss",
type = {"wild-gift/moss", 4},
require = gifts_req4,
points = 5,
cooldown = 16,
equilibrium = 5,
no_energy = true,
tactical = { ATTACKAREA = {NATURE=1}, DISABLE = {pin = 1} },
getDamage = function(self, t) return self:combatTalentMindDamage(t, 6, 40) end,
getDuration = function(self, t) return 3 + math.ceil(self:getTalentLevel(t)) end,
getChance = function(self, t) return 20 + math.ceil(self:getTalentLevel(t) * 5.5) end,
getPower = function(self, t) return 15 + math.ceil(self:getTalentLevel(t) * 5) end,
range = 0,
radius = function(self, t)
return 2 + math.floor(self:getTalentLevelRaw(t)/2)
end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
end,
action = function(self, t)
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, self:spellCrit(t.getDuration(self, t)),
DamageType.HALLUCINOGENIC_MOSS, {dam=self:mindCrit(t.getDamage(self, t)), chance=t.getChance(self, t), power=t.getPower(self, t)},
self:getTalentRadius(t),
5, nil,
{type="moss"},
nil, false, false
)
activate_moss(self, t.id)
game:playSoundNear(self, "talents/slime")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getDuration(self, t)
local chance = t.getChance(self, t)
local power = t.getPower(self, t)
local radius = self:getTalentRadius(t)
return ([[Instantly grow a moss circle of radius %d at your feet.
Each turn the moss deals %0.2f nature damage to any foes with in its radius.
This moss is coated with strange fluids, any foes passing through it has %d%% chances to be confused (power %d%%) for 2 turns.
The moss lasts %d turns.
Using a moss talent takes no turn but places all other moss talents on a 3 turns cooldown.
The damage will increase with your Mindpower.]]):
format(radius, damDesc(self, DamageType.NATURE, damage), chance, power, duration)
end,
}