Editing Module:Tag Force present responses
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page is not enabled for semantic in-text annotations due to namespace restrictions. Details about how to enable the namespace can be found on the configuration help page.
Latest revision | Your text | ||
Line 116: | Line 116: | ||
-- Map names to page names for items where the two are different | -- Map names to page names for items where the two are different | ||
local map = { | local map = { | ||
− | ['Amplifier'] = 'Amplifier (Tag Force | + | ['Amplifier'] = 'Amplifier (Tag Force)', |
− | ['Atlas Rising'] = 'Atlas Rising (Tag Force | + | ['Atlas Rising'] = 'Atlas Rising (Tag Force)', |
− | ['Bandanna'] = 'Bandanna ( | + | ['Bandanna'] = 'Bandanna (Tag Force)', |
['Bat'] = 'Bat (item)', | ['Bat'] = 'Bat (item)', | ||
['Beef Bowl'] = 'Beef Bowl (item)', | ['Beef Bowl'] = 'Beef Bowl (item)', | ||
Line 164: | Line 164: | ||
return difference | return difference | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
Line 197: | Line 185: | ||
self.name = args['character_name'] or mw.text.split(self.pageName, ' %(')[1] | self.name = args['character_name'] or mw.text.split(self.pageName, ' %(')[1] | ||
self.game = args['game'] | self.game = args['game'] | ||
− | self.gender = args['gender'] | + | self.gender = args['gender'] |
self.responses = {} | self.responses = {} | ||
Line 222: | Line 210: | ||
table.insert(self.responses, response) | table.insert(self.responses, response) | ||
end | end | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
end | end | ||
Line 250: | Line 215: | ||
-- Get a character's pronoun | -- Get a character's pronoun | ||
-- @return string "he", "she", or "they" | -- @return string "he", "she", or "they" | ||
− | function Character | + | function Character.getPronoun() |
− | + | if (gender == 'male') then return 'he' end | |
− | + | if (gender == 'female') then return 'she' end | |
− | return | + | return 'they' |
end | end | ||
-- Get a character's objective pronoun | -- Get a character's objective pronoun | ||
-- @return string "him", "her", or "them" | -- @return string "him", "her", or "them" | ||
− | function Character | + | function Character.getObjectivePronoun() |
− | + | if (gender == 'male') then return 'him' end | |
− | + | if (gender == 'female') then return 'her' end | |
− | return | + | return 'them' |
end | end | ||
Line 268: | Line 233: | ||
function Character:renderResponses() | function Character:renderResponses() | ||
local intro = '<p>In <i>[[' .. self.game .. ']]</i>, ' .. (self.name) .. ' has the following responses when the player gives ' .. (self:getObjectivePronoun()) .. ' a present.</p>' | local intro = '<p>In <i>[[' .. self.game .. ']]</i>, ' .. (self.name) .. ' has the following responses when the player gives ' .. (self:getObjectivePronoun()) .. ' a present.</p>' | ||
− | intro = intro .. '<p>The "Trust" column shows how much of a heart the present will increase in the level of trust | + | intro = intro .. '<p>The "Trust" column shows how much of a heart the present will increase in the level of trust. ' |
− | intro = intro .. 'The "Card", "Dueling", and "Them" columns show the effect it has on | + | intro = intro .. 'The "Card", "Dueling", and "Them" columns show the effect it has on ow many more times ' .. (self:getPronoun()) .. ' is will to talk about that topic (maximum 5).</p>' |
− | |||
− | local chart = mw.html.create(' | + | local chart = mw.html.create('table') |
local theadRow = chart:tag('tr') | local theadRow = chart:tag('tr') | ||
Line 300: | Line 264: | ||
row:tag('td'):wikitext(group.name) | row:tag('td'):wikitext(group.name) | ||
row:tag('td'):wikitext(response and response:renderItemList()) | row:tag('td'):wikitext(response and response:renderItemList()) | ||
− | row:tag('td'):wikitext( | + | row:tag('td'):wikitext(renponse and response.message) |
− | row:tag('td'):wikitext( | + | row:tag('td'):wikitext(renderEffect(group.trust[rating]) .. '%') |
row:tag('td'):wikitext(renderEffect(group.mood[rating])) | row:tag('td'):wikitext(renderEffect(group.mood[rating])) | ||
row:tag('td'):wikitext(renderEffect(group.card[rating])) | row:tag('td'):wikitext(renderEffect(group.card[rating])) | ||
Line 336: | Line 300: | ||
-- @return string | -- @return string | ||
function Response:renderItemList() | function Response:renderItemList() | ||
− | local list = mw.html.create('ul') | + | local list = mw.html.create('ul'):attr('class', 'hlist') |
for _, item in pairs(self.items) do | for _, item in pairs(self.items) do |