Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def skillCost(rarity=1):
- SALVsteps = [1, 25, 49, 67, 79, 88, 94, 97]
- skillBoostsUsed = [4, 5, 5, 5, 5, 5, 5, 5]
- totalCost = 0
- for i, j in zip(SALVsteps, skillBoostsUsed):
- costStipend = j*(rarity * i**2 + 100)
- #print(i, j)
- totalCost += costStipend
- print(str(costStipend) + " added to " + str(totalCost - costStipend) + " → total " + str(totalCost))
- print(totalCost)
- def levelCost(rarity=5,
- myLV=False,
- expToNextLV = False,
- preseeded = False,
- refTableName = "levelXP.tsv",
- boostTableName = "boostXP.tsv"):
- #make XP-per-level table
- if not Path(refTableName).exists():
- levels = range(1, 81)
- XPreq = [12, 15, 27, 36, 50, 80, 100, 130, 150, 200,
- 250, 350, 400, 550, 650, 700, 750, 800, 850, 900,
- 950, 1000, 1050, 1100, 1150, 1250, 1400, 1500, 1600, 1700,
- 1700, 1800, 1800, 1800, 1800, 1800, 1800, 1900, 1900, 1950,
- 2000, 2150, 2200, 2300, 2400, 2600, 2600, 2800, 3000, 3200,
- 3600, 4200, 5000, 5800, 6600, 7600, 8600, 9600, 10800, 11600,
- 12800, 14000, 15200, 16400, 17600, 19000, 20400, 23200, 24800, 26800,
- 28800, 31000, 33200, 35400, 37600, 39600, 42300, 45200, 47400, 50000]
- cumXP = [sum(XPreq[0:x+1]) - XPreq[x] for x in range(len(XPreq))]
- print(len(XPreq), len(levels))
- data = {"LV":levels, "XP to LV+1":XPreq, "Cumulative XP":cumXP }
- refTable = pd.DataFrame(data)
- print(refTable)
- refTable.to_csv(refTableName, sep="\t", index = False)
- #make Boost XP table
- if not Path(boostTableName).exists():
- boostLevel = ["S", "M", "L", "G"]
- boost1XP = 20
- XPboosts = [(4**x)*boost1XP for x in range(0,4)]
- XPmatchMultiplier = 1.2
- XPboosts2 = [int(x*XPmatchMultiplier) for x in XPboosts]
- data = {"Boost Size":boostLevel, "Boost XP":XPboosts, "Boost XP (match)":XPboosts2}
- boostTable = pd.DataFrame(data)
- print(boostTable)
- boostTable.to_csv(boostTableName, sep="\t", index = False)
- RT = pd.read_table(refTableName, sep="\t")
- BT = pd.read_table(boostTableName, sep="\t")
- LB0Cap = 20 + (rarity-1)*5
- if preseeded == False:
- LBcaps = [LB0Cap + 10*x for x in range(0, 4)]
- LVseedCaps = [LBcaps[-1] + x for x in range(1, 11)]
- caps = LBcaps + LVseedCaps
- LBlist = ["LB" + str(x) for x in range(0, 4)]
- LVseedList = ["LV+" + str(x) for x in range(1, 11)]
- capList = LBlist + LVseedList
- elif preseeded == True:
- LBcaps = [LB0Cap + 10*x for x in range(0, 3)]
- caps = LBcaps + [LBcaps[-1] + 20]
- LBlist = ["LB" + str(x) for x in range(0, 3)]
- capList = LBlist + ["Final LB and preseeded"]
- else:
- print("error preseeded status")
- return
- print(caps, capList)
- data = {"Cap Label":capList, "Level Cap":caps}
- capTable = pd.DataFrame(data)
- XPcumLB = [RT.loc[(RT["LV"] == x), "Cumulative XP"].tolist()[0] for x in capTable["Level Cap"].tolist()]
- XPbyLB = [XPcumLB[x] - XPcumLB[x-1] if x != 0 else XPcumLB[x] for x in range(len(XPcumLB))]
- print(XPcumLB)
- print(XPbyLB)
- def coinCalc(LV, slotted=5):
- coins = slotted*(20*LV + 100)
- return coins
- maxBoostMatchXP = BT["Boost XP (match)"].max()
- maxBoostXP = BT["Boost XP"].max()
- totalCost = 0
- print("☆☆ Batching begins here")
- OP = ""
- totalBoosts = 0
- totalNonMatches = 0
- for i in range(len(XPbyLB)):
- #determine how many matching boosts are required to reach the next LV cap
- XPremaining = XPbyLB[i]
- maxBoostMatches = 0
- if myLV == False:
- if i != 0:
- floorLV = caps[i-1]
- else:
- floorLV = 1
- else:
- floorLV = myLV
- capLV = caps[i]
- while XPremaining > 0:
- maxBoostMatches += 1
- XPremaining -= maxBoostMatchXP
- print("☾☾ Leveling from " + str(floorLV) + " to " + str(capLV))
- print("Matched max boosts used: " + str(maxBoostMatches))
- print("XP wasted: " + str(-XPremaining))
- #minimize how many matching boosts can be subbed with nonmatchers
- nonmatchBoosts = 0
- if XPremaining != 0 and maxBoostMatchXP - maxBoostXP > 0:
- tempMaxBoostMatches = maxBoostMatches
- while XPremaining < 0 and tempMaxBoostMatches > 0:
- nonmatchBoosts += 1
- tempMaxBoostMatches -= 1
- XPremaining = -(-XPremaining - (maxBoostMatchXP - maxBoostXP))
- if XPremaining != 0:
- nonmatchBoosts -= 1
- nonmatchBoostsStable = nonmatchBoosts
- #if XPremaining ends up being positive from subbing with nonmatchers, this indicates subbing has become inefficient enough for ≥1 more boost to be required
- print("Non-matching boosts: " + str(nonmatchBoosts))
- # a max of 4 nonmatch subs is possible
- #subbing for any more even in the most extreme wasteful situation (G at 1XP left, for 1535 wasted) will lead to needing more boosts
- matchBoosts = maxBoostMatches - nonmatchBoosts
- #cost
- LVrangeCost = 0
- currentLV = floorLV
- currentXP = RT.loc[(RT["LV"] == currentLV), "Cumulative XP"].tolist()[0]
- #print(currentLV, currentXP)
- firstBatch = maxBoostMatches % 5
- if firstBatch == 0:
- firstBatch = 5
- remainderBatchCount = (maxBoostMatches - firstBatch)//5
- #print(remainderBatchCount, type(remainderBatchCount))
- batchList = [firstBatch,] + [5]*remainderBatchCount
- print(batchList)
- for j in range(len(batchList)):
- batchCost = coinCalc(currentLV, batchList[j])
- LVrangeCost += batchCost
- for k in range(batchList[j]):
- #print(str(k+1) + " of " + str(batchList[j]) + " boosts in a batch (" + str(nonmatchBoosts) + " non-match boosts in tow before use)")
- if nonmatchBoosts > 0:
- nonmatchBoosts -= 1
- currentXP += maxBoostXP
- elif matchBoosts > 0:
- matchBoosts -=1
- currentXP += maxBoostMatchXP
- else:
- print("error: " + str(nonmatchBoosts) + " non-match boosts and " + str(matchBoosts) + " match boosts")
- return
- for k in range(len(RT.index) - 1):
- if RT.loc[k, "Cumulative XP"] <= currentXP <= RT.loc[k+1, "Cumulative XP"]:
- currentLV = RT.loc[k, "LV"]
- break
- print("cost for this leveling range is " + str(LVrangeCost))
- totalCost += LVrangeCost
- totalBoosts += maxBoostMatches
- totalNonMatches += nonmatchBoostsStable
- print("Total cost up to this point is " + str(totalCost))
- OP += "|" + str(maxBoostMatches) + " (" + str(nonmatchBoostsStable) + ") <br/> " + str(LVrangeCost) + "\n"
- print("☆☆")
- totalPrint = "|" + str(totalBoosts) + " (" + str(totalNonMatches) + ") <br/> " + str(totalCost) + "\n"
- OP += totalPrint
- print(OP)
- def skillSearch(start=0, Length=100):
- mystr1 = "{{#masterdata:Skill|"
- mystr2 = "|format=wiki}}"
- finish = start + Length
- for i in range(start, finish):
- print(mystr1 + str(i+1) + mystr2)
- def valueWikiTabular(myInput=("0 1 2 3 4 5 6 7 8 9")):
- myList = myInput.split("\t")
- del myList[2:4]
- OP = " || ".join(myList)
- print(OP)
- '''
- - Under Rage, he’s obliged to have Tenacity up or at least a defensive buff, otherwise his durability is terrible, what with requiring to be hit for it to trigger.
- - Only under Rage is his Charge worth noting, since LB3 doesn’t apply to it nor does it have any good effects despite the ailment being rather unique, making LB1 a bit useless.
- '''
- if __name__ == "__main__":
- values = "6389 8274 68.776 510 4912 6599 2701 3630 8104 10889"
- #valueWikiTabular(values)
- skillSearch(300,100)
- #levelCost(rarity=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement