Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
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
List
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
nanahira
DataEditorX
Commits
f285997d
Commit
f285997d
authored
May 20, 2017
by
keyongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多类型
parent
95f2a556
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
111 deletions
+114
-111
DataEditorX/Core/Info/CardType.cs
DataEditorX/Core/Info/CardType.cs
+80
-26
DataEditorX/Core/Mse/MseMaker.cs
DataEditorX/Core/Mse/MseMaker.cs
+34
-85
No files found.
DataEditorX/Core/Info/CardType.cs
View file @
f285997d
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
*
*
*/
*/
using
System
;
using
System
;
using
System.Collections.Generic
;
namespace
DataEditorX.Core.Info
namespace
DataEditorX.Core.Info
{
{
...
@@ -14,56 +15,109 @@ namespace DataEditorX.Core.Info
...
@@ -14,56 +15,109 @@ namespace DataEditorX.Core.Info
/// </summary>
/// </summary>
public
enum
CardType
:
long
public
enum
CardType
:
long
{
{
///<summary>怪兽卡</summary>
///<summary>怪兽卡</summary>
TYPE_MONSTER
=
0x1
,
TYPE_MONSTER
=
0x1
,
///<summary>魔法卡</summary>
///<summary>魔法卡</summary>
TYPE_SPELL
=
0x2
,
TYPE_SPELL
=
0x2
,
///<summary>陷阱卡</summary>
///<summary>陷阱卡</summary>
TYPE_TRAP
=
0x4
,
TYPE_TRAP
=
0x4
,
///<summary>通常</summary>
///<summary>通常</summary>
TYPE_NORMAL
=
0x10
,
TYPE_NORMAL
=
0x10
,
///<summary>效果</summary>
///<summary>效果</summary>
TYPE_EFFECT
=
0x20
,
TYPE_EFFECT
=
0x20
,
///<summary>融合</summary>
///<summary>融合</summary>
TYPE_FUSION
=
0x40
,
TYPE_FUSION
=
0x40
,
///<summary>仪式</summary>
///<summary>仪式</summary>
TYPE_RITUAL
=
0x80
,
TYPE_RITUAL
=
0x80
,
///<summary>陷阱怪兽</summary>
///<summary>陷阱怪兽</summary>
TYPE_TRAPMONSTER
=
0x100
,
TYPE_TRAPMONSTER
=
0x100
,
///<summary>灵魂</summary>
///<summary>灵魂</summary>
TYPE_SPIRIT
=
0x200
,
TYPE_SPIRIT
=
0x200
,
///<summary>同盟</summary>
///<summary>同盟</summary>
TYPE_UNION
=
0x400
,
TYPE_UNION
=
0x400
,
///<summary>二重</summary>
///<summary>二重</summary>
TYPE_DUAL
=
0x800
,
TYPE_DUAL
=
0x800
,
///<summary>调整</summary>
///<summary>调整</summary>
TYPE_TUNER
=
0x1000
,
TYPE_TUNER
=
0x1000
,
///<summary>同调</summary>
///<summary>同调</summary>
TYPE_SYNCHRO
=
0x2000
,
TYPE_SYNCHRO
=
0x2000
,
///<summary>衍生物</summary>
///<summary>衍生物</summary>
TYPE_TOKEN
=
0x4000
,
TYPE_TOKEN
=
0x4000
,
///<summary>速攻</summary>
///<summary>速攻</summary>
TYPE_QUICKPLAY
=
0x10000
,
TYPE_QUICKPLAY
=
0x10000
,
///<summary>永续</summary>
///<summary>永续</summary>
TYPE_CONTINUOUS
=
0x20000
,
TYPE_CONTINUOUS
=
0x20000
,
///<summary>装备</summary>
///<summary>装备</summary>
TYPE_EQUIP
=
0x40000
,
TYPE_EQUIP
=
0x40000
,
///<summary>场地</summary>
///<summary>场地</summary>
TYPE_FIELD
=
0x80000
,
TYPE_FIELD
=
0x80000
,
///<summary>反击</summary>
///<summary>反击</summary>
TYPE_COUNTER
=
0x100000
,
TYPE_COUNTER
=
0x100000
,
///<summary>反转</summary>
///<summary>反转</summary>
TYPE_FLIP
=
0x200000
,
TYPE_FLIP
=
0x200000
,
///<summary>卡通</summary>
///<summary>卡通</summary>
TYPE_TOON
=
0x400000
,
TYPE_TOON
=
0x400000
,
///<summary>超量</summary>
///<summary>超量</summary>
TYPE_XYZ
=
0x800000
,
TYPE_XYZ
=
0x800000
,
///<summary>灵摆</summary>
///<summary>灵摆</summary>
TYPE_PENDULUM
=
0x1000000
,
TYPE_PENDULUM
=
0x1000000
,
///<summary>特殊召唤</summary>
///<summary>特殊召唤</summary>
TYPE_SPSUMMON
=
0x2000000
,
TYPE_SPSUMMON
=
0x2000000
,
///<summary>连接</summary>
///<summary>连接</summary>
TYPE_LINK
=
0x4000000
,
TYPE_LINK
=
0x4000000
,
}
}
public
static
class
CardTypes
{
public
static
readonly
CardType
[]
TYPE1
=
{
CardType
.
TYPE_LINK
,
CardType
.
TYPE_XYZ
,
CardType
.
TYPE_SYNCHRO
,
CardType
.
TYPE_PENDULUM
,
CardType
.
TYPE_RITUAL
,
CardType
.
TYPE_FUSION
,
CardType
.
TYPE_SPIRIT
,
CardType
.
TYPE_UNION
,
CardType
.
TYPE_DUAL
,
CardType
.
TYPE_FLIP
,
CardType
.
TYPE_TOON
,
};
public
static
readonly
CardType
[]
TYPE2
=
{
CardType
.
TYPE_PENDULUM
,
CardType
.
TYPE_SYNCHRO
,
CardType
.
TYPE_SPIRIT
,
CardType
.
TYPE_UNION
,
CardType
.
TYPE_DUAL
,
CardType
.
TYPE_FLIP
,
CardType
.
TYPE_TOON
};
public
static
readonly
CardType
[]
TYPE3
={
CardType
.
TYPE_TUNER
,
CardType
.
TYPE_EFFECT
};
public
static
CardType
[]
GetMonsterTypes
(
long
type
){
var
list
=
new
List
<
CardType
>(
4
);
var
typeList
=
new
List
<
CardType
[
]>
(
4
);
typeList
.
Add
(
TYPE1
);
typeList
.
Add
(
TYPE2
);
typeList
.
Add
(
TYPE3
);
typeList
.
Add
(
TYPE3
);
typeList
.
Add
(
TYPE3
);
int
count
=
typeList
.
Count
;
for
(
int
i
=
0
;
i
<
count
;
i
++){
CardType
[]
types
=
typeList
[
i
];
foreach
(
var
t
in
types
){
if
((
type
&
(
long
)
t
)==(
long
)
t
){
if
(!
list
.
Contains
(
t
)){
list
.
Add
(
t
);
break
;
}
}
}
}
return
list
.
ToArray
();
}
}
}
}
DataEditorX/Core/Mse/MseMaker.cs
View file @
f285997d
...
@@ -277,105 +277,54 @@ public string GetType(CardType ctype)
...
@@ -277,105 +277,54 @@ public string GetType(CardType ctype)
public
string
[]
GetTypes
(
Card
c
)
public
string
[]
GetTypes
(
Card
c
)
{
{
//卡片类型,效果1,效果2,效果3
//卡片类型,效果1,效果2,效果3
string
[]
types
=
new
string
[]
{
string
[]
types
=
{
MseCardType
.
CARD_NORMAL
,
""
,
""
,
""
,
""
,
""
};
MseCardType
.
CARD_NORMAL
,
""
,
""
,
""
,
""
};
if
(
c
.
IsType
(
CardType
.
TYPE_MONSTER
))
if
(
c
.
IsType
(
CardType
.
TYPE_MONSTER
))
{
//卡片类型和第1效果
{
if
(
c
.
IsType
(
CardType
.
TYPE_LINK
)){
CardType
[]
cardTypes
=
CardTypes
.
GetMonsterTypes
(
c
.
type
);
types
[
0
]
=
MseCardType
.
CARD_LINK
;
int
count
=
cardTypes
.
Length
;
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_XYZ
))
for
(
int
i
=
0
;
i
<
count
&&
i
<
4
;
i
++){
{
types
[
i
+
1
]
=
GetType
(
cardTypes
[
i
]);
types
[
0
]
=
MseCardType
.
CARD_XYZ
;
}
types
[
1
]
=
GetType
(
CardType
.
TYPE_XYZ
);
if
(
cardTypes
.
Length
>
0
){
}
if
(
c
.
IsType
(
CardType
.
TYPE_LINK
)){
else
if
(
c
.
IsType
(
CardType
.
TYPE_TOKEN
))
types
[
0
]
=
MseCardType
.
CARD_LINK
;
{
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_XYZ
))
types
[
0
]
=
(
c
.
race
==
0
)
?
{
MseCardType
.
CARD_TOKEN2
types
[
0
]
=
MseCardType
.
CARD_XYZ
;
:
MseCardType
.
CARD_TOKEN
;
types
[
1
]
=
GetType
(
CardType
.
TYPE_TOKEN
);
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_RITUAL
))
{
types
[
0
]
=
MseCardType
.
CARD_RITUAL
;
types
[
1
]
=
GetType
(
CardType
.
TYPE_RITUAL
);
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_FUSION
))
{
types
[
0
]
=
MseCardType
.
CARD_FUSION
;
types
[
1
]
=
GetType
(
CardType
.
TYPE_FUSION
);
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_SYNCHRO
))
{
types
[
0
]
=
MseCardType
.
CARD_SYNCHRO
;
types
[
1
]
=
GetType
(
CardType
.
TYPE_SYNCHRO
);
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_EFFECT
))
{
types
[
0
]
=
MseCardType
.
CARD_EFFECT
;
}
else
types
[
0
]
=
MseCardType
.
CARD_NORMAL
;
//同调
if
(
types
[
0
]
==
MseCardType
.
CARD_SYNCHRO
||
types
[
0
]
==
MseCardType
.
CARD_TOKEN
)
{
if
(
c
.
IsType
(
CardType
.
TYPE_TUNER
)
&&
c
.
IsType
(
CardType
.
TYPE_EFFECT
))
{
//调整效果
types
[
2
]
=
GetType
(
CardType
.
TYPE_TUNER
);
types
[
3
]
=
GetType
(
CardType
.
TYPE_EFFECT
);
}
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_T
UNER
))
else
if
(
c
.
IsType
(
CardType
.
TYPE_T
OKEN
))
{
{
types
[
2
]
=
GetType
(
CardType
.
TYPE_TUNER
);
types
[
0
]
=
(
c
.
race
==
0
)
?
MseCardType
.
CARD_TOKEN2
:
MseCardType
.
CARD_TOKEN
;
}
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_
EFFECT
))
else
if
(
c
.
IsType
(
CardType
.
TYPE_
RITUAL
))
{
{
types
[
2
]
=
GetType
(
CardType
.
TYPE_EFFECT
)
;
types
[
0
]
=
MseCardType
.
CARD_RITUAL
;
}
}
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_FUSION
))
else
if
(
types
[
0
]
==
MseCardType
.
CARD_NORMAL
)
{
if
(
c
.
IsType
(
CardType
.
TYPE_PENDULUM
))
//灵摆
types
[
1
]
=
GetType
(
CardType
.
TYPE_PENDULUM
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_TUNER
))
//调整
types
[
1
]
=
GetType
(
CardType
.
TYPE_TUNER
);
}
else
if
(
types
[
0
]
!=
MseCardType
.
CARD_EFFECT
)
{
//效果
if
(
c
.
IsType
(
CardType
.
TYPE_EFFECT
))
types
[
2
]
=
GetType
(
CardType
.
TYPE_EFFECT
);
}
else
{
//效果怪兽
types
[
2
]
=
GetType
(
CardType
.
TYPE_EFFECT
);
if
(
c
.
IsType
(
CardType
.
TYPE_PENDULUM
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_PENDULUM
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_TUNER
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_TUNER
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_SPIRIT
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_SPIRIT
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_TOON
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_TOON
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_UNION
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_UNION
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_DUAL
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_DUAL
);
else
if
(
c
.
IsType
(
CardType
.
TYPE_FLIP
))
types
[
1
]
=
GetType
(
CardType
.
TYPE_FLIP
);
else
{
{
types
[
1
]
=
GetType
(
CardType
.
TYPE_EFFECT
);
types
[
0
]
=
MseCardType
.
CARD_FUSION
;
types
[
2
]
=
""
;
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_SYNCHRO
))
{
types
[
0
]
=
MseCardType
.
CARD_SYNCHRO
;
}
else
if
(
c
.
IsType
(
CardType
.
TYPE_EFFECT
))
{
types
[
0
]
=
MseCardType
.
CARD_EFFECT
;
}
else
{
types
[
0
]
=
MseCardType
.
CARD_NORMAL
;
}
}
}
}
}
}
if
(
c
.
race
==
0
)
//如果没有种族
if
(
c
.
race
==
0
)
//如果没有种族
{
{
types
[
1
]
=
""
;
types
[
1
]
=
""
;
types
[
2
]
=
""
;
types
[
2
]
=
""
;
types
[
3
]
=
""
;
types
[
4
]
=
""
;
}
}
return
types
;
return
types
;
}
}
...
...
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