Skip to content
Snippets Groups Projects
Commit 08c87cfc authored by DarkGod's avatar DarkGod
Browse files

When disarmed the weapon will disappear from the character doll

parent 66970965
No related branches found
No related tags found
No related merge requests found
......@@ -470,7 +470,7 @@ function _M:actBase()
self:timedEffects()
-- Handle thunderstorm, even if the actor is stunned or incapacitated it still works
if not game.zone.wilderness then
if not game.zone.wilderness and not self.dead then
if self:isTalentActive(self.T_THUNDERSTORM) then
local t = self:getTalentFromId(self.T_THUNDERSTORM)
t.do_storm(self, t)
......@@ -2673,6 +2673,8 @@ function _M:onTemporaryValueChange(prop, v, base)
self:recomputeGlobalSpeed()
elseif base == self.talents_types_mastery then
self:updateTalentTypeMastery(prop)
elseif prop == "disarmed" then
self:updateModdableTile()
end
end
......@@ -2751,17 +2753,19 @@ function _M:updateModdableTile()
i = self.inven[self.INVEN_HEAD]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_HANDS]; if i and i[1] and i[1].moddable_tile then add[#add+1] = {image = base..(i[1].moddable_tile)..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_CLOAK]; if i and i[1] and i[1].moddable_tile_hood then add[#add+1] = {image = base..(i[1].moddable_tile):format("hood")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
i = self.inven[self.INVEN_MAINHAND]; if i and i[1] and i[1].moddable_tile then
add[#add+1] = {image = base..(i[1].moddable_tile):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
if i[1].moddable_tile_particle then
add[#add].particle = i[1].moddable_tile_particle[1]
add[#add].particle_args = i[1].moddable_tile_particle[2]
if not self:attr("disarmed") then
i = self.inven[self.INVEN_MAINHAND]; if i and i[1] and i[1].moddable_tile then
add[#add+1] = {image = base..(i[1].moddable_tile):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
if i[1].moddable_tile_particle then
add[#add].particle = i[1].moddable_tile_particle[1]
add[#add].particle_args = i[1].moddable_tile_particle[2]
end
if i[1].moddable_tile_ornament then add[#add+1] = {image = base..(i[1].moddable_tile_ornament):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
end
i = self.inven[self.INVEN_OFFHAND]; if i and i[1] and i[1].moddable_tile then
add[#add+1] = {image = base..(i[1].moddable_tile):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
if i[1].moddable_tile_ornament then add[#add+1] = {image = base..(i[1].moddable_tile_ornament):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
end
if i[1].moddable_tile_ornament then add[#add+1] = {image = base..(i[1].moddable_tile_ornament):format("right")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
end
i = self.inven[self.INVEN_OFFHAND]; if i and i[1] and i[1].moddable_tile then
add[#add+1] = {image = base..(i[1].moddable_tile):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1}
if i[1].moddable_tile_ornament then add[#add+1] = {image = base..(i[1].moddable_tile_ornament):format("left")..".png", display_y=i[1].moddable_tile_big and -1 or 0, display_h=i[1].moddable_tile_big and 2 or 1} end
end
if self.moddable_tile_ornament and self.moddable_tile_ornament[self.female and "female" or "male"] then add[#add+1] = {image = base..self.moddable_tile_ornament[self.female and "female" or "male"]..".png"} end
......
......@@ -553,7 +553,7 @@ function _M:drawDialog(kind, actor_to_compare)
w = 0
local mainhand = player:getInven(player.INVEN_MAINHAND)
if mainhand and (#mainhand > 0) then
if mainhand and (#mainhand > 0) and not player:attr("disarmed") then
local WeaponTxt = "#LIGHT_BLUE#Main Hand"
if player:hasTwoHandedWeapon() then
WeaponTxt = WeaponTxt.."(2-handed)"
......@@ -616,7 +616,7 @@ function _M:drawDialog(kind, actor_to_compare)
dam = (player:getInven("QUIVER") and player:getInven("QUIVER")[1] and player:getInven("QUIVER")[1].combat)
end
if mean and dam then
s:drawColorStringBlended(self.font, "#LIGHT_BLUE#Off Hand:", w, h, 255, 255, 255, true) h = h + self.font_h
s:drawColorStringBlended(self.font, "#LIGHT_BLUE#Off Hand:"..(player:attr("disarmed") and " (disabled)" or ""), w, h, 255, 255, 255, true) h = h + self.font_h
text = compare_fields(player, actor_to_compare, function(actor, ...) return math.floor(actor:combatAttack(...)) end, "%3d", "%+.0f", 1, false, false, mean)
dur_text = ("%d"):format(math.floor(player:combatAttack(o.combat)/5))
self:mouseTooltip(self.TOOLTIP_COMBAT_ATTACK, s:drawColorStringBlended(self.font, ("Accuracy : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h
......
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