Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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-core
Commits
23e6b1f9
Commit
23e6b1f9
authored
Jul 15, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
53e59d45
4aa2025e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
13 deletions
+49
-13
libduel.cpp
libduel.cpp
+15
-1
operations.cpp
operations.cpp
+34
-12
No files found.
libduel.cpp
View file @
23e6b1f9
...
...
@@ -3458,7 +3458,17 @@ int32 scriptlib::duel_select_disable_field(lua_State * L) {
ct4
=
pduel
->
game_field
->
get_useable_count
(
NULL
,
1
-
playerid
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
,
0xff
,
&
plist
);
flag
=
(
flag
&
0xffffff
)
|
(
plist
<<
24
);
}
flag
|=
filter
|
0xe0e0e0e0
;
if
((
location1
&
LOCATION_MZONE
)
&&
(
location2
&
LOCATION_MZONE
)
&&
pduel
->
game_field
->
core
.
duel_rule
>=
4
)
{
if
(
pduel
->
game_field
->
is_location_useable
(
playerid
,
LOCATION_MZONE
,
5
))
{
flag
&=
~
(
0x1
<<
5
);
ct1
+=
1
;
}
if
(
pduel
->
game_field
->
is_location_useable
(
playerid
,
LOCATION_MZONE
,
6
))
{
flag
&=
~
(
0x1
<<
6
);
ct1
+=
1
;
}
}
flag
|=
filter
|
0xe080e080
;
if
(
count
>
ct1
+
ct2
+
ct3
+
ct4
)
count
=
ct1
+
ct2
+
ct3
+
ct4
;
if
(
count
==
0
)
...
...
@@ -3477,6 +3487,10 @@ int32 scriptlib::duel_select_disable_field(lua_State * L) {
dfflag
|=
0x1u
<<
(
s
+
(
p
==
playerid
?
0
:
16
)
+
(
l
==
LOCATION_MZONE
?
0
:
8
));
pa
+=
3
;
}
if
(
dfflag
&
(
0x1
<<
5
))
dfflag
|=
0x1
<<
(
16
+
6
);
if
(
dfflag
&
(
0x1
<<
6
))
dfflag
|=
0x1
<<
(
16
+
5
);
lua_pushinteger
(
L
,
dfflag
);
return
1
;
});
...
...
operations.cpp
View file @
23e6b1f9
...
...
@@ -408,6 +408,16 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
shuffle
(
playerid
,
LOCATION_HAND
);
}
for
(
auto
&
pcard
:
*
drawed_set
)
{
if
(
pcard
->
owner
!=
pcard
->
current
.
controler
)
{
effect
*
deffect
=
pduel
->
new_effect
();
deffect
->
owner
=
pcard
;
deffect
->
code
=
0
;
deffect
->
type
=
EFFECT_TYPE_SINGLE
;
deffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_CLIENT_HINT
;
deffect
->
description
=
67
;
deffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
pcard
->
add_effect
(
deffect
);
}
raise_single_event
(
pcard
,
0
,
EVENT_DRAW
,
reason_effect
,
reason
,
reason_player
,
playerid
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_TO_HAND
,
reason_effect
,
reason
,
reason_player
,
playerid
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_MOVE
,
reason_effect
,
reason
,
reason_player
,
playerid
,
0
);
...
...
@@ -4063,6 +4073,16 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
pcard
->
clear_card_target
();
if
(
nloc
==
LOCATION_HAND
)
{
if
(
pcard
->
owner
!=
pcard
->
current
.
controler
)
{
effect
*
deffect
=
pduel
->
new_effect
();
deffect
->
owner
=
pcard
;
deffect
->
code
=
0
;
deffect
->
type
=
EFFECT_TYPE_SINGLE
;
deffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_CLIENT_HINT
;
deffect
->
description
=
67
;
deffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
pcard
->
add_effect
(
deffect
);
}
tohand
.
insert
(
pcard
);
raise_single_event
(
pcard
,
0
,
EVENT_TO_HAND
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
}
...
...
@@ -4221,6 +4241,16 @@ int32 field::discard_deck(uint16 step, uint8 playerid, uint8 count, uint32 reaso
pduel
->
write_buffer8
(
pcard
->
current
.
position
);
pduel
->
write_buffer32
(
pcard
->
current
.
reason
);
if
(
dest
==
LOCATION_HAND
)
{
if
(
pcard
->
owner
!=
pcard
->
current
.
controler
)
{
effect
*
deffect
=
pduel
->
new_effect
();
deffect
->
owner
=
pcard
;
deffect
->
code
=
0
;
deffect
->
type
=
EFFECT_TYPE_SINGLE
;
deffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_CLIENT_HINT
;
deffect
->
description
=
67
;
deffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
pcard
->
add_effect
(
deffect
);
}
tohand
.
insert
(
pcard
);
raise_single_event
(
pcard
,
0
,
EVENT_TO_HAND
,
pcard
->
current
.
reason_effect
,
pcard
->
current
.
reason
,
pcard
->
current
.
reason_player
,
0
,
0
);
}
else
if
(
dest
==
LOCATION_DECK
||
dest
==
LOCATION_EXTRA
)
{
...
...
@@ -6033,7 +6063,8 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event
();
}
else
{
solve_continuous
(
peffect
->
get_handler_player
(),
peffect
,
e
);
core
.
units
.
begin
()
->
step
=
1
;
//call Duel.SetCoinResult in operation if necessary
return
TRUE
;
}
return
FALSE
;
}
...
...
@@ -6042,11 +6073,6 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event
();
return
TRUE
;
}
case
2
:
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
core
.
coin_result
[
i
]
=
(
returns
.
ivalue
[
0
]
>>
(
i
*
4
))
&
0xf
;
return
TRUE
;
}
}
return
TRUE
;
}
...
...
@@ -6094,7 +6120,8 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event
();
}
else
{
solve_continuous
(
peffect
->
get_handler_player
(),
peffect
,
e
);
core
.
units
.
begin
()
->
step
=
1
;
//call Duel.SetDiceResult in operation if necessary
return
TRUE
;
}
return
FALSE
;
}
...
...
@@ -6103,11 +6130,6 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
process_instant_event
();
return
TRUE
;
}
case
2
:
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
core
.
dice_result
[
i
]
=
(
returns
.
ivalue
[
0
]
>>
(
i
*
4
))
&
0xf
;
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