﻿mse version: 0.3.6
short name: DC
full name: DC Deck Building Game
installer group: DC/Game Files
icon: card-back.png
position hint: 13

version: 2008-5-19

#By: Zaratustra
#Updated by: Zuty
############################################################## Auto replace
auto replace:
	match: --
	replace: —
auto replace:
	# note the spaces
	match:
		 - 
	replace:
		 — 
############################################################## Functions & filters
## Copied and Pasted from vs.mse-game, with a few modifications
# General functions
init script:
	text_filter := 
		# step 1 : Remove all automatic tags
		tag_remove_rule(tag: "<sym-auto>") +
		tag_remove_rule(tag: "<i-auto>")   +
		tag_remove_rule(tag: "<b-auto>")   +
		# step 2 : reminder text for keywords
		expand_keywords@(
			condition: {
				correct_case
			}
			default_expand: {
				chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
			},
			combine:        {
				if mode == "real" then "<b-auto>{keyword}</b-auto>" + (if expand then "<atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" else "")
				else "<b-auto>{keyword}</b-auto>" }
			) +
		# step 2b : remove duplicate reminder text
		replace@(
			match: "(<atom-reminder-[^>]*>[^)]+[)]</atom-reminder-[^>]*>)([^\n]+)\\1"
			replace: "\\2\\1"
			) +
		# step 3 : Expand shortcut words ~ and CARDNAME
		replace_rule(
			match: "~|~THIS~|CARDNAME",
			in_context: "(^|[[:space:]])<match>",
			replace: "<atom-cardname>&</atom-cardname>"
			) +
		# step 4 : Fill in atom fields
		tag_contents_rule(
			tag: "<atom-cardname>",
			contents: { if card.name=="" then "CARDNAME" else card.name }
			) +
		# step 5a: add arrow & diamond symbols
		replace_rule(
			match: "->|>>>|@|<>|•",
			replace: "<sym-auto>&</sym-auto>") +
		#X#if contains(card.shape, match:"old") then symbol_filter else new_symbols
		# step 8 : Italic reminder text
		replace_rule(
		 	match: "[(]([^)\n]|[(][^)\n]*[)])*[)]?",
			in_context: "(^|[[:space:]])<match>|<atom-keyword><match></",
		 	replace: "<i-auto>&</i-auto>")
	
	############### Determine type of card
	card_type := {
		if card.super_type == "starter"	then "starter"
		else if card.super_type == "playable hero blue"	then "playable blue"
		else if card.super_type == "playable hero red"	then "playable red"
		else if card.super_type == "playable villain blue"	then "playable blue"
		else if card.super_type == "playable villain red"	then "playable red"
		else if card.super_type == "playable hero crisis blue"	then "playable crisis blue"
		else if card.super_type == "playable hero crisis red"	then "playable crisis red"
		else if card.super_type == "playable villain crisis blue"	then "playable crisis blue"
		else if card.super_type == "playable villain crisis red"	then "playable crisis red"
		else if card.super_type == "type hero"   then "hero"
		else if card.super_type == "type villain"   then "villain"
		else if card.super_type == "type equipment"    then "equipment"
		else if card.super_type == "type location"    then "location"
		else if card.super_type == "type superpower"	then "superpower"
		else if card.super_type == "type ultra"	then "ultra"
		else if card.super_type == "type artifact"	then "artifact"
		else if card.super_type == "type event"	then "event"
		else if card.super_type == "type special"	then "special"
		else if card.super_type == "defeatable supervillain"	then "defeatable supervillain"
		else if card.super_type == "defeatable superhero"	then "defeatable superhero"
		else if card.super_type == "weakness"	then "weakness"
		else if card.super_type == "crisis blue"	then "crisis blue"
		else if card.super_type == "crisis red"	then "crisis red"
		else                                     "starter"
	}
	
	separator_script := {
		if card.sub_type == "" then ""
		else " - "
	}
	
############################################################## Set fields
set field:
	type: text
	name: title
	description: This information will not appear on the card.
set field:
	type: text
	name: description
	multi line: true
	description: This information will not appear on the card.
set field:
	type: choice
	name: logo
	choice: none
	choice:	DBZ
	choice: Marvel
	choice: DC
	initial: none
	save value: true
	description: The logo for the company.
set field:
	type: text
	name: designer
	description: Designer(s) of the set.
set field:
	type: text
	name: date
	description: Date
############################################################## Card fields
############################# Background stuff
card field:
	type: choice
	name: card type
	choice: starter
	choice: 
		name: weakness
	choice:
		name: special
	choice:
		name: playable
		choice: 
			name: hero
			choice: blue
			choice: red
			choice: crisis blue
			choice: crisis red
			choice: rival blue
			choice: rival red
		choice:
			name: villain
			choice: blue
			choice: red
			choice: crisis blue
			choice: crisis red
			choice: rival blue
			choice: rival red
	choice:
		name: type
		choice: artifact
		choice: equipment
		choice: event
		choice: hero
		choice: location
		choice: superpower
		choice: ultra
		choice: villain
	choice:
		name: defeatable
		choice: superhero
		choice: supervillain
	choice:
		name: crisis
		choice:	blue
		choice: red
	default: card_type()
############################# Name line
card field:
	type: text
	name: name
	identifying: true
	show statistics: false
	card list visible: true
	card list name: Name
	card list column: 1
	card list width: 150
	description: The name of the card
card field:
	type: text
	name: super type
	editable: false
card field:
	type: text
	name: sub type
card field:
	type: text
	name: type
	script:
		# Either just supertype, or subtype - supertype
		combined_editor(
			field1: card.super_type,
			separator: " — ",
			field2: card.sub_type,
			grey_until_needed: true,
			hide_when_both_empty: true,
			type_over1: " -",
			type_over2: "-"
		)
	card list visible: true
	card list name: Type
	card list column: 3
	card list width: 150
	description: The type of this card, type - to go the sub type
############################# Subtype line
card field:
	type: text
	name: subtype
	identifying: true
	show statistics: false
	card list visible: true
	card list name: Sub Type
	card list column: 4
	card list width: 150
	description: The type of the card
############################# Image
card field:
	type: image
	name: image
	show statistics: false
card field:
	type: choice
	name: card symbol
	choice: none
	choice: Marvel
	choice: DC
	choice: DBZ
	show statistics: false
	default: set.logo
	editable: false
card field:
	type: choice
	name: impossible
	choice: none
	choice: Impossible Red
	choice: Impossible Blue
	initial: none
	show statistics: false

############################# Text box
card field:
	type: text
	name: text
	multi line: true
	save value: true
	script: text_filter(input: value, card_name: card.name)
	show statistics: false
############################# Cost Field
card field:
	type: text
	name: honor
	script: text_filter(input: value, card_name: card.name)
	show statistics: false
card field:
	type: choice
	name: honortype
	card list visible: true
	card list column: 5
	card list width: 50
	description: Victory Points type.
	choice: none
	choice: positive
	choice: weakness
	choice: negative
	choice: win
	initial: none
card field:
	type: choice
	name: expansion
	choice: none
	choice: custom
	show statistics: false
	save value: true
	description: Expansion symbol.
	initial: none
card field:
	type: choice
	name: cost
	choice: none
	choice: Star
	choice:
		name: Regular
		choice: 0
		choice: 1
		choice: 2
		choice: 3
		choice: 4
		choice: 5
		choice: 6
		choice: 7
		choice: 8
		choice: 9
		choice: 10
		choice: 11
		choice: 12
		choice: 13
		choice: 14
		choice: 15
		choice: 16
		choice: 17
		choice: 18
		choice: 19
		choice: 20
		choice: 21
		choice: 22
		choice: 23
		choice: 24
		choice: 25
	choice:
		name: Star
		choice: 0
		choice: 1
		choice: 2
		choice: 3
		choice: 4
		choice: 5
		choice: 6
		choice: 7
		choice: 8
		choice: 9
		choice: 10
		choice: 11
		choice: 12
		choice: 13
		choice: 14
		choice: 15
		choice: 16
		choice: 17
		choice: 18
		choice: 19
		choice: 20
		choice: 21
		choice: 22
		choice: 23
		choice: 24
		choice: 25
	initial: none
	show statistics: false
	save value: true
	description: Cost icons for the card.
card list color script:
	input := card.card_type
	if      input == "action" then rgb(255,0,0)
	else if input == "thing"  then rgb(0,0,255)
	else if input == "rule" then rgb(0,0,0)
	else rgb(0,0,0)
############################# Copyright
card field:
	type: choice
	name: copyright
	choice: copyright
	editable: false
	show statistics: false
card field:
	type: choice
	name: copyright playable
	choice: copyright2
	editable: false
	show statistics: false
############################# Keywords
has keywords: true

keyword match script: text_filter(value)

keyword mode:
	name: real
	description: Actual keywords.

keyword parameter type:
	name: number
	match: [0-9XYZ?!]+
keyword parameter type:
	name: action
	match: 
		[^
		(.,]+
keyword parameter type:
	name: name
	match:
		[^
		(.,]+
keyword parameter type:
	name: affiliation
	match:
		[^
		(.,]+

############################# All DC keywords
keyword:
	keyword: Power
	match: Power
	mode: real
	reminder: Purchase cards with combined cost less than or equal to your total Power.
keyword:
	keyword: Ongoing
	match: Ongoing:
	mode: real
	reminder: Place this card in front of you for the rest of the game.
keyword:
	keyword: Defense
	match: Defense
	mode: real
	reminder: You may discard this card to avoid an Attack.
keyword:
	keyword: FIRST APPEARANCE—ATTACK
	match: FIRST APPEARANCE—ATTACK:
	mode: real
	reminder: When revealed on the Super-Villain stack, this Attack resolves immediately against each player in the game.
keyword:
	keyword: Attack
	match: Attack
	mode: real
	reminder: References to cards with the keyword.
keyword:
	keyword: Punch
	match: Punch
	mode: real
	reminder: References to cards with this name.
keyword:
	keyword: Vulnerability
	match: Vulnerability
	mode: real
	reminder: References to cards with this name.
keyword:
	keyword: Kick
	match: Kick
	mode: real
	reminder: References to cards with this name.
keyword:
	keyword: Weakness
	match: Weakness
	mode: real
	reminder: Weakness cards reduce your score at the end of the game.
keyword:
	keyword: Super-Villain
	match: Super-Villain
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Hero
	match: Hero
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Super Power
	match: Super Power
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Villain
	match: Villain
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Equipment
	match: Equipment
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Location
	match: Location
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Starter
	match: Starter
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Artifact
	match: Artifact
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Event
	match: Event
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: Counter-Attack
	match: Counter-Attack:
	mode: real
	reminder: References to cards of this type.
keyword:
	keyword: To Beat
	match: To Beat:
	mode: real
	reminder: References to cards of this type.