Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
Commits
1fbf5b26
Commit
1fbf5b26
authored
Mar 07, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
a88b350e
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
47 deletions
+99
-47
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+30
-0
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+1
-0
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+1
-1
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+14
-8
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+10
-6
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+43
-32
No files found.
Classes/ocgcore/card.cpp
View file @
1fbf5b26
...
...
@@ -3279,6 +3279,36 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
}
uint8
card
::
get_spsummonable_position
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
)
{
uint8
position
=
0
;
uint8
positions
[
4
]
=
{
POS_FACEUP_ATTACK
,
POS_FACEDOWN_ATTACK
,
POS_FACEUP_DEFENSE
,
POS_FACEDOWN_DEFENSE
};
effect_set
eset
;
for
(
int32
p
=
0
;
p
<
4
;
++
p
)
{
bool
poscheck
=
true
;
if
(
!
(
positions
[
p
]
&
sumpos
))
continue
;
if
((
data
.
type
&
(
TYPE_TOKEN
|
TYPE_LINK
))
&&
(
positions
[
p
]
&
POS_FACEDOWN
))
continue
;
pduel
->
game_field
->
filter_player_effect
(
sumplayer
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
continue
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
positions
[
p
],
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
poscheck
=
false
;
}
eset
.
clear
();
if
(
poscheck
)
position
|=
positions
[
p
];
}
return
position
;
}
int32
card
::
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
is_summonable_card
())
return
FALSE
;
...
...
Classes/ocgcore/card.h
View file @
1fbf5b26
...
...
@@ -346,6 +346,7 @@ public:
int32
is_can_be_flip_summoned
(
uint8
playerid
);
int32
is_special_summonable
(
uint8
playerid
,
uint32
summon_type
,
material_info
info
=
null_info
);
int32
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
);
uint8
get_spsummonable_position
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
);
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_affect_by_effect
(
effect
*
reason_effect
);
...
...
Classes/ocgcore/effect.h
View file @
1fbf5b26
...
...
@@ -201,7 +201,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_IMMEDIATELY_APPLY
=
0x80000000
,
};
enum
effect_flag2
:
uint32
{
EFFECT_FLAG2_MILLENNIUM_RESTRICT
=
0x0001
,
//
EFFECT_FLAG2_MILLENNIUM_RESTRICT = 0x0001,
EFFECT_FLAG2_COF
=
0x0002
,
EFFECT_FLAG2_WICKED
=
0x0004
,
EFFECT_FLAG2_OPTION
=
0x0008
,
...
...
Classes/ocgcore/field.cpp
View file @
1fbf5b26
...
...
@@ -1824,6 +1824,9 @@ int32 field::get_summon_count_limit(uint8 playerid) {
return
count
;
}
int32
field
::
get_draw_count
(
uint8
playerid
)
{
if
((
core
.
duel_rule
>=
3
)
&&
(
infos
.
turn_id
==
1
)
&&
(
infos
.
turn_player
==
playerid
))
{
return
0
;
}
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_DRAW_COUNT
,
&
eset
);
int32
count
=
player
[
playerid
].
draw_count
;
...
...
@@ -3069,7 +3072,8 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
return
FALSE
;
if
(
pcard
->
data
.
type
&
TYPE_LINK
)
sumpos
&=
POS_FACEUP_ATTACK
;
if
(
sumpos
==
0
)
uint8
position
=
pcard
->
get_spsummonable_position
(
reason_effect
,
sumtype
,
sumpos
,
playerid
,
toplayer
);
if
(
position
==
0
)
return
FALSE
;
sumtype
|=
SUMMON_TYPE_SPECIAL
;
save_lp_cost
();
...
...
@@ -3078,8 +3082,8 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
return
FALSE
;
}
restore_lp_cost
();
if
(
sumpos
&
POS_FACEDOWN
&&
is_player_affected_by_effect
(
playerid
,
EFFECT_DIVINE_LIGHT
))
sumpos
=
(
sumpos
&
POS_FACEUP
)
|
((
sumpos
&
POS_FACEDOWN
)
>>
1
);
if
(
position
&
POS_FACEDOWN
&&
is_player_affected_by_effect
(
playerid
,
EFFECT_DIVINE_LIGHT
))
position
=
(
position
&
POS_FACEUP
)
|
((
position
&
POS_FACEDOWN
)
>>
1
);
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
@@ -3089,7 +3093,7 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumpos
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
position
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
...
...
@@ -3377,8 +3381,9 @@ int32 field::get_cteffect(effect* peffect, int32 playerid, int32 store) {
continue
;
uint32
code
=
efit
.
first
;
if
(
code
==
EVENT_FREE_CHAIN
||
code
==
EVENT_PHASE
+
infos
.
phase
)
{
nil_event
.
event_code
=
code
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
nil_event
,
store
)
&&
!
store
)
tevent
test_event
;
test_event
.
event_code
=
code
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
test_event
,
store
)
&&
!
store
)
return
TRUE
;
}
else
{
for
(
const
auto
&
ev
:
core
.
point_event
)
{
...
...
@@ -3427,8 +3432,9 @@ int32 field::check_cteffect_hint(effect* peffect, uint8 playerid) {
continue
;
uint32
code
=
efit
.
first
;
if
(
code
==
EVENT_FREE_CHAIN
||
code
==
EVENT_PHASE
+
infos
.
phase
)
{
nil_event
.
event_code
=
code
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
nil_event
,
FALSE
)
tevent
test_event
;
test_event
.
event_code
=
code
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
test_event
,
FALSE
)
&&
(
code
!=
EVENT_FREE_CHAIN
||
check_hint_timing
(
feffect
)))
return
TRUE
;
}
else
{
...
...
Classes/ocgcore/operations.cpp
View file @
1fbf5b26
...
...
@@ -2747,11 +2747,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
else
targetplayer
=
1
-
sumplayer
;
}
if
(
positions
==
0
)
positions
=
POS_FACEUP_ATTACK
;
std
::
vector
<
int32
>
retval
;
peffect
->
get_value
(
target
,
0
,
&
retval
);
uint32
summon_info
=
retval
.
size
()
>
0
?
retval
[
0
]
:
0
;
positions
=
target
->
get_spsummonable_position
(
peffect
,
((
summon_info
&
0xf00ffff
)
|
SUMMON_TYPE_SPECIAL
),
positions
,
sumplayer
,
targetplayer
);
if
(
positions
==
0
)
positions
=
POS_FACEUP_ATTACK
;
uint32
zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0xff
;
target
->
summon_info
=
(
summon_info
&
0xf00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
target
->
current
.
location
<<
16
);
target
->
enable_field_effect
(
false
);
...
...
@@ -2958,7 +2959,8 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
if
(
ct1
==
0
)
zone
=
flag1
;
}
move_to_field
(
pcard
,
sumplayer
,
sumplayer
,
LOCATION_MZONE
,
POS_FACEUP
,
FALSE
,
0
,
FALSE
,
zone
);
uint8
positions
=
pcard
->
get_spsummonable_position
(
peffect
,
((
peffect
->
get_value
(
pcard
)
&
0xff00ffff
)
|
SUMMON_TYPE_SPECIAL
),
POS_FACEUP
,
sumplayer
,
sumplayer
);
move_to_field
(
pcard
,
sumplayer
,
sumplayer
,
LOCATION_MZONE
,
positions
,
FALSE
,
0
,
FALSE
,
zone
);
return
FALSE
;
}
case
24
:
{
...
...
@@ -3154,7 +3156,8 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
zone
&=
flag1
;
}
}
move_to_field
(
target
,
target
->
summon_player
,
playerid
,
LOCATION_MZONE
,
positions
,
FALSE
,
0
,
FALSE
,
zone
);
uint8
sumpositions
=
target
->
get_spsummonable_position
(
core
.
reason_effect
,
(
target
->
summon_info
&
0xff00ffff
),
positions
,
target
->
summon_player
,
playerid
);
move_to_field
(
target
,
target
->
summon_player
,
playerid
,
LOCATION_MZONE
,
sumpositions
,
FALSE
,
0
,
FALSE
,
zone
);
return
FALSE
;
}
case
2
:
{
...
...
@@ -5089,8 +5092,9 @@ int32 field::activate_effect(uint16 step, effect* peffect) {
case
0
:
{
card
*
phandler
=
peffect
->
get_handler
();
int32
playerid
=
phandler
->
current
.
controler
;
nil_event
.
event_code
=
EVENT_FREE_CHAIN
;
if
(
!
peffect
->
is_activateable
(
playerid
,
nil_event
))
tevent
test_event
;
test_event
.
event_code
=
EVENT_FREE_CHAIN
;
if
(
!
peffect
->
is_activateable
(
playerid
,
test_event
))
return
TRUE
;
chain
newchain
;
newchain
.
flag
=
0
;
...
...
Classes/ocgcore/processor.cpp
View file @
1fbf5b26
This diff is collapsed.
Click to expand it.
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