Post by sekira on Mar 28, 2008 9:49:45 GMT -5
I thought I would put all my martial arts patches in one place here, and also add in the changes that allow martial artists to use soft armor without penalty. All changes are in passive.lua in the calc_bonuses() function. I think I found all the places where martial artists are penalized for wearing soft armor, and changed that, but I'm not 100% sure. If someone finds another place, feel free to post the location and I'll see if I can come up with a lua fix, or if you did your own fix, post that. Enjoy!
WARNING: I'm sure most of you already know this, but just for those who don't (and for those who are absent minded about such things some times, like me) Any time you intend to change a lua script in the script folder or a txt file in the edit folder, be sure to back up your original file before you make the change. Lots of things can happen when you attempt to copy and paste code like this... if you are off by just one line, it could break the whole game. You want to be able to roll back the changes quickly instead of having to download the original files and copy them in.
First Patch:should actually be
Next patch:would become:
Next Patch:would become:
Next Patch:
Note: This one had an error anyway... in the inner if statement conditional clause every instance of or should be replaced with and. The way it is written originally, you will always have monk speed no matter what armor you wear... might be a good reason to multiclass to monk for that one abilitywould become:
EDIT: modified first patch per Variaz's comments in the first reply post.
WARNING: I'm sure most of you already know this, but just for those who don't (and for those who are absent minded about such things some times, like me) Any time you intend to change a lua script in the script folder or a txt file in the edit folder, be sure to back up your original file before you make the change. Lots of things can happen when you attempt to copy and paste code like this... if you are off by just one line, it could break the whole game. You want to be able to roll back the changes quickly instead of having to download the original files and copy them in.
First Patch:
-- When fighting bare handed, use the martial arts skill to boost
-- the damages. Note that claws are NOT considered martial arts!!
if (unarmed()) then
if (p_ptr.body_monster > 0) then
if (inven(INVEN_ARM).tval == 0 or inven(INVEN_ARM).tval == TV_ARM_BAND) then
if (inven(INVEN_BODY).tval == TV_SOFT_ARMOR or inven(INVEN_BODY).tval == TV_HARD_ARMOR or inven(INVEN_BODY).tval == TV_DRAG_ARMOR) then
p_ptr.to_h = p_ptr.to_h + p_ptr.skill[19]
p_ptr.dis_to_h = p_ptr.dis_to_h + p_ptr.skill[19]
else
p_ptr.to_h = p_ptr.to_h + (2 * p_ptr.skill[19])
p_ptr.dis_to_h = p_ptr.dis_to_h + (2 * p_ptr.skill[19])
end
end
else
p_ptr.to_h = p_ptr.to_h + (2 * p_ptr.skill[19])
p_ptr.dis_to_h = p_ptr.dis_to_h + (2 * p_ptr.skill[19])
end
end
-- When fighting bare handed, use the martial arts skill to boost
-- the damages. Note that claws are NOT considered martial arts!!
if (unarmed()) then
if (p_ptr.body_monster > 0) then
if (inven(INVEN_BODY).tval == TV_HARD_ARMOR or inven(INVEN_BODY).tval == TV_DRAG_ARMOR) then
p_ptr.to_h = p_ptr.to_h + p_ptr.skill[19]
p_ptr.dis_to_h = p_ptr.dis_to_h + p_ptr.skill[19]
p_ptr.to_d = p_ptr.to_d + (2 * p_ptr.skill[19])
p_ptr.dis_to_d = p_ptr.dis_to_d + (2 * p_ptr.skill[19])
else
p_ptr.to_h = p_ptr.to_h + (2 * p_ptr.skill[19])
p_ptr.dis_to_h = p_ptr.dis_to_h + (2 * p_ptr.skill[19])
p_ptr.to_d = p_ptr.to_d + (5 * p_ptr.skill[19])
p_ptr.dis_to_d = p_ptr.dis_to_d + (5 * p_ptr.skill[19])
end
else
p_ptr.to_h = p_ptr.to_h + (2 * p_ptr.skill[19])
p_ptr.dis_to_h = p_ptr.dis_to_h + (2 * p_ptr.skill[19])
p_ptr.to_d = p_ptr.to_d + (5 * p_ptr.skill[19])
p_ptr.dis_to_d = p_ptr.dis_to_d + (5 * p_ptr.skill[19])
end
end
Next patch:
-- Base AC from Martial Arts skill
if (inven(INVEN_BODY).tval == 0) then
p_ptr.ac = p_ptr.ac + (p_ptr.skill[19] * 2)
p_ptr.dis_ac = p_ptr.dis_ac + (p_ptr.skill[19] * 2)
end
-- Base AC from Martial Arts skill
if (not(inven(INVEN_BODY).tval == TV_HARD_ARMOR) and not(inven(INVEN_BODY).tval == TV_DRAG_ARMOR)) then
p_ptr.ac = p_ptr.ac + (p_ptr.skill[19] * 2) + ((p_ptr.skill[19] * 2 * p_ptr.skill[6] * 10) / 100)
p_ptr.dis_ac = p_ptr.dis_ac + (p_ptr.skill[19] * 2) + ((p_ptr.skill[19] * 2 * p_ptr.skill[6] * 10) / 100)
end
Next Patch:
-- Base AC bonus for the Unarmored Combat monk ability!
if (p_ptr.abilities[(CLASS_MONK * 10) + 1] >= 1 and (inven(INVEN_BODY).tval == 0)) then
p_ptr.ac = p_ptr.ac + (p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4)
p_ptr.dis_ac = p_ptr.dis_ac + (p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4)
end
-- Base AC bonus for the Unarmored Combat monk ability!
if (p_ptr.abilities[(CLASS_MONK * 10) + 1] >= 1 and not(inven(INVEN_BODY).tval == TV_HARD_ARMOR) and not(inven(INVEN_BODY).tval == TV_DRAG_ARMOR)) then
p_ptr.ac = p_ptr.ac + (p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4) + ((p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4 * p_ptr.skill[6] * 10) / 100)
p_ptr.dis_ac = p_ptr.dis_ac + (p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4) + ((p_ptr.abilities[(CLASS_MONK * 10) + 1] * 4 * p_ptr.skill[6] * 10) / 100)
end
Next Patch:
Note: This one had an error anyway... in the inner if statement conditional clause every instance of or should be replaced with and. The way it is written originally, you will always have monk speed no matter what armor you wear... might be a good reason to multiclass to monk for that one ability
-- Monk Speed!
if (p_ptr.abilities[(CLASS_MONK * 10) + 8] >= 1) then
if (not(inven(INVEN_BODY).tval == TV_SOFT_ARMOR) or not(inven(INVEN_BODY).tval == TV_HARD_ARMOR) or not(inven(INVEN_BODY).tval == TV_DRAG_ARMOR)) then
p_ptr.pspeed = p_ptr.pspeed + ((p_ptr.abilities[(CLASS_MONK * 10) + 8] / 2) + 1)
end
end
-- Monk Speed!
if (p_ptr.abilities[(CLASS_MONK * 10) + 8] >= 1) then
if (not(inven(INVEN_BODY).tval == TV_HARD_ARMOR) and not(inven(INVEN_BODY).tval == TV_DRAG_ARMOR)) then
p_ptr.pspeed = p_ptr.pspeed + ((p_ptr.abilities[(CLASS_MONK * 10) + 8] / 2) + 1)
end
end
EDIT: modified first patch per Variaz's comments in the first reply post.