mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-12-06 03:07:19 +00:00
Move AttackRequirement to separate source unit
This commit is contained in:
1 parent
5686a1dcd6
commit
04df65be4c
1 file changed
+9
-1
@@ -24,11 +24,19 @@ class SpecialEnergyRequirement < AttackRequirement
|
||||
end
|
||||
|
||||
def validate!(player)
|
||||
throw AttackRequirementException.new('Not enough special attack energy.') unless player.special_energy >= @amount
|
||||
if player.special_energy < @amount
|
||||
player.using_special = false
|
||||
|
||||
update_special_bar(player)
|
||||
raise AttackRequirementException.new('Not enough special attack energy.')
|
||||
end
|
||||
end
|
||||
|
||||
def apply(player)
|
||||
player.special_energy = player.special_energy - @amount
|
||||
player.using_special = false
|
||||
|
||||
update_special_bar player
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user