def dataToEmbed(self, enemylines, stagedata, magnification): # TODO refine the enemylines stageEmbed = emb( description= 'Amount | First Spawn Frame *(Respawn F)* | Base Health', color=0x009B77) stageEmbed.set_author(name='Cat Bot') stageEmbed.add_field(name='Stage data', value=enemylines[0][14]) enemystring = '' for enemyline in enemylines: title = '' if enemyline[10] == 1: title = '**' title += self._enemydata.namefromcode(enemyline[2]) + ', ' + str( round(enemyline[4] * magnification)) + '%' if enemyline[10] == 1: title += '**' if enemyline[3] < 1: enemystring += '∞' else: enemystring += str(enemyline[3]) enemystring += ' | ' + str(enemyline[11] * 2) + 'f' if enemyline[3] != 1: if enemyline[5] == enemyline[6]: enemystring += ' *(' + str(enemyline[5] * 2) + 'f)*' else: enemystring += ' *(' + str(enemyline[5] * 2) + '~' + str( enemyline[6] * 2) + 'f)*' enemystring += ' | ' + str(enemyline[7]) + '%' stageEmbed.add_field(name=title, value=enemystring, inline=True) enemystring = '' return stageEmbed
def makeembed(self, stageinfo, stageenemies, stagetimed, stagereward, stagerestrictions): decsstring = 'Base hp = ' + str( stageinfo[0][4]) + ', stage length = ' + str( stageinfo[0][7]) + ', max enemies = ' + str( stageinfo[0][8]) + '\n' for reward in stagereward: decsstring += str(reward[0]) + '% of getting ' + str( reward[1]) + ' ' + reward[2] + ', ' if len(stagereward) > 0: decsstring = decsstring[:-2] + '\n' for timed in stagetimed: decsstring += "Time score " + str(timed[0]) + " = " + str( timed[1]) + ' ' + str(timed[2]) + ', ' if len(stagetimed) > 0: decsstring = decsstring[:-2] + '\n' decsstring += 'Difficulties ' + stageinfo[0][14] stageEmbed = emb(title=stageinfo[0][3] + ', ' + stageinfo[0][2] + ', ' + stageinfo[0][1], description=decsstring, color=0x009B77) stageEmbed.set_author(name='Cat Bot') enemystring = '' for enemyline in stageenemies: title = '' if enemyline[1] == 1: title = '__**' magstring = enemyline[3] if magstring.count(magstring[1:magstring.find(',')]) > 1: magstring = magstring[1:magstring.find(',')] + '%' else: magstring = magstring + '%' title += self._enemydata.namefromcode( enemyline[2]) + ', ' + magstring if enemyline[1] == 1: title += '**__' if enemyline[4] < 1: enemystring += '∞' else: enemystring += str(enemyline[4]) enemystring += ' | ' + str(enemyline[6]) + 'f' if enemyline[4] != 1: enemystring += ' *(' + str(enemyline[7]) + 'f)*' enemystring += ' | ' + str(enemyline[5]) stageEmbed.add_field(name=title, value=enemystring, inline=True) enemystring = '' try: elaborate = stagerestrictions[0][1] stageEmbed.set_footer(text=elaborate) except: stageEmbed.set_footer(text='No restrictions') return stageEmbed
def showstagesinembed(self, stages, index=0, showcost=False): # todo implement showcost embedtoret = emb(description='test', color=0xf43967) embedtoret.set_author(name='Cat Bot') embedtoret.set_footer(text='Beta feature; showing page ' + str(math.ceil((index + 1) / 25)) + ' out of ' + str(math.ceil(len(stages) / 25))) for stage in stages[index:index + 24]: embedtoret.add_field(name=stage[1] + ' - ' + stage[2], value=stage[3], inline=True) return embedtoret
def getstatsEmbed(self, cat, level, unitcode): isinline = True title = 'Stats of ' + cat[95] if len(cat[-4]) > 1: title = 'Stats of ' + cat[97] whichform = unitcode - 1 if unitcode > 1019 else unitcode if whichform % 3 == 0: title += ' - First form' elif whichform % 3 == 1: title += ' - Evolved form' else: title += ' - True form' title += ' - Unitcode: ' + str(unitcode) catEmbed = emb(description=title, color=0xff3300) catEmbed.set_author(name='Cat Bot') rarity = '' if cat[96] == 0: rarity = 'Normal Rare' elif cat[96] == 1: rarity = 'Special Rare' elif cat[96] == 2: rarity = 'Rare' elif cat[96] == 3: rarity = 'Super Rare' elif cat[96] == 4: rarity = 'Uber Super Rare' elif cat[96] == 5: rarity = 'Legend Rare' catEmbed.add_field(name='Level - Rarity', value=str(level) + ' - ' + rarity, inline=isinline) lvmult = float(self.levelMultiplier(cat[96], unitcode, level)) hpv = str(math.ceil(int(cat[0]) * lvmult)) + ' HP - ' + str( round(int(cat[1]), 0)) + ' KB' catEmbed.add_field(name='HP - Knockbacks', value=hpv, inline=isinline) dmg = str(math.ceil(int(cat[3]) * lvmult)) if int(cat[59]) > 0: dmg += '/' + str(math.ceil(int(cat[59]) * lvmult)) if int(cat[60]) > 0: dmg += '/' + str(math.ceil(int(cat[60]) * lvmult)) dps = ' Damage - ' + str( int(float(cat[100].replace(',', '.')) * lvmult)) + ' DPS' damagekind = '' if cat[12] == 1: damagekind += 'area' else: damagekind += 'single' if cat[44] > 0: if cat[45] > 0: damagekind += ', long range' elif cat[45] < 0: damagekind += ', omnistrike' damagetype = 'Damage (' + damagekind + ') - DPS' catEmbed.add_field(name=damagetype, value=dmg + dps, inline=isinline) tba = str(round(int(cat[99]) / 30, 2)) catEmbed.add_field(name='Speed - Attack Frequency', value=str(round(int(cat[2]), 0)) + ' - ' + tba + 's', inline=isinline) catEmbed.add_field(name='Cost - Respawn', value=str(round(int(cat[6] * 1.5), 0)) + ' - ' + str(round(max( ((cat[7] * 2 - 254) / 30), 2), 2)) + 's', inline=isinline) rangestr = '' if ',' in damagekind: # it's long range or omni leftrange = str( max(round(int(cat[44]), 0), round(int(cat[44] + cat[45])))) rightrange = str( min(round(int(cat[44]), 0), round(int(cat[44] + cat[45])))) rangestr += leftrange + ' to ' + rightrange + '; stands at ' + str( round(int(cat[5]))) else: # otherwise only range is needed rangestr += str(round(int(cat[5]))) catEmbed.add_field(name='Range', value=rangestr, inline=isinline) catEmbed.set_thumbnail(url=self.cattotriaitpics(cat)) offensivestr = '' if cat[23] > 0: # strong offensivestr += 'Strong, ' if cat[24] > 0: # knockback offensivestr += 'Knockback ' + str(round(int(cat[24]))) + '%, ' if cat[25] > 0: # freezes offensivestr += 'Freeze ' + str(round(int(cat[25]))) + '% (' + str( round(int(cat[26]) / 30, 2)) + 's), ' if cat[27] > 0: # slow offensivestr += 'Slow ' + str(round(int(cat[27]))) + '% (' + str( round(int(cat[28]) / 30, 2)) + 's), ' if cat[30] > 0: # massive damage offensivestr += 'Massive Damage, ' if cat[31] > 0: # critical offensivestr += 'Critical ' + str(round(int(cat[31]))) + '%, ' if cat[32] > 0: # targets only offensivestr += 'Targets only, ' if cat[33] > 0: # cash offensivestr += 'Double money, ' if cat[34] > 0: # base destroyer offensivestr += 'Base destroyer, ' if cat[35] > 0: # wave attack offensivestr += 'Wave attack ' + str(round(int( cat[35]))) + '% (' + str(333 + round(int(cat[36]) - 1) * 200) + ' range), ' if cat[37] > 0: # weaken offensivestr += 'Weaken ' + str(round(int(cat[37]))) + '% (' + str( round(int(cat[39]))) + '% power, ' + str( round(int(cat[38]) / 30, 2)) + 's), ' if cat[40] > 0: # strengthen offensivestr += 'Strengthen +' + str(round(int( cat[41]))) + '% (at ' + str(round(int(cat[40]))) + '% hp), ' if cat[52] > 0: # zombie killer offensivestr += 'Zombie killer, ' if cat[53] > 0: # witch killer (collab) offensivestr += 'Witch killer, ' if cat[70] > 0: # barrier breaks offensivestr += 'Barrier breaks ' + str(round(int( cat[70]))) + '%, ' if cat[71] > 0: # warp, currently unused offensivestr += 'Warp ' + str(round(int(cat[71]))) + '% (' + str( round(int(cat[73]))) + '-' + str( round(int(cat[74]))) + ', ' + str( round(int(cat[72] / 30, 2))) + 's), ' if cat[81] > 0: # insane damage offensivestr += 'Insane damage, ' if cat[82] > 0: # savage blow offensivestr += 'Savage Blow ' + str(round(int( cat[82]))) + '% (' + str(round(int( cat[83]))) + '% extra power), ' if cat[86] > 0: # surge attack offensivestr += 'Surge Attack ' + str(round(int( cat[86]))) + '% (' + str(round(int(cat[87] / 4))) + '-' + str( round(int(cat[87] / 4) + int(cat[88] / 4))) + ', level ' + str( round(int(cat[89]))) + '), ' if cat[92] > 0: # curse attack offensivestr += 'Curses ' + str(round(int( cat[92]))) + '% for ' + str(round(cat[93] / 30, 2)) + 's, ' offensivestr = offensivestr[:-2] if len(offensivestr) > 3: catEmbed.add_field(name='Offensive abilities', value=offensivestr, inline=isinline) defensivestr = '' if cat[29] > 0: # strong defensivestr += 'Resistant, ' if cat[42] > 0: # survive defensivestr += 'Survive ' + str(round(int(cat[42]))) + '%, ' if cat[43] > 0: # metal defensivestr += 'Metal, ' if cat[46] > 0: # wave immune defensivestr += 'Wave immune, ' if cat[47] > 0: # wave block defensivestr += 'Wave block, ' if cat[48] > 0: # knockback immune defensivestr += 'Knockback immune, ' if cat[49] > 0: # freeze immune defensivestr += 'Freeze immune, ' if cat[50] > 0: # slow immune defensivestr += 'Slow immune, ' if cat[51] > 0: # weaken immune defensivestr += 'Weaken immune, ' if cat[75] > 0: # warp immune defensivestr += 'Warp immune, ' if cat[79] > 0: # curse immune defensivestr += 'Curse immune, ' if cat[80] > 0: # insane resist defensivestr += 'Insanely resists, ' if cat[84] > 0: # dodge defensivestr += 'Dodge ' + str(round(int(cat[84]))) + '% (' + str( round(int(cat[85]) / 30, 2)) + 's), ' if cat[90] > 0: # poison immune defensivestr += 'Poison immune, ' if cat[91] > 0: # surge immune defensivestr += 'Surge immune, ' defensivestr = defensivestr[:-2] if len(defensivestr) > 3: catEmbed.add_field(name='Defensive abilities', value=defensivestr, inline=isinline) atkroutine = str(round(int(cat[13]))) if cat[63] > 0: # first attack applies effects atkroutine = '**' + atkroutine + '**' if int(cat[61]) > 0: # has a second attack if cat[64] > 0: # second attack applies effect atkroutine += 'f / **' + str(round(int(cat[61]))) + '**' else: atkroutine += 'f / ' + str(round(int(cat[61]))) if int(cat[62]) > 0: if cat[65] > 0: # third attack has effect atkroutine += 'f / **' + str(round(int(cat[62]))) + '**' else: atkroutine += 'f / ' + str(round(int(cat[62]))) atkroutine += 'f / ' + str(round(int(cat[98]))) + 'f' # backswing catEmbed.add_field(name='Attack timings', value=atkroutine, inline=isinline) return catEmbed
def getstatsembed(self, enemy, magnification): isinline = True title = 'Stats of ' + str(enemy[86]) enemyEmbed = emb(description=title, color=0x00ff00) enemyEmbed.set_author(name='Cat Bot') enemyEmbed.add_field(name='Magnification', value=str(int(magnification*100)) + '%', inline=isinline) hpv = str(math.ceil(int(enemy[0]) * magnification)) + ' HP - ' + str(round(int(enemy[1]), 0)) + ' KB' enemyEmbed.add_field(name='HP - Knockbacks', value=hpv, inline=isinline) dmg = str(math.ceil(int(enemy[3]) * magnification)) if int(enemy[55]) > 0: dmg += '/' + str(math.ceil(int(enemy[55]) * magnification)) if int(enemy[56]) > 0: dmg += '/' + str(math.ceil(int(enemy[56]) * magnification)) dps = ' Damage - ' + str(math.ceil(int(enemy[3]+enemy[55]+enemy[56])*magnification*30/enemy[90])) + ' DPS' damagekind = '' if enemy[11] == 1: damagekind += 'area' else: damagekind += 'single' if enemy[35] > 0: if enemy[36] > 0: damagekind += ', long range' elif enemy[36] < 0: damagekind += ', omnistrike' damagetype = 'Damage (' + damagekind + ') - DPS' enemyEmbed.add_field(name=damagetype, value=dmg + dps, inline=isinline) tba = str(round(int(enemy[90]) / 30, 2)) enemyEmbed.add_field(name='Speed - Attack Frequency', value=str(round(int(enemy[2]), 0)) + ' - ' + tba + 's', inline=isinline) enemyEmbed.add_field(name='Cash Awarded', value=str(round(int(enemy[6]*3.95), 0)), inline=isinline) rangestr = '' if ',' in damagekind: # it's long range or omni leftrange = str(max(round(int(enemy[35]), 0), round(int(enemy[35] + enemy[36])))) rightrange = str(min(round(int(enemy[35]), 0), round(int(enemy[35] + enemy[36])))) rangestr += leftrange + ' to ' + rightrange + '; stands at ' + str(round(int(enemy[5]))) else: # otherwise only range is needed rangestr += str(round(int(enemy[5]))) enemyEmbed.add_field(name='Range', value=rangestr, inline=isinline) enemyEmbed.set_thumbnail(url=self.enemytraitstopic(enemy)) offensive = '' if enemy[20] > 0: # knockback offensive += 'Knockback ' + str(round(int(enemy[20]))) + '%, ' if enemy[21] > 0: # freezes offensive += 'Freeze ' + str(round(int(enemy[21]))) + '% (' + str(round(int(enemy[22]) / 30, 2)) + 's), ' if enemy[23] > 0: # slow offensive += 'Slow ' + str(round(int(enemy[23]))) + '% (' + str(round(int(enemy[24]) / 30, 2)) + 's), ' if enemy[25] > 0: # crits offensive += 'Critical ' + str(round(int(enemy[25]))) + '%, ' if enemy[26] > 0: # base destroyer offensive += 'Base Destroyer, ' if enemy[27] > 0: # wave attack offensive += 'Wave attack ' + str(round(int(enemy[27]))) + '% (' + str(467 + round(int(enemy[28]) - 1) * 200) + ' range), ' if enemy[29] > 0: # weaken offensive += 'Weaken ' + str(round(int(enemy[29]))) + '% (' + str(round(int(enemy[31]))) + '% power, ' + str( round(int(enemy[30]) / 30, 2)) + 's), ' if enemy[32] > 0: # strengthen offensive += 'Strengthen ' + str(round(int(enemy[33]))) + '% (at ' + str(round(int(enemy[32]))) + '% hp), ' if enemy[43] != 0: # burrow if enemy[43] == 1: offensive += 'Burrows once' elif enemy[43] > 1: offensive += 'Burrows ' + str(enemy[43]) + ' times' else: offensive += 'Burrows infinite times' offensive += ' (for ' + str(int(enemy[44]/4)) + ' range), ' if enemy[65] > 0: # warp warp1 = str(round(int(enemy[65]))) warp2 = str(round(int(enemy[67]/4))) warp3 = str(round(int(enemy[68]/4))) warp4 = str(round(float(enemy[66] / 30), 2)) offensive += 'Warp ' + warp1 + '% (' + warp2 + ' / ' + warp3 + ' range, ' + warp4 + 's), ' if enemy[73] > 0: # curses offensive += 'Curses ' + str(round(int(enemy[73]))) + '% (' + str(round(int(enemy[74]) / 30, 2)) + 's), ' if enemy[79] > 0: # poison offensive += 'Poisons ' + str(round(int(enemy[79]))) + '% (' + str(int(enemy[80])) + '% hp), ' if enemy[81] > 0: # surge attack offensive += 'Surge Attack ' + str(round(int(enemy[81]))) + '% (' + str(round(int(enemy[82]/4))) + '-' + str(round(int(enemy[82]/4)+int(enemy[83]/4))) + ', level ' + str(round(int(enemy[84]))) + '), ' offensive = offensive[:-2] if len(offensive) > 3: enemyEmbed.add_field(name='Offensive abilities', value=offensive, inline=isinline) defensive = '' if enemy[34] > 0: # survive defensive += 'Survive ' + str(round(int(enemy[34]))) + '%, ' if enemy[37] > 0: # wave immune defensive += 'Wave immune, ' if enemy[39] > 0: # knockback immune defensive += 'Knockback immune, ' if enemy[40] > 0: # freeze immune defensive += 'Freeze immune, ' if enemy[41] > 0: # slow immune defensive += 'Slow immune, ' if enemy[42] > 0: # weaken immune defensive += 'Weaken immune, ' if enemy[45] != 0: # resurrects if enemy[45] == 1: defensive += 'Revives once' elif enemy[45] > 1: defensive += 'Revives ' + str(enemy[45]) + ' times' else: defensive += 'Revives until z-killed' defensive += ' (in ' + str(round(enemy[46]/30, 2)) + 's, at ' + str(enemy[47]) + '% hp), ' if enemy[49] > 0: # it's a base defensive += "It's a base, " if enemy[64] > 0: # has a barrier defensive += 'Has a ' + str(int(enemy[64])) + 'hp barrier, ' if enemy[70] > 0: # resists warp (never used) defensive += 'Immune to warp, ' if enemy[77] > 0: # dodge defensive += 'Dodge ' + str(round(int(enemy[77]))) + '% (' + str(round(int(enemy[78]) / 30, 2)) + 's), ' defensive = defensive[:-2] if len(defensive) > 3: enemyEmbed.add_field(name='Defensive abilities', value=defensive, inline=isinline) if int(enemy[59]) > 0: atkroutine = '**' + str(round(int(enemy[12]))) + '**' else: atkroutine = str(round(int(enemy[12]))) if int(enemy[57]) > 0: if int(enemy[60]) > 0: atkroutine += 'f / **' + str(round(int(enemy[57]))) + '**' else: atkroutine += 'f / ' + str(round(int(enemy[57]))) if int(enemy[58]) > 0: if int(enemy[61]) > 0: atkroutine += 'f / **' + str(round(int(enemy[58]))) + '**' else: atkroutine += 'f / ' + str(round(int(enemy[58]))) atkroutine += 'f / ' + str(round(int(enemy[89]))) + 'f' enemyEmbed.add_field(name='Attack timings', value=atkroutine, inline=isinline) return enemyEmbed