Merge branch 'master' of bitbucket.org:Major-/apollo into pathfinding.

This commit is contained in:
Major-
2015-03-04 15:09:39 +00:00
4 changed files with 28 additions and 3 deletions
-1
View File
@@ -10,7 +10,6 @@
<scripts>
<script>actions.rb</script>
<script>areas.rb</script>
<script>wilderness.rb</script>
</scripts>
<dependencies />
</plugin>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<plugin>
<id>combat</id>
<version>1</version>
<name>Combat</name>
<description>Manages combat between game characters.</description>
<authors>
<author>Ryley</author>
</authors>
<scripts>
<script>wilderness.rb</script>
</scripts>
<dependencies>
<dependency>attributes</dependency>
<dependency>areas</dependency>
</dependencies>
</plugin>
@@ -50,4 +50,13 @@ area_action :wilderness_level do
end
# Monkey patch the existing player class to add method of checking whether or not a player is within the wilderness
class Player
def in_wilderness
self.wilderness_level > 0
end
end
area :name => :wilderness, :coordinates => [ 2945, 3522, 3390, 3972, 0 ], :actions => :wilderness_level
+2 -2
View File
@@ -10,7 +10,7 @@ class PlayerAction
def initialize(slot, primary, name)
index = [ :first, :second, :third, :fourth, :fifth ].find_index(slot)
raise "Unsupport action slot #{slot}." if index.nil?
raise "Unsupported action slot #{slot}." if index.nil?
@slot = index
@primary = primary
@@ -55,7 +55,7 @@ class Player
end
def has_action(action)
return actions[action.slot] == action.name
actions[action.slot] == action.name
end
end