module AR
  module Game

    class ChitinSword < Weapon 
      def initialize id=nil
        super 
        #add_behavior AR::Game::SomeBehavior
        add_story_implement StoryImplement.new
        self.noun = "chitin sword"
        self.slot = :main_hand
        self.damage_dice = 8

        self.on_equipped = Proc.new do |equipper|
          equipper.attack_techniques.unshift (AR::Game::SlashTech.new)
          nil
        end

        self.on_unequipped = Proc.new do |equipper|
          tech = equipper.attack_techniques.select{|t| t.class == AR::Game::SlashTech}.last
          equipper.attack_techniques.delete tech
          nil
        end


      end


      #sort of just a way to 'include' these classes, so you don't
      #need to fully qualify them.  There must be a better way...
      class Story < AR::Game::StoryBehavior::Story
      end
      class StoryImplement < AR::Game::StoryBehavior::StoryImplement
        def initialize stories=[]
          super
          #add stories like this:
          #s = Story.new when: AR::Events::Event, as: "participant" do |e|
          #end
          #add_story s
        end
      end

    end



  end
end


