コード例 #1
0
from app.models.effects import Times, Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

human_technology = {
    Technology(
        name='Civic Duty',
        cost=500,
        max_level=1,
        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.',
コード例 #2
0
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)
コード例 #3
0
from app.models.technologies.helpers import generate_tech_levels
from app.models.technologies import Technology
from app.models.effects import Add

generic_technology = [
    Technology(
        name='Basic Alchemy',
        cost=250,
        max_level=5,
        description=
        'Generate an additional +{research_change} research each day.',
        effects=Add('Scientist', research_change=10),
    ),
    Technology(
        name='Philosopher\'s Stone',
        cost=750,
        max_level=1,
        description=
        'Generate an additional +{bank_multiplier} gold for each mine you own.',
        effects=Add('Economy', bank_multiplier=4),
    ),
    Technology(name='Basic Engineering',
               cost=250,
               max_level=5,
               description=
               '+{build_slots} building can be built each day for each level.',
               effects=Add('Economy', build_slots=1)),
    Technology(
        name='Public Works',
        cost=750,
        max_level=1,
コード例 #4
0
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)
コード例 #5
0
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)
コード例 #6
0
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)
コード例 #7
0
from app.models.effects import Add
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)
コード例 #8
0
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

dwarf_technology = {
    Technology(name='Dwarven Muskets',
               cost=1000,
               max_level=1,
               description='Riflemen get {archer_defence:+} defence.',
               source="Dwarf",
               effects=Add('Military', archer_defence=1)),
    Technology(name='Throwing Axes',
               cost=750,
               max_level=1,
               description='Axemen get {soldier_defence:+} defence.',
               source="Dwarf",
               effects=Add('Military', soldier_defence=2)),
    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="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(
コード例 #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)
コード例 #10
0
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

elf_technology = {
    Technology(
        name='Knowledge of the Ancients',
        cost=300,
        max_level=1,
        description='Each laboratory generates {research_multiplier} additional research point per day.',
        effects=Add(research_multiplier=1),
        source="Elf"
    ),
    Technology(
        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',
コード例 #11
0
from app.models.effects import Add
from app.models.technologies import Technology
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(
コード例 #12
0
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

warlord_technology = {
    Technology(
        name='Advanced Logistics',
        cost=500,
        max_level=1,
        description='Your armies return from battle {speed} days sooner.',
        effects=Add('Military', speed=1),
        source="Warlord"),
    Technology(
        name='Battle Tactics',
        cost=1000,
        max_level=1,
        description=
        '{offensive_modifier:+0.0%} Attack Power bonus to all offensive invasions you perform.',
        effects=Add('Military', offensive_modifier=0.15),
        source="Warlord"),
    Technology(
        name="Call to Arms",
        description=
        "You can train {trainable_per_day_modifier:+0.0%} more soldiers per day",
        cost=1250,
        max_level=1,
        source="Warlord",
        effects=Add('Military', trainable_per_day_modifier=0.2))
}

# it must be a list or it will fail
コード例 #13
0
from app.models.effects import Add
from app.models.technologies import Technology
from app.models.technologies.helpers import generate_tech_levels

cleric_technology = {
    Technology(
        name='Missionaries',
        cost=750,
        max_level=1,
        description='Your county has {immigration_modifier:+0.0%} immigration rate.',
        effects=Add('Economy', immigration_modifier=0.2),
        source="Cleric"
    ),
    Technology(
        name="Heaven's Blessing",
        cost=1250,
        max_level=1,
        description='Grant +{unit_health} health to all infantry and cavalry units.',
        effects=Add("Military", unit_health=1),
        source="Cleric"
    )
}

# it must be a list or it will fail
custom_requirements = {
    "missionaries": ["philosophy iii"],
    "heaven's blessing": ["missionaries"]
}

cleric_technology, cleric_requirements = generate_tech_levels(cleric_technology, custom_requirements)