示例#1
0
    def estimate_potion_combinations(self):
        for option in Ingredient:
            print(str(option.name) + ' = ' + str(option.value))
        i1 = Ingredient(int(input('Ingredient #1 Number? ')))
        i2 = Ingredient(int(input('Ingredient #2 Number? ')))

        if PotionCombinations.postion_list_search(self.potion_list, i1, i2):
            return None  #done
        else:
            ##handling for unknown ingredients
            if i1 not in self.ingredient_dic:
                ip = IngredientProperties(i1)
                ip.set_alchemical_options(
                    AlchemicalCombinations().inital_alchemical_options())
                self.ingredient_dic[i1] = ip
            if i2 not in self.ingredient_dic:
                ip = IngredientProperties(i2)
                ip.set_alchemical_options(
                    AlchemicalCombinations().inital_alchemical_options())
                self.ingredient_dic[i2] = ip

            potionStats = PotionCombinations.generate_ingredient_potions(
                self.ingredient_dic[i1], self.ingredient_dic[i2])
            for stat in potionStats:
                print(stat)
示例#2
0
 def update_ingredient_dic(self, potion):
     reduction = AlchemicalCombinations().reduce_potion_alchemicals(
         potion, self.ingredient_dic)
     for ingredient in potion.get_ingredients():
         #build new IP for each
         if ingredient in self.ingredient_dic:
             ip = self.ingredient_dic[ingredient]
             ip.set_alchemical_options(reduction[ingredient])
         else:
             ip = IngredientProperties(ingredient)
             ip.set_alchemical_options(reduction[ingredient])
         self.ingredient_dic[ingredient] = ip
示例#3
0
triplet_one = AlchemicalTriplet([redposlarge, bluenegsmall, greennegsmall])
triplet_one_list = triplet_one.get_alchemicals()
for a in triplet_one_list:
    print('Triplet_ONE ' + str(a.get_color()) + ' ' + str(a.get_sign()) + ' ' +
          str(a.get_size()))

triplet_two = AlchemicalTriplet([redpossmall, bluepossmall, greenposlarge])
triplet_two_list = triplet_two.get_alchemicals()
print(triplet_two_list)
for b in triplet_two_list:
    print('Triplet_TWO ' + str(b.get_color()) + ' ' + str(b.get_sign()) + ' ' +
          str(b.get_size()))
#make some ingredients and properties
from Object.IngredientProperties import IngredientProperties

ip = IngredientProperties(Ingredient.TOAD)
print(str(ip.get_name()))
print(ip.get_alchemical_options())
ip.set_alchemical_options([triplet_one])
ip_triplet_list = ip.get_alchemical_options()

#for given ingredient list all triplet props
for l in ip_triplet_list:
    for a in l.get_alchemicals():
        print('IngredientProps ' + str(a.get_color()) + ' ' +
              str(a.get_sign()) + ' ' + str(a.get_size()))

#Alchemical Combinations Test
from Routine.AlchemicalCombinations import AlchemicalCombinations

ingredient_dic = {Ingredient.TOAD: ip}