Update all plugins to conform to Rubocop.

This commit is contained in:
Major-
2015-08-27 18:17:58 +01:00
parent 424d2bda29
commit 8f3fd75b33
75 changed files with 1625 additions and 1537 deletions
+17 -12
View File
@@ -9,20 +9,22 @@ java_import 'org.apollo.game.model.entity.Player'
on :command, :lookup, RIGHTS_ADMIN do |player, command|
args = command.arguments.to_a
next unless valid_arg_length(args, (1..10), player, 'Invalid syntax - ::lookup [npc/object/item] [name]')
message = 'Invalid syntax - ::lookup [npc/object/item] [name]'
next unless valid_arg_length(args, (1..10), player, message)
type = args.shift.downcase
limit = args.first.to_i == 0 ? 5 : args.shift.to_i;
limit = args.first.to_i == 0 ? 5 : args.shift.to_i
name = args.join(' ').downcase
if ['npc', 'object', 'item'].index(type) == nil
player.send_message('Invalid syntax - ::lookup [npc/object/item] [name]')
if %w(npc object item).index(type).nil?
player.send_message('Invalid syntax - ::lookup [npc/object/item] [name]')
next
end
ids = find_entities(type, name, limit).join(', ')
message = ids.empty? ? "Could not find an #{type} called #{name}." : "Possible ids for \"#{name}\" are: #{ids}."
message = ids.empty? ? "Could not find an #{type} called #{name}." :
"Possible ids for \"#{name}\" are: #{ids}."
player.send_message(message)
end
@@ -35,7 +37,8 @@ on :command, :iteminfo, RIGHTS_ADMIN do |player, command|
definition = ItemDefinition.lookup(id)
members = definition.is_members_only ? 'members' : 'not members'
player.send_message("Item #{id} is called #{definition.name}, is #{members} only, and has a team of #{definition.team}.")
player.send_message("Item #{id} is called #{definition.name}, is #{members} only, and has a "\
"team of #{definition.team}.")
player.send_message("Its description is \"#{definition.description}\".")
end
@@ -46,7 +49,8 @@ on :command, :npcinfo, RIGHTS_ADMIN do |player, command|
id = args[0].to_i
definition = NpcDefinition.lookup(id)
is_combative = definition.has_combat_level ? "has a combat level of #{definition.combat_level}" : "does not have a combat level"
is_combative = definition.has_combat_level ? "has a combat level of #{definition.combat_level}" :
'does not have a combat level'
player.send_message("Npc #{id} is called #{definition.name} and #{is_combative}.")
player.send_message("Its description is \"#{definition.description}\".")
@@ -59,6 +63,7 @@ on :command, :objectinfo, RIGHTS_ADMIN do |player, command|
id = args[0].to_i
definition = ObjectDefinition.lookup(id)
player.send_message("Object #{id} is called #{definition.name} and its description is \"#{definition.description}\".")
player.send_message("Object #{id} is called #{definition.name} and its description is "\
"\"#{definition.description}\".")
player.send_message("Its width is #{definition.width} and its length is #{definition.length}.")
end
end