Need help coding a talent!
Posted: Thu Jan 17, 2013 4:01 am
hey guys, i really suck at coding and need some help. the talent shouldn't be all that difficult to get working, and i have most of it in place, but it just doesn't work. there are a couple of things i think i'm doing wrong, but i just can't figure out exactly what is the proper format to put stuff in. everything i've done so far has been figured out by editing the standard lua files, and i'm just at the point where i'm over my head
it is a sustain
it is supposed to modify a number of basic attributes; size_category, physpower, and health regen positively. movement speed, accuracy, and stamina regen negatively.
if possible, i'd like it to trigger itself to activate on any bleed damage
(it will probably also get a +20 cut immunity per level but this is not important for now)
(it will also get its own player sprite when active, but i can get that code from lichform)
i've tried to keep it simple in the way it modifies stats, and tried to keep it contained in just the mutations.lua file without using actor.lua or combat.lua . this hasn't worked so far
here's what i have so far:
now i've just recently noticed that some of these basic stats use self, like self.movement_speed or self.combat_atk. others use t, like r t.health_regen and t.stamina_regen. i don't know what this means. i have a feeling this is why my talent won't work though.
can someone point me in the right direction? thanks in advance!
it is a sustain
it is supposed to modify a number of basic attributes; size_category, physpower, and health regen positively. movement speed, accuracy, and stamina regen negatively.
if possible, i'd like it to trigger itself to activate on any bleed damage
(it will probably also get a +20 cut immunity per level but this is not important for now)
(it will also get its own player sprite when active, but i can get that code from lichform)
i've tried to keep it simple in the way it modifies stats, and tried to keep it contained in just the mutations.lua file without using actor.lua or combat.lua . this hasn't worked so far
here's what i have so far:
Code: Select all
newTalent{
name = "Hulk Mode",
type = {"wild-gift/mutations", 3},
mode = "sustained",
points = 5,
require = barbgift_highreq1,
cooldown = 30,
sustain_stamina = 50,
tactical = { BUFF = 2 },
activate = function(self, t)
return {
size = self:addTemporaryValue("size_category", 0.5 * self:getTalentLevel(t)),
dam = self:addTemporaryValue("combat_dam", 15 * self:getTalentLevel(t)),
atk = self:addTemporaryValue("combat_atk", - 0.05 * self:getTalentLevel(t)),
movespeed = self:addTemporaryValue("movement_speed", - 0.05 * self:getTalentLevel(t)),
liferegen = self:addTemporaryValue("life_regen", 2 * self:getTalentLevel(t)),
stamregen = self:addTemporaryValue("stamina_regen", - 1 * self:getTalentLevel(t)),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("size_category", p.size)
self:removeTemporaryValue("combat_dam", p.dam)
self:removeTemporaryValue("combat_atk", p.atk)
self:removeTemporaryValue("movement_speed", p.movespeed)
self:removeTemporaryValue("life_regen", p.liferegen)
self:removeTemporaryValue("stamina_regen", p.stamregen)
return true
end,
info = function(self, t)
return ([[Turn into the Hulk. Greatly increase your size, strength, health regen, and cut immunity. Lose some accuracy, global speed, and drain stamina while active due to your massive bulk.
*Gain 1 size category for every two points in the skill. (First huge, then gargntuan)
+%d Physical Power
+%d Health Regeneration
-%d Stamina Regeneration
-%d Accuracy
-%d Movement Speed]]):format(15 * self:getTalentLevel(t), 2 * self:getTalentLevel(t), self:getTalentLevel(t), 5 * self:getTalentLevel, 5 * self:getTalentLevel(t))
end,
}
can someone point me in the right direction? thanks in advance!