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

Fatigue can not be negative

git-svn-id: http://svn.net-core.org/repos/t-engine4@2131 51575b47-30f0-44d4-a5cc-537603b46e54
parent f20d843d
No related branches found
No related tags found
No related merge requests found
......@@ -1357,11 +1357,11 @@ function _M:preUseTalent(ab, silent, fake)
return false
end
else
if ab.mana and self:getMana() < ab.mana * (100 + 2 * self.fatigue) / 100 then
if ab.mana and self:getMana() < ab.mana * (100 + 2 * self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough mana to cast %s.", ab.name) end
return false
end
if ab.stamina and self:getStamina() < ab.stamina * (100 + self.fatigue) / 100 then
if ab.stamina and self:getStamina() < ab.stamina * (100 + self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough stamina to use %s.", ab.name) end
return false
end
......@@ -1369,15 +1369,15 @@ function _M:preUseTalent(ab, silent, fake)
if not silent then game.logPlayer(self, "You do not have enough vim to use %s.", ab.name) end
return false
end
if ab.positive and self:getPositive() < ab.positive * (100 + self.fatigue) / 100 then
if ab.positive and self:getPositive() < ab.positive * (100 + self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough positive energy to use %s.", ab.name) end
return false
end
if ab.negative and self:getNegative() < ab.negative * (100 + self.fatigue) / 100 then
if ab.negative and self:getNegative() < ab.negative * (100 + self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough negative energy to use %s.", ab.name) end
return false
end
if ab.hate and self:getHate() < ab.hate * (100 + self.fatigue) / 100 then
if ab.hate and self:getHate() < ab.hate * (100 + self:combatFatigue()) / 100 then
if not silent then game.logPlayer(self, "You do not have enough hate to use %s.", ab.name) end
return false
end
......@@ -1517,23 +1517,23 @@ function _M:postUseTalent(ab, ret)
end
else
if ab.mana then
trigger = true; self:incMana(-ab.mana * (100 + 2 * self.fatigue) / 100)
trigger = true; self:incMana(-ab.mana * (100 + 2 * self:combatFatigue()) / 100)
end
if ab.stamina then
trigger = true; self:incStamina(-ab.stamina * (100 + self.fatigue) / 100)
trigger = true; self:incStamina(-ab.stamina * (100 + self:combatFatigue()) / 100)
end
-- Vim is not affected by fatigue
if ab.vim then
trigger = true; self:incVim(-ab.vim)
end
if ab.positive then
trigger = true; self:incPositive(-ab.positive * (100 + self.fatigue) / 100)
trigger = true; self:incPositive(-ab.positive * (100 + self:combatFatigue()) / 100)
end
if ab.negative then
trigger = true; self:incNegative(-ab.negative * (100 + self.fatigue) / 100)
trigger = true; self:incNegative(-ab.negative * (100 + self:combatFatigue()) / 100)
end
if ab.hate then
trigger = true; self:incHate(-ab.hate * (100 + self.fatigue) / 100)
trigger = true; self:incHate(-ab.hate * (100 + self:combatFatigue()) / 100)
end
-- Equilibrium is not affected by fatigue
if ab.equilibrium then
......@@ -1635,12 +1635,12 @@ function _M:getTalentFullDescription(t, addlevel)
else d:add({"color",0x6f,0xff,0x83}, "Use mode: ", {"color",0x00,0xFF,0x00}, "Activated", true)
end
if t.mana or t.sustain_mana then d:add({"color",0x6f,0xff,0x83}, "Mana cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.sustain_mana or t.mana * (100 + 2 * self.fatigue) / 100), true) end
if t.stamina or t.sustain_stamina then d:add({"color",0x6f,0xff,0x83}, "Stamina cost: ", {"color",0xff,0xcc,0x80}, ""..(t.sustain_stamina or t.stamina * (100 + self.fatigue) / 100), true) end
if t.mana or t.sustain_mana then d:add({"color",0x6f,0xff,0x83}, "Mana cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.sustain_mana or t.mana * (100 + 2 * self:combatFatigue()) / 100), true) end
if t.stamina or t.sustain_stamina then d:add({"color",0x6f,0xff,0x83}, "Stamina cost: ", {"color",0xff,0xcc,0x80}, ""..(t.sustain_stamina or t.stamina * (100 + self:combatFatigue()) / 100), true) end
if t.equilibrium or t.sustain_equilibrium then d:add({"color",0x6f,0xff,0x83}, "Equilibrium cost: ", {"color",0x00,0xff,0x74}, ""..(t.equilibrium or t.sustain_equilibrium), true) end
if t.vim or t.sustain_vim then d:add({"color",0x6f,0xff,0x83}, "Vim cost: ", {"color",0x88,0x88,0x88}, ""..(t.sustain_vim or t.vim), true) end
if t.positive or t.sustain_positive then d:add({"color",0x6f,0xff,0x83}, "Positive energy cost: ", {"color",255, 215, 0}, ""..(t.sustain_positive or t.positive * (100 + self.fatigue) / 100), true) end
if t.negative or t.sustain_negative then d:add({"color",0x6f,0xff,0x83}, "Negative energy cost: ", {"color", 127, 127, 127}, ""..(t.sustain_negative or t.negative * (100 + self.fatigue) / 100), true) end
if t.positive or t.sustain_positive then d:add({"color",0x6f,0xff,0x83}, "Positive energy cost: ", {"color",255, 215, 0}, ""..(t.sustain_positive or t.positive * (100 + self:combatFatigue()) / 100), true) end
if t.negative or t.sustain_negative then d:add({"color",0x6f,0xff,0x83}, "Negative energy cost: ", {"color", 127, 127, 127}, ""..(t.sustain_negative or t.negative * (100 + self:combatFatigue()) / 100), true) end
if t.hate or t.sustain_hate then d:add({"color",0x6f,0xff,0x83}, "Hate cost: ", {"color", 127, 127, 127}, ""..(t.hate or t.sustain_hate), true) end
if t.paradox or t.sustain_paradox then d:add({"color",0x6f,0xff,0x83}, "Paradox cost: ", {"color", 176, 196, 222}, ("%0.2f"):format(t.sustain_paradox or t.paradox * (1 + (self.paradox / 100))), true) end
if self:getTalentRange(t) > 1 then d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, ("%0.2f"):format(self:getTalentRange(t)), true)
......
......@@ -531,6 +531,12 @@ function _M:getOffHandMult(mult)
return offmult
end
--- Gets fatigue
function _M:combatFatigue()
if self.fatigue < 0 then return 0 end
return self.fatigue
end
--- Gets spellcrit
function _M:combatSpellCrit()
return self.combat_spellcrit + (self:getCun() - 10) * 0.3 + (self:getLck() - 50) * 0.30 + 1
......@@ -600,10 +606,10 @@ function _M:spellCrit(dam, add_chance)
local t = self:getTalentFromId(self.T_BLOOD_FURY)
t.on_crit(self, t)
end
if self:isTalentActive(self.T_CORONA) then
local t = self:getTalentFromId(self.T_CORONA)
t.on_crit(self, t)
t.on_crit(self, t)
end
end
......
......@@ -146,7 +146,7 @@ function _M:dumpToJSON(js)
-- Defense
-------------------------------------------------------------------
local d = js:newSection("defense", "defense", "pairs", "break")
d[#d+1] = { ["fatigue"] = self.fatigue }
d[#d+1] = { ["fatigue"] = self:combatFatigue() }
d[#d+1] = { ["armour"] = self:combatArmor() }
d[#d+1] = { ["defense"] = self:combatDefense() }
d[#d+1] = { ["ranged defense"] = self:combatDefenseRanged() }
......
......@@ -1295,6 +1295,7 @@ newEntity{ base = "BASE_HEAVY_ARMOR",
max_life=120,
combat_def = 10,
combat_armor = 14,
fatigue = 16,
},
max_power = 80, power_regen = 1,
use_talent = { id = Talents.T_INFERNO, level = 3, power = 50 },
......@@ -1326,6 +1327,7 @@ newEntity{ base = "BASE_MASSIVE_ARMOR",
stun_immune = 0.5,
knockback_immune = 0.5,
lite = 1,
fatigue = 26,
},
}
......
......@@ -187,7 +187,7 @@ function _M:drawDialog(s)
h = basey
w = 400
self:mouseTooltip(self.TOOLTIP_FATIGUE, s:drawColorStringBlended(self.font, ("Fatigue: #00ff00#%3d%%"):format(player.fatigue), w, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(self.TOOLTIP_FATIGUE, s:drawColorStringBlended(self.font, ("Fatigue: #00ff00#%3d%%"):format(player:combatFatigue()), w, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(self.TOOLTIP_ARMOR, s:drawColorStringBlended(self.font, ("Armor: #00ff00#%3d"):format(player:combatArmor()), w, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(self.TOOLTIP_DEFENSE, s:drawColorStringBlended(self.font, ("Defense: #00ff00#%3d"):format(player:combatDefense()), w, h, 255, 255, 255)) h = h + self.font_h
self:mouseTooltip(self.TOOLTIP_RDEFENSE,s:drawColorStringBlended(self.font, ("Ranged Defense: #00ff00#%3d"):format(player:combatDefenseRanged()), w, h, 255, 255, 255)) h = h + self.font_h
......@@ -365,7 +365,7 @@ function _M:dump()
end
nl()
nnl(("%-32s"):format(makelabel("Fatigue", player.fatigue .. "%")))
nnl(("%-32s"):format(makelabel("Fatigue", player:combatFatigue() .. "%")))
nl(makelabel("Spellpower", player:combatSpellpower() ..""))
nnl(("%-32s"):format(makelabel("Armor", player:combatArmor() .. "")))
nl(makelabel("Spell Crit", player:combatSpellCrit() .."%"))
......
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