mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 08:39:17 +00:00
Fix minor issues in mining and running.
This commit is contained in:
@@ -71,7 +71,7 @@ class MiningAction < DistancedAction
|
|||||||
# TODO: calculate the chance that the player can actually get the rock
|
# TODO: calculate the chance that the player can actually get the rock
|
||||||
|
|
||||||
if character.inventory.add ore.id
|
if character.inventory.add ore.id
|
||||||
ore_def = ItemDefinition.for_id @ore.id # TODO: split off into some method
|
ore_def = ItemDefinition.lookup @ore.id # TODO: split off into some method
|
||||||
name = ore_def.name.sub(/ ore$/, "").downcase
|
name = ore_def.name.sub(/ ore$/, "").downcase
|
||||||
|
|
||||||
character.send_message "You manage to mine some #{name}."
|
character.send_message "You manage to mine some #{name}."
|
||||||
@@ -126,7 +126,7 @@ class ProspectingAction < DistancedAction
|
|||||||
character.send_message "You examine the rock for ores..."
|
character.send_message "You examine the rock for ores..."
|
||||||
character.turn_to @position
|
character.turn_to @position
|
||||||
else
|
else
|
||||||
ore_def = ItemDefinition.for_id @ore.id
|
ore_def = ItemDefinition.lookup @ore.id
|
||||||
name = ore_def.name.sub(/ ore$/, "").downcase
|
name = ore_def.name.sub(/ ore$/, "").downcase
|
||||||
|
|
||||||
character.send_message "This rock contains #{name}."
|
character.send_message "This rock contains #{name}."
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ WALK_BUTTON_ID = 152
|
|||||||
RUN_BUTTON_ID = 153
|
RUN_BUTTON_ID = 153
|
||||||
|
|
||||||
on :button, WALK_BUTTON_ID do |player|
|
on :button, WALK_BUTTON_ID do |player|
|
||||||
player.set_running(false)
|
player.running = false
|
||||||
end
|
end
|
||||||
|
|
||||||
on :button, RUN_BUTTON_ID do |player|
|
on :button, RUN_BUTTON_ID do |player|
|
||||||
player.set_running(true)
|
player.running = true
|
||||||
end
|
end
|
||||||
|
|
||||||
on :command, :run do |player, command|
|
on :command, :run do |player, command|
|
||||||
running = player.is_running
|
running = player.is_running
|
||||||
player.set_running(!running)
|
player.running = !running
|
||||||
|
|
||||||
player.send_message(running ? "You are now running." : "You are no longer running.")
|
player.send_message(running ? "You are now running." : "You are no longer running.")
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user