Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pf loot generator
- # (c) Sven M.
- # v 1.0 2019.06.16:
- # v 1.2 2019.08.09:
- # rework. only 1 equip- dictionary instead a list and a dictionary. This avoid errors bc there are no more two lists to carry of.
- """
- Usage:
- first line insert the level of the encounter between 1 and 30 (1/8, 1/6, 1/4, 1/2 is possible).
- second line insert loot -
- progression level
- 1 = LOW
- 2 = MID
- 3 = FAST
- """
- # pf loot generator
- # 2.0 first programm was lost
- # Sven M.
- # 2019-03-16 start ~ 11.00 pm
- # REQUIERED IMPORTS
- import random as r
- # REQUIERED DATA
- # 3 encounter - loot tables
- # (values in GOLD)
- l_loot = {
- "1/8" : 20, "1/6" : 30, "1/4" : 40,
- "1/3" : 55, "1/2" : 85, "1" : 170,
- "2" : 350, "3" : 550, "4" : 750,
- "5" : 1000, "6" : 1350, "7" : 1750,
- "8" : 2200, "9" : 2850, "10" : 3650,
- "11" : 4650, "12" : 6000, "13" : 7750, "14" : 10000, "15" : 13000,
- "16" : 16500, "17" : 22000,
- "18" : 28000, "19" : 35000,
- "20" : 44000, "21" : 55000,
- "22" : 69000, "23" : 85000,
- "24" : 102000, "25" : 125000,
- "26" : 150000, "27" : 175000,
- "28" : 205000, "29" : 240000,
- "30" : 280000}
- m_loot = {
- "1/8" : 35, "1/6" : 45, "1/4" : 65,
- "1/3" : 85, "1/2" : 130, "1" : 260,
- "2" : 550, "3" : 800, "4" : 1150,
- "5" : 1550, "6" : 2000, "7" : 2600,
- "8" : 3350, "9" : 4250, "10" : 5450,
- "11" : 7000, "12" : 9000, "13" : 11600,
- "14" : 15000, "15" : 19500,
- "16" : 25000, "17" : 32000,
- "18" : 41000, "19" : 53000,
- "20" : 67000, "21" : 84000,
- "22" : 104000, "23" : 127000,
- "24" : 155000, "25" : 185000,
- "26" : 220000, "27" : 260000,
- "28" : 305000, "29" : 360000,
- "30" : 420000}
- f_loot= {
- "1/8" : 50, "1/6" : 65, "1/4" : 100,
- "1/3" : 135, "1/2" : 200, "1" : 400,
- "2" : 800, "3" : 1200, "4" : 1700,
- "5" : 2300, "6" : 3000, "7" : 3900,
- "8" : 5000, "9" : 6400, "10" : 8200,
- "11" : 10500, "12" : 13500,
- "13" : 17500, "14" : 22000,
- "15" : 29000, "16" : 38000,
- "17" : 48000, "18" : 62000,
- "19" : 79000, "20" : 100000,
- "21" : 125000, "22" : 155000,
- "23" : 190000, "24" : 230000,
- "25" : 275000, "26" : 330000,
- "27" : 390000, "28" : 460000,
- "29" : 540000, "30" : 630000}
- # dict of prices of the items. Values in COPPER
- eqdic = {
- "Hoelzerner Krug" : 5,
- "Alter Silberkrug" : 100,
- "Angelaufener Teller aus Silber" : 150,
- "Feiner Silberteller" : 200,
- "Geschnitzer Krug" : 10,
- "Beutelchen mit Baldriantee" : 10,
- "Beutelchen mit Kraeutertee" : 2,
- "Beutelchen mit Rotbuschtee" : 2,
- "Beutel mit Pfefferminztee" : 1,
- "Beutelchen mit Lavendeltee" : 2,
- "Beutelchen mit Kamilentee" : 1,
- "Beutelchen mit Holundertee" : 1,
- "Beutelchen mit Fencheltee" : 2,
- "Beutel mit getrockneten Salatkraeutern" : 1,
- "Tonphiole mit 0,5l Kefir" : 3,
- "Tonphiole mit Pferdemilch" : 1,
- "Leinenbeutel gefuellt mit Reis (250g)" : 2,
- "Saeckchen Rueben" : 1,
- "kleiner Sack mit Kartoffeln" : 1,
- "Alchemistenfeuer" : 2000,
- "Dünner Ring aus purem Gold" : 200,
- "Massiver Ring aus purem Gold" : 1000,
- "Fackel" : 1,
- "Verstrickungsbeutel" : 5000,
- "Eiserner Wurfhaken" : 100,
- "Tonkrug" : 3,
- "Tonbecher" : 2,
- "Tonhumpen" : 2,
- "Silberbecher" : 20,
- "Silberhumpen" : 20,
- "Goldener Becher" : 1000,
- "Becher aus purem Gold" : 3000,
- "Goldener Krug" : 2000,
- "Praechtiger Krug aus purem Gold" : 6000,
- "Reich verzierter Krug aus purem Gold" : 6000,
- "Massiver Krug aus purem Gold" : 6000,
- "Goldener Humpen, mit edelsteinen verziert" : 3000,
- "Goldener Humpen" : 1000,
- "Humpen aus purem Gold" : 3000,
- "Kaestchen (3x6x3) aus Eichenholz" : 1,
- "Kleiner Hammer" : 500,
- "kleines Stueck wohlriechende Seife" : 2,
- "Schachtel mit alter Seife" : 1,
- "kleines Zelt" : 500,
- "rostige Baerenfalle" : 1000,
- "Angelhaken" : 5,
- "Kompass" : 1000,
- "kleines Gloeckchen aus Eisen" : 100,
- "Holzgabel" : 1,
- "kleiner Goldloeffel" : 1000,
- "Suppenloeffel aus Gold" : 1500,
- "Gabel aus Silber" : 1000,
- "Filigrane Silbergabel" : 1500,
- "Antike Silbergabel" : 2000,
- "Antike Kupfermuenze" : 5,
- "Antike Silbermünze" : 500,
- "Antike Goldmünze" : 5000,
- "Einfach gearbeitetes Brotmesser aus Silber" : 1000,
- "Brotmesser aus Gold" : 10000,
- "Gabel aus Gold" : 100000,
- "Fein gearbeitete Gabel aus Gold" : 15000,
- "kleiner Stahlspiegel" : 1000,
- "25m Hanfseil" : 100,
- "12m Strickseil" : 10,
- "10m Hanfseil" : 50,
- "25m Seil aus Seide" : 1000,
- "25m Seil aus Spinnenseide" : 20000,
- "Lampe (mit Kerze)" : 5000,
- "einfacher Schlafsack" : 10,
- "kleine Flasche Cauim (Bierartig; hergestellt aus Maniok- Wurzeln)" : 100,
- "kleine Flasche Kumis(Bierartig; hergestellt aus Pferdemilch)" : 50,
- "handvoll Roggenbrot" : 1,
- "Pfund Kuerbisbrot" :2,
- "Pfund Weizenbrot" : 2,
- "1 Leib Knoblauchbrot" : 2,
- "Glaeschen Honig" : 100,
- "Glaeschen Kirschmarmelade" : 50,
- "Beutel mit Kaffee (20g)" : 1,
- "Kleiner Sack Kaffeepulver (500g)" : 450,
- "Flaeschen mit Saure" : 1000,
- "Rauchstab" : 2000,
- "Sonnenzepter": 2000,
- "Donnerstein" : 3000,
- "Ewige Fackel (Farbe von Feuer" : 11000,
- "Fläschen Weihwasser mit dem Symbol Pyrons" : 2500,
- "Streichholz" : 100,
- "Tonflaeschen Tinte (30ml)" : 2500,
- "Glasflasche mit Tinte (1L" : 2600,
- "Tonphiole mit Tinte 1L" : 2600,
- "Stundenglas mit hoelzernem Rahmen (30min)" : 2500,
- "Prachtvolles Stundenglas aus Silber(30min)" : 5000,
- "Einfaches Stundenglas aus Gold (1h)" : 2500,
- "Glasflaeschen gefuellt mit Tinte (30ml)" : 2500,
- }
- # PROGRAM PART
- def lootworth(elvl, wlvl):
- if wlvl == 1:
- loot_worth = l_loot.get(elvl)
- return loot_worth
- elif wlvl == 2:
- loot_worth = m_loot.get(elvl)
- return loot_worth
- elif wlvl == 3:
- loot_worth = f_loot.get(elvl)
- return loot_worth
- else:
- print("Bitte gib eine gueltige Nummer ein. Versuch es noch einmal.")
- lootworth(elvl,wlvl)
- # split up the gold
- def goldsplit(lootworth):
- split= 25 # ***
- raw = lootworth(elvl, wlvl) /100 *split
- return raw
- """
- we split the sum, which is in
- gold in pieces of gold, silver and copper. 1g = 10s or 100 copper &
- return the result
- """
- def lines(number):
- print("\n" * number)
- def raw_gold(goldsplit):
- gold_counter = 0
- silver_counter = 0
- copper_counter = 0
- options = ["gold", "silver", "copper"]
- g = goldsplit(lootworth)
- lines(10)
- print("- - - - - - - - - - - - - - - -")
- lines(2)
- print("Rawgold = ", g)
- print("\nVerteilt auf folgende Muenzen:")
- for x in range(int(goldsplit(lootworth))):
- rollit = r.choice(options)
- if rollit == "gold":
- gold_counter += 1
- elif rollit == "silver":
- silver_counter += 10
- elif rollit == "copper":
- copper_counter += 100
- print("Goldmuenzen: ", gold_counter, "\nSilbermuenzen: ", silver_counter, "\nKupfermuenzen: ", copper_counter)
- """
- next
- we split the sum of gold for the loot
- which is given instead in coins, in equipment.
- what we do is, while sum >= 0, we take a random - item of a list (eqlist) look what it cost & subtract it from the sum.
- """
- def duplitest(a):
- dupli_test = []
- dupli_storage = {}
- for i in a:
- dupli_test.append(i)
- dupli_storage[i] = 1
- if i in dupli_test and i in a:
- dupli_storage[i] +=1
- for k, v in dupli_storage.items():
- print(k, v)
- def loot(lootworth, goldsplit):
- budget = (lootworth(elvl,wlvl) - goldsplit(lootworth)) * 100
- budgetingold = budget / 100
- print("\n\nGesamtwert Equip: ", budgetingold, "\n")
- loot_list =[]
- worklist = []
- clc = []
- duplicate_entrys = {}
- for i in eqdic.keys():
- worklist.append(i)
- while budget > 0:
- pice = r.choice(worklist)
- budget -= eqdic.get(pice)
- if budget < 0:
- budget += eqdic.get(pice)
- else:
- loot_list.append(pice)
- budget_toadd = str(budget)
- to_add = pice + " added to loot. Lootworth remain = " + budget_toadd
- clc.append(to_add)
- duplitest(loot_list)
- # for i in loot_list:
- # print(i)
- show_clc = input("\n\nWant to see the calculation? enter y")
- if show_clc == "y":
- print(clc)
- print("Lootworth remain = ", budget)
- else:
- quit()
- """
- new part
- to sumup all duplicante entrys
- i.ex.:
- a = [
- "a",
- "b",
- "c",
- "a",
- ]
- def duplitest(a):
- dupli_test = []
- dupli_storage = {}
- for i in a:
- dupli_test.append(i)
- dupli_storage[i] = 1
- if i in dupli_test and i in a:
- dupli_storage[i] +=1
- print("given",a)
- print(dupli_test)
- print("There was duplicate entrys")
- print(dupli_storage)
- for k, v in dupli_storage.items():
- print(k, v)
- duplitest(a)
- """
- # PROGRAM RUNNIG FLOW PART
- print("\n PATHFINDER LOOT GENERATOR\n")
- # 2 USER - INPUTS REQUIERED
- elvl= input("\n\nGib ein Encounter-Level zwischen\n1 und 30 ein.\n(1/8, 1/6, 1/4, 1/2 sind auch moeglich)\n>>> ")
- wlvl= int(input("\n\nGib das wealth - progression - Level ein.\n\n1 = LOW\n2 = MID\n3 = FAST\n>>> "))
- # proceed the input to
- # raw - loot a number (int)
- lootworth(elvl, wlvl)
- # into a number (lootwoth)
- # we proceed the output of
- # the function above
- # split up the gold
- goldsplit(lootworth)
- raw_gold(goldsplit)
- loot(lootworth, goldsplit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement