2016-02-04 22:30:39 +00:00
|
|
|
self = (if window? then window.PokeBattle.conditions ?= {} else this)
|
|
|
|
|
2016-02-01 22:19:30 +00:00
|
|
|
@Conditions =
|
|
|
|
TEAM_PREVIEW : 1
|
|
|
|
RATED_BATTLE : 2
|
|
|
|
PBV_1000 : 3
|
|
|
|
TIMED_BATTLE : 4
|
|
|
|
SLEEP_CLAUSE : 5
|
|
|
|
SPECIES_CLAUSE : 6
|
|
|
|
EVASION_CLAUSE : 7
|
|
|
|
OHKO_CLAUSE : 8
|
|
|
|
UNRELEASED_BAN : 9
|
|
|
|
PRANKSTER_SWAGGER_CLAUSE : 10
|
|
|
|
PBV_500 : 11
|
|
|
|
VISIBLE_TEAM : 12
|
2016-02-20 16:25:41 +00:00
|
|
|
PRIMAL_LIMIT : 13
|
|
|
|
TIER_LC : 14
|
|
|
|
TIER_PU : 15
|
|
|
|
TIER_NU : 16
|
|
|
|
TIER_RU : 17
|
|
|
|
TIER_UU : 18
|
|
|
|
TIER_OU : 19
|
|
|
|
TIER_Uber : 20
|
2016-02-01 22:19:30 +00:00
|
|
|
|
|
|
|
@SelectableConditions = [
|
|
|
|
@Conditions.VISIBLE_TEAM
|
|
|
|
@Conditions.TIMED_BATTLE
|
|
|
|
@Conditions.SLEEP_CLAUSE
|
|
|
|
@Conditions.EVASION_CLAUSE
|
|
|
|
@Conditions.SPECIES_CLAUSE
|
|
|
|
@Conditions.PRANKSTER_SWAGGER_CLAUSE
|
|
|
|
@Conditions.OHKO_CLAUSE
|
|
|
|
@Conditions.UNRELEASED_BAN
|
|
|
|
]
|
|
|
|
|
|
|
|
@HumanizedConditions =
|
|
|
|
en:
|
|
|
|
VISIBLE_TEAM : "Visible Teams"
|
|
|
|
TEAM_PREVIEW : "Team Preview"
|
|
|
|
SLEEP_CLAUSE : "Sleep Clause"
|
|
|
|
RATED_BATTLE : "Rated Battle"
|
|
|
|
TIMED_BATTLE : "Timed Battle"
|
|
|
|
SPECIES_CLAUSE : "Species Clause"
|
|
|
|
EVASION_CLAUSE : "Evasion Clause"
|
|
|
|
OHKO_CLAUSE : "One-Hit KO Clause"
|
|
|
|
UNRELEASED_BAN : "Unreleased Ban"
|
|
|
|
PRANKSTER_SWAGGER_CLAUSE : "Prankster + Swagger Clause"
|
2016-02-20 16:25:41 +00:00
|
|
|
PRIMAL_LIMIT : "Primal Limit"
|
|
|
|
|
2016-02-01 22:19:30 +00:00
|
|
|
|
2016-02-04 22:30:39 +00:00
|
|
|
self.PresetFormats =
|
2016-02-01 22:19:30 +00:00
|
|
|
insur1000:
|
2016-02-04 22:30:39 +00:00
|
|
|
name : 'insur1000'
|
|
|
|
humanName : 'Insurgence 1000'
|
|
|
|
generation : 'in'
|
2016-02-20 16:25:41 +00:00
|
|
|
conditions : [ @Conditions.PBV_1000, @Conditions.TEAM_PREVIEW, @Conditions.PRIMAL_LIMIT]
|
2016-02-04 22:30:39 +00:00
|
|
|
playable : true
|
|
|
|
priority : 5
|
|
|
|
tierBased : false
|
2016-02-01 22:19:30 +00:00
|
|
|
xy1000:
|
2016-02-04 22:30:39 +00:00
|
|
|
name : 'xy1000'
|
|
|
|
humanName : '1,000 PBV XY'
|
|
|
|
generation : 'xy'
|
2016-02-20 16:25:41 +00:00
|
|
|
conditions : [ @Conditions.PBV_1000, @Conditions.TEAM_PREVIEW, @Conditions.PRIMAL_LIMIT]
|
2016-02-04 22:30:39 +00:00
|
|
|
playable : true
|
|
|
|
priority : 10
|
|
|
|
tierBased : false
|
2016-02-01 22:19:30 +00:00
|
|
|
xy500:
|
2016-02-04 22:30:39 +00:00
|
|
|
name : 'xy500'
|
|
|
|
humanName : '500 PBV XY'
|
|
|
|
generation : 'xy'
|
2016-02-20 16:25:41 +00:00
|
|
|
conditions : [ @Conditions.PBV_500, @Conditions.TEAM_PREVIEW, @Conditions.PRIMAL_LIMIT]
|
2016-02-04 22:30:39 +00:00
|
|
|
playable : true
|
|
|
|
priority : 10
|
|
|
|
tierBased : false
|
|
|
|
|
|
|
|
@GenerationCondition =
|
|
|
|
'in':
|
|
|
|
conditionname : 'insur'
|
|
|
|
humanName : 'Insurgence'
|
|
|
|
|
|
|
|
self.Formats_ = {}
|
|
|
|
|
|
|
|
self.Formats = ->
|
|
|
|
if Object.keys(@Formats_).length is 0
|
|
|
|
@setFormats()
|
|
|
|
return @Formats_
|
|
|
|
else
|
|
|
|
return @Formats_
|
|
|
|
|
|
|
|
self.setFormats = ->
|
|
|
|
playablegens = ['in']
|
|
|
|
newformats = @PresetFormats
|
|
|
|
if window?
|
|
|
|
Tiers = window.PokeBattle.Tier.Tiers
|
|
|
|
conditions = Conditions
|
|
|
|
_ = window._
|
|
|
|
else
|
|
|
|
{Tiers} = require('./tier')
|
|
|
|
conditions = @Conditions
|
|
|
|
{_} = require('underscore')
|
|
|
|
for key of conditions
|
|
|
|
if (key.search /TIER_/) == 0
|
|
|
|
tier = key.replace /TIER_/, ""
|
|
|
|
tierData = Tiers[tier]
|
|
|
|
if tierData.playable
|
|
|
|
for gen in playablegens
|
|
|
|
tierbased = true
|
|
|
|
if window?
|
|
|
|
formatname = GenerationCondition[gen].conditionname + tier
|
2016-02-20 16:25:41 +00:00
|
|
|
_conditions = [Conditions[key], Conditions.TEAM_PREVIEW, Conditions.PRIMAL_LIMIT]
|
2016-02-04 22:30:39 +00:00
|
|
|
priority = tierData.priority
|
|
|
|
humanname = "#{GenerationCondition[gen].humanName} #{tierData.humanName}"
|
|
|
|
else
|
|
|
|
formatname = @GenerationCondition[gen].conditionname + tier
|
2016-02-20 16:25:41 +00:00
|
|
|
_conditions = [@Conditions[key], @Conditions.TEAM_PREVIEW, @Conditions.PRIMAL_LIMIT]
|
2016-02-04 22:30:39 +00:00
|
|
|
priority = tierData.priority
|
|
|
|
humanname = "#{@GenerationCondition[gen].humanName} #{tierData.humanName}"
|
|
|
|
|
|
|
|
newformats[formatname] = {name: formatname, humanName: humanname, generation: gen, conditions: _conditions, priority: priority, tierBased: tierbased}
|
|
|
|
sortedformatsarr = _.sortBy(newformats, 'priority');
|
|
|
|
finalobj = {}
|
|
|
|
for format in sortedformatsarr
|
|
|
|
finalobj[format.name] = format
|
|
|
|
@Formats_ = finalobj
|
2016-02-01 22:19:30 +00:00
|
|
|
|
2016-02-04 22:30:39 +00:00
|
|
|
@DEFAULT_FORMAT = 'insurOU'
|
2016-02-01 22:19:30 +00:00
|
|
|
|