mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 00:38:11 +00:00
Update all plugins to conform to Rubocop.
This commit is contained in:
@@ -3,32 +3,33 @@ require 'java'
|
||||
java_import 'org.apollo.game.message.impl.HintIconMessage'
|
||||
java_import 'org.apollo.game.message.impl.SwitchTabInterfaceMessage'
|
||||
|
||||
|
||||
private
|
||||
|
||||
# The ids of tabs that are displayed when the player has yet to start the tutorial.
|
||||
INITIAL_TABS = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2449, 904, -1, -1 ]
|
||||
INITIAL_TABS = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2449, 904, -1, -1]
|
||||
|
||||
# The character design interface id.
|
||||
CHARACTER_DESIGN = 3559
|
||||
|
||||
# The Runescape guide Npc
|
||||
@runescape_guide = spawn_npc :name => :runescape_guide, :x => 3093, :y => 3107
|
||||
@runescape_guide = spawn_npc name: :runescape_guide, x: 3093, y: 3107
|
||||
|
||||
# Sends the appropriate data to the client when the player logs in to the game.
|
||||
on :login do |event, player|
|
||||
if player.in_tutorial_island
|
||||
# TutorialInstructions::show_instruction(player)
|
||||
# INITIAL_TABS.each_with_index { |tab, index| player.send(SwitchTabInterfaceMessage.new(index, tab)) }
|
||||
on :login do |_event, player|
|
||||
if player.in_tutorial_island && player.privilege_level != RIGHTS_ADMIN
|
||||
TutorialInstructions.show_instruction(player)
|
||||
|
||||
if (player.tutorial_island_progress == :not_started)
|
||||
INITIAL_TABS.each_with_index do |tab, index|
|
||||
player.send(SwitchTabInterfaceMessage.new(index, tab))
|
||||
end
|
||||
|
||||
if player.tutorial_island_progress == :not_started
|
||||
show_hint_icon(player)
|
||||
player.interface_set.open_window(CHARACTER_DESIGN)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# The conversation with the Runescape Guide, when on tutorial island.
|
||||
conversation :tutorial_runescape_guide do
|
||||
|
||||
@@ -36,63 +37,66 @@ conversation :tutorial_runescape_guide do
|
||||
dialogue :greetings do
|
||||
type :npc_speech
|
||||
npc :runescape_guide
|
||||
|
||||
|
||||
precondition { |player| player.tutorial_island_progress == :not_started }
|
||||
|
||||
text "Greetings! I see you are a new arrival to this land. My job is to welcome all new visitors. So welcome!"
|
||||
text 'Greetings! I see you are a new arrival to this land. My job is to welcome all new '\
|
||||
'visitors. So welcome!'
|
||||
|
||||
continue :dialogue => :talk_to_people do |player|
|
||||
continue dialogue: :talk_to_people do |player|
|
||||
player.tutorial_island_progress = :talk_to_people
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# The Guide welcomes back the Player if they speak to him after they have already gone through the conversation once.
|
||||
# The Guide welcomes back the Player if they speak to him after they have already gone through
|
||||
# the conversation once.
|
||||
dialogue :welcome_back do
|
||||
type :npc_speech
|
||||
npc :runescape_guide
|
||||
|
||||
precondition { |player| player.tutorial_island_progress != :not_started }
|
||||
|
||||
text "Welcome back."
|
||||
text 'Welcome back.'
|
||||
|
||||
continue :dialogue => :talk_to_people
|
||||
continue dialogue: :talk_to_people
|
||||
end
|
||||
|
||||
|
||||
# The Guide tells Players to speak to people in order to succeed.
|
||||
dialogue :talk_to_people do
|
||||
type :npc_speech
|
||||
npc :runescape_guide
|
||||
|
||||
text "You have already learned the first thing you need to succeed in this world: talking to people!",
|
||||
"You will find many inhabitants of this world have useful things to say to you. By clicking on them with your mouse you can talk to them.",
|
||||
"I would also suggest reading through some of the supporting information on the website. There you can find maps, a bestiary, and much more."
|
||||
text 'You have already learned the first thing you need to succeed in this world: talking to '\
|
||||
'people!',
|
||||
'You will find many inhabitants of this world have useful things to say to you. By '\
|
||||
'clicking on them with your mouse you can talk to them.',
|
||||
'I would also suggest reading through some of the supporting information on the website.'\
|
||||
' There you can find maps, a bestiary, and much more.'
|
||||
|
||||
continue :dialogue => :go_through_door
|
||||
end
|
||||
continue dialogue: :go_through_door
|
||||
end
|
||||
|
||||
# The Guide tells Players to go through the door, advancing the tutorial progress if this is the first time the Player has heard this.
|
||||
# The Guide tells Players to go through the door, advancing the tutorial progress if this is the
|
||||
# first time the Player has heard this.
|
||||
dialogue :go_through_door do
|
||||
type :npc_speech
|
||||
npc :runescape_guide
|
||||
|
||||
text "To continue the tutorial go through that door over there, and speak to your first instructor."
|
||||
text 'To continue the tutorial go through that door over there, and speak to your first '\
|
||||
'instructor.'
|
||||
|
||||
close do |player|
|
||||
if (player.tutorial_island_progress < :runescape_guide_finished)
|
||||
if player.tutorial_island_progress < :runescape_guide_finished
|
||||
reset_hint_icon(player)
|
||||
# TODO door hint icon
|
||||
# TODO: door hint icon
|
||||
player.tutorial_island_progress = :runescape_guide_finished
|
||||
end
|
||||
|
||||
TutorialInstructions.show_instruction(player)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
# Enables the hint icon above the Runescape guide.
|
||||
def show_hint_icon(player)
|
||||
player.send(HintIconMessage.for_npc(@runescape_guide.index))
|
||||
@@ -100,5 +104,5 @@ end
|
||||
|
||||
# Resets the hint icon.
|
||||
def reset_hint_icon(player)
|
||||
player.send(HintIconMessage.reset_npc())
|
||||
end
|
||||
player.send(HintIconMessage.reset_npc)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user