module AR
  module Game

    class Shield < PieceOfEquipment
      attr_accessor :block_rating
      def initialize id=nil
        super 
        self.block_rating = 1

        self.on_equipped = Proc.new do |equipper|

        end

        self.on_unequipped = Proc.new do |equipper|

        end

        self.on_equipped = Proc.new do |equipper|
          equipper.defense_techniques.push (AR::Game::BlockTech.new)
          nil
        end

        self.on_unequipped = Proc.new do |equipper|
          tech = equipper.defense_techniques.select{|t| t.class == AR::Game::BlockTech}.last
          equipper.defense_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
