Exemplo n.º 1
0
 def setUp(self):
     super(ItemEncumbranceTestCase, self).setUp()
     sample_char(self.char1, 'warrior', 'human', 'cunning')
     self.obj1.db.desc = 'Test Obj'
     self.obj1.db.damage = 1
     self.obj1.db.weight = 1.0
     self.obj2.swap_typeclass('typeclasses.armors.Armor',
                              clean_attributes=True,
                              run_start_hooks="all")
     self.obj2.db.toughness = 1
     self.obj2.db.weight = 18.0
Exemplo n.º 2
0
 def setUp(self):
     super(ItemEncumbranceTestCase, self).setUp()
     sample_char(self.char1, 'warrior', 'human', 'cunning')
     self.obj1.db.desc = 'Test Obj'
     self.obj1.db.damage = 1
     self.obj1.db.weight = 1.0
     self.obj2.swap_typeclass('typeclasses.armors.Armor',
                              clean_attributes=True,
                              run_start_hooks="all")
     self.obj2.db.toughness = 1
     self.obj2.db.weight = 18.0
Exemplo n.º 3
0
    def setUp(self):
        super(AppraiseTestCase, self).setUp()
        sample_char(self.char1, 'arcanist', 'elf', 'spirit')

        self.obj1.db.weight = 1
        self.obj1.db.damage = 2
        self.obj1.db.toughness = 3
        self.obj1.db.range = 4
        self.obj1.db.value = 150

        self.obj2.db.weight = 1
        self.obj2.db.damage = 2
        self.obj2.db.toughness = 3
        self.obj2.db.range = 4
        self.obj2.db.value = 150
Exemplo n.º 4
0
    def setUp(self):
        super(AppraiseTestCase, self).setUp()
        sample_char(self.char1, 'arcanist', 'elf', 'spirit')

        self.obj1.db.weight = 1
        self.obj1.db.damage = 2
        self.obj1.db.toughness = 3
        self.obj1.db.range = 4
        self.obj1.db.value = 150

        self.obj2.db.weight = 1
        self.obj2.db.damage = 2
        self.obj2.db.toughness = 3
        self.obj2.db.range = 4
        self.obj2.db.value = 150
Exemplo n.º 5
0
    def setUp(self):
        settings.PROTOTYPE_MODULES = ainneve_settings.PROTOTYPE_MODULES
        self.character_typeclass = Character
        self.object_typeclass = NPC
        self.room_typeclass = Room
        self.script_typeclass = CombatHandler
        super(AinneveCombatTest, self).setUp()
        # create weapons for the fight
        self.melee = spawn({'prototype': 'SHORT_SWORD',
                            'location': self.room1},
                           prototype_modules=('world.content.prototypes_weapons',))[0]
        self.reach = spawn({'prototype': 'PIKE_POLEARM',
                            'location': self.room1},
                           prototype_modules=('world.content.prototypes_weapons',))[0]
        self.ranged = spawn({'prototype': 'LONG_BOW',
                             'location': self.room1},
                            prototype_modules=('world.content.prototypes_weapons',))[0]
        self.arrows = spawn({'prototype': 'ARROW_BUNDLE',
                             'location': self.room1},
                            prototype_modules=('world.content.prototypes_weapons',))[0]
        # set up chars
        sample_char(self.char1, 'warrior', 'human', 'cunning')
        self.char1.traits.ATKM.base = self.char1.traits.ATKR.base = self.char1.traits.ATKU.base = 5
        sample_char(self.char2, 'warrior', 'human', 'cunning')
        self.char2.traits.HP.base = self.char2.traits.HP.current = 10
        # one additional NPC
        self.obj3 = create.create_object(self.object_typeclass, key="Obj3", location=self.room1, home=self.room1)

        # set sdescs to key for testing
        self.char1.sdesc.add(self.char1.key)
        self.char2.sdesc.add(self.char2.key)
        self.obj1.sdesc.add(self.obj1.key)
        self.obj2.sdesc.add(self.obj2.key)
        self.obj3.sdesc.add(self.obj3.key)
        # use mock msg methods
        self.char1.msg = Mock()
        self.char2.msg = Mock()
        self.obj1.msg = Mock()
        self.obj2.msg = Mock()
        self.obj3.msg = Mock()
        # add combatants
        self.script.add_character(self.char1)
        self.script.add_character(self.char2)
        self.script.add_character(self.obj1)
        self.script.add_character(self.obj2)
        self.script.add_character(self.obj3)
Exemplo n.º 6
0
    def setUp(self):
        settings.PROTOTYPE_MODULES = ainneve_settings.PROTOTYPE_MODULES
        self.character_typeclass = Character
        self.object_typeclass = NPC
        self.room_typeclass = Room
        self.script_typeclass = CombatHandler
        super(AinneveCombatTest, self).setUp()
        # create weapons for the fight
        self.melee = spawn({'prototype': 'SHORT_SWORD',
                            'location': self.room1},
                           prototype_modules=('world.content.prototypes_weapons',))[0]
        self.reach = spawn({'prototype': 'PIKE_POLEARM',
                            'location': self.room1},
                           prototype_modules=('world.content.prototypes_weapons',))[0]
        self.ranged = spawn({'prototype': 'LONG_BOW',
                             'location': self.room1},
                            prototype_modules=('world.content.prototypes_weapons',))[0]
        self.arrows = spawn({'prototype': 'ARROW_BUNDLE',
                             'location': self.room1},
                            prototype_modules=('world.content.prototypes_weapons',))[0]
        # set up chars
        sample_char(self.char1, 'warrior', 'human', 'cunning')
        self.char1.traits.ATKM.base = self.char1.traits.ATKR.base = self.char1.traits.ATKU.base = 5
        sample_char(self.char2, 'warrior', 'human', 'cunning')
        self.char2.traits.HP.base = self.char2.traits.HP.current = 10
        # one additional NPC
        self.obj3 = create.create_object(self.object_typeclass, key="Obj3", location=self.room1, home=self.room1)

        # set sdescs to key for testing
        self.char1.sdesc.add(self.char1.key)
        self.char2.sdesc.add(self.char2.key)
        self.obj1.sdesc.add(self.obj1.key)
        self.obj2.sdesc.add(self.obj2.key)
        self.obj3.sdesc.add(self.obj3.key)
        # use mock msg methods
        self.char1.msg = Mock()
        self.char2.msg = Mock()
        self.obj1.msg = Mock()
        self.obj2.msg = Mock()
        self.obj3.msg = Mock()
        # add combatants
        self.script.add_character(self.char1)
        self.script.add_character(self.char2)
        self.script.add_character(self.obj1)
        self.script.add_character(self.obj2)
        self.script.add_character(self.obj3)
Exemplo n.º 7
0
 def setUp(self):
     super(MovementTestCase, self).setUp()
     sample_char(self.char1, 'warrior', 'human', 'cunning')
     self.char1.msg = Mock()
Exemplo n.º 8
0
 def setUp(self):
     super(DescriptionTestCase, self).setUp()
     sample_char(self.char1, 'warrior', 'human', 'cunning')
     sample_char(self.char2, 'arcanist', 'elf', 'alertness')
     self.char1.msg = Mock()
     self.char2.msg = Mock()