
############################################################## Card fields

############################# Automatic fields

# The 'shape' of the card (flip, split, etc.)
card field:
	type: choice
	name: shape
	save value: false
	show statistics: false
	editable: false
	choice: normal
	choice: token
	choice: flip
	choice: split
	choice: shifted
	choice: rulestip
	script:
		stylesheet   # indicate that this value should be updated when the stylesheet changes
		card_shape() # determined by the style
card field:
	type: text
	name: full name
	save value: false
	show statistics: false
	editable: false
	card list visible: true
	card list name: Name
	card list column: 1
	card list width: 150
	description: The name of the card
	script: if contains(card.shape, match:"split") then card.name + " // " + card.name_2 else card.name

############################# Background stuff
card field:
	type: color
	name: border color
	default: set.border_color
	choice:
		name: black
		color: rgb(0,0,0)
	choice:
		name: white
		color: rgb(255,255,255)
	choice:
		name: silver
		color: rgb(128,128,128)
	choice:
		name: gold
		color: rgb(200,180,0)
	show statistics: false
	description: The border of the card; can be any solid color.
card field:
	type: multiple choice
	name: card color
	empty choice: colorless
	choice: white
	choice: blue
	choice: black
	choice: red
	choice:
		name: green
		line below: true
	choice: artifact
	choice: land
	choice: multicolor
	choice:
		name: hybrid
		enabled: { card_color_color_count(card.card_color) >= 2 }
		line below: true
	choice:
		name: horizontal
		enabled: { card_color_color_count(card.card_color) >= 2 }
		type: radio
	choice:
		name: vertical
		enabled: { card_color_color_count(card.card_color) >= 2 }
		type: radio
	choice:
		name: radial
		enabled: { card_color_color_count(card.card_color) >= 2 }
		type: radio
	choice:
		name: overlay
		enabled: { card_color_color_count(card.card_color) == 2 and chosen(choice:"hybrid",card.card_color) }
		type: radio
	choice:
		name: reversed
		enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color) }
	script: card_color_filter(value)
	default: card_color(casting_cost: card.casting_cost, rules_text: card.rule_text, type: card.super_type, watermark: card.watermark, card_name: card.name)
	show statistics: false
	description: The frame of the card, used to indicate card color.

############################# Name line
card field:
	type: text
	name: name
	card list visible: false
	identifying: true
	show statistics: false
	description: The name of the card
card field:
	type: text
	name: casting cost
	icon: stats/casting_cost.png
	position hint: 1
	script: mana_filter(value)
	card list visible: true
	card list column: 2
	card list alignment: right
	card list width: 50
	card list name: CC
	description: The casting cost of the card
card field:
	type: choice
	name: card symbol
	position hint: 10
	icon: stats/card_symbol.png
	choice: none
	choice: tombstone
	description: Symbol for this card (tombstone)
card field:
	type: choice
	name: type symbol
	default: typesymbol_type(value)
	card list visible: false
	show statistics: false
	choice: artifact
	choice: creature
	choice: enchantment
	choice: instant
	choice: land
	choice: multitype
	choice: planeswalker
	choice: sorcery
	choice: none
	description: The card type symbol for this card

############################# Image
card field:
	type: image
	name: image
	show statistics: false
	description: The image of the card

############################# Card type
card field:
	type: text
	name: super type
	icon: stats/card_type.png
	position hint: 30
	editable: false
	script: super_type_filter(value)
card field:
	type: text
	name: sub type
	icon: stats/creature_type.png
	position hint: 31
	script: sub_type_filter(value, type:card.super_type)
	editable: false
card field:
	type: text
	name: type
	show statistics: false
	save value: false
	script:
		# Either just supertype, or subtype - supertype
		combined_editor(
			field1: card.super_type,
			separator: language().type_separator,
			field2: card.sub_type,
			soft_before_empty: true,
			hide_when_empty:   true
		)
	card list visible: true
	card list column:4
	description: The type of this card, type - to go the sub type
card field:
	type: choice
	name: rarity
	icon: stats/rarity.png
	position hint: 100
	choice: basic land
	choice: common
	choice: uncommon
	choice: rare
	choice: mythic rare
	choice: special
	initial: common
	card list visible: true
	card list column: 6
	description: The rarity of the card, to edit the symbol switch to the 'set info' tab
	choice colors:
		basic land: rgb(109,62,39)
		common:     rgb(33,33,33)
		uncommon:   rgb(224,224,224)
		mythic rare: rgb(202, 49, 35)
		rare:       rgb(255,207,52)
		special:    rgb(190,0,255)

############################# Text box
card field:
	type: text
	name: rule text
	script: text_filter(input: value, card_name: card.name)
	show statistics: false
	multi line: true
	description: The rules text for the card
card field:
	type: text
	name: flavor text
	script: flavor_text_filter(value)
	show statistics: false
	multi line: true
	description: The flavor text for the card
card field:
	type: text
	name: text
	multi line: true
	save value: false
	show statistics: false
	script:
		combined_editor(field1: card.rule_text, separator: "<line>\n</line>", field2: card.flavor_text)
	description: The rules and flavor text for the card; use up and down arrows to switch
card field:
	type: choice
	name: watermark
	icon: stats/watermark.png
	position hint: 200
	include file: /magic-watermarks.mse-include/watermark-names
	description: A watermark for below the textbox, this can be a big mana symbol used on basic lands, or a guild symbol

############################# Loyalty
card field:
	type: text
	name: loyalty
	icon: stats/toughness.png
	position hint: 59
	description: The initial loyalty of a planeswalker
card field:
	type: text
	name: loyalty cost 1
	show statistics: false
	description: The loyalty cost for the first ability of a planeswalker
card field:
	type: text
	name: loyalty cost 2
	show statistics: false
	description: The loyalty cost for the second ability of a planeswalker
card field:
	type: text
	name: loyalty cost 3
	show statistics: false
	description: The loyalty cost for the third ability of a planeswalker
############################# PT
card field:
	type: text
	name: power
	icon: stats/power.png
	show statistics: false
	script: type_over_pt(value)
	description: The power of a creature
card field:
	type: text
	name: toughness
	show statistics: false
	icon: stats/toughness.png
	description: The toughness of a creature
card field:
	type: text
	name: pt
	save value: false
	script: 
		combined_editor(
			field1: card.power,
			separator: language().pt_separator,
			field2: card.toughness,
			soft_before_empty: true,
			hide_when_empty:   true
		)
	card list visible: true
	card list column: 5
	card list width: 50
	card list name: P/T
	description: Power/toughness of a creature
	show statistics: false

############################# Card sorting / numbering
card field:
	type: text
	name: card number
	save value: false
	script:      card_number() + "/" + card_count()
	sort script: rarity_sort() + card.card_number
	card list visible: true
	card list column: 10
	card list width: 50
	card list name: #
	card list alignment: right
	editable: false
	show statistics: false

############################# Copyright stuff
card field:
	type: text
	name: illustrator
	icon: stats/illustrator.png
	position hint: 210
	default: set.artist
	description: Illustrator of this card, the default value can be changed on the 'set info' tab
card field:
	type: text
	name: copyright
	default: set.copyright
	show statistics: false
card field:
	type: text
	name: copyright line
	save value: false
	show statistics: false
	script:
		if set.automatic_card_numbers then
			combined_editor(field1: card.copyright, separator: " ", field2: card.card_number)
		else
			forward_editor(field: card.copyright)
	description: Copyright of this card and cardnumber, the default value can be changed on the 'set info' tab

############################################################## Duplicate fields (split/flip cards)
# Based on flip templates by Wolfwood
# These are a direct copy of the fields above, only with a 2


card field:
	type: multiple choice
	name: card color 2
	icon: stats/card_color.png
	empty choice: colorless
	choice: white
	choice: blue
	choice: black
	choice: red
	choice:
		name: green
		line below: true
	choice: artifact
	choice: land
	choice: multicolor
	choice:
		name: hybrid
		enabled: { card_color_color_count(card.card_color_2) >= 2 }
		line below: true
	choice:
		name: horizontal
		enabled: { card_color_color_count(card.card_color_2) >= 2 }
		type: radio
	choice:
		name: vertical
		enabled: { card_color_color_count(card.card_color_2) >= 2 }
		type: radio
	choice:
		name: radial
		enabled: { card_color_color_count(card.card_color_2) >= 2 }
		type: radio
	choice:
		name: overlay
		enabled: { card_color_color_count(card.card_color_2) == 2 and chosen(choice:"hybrid",card.card_color_2) }
		type: radio
	choice:
		name: reversed
		enabled: { card_color_color_count(card.card_color) >= 2 and not chosen(choice:"overlay",card.card_color_2) }
	script: card_color_filter(value)
	default: card_color(casting_cost: card.casting_cost_2, type: card.super_type_2, rules_text: card.rule_text_2, watermark: card.watermark_2, card_name: card.name_2)
	show statistics: false
	description: The frame of a card
card field:
	type: text
	name: name 2
	identifying: true
	show statistics: false
	description: The name of a card
card field:
	type: text
	name: casting cost 2
	icon: stats/casting_cost.png
	script: mana_filter(value)
	card list alignment: right
	card list width: 50
	card list name: CC
	show statistics: false
	description: The casting cost of a card
card field:
	type: choice
	name: card symbol 2
	icon: stats/card_symbol.png
	choice: none
	choice: tombstone
	show statistics: false
	description: The card symbol of the card (Tombstone)
card field:
	type: image
	name: image 2
	show statistics: false
	description: The image of the card
card field:
	type: text
	name: super type 2
	icon: stats/creature_type.png
	editable: false
	show statistics: false
	script: super_type_filter(value)
card field:
	type: text
	name: sub type 2
	icon: stats/creature_type.png
	editable: false
	show statistics: false
	script: sub_type_filter(value, type:card.super_type_2)
card field:
	type: text
	name: type 2
	save value: false
	script:
		combined_editor(
			field1: card.super_type_2,
			separator: language().type_separator,
			field2: card.sub_type_2,
			soft_before_empty: true,
			hide_when_empty:   true
		)
	show statistics: false
	description: The type of the card; type "-" to go from type to subtype
card field:
	type: choice
	name: rarity 2
	icon: stats/rarity.png
	choice: basic land
	choice: common
	choice: uncommon
	choice: rare
	choice: mythic rare
	choice: special
	initial: common
	# Both rarities will be the same
	script: card.rarity
	editable: false
	show statistics: false
card field:
	type: text
	name: rule text 2
	script: text_filter(input: value, card_name: card.name_2)
	show statistics: false
	multi line: true
	description: The rules text of the card
card field:
	type: text
	name: flavor text 2
	script: flavor_text_filter(value)
	multi line: true
	show statistics: false
card field:
	type: text
	name: text 2
	multi line: true
	save value: false
	show statistics: false
	script:
		combined_editor(field1: card.rule_text_2, separator: "<line>\n</line>", field2: card.flavor_text_2)
	description: The rules and flavor text of the card
card field:
	type: choice
	name: watermark 2
	include file: /magic-watermarks.mse-include/watermark-names
	icon: stats/watermark.png
	show statistics: false
	description: A watermark for below the textbox, this can be a big mana symbol used on basic lands, a special symbol, or a guild symbol
card field:
	type: text
	name: power 2
	icon: stats/power.png
	show statistics: false
	script: type_over_pt(value)
	description: The power of a creature
card field:
	type: text
	name: toughness 2
	icon: stats/toughness.png
	show statistics: false
	description: The toughness of a creature
card field:
	type: text
	name: pt 2
	save value: false
	script:
		combined_editor(
			field1: card.power_2,
			separator: language().pt_separator,
			field2: card.toughness_2,
			soft_before_empty: true,
			hide_when_empty:   true
		)
	card list width: 50
	card list name: P/T2
	show statistics: false
	description: Power/Toughness of a creature
card field:
	type: text
	name: illustrator 2
	icon: stats/illustrator.png
	default: set.artist
	show statistics: false
	description: The illustrator of the image
card field:
	type: text
	name: copyright 2
	default: set.copyright
	show statistics: false
card field:
	type: text
	name: copyright line 2
	save value: false
	show statistics: false
	script:
		if set.automatic_card_numbers then
			combined_editor(field1: card.copyright_2, separator: " ", field2: card.card_number)
		else
			forward_editor(field: card.copyright_2)
	description: The copyright and card number of the card
