mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
Update all plugins to conform to Rubocop.
This commit is contained in:
@@ -3,8 +3,9 @@ java_import 'org.apollo.game.model.entity.SkillSet'
|
||||
java_import 'org.apollo.game.model.entity.Skill'
|
||||
|
||||
# Maximises the player's skill set.
|
||||
on :command, :max, RIGHTS_ADMIN do |player, command|
|
||||
on :command, :max, RIGHTS_ADMIN do |player, _command|
|
||||
skills = player.skill_set
|
||||
|
||||
(0...skills.size).each do |skill|
|
||||
skills.add_experience(skill, SkillSet::MAXIMUM_EXP)
|
||||
end
|
||||
@@ -13,15 +14,16 @@ end
|
||||
# Levels the specified skill to the specified level, optionally updating the current level as well.
|
||||
on :command, :level, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless (2..3).include?(args.length) && (0..20).include?(skill_id = args[0].to_i) && (1..99).include?(level = args[1].to_i)
|
||||
player.send_message("Invalid syntax - ::level [skill-id] [level]")
|
||||
unless (2..3).include?(args.length) && (0..20).include?(skill_id = args[0].to_i) &&
|
||||
(1..99).include?(level = args[1].to_i)
|
||||
player.send_message('Invalid syntax - ::level [skill-id] [level]')
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
experience = SkillSet.experience_for_level(level)
|
||||
current = level
|
||||
|
||||
if args.length == 3 && args[2].to_s == "old"
|
||||
if args.length == 3 && args[2].to_s == 'old'
|
||||
skill = player.skill_set.skill(skill_id)
|
||||
current = skill.current_level
|
||||
end
|
||||
@@ -32,10 +34,11 @@ end
|
||||
# Adds the specified amount of experience to the specified skill.
|
||||
on :command, :xp, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
unless args.length == 2 && (0..20).include?(skill_id = args[0].to_i) && (experience = args[1].to_i) >= 0
|
||||
player.send_message("Invalid syntax - ::xp [skill-id] [experience]")
|
||||
unless args.length == 2 && (0..20).include?(skill_id = args[0].to_i) &&
|
||||
(experience = args[1].to_i) >= 0
|
||||
player.send_message('Invalid syntax - ::xp [skill-id] [experience]')
|
||||
return
|
||||
end
|
||||
|
||||
player.skill_set.add_experience(skill_id, experience)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user