def rollDamage(self): if self.ammo > 0: hitDam = roll(self.damage) self.ammo = self.ammo - 1 logging.debug('DAMAGE: Weapon rolled {} damage'.format(hitDam)) else: logging.info('Combat: CLICK! {} is out of ammo! Choose a different weapon next time.'.format(self.name)) hitDam = 0 return hitDam
#!/usr/bin/env python # script to test various skill checks import logging from cthulhu.skill import skill from cthulhu.roll import roll logging.basicConfig(format='%(message)s', level=logging.DEBUG) #testskill = skill('Spot Hidden', 65) #testskill.dump() #testskill.check() #otherskill = skill('Sneak', 25) #testskill.opposedSkill(otherskill) roll('1d6+1d6', max=True)
def maxDamage(self): mDam = roll(self.damage, max=True) return mDam
def rollDamage(self): hitDam = roll(self.damage) logging.debug('DAMAGE: Weapon rolled {} damage'.format(hitDam)) return hitDam
#!/usr/bin/env python # script to create a test character import logging from cthulhu.char import character, json_import from cthulhu.roll import roll logging.basicConfig(format='%(message)s', level=logging.INFO) newChar = character('Tyler') for characteristic in ['STR', 'DEX', 'APP', 'CON', 'POW']: newChar.setCharacteristic(characteristic, roll('3d6*5')) for characteristic in ['INT', 'SIZ', 'EDU']: newChar.setCharacteristic(characteristic, roll('2d6+6*5')) newChar.luck = roll('2d6+6*5') newChar.setSecondary() newChar.setSkill('Spot Hidden', 70) newChar.setSkill('Fighting (Brawl)', 55) newChar.setSkill('Firearms (handgun)', 55) newChar.setSkill('Sneak', 40) newChar.setSkill('Listen', 55) newChar.setSkill('Sleight of Hand', 25) newChar.addWeapon('Unarmed', '1d3', 'Fighting (Brawl)', 'non-impaling',
#!/usr/bin/env python # script to create a test character import logging from cthulhu.char import character, json_import from cthulhu.roll import roll logging.basicConfig(format='%(message)s', level=logging.INFO) newChar = character('Tyler') for characteristic in ['STR', 'DEX', 'APP', 'CON', 'POW']: newChar.setCharacteristic(characteristic, roll('3d6*5')) for characteristic in ['INT', 'SIZ', 'EDU']: newChar.setCharacteristic(characteristic, roll('2d6+6*5')) newChar.luck = roll('2d6+6*5') newChar.setSecondary() newChar.setSkill('Spot Hidden', 70) newChar.setSkill('Fighting (Brawl)', 55) newChar.setSkill('Firearms (handgun)', 55) newChar.setSkill('Sneak', 40) newChar.setSkill('Listen', 55) newChar.setSkill('Sleight of Hand', 25) newChar.addWeapon('Unarmed', '1d3', 'Fighting (Brawl)', 'non-impaling', db=True) #newChar.addWeapon('Machete', '1d8', 'Fighting (Brawl)', 'penetrating', db=True) newChar.addWeapon('.38 Automatic', '1d10', 'Firearms (handgun)', 'firearm', db=False, mal=99, ammo=8, numAttacks=3)
#!/usr/bin/env python # Test script to create a Byakhee monster import logging from cthulhu.char import monster, json_import from cthulhu.roll import roll from cthulhu.weapon import weapon logging.basicConfig(format='%(message)s', level=logging.INFO) byakhee = monster('Byakhee') for characteristic in ['STR', 'SIZ']: byakhee.setCharacteristic(characteristic, roll('5d6*5')) for characteristic in ['CON', 'INT', 'POW']: byakhee.setCharacteristic(characteristic, roll('3d6*5')) byakhee.setCharacteristic('DEX', roll('3d6+3*5')) byakhee.setDodge() byakhee.HP = 14 byakhee.maxHP = 14 byakhee.db = '1d6' byakhee.build = 2 byakhee.mp = 10 byakhee.sanLoss = '1/1d6' byakhee.armor = 2 byakhee.numAttacks = 2