from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

druid_technology = {
    Technology(
        name='Advanced Agriculture',
        cost=500,
        max_level=1,
        description="{grain_modifier:+0.0%} grain produced from each field",
        effects=Add(grain_modifier=0.50),
        source="Druid"),
    Technology(name="Nature's Blessing",
               cost=1500,
               max_level=1,
               description='Your people are immune to sickness.',
               effects=None,
               source="Druid")
}

# it must be a list or it will fail
custom_requirements = {
    "advanced agriculture": ["basic agriculture iii"],
    "nature's blessing": ["advanced agriculture"]
}

druid_technology, druid_requirements = generate_tech_levels(
    druid_technology, custom_requirements)
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

merchant_technology = {
    Technology(
        name='Advanced Economics',
        cost=500,
        max_level=3,
        description='Increases all gold income by {gold_modifier:+0.0%}.',
        effects=Add('Economy', gold_modifier=0.1),
        source="Merchant"),
    Technology(
        name='Trade Routes',
        cost=1250,
        max_level=1,
        description='Can trade with travelling merchants any resource 1:1.',
        effects=None,
        source="Merchant")
}

# it must be a list or it will fail
custom_requirements = {
    "advanced economics": ["basic economics v"],
    "trade routes": ["advanced economics iii"]
}

merchant_technology, merchant_requirements = generate_tech_levels(
    merchant_technology, custom_requirements)
        description=
        'Reduces upkeep cost of men-at-arms by {abs(peasant_upkeep)} gold each.',
        source="Human",
        effects=Add('Military', peasant_upkeep=-10)),
    Technology(
        name='Economics',
        cost=750,
        max_level=1,
        description='Increases all gold income by {gold_modifier:+0.0%}.',
        effects=Add('Economy', gold_modifier=0.15),
        source="Human"),
    Technology(name='Knights Templar',
               cost=1000,
               max_level=1,
               description='All knights get {elite_attack:+} attack.',
               source="Human",
               effects=Add('Military', elite_attack=3)),
    Technology(name='Trading',
               cost=750,
               max_level=1,
               description=
               'All military units cost {abs(unit_gold)} less gold to train.',
               source="Human",
               effects=Add('Military', unit_gold=-5))
}

custom_requirements = {}

human_technology, human_requirements = generate_tech_levels(
    human_technology, custom_requirements)
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

wizard_technology = [
    Technology(name='Advanced Channelling',
               cost=500,
               max_level=1,
               description='Generate an additional mana each day.',
               effects=Add('Wizardry', mana_change=1),
               source="Wizard"),
    Technology(
        name='Hellcaster',
        cost=500,
        max_level=1,
        description=
        'When your spells are disrupted, you are able to recover half of the spent mana.',
        effects=Add('Wizardry', recoup_factor=0.5),
        source="Wizard")
]

# it must be a list or it will fail
custom_requirements = {
    "advanced channelling": ["basic channelling v"],
    "nature's blessing": ["advanced channelling iii"]
}

wizard_technology, wizard_requirements = generate_tech_levels(
    wizard_technology, custom_requirements)
Ejemplo n.º 5
0
]

custom_requirements = {
    "philosopher's stone": ["basic alchemy"],
    "public works": ["basic engineering"],
    "fertility": ["philosophy"],
    "advanced diplomacy": ["basic diplomacy"],
    "animal husbandry": ["basic agriculture"],
    "advanced hierophant": ["basic hierophant"],
    "banking": ["basic economics"],
    "infiltration": ["basic espionage"],
    "military training": ["basic logistics"],
    "attunement": ["basic channelling"]
}

generic_technology, generic_requirements = generate_tech_levels(
    generic_technology, custom_requirements)

# for tech in generic_technology.values():
#     print(tech.description)
"""
Technology(
    name='Masonry',
    cost=750,
    max_level=2,
    description="You generate +{iron_produced} additional iron ore each day per level.",
    output=5,
    effects=Add(iron_produced=5),
    source="Artificer"
)
"""
        'All non-monster and non-siege units get an additional {non_monster_non_siege_health:+} health point.',
        source="Dwarf",
        effects=Add('Military', non_monster_non_siege_health=2)),
    Technology(name='Hellfire Cannons',
               cost=2000,
               max_level=1,
               description='Cannons have +5 attack.',
               source="Dwarf"),
    Technology(
        name='Smelting',
        cost=250,
        max_level=1,
        description=
        'Your iron mines produce {iron_multiplier} additional iron ore each day.',
        effects=Add(iron_multiplier=0.5),
        source="Dwarf"),
    Technology(
        name='Battle hardened',
        cost=250,
        max_level=1,
        description=
        '{offensive_modifier:+0.0%} Attack Power bonus to all offensive invasions you perform.',
        effects=Add('Military', offensive_modifier=0.05),
        source="Dwarf")
}

custom_requirements = {}

dwarf_technology, dwarf_requirements = generate_tech_levels(
    dwarf_technology, custom_requirements)
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

rogue_technology = {
    Technology(name='Advanced Espionage',
               cost=500,
               max_level=3,
               description=
               'All thief missions are {gain_modifier:+0.0%} more effective.',
               effects=Add('Espionage', gain_modifier=0.2),
               source="Rogue"),
    Technology(
        name='Spy Network',
        cost=500,
        max_level=3,
        description='Your thieves return from all missions 10% more quickly.',
        effects=Add('Espionage', duration_multiplier=-0.1),
        source="Rogue")
}

# it must be a list or it will fail
custom_requirements = {
    "advanced espionage": ["basic espionage v"],
    "trade routes": ["advanced espionage iii"]
}

rogue_technology, rogue_requirements = generate_tech_levels(
    rogue_technology, custom_requirements)
Ejemplo n.º 8
0
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

artificer_technology = {
    Technology(
        name='Advanced Engineering',
        cost=500,
        max_level=3,
        description="All buildings are {cost_modifier:0.0%} cheaper.",
        effects=Add('Infrastructure', cost_modifier=0.1),
        source="Artificer",
    ),
    Technology(
        name='Masonry',
        cost=1000,
        max_level=1,
        description="Your forts are {fort_multiplier:+0.0%} more effective",
        effects=Add('Infrastructure', fort_multiplier=2.0),
        source="Artificer",
    )
}

# it must be a list or it will fail
custom_requirements = {
    "advanced engineering": ["basic engineering v"],
    "masonry": ["advanced engineering iii"]
}

artificer_technology, artificer_requirements = generate_tech_levels(
    artificer_technology, custom_requirements)
Ejemplo n.º 9
0
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

alchemist_technology = {
    Technology(
        name='Advanced Alchemy',
        cost=500,
        max_level=3,
        description='Generate an additional +{research_change} research each day.',
        effects=Add('Scientist', research_change=30),
        source="Alchemist"
    ),
    Technology(
        name='Elixir of Life',
        cost=1000,
        max_level=1,
        description='All non-siege units have +{non_siege_health} health',
        effects=Add('Military', non_siege_health=2),
        source="Alchemist"
    )
}

# it must be a list or it will fail
custom_requirements = {
    "advanced alchemy": ["basic alchemy v"],
    "elixir of life": ["advanced alchemy iii"]
}

alchemist_technology, alchemist_requirements = generate_tech_levels(alchemist_technology, custom_requirements)
        name='Ranger Training',
        cost=1000,
        max_level=1,
        description='Your rangers have {soldier_attack:+} attack.',
        source="Elf",
        effects=Add('Military', soldier_attack=1)
    ),
    Technology(
        name='Mithril Armour',
        cost=1500,
        max_level=1,
        description='All non-monster and non-siege units get an additional {non_monster_non_siege_health:+} health point.',
        source="Elf",
        effects=Add('Military', non_monster_non_siege_health=1)
    ),
    Technology(
        name='Dragon-fire',
        cost=1000,
        max_level=1,
        description='Dragonhelms have {elite_attack:+} attack.',
        source="Elf",
        effects=Add('Military', elite_attack=3)
    )
}

custom_requirements = {
    
}

elf_technology, elf_requirements = generate_tech_levels(elf_technology, custom_requirements)
from app.models.technologies.helpers import generate_tech_levels

hierophant_technology = {
    Technology(
        name='Unholy Sacrifice',
        cost=500,
        max_level=1,
        description=
        'All infantry and cavalry units gain +1 attack at the cost of -1 to their health.',
        effects=Add('Military',
                    non_monster_non_siege_health=-1,
                    non_monster_non_siege_attack=1),
        source="Hierophant"),
    Technology(
        name='Wall of Bodies',
        cost=500,
        max_level=1,
        description=
        'All infantry and cavalry gain +1 defence at the cost of -1 to their health.',
        effects=Add('Military',
                    non_monster_non_siege_health=-1,
                    non_monster_non_siege_defence=1),
        source="Hierophant")
}

# it must be a list or set it will fail
custom_requirements = {}

hierophant_technology, hierophant_requirements = generate_tech_levels(
    hierophant_technology, custom_requirements)
Ejemplo n.º 12
0
from app.models.effects import Times
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

diplomat_technology = {
    Technology(name='diplo',
               cost=5,
               max_level=1,
               description='...',
               effects=None,
               source="Diplomat"),
    Technology(name='diplo2',
               cost=5,
               max_level=1,
               description='b...',
               effects=None,
               source="Diplomat")
}

# it must be a list or it will fail
custom_requirements = {}

diplomat_technology, diplomat_requirements = generate_tech_levels(
    diplomat_technology, custom_requirements)