Difference between revisions of "Module:Availability/active"

From Team Fortress Wiki
Jump to: navigation, search
(Slight refactoring to support cases (and renamed, since it's being repurposed))
 
m
 
Line 15: Line 15:
 
   end
 
   end
 
   return false
 
   return false
 +
end
 +
 +
function crate_link(num)
 +
  if is_active(num) then
 +
    return 'Mann Co. Supply Crate/Active series'
 +
  else
 +
    return 'Mann Co. Supply Crate/Retired series'
 +
  end
 +
end
 +
 +
function case_link(num)
 +
  if is_active(num) then
 +
    return 'Mann Co. Supply Crate/Active series'
 +
  else
 +
    return 'Mann Co. Supply Crate/Retired case series'
 +
  end
 
end
 
end

Latest revision as of 09:42, 29 December 2023

Helper page for Module:Availability. This page only houses some relatively minor (and therefore safe to touch) logic around which crate/case series are active.


-- These crate and case numbers should exactly match the ones listed on [[Mann Co. Supply Crate/Active series]]
local active = {
  '62', '63', '64', '65', '66', '67', '68', '69',
  '92',
  '103', '105', '109',
  '110', '111', '112', '113', '114', '115', '116',
  '143',
}

function is_active(num)
  for _, n in ipairs(active) do
    if n == num then
      return true
    end
  end
  return false
end

function crate_link(num)
  if is_active(num) then
    return 'Mann Co. Supply Crate/Active series'
  else
    return 'Mann Co. Supply Crate/Retired series'
  end
end

function case_link(num)
  if is_active(num) then
    return 'Mann Co. Supply Crate/Active series'
  else
    return 'Mann Co. Supply Crate/Retired case series'
  end
end