Add Attack / AttackRequirement docs

This commit is contained in:
Gary Tierney
2016-01-29 22:12:13 +00:00
parent 27e06c304d
commit a7b4036deb
6 changed files with 63 additions and 24 deletions
+7 -6
View File
@@ -20,24 +20,25 @@ end
on :message, :magic_on_mob do |player, message|
target = $world.npc_repository.get(message.index)
next unless SPELLBOOKS.has_key? message.interface_id
player_combat_state = player.get_combat_state
player_combat_state.target = target
spellbook = spellbook_for(message.interface_id)
spellbook = SPELLBOOKS[message.interface_id]
spell = spell_for(spellbook, message.spell_id)
player_combat_state.queue_attack(spell.attack)
player.walking_queue.clear
player.start_action CombatAction.new(player)
magic_attack = MagicAttack.new(spell)
player_combat_state.queue_attack(magic_attack)
player.start_action CombatAction.new(player, true)
end
on :message, :player_action do |player, message|
end
## TODO: another way of handling this
schedule 0 do |_task|
$world.player_repository.each { |player| player.attack_timer = player.attack_timer + 1 }
$world.npc_repository.each { |npc| npc.attack_timer = npc.attack_timer + 1 }