Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
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
Senator John
MDPro3
Commits
9b50b9b3
Commit
9b50b9b3
authored
Apr 06, 2024
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
2c21cc43
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
39 deletions
+60
-39
Assets/Scripts/MDPro3/Duel/GameCard.cs
Assets/Scripts/MDPro3/Duel/GameCard.cs
+1
-1
Assets/Scripts/MDPro3/Servants/OcgCore.cs
Assets/Scripts/MDPro3/Servants/OcgCore.cs
+41
-27
Assets/Scripts/MDPro3/UI/Handler/PlaceSelector.cs
Assets/Scripts/MDPro3/UI/Handler/PlaceSelector.cs
+11
-10
Assets/Scripts/MDPro3/UI/Popup/PopupDuelSelectCard.cs
Assets/Scripts/MDPro3/UI/Popup/PopupDuelSelectCard.cs
+7
-1
No files found.
Assets/Scripts/MDPro3/Duel/GameCard.cs
View file @
9b50b9b3
...
...
@@ -1132,10 +1132,10 @@ namespace MDPro3
moveTime
=
0.1f
;
break
;
case
GameMessage
.
ShuffleSetCard
:
case
GameMessage
.
Swap
:
moveTime
=
0.2f
;
break
;
}
TokenPass
:
var
cardPlane
=
manager
.
GetElement
<
Transform
>(
"CardPlane"
);
var
pivot
=
manager
.
GetElement
<
Transform
>(
"Pivot"
);
var
offset
=
manager
.
GetElement
<
Transform
>(
"Offset"
);
...
...
Assets/Scripts/MDPro3/Servants/OcgCore.cs
View file @
9b50b9b3
...
...
@@ -2008,12 +2008,26 @@ namespace MDPro3
from
=
r
.
ReadGPS
();
code
=
r
.
ReadInt32
();
to
=
r
.
ReadGPS
();
var
from2
=
new
GPS
{
controller
=
from
.
controller
,
location
=
from
.
location
,
sequence
=
from
.
sequence
,
position
=
to
.
position
};
var
to2
=
new
GPS
{
controller
=
to
.
controller
,
location
=
to
.
location
,
sequence
=
to
.
sequence
,
position
=
from
.
position
};
card
=
GCS_Get
(
from
);
var
card_2
=
GCS_Get
(
to
);
if
(
card
!=
null
)
Sleep
((
int
)(
card
.
Move
(
to
)
*
100
));
card
=
GCS_Get
(
to
);
if
(
card
!=
null
)
Sleep
((
int
)(
card
.
Move
(
from
)
*
100
));
Sleep
((
int
)(
card
.
Move
(
to2
)
*
100
));
if
(
card_2
!=
null
)
Sleep
((
int
)(
card_2
.
Move
(
from2
)
*
100
));
break
;
case
GameMessage
.
Summoning
:
cardsInSelection
.
Clear
();
...
...
@@ -4713,35 +4727,25 @@ namespace MDPro3
return
new
int
[]
{
sum1
,
sum2
};
}
public
static
bool
CheckSelectable
(
List
<
GameCard
>
cards
,
GameCard
card
,
List
<
GameCard
>
selectedCards
,
int
max
,
List
<
GameCard
>
unselectables
=
null
)
public
static
bool
CheckSelectable
InSum
(
List
<
GameCard
>
cards
,
GameCard
card
,
List
<
GameCard
>
selectedCards
,
int
max
)
{
if
(
selectedCards
.
Count
>=
max
)
return
false
;
bool
returnValue
=
false
;
var
sum
=
GetSelectLevelSum
(
selectedCards
);
if
(
unselectables
==
null
)
unselectables
=
new
List
<
GameCard
>();
foreach
(
var
c
in
cards
)
if
(!
selectedCards
.
Contains
(
c
))
if
(!
unselectables
.
Contains
(
c
))
if
(
c
!=
card
)
if
(
sum
[
0
]
+
c
.
levelForSelect_1
>
Program
.
I
().
ocgcore
.
ES_level
||
sum
[
1
]
+
c
.
levelForSelect_2
>
Program
.
I
().
ocgcore
.
ES_level
)
unselectables
.
Add
(
c
);
if
(
sum
[
0
]
+
card
.
levelForSelect_1
==
Program
.
I
().
ocgcore
.
ES_level
||
sum
[
1
]
+
card
.
levelForSelect_2
==
Program
.
I
().
ocgcore
.
ES_level
)
return
true
;
else
{
if
(
sum
[
0
]
+
card
.
levelForSelect_1
>
Program
.
I
().
ocgcore
.
ES_level
||
sum
[
1
]
+
card
.
levelForSelect_2
>
Program
.
I
().
ocgcore
.
ES_level
)
return
false
;
var
newSelectedCards
=
new
List
<
GameCard
>(
selectedCards
)
{
card
};
foreach
(
var
c
in
cards
)
if
(!
unselectables
.
Contains
(
c
))
if
(!
newSelectedCards
.
Contains
(
c
))
{
returnValue
=
CheckSelectable
(
cards
,
c
,
newSelectedCards
,
max
,
unselectables
);
returnValue
=
CheckSelectableInSum
(
cards
,
c
,
newSelectedCards
,
max
);
if
(
returnValue
)
return
true
;
}
}
return
returnValue
;
}
...
...
@@ -5319,6 +5323,16 @@ namespace MDPro3
if
(
currentMessage
==
GameMessage
.
SelectCard
||
currentMessage
==
GameMessage
.
SelectCounter
)
hintText
.
text
=
fieldHint
+
": "
+
0
+
"/"
+
fieldMax
;
else
if
(
currentMessage
==
GameMessage
.
SelectSum
&&
!
ES_overFlow
)
{
foreach
(
var
place
in
places
)
if
(
place
.
cardSelecting
)
if
(!
place
.
cardSelected
)
if
(
CheckSelectableInSum
(
cardsInSelection
,
place
.
cookieCard
,
cardsMustBeSelected
,
ES_max
))
place
.
CardInThisZoneSelectable
();
else
place
.
CardInThisZoneUnselectable
();
}
else
hintText
.
text
=
fieldHint
;
}
...
...
@@ -5351,7 +5365,7 @@ namespace MDPro3
foreach
(
var
place
in
places
)
if
(
place
.
cardSelecting
)
if
(!
place
.
cardSelected
)
if
(
CheckSelectable
(
cardsInSelection
,
place
.
cookieCard
,
selected
,
ES_max
))
if
(
CheckSelectable
InSum
(
cardsInSelection
,
place
.
cookieCard
,
selected
,
ES_max
))
place
.
CardInThisZoneSelectable
();
else
place
.
CardInThisZoneUnselectable
();
...
...
Assets/Scripts/MDPro3/UI/Handler/PlaceSelector.cs
View file @
9b50b9b3
...
...
@@ -203,6 +203,8 @@ namespace MDPro3.UI
}
else
if
(!
cardSelected
&&
!
cardUnselectable
&&
!
cardPreselected
)
selectButton
.
Show
();
else
if
(
cardSelected
&&
!
cardUnselectable
&&
!
cardPreselected
)
UnselectCardInThisZone
();
var
card
=
FindCardInThisPlace
();
if
(
card
!=
null
)
card
.
OnClick
();
...
...
@@ -421,6 +423,15 @@ namespace MDPro3.UI
selectCardPush
.
SetActive
(
true
);
Program
.
I
().
ocgcore
.
FieldSelectRefresh
(
cookieCard
);
}
public
void
UnselectCardInThisZone
()
{
if
(
Program
.
I
().
ocgcore
.
currentMessage
==
GameMessage
.
SelectCounter
)
return
;
cardSelected
=
false
;
Program
.
I
().
ocgcore
.
FieldSelectRefresh
(
cookieCard
);
}
public
void
CardInThisZoneSelectable
()
{
cardUnselectable
=
false
;
...
...
@@ -489,16 +500,6 @@ namespace MDPro3.UI
}
}
public
void
StopShowingZoneHighlight
()
{
select
.
SetActive
(
false
);
}
public
void
StopShowingCardHighlight
()
{
selectCard
.
SetActive
(
false
);
selectCardPush
.
SetActive
(
false
);
selectCardPush
.
SetActive
(
true
);
}
public
GameCard
FindCardInThisPlace
()
{
...
...
Assets/Scripts/MDPro3/UI/Popup/PopupDuelSelectCard.cs
View file @
9b50b9b3
...
...
@@ -92,6 +92,12 @@ namespace MDPro3.UI
mono
.
PreSelectThis
();
break
;
}
foreach
(
var
mono
in
monos
)
if
(!
mono
.
selected
)
if
(
OcgCore
.
CheckSelectableInSum
(
Program
.
I
().
ocgcore
.
cardsInSelection
,
mono
.
card
,
core
.
cardsMustBeSelected
,
max
+
core
.
cardsMustBeSelected
.
Count
))
mono
.
SelectableThis
();
else
mono
.
UnselectableThis
();
title
.
text
=
hint
+
"-"
+
OcgCore
.
GetSelectLevelSum
(
GetSelected
())[
0
].
ToString
()
+
"/"
+
core
.
ES_level
;
}
else
if
(
core
.
currentMessage
==
GameMessage
.
SortCard
...
...
@@ -135,7 +141,7 @@ namespace MDPro3.UI
foreach
(
var
mono
in
monos
)
if
(!
mono
.
selected
)
if
(
OcgCore
.
CheckSelectable
(
Program
.
I
().
ocgcore
.
cardsInSelection
,
mono
.
card
,
selected
,
max
+
core
.
cardsMustBeSelected
.
Count
))
if
(
OcgCore
.
CheckSelectable
InSum
(
Program
.
I
().
ocgcore
.
cardsInSelection
,
mono
.
card
,
selected
,
max
+
core
.
cardsMustBeSelected
.
Count
))
mono
.
SelectableThis
();
else
mono
.
UnselectableThis
();
...
...
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