Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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
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
fallenstardust
YGOMobile-Cn-Ko-En
Commits
8b3e0b2d
Commit
8b3e0b2d
authored
Feb 21, 2020
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非效果怪兽卡查规则优化
卡查主字段可搜索到子字段(例:英雄——元素英雄)
parent
7b7cc6b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
56 deletions
+50
-56
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
.../main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
+45
-55
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+5
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
View file @
8b3e0b2d
...
@@ -130,64 +130,54 @@ class CardSearchInfo {
...
@@ -130,64 +130,54 @@ class CardSearchInfo {
if
(
types
.
length
>
0
)
{
if
(
types
.
length
>
0
)
{
boolean
st
=
false
;
boolean
st
=
false
;
for
(
long
cardType
:
types
)
{
for
(
long
cardType
:
types
)
{
// if (cardType == CardType.Spell.value() || cardType == CardType.Trap.value()) {
if
(
cardType
==
CardType
.
Spell
.
value
()
||
cardType
==
CardType
.
Trap
.
value
())
{
// st = true;
st
=
true
;
// break;
break
;
// }
}
//非效果怪兽
}
if
(
cardType
==
CardType
.
Non_Effect
.
value
())
{
//如果不是融合/仪式/同调/超量/连接
for
(
long
type
:
types
)
{
if
((
card
.
Type
&
CardType
.
Fusion
.
value
())
!=
CardType
.
Fusion
.
value
()
if
(
type
>
0
)
{
&&
(
card
.
Type
&
CardType
.
Ritual
.
value
())
!=
CardType
.
Ritual
.
value
()
if
(
st
)
{
&&
(
card
.
Type
&
CardType
.
Synchro
.
value
())
!=
CardType
.
Synchro
.
value
()
//魔法
&&
(
card
.
Type
&
CardType
.
Xyz
.
value
())
!=
CardType
.
Xyz
.
value
()
if
(
type
==
CardType
.
Normal
.
value
())
{
&&
(
card
.
Type
&
CardType
.
Link
.
value
())
!=
CardType
.
Link
.
value
()
//通常
)
if
(
card
.
isType
(
CardType
.
Normal
))
{
//带通常的魔法陷阱
if
(
card
.
Type
!=
(
CardType
.
Spell
.
value
()
|
CardType
.
Normal
.
value
())
&&
card
.
Type
!=
(
CardType
.
Trap
.
value
()
|
CardType
.
Normal
.
value
()))
{
return
false
;
}
}
else
{
//只有魔法/陷阱
if
(
card
.
Type
!=
CardType
.
Spell
.
value
()
&&
card
.
Type
!=
CardType
.
Trap
.
value
())
return
false
;
}
continue
;
}
}
//如果是效果怪兽
if
(
type
==
CardType
.
Effect
.
value
())
{
if
((
card
.
Type
&
CardType
.
Effect
.
value
())
==
CardType
.
Effect
.
value
())
{
//如果是融合/仪式/同调/超量/连接
if
((
card
.
Type
&
CardType
.
Fusion
.
value
())
==
CardType
.
Fusion
.
value
()
||
(
card
.
Type
&
CardType
.
Ritual
.
value
())
==
CardType
.
Ritual
.
value
()
||
(
card
.
Type
&
CardType
.
Synchro
.
value
())
==
CardType
.
Synchro
.
value
()
||
(
card
.
Type
&
CardType
.
Xyz
.
value
())
==
CardType
.
Xyz
.
value
()
||
(
card
.
Type
&
CardType
.
Link
.
value
())
==
CardType
.
Link
.
value
()
)
return
false
;
}
}
else
if
(
type
==
CardType
.
Non_Effect
.
value
())
{
//非效果怪兽
if
((
card
.
Type
&
CardType
.
Effect
.
value
())
==
CardType
.
Effect
.
value
())
return
false
;
}
else
if
((
card
.
Type
&
type
)
!=
type
)
{
return
false
;
return
false
;
}
else
if
((
card
.
Type
&
cardType
)
!=
cardType
)
{
}
return
false
;
}
}
}
}
//
// for (long type : types) {
// if (type > 0) {
// if (st) {
// //魔法
// if (type == CardType.Normal.value()) {
// //通常
// if (card.isType(CardType.Normal)) {
// //带通常的魔法陷阱
// if (card.Type != (CardType.Spell.value() | CardType.Normal.value())
// && card.Type != (CardType.Trap.value() | CardType.Normal.value())) {
// return false;
// }
// } else {
// //只有魔法/陷阱
// if (card.Type != CardType.Spell.value() && card.Type != CardType.Trap.value())
// return false;
// }
// continue;
// }
// }
// if ((card.Type & type) != type) {
// return false;
// }
// //如果是效果怪兽
// if (type == CardType.Effect.value()) {
// if ((card.Type & CardType.Effect.value()) == CardType.Effect.value()) {
// //如果是融合/仪式/同调/超量/连接
// if ((card.Type & CardType.Fusion.value()) == CardType.Fusion.value()
// || (card.Type & CardType.Ritual.value()) == CardType.Ritual.value()
// || (card.Type & CardType.Synchro.value()) == CardType.Synchro.value()
// || (card.Type & CardType.Xyz.value()) == CardType.Xyz.value()
// || (card.Type & CardType.Link.value()) == CardType.Link.value()
// )
// return false;
// }
// }
//
// }
// }
}
}
//TODO setcode
//TODO setcode
if
(
setcode
>
0
)
{
if
(
setcode
>
0
)
{
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
8b3e0b2d
...
@@ -103,7 +103,11 @@ public class Card extends CardData implements Parcelable {
...
@@ -103,7 +103,11 @@ public class Card extends CardData implements Parcelable {
public
boolean
isSetCode
(
long
_setcode
)
{
public
boolean
isSetCode
(
long
_setcode
)
{
long
[]
setcodes
=
getSetCode
();
long
[]
setcodes
=
getSetCode
();
for
(
long
setcode
:
setcodes
)
{
for
(
long
setcode
:
setcodes
)
{
if
(
setcode
==
_setcode
)
{
String
setcode16
=
Long
.
toHexString
(
setcode
);
if
(
setcode16
.
length
()==
4
){
if
(
setcode16
.
endsWith
(
Long
.
toHexString
(
_setcode
)))
return
true
;
}
else
if
(
setcode
==
_setcode
)
{
return
true
;
return
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