Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
ygopro
Commits
efbaa3ef
Commit
efbaa3ef
authored
Aug 26, 2021
by
nanahira
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework logic
parent
a94f9b84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+9
-9
No files found.
gframe/deck_manager.cpp
View file @
efbaa3ef
...
...
@@ -72,15 +72,15 @@ const std::unordered_map<int, int>* DeckManager::GetLFListContent(int lfhash) {
return
nullptr
;
}
int
DeckManager
::
IsGameRuleDisallowed
(
unsigned
char
hostInfoRule
,
unsigned
int
cardOt
)
{
bool
allow_ocg
=
hostInfoRule
==
0
||
hostInfoRule
==
4
||
hostInfoRule
==
2
;
// OCG can be used in OCG and OT duels
bool
allow_tcg
=
hostInfoRule
==
1
||
hostInfoRule
==
2
;
// TCG can be used in T
CG and OT duels
bool
allow_ccg
=
hostInfoRule
==
0
||
hostInfoRule
==
4
||
hostInfoRule
==
2
;
// CCG can be used in OCG, C
CG and OT duels
if
(
!
allow_ocg
&&
((
cardOt
&
0x3
)
==
0x1
))
return
DECKERROR_OCGONLY
;
if
(
!
allow_tcg
&&
((
cardOt
&
0x3
)
==
0x2
))
return
DECKERROR_TCGONLY
;
if
(
hostInfoRule
==
4
&&
!
(
cardOt
&
0x8
)
&&
(
cardOt
&
0x3
))
{
// in CCG duels, cards labeled with ither OCG or TCG, but not CCG, would not be allowed.
if
(
cardOt
&
0x3
==
0x2
)
{
if
(
hostInfoRule
!=
4
)
{
// non-CCG
bool
allow_ocg
=
hostInfoRule
==
0
||
hostInfoRule
==
2
;
// OCG can be used in O
CG and OT duels
bool
allow_tcg
=
hostInfoRule
==
1
||
hostInfoRule
==
2
;
// TCG can be used in T
CG and OT duels
if
(
!
allow_ocg
&&
((
cardOt
&
0x3
)
==
0x1
))
return
DECKERROR_OCGONLY
;
if
(
!
allow_tcg
&&
((
cardOt
&
0x3
)
==
0x2
))
return
DECKERROR_TCGONLY
;
}
else
if
(
(
cardOt
&
0x8
)
&&
(
cardOt
&
0x3
))
{
// in CCG duels, cards labeled with ither OCG or TCG, but not CCG, would not be allowed.
if
(
(
cardOt
&
0x3
)
==
0x2
)
{
return
DECKERROR_TCGONLY
;
}
else
{
return
DECKERROR_OCGONLY
;
...
...
mercury233
@mercury233
mentioned in commit
59c699c6
·
Sep 06, 2021
mentioned in commit
59c699c6
mentioned in commit 59c699c6bcf918e158c5242cad1a6a042c2ce592
Toggle commit list
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