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
887f84df
Commit
887f84df
authored
May 24, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
9ac0be73
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
257 additions
and
149 deletions
+257
-149
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+45
-49
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+9
-9
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+9
-4
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+3
-2
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+60
-18
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+124
-63
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+5
-3
Classes/ocgcore/scriptlib.h
Classes/ocgcore/scriptlib.h
+2
-1
No files found.
Classes/ocgcore/card.cpp
View file @
887f84df
This diff is collapsed.
Click to expand it.
Classes/ocgcore/card.h
View file @
887f84df
...
@@ -289,9 +289,9 @@ public:
...
@@ -289,9 +289,9 @@ public:
void
filter_immune_effect
();
void
filter_immune_effect
();
void
filter_disable_related_cards
();
void
filter_disable_related_cards
();
int32
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_summon_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_summon_procedure
(
effect
*
p
roc
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
filter_set_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
filter_set_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_set_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_set_procedure
(
effect
*
p
roc
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
void
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint32
summon_type
);
void
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint32
summon_type
);
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
);
...
@@ -307,8 +307,8 @@ public:
...
@@ -307,8 +307,8 @@ public:
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
);
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
);
int32
is_summonable_card
();
int32
is_summonable_card
();
int32
is_fusion_summonable_card
(
uint32
summon_type
);
int32
is_fusion_summonable_card
(
uint32
summon_type
);
int32
is_spsummonable
(
effect
*
p
effect
);
int32
is_spsummonable
(
effect
*
p
roc
);
int32
is_summonable
(
effect
*
p
effect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
);
int32
is_summonable
(
effect
*
p
roc
,
uint8
min_tribute
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
);
int32
is_can_be_summoned
(
uint8
playerid
,
uint8
ingore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_can_be_summoned
(
uint8
playerid
,
uint8
ingore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
get_summon_tribute_count
();
int32
get_summon_tribute_count
();
int32
get_set_tribute_count
();
int32
get_set_tribute_count
();
...
@@ -317,16 +317,16 @@ public:
...
@@ -317,16 +317,16 @@ public:
int32
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
);
int32
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
);
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
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_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_affect_by_effect
(
effect
*
p
effect
);
int32
is_affect_by_effect
(
effect
*
reason_
effect
);
int32
is_destructable
();
int32
is_destructable
();
int32
is_destructable_by_battle
(
card
*
pcard
);
int32
is_destructable_by_battle
(
card
*
pcard
);
effect
*
check_indestructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
);
effect
*
check_indestructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_destructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
);
int32
is_destructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_removeable
(
uint8
playerid
,
uint8
pos
,
uint32
reason
);
int32
is_removeable
(
uint8
playerid
,
uint8
pos
,
uint32
reason
);
int32
is_removeable_as_cost
(
uint8
playerid
,
uint8
pos
);
int32
is_removeable_as_cost
(
uint8
playerid
,
uint8
pos
);
int32
is_releasable_by_summon
(
uint8
playerid
,
card
*
pcard
);
int32
is_releasable_by_summon
(
uint8
playerid
,
card
*
pcard
);
int32
is_releasable_by_nonsummon
(
uint8
playerid
);
int32
is_releasable_by_nonsummon
(
uint8
playerid
);
int32
is_releasable_by_effect
(
uint8
playerid
,
effect
*
p
effect
);
int32
is_releasable_by_effect
(
uint8
playerid
,
effect
*
reason_
effect
);
int32
is_capable_send_to_grave
(
uint8
playerid
);
int32
is_capable_send_to_grave
(
uint8
playerid
);
int32
is_capable_send_to_hand
(
uint8
playerid
);
int32
is_capable_send_to_hand
(
uint8
playerid
);
int32
is_capable_send_to_deck
(
uint8
playerid
);
int32
is_capable_send_to_deck
(
uint8
playerid
);
...
@@ -343,7 +343,7 @@ public:
...
@@ -343,7 +343,7 @@ public:
int32
is_capable_change_control
();
int32
is_capable_change_control
();
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
int32
is_capable_be_battle_target
(
card
*
pcard
);
int32
is_capable_be_battle_target
(
card
*
pcard
);
int32
is_capable_be_effect_target
(
effect
*
p
effect
,
uint8
playerid
);
int32
is_capable_be_effect_target
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_capable_overlay
(
uint8
playerid
);
int32
is_capable_overlay
(
uint8
playerid
);
int32
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
);
int32
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
);
int32
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
=
0
);
int32
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
=
0
);
...
...
Classes/ocgcore/field.cpp
View file @
887f84df
...
@@ -1266,6 +1266,11 @@ void field::remove_oath_effect(effect* reason_effect) {
...
@@ -1266,6 +1266,11 @@ void field::remove_oath_effect(effect* reason_effect) {
}
}
}
}
}
}
void
field
::
release_oath_relation
(
effect
*
reason_effect
)
{
for
(
auto
&
oeit
:
effects
.
oath
)
if
(
oeit
.
second
==
reason_effect
)
oeit
.
second
=
0
;
}
void
field
::
reset_phase
(
uint32
phase
)
{
void
field
::
reset_phase
(
uint32
phase
)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
auto
rm
=
eit
++
;
auto
rm
=
eit
++
;
...
@@ -2868,7 +2873,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
...
@@ -2868,7 +2873,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
p
effect
,
uint32
reason
)
{
int32
field
::
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
reason_
effect
,
uint32
reason
)
{
if
(
pcard
->
current
.
location
!=
LOCATION_HAND
)
if
(
pcard
->
current
.
location
!=
LOCATION_HAND
)
return
FALSE
;
return
FALSE
;
effect_set
eset
;
effect_set
eset
;
...
@@ -2878,7 +2883,7 @@ int32 field::is_player_can_discard_hand(uint8 playerid, card * pcard, effect * p
...
@@ -2878,7 +2883,7 @@ int32 field::is_player_can_discard_hand(uint8 playerid, card * pcard, effect * p
return
FALSE
;
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
4
))
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
4
))
return
FALSE
;
return
FALSE
;
...
@@ -2954,7 +2959,7 @@ int32 field::is_player_can_spsummon(uint8 playerid) {
...
@@ -2954,7 +2959,7 @@ int32 field::is_player_can_spsummon(uint8 playerid) {
}
}
return
is_player_can_spsummon_count
(
playerid
,
1
);
return
is_player_can_spsummon_count
(
playerid
,
1
);
}
}
int32
field
::
is_player_can_spsummon
(
effect
*
p
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
)
{
int32
field
::
is_player_can_spsummon
(
effect
*
reason_
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
)
{
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
))
return
FALSE
;
return
FALSE
;
if
(
pcard
->
is_status
(
STATUS_FORBIDDEN
))
if
(
pcard
->
is_status
(
STATUS_FORBIDDEN
))
...
@@ -2985,7 +2990,7 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
...
@@ -2985,7 +2990,7 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumpos
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumpos
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
return
FALSE
;
return
FALSE
;
}
}
...
...
Classes/ocgcore/field.h
View file @
887f84df
...
@@ -391,6 +391,7 @@ public:
...
@@ -391,6 +391,7 @@ public:
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
remove_effect
(
effect
*
peffect
);
void
remove_effect
(
effect
*
peffect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
release_oath_relation
(
effect
*
reason_effect
);
void
reset_phase
(
uint32
phase
);
void
reset_phase
(
uint32
phase
);
void
reset_chain
();
void
reset_chain
();
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
...
@@ -455,13 +456,13 @@ public:
...
@@ -455,13 +456,13 @@ public:
int32
is_player_can_draw
(
uint8
playerid
);
int32
is_player_can_draw
(
uint8
playerid
);
int32
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
p
effect
,
uint32
reason
);
int32
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
reason_
effect
,
uint32
reason
);
int32
is_player_can_action
(
uint8
playerid
,
uint32
actionlimit
);
int32
is_player_can_action
(
uint8
playerid
,
uint32
actionlimit
);
int32
is_player_can_summon
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_summon
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_mset
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_mset
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_sset
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_sset
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_spsummon
(
uint8
playerid
);
int32
is_player_can_spsummon
(
uint8
playerid
);
int32
is_player_can_spsummon
(
effect
*
p
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
);
int32
is_player_can_spsummon
(
effect
*
reason_
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
);
int32
is_player_can_flipsummon
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_flipsummon
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_spsummon_monster
(
uint8
playerid
,
uint8
toplayer
,
uint8
sumpos
,
uint32
sumtype
,
card_data
*
pdata
);
int32
is_player_can_spsummon_monster
(
uint8
playerid
,
uint8
toplayer
,
uint8
sumpos
,
uint32
sumtype
,
card_data
*
pdata
);
int32
is_player_can_spsummon_count
(
uint8
playerid
,
uint32
count
);
int32
is_player_can_spsummon_count
(
uint8
playerid
,
uint32
count
);
...
...
Classes/ocgcore/libduel.cpp
View file @
887f84df
...
@@ -260,25 +260,30 @@ int32 scriptlib::duel_summon(lua_State *L) {
...
@@ -260,25 +260,30 @@ int32 scriptlib::duel_summon(lua_State *L) {
check_action_permission
(
L
);
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
min_tribute
=
0
;
uint32
min_tribute
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
if
(
lua_gettop
(
L
)
>=
5
)
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
zone
=
0x1f
;
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
6
)
if
(
lua_gettop
(
L
)
>=
6
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_special_summon_rule
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_special_summon_rule
(
lua_State
*
L
)
{
...
@@ -290,11 +295,16 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
...
@@ -290,11 +295,16 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
sumtype
=
0
;
uint32
sumtype
=
0
;
if
(
lua_gettop
(
L
)
>=
3
)
if
(
lua_gettop
(
L
)
>=
3
)
sumtype
=
(
uint32
)
lua_tointeger
(
L
,
3
);
sumtype
=
(
uint32
)
lua_tointeger
(
L
,
3
);
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
sumtype
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
sumtype
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_synchro_summon
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_synchro_summon
(
lua_State
*
L
)
{
...
@@ -305,6 +315,9 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
...
@@ -305,6 +315,9 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
card
*
tuner
=
0
;
card
*
tuner
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
...
@@ -314,7 +327,9 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
...
@@ -314,7 +327,9 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
!
lua_isnil
(
L
,
4
))
{
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
mg
=
pduel
->
new_group
(
pgroup
->
container
);
mg
->
is_readonly
=
TRUE
;
}
}
}
}
int32
minc
=
0
;
int32
minc
=
0
;
...
@@ -323,13 +338,15 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
...
@@ -323,13 +338,15 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
int32
maxc
=
0
;
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
if
(
lua_gettop
(
L
)
>=
6
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pduel
->
game_field
->
core
.
limit_syn
=
mg
;
pduel
->
game_field
->
core
.
limit_syn
=
mg
;
pduel
->
game_field
->
core
.
limit_syn_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_syn_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_syn_maxc
=
maxc
;
pduel
->
game_field
->
core
.
limit_syn_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_SYNCHRO
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_SYNCHRO
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_xyz_summon
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_xyz_summon
(
lua_State
*
L
)
{
...
@@ -340,10 +357,15 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
...
@@ -340,10 +357,15 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
group
*
materials
=
0
;
group
*
materials
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
materials
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
materials
=
pduel
->
new_group
(
pgroup
->
container
);
materials
->
is_readonly
=
TRUE
;
}
}
int32
minc
=
0
;
int32
minc
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
if
(
lua_gettop
(
L
)
>=
4
)
...
@@ -351,12 +373,14 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
...
@@ -351,12 +373,14 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
int32
maxc
=
0
;
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
if
(
lua_gettop
(
L
)
>=
5
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
5
);
maxc
=
(
int32
)
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_xyz
=
materials
;
pduel
->
game_field
->
core
.
limit_xyz
=
materials
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
maxc
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_link_summon
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_link_summon
(
lua_State
*
L
)
{
...
@@ -367,11 +391,16 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
...
@@ -367,11 +391,16 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
group
*
materials
=
0
;
group
*
materials
=
0
;
card
*
lcard
=
0
;
card
*
lcard
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
materials
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
materials
=
pduel
->
new_group
(
pgroup
->
container
);
materials
->
is_readonly
=
TRUE
;
}
}
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
!
lua_isnil
(
L
,
4
))
{
if
(
!
lua_isnil
(
L
,
4
))
{
...
@@ -385,38 +414,45 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
...
@@ -385,38 +414,45 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
int32
maxc
=
0
;
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
if
(
lua_gettop
(
L
)
>=
6
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_link
=
materials
;
pduel
->
game_field
->
core
.
limit_link
=
materials
;
pduel
->
game_field
->
core
.
limit_link_card
=
lcard
;
pduel
->
game_field
->
core
.
limit_link_card
=
lcard
;
pduel
->
game_field
->
core
.
limit_link_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_link_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
maxc
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_LINK
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_LINK
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_setm
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_setm
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
min_tribute
=
0
;
uint32
min_tribute
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
if
(
lua_gettop
(
L
)
>=
5
)
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
zone
=
0x1f
;
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
6
)
if
(
lua_gettop
(
L
)
>=
6
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
mset
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
mset
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_sets
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_sets
(
lua_State
*
L
)
{
...
@@ -3049,6 +3085,11 @@ int32 scriptlib::duel_get_fusion_material(lua_State *L) {
...
@@ -3049,6 +3085,11 @@ int32 scriptlib::duel_get_fusion_material(lua_State *L) {
interpreter
::
group2value
(
L
,
pgroup
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_is_summon_cancelable
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
core
.
summon_cancelable
);
return
1
;
}
int32
scriptlib
::
duel_set_must_select_cards
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_set_must_select_cards
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
1
,
TRUE
))
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
1
,
TRUE
))
{
...
@@ -4525,6 +4566,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -4525,6 +4566,7 @@ static const struct luaL_Reg duellib[] = {
{
"GetRitualMaterial"
,
scriptlib
::
duel_get_ritual_material
},
{
"GetRitualMaterial"
,
scriptlib
::
duel_get_ritual_material
},
{
"ReleaseRitualMaterial"
,
scriptlib
::
duel_release_ritual_material
},
{
"ReleaseRitualMaterial"
,
scriptlib
::
duel_release_ritual_material
},
{
"GetFusionMaterial"
,
scriptlib
::
duel_get_fusion_material
},
{
"GetFusionMaterial"
,
scriptlib
::
duel_get_fusion_material
},
{
"IsSummonCancelable"
,
scriptlib
::
duel_is_summon_cancelable
},
{
"SetSelectedCard"
,
scriptlib
::
duel_set_must_select_cards
},
{
"SetSelectedCard"
,
scriptlib
::
duel_set_must_select_cards
},
{
"GrabSelectedCard"
,
scriptlib
::
duel_grab_must_select_cards
},
{
"GrabSelectedCard"
,
scriptlib
::
duel_grab_must_select_cards
},
{
"SetTargetCard"
,
scriptlib
::
duel_set_target_card
},
{
"SetTargetCard"
,
scriptlib
::
duel_set_target_card
},
...
...
Classes/ocgcore/operations.cpp
View file @
887f84df
This diff is collapsed.
Click to expand it.
Classes/ocgcore/processor.cpp
View file @
887f84df
...
@@ -4290,9 +4290,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4290,9 +4290,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core
.
units
.
begin
()
->
step
=
9
;
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
return
FALSE
;
}
}
for
(
auto
&
oeit
:
effects
.
oath
)
release_oath_relation
(
peffect
);
if
(
oeit
.
second
==
peffect
)
oeit
.
second
=
0
;
break_effect
();
break_effect
();
core
.
chain_solving
=
TRUE
;
core
.
chain_solving
=
TRUE
;
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
...
@@ -4413,6 +4411,9 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4413,6 +4411,9 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core
.
chain_limit
.
clear
();
core
.
chain_limit
.
clear
();
return
FALSE
;
return
FALSE
;
}
}
if
(
core
.
summoning_card
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
summoning_card
=
0
;
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -4435,6 +4436,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4435,6 +4436,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
reset_chain
();
reset_chain
();
if
(
core
.
summoning_card
||
core
.
effect_damage_step
==
1
)
if
(
core
.
summoning_card
||
core
.
effect_damage_step
==
1
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
summoning_card
=
0
;
return
FALSE
;
return
FALSE
;
}
}
case
13
:
{
case
13
:
{
...
...
Classes/ocgcore/scriptlib.h
View file @
887f84df
...
@@ -188,7 +188,7 @@ public:
...
@@ -188,7 +188,7 @@ public:
static
int32
card_is_disabled
(
lua_State
*
L
);
static
int32
card_is_disabled
(
lua_State
*
L
);
static
int32
card_is_destructable
(
lua_State
*
L
);
static
int32
card_is_destructable
(
lua_State
*
L
);
static
int32
card_is_summonable
(
lua_State
*
L
);
static
int32
card_is_summonable
(
lua_State
*
L
);
static
int32
card_is_fusion_summonable_card
(
lua_State
*
L
);
static
int32
card_is_fusion_summonable_card
(
lua_State
*
L
);
static
int32
card_is_msetable
(
lua_State
*
L
);
static
int32
card_is_msetable
(
lua_State
*
L
);
static
int32
card_is_ssetable
(
lua_State
*
L
);
static
int32
card_is_ssetable
(
lua_State
*
L
);
static
int32
card_is_special_summonable
(
lua_State
*
L
);
static
int32
card_is_special_summonable
(
lua_State
*
L
);
...
@@ -508,6 +508,7 @@ public:
...
@@ -508,6 +508,7 @@ public:
static
int32
duel_get_ritual_material
(
lua_State
*
L
);
static
int32
duel_get_ritual_material
(
lua_State
*
L
);
static
int32
duel_release_ritual_material
(
lua_State
*
L
);
static
int32
duel_release_ritual_material
(
lua_State
*
L
);
static
int32
duel_get_fusion_material
(
lua_State
*
L
);
static
int32
duel_get_fusion_material
(
lua_State
*
L
);
static
int32
duel_is_summon_cancelable
(
lua_State
*
L
);
static
int32
duel_set_must_select_cards
(
lua_State
*
L
);
static
int32
duel_set_must_select_cards
(
lua_State
*
L
);
static
int32
duel_grab_must_select_cards
(
lua_State
*
L
);
static
int32
duel_grab_must_select_cards
(
lua_State
*
L
);
static
int32
duel_set_target_card
(
lua_State
*
L
);
static
int32
duel_set_target_card
(
lua_State
*
L
);
...
...
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