Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def randMMD(minValue=4, maxValue=6, decimals=2):
- return round(random.uniform(minValue,maxValue), decimals)
- class Monster:
- def __init__(self, name, age, damage, attackspeed, defence, hp, dodge, crit, movementspeed ):
- self.name = name
- self.age = age
- self.damage = damage
- self.attackspeed = attackspeed
- self.defence = defence
- self.maxhp = hp
- self.hp = hp
- self.dodge = dodge
- self.crit = crit
- self.movementspeed = movementspeed
- def myfunc(self):
- def randMMD(minValue=4, maxValue=6, decimals=2):
- return round(random.uniform(minValue,maxValue), decimals)
- damage = randMMD()
- attackspeed = randMMD()
- defence = randMMD()
- hp = randMMD()
- dodge = randMMD()
- crit = randMMD()
- movementspeed = randMMD()
- m1 = Monster("Frankenstein", "1", damage, attackspeed, defence, hp, dodge, crit, movementspeed )
- m1.myfunc()
- print("Name : " + m1.name )
- print("Age : " + m1.age )
- print("Damage : " + str(damage))
- print("Attack speed : " + str(attackspeed))
- print("Defence : " + str(defence))
- print("HP : " + str(hp))
- print("Dodge : " + str(dodge))
- print("Critical chance : " + str(crit))
- print("Movement speed : " + str(movementspeed))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement