Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/attrib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ export const ignoreForNow: (string | ((file: string) => boolean))[] = [
"upgrade_landmark_siege_works",
"unit_siege_tower_3_eng",

"unit_abbey_king_free_2", //free king on abbey completion

"_tanegashima_4_jpn",
"upgrade_econ_resource_wood_harvest_rate_1_kura_jpn",
"upgrade_econ_resource_wood_harvest_rate_2_kura_jpn",
Expand Down
12 changes: 12 additions & 0 deletions src/attrib/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,18 @@ workaround("HRE Civ Bonus: 'Cost of emplacements on Outposts, Wall Towers, and K
},
});

workaround("Differentiate Free King from Trainable King", {
predicate: (item) => item.type === "unit" && item.attribName === "unit_abbey_king_free_2",
mutator: (item) => {
item.baseId = "king-free";
item.id = `${item.baseId}-${item.age}`;
item.name = "King (Free)";
item.description += "\n\nAutomatically spawned when Abbey of Kings is completed.";
item.costs = { food: 0, wood: 0, stone: 0, gold: 0, vizier: 0, oliveoil: 0, total: 0, time: 0, popcap: 1 };
},
});


const MILITIA_COSTS = generateCosts({ food: 20 });

function discountCosts(costs: Item["costs"], discount: number) {
Expand Down
131 changes: 131 additions & 0 deletions units/english/king-free-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"id": "king-free-2",
"baseId": "king-free",
"type": "unit",
"name": "King (Free)",
"pbgid": 2161903,
"attribName": "unit_abbey_king_free_2",
"age": 2,
"civs": [
"en"
],
"description": "A mighty King, a powerful heavy cavalry unit. Heals nearby out of combat units by 2 health every 1 seconds.\n+ Heavy armor\n+ Strong in melee combat\n- Countered by Spearmen and Crossbowmen\n\nAutomatically spawned when Abbey of Kings is completed.",
"classes": [
"heavy",
"melee",
"cavalry"
],
"displayClasses": [
"Heavy Melee Cavalry"
],
"unique": true,
"costs": {
"food": 0,
"wood": 0,
"stone": 0,
"gold": 0,
"vizier": 0,
"oliveoil": 0,
"total": 0,
"time": 0,
"popcap": 1
},
"producedBy": [
"abbey-of-kings"
],
"icon": "https://data.aoe4world.com/images/units/king-2.png",
"hitpoints": 220,
"weapons": [
{
"name": "Great Sword",
"type": "melee",
"damage": 16,
"speed": 2.375,
"range": {
"min": 0,
"max": 0.295
},
"modifiers": [],
"durations": {
"aim": 0,
"windup": 0.5,
"attack": 0.125,
"winddown": 0.75,
"reload": 0,
"setup": 0,
"teardown": 0,
"cooldown": 1
},
"attribName": "weapon_abbey_king_axe_eng",
"pbgid": 2104834
},
{
"name": "Torch",
"type": "fire",
"damage": 10,
"speed": 2.125,
"range": {
"min": 0,
"max": 1.25
},
"modifiers": [],
"durations": {
"aim": 0,
"windup": 0.75,
"attack": 0.125,
"winddown": 0,
"reload": 0,
"setup": 0,
"teardown": 0,
"cooldown": 1.25
},
"attribName": "weapon_torch",
"pbgid": 123518
},
{
"name": "Lance",
"type": "melee",
"damage": 24,
"speed": 0.525,
"range": {
"min": 0,
"max": 1.0375
},
"modifiers": [],
"durations": {
"aim": 0,
"windup": 0,
"attack": 0.125,
"winddown": 0,
"reload": 0,
"setup": 0,
"teardown": 0,
"cooldown": 0.4
},
"attribName": "weapon_abbey_king_charge_eng",
"pbgid": 2104855
}
],
"armor": [
{
"type": "melee",
"value": 2
},
{
"type": "ranged",
"value": 2
}
],
"sight": {
"inner_height": 10,
"inner_radius": 4,
"outer_height": -15,
"outer_radius": 28,
"base": 13.6,
"line": 28,
"height": 10
},
"movement": {
"speed": 1.6875
}
}