Module:Game: Difference between revisions

From Wavu Wiki, the 🌊 wavy Tekken wiki
m (Add Lidia to list of T8 chars)
m (Add Heihachi (T8))
Line 83: Line 83:
fighters = {
fighters = {
"Alisa", "Asuka", "Azucena", "Bryan", "Claudio",
"Alisa", "Asuka", "Azucena", "Bryan", "Claudio",
"Eddy",
"Eddy", "Devil Jin", "Dragunov", "Feng", "Heihachi",
"Devil Jin", "Dragunov", "Feng", "Hwoarang", "Jack-8",
"Hwoarang", "Jack-8", "Jin", "Jun", "Kazuya",  
"Jin", "Jun", "Kazuya", "King", "Kuma",
"King", "Kuma", "Lars", "Law", "Lee",  
"Lars", "Law", "Lee", "Leo", "Leroy",
"Leo", "Leroy", "Lidia", "Lili", "Nina",  
"Lidia", "Lili", "Nina", "Panda", "Paul", "Raven",
"Panda", "Paul", "Raven", "Reina", "Shaheen",  
"Reina", "Shaheen", "Steve", "Victor", "Xiaoyu",
"Steve", "Victor", "Xiaoyu", "Yoshimitsu", "Zafina"
"Yoshimitsu", "Zafina"
},
},
tables = {
tables = {

Revision as of 22:17, 21 September 2024

Documentation for this module may be created at Module:Game/doc

local p = {}

p.pageSuffix = function(game, fighter)
	if (game == 7) and p.Tekken8.hasFighter(fighter) then
		return " (Tekken 7)"
	else
		return ""
	end
end

p.gameFighterPage = function(game, fighter, page)
	-- Handle case for overview page (i.e. `page` is empty string or nil)
	if page == nil then page = "" end
	if page ~= "" then page = " " .. page end
	return fighter .. page .. p.pageSuffix(game, fighter)
end

function genFighterPageFromGame(game)
	return function(fighter, page)
		return p.gameFighterPage(game, fighter, page)
	end
end

function genFighterPageFromGamePage(game, page)
	return function(fighter)
		return p.gameFighterPage(game, fighter, page)
	end
end

function genComboLink(game)
	return function(fighter, section, damage)
		return '[[' .. p.gameFighterPage(game, fighter, "combos") .. '#' .. section .. '|' .. damage ..']]'
	end
end

function genHasFighter(game)
	local map = nil
	return function(fighter)
		if map == nil then
			local gameObj = p.Tekken8
			if game == 7 then
				gameObj = p.Tekken7
			end
			map = {}
			for _, f in ipairs(gameObj.fighters) do
				map[f] = true
			end
		end
		return map[fighter]
	end
end

p.Tekken7 = {
	fighters = {
		"Akuma", "Alisa", "Anna", "Armor King", "Asuka",
		"Bob", "Bryan", "Claudio", "Devil Jin", "Dragunov",
		"Eddy", "Eliza", "Fahkumram", "Feng", "Ganryu",
		"Geese", "Gigas", "Heihachi", "Hwoarang", "Jack-7",
		"Jin", "Josie", "Julia", "Katarina", "Kazumi",
		"Kazuya", "King", "Kuma", "Kunimitsu", "Lars",
		"Law", "Lee", "Lei", "Leo", "Leroy",
		"Lidia", "Lili", "Lucky Chloe", "Marduk", "Master Raven",
		"Miguel", "Negan", "Nina", "Noctis", "Paul",
		"Shaheen", "Steve", "Xiaoyu", "Yoshimitsu", "Zafina"
	},
	tables = {
		Move = 'Move7',
		Punisher = 'Punisher7',
	},
	templates = {
		MoveDisplay = 'MoveDisplay7',
		MoveImpl = 'MoveImpl7',
		PunisherTableDisplay = 'PunisherTableDisplay7',
		WhiffPunisherTableDisplay = 'WhiffPunisherTableDisplay7'
	},
	fighterPage = genFighterPageFromGame(7),
	comboLink = genComboLink(7),
	punishersPage = genFighterPageFromGamePage(7, "punishers"),
	hasFighter = genHasFighter(7)
}

p.Tekken8 = {
	fighters = {
		"Alisa", "Asuka", "Azucena", "Bryan", "Claudio",
		"Eddy", "Devil Jin", "Dragunov", "Feng", "Heihachi", 
		"Hwoarang", "Jack-8", "Jin", "Jun", "Kazuya", 
		"King", "Kuma", "Lars", "Law", "Lee", 
		"Leo", "Leroy", "Lidia", "Lili", "Nina", 
		"Panda", "Paul", "Raven", "Reina", "Shaheen", 
		"Steve", "Victor", "Xiaoyu", "Yoshimitsu", "Zafina"
	},
	tables = {
		Move = 'Move',
		Punisher = 'Punisher',
	},
	templates = {
		MoveDisplay = 'MoveDisplay',
		MoveImpl = 'MoveImpl',
		PunisherTableDisplay = 'PunisherTableDisplay',
		WhiffPunisherTableDisplay = 'WhiffPunisherTableDisplay'
	},
	fighterPage = genFighterPageFromGame(8),
	comboLink = genComboLink(8),
	punishersPage = genFighterPageFromGamePage(8, "punishers"),
	hasFighter = genHasFighter(8)
}

return p