mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Move AttackRequirement to separate source unit
This commit is contained in:
@@ -24,11 +24,19 @@ class SpecialEnergyRequirement < AttackRequirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
def validate!(player)
|
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
|
end
|
||||||
|
|
||||||
def apply(player)
|
def apply(player)
|
||||||
player.special_energy = player.special_energy - @amount
|
player.special_energy = player.special_energy - @amount
|
||||||
|
player.using_special = false
|
||||||
|
|
||||||
|
update_special_bar player
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user