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
b20d2637
Commit
b20d2637
authored
Jan 10, 2009
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: version number propagates to included files
magic pack template now uses 'pack type' instead of 'pack item'
parent
f07494b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
28 deletions
+32
-28
data/magic.mse-game/packs
data/magic.mse-game/packs
+19
-19
src/util/io/reader.cpp
src/util/io/reader.cpp
+6
-2
src/util/io/reader.hpp
src/util/io/reader.hpp
+7
-7
No files found.
data/magic.mse-game/packs
View file @
b20d2637
############################################################## Card pack
item
s
############################################################## Card pack
type
s
pack
item
:
pack
type
:
name: basic land
select: cyclic
filter: card.rarity == "basic land" and not is_token_card() # can be shifted
pack
item
:
pack
type
:
name: common
filter: card.rarity == "common" and not is_token_card() and not is_shifted_card()
pack
item
:
pack
type
:
name: uncommon
filter: card.rarity == "uncommon" and not is_token_card() and not is_shifted_card()
pack
item
:
pack
type
:
name: rare
filter: card.rarity == "rare" and not is_token_card() and not is_shifted_card()
pack
item
:
pack
type
:
name: mythic rare
filter: card.rarity == "mythic rare" and not is_token_card() and not is_shifted_card()
pack
item
:
pack
type
:
name: special
filter: card.rarity == "special" and not is_token_card() # can be shifted
pack
item
:
pack
type
:
name: shifted common
filter: card.rarity == "common" and not is_token_card() and is_shifted_card()
pack
item
:
pack
type
:
name: shifted uncommon
filter: card.rarity == "uncommon" and not is_token_card() and is_shifted_card()
pack
item
:
pack
type
:
name: shifted rare
filter:
( card.rarity == "rare" or
card.rarity == "mythic rare" # We've got to put shifted mythic rares somewhere
) and not is_token_card() and is_shifted_card()
pack
item
:
pack
type
:
name: token / rulestip
filter: is_token_card()
############################################################## shifted/special if possible
# shifted common if they exist, otherwise a normal common
pack
item
:
pack
type
:
name: shifted common or else common
selectable: false
select: first
...
...
@@ -49,7 +49,7 @@ pack item:
item: common
# basic land if it exist, otherwise a common
pack
item
:
pack
type
:
name: basic land or else common
selectable: false
select: first
...
...
@@ -57,7 +57,7 @@ pack item:
item: common
# special if it exist, otherwise a common
pack
item
:
pack
type
:
name: special or else common
selectable: false
select: first
...
...
@@ -65,7 +65,7 @@ pack item:
item: common
# shifted uncommon/rare if they exist, otherwise a normal uncommon
pack
item
:
pack
type
:
name: shifted uncommon or rare or else uncommon
selectable: false
select: first
...
...
@@ -74,7 +74,7 @@ pack item:
############################################################## Randomized selections
pack
item
:
pack
type
:
name: mythic rare or rare
selectable: false
# In Shards of Alara there are 15 mythic rares and 53 rares.
...
...
@@ -96,7 +96,7 @@ pack item:
name: rare
probability: 2
pack
item
:
pack
type
:
name: shifted uncommon or rare
selectable: false
select: nonempty
...
...
@@ -110,7 +110,7 @@ pack item:
############################################################## Common proportions of cards
# of the common slots, 3/10 will be shifted, 1/10 will be special
pack
item
:
pack
type
:
name: common sometimes shifted or special
selectable: false
# TODO: Perhaps use some kind of proportional system here as well?
...
...
@@ -127,7 +127,7 @@ pack item:
item: special or else common
# of the uncommon slots, 1/3 will be shifted, 1/4 of that will be shifted rares instead
pack
item
:
pack
type
:
name: uncommon sometimes shifted
selectable: false
select: cyclic
...
...
src/util/io/reader.cpp
View file @
b20d2637
...
...
@@ -30,14 +30,18 @@ Reader::Reader(const InputStreamP& input, Packaged* package, const String& filen
handleAppVersion
();
}
Reader
::
Reader
(
Packaged
*
pkg
,
const
String
&
filename
,
bool
ignore_invalid
)
Reader
::
Reader
(
Reader
*
parent
,
Packaged
*
pkg
,
const
String
&
filename
,
bool
ignore_invalid
)
:
indent
(
0
),
expected_indent
(
0
),
state
(
OUTSIDE
)
,
ignore_invalid
(
ignore_invalid
)
,
filename
(
filename
),
package
(
pkg
),
line_number
(
0
),
previous_line_number
(
0
)
,
input
(
package_manager
.
openFileFromPackage
(
package
,
filename
))
{
moveNext
();
// in an included file, use the app version of the parent if we have none
handleAppVersion
();
if
(
file_app_version
==
0
)
{
file_app_version
=
parent
->
file_app_version
;
}
}
void
Reader
::
addAlias
(
Version
end_version
,
const
Char
*
a
,
const
Char
*
b
)
{
...
...
@@ -53,7 +57,7 @@ void Reader::handleIgnore(int end_version, const Char* a) {
}
void
Reader
::
handleAppVersion
()
{
if
(
enterBlock
(
_
(
"mse_version"
)))
{
if
(
enterBlock
(
_
(
"mse_version"
)))
{
handle
(
file_app_version
);
if
(
app_version
<
file_app_version
)
{
handle_warning
(
_ERROR_2_
(
"newer version"
,
filename
,
file_app_version
.
toString
()),
false
);
...
...
src/util/io/reader.hpp
View file @
b20d2637
...
...
@@ -32,18 +32,18 @@ typedef shared_ptr<wxInputStream> InputStreamP;
* object that was just read.
*/
class
Reader
{
private:
/// Construct a reader that reads a file in a package
/** Used for "include file" keys.
* package can be nullptr
*/
Reader
(
Reader
*
parent
,
Packaged
*
package
,
const
String
&
filename
,
bool
ignore_invalid
=
false
);
public:
/// Construct a reader that reads from the given input stream
/** filename is used only for error messages
*/
Reader
(
const
InputStreamP
&
input
,
Packaged
*
package
=
nullptr
,
const
String
&
filename
=
wxEmptyString
,
bool
ignore_invalid
=
false
);
/// Construct a reader that reads a file in a package
/** Used for "include file" keys.
* package can be nullptr
*/
Reader
(
Packaged
*
package
,
const
String
&
filename
,
bool
ignore_invalid
=
false
);
~
Reader
()
{
showWarnings
();
}
/// Tell the reflection code we are reading
...
...
@@ -182,7 +182,7 @@ class Reader {
template
<
typename
T
>
void
unknownKey
(
T
&
v
)
{
if
(
key
==
_
(
"include file"
))
{
Reader
reader
(
package
,
value
,
ignore_invalid
);
Reader
reader
(
this
,
package
,
value
,
ignore_invalid
);
reader
.
handle_greedy
(
v
);
moveNext
();
}
else
{
...
...
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