Module:Game: Difference between revisions

From Wavu Wiki, the 🌊 wavy Tekken wiki
(Created page with "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) 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(fighte...")
 
(Add Clive)
 
(5 intermediate revisions by 3 users not shown)
Line 10: Line 10:


p.gameFighterPage = function(game, fighter, page)
p.gameFighterPage = function(game, fighter, page)
return fighter .. " " .. page .. p.pageSuffix(game, fighter)
-- 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
end


Line 79: Line 82:
p.Tekken8 = {
p.Tekken8 = {
fighters = {
fighters = {
"Alisa", "Asuka", "Azucena", "Bryan", "Claudio",
"Alisa", "Asuka", "Azucena", "Bryan", "Claudio", "Clive",
"Devil Jin", "Dragunov", "Feng", "Hwoarang", "Jack-8",
"Devil Jin", "Dragunov", "Eddy", "Feng", "Heihachi",
"Jin", "Jun", "Kazuya", "King", "Kuma",
"Hwoarang", "Jack-8", "Jin", "Jun", "Kazuya",  
"Lars", "Law", "Lee", "Leo", "Leroy",
"King", "Kuma", "Lars", "Law", "Lee",  
"Lili", "Nina", "Panda", "Paul", "Raven",
"Leo", "Leroy", "Lidia", "Lili", "Nina",  
"Reina", "Shaheen", "Steve", "Victor", "Xiaoyu",
"Panda", "Paul", "Raven", "Reina", "Shaheen",  
"Yoshimitsu", "Zafina"
"Steve", "Victor", "Xiaoyu", "Yoshimitsu", "Zafina"
},
},
tables = {
tables = {

Latest revision as of 19:23, 13 December 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", "Clive",
		"Devil Jin", "Dragunov", "Eddy", "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