Fandom

Civilization

Module:Data/CivBE/Expedition

< Module:Data | CivBE

6,977pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

local utils = require("Module:TemplateUtils")
 
 
local expeditionTemplate= [[<table class="civbetable expedition">
<tr><th class="expedition-header" colspan=2>
<div class="expedition-name">%s</div>
<div class="expedition-icon-container"><span class="sponsor-icon">%s</span><span class="colonist-icon">%s</span><span class="spacecraft-icon">%s</span><span class="cargo-icon">%s</span>
</div>
</th></tr>
<tr class="expedition-row sponsor">
<th>%s</th>
<td>%s</td></tr>
<tr class="expedition-row colonist">
<th>%s</th>
<td>%s</td></tr>
<tr class="expedition-row spacecraft">
<th>%s</th>
<td>%s</td></tr>
<tr class="expedition-row cargo">
<th>%s</th>
<td>%s</td></tr>
</table>]]
 
local expeditionIconTemplate= "[[Image:%s (CivBE).png|55px|link=%s|%s]]"
 
function CreateExpeditionIcon(name,page)
	return string.format(expeditionIconTemplate,name,page and (page.." (CivBE)#"..name) or (name.." (CivBE)"),name)
end
 
function CreateExpedition(frame)
	local expeditionName, sponsor, colonist, spacecraft, cargo = utils.UnpackArgs(frame.args)
 
	local data = mw.loadData("Module:Data/CivBE/CivFeatures")
 
	--Making sure the arguments are valid
	if (not (expeditionName and data.sponsor[sponsor] and data.colonists[colonist] and data.spacecraft[spacecraft] and data.cargo[cargo])) then
		return utils.Error("Invalid argument(s)")
	end
 
	return utils.PreProcess(frame, string.format(expeditionTemplate,
	expeditionName,
	CreateExpeditionIcon(sponsor),
	CreateExpeditionIcon(colonist,"Colonists"),
	CreateExpeditionIcon(spacecraft,"Spacecrafts"),
	CreateExpeditionIcon(cargo,"Cargo"),
	sponsor,
	data.sponsor[sponsor].specialty,
	colonist,
	data.colonists[colonist].specialty,
	spacecraft,
	data.spacecraft[spacecraft].specialty,
	cargo,
	data.cargo[cargo].specialty))
end
 
return {CreateExpeditionIcon=CreateExpeditionIcon,CreateExpedition=CreateExpedition}

Also on Fandom

Random Wiki