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
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
ygopro-core
Commits
2f0094c1
Commit
2f0094c1
authored
Jan 06, 2024
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
04405a0c
9906c04b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
13 deletions
+19
-13
card.h
card.h
+4
-1
common.h
common.h
+4
-0
effect.cpp
effect.cpp
+0
-2
field.cpp
field.cpp
+3
-3
libduel.cpp
libduel.cpp
+2
-2
operations.cpp
operations.cpp
+6
-5
No files found.
card.h
View file @
2f0094c1
...
@@ -389,6 +389,9 @@ public:
...
@@ -389,6 +389,9 @@ public:
#define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_LINK 0x4c000000
#define SUMMON_TYPE_LINK 0x4c000000
#define SUMMON_TYPE_MAIN 0xf0000000
#define SUMMON_TYPE_LOCATION 0x00ff0000
//Counter
//Counter
#define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_WITHOUT_PERMIT 0x1000
//#define COUNTER_NEED_ENABLE 0x2000
//#define COUNTER_NEED_ENABLE 0x2000
...
@@ -403,7 +406,7 @@ public:
...
@@ -403,7 +406,7 @@ public:
#define ASSUME_ATTACK 7
#define ASSUME_ATTACK 7
#define ASSUME_DEFENSE 8
#define ASSUME_DEFENSE 8
//S
ummon
info
//S
pecial Summon effect
info
#define SUMMON_INFO_CODE 0x01
#define SUMMON_INFO_CODE 0x01
#define SUMMON_INFO_CODE2 0x02
#define SUMMON_INFO_CODE2 0x02
#define SUMMON_INFO_TYPE 0x04
#define SUMMON_INFO_TYPE 0x04
...
...
common.h
View file @
2f0094c1
...
@@ -24,6 +24,10 @@ typedef signed char int8;
...
@@ -24,6 +24,10 @@ typedef signed char int8;
#define ADD_BIT(x,y) ((x)|=(y))
#define ADD_BIT(x,y) ((x)|=(y))
#define REMOVE_BIT(x,y) ((x)&=~(y))
#define REMOVE_BIT(x,y) ((x)&=~(y))
constexpr
bool
match_all
(
uint32
x
,
uint32
y
)
{
return
(
x
&
y
)
==
y
;
}
#define OPERATION_SUCCESS 1
#define OPERATION_SUCCESS 1
#define OPERATION_FAIL 0
#define OPERATION_FAIL 0
#define OPERATION_CANCELED -1
#define OPERATION_CANCELED -1
...
...
effect.cpp
View file @
2f0094c1
...
@@ -43,8 +43,6 @@ int32 effect::is_self_destroy_related() {
...
@@ -43,8 +43,6 @@ int32 effect::is_self_destroy_related() {
int32
effect
::
is_can_be_forbidden
()
{
int32
effect
::
is_can_be_forbidden
()
{
if
(
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_NEGATE
))
if
(
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_NEGATE
))
return
FALSE
;
return
FALSE
;
if
(
code
==
EFFECT_CHANGE_CODE
)
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
// check if a single/field/equip effect is available
// check if a single/field/equip effect is available
...
...
field.cpp
View file @
2f0094c1
...
@@ -534,10 +534,10 @@ card* field::get_field_card(uint32 playerid, uint32 location, uint32 sequence) {
...
@@ -534,10 +534,10 @@ card* field::get_field_card(uint32 playerid, uint32 location, uint32 sequence) {
case
LOCATION_PZONE
:
{
case
LOCATION_PZONE
:
{
if
(
sequence
==
0
)
{
if
(
sequence
==
0
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
4
?
0
:
6
];
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
4
?
0
:
6
];
return
pcard
&&
pcard
->
current
.
pzone
?
pcard
:
0
;
return
(
pcard
&&
pcard
->
current
.
pzone
)
?
pcard
:
0
;
}
else
if
(
sequence
==
1
)
{
}
else
if
(
sequence
==
1
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
4
?
4
:
7
];
card
*
pcard
=
player
[
playerid
].
list_szone
[
core
.
duel_rule
>=
4
?
4
:
7
];
return
pcard
&&
pcard
->
current
.
pzone
?
pcard
:
0
;
return
(
pcard
&&
pcard
->
current
.
pzone
)
?
pcard
:
0
;
}
else
}
else
return
nullptr
;
return
nullptr
;
break
;
break
;
...
@@ -1895,7 +1895,7 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
...
@@ -1895,7 +1895,7 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
)
{
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
)
{
if
(
location
&
LOCATION_MZONE
)
{
if
(
location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
if
(
pcard
&&
!
pcard
->
is_status
(
STATUS_SUMMONING
)
)
material_base
->
insert
(
pcard
);
material_base
->
insert
(
pcard
);
}
}
}
}
...
...
libduel.cpp
View file @
2f0094c1
...
@@ -1824,14 +1824,14 @@ int32 scriptlib::duel_disable_summon(lua_State *L) {
...
@@ -1824,14 +1824,14 @@ int32 scriptlib::duel_disable_summon(lua_State *L) {
sumplayer
=
pcard
->
summon_player
;
sumplayer
=
pcard
->
summon_player
;
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
if
((
pcard
->
summon_info
&
SUMMON_TYPE_PENDULUM
)
!=
SUMMON_TYPE_PENDULUM
)
if
(
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_FLIP
)
&&
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_DUAL
)
)
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
}
else
{
}
else
{
for
(
auto
&
pcard
:
pgroup
->
container
)
{
for
(
auto
&
pcard
:
pgroup
->
container
)
{
sumplayer
=
pcard
->
summon_player
;
sumplayer
=
pcard
->
summon_player
;
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
pcard
->
set_status
(
STATUS_SUMMON_DISABLED
,
TRUE
);
if
((
pcard
->
summon_info
&
SUMMON_TYPE_PENDULUM
)
!=
SUMMON_TYPE_PENDULUM
)
if
(
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_FLIP
)
&&
!
match_all
(
pcard
->
summon_info
,
SUMMON_TYPE_DUAL
)
)
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
FALSE
);
}
}
}
}
...
...
operations.cpp
View file @
2f0094c1
...
@@ -1913,7 +1913,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1913,7 +1913,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
core
.
units
.
begin
()
->
ptr2
=
0
;
core
.
units
.
begin
()
->
ptr2
=
0
;
}
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
PLAYER_NONE
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
adjust_instant
();
adjust_instant
();
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
return
TRUE
;
return
TRUE
;
...
@@ -2020,7 +2020,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2020,7 +2020,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
core
.
units
.
begin
()
->
ptr1
=
0
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
PLAYER_NONE
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -2902,7 +2902,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2902,7 +2902,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
core
.
units
.
begin
()
->
ptr1
=
0
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
PLAYER_NONE
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
adjust_instant
();
adjust_instant
();
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
return
TRUE
;
return
TRUE
;
...
@@ -3091,7 +3091,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -3091,7 +3091,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
++
cit
;
++
cit
;
}
}
if
(
cset
.
size
())
{
if
(
cset
.
size
())
{
send_to
(
&
cset
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
&
cset
,
0
,
REASON_RULE
,
PLAYER_NONE
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
adjust_instant
();
adjust_instant
();
}
}
if
(
pgroup
->
container
.
size
()
==
0
)
{
if
(
pgroup
->
container
.
size
()
==
0
)
{
...
@@ -3726,6 +3726,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3726,6 +3726,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
core
.
destroy_canceled
.
insert
(
pcard
);
core
.
destroy_canceled
.
insert
(
pcard
);
cit
=
targets
->
container
.
erase
(
cit
);
cit
=
targets
->
container
.
erase
(
cit
);
continue
;
}
}
}
}
++
cit
;
++
cit
;
...
...
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