コード例 #1
0
ファイル: Clement.py プロジェクト: jsexauer/ItBuildsCharacter
# Weapons
wep1 = Weapon("+1 Tidewater Cutless",
                        Attack(1, "1d6+1", [18,19,20]))
c.equipment.main_hand = wep1

wep2 = Weapon("+1 Keen Mwk Handaxe", Attack(1, "1d6+1", [19,20], 3))
c.equipment.off_hand = wep2

wep3 = Weapon("+1 Vindictive Harpoon", Attack(1, "1d8+1", ranged=True))
c.equipment.append(wep3)

wep4 = Weapon("Battleaxe", Attack(0, "1d8", [20], 3))
c.equipment.append(wep4)

# Feats
twf = Feat("Two Weapon Fighting")
twf.twf_mh = +2
twf.twf_oh = +6
c.feats.append(twf)

resilient = Feat("Resilient")
resilient.fort = 1
resilient.twf_mh = 0
resilient.twf_oh = 0
c.feats.append(resilient)

### Possible Buffs
pbl  =  [Buff('Favored Enemy (Human)',4,4),
             Buff('Favored Enemy (Monstrous Humanoid)',2,2),
             Buff('Bless',atk_mod=1),
             Buff('Prayer',atk_mod=1,dmg_mod=1),
コード例 #2
0
    def test_twf(self):
        # Two weapon fighting
        self.c.lvl = 6
        self.c.BAB = 6
        self.c.equipment.main_hand = self.w.short_sword
        self.c.equipment.off_hand = self.w.short_sword

        ##
        # No feat
        ##
        atks = self.c.attacks
        assert_equals(len(atks), 3)
        # first attack MH
        #  at +6 -plus -4 penalty for TWF w/o feat
        assert_equals(atks[0].atk, 6-4)
        # iterative attack MH
        #   at +1 plus -4 penalty for TWF w/o feat
        assert_equals(atks[1].atk, 1-4)
        # attack OH
        #  at +6 plus -8 penalty for TWF w/o feat
        assert_equals(atks[2].atk, 6-8)

        ##
        # Give ourselves two-weapon fighting
        ##
        twf = Feat("Two Weapon Fighting")
        twf.twf_mh = +2
        twf.twf_oh = +6
        self.c.feats.append(twf)

        atks = self.c.attacks
        assert_equals(len(atks), 3)
        # first attack MH
        #  at +6 -plus -2 penalty for TWF w/ feat
        assert_equals(atks[0].atk, 6-2)
        # iterative attack MH
        #   at +1 plus -2 penalty for TWF w/ feat
        assert_equals(atks[1].atk, 1-2)
        # attack OH
        #  at +6 plus -2 penalty for TWF w/ feat
        assert_equals(atks[2].atk, 6-2)

        ##
        # Give ourselves improved two-weapon fighting
        ##
        twf.twf_oh2 = True

        atks = self.c.attacks
        assert_equals(len(atks), 4)
        # first attack MH
        #  at +6 -plus -2 penalty for TWF w/ feat
        assert_equals(atks[0].atk, 6-2)
        # iterative attack MH
        #   at +1 plus -2 penalty for TWF w/ feat
        assert_equals(atks[1].atk, 1-2)
        # attack OH
        #  at +6 plus -2 penalty for TWF w/ feat
        assert_equals(atks[2].atk, 6-2)
        # iterative OH
        #  at +1 plus -2 penalty for TWF w/ feat
        assert_equals(atks[3].atk, 1-2)


        ##
        # Give ourselves greater two-weapon fighting
        ##
        twf.twf_oh3 = True

        atks = self.c.attacks
        assert_equals(len(atks), 5)
        # first attack MH
        #  at +6 -plus -2 penalty for TWF w/ feat
        assert_equals(atks[0].atk, 6-2)
        # iterative attack MH
        #   at +1 plus -2 penalty for TWF w/ feat
        assert_equals(atks[1].atk, 1-2)
        # attack OH
        #  at +6 plus -2 penalty for TWF w/ feat
        assert_equals(atks[2].atk, 6-2)
        # iterative OH
        #  at +1 plus -2 penalty for TWF w/ feat
        assert_equals(atks[3].atk, 1-2)
        # iterative OH #2
        #  at -4 plus -2 penalty for TWF w/ feat
        assert_equals(atks[4].atk, -4-2)