from math import ceil, floor
from random import choice
class cpuPlayer:
	def __init__(self, name, classType):
		self.health = int(classType.HP)
		self.name = name
		self.classType = classType
		self.moves = classType.moves
		self.damageTaken = 1
		self.ultCharge = -5
		print(f"{self.name}: HP = {self.health}, Class = {self.classType.name}")

	def takeDamage(self, d):
		damTak = int(self.damageTaken)
		damage = d * damTak
		damage = ceil(damage)
		self.health -= damage
		self.damageTaken = 1
		self.ultCharge += floor(self.ultCharge + (damage / 1.5))
		if self.ultCharge >= 30:
			self.ultCharge = 30
		if self.health <= 0:
			self.health = 0
	
	def ultDamage(self, d):
		damTak = int(self.damageTaken)
		damage = d * damTak
		damage = ceil(damage)
		self.health -= damage
		self.damageTaken = 1
		if self.health <= 0:
			self.health = 0

	def doHeal(self):
		healAmnt = self.damageTaken
		healAmnt = ceil(healAmnt)
		self.health += healAmnt
		if self.health > self.classType.HP:
			self.health = self.classType.HP

	def log(self, text):
		print(f"{self.name}: {text}")

	def prompt(self):
		print('\n')
		if self.health <= 0:
			self.health = 0
		if self.ultCharge == 30:
			selection = '4' # If ult available, use ult
		elif self.health <= (0.75 * self.classType.HP):
			selection = choice(['0','1']) # punch or kick/fireball/rock/smite/etc.
		elif self.health <= (0.5 * self.classType.HP):
			selection = choice(['0','1','2']) # same as above but can also block/heal
		elif self.health <= (0.1 * self.classType.HP):
			selection = choice(['2','3']) # in a pinch, block/heal or 'All-or-Nothing'
		else:
			selection = '0' # if no other case applies, punch
		
		mid = 0
		
		try:
			mid = int(selection)
		except:
			print('Invalid move!')
			return self.prompt()
		if mid >= len(self.moves) or mid < 0:
			print('Invalid move!')
			return self.prompt()
		return self.moves[mid]

9134ba5336baf59e65b9e32c2ec0cee751e0269f
<mask token>


class cpuPlayer:
    <mask token>

    def takeDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        self.ultCharge += floor(self.ultCharge + damage / 1.5)
        if self.ultCharge >= 30:
            self.ultCharge = 30
        if self.health <= 0:
            self.health = 0

    def ultDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        if self.health <= 0:
            self.health = 0
    <mask token>
    <mask token>
    <mask token>

<mask token>


class cpuPlayer:

    def __init__(self, name, classType):
        self.health = int(classType.HP)
        self.name = name
        self.classType = classType
        self.moves = classType.moves
        self.damageTaken = 1
        self.ultCharge = -5
        print(f'{self.name}: HP = {self.health}, Class = {self.classType.name}'
            )

    def takeDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        self.ultCharge += floor(self.ultCharge + damage / 1.5)
        if self.ultCharge >= 30:
            self.ultCharge = 30
        if self.health <= 0:
            self.health = 0

    def ultDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        if self.health <= 0:
            self.health = 0
    <mask token>
    <mask token>

    def prompt(self):
        print('\n')
        if self.health <= 0:
            self.health = 0
        if self.ultCharge == 30:
            selection = '4'
        elif self.health <= 0.75 * self.classType.HP:
            selection = choice(['0', '1'])
        elif self.health <= 0.5 * self.classType.HP:
            selection = choice(['0', '1', '2'])
        elif self.health <= 0.1 * self.classType.HP:
            selection = choice(['2', '3'])
        else:
            selection = '0'
        mid = 0
        try:
            mid = int(selection)
        except:
            print('Invalid move!')
            return self.prompt()
        if mid >= len(self.moves) or mid < 0:
            print('Invalid move!')
            return self.prompt()
        return self.moves[mid]

<mask token>


class cpuPlayer:

    def __init__(self, name, classType):
        self.health = int(classType.HP)
        self.name = name
        self.classType = classType
        self.moves = classType.moves
        self.damageTaken = 1
        self.ultCharge = -5
        print(f'{self.name}: HP = {self.health}, Class = {self.classType.name}'
            )

    def takeDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        self.ultCharge += floor(self.ultCharge + damage / 1.5)
        if self.ultCharge >= 30:
            self.ultCharge = 30
        if self.health <= 0:
            self.health = 0

    def ultDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        if self.health <= 0:
            self.health = 0
    <mask token>

    def log(self, text):
        print(f'{self.name}: {text}')

    def prompt(self):
        print('\n')
        if self.health <= 0:
            self.health = 0
        if self.ultCharge == 30:
            selection = '4'
        elif self.health <= 0.75 * self.classType.HP:
            selection = choice(['0', '1'])
        elif self.health <= 0.5 * self.classType.HP:
            selection = choice(['0', '1', '2'])
        elif self.health <= 0.1 * self.classType.HP:
            selection = choice(['2', '3'])
        else:
            selection = '0'
        mid = 0
        try:
            mid = int(selection)
        except:
            print('Invalid move!')
            return self.prompt()
        if mid >= len(self.moves) or mid < 0:
            print('Invalid move!')
            return self.prompt()
        return self.moves[mid]

<mask token>


class cpuPlayer:

    def __init__(self, name, classType):
        self.health = int(classType.HP)
        self.name = name
        self.classType = classType
        self.moves = classType.moves
        self.damageTaken = 1
        self.ultCharge = -5
        print(f'{self.name}: HP = {self.health}, Class = {self.classType.name}'
            )

    def takeDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        self.ultCharge += floor(self.ultCharge + damage / 1.5)
        if self.ultCharge >= 30:
            self.ultCharge = 30
        if self.health <= 0:
            self.health = 0

    def ultDamage(self, d):
        damTak = int(self.damageTaken)
        damage = d * damTak
        damage = ceil(damage)
        self.health -= damage
        self.damageTaken = 1
        if self.health <= 0:
            self.health = 0

    def doHeal(self):
        healAmnt = self.damageTaken
        healAmnt = ceil(healAmnt)
        self.health += healAmnt
        if self.health > self.classType.HP:
            self.health = self.classType.HP

    def log(self, text):
        print(f'{self.name}: {text}')

    def prompt(self):
        print('\n')
        if self.health <= 0:
            self.health = 0
        if self.ultCharge == 30:
            selection = '4'
        elif self.health <= 0.75 * self.classType.HP:
            selection = choice(['0', '1'])
        elif self.health <= 0.5 * self.classType.HP:
            selection = choice(['0', '1', '2'])
        elif self.health <= 0.1 * self.classType.HP:
            selection = choice(['2', '3'])
        else:
            selection = '0'
        mid = 0
        try:
            mid = int(selection)
        except:
            print('Invalid move!')
            return self.prompt()
        if mid >= len(self.moves) or mid < 0:
            print('Invalid move!')
            return self.prompt()
        return self.moves[mid]

from math import ceil, floor
from random import choice
class cpuPlayer:
	def __init__(self, name, classType):
		self.health = int(classType.HP)
		self.name = name
		self.classType = classType
		self.moves = classType.moves
		self.damageTaken = 1
		self.ultCharge = -5
		print(f"{self.name}: HP = {self.health}, Class = {self.classType.name}")

	def takeDamage(self, d):
		damTak = int(self.damageTaken)
		damage = d * damTak
		damage = ceil(damage)
		self.health -= damage
		self.damageTaken = 1
		self.ultCharge += floor(self.ultCharge + (damage / 1.5))
		if self.ultCharge >= 30:
			self.ultCharge = 30
		if self.health <= 0:
			self.health = 0
	
	def ultDamage(self, d):
		damTak = int(self.damageTaken)
		damage = d * damTak
		damage = ceil(damage)
		self.health -= damage
		self.damageTaken = 1
		if self.health <= 0:
			self.health = 0

	def doHeal(self):
		healAmnt = self.damageTaken
		healAmnt = ceil(healAmnt)
		self.health += healAmnt
		if self.health > self.classType.HP:
			self.health = self.classType.HP

	def log(self, text):
		print(f"{self.name}: {text}")

	def prompt(self):
		print('\n')
		if self.health <= 0:
			self.health = 0
		if self.ultCharge == 30:
			selection = '4' # If ult available, use ult
		elif self.health <= (0.75 * self.classType.HP):
			selection = choice(['0','1']) # punch or kick/fireball/rock/smite/etc.
		elif self.health <= (0.5 * self.classType.HP):
			selection = choice(['0','1','2']) # same as above but can also block/heal
		elif self.health <= (0.1 * self.classType.HP):
			selection = choice(['2','3']) # in a pinch, block/heal or 'All-or-Nothing'
		else:
			selection = '0' # if no other case applies, punch
		
		mid = 0
		
		try:
			mid = int(selection)
		except:
			print('Invalid move!')
			return self.prompt()
		if mid >= len(self.moves) or mid < 0:
			print('Invalid move!')
			return self.prompt()
		return self.moves[mid]
