-
Notifications
You must be signed in to change notification settings - Fork 92
feat: add HoMM factions to the lab wiki #6439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Libavi
wants to merge
20
commits into
Liquipedia:main
Choose a base branch
from
Libavi:homm-factions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
524e628
Added lab Faction/Data.lua.
Libavi 4df8394
Added lab Faction/IconData.lua.
Libavi d1069c9
Added return to lab Faction/Data.lua.
Libavi 2f77c95
linter: fix some whitespace and empty lines
hjpalpha 729febc
try to fix visual snapshot from external repo
Rathoz 3be56ca
let's try this too
Rathoz a2c68ac
Use repository instead of head.sha+fetch_depth
mbergen 5f9bbbb
Merge branch 'main' into homm-factions
Rathoz 8b11a13
Added return to lab Faction/IconData.lua.
Libavi 3b196af
Merge branch 'Liquipedia:main' into homm-factions
Libavi d200681
Fixed h6 and h7 prefixes in lab Faction/Data.lua and commented them o…
Libavi 270b5d1
Added h4, h4, and hoe aliases to lab Faion/Data.lua.
Libavi c34b74f
Fixed unfinished string in lab Faction/Data.lua.
Libavi 1ea548b
Changed .webp icon image file names to .png in lab Faction/IconData.lua.
Libavi 0a91c14
Added h6 and h7 to lab Faction/Data.lua.
Libavi 992fd3c
Added h6 and h7 to lab Faction/IconData.lua
Libavi 82d131a
Fixed dual declaration of factionPropsH5 in lab Faction/Data.lua.
Libavi 02a002d
Fixed sanctuary icon file name in lab Faction/IconData.lua.
Libavi 2c8faa9
Added HoMM games to lab Info.lua.
Libavi 9c1aa08
Merge branch 'main' into homm-factions
Libavi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,392 @@ | ||
| --- | ||
| -- @Liquipedia | ||
| -- page=Module:Faction/Data | ||
| -- | ||
| -- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
| -- | ||
|
|
||
| local Lua = require('Module:Lua') | ||
|
|
||
| local Array = Lua.import('Module:Array') | ||
|
|
||
| -- Heroes of Might and Magic | ||
|
|
||
| local HOMM_PREFIX = 'Heroesofmightandmagic/' | ||
| local H3_SUFFIX = '/Heroes of Might and Magic III' | ||
| local H4_SUFFIX = '/Heroes of Might and Magic IV' | ||
| local H5_SUFFIX = '/Heroes of Might and Magic V' | ||
| local H6_SUFFIX = '/Heroes of Might and Magic VI' | ||
| local H7_SUFFIX = '/Heroes of Might and Magic VII' | ||
| local HOE_SUFFIX = '/Heroes of Might and Magic: Olden Era' | ||
|
|
||
| local factionPropsH1 = { | ||
| farm = { | ||
| index = 1, | ||
| name = 'Farm', | ||
| pageName = HOMM_PREFIX .. 'Farm', | ||
| faction = 'farm', | ||
| }, | ||
| forest = { | ||
| index = 2, | ||
| name = 'Forest', | ||
| pageName = HOMM_PREFIX .. 'Forest', | ||
| faction = 'forest', | ||
| }, | ||
| mountain = { | ||
| index = 3, | ||
| name = 'Mountain', | ||
| pageName = HOMM_PREFIX .. 'Mountain', | ||
| faction = 'mountain', | ||
| }, | ||
| plains = { | ||
| index = 4, | ||
| name = 'Plains', | ||
| pageName = HOMM_PREFIX .. 'Plains', | ||
| faction = 'plains', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 5, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| local factionPropsH2 = { | ||
| barbarian = { | ||
| index = 1, | ||
| name = 'Barbarian', | ||
| pageName = HOMM_PREFIX .. 'Barbarian', | ||
| faction = 'barbarian', | ||
| }, | ||
| knight = { | ||
| index = 2, | ||
| name = 'Knight', | ||
| pageName = HOMM_PREFIX .. 'Knight', | ||
| faction = 'knight', | ||
| }, | ||
| necromancer = { | ||
| index = 3, | ||
| name = 'Necromancer', | ||
| pageName = HOMM_PREFIX .. 'Necromancer', | ||
| faction = 'necromancer', | ||
| }, | ||
| sorceress = { | ||
| index = 4, | ||
| name = 'Sorceress', | ||
| pageName = HOMM_PREFIX .. 'Sorceress', | ||
| faction = 'sorceress', | ||
| }, | ||
| warlock = { | ||
| index = 5, | ||
| name = 'Warlock', | ||
| pageName = HOMM_PREFIX .. 'Warlock', | ||
| faction = 'warlock', | ||
| }, | ||
| wizard = { | ||
| index = 6, | ||
| name = 'Wizard', | ||
| pageName = HOMM_PREFIX .. 'Wizard', | ||
| faction = 'wizard', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 7, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| local factionPropsH3 = { | ||
| castle = { | ||
| index = 1, | ||
| name = 'Castle', | ||
| pageName = HOMM_PREFIX .. 'Castle', | ||
| faction = 'castle', | ||
| }, | ||
| rampart = { | ||
| index = 2, | ||
| name = 'Rampart', | ||
| pageName = HOMM_PREFIX .. 'Rampart', | ||
| faction = 'rampart', | ||
| }, | ||
| tower = { | ||
| index = 3, | ||
| name = 'Tower', | ||
| pageName = HOMM_PREFIX .. 'Tower', | ||
| faction = 'tower', | ||
| }, | ||
| inferno = { | ||
| index = 4, | ||
| name = 'Inferno', | ||
| pageName = HOMM_PREFIX .. 'Inferno' .. H3_SUFFIX, | ||
| faction = 'inferno', | ||
| }, | ||
| necropolis = { | ||
| index = 5, | ||
| name = 'Necropolis', | ||
| pageName = HOMM_PREFIX .. 'Necropolis' .. H3_SUFFIX, | ||
| faction = 'necropolis', | ||
| }, | ||
| dungeon = { | ||
| index = 6, | ||
| name = 'Dungeon', | ||
| pageName = HOMM_PREFIX .. 'Dungeon' .. H3_SUFFIX, | ||
| faction = 'dungeon', | ||
| }, | ||
| stronghold = { | ||
| index = 7, | ||
| name = 'Stronghold', | ||
| pageName = HOMM_PREFIX .. 'Stronghold' .. H3_SUFFIX, | ||
| faction = 'stronghold', | ||
| }, | ||
| fortress = { | ||
| index = 8, | ||
| name = 'Fortress', | ||
| pageName = HOMM_PREFIX .. 'Fortress' .. H3_SUFFIX, | ||
| faction = 'fortress', | ||
| }, | ||
| conflux = { | ||
| index = 9, | ||
| name = 'Conflux', | ||
| pageName = HOMM_PREFIX .. 'Conflux', | ||
| faction = 'conflux', | ||
| }, | ||
| cove = { | ||
| index = 10, | ||
| name = 'Cove', | ||
| pageName = HOMM_PREFIX .. 'Cove', | ||
| faction = 'cove', | ||
| }, | ||
| factory = { | ||
| index = 11, | ||
| name = 'Factory', | ||
| pageName = HOMM_PREFIX .. 'Factory', | ||
| faction = 'factory', | ||
| }, | ||
| bulwark = { | ||
| index = 12, | ||
| name = 'Bulwark', | ||
| pageName = HOMM_PREFIX .. 'Bulwark', | ||
| faction = 'bulwark', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 13, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| local factionPropsH4 = { | ||
| haven = { | ||
| index = 1, | ||
| name = 'Haven', | ||
| pageName = HOMM_PREFIX .. 'Haven' .. H4_SUFFIX, | ||
| faction = 'haven', | ||
| }, | ||
| stronghold = { | ||
| index = 2, | ||
| name = 'Stronghold', | ||
| pageName = HOMM_PREFIX .. 'Stronghold' .. H4_SUFFIX, | ||
| faction = 'stronghold', | ||
| }, | ||
| academy = { | ||
| index = 3, | ||
| name = 'Academy', | ||
| pageName = HOMM_PREFIX .. 'Academy' .. H4_SUFFIX, | ||
| faction = 'academy', | ||
| }, | ||
| preserve = { | ||
| index = 4, | ||
| name = 'Preserve', | ||
| pageName = HOMM_PREFIX .. 'Preserve', | ||
| faction = 'preserve', | ||
| }, | ||
| necropolis = { | ||
| index = 5, | ||
| name = 'Necropolis', | ||
| pageName = HOMM_PREFIX .. 'Necropolis' .. H4_SUFFIX, | ||
| faction = 'necropolis', | ||
| }, | ||
| asylum = { | ||
| index = 6, | ||
| name = 'Asylum', | ||
| pageName = HOMM_PREFIX .. 'Asylum', | ||
| faction = 'asylum', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 7, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| local factionPropsH5 = { | ||
| academy = { | ||
| index = 1, | ||
| name = 'Academy', | ||
| pageName = HOMM_PREFIX .. 'Academy' .. H5_SUFFIX, | ||
| faction = 'academy', | ||
| }, | ||
| dungeon = { | ||
| index = 2, | ||
| name = 'Dungeon', | ||
| pageName = HOMM_PREFIX .. 'Dungeon' .. H5_SUFFIX, | ||
| faction = 'dungeon', | ||
| }, | ||
|
|
||
| haven = { | ||
| index = 3, | ||
| name = 'Haven', | ||
| pageName = HOMM_PREFIX .. 'Haven' .. H5_SUFFIX, | ||
| faction = 'haven', | ||
| }, | ||
| inferno = { | ||
| index = 4, | ||
| name = 'Inferno', | ||
| pageName = HOMM_PREFIX .. 'Inferno' .. H5_SUFFIX, | ||
| faction = 'inferno', | ||
| }, | ||
| necropolis = { | ||
| index = 5, | ||
| name = 'Necropolis', | ||
| pageName = HOMM_PREFIX .. 'Necropolis' .. H5_SUFFIX, | ||
| faction = 'necropolis', | ||
| }, | ||
| sylvan = { | ||
| index = 6, | ||
| name = 'Sylvan', | ||
| pageName = HOMM_PREFIX .. 'Sylvan' .. H5_SUFFIX, | ||
| faction = 'sylvan', | ||
| }, | ||
|
|
||
| fortress = { | ||
| index = 7, | ||
| name = 'Fortress', | ||
| pageName = HOMM_PREFIX .. 'Fortress' .. H5_SUFFIX, | ||
| faction = 'fortress', | ||
| }, | ||
| stronghold = { | ||
| index = 8, | ||
| name = 'Stronghold', | ||
| pageName = HOMM_PREFIX .. 'Stronghold' .. H5_SUFFIX, | ||
| faction = 'stronghold', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 9, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| local factionPropsHOE = { | ||
| temple = { | ||
| index = 1, | ||
| name = 'Temple', | ||
| pageName = HOMM_PREFIX .. 'Temple', | ||
| faction = 'temple', | ||
| }, | ||
| necropolis = { | ||
| index = 2, | ||
| name = 'Necropolis', | ||
| pageName = HOMM_PREFIX .. 'Necropolis' .. HOE_SUFFIX, | ||
| faction = 'necropolis', | ||
| }, | ||
|
|
||
| sylvan = { | ||
| index = 3, | ||
| name = 'Sylvan', | ||
| pageName = HOMM_PREFIX .. 'Sylvan' .. HOE_SUFFIX, | ||
| faction = 'sylvan', | ||
| }, | ||
| dungeon = { | ||
| index = 4, | ||
| name = 'Dungeon', | ||
| pageName = HOMM_PREFIX .. 'Dungeon' .. HOE_SUFFIX, | ||
| faction = 'dungeon', | ||
| }, | ||
| hive = { | ||
| index = 5, | ||
| name = 'Hive', | ||
| pageName = HOMM_PREFIX .. 'Hive', | ||
| faction = 'hive', | ||
| }, | ||
| schism = { | ||
| index = 6, | ||
| name = 'Schism', | ||
| pageName = HOMM_PREFIX .. 'Schism', | ||
| faction = 'schism', | ||
| }, | ||
|
|
||
| unknown = { | ||
| index = 7, | ||
| name = 'Unknown', | ||
| faction = 'unknown', | ||
| }, | ||
| } | ||
|
|
||
| return { | ||
| factionProps = { | ||
| -- Heroes of Might and Magic | ||
| h1 = factionPropsH1, | ||
| h2 = factionPropsH2, | ||
| h3 = factionPropsH3, | ||
| h4 = factionPropsH4, | ||
| h5 = factionPropsH5, | ||
| hoe = factionPropsHOE, | ||
| }, | ||
| defaultFaction = 'unknown', | ||
| factions = { | ||
| -- Heroes of Might and Magic | ||
| h1 = Array.extractKeys(factionPropsH1), | ||
| h2 = Array.extractKeys(factionPropsH2), | ||
| h3 = Array.extractKeys(factionPropsH3), | ||
| h4 = Array.extractKeys(factionPropsH4), | ||
| h5 = Array.extractKeys(factionPropsH5), | ||
| hoe = Array.extractKeys(factionPropsHOE), | ||
| }, | ||
| aliases = { | ||
| -- Heroes of Might and Magic | ||
| h1 = { | ||
| far = 'farm', | ||
| ['for'] = 'forest', | ||
| mou = 'mountain', | ||
| pla = 'plains', | ||
| }, | ||
| h2 = { | ||
| bar = 'barbarian', | ||
| kni = 'knight', | ||
| nec = 'necromancer', | ||
| sor = 'sorceress', | ||
| war = 'warlock', | ||
| wiz = 'wizard', | ||
| }, | ||
| h3 = { | ||
| cas = 'castle', | ||
| ram = 'rampart', | ||
| tow = 'tower', | ||
| inf = 'inferno', | ||
| nec = 'necropolis', | ||
| necro = 'necropolis', | ||
| dun = 'dungeon', | ||
| str = 'stronghold', | ||
| strong = 'stronghold', | ||
| ['for'] = 'fortress', | ||
| fort = 'fortress', | ||
| con = 'conflux', | ||
| flux = 'conflux', | ||
| cov = 'cove', | ||
| fac = 'factory', | ||
| bul = 'bulwark' | ||
| }, | ||
| h4 = { | ||
| }, | ||
| h5 = { | ||
| }, | ||
| hoe = { | ||
| } | ||
| }, | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the keys have to match the game keys used in Module:Info
i doubt we will use h1-h5 there
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the common abbreviations used within the community. For a separate homm alpha wiki, these would be by far the most sensible abbreviations. Are you worried, that there might be collision with other games? I think, it's rather safe since most other games are single-game wikis and everything in labs is ideally only temporary.
homm may be a reasonable abbreviation for the 6 games added as of yet, but h6 and h7 were released as "might & magic: heroes", i.e. mm:h. And writing something like hommoe seems unnecessarily verbose and does not really make things easier. Yet, I am open to other suggestions or arguments :)