Add more documentation and fix rubocop warnings

This commit is contained in:
Gary Tierney
2016-01-29 22:42:03 +00:00
parent a7b4036deb
commit 8e0b84a470
17 changed files with 77 additions and 80 deletions
+3 -5
View File
@@ -2,9 +2,7 @@ java_import 'org.apollo.game.model.entity.Mob'
module MobCombatState
def get_combat_state
if @combat_state.nil?
@combat_state = CombatState.new(self, true)
end
@combat_state = CombatState.new(self, true) if @combat_state.nil?
@combat_state
end
@@ -30,10 +28,10 @@ class CombatState
end
def will_attack?
is_attacking? && next_attack(true).speed >= @mob.attack_timer
attacking? && next_attack(true).speed >= @mob.attack_timer
end
def is_attacking?
def attacking?
!target.nil? && @mob.attacking
end