Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
adbbb789
Commit
adbbb789
authored
Jul 25, 2007
by
pichoro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated text filtering for non-rules text fields in Vanguard.
Reorganized Vanguard game scripts to same order as Magic game.
parent
44224ade
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
42 deletions
+73
-42
data/vanguard.mse-game/game
data/vanguard.mse-game/game
+73
-42
No files found.
data/vanguard.mse-game/game
View file @
adbbb789
...
...
@@ -11,41 +11,7 @@ position hint: 2
# General functions
init script:
#character filter for copyright line
copyright_filter :=
# step 1 : Æ replacement rule
replace_rule(
match: "AE",
replace: "Æ") +
# step 2 : longdash for keywords
replace_rule(
match: "--",
replace: "—") +
replace_rule(
match: " - ",
replace: " — ") +
# step 3 : trademark symbol
replace_rule(
match: "TM",
replace: "™") +
# step 4 : copyright symbol
replace_rule(
match: "CR",
replace: "©")
#character filter for title line
name_filter :=
# step 1 : Æ replacement rule
replace_rule(
match: "AE",
replace: "Æ") +
# step 2 : longdash for keywords
replace_rule(
match: "--",
replace: "—") +
replace_rule(
match: " - ",
replace: " — ")
############################################################## Sorting mana symbols
# correctly sort a mana symbol (no guild mana)
mana_sort := sort_rule(order: "XYZ[0123456789]S(WUBRG)")
...
...
@@ -67,6 +33,8 @@ init script:
replace: ""
) + { tap_filter() + mana_filter() }
############################################################## Utilities for keywords
# replaces — correctly
add := "" # default is nothing
for_mana_costs := format_cost := {
...
...
@@ -92,6 +60,15 @@ init script:
has_cc := { card.casting_cost != "" }
has_pt := { card.pt != "" }
# Converted mana cost
cmc := to_text + {
1 * number_of_items(in: sort(order:"SWUBRG")) # colored mana
- 1 * number_of_items(in: sort(order:"/")) # guild mana, W/U -> 2 - 1
+ 1 * sort(order: "[0123456789]") # colorless mana
}
############################################################## The text box
# Filters for the text box
# context in which mana symbols are found
mana_context :=
...
...
@@ -182,18 +159,70 @@ init script:
match: "[(][^)\n]*[)]?",
in_context: "(^|[[:space:]])<match>|<atom-keyword><match></>",
replace: "<i-auto>&</i-auto>") +
# step 8 :
post (
capitalization
# step 8 :
automatic
capitalization
replace_rule(
match: "[a-z]",
in_context: "[(](<param-[a-z]*>)?<match>|[ ]*: <param-cost><match>|—<match>| — <match>",
replace: { to_upper() })
curly_quotes
# Converted mana cost
cmc := to_text + {
1 * number_of_items(in: sort(order:"SWUBRG")) # colored mana
- 1 * number_of_items(in: sort(order:"/")) # guild mana, W/U -> 2 - 1
+ 1 * sort(order: "[0123456789]") # colorless mana
}
############################################################## Other boxes
# the flavor text filter
# - makes all text italic
flavor_text_filter :=
# step 1 : Æ replacement rule
replace_rule(
match: "AE",
replace: "Æ") +
# step 1.5 : longdash
replace_rule(
match: "--",
replace: "—") +
replace_rule(
match: " - ",
replace: " — ") +
# step 2 : remove italic tags
tag_remove_rule(tag: "<i-flavor>") +
# step 3 : surround by <i> tags
{ "<i-flavor>" + input + "</i-flavor>" } +
# curly quotes
curly_quotes
#character filter for copyright line
copyright_filter :=
# step 1 : Æ replacement rule
replace_rule(
match: "AE",
replace: "Æ") +
# step 2 : longdash for keywords
replace_rule(
match: "--",
replace: "—") +
replace_rule(
match: " - ",
replace: " — ") +
# step 3 : trademark symbol
replace_rule(
match: "TM",
replace: "™") +
# step 4 : copyright symbol
replace_rule(
match: "CR",
replace: "©")
#character filter for title line
name_filter :=
# step 1 : Æ replacement rule
replace_rule(
match: "AE",
replace: "Æ") +
# step 2 : longdash for keywords
replace_rule(
match: "--",
replace: "—") +
replace_rule(
match: " - ",
replace: " — ")
############################################################## Set fields
...
...
@@ -213,6 +242,7 @@ set field:
set field:
type: text
name: copyright
script: copyright_filter(value)
set field:
type: info
name: Defaults and Automation
...
...
@@ -325,6 +355,7 @@ card field:
card field:
type: text
name: flavor text
script: flavor_text_filter(value)
show statistics: false
multi line: true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment