def Stomp(UnitList1, UnitList2, roundwnds1, roundwnds2, verbose): if len(UnitList2) > 1: for x in range(1, len(UnitList1)): if hasattr(UnitList1[x], 'Stomp'): roundwnds2 += ward( armor( wound(1, UnitList1[x].Strength, UnitList2[-1].Toughness, verbose), UnitList1[x].Strength, UnitList2[-1].ArmorPts, verbose), UnitList2[-1].WardPts, verbose) elif hasattr(UnitList1[x], 'ThunderStomp'): roundwnds2 += ward( armor( wound(random.randint(1, 6), UnitList1[x].Strength, UnitList2[-1].Toughness, verbose), UnitList1[x].Strength, UnitList2[-1].ArmorPts, verbose), UnitList2[-1].WardPts, verbose) if len(UnitList1) > 1: for x in range(1, len(UnitList2)): if hasattr(UnitList2[x], 'Stomp'): roundwnds1 += ward( armor( wound(1, UnitList2[x].Strength, UnitList1[-1].Toughness, verbose), UnitList2[x].Strength, UnitList1[-1].ArmorPts, verbose), UnitList1[-1].WardPts, verbose) elif hasattr(UnitList2[x], 'ThunderStomp'): roundwnds1 += ward( armor( wound(random.randint(1, 6), UnitList2[x].Strength, UnitList1[-1].Toughness, verbose), UnitList2[x].Strength, UnitList1[-1].ArmorPts, verbose), UnitList1[-1].WardPts, verbose) return roundwnds1, roundwnds2
def Stomp(UnitList1,UnitList2,roundwnds1,roundwnds2,verbose): if len(UnitList2) > 1: for x in range(1,len(UnitList1)): if hasattr(UnitList1[x],'Stomp'): roundwnds2 += ward(armor(wound(1,UnitList1[x].Strength,UnitList2[-1].Toughness,verbose),UnitList1[x].Strength,UnitList2[-1].ArmorPts,verbose),UnitList2[-1].WardPts,verbose) elif hasattr(UnitList1[x],'ThunderStomp'): roundwnds2 += ward(armor(wound(random.randint(1,6),UnitList1[x].Strength,UnitList2[-1].Toughness,verbose),UnitList1[x].Strength,UnitList2[-1].ArmorPts,verbose),UnitList2[-1].WardPts,verbose) if len(UnitList1) > 1: for x in range(1,len(UnitList2)): if hasattr(UnitList2[x],'Stomp'): roundwnds1 += ward(armor(wound(1,UnitList2[x].Strength,UnitList1[-1].Toughness,verbose),UnitList2[x].Strength,UnitList1[-1].ArmorPts,verbose),UnitList1[-1].WardPts,verbose) elif hasattr(UnitList2[x],'ThunderStomp'): roundwnds1 += ward(armor(wound(random.randint(1,6),UnitList2[x].Strength,UnitList1[-1].Toughness,verbose),UnitList2[x].Strength,UnitList1[-1].ArmorPts,verbose),UnitList1[-1].WardPts,verbose) return roundwnds1,roundwnds2;
def attack(AttackUnit,DefenseModel,AttackingModelsList,verbose): kills = 0 for x in range(len(AttackingModelsList)): if hasattr(AttackUnit[AttackingModelsList[x]],'JunglePoisons') or hasattr(AttackUnit[AttackingModelsList[x]],'PoisonedAttacks'): kills += PoisonedAttacks(AttackUnit,DefenseModel,AttackingModelsList,x,verbose) elif hasattr(AttackUnit[AttackingModelsList[x]],'Blood-frenzy') and hasattr(AttackUnit[AttackingModelsList[x]],'UltimatePredator'): kills += CarnosaurAttacks(AttackUnit,DefenseModel,AttackingModelsList,x,verbose) else: if x <AttackUnit[0].Width: kills += ward(armor(wound(hit(AttackUnit[AttackingModelsList[x]].Attacks,AttackUnit[AttackingModelsList[x]].WeaponSkill,DefenseModel.WeaponSkill,verbose)[0],AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.Toughness,verbose),AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) else: kills += ward(armor(wound(hit(1,AttackUnit[AttackingModelsList[x]].WeaponSkill,DefenseModel.WeaponSkill,verbose)[0],AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.Toughness,verbose),AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) if verbose >= 3: print kills, "Wounds Total" return kills;
def PoisonedAttacks(AttackUnit,DefenseModel,AttackingModelsList,x,verbose): if x <AttackUnit[0].Width: Hits,ToHitRolls = hit(AttackUnit[AttackingModelsList[x]].Attacks,AttackUnit[AttackingModelsList[x]].WeaponSkill,DefenseModel.WeaponSkill,verbose) for y in range(Hits): if ToHitRolls[y] == 6: if verbose >=4: print "Poisoned Attack Landed! Automatic Wound!" kills += ward(armor(1,AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) else: kills += ward(armor(wound(1,AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.Toughness,verbose),AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) else: Hits,ToHitRolls = hit(1,AttackUnit[AttackingModelsList[x]].WeaponSkill,DefenseModel.WeaponSkill,verbose) for y in range(Hits): if ToHitRolls[y] == 6: kills += ward(armor(1,AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) else: kills += ward(armor(wound(1,AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.Toughness,verbose),AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose)
def attack(AttackUnit, DefenseModel, AttackingModelsList, verbose): kills = 0 for x in range(len(AttackingModelsList)): if hasattr(AttackUnit[AttackingModelsList[x]], 'JunglePoisons') or hasattr( AttackUnit[AttackingModelsList[x]], 'PoisonedAttacks'): kills += PoisonedAttacks(AttackUnit, DefenseModel, AttackingModelsList, x, verbose) elif hasattr(AttackUnit[AttackingModelsList[x]], 'Blood-frenzy') and hasattr( AttackUnit[AttackingModelsList[x]], 'UltimatePredator'): kills += CarnosaurAttacks(AttackUnit, DefenseModel, AttackingModelsList, x, verbose) else: if x < AttackUnit[0].Width: kills += ward( armor( wound( hit(AttackUnit[AttackingModelsList[x]].Attacks, AttackUnit[AttackingModelsList[x]].WeaponSkill, DefenseModel.WeaponSkill, verbose)[0], AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.Toughness, verbose), AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) else: kills += ward( armor( wound( hit(1, AttackUnit[AttackingModelsList[x]].WeaponSkill, DefenseModel.WeaponSkill, verbose)[0], AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.Toughness, verbose), AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) if verbose >= 3: print kills, "Wounds Total" return kills
def HatredAttacks(Def,verbose): """ Attacks made with Hatred of the opponent can reroll misses. Most opponents have normal hatred which can only be applied in the first round of combat. This rule is intended to be used beside a normal attack, and only applied in the first round of combat. """ hits,rolls = hit(self.Ata,self.WepS,Def.WepS,verbose) hits += hit(self.Ata-hits,self.WepS,Def.WepS,verbose)[0] return ward(armor(wound(hits,self.Str,Def.Tuf,verbose),self.Str,Def.Armr,verbose),Def.Ward,verbose)
def CarnosaurAttacks(AttackUnit,DefenseModel,AttackingModelsList,x,verbose): wounds = ward(armor(wound(hit(AttackUnit[AttackingModelsList[x]].Attacks,AttackUnit[AttackingModelsList[x]].WeaponSkill,DefenseModel.WeaponSkill,verbose)[0],AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.Toughness,verbose),AttackUnit[AttackingModelsList[x]].Strength,DefenseModel.ArmorPts,verbose),DefenseModel.WardPts,verbose) if wounds > 0 and not hasattr(AttackUnit[AttackingModelsList[x]],'Frenzy'): setattr(AttackUnit[AttackingModelsList[x]],'Frenzy',2) AttackUnit[AttackingModelsList[x]].Attacks += 1 kills = 0 for x in range(wounds): kills += random.randint(1,3) if verbose >= 3: print kills, "Carnosaur Wounds Total" return kills;
def PoisonedAttack(Def, verbose): """ Poisoned Attacks; any dice which hits on a 6 automatically wounds """ wounds = 0 hits, rolls = hit(self.Ata, self.WepS, Def.WepS, verbose) for dice in rolls: if dice == 6: wounds += 1 hits -= 1 wounds += wound(hits, self.Str, Def.Tuf, verbose) return ward(armor(wounds, self.Str, Def.Armr), Def.Ward)
def PoisonedAttack(Def,verbose): """ Poisoned Attacks; any dice which hits on a 6 automatically wounds """ wounds = 0 hits,rolls = hit(self.Ata,self.WepS,Def.WepS,verbose) for dice in rolls: if dice == 6: wounds += 1 hits -= 1 wounds += wound(hits,self.Str,Def.Tuf,verbose) return ward(armor(wounds,self.Str,Def.Armr),Def.Ward)
def HatredAttacks(Def, verbose): """ Attacks made with Hatred of the opponent can reroll misses. Most opponents have normal hatred which can only be applied in the first round of combat. This rule is intended to be used beside a normal attack, and only applied in the first round of combat. """ hits, rolls = hit(self.Ata, self.WepS, Def.WepS, verbose) hits += hit(self.Ata - hits, self.WepS, Def.WepS, verbose)[0] return ward( armor(wound(hits, self.Str, Def.Tuf, verbose), self.Str, Def.Armr, verbose), Def.Ward, verbose)
def PoisonedAttacks(AttackUnit, DefenseModel, AttackingModelsList, x, verbose): if x < AttackUnit[0].Width: Hits, ToHitRolls = hit(AttackUnit[AttackingModelsList[x]].Attacks, AttackUnit[AttackingModelsList[x]].WeaponSkill, DefenseModel.WeaponSkill, verbose) for y in range(Hits): if ToHitRolls[y] == 6: if verbose >= 4: print "Poisoned Attack Landed! Automatic Wound!" kills += ward( armor(1, AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) else: kills += ward( armor( wound(1, AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.Toughness, verbose), AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) else: Hits, ToHitRolls = hit(1, AttackUnit[AttackingModelsList[x]].WeaponSkill, DefenseModel.WeaponSkill, verbose) for y in range(Hits): if ToHitRolls[y] == 6: kills += ward( armor(1, AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) else: kills += ward( armor( wound(1, AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.Toughness, verbose), AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose)
def Attack( Def, verbose, ): """ The generic Attack model, which has no special rules applied to it. """ return ward( armor( wound( hit(self.Ata, self.WepS, Def.WepS, verbose)[0], self.Str, Def.Tuf, verbose), self.Str, Def.Tuf, verbose), Def.Ward, verbose)
def CarnosaurAttacks(AttackUnit, DefenseModel, AttackingModelsList, x, verbose): wounds = ward( armor( wound( hit(AttackUnit[AttackingModelsList[x]].Attacks, AttackUnit[AttackingModelsList[x]].WeaponSkill, DefenseModel.WeaponSkill, verbose)[0], AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.Toughness, verbose), AttackUnit[AttackingModelsList[x]].Strength, DefenseModel.ArmorPts, verbose), DefenseModel.WardPts, verbose) if wounds > 0 and not hasattr(AttackUnit[AttackingModelsList[x]], 'Frenzy'): setattr(AttackUnit[AttackingModelsList[x]], 'Frenzy', 2) AttackUnit[AttackingModelsList[x]].Attacks += 1 kills = 0 for x in range(wounds): kills += random.randint(1, 3) if verbose >= 3: print kills, "Carnosaur Wounds Total" return kills
def Attack(Def,verbose,): """ The generic Attack model, which has no special rules applied to it. """ return ward(armor(wound(hit(self.Ata,self.WepS,Def.WepS,verbose)[0],self.Str,Def.Tuf,verbose),self.Str,Def.Tuf,verbose),Def.Ward,verbose)