Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delayed blacksmith speech #1073

Merged
merged 1 commit into from
Mar 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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