Add support for combat related UI

* Allows switching between different combat styles, and updates the
  combat tabs styles for every equipped weapon. If a weapon with a
  special attack is equipped, the special bar for that interface will be
  shown.

* Adds a scheduled task which periodically restores special energy to
  the player and updates their special bar.
This commit is contained in:
Gary Tierney
2015-12-24 05:10:43 +00:00
parent c9592c38df
commit 5686a1dcd6
2 changed files with 93 additions and 0 deletions
@@ -0,0 +1,23 @@
java_import 'org.apollo.game.message.impl.ConfigMessage'
def update_special_bar(player)
player.send(ConfigMessage.new(300, player.special_energy * 10)) # special energy
player.send(ConfigMessage.new(301, player.using_special ? 1 : 0)) # special enabled
end
on :login do |event|
player = event.player
update_special_bar player
schedule 25 do |task|
unless player.is_active
task.stop
next
end
player.special_energy = [player.special_energy + 5, 100].min
update_special_bar player
end
end