attack and follow

This commit is contained in:
Henrique Santiago
2012-01-05 12:24:38 -02:00
parent 320b67e292
commit 7e7050929d
7 changed files with 101 additions and 13 deletions

View File

@@ -37,10 +37,18 @@ function Game.createThingMenu(menuPosition, lookThing, useThing, creatureThing)
if creatureThing:asLocalPlayer() then
menu:addOption('Set Outfit', function() Game.openOutfitWindow() end)
else
-- todo: check for stop attack/follow
menu:addOption('Attack', function() Game.attack(creatureThing) end)
menu:addOption('Follow', function() Game.follow(creatureThing)end)
if Game.getAttackingCreature() ~= creatureThing then
menu:addOption('Attack', function() Game.attack(creatureThing) end)
else
menu:addOption('Stop Attack', function() Game.cancelAttack() end)
end
if Game.getFollowingCreature() ~= creatureThing then
menu:addOption('Follow', function() Game.follow(creatureThing) end)
else
menu:addOption('Stop Follow', function() Game.cancelFollow() end)
end
if creatureThing:asPlayer() then
menu:addSeparator()
menu:addOption('Message to ' .. creatureThing:getName(), function() print('message') end)