Skip to content

Commit

Permalink
Merge pull request #1073 from NimbusBP1729/blacksmith_cleanup
Browse files Browse the repository at this point in the history
delayed blacksmith speech
  • Loading branch information
Jordan Hoff committed Mar 24, 2013
2 parents fa31405 + 26376d3 commit b2d7a6d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
Binary file modified src/audio/sfx/sword_hit.ogg
Binary file not shown.
7 changes: 6 additions & 1 deletion src/maps/blacksmith.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
</properties>
<polygon points="-21,-4 81,-4 101,15 -5,15"/>
</object>
<object x="408" y="259" width="71" height="3">
<object x="407" y="256" width="71" height="6">
<properties>
<property name="blocks" value="true"/>
</properties>
</object>
<object x="214" y="226" width="75" height="14">
<properties>
<property name="blocks" value="true"/>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/activenpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end

function Activenpc:enter( previous )
if self.props.enter then
self.props.enter(self)
self.props.enter(self, previous)
end
end

Expand Down
14 changes: 10 additions & 4 deletions src/nodes/activenpcs/blacksmith.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ return {
file = 'sword_hit',
}
},
enter = function(activenpc)
activenpc.state = 'talking'
sound.playSfx("ibuyandsell")
Timer.add(2.8,function() activenpc.state = 'default' end)
enter = function(activenpc, previous)
if not previous.isLevel and previous~=Gamestate.get("overworld") then return end

Timer.add(1,function()
activenpc.state = 'talking'
sound.playSfx("ibuyandsell")
Timer.add(2.8,function()
activenpc.state = 'default'
end)
end)
end,
onInteract = function(activenpc, player)
local options = {"YES","NO"}
Expand Down

0 comments on commit b2d7a6d

Please sign in to comment.