mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
Move wilderness plguin to combat package, remove explicit return and fix typo.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
<scripts>
|
||||
<script>actions.rb</script>
|
||||
<script>areas.rb</script>
|
||||
<script>wilderness.rb</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
</plugin>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user