import random
class Miniature:
def __init__(self, name, transportable):
[Link] = name
[Link] = 20
self.dice_types = ['d0', 'd4', 'd6', 'd8', 'd10', 'd12']
[Link] = 1
self.actions_max = 5
self.action_cost = 5
[Link] = 3
self.move_max = 15
self.move_cost = 2
[Link] = 1
self.melee_max = len(self.dice_types)
self.melee_cost = 1
[Link] = 0
self.shoot_max = len(self.dice_types)
self.shoot_cost = 3
self.area_shoot = 0
self.area_power = 0
self.area_cost = 3
self.area_max = 10
[Link] = 0
self.power_max = len(self.dice_types)
self.power_cost = 2
[Link] = 1
self.defense_max = len(self.dice_types)
self.defense_cost = 3
[Link] = 1
self.health_max = 10
self.health_cost = 5
[Link] = transportable
self.transport_cost = 1
self.transport_max = 15
self.sneak_cost = 4
self.sneak_max = 1
self.fly_cost = 5
self.fly_max = 1
[Link] = {'fly': 0, 'sneak': 0, 'transport': 0}
def print_data(self):
print('Name:, ' + str([Link]))
print('Cost:, ' + str([Link]))
print('Actions:, ' + str([Link]) + ',Upgrade Cost:, ' +
str(([Link] * self.action_cost)))
print('Move:, ' + str([Link]) + ',Upgrade Cost:, ' + str(([Link] *
self.move_cost)))
print('Melee:, ' + str(self.dice_types[[Link]]) + ',Upgrade Cost:, ' +
str(([Link] * self.melee_cost)))
print('Shoot:, ' + str(self.dice_types[[Link]]) + ',Upgrade Cost:, ' +
str([Link] * self.shoot_cost))
print('Area Shoot:, ' + str(self.area_shoot) + ',Upgrade Cost:, ' +
str(self.area_shoot * self.area_cost))
print('Power:, ' + str(self.dice_types[[Link]]) + ',Upgrade Cost:, ' +
str([Link] * self.power_cost))
print('Area Power:, ' + str(self.area_power) + ',Upgrade Cost:, ' +
str(self.area_power * self.area_cost))
print('Defense:, ' + str(self.dice_types[[Link]]) + ',Upgrade Cost:,
'+ str(([Link] * self.defense_cost)))
print('Health:, ' + str([Link]) + ',Upgrade Cost:, ' + str(([Link]
* self.health_cost)))
print('Abilities Transport:, ' + str([Link]['transport']) +
',Upgrade Cost:, ' + str([Link]['transport'] * self.transport_cost))
print('Abilities Sneak:, ' + str([Link]['sneak']) + ',Upgrade Cost:,
' + str([Link]['sneak'] * self.sneak_cost))
print('Abilities Fly:, ' + str([Link]['fly']) + ',Upgrade Cost:, ' +
str([Link]['fly'] * self.fly_cost))
def choose_upgrades(self, cost):
[Link]()
choice = 0
count = 0
cost_initial = cost
while cost > 0:
choice = [Link](1, 12)
if choice == 1 or ([Link] < self.actions_max and cost >=
self.action_cost):
[Link] += 1
cost -= self.action_cost
if choice == 2 or ([Link] < self.move_max and cost >=
self.move_cost):
[Link] += 1
cost -= self.move_cost
if choice == 3 or ([Link] < self.melee_max and cost >=
self.melee_cost):
[Link] += 1
cost -= self.melee_cost
if choice == 4 or ([Link] < self.shoot_max and cost >=
self.shoot_cost):
[Link] += 1
cost -= self.shoot_cost
if choice == 5 or ([Link] >= 1 and self.area_max and cost >=
self.area_cost):
self.area_shoot += 1
cost -= self.area_cost
if choice == 6 or ([Link] >= 1 and self.area_max and cost >=
self.area_cost):
self.area_power += 1
cost -= self.area_cost
if choice == 7 or ([Link] < self.power_max and cost >=
self.power_cost):
[Link] += 1
cost -= self.power_cost
if choice == 8 or ([Link] < self.defense_max and cost >=
self.defense_cost):
[Link] += 1
cost -= self.defense_cost
if choice == 9 or ([Link] < self.health_max and cost >=
self.health_cost):
[Link] += 1
cost -= self.health_cost
if choice == 10 or ([Link]['transport'] < self.transport_max and
cost >= self.transport_cost and [Link] == True):
[Link]['transport'] += 1
cost -= self.transport_cost
if choice == 11 or ([Link]['sneak'] < self.sneak_max and cost >=
self.sneak_cost):
[Link]['sneak'] = 1
cost -= self.sneak_cost
if choice == 12 or ([Link]['fly'] < self.sneak_max and cost
>=self.fly_cost):
[Link]['fly'] = 1
cost -= self.fly_cost
[Link] += cost_initial
return [Link]
def main():
army_cost = 1000
final_army_cost = 0
additional_cost_range = [5, 20]
name = 0
transportable = True
while army_cost > 0:
name += 1
mini_cost = [Link](additional_cost_range[0],
additional_cost_range[1])
mini = Miniature(str(name), transportable)
if (mini_cost + 20) > army_cost:
mini_cost = army_cost - 20
overall_cost = mini.choose_upgrades(mini_cost)
mini.print_data()
print('\n\n')
army_cost -= overall_cost
final_army_cost += overall_cost
print (final_army_cost)
if __name__ == '__main__':
main()