From f3799391c854e24a8634a5418b987e4d4abf36d2 Mon Sep 17 00:00:00 2001 From: Major- Date: Mon, 25 Nov 2013 21:26:49 +0000 Subject: [PATCH] Fix mining; rename to skill-mining. --- data/plugins/{mining => skill-mining}/gem.rb | 0 .../{mining => skill-mining}/mining.rb | 42 +++++++++---------- data/plugins/{mining => skill-mining}/ore.rb | 0 .../{mining => skill-mining}/pickaxe.rb | 0 .../{mining => skill-mining}/plugin.xml | 4 +- .../{mining => skill-mining}/respawn.rb | 0 6 files changed, 23 insertions(+), 23 deletions(-) rename data/plugins/{mining => skill-mining}/gem.rb (100%) rename data/plugins/{mining => skill-mining}/mining.rb (73%) rename data/plugins/{mining => skill-mining}/ore.rb (100%) rename data/plugins/{mining => skill-mining}/pickaxe.rb (100%) rename data/plugins/{mining => skill-mining}/plugin.xml (93%) rename data/plugins/{mining => skill-mining}/respawn.rb (100%) diff --git a/data/plugins/mining/gem.rb b/data/plugins/skill-mining/gem.rb similarity index 100% rename from data/plugins/mining/gem.rb rename to data/plugins/skill-mining/gem.rb diff --git a/data/plugins/mining/mining.rb b/data/plugins/skill-mining/mining.rb similarity index 73% rename from data/plugins/mining/mining.rb rename to data/plugins/skill-mining/mining.rb index b0425083..a1dae272 100644 --- a/data/plugins/mining/mining.rb +++ b/data/plugins/skill-mining/mining.rb @@ -10,8 +10,8 @@ ORE_SIZE = 1 class MiningAction < DistancedAction attr_reader :position, :ore, :counter, :started - def initialize(character, position, ore) - super 0, true, character, position, ORE_SIZE + def initialize(player, position, ore) + super 0, true, player, position, ORE_SIZE @position = position @ore = ore @started = false @@ -20,12 +20,12 @@ class MiningAction < DistancedAction def find_pickaxe PICKAXE_IDS.each do |id| - weapon = character.equipment.get EquipmentConstants::WEAPON + weapon = player.equipment.get EquipmentConstants::WEAPON if weapon.id == id return PICKAXES[id] end - if character.inventory.contains id + if player.inventory.contains id return PICKAXES[id] end end @@ -33,31 +33,31 @@ class MiningAction < DistancedAction return nil end - # starts the mining animation, sets counters/flags and turns the character to + # starts the mining animation, sets counters/flags and turns the player to # the ore def start_mine(pickaxe) @started = true - character.send_message "You swing your pick at the rock." - character.turn_to @position - character.play_animation pickaxe.animation + player.send_message "You swing your pick at the rock." + player.turn_to @position + player.play_animation pickaxe.animation @counter = pickaxe.pulses end def executeAction - skills = character.skill_set + skills = player.skill_set level = skills.get_skill(Skill::MINING).current_level pickaxe = find_pickaxe # verify the player can mine with their pickaxe if not (pickaxe != nil and level >= pickaxe.level) - character.send_message "You do not have a pickaxe for which you have the level to use." + player.send_message "You do not have a pickaxe for which you have the level to use." stop return end # verify the player can mine the ore if ore.level > level - character.send_message "You do not have the required level to mine this rock." + player.send_message "You do not have the required level to mine this rock." stop return end @@ -70,11 +70,11 @@ class MiningAction < DistancedAction if @counter == 0 # TODO: calculate the chance that the player can actually get the rock - if character.inventory.add ore.id + if player.inventory.add ore.id ore_def = ItemDefinition.lookup @ore.id # TODO: split off into some method name = ore_def.name.sub(/ ore$/, "").downcase - character.send_message "You manage to mine some #{name}." + player.send_message "You manage to mine some #{name}." skills.add_experience Skill::MINING, ore.exp # TODO: expire the rock end @@ -94,12 +94,12 @@ end class ExpiredProspectingAction < DistancedAction attr_reader :position - def initialize(character, position) - super 0, true, character, position, ORE_SIZE + def initialize(player, position) + super 0, true, player, position, ORE_SIZE end def executeAction - character.send_message "There is currently no ore available in this rock." + player.send_message "There is currently no ore available in this rock." stop end @@ -112,8 +112,8 @@ end class ProspectingAction < DistancedAction attr_reader :position, :ore - def initialize(character, position, ore) - super PROSPECT_PULSES, true, character, position, ORE_SIZE + def initialize(player, position, ore) + super PROSPECT_PULSES, true, player, position, ORE_SIZE @position = position @ore = ore @started = false @@ -123,13 +123,13 @@ class ProspectingAction < DistancedAction if not @started @started = true - character.send_message "You examine the rock for ores..." - character.turn_to @position + player.send_message "You examine the rock for ores..." + player.turn_to @position else ore_def = ItemDefinition.lookup @ore.id name = ore_def.name.sub(/ ore$/, "").downcase - character.send_message "This rock contains #{name}." + player.send_message "This rock contains #{name}." stop end diff --git a/data/plugins/mining/ore.rb b/data/plugins/skill-mining/ore.rb similarity index 100% rename from data/plugins/mining/ore.rb rename to data/plugins/skill-mining/ore.rb diff --git a/data/plugins/mining/pickaxe.rb b/data/plugins/skill-mining/pickaxe.rb similarity index 100% rename from data/plugins/mining/pickaxe.rb rename to data/plugins/skill-mining/pickaxe.rb diff --git a/data/plugins/mining/plugin.xml b/data/plugins/skill-mining/plugin.xml similarity index 93% rename from data/plugins/mining/plugin.xml rename to data/plugins/skill-mining/plugin.xml index f6f6fe75..ed134dd0 100644 --- a/data/plugins/mining/plugin.xml +++ b/data/plugins/skill-mining/plugin.xml @@ -1,6 +1,6 @@ - mining + skill-mining 1 Mining Adds the mining skill. @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/data/plugins/mining/respawn.rb b/data/plugins/skill-mining/respawn.rb similarity index 100% rename from data/plugins/mining/respawn.rb rename to data/plugins/skill-mining/respawn.rb