Jump to content
Toggle menu
  • 3.1K articles
  • 4.4K files
  • 19 users
  • 91.5K edits
Ashenzari's Archive
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Apt: Difference between revisions

From Ashenzari's Archive
imported>CommanderC
No edit summary
imported>CommanderC
Remove Traps, Stabbing and Sludge Elves; Add Gr
Line 19: Line 19:
   local species = {'Human',  'Centaur', 'Demigod', 'Demonspawn',
   local species = {'Human',  'Centaur', 'Demigod', 'Demonspawn',
   'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf',
   'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf',
   'Sludge Elf', 'Felid', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk',  
   'Felid', 'Gargoyle', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk',  
   'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
   'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
   'Spriggan', 'Tengu', 'Troll', 'Vampire'}
   'Spriggan', 'Tengu', 'Troll', 'Vampire'}
Line 33: Line 33:
|'''[[Deep Elf|DE]]'''
|'''[[Deep Elf|DE]]'''
|'''[[High Elf|HE]]'''
|'''[[High Elf|HE]]'''
|'''[[Sludge Elf|SE]]'''
|'''[[Felid|Fe]]'''
|'''[[Felid|Fe]]'''
|'''[[Gargoyle|Gr]]'''
|'''[[Ghoul|Gh]]'''
|'''[[Ghoul|Gh]]'''
|'''[[Halfling|Ha]]'''
|'''[[Halfling|Ha]]'''
Line 62: Line 62:
   local species = {'Human',  'Centaur', 'Demigod', 'Demonspawn',
   local species = {'Human',  'Centaur', 'Demigod', 'Demonspawn',
   'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf',
   'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf',
   'Sludge Elf', 'Felid', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk',  
   'Felid', 'Gargoyle', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk',  
   'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
   'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
   'Spriggan', 'Tengu', 'Troll', 'Vampire'}
   'Spriggan', 'Tengu', 'Troll', 'Vampire'}
Line 97: Line 97:


function p.aptitude_chart_general(frame)
function p.aptitude_chart_general(frame)
   local skills = {'Armour', 'Dodging', 'Stealth', 'Stabbing',
   local skills = {'Armour', 'Dodging', 'Stealth',
   'Shields', 'Traps', 'Invocations', 'Evocations', 'Hit Points', 'Magic Points', 'Experience'}
   'Shields', 'Invocations', 'Evocations', 'Hit Points', 'Magic Points', 'Experience'}
   local header = [=[
   local header = [=[
{| class="wikitable sortable" style="font-size:75%" border=1
{| class="wikitable sortable" style="font-size:75%" border=1
Line 105: Line 105:
! scope="col" | [[Dodging|Ddg]]
! scope="col" | [[Dodging|Ddg]]
! scope="col" | [[Stealth|Sth]]
! scope="col" | [[Stealth|Sth]]
! scope="col" | [[Stabbing|Stb]]
! scope="col" | [[Shields (skill)|Shd]]
! scope="col" | [[Shields (skill)|Shd]]
! scope="col" | [[Traps|Trp]]
! scope="col" | [[Invocations|Inv]]
! scope="col" | [[Invocations|Inv]]
! scope="col" | [[Evocations|Evo]]
! scope="col" | [[Evocations|Evo]]

Revision as of 13:24, 10 October 2013

local p = {}

function p.aptitude(frame)

 local data = mw.loadData('Module:Table of aptitudes')
 local sp = frame.args[1]
 local sk = frame.args[2]
 if not sp or not sk then
   return ""
 end
 if sp == "Draconian" then
   sp = "Base Draconian"
 end
 return data[sp][sk]

end

function p.skill_table(frame)

 local data = mw.loadData('Module:Table of aptitudes')
 local skill = frame.args[1]
 local species = {'Human',  'Centaur', 'Demigod', 'Demonspawn',
  'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf',
  'Felid', 'Gargoyle', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk', 
  'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
  'Spriggan', 'Tengu', 'Troll', 'Vampire'}
 local result = [=[
]=] for _, sp in ipairs(species) do result = result .. "| " .. data[sp][skill] .. "\n" end result = result .. "|}" return result end function p.aptitude_chart(skills, header) local data = mw.loadData('Module:Table of aptitudes') local species = {'Human', 'Centaur', 'Demigod', 'Demonspawn', 'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf', 'Felid', 'Gargoyle', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk', 'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc', 'Spriggan', 'Tengu', 'Troll', 'Vampire'} local result = header -- constants used by sort_key local a_ord = string.byte('a') local z_ord = string.byte('z') local aa_ord = string.byte('A') -- generates the table keys function sort_key(i) local result if i > z_ord - a_ord then i = i - (z_ord - a_ord) - 1 result = '!' .. string.char(aa_ord + i) else result = '"' .. string.char(a_ord + i) end return result end local i = 0 for _, sp in ipairs(species) do result = result .. '|' .. sort_key(i) .. '' .. sp .. "\n" for _,sk in ipairs(skills) do result = result .. "||" .. data[sp][sk] .. "\n" end result = result .. "|-\n" i = i + 1 end result = result .. "|}" return result end function p.aptitude_chart_general(frame) local skills = {'Armour', 'Dodging', 'Stealth', 'Shields', 'Invocations', 'Evocations', 'Hit Points', 'Magic Points', 'Experience'} local header = [=[
Hu Ce Dg Ds Dr DD DE HE Fe Gr Gh Ha Ko Mf Mi Mu Na Op Og HO Sp Te Tr Vp
]=] return p.aptitude_chart(skills, header) end function p.aptitude_chart_combat(frame) local skills = {'Fighting', 'Short Blades', 'Long Blades', 'Maces Flails', 'Axes', 'Polearms', 'Staves', 'Unarmed Combat', 'Throwing', 'Slings', 'Bows', 'Crossbows'} local header = [=[
Species Arm Ddg Sth Shd Inv Evo HP MP Exp
]=] return p.aptitude_chart(skills, header) end function p.aptitude_chart_magic(frame) local skills = {'Spellcasting', 'Conjurations', 'Hexes', 'Charms', 'Summonings', 'Necromancy', 'Translocations', 'Transmutations', 'Fire Magic', 'Ice Magic', 'Air Magic', 'Earth Magic', 'Poison Magic'} local header = [=[
Species Fgt SBl LBl M&F Axs Pla Stv UC Thr Slg Bws Crb
]=] return p.aptitude_chart(skills, header) end return p
Species Spc Coj Hex Cha Sum Nec Trl Trm Fir Ice Air Ear Poi