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
fafebe6e
Commit
fafebe6e
authored
Jan 28, 2024
by
Dark Zane
Committed by
GitHub
Jan 28, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fallenstardust:master' into master
parents
9946e270
8fd26ae3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
58 deletions
+110
-58
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+12
-4
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+47
-51
Classes/ocgcore/libgroup.cpp
Classes/ocgcore/libgroup.cpp
+41
-0
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+1
-3
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+8
-0
Classes/ocgcore/scriptlib.h
Classes/ocgcore/scriptlib.h
+1
-0
No files found.
Classes/ocgcore/libcard.cpp
View file @
fafebe6e
...
...
@@ -1241,7 +1241,7 @@ int32 scriptlib::card_is_non_attribute(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tattrib
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_attribute
()
&
(
ATTRIBUTE_ALL
-
tattrib
))
if
(
pcard
->
get_attribute
()
&
(
ATTRIBUTE_ALL
&
~
tattrib
))
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
...
...
@@ -2132,6 +2132,10 @@ int32 scriptlib::card_is_msetable(lua_State *L) {
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
pcard
->
pduel
->
game_field
->
core
.
effect_damage_step
)
{
lua_pushboolean
(
L
,
FALSE
);
return
1
;
}
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
ign
=
lua_toboolean
(
L
,
2
);
effect
*
peffect
=
nullptr
;
...
...
@@ -2174,7 +2178,7 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_SYNCHRO
))
{
if
(
!
(
pcard
->
data
.
type
&
TYPE_SYNCHRO
)
||
pcard
->
pduel
->
game_field
->
core
.
effect_damage_step
)
{
lua_pushboolean
(
L
,
FALSE
);
return
1
;
}
...
...
@@ -2210,7 +2214,7 @@ int32 scriptlib::card_is_xyz_summonable(lua_State *L) {
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_XYZ
))
{
if
(
!
(
pcard
->
data
.
type
&
TYPE_XYZ
)
||
pcard
->
pduel
->
game_field
->
core
.
effect_damage_step
)
{
lua_pushboolean
(
L
,
FALSE
);
return
1
;
}
...
...
@@ -2238,7 +2242,7 @@ int32 scriptlib::card_is_link_summonable(lua_State *L) {
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_LINK
))
{
if
(
!
(
pcard
->
data
.
type
&
TYPE_LINK
)
||
pcard
->
pduel
->
game_field
->
core
.
effect_damage_step
)
{
lua_pushboolean
(
L
,
FALSE
);
return
1
;
}
...
...
@@ -2274,6 +2278,10 @@ int32 scriptlib::card_is_can_be_summoned(lua_State *L) {
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
pcard
->
pduel
->
game_field
->
core
.
effect_damage_step
)
{
lua_pushboolean
(
L
,
FALSE
);
return
1
;
}
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
ign
=
lua_toboolean
(
L
,
2
);
effect
*
peffect
=
nullptr
;
...
...
Classes/ocgcore/libduel.cpp
View file @
fafebe6e
...
...
@@ -1343,12 +1343,9 @@ int32 scriptlib::duel_equip(lua_State *L) {
int32
scriptlib
::
duel_equip_complete
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
field
::
card_set
etargets
;
field
::
card_set
set_cards
;
for
(
auto
&
equip_card
:
pduel
->
game_field
->
core
.
equiping_cards
)
{
if
(
equip_card
->
is_position
(
POS_FACEUP
))
equip_card
->
enable_field_effect
(
true
);
if
(
equip_card
->
is_position
(
POS_FACEDOWN
))
set_cards
.
insert
(
equip_card
);
etargets
.
insert
(
equip_card
->
equiping_target
);
}
pduel
->
game_field
->
adjust_instant
();
...
...
@@ -1356,8 +1353,7 @@ int32 scriptlib::duel_equip_complete(lua_State *L) {
pduel
->
game_field
->
raise_single_event
(
equip_target
,
&
pduel
->
game_field
->
core
.
equiping_cards
,
EVENT_EQUIP
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
0
);
pduel
->
game_field
->
raise_event
(
&
pduel
->
game_field
->
core
.
equiping_cards
,
EVENT_EQUIP
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
0
);
pduel
->
game_field
->
raise_event
(
&
set_cards
,
EVENT_SSET
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
pduel
->
game_field
->
core
.
reason_player
,
0
,
0
);
pduel
->
game_field
->
core
.
reason_effect
,
0
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
0
);
pduel
->
game_field
->
core
.
hint_timing
[
0
]
|=
TIMING_EQUIP
;
pduel
->
game_field
->
core
.
hint_timing
[
1
]
|=
TIMING_EQUIP
;
pduel
->
game_field
->
process_single_event
();
...
...
@@ -2664,58 +2660,56 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
return
1
;
}
int32
scriptlib
::
duel_check_release_group
(
lua_State
*
L
)
{
const
int32
must_param
=
5
;
const
int32
must_param
=
4
;
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
card
*
pexception
=
nullptr
;
group
*
pexgroup
=
nullptr
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
4
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
FALSE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
return
1
;
}
int32
scriptlib
::
duel_select_release_group
(
lua_State
*
L
)
{
const
int32
must_param
=
6
;
const
int32
must_param
=
5
;
check_action_permission
(
L
);
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
card
*
pexception
=
0
;
group
*
pexgroup
=
0
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
FALSE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
...
...
@@ -2729,58 +2723,60 @@ int32 scriptlib::duel_select_release_group(lua_State *L) {
});
}
int32
scriptlib
::
duel_check_release_group_ex
(
lua_State
*
L
)
{
const
int32
must_param
=
5
;
const
int32
must_param
=
6
;
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
4
);
int32
use_hand
=
lua_toboolean
(
L
,
5
);
card
*
pexception
=
nullptr
;
group
*
pexgroup
=
nullptr
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
TRUE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
return
1
;
}
int32
scriptlib
::
duel_select_release_group_ex
(
lua_State
*
L
)
{
const
int32
must_param
=
6
;
const
int32
must_param
=
7
;
check_action_permission
(
L
);
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
5
);
int32
use_hand
=
lua_toboolean
(
L
,
6
);
card
*
pexception
=
0
;
group
*
pexgroup
=
0
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
7
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
7
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
TRUE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
...
...
Classes/ocgcore/libgroup.cpp
View file @
fafebe6e
...
...
@@ -374,6 +374,46 @@ int32 scriptlib::group_random_select(lua_State *L) {
interpreter
::
group2value
(
L
,
newgroup
);
return
1
;
}
int32
scriptlib
::
group_cancelable_select
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
5
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
field
::
card_set
cset
(
pgroup
->
container
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
{
card
*
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
cset
.
erase
(
pexception
);
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
{
group
*
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
for
(
auto
&
pcard
:
pexgroup
->
container
)
cset
.
erase
(
pcard
);
}
duel
*
pduel
=
pgroup
->
pduel
;
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
pduel
->
game_field
->
core
.
select_cards
.
clear
();
for
(
auto
&
pcard
:
cset
)
{
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
0x10000
,
min
+
(
max
<<
16
));
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
if
(
pduel
->
game_field
->
returns
.
bvalue
[
0
]
==
-
1
)
{
lua_pushnil
(
L
);
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
for
(
int32
i
=
0
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
interpreter
::
group2value
(
L
,
pgroup
);
}
return
1
;
});
}
int32
scriptlib
::
group_is_exists
(
lua_State
*
L
)
{
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
...
...
@@ -890,6 +930,7 @@ static const struct luaL_Reg grouplib[] = {
{
"Select"
,
scriptlib
::
group_select
},
{
"SelectUnselect"
,
scriptlib
::
group_select_unselect
},
{
"RandomSelect"
,
scriptlib
::
group_random_select
},
{
"CancelableSelect"
,
scriptlib
::
group_cancelable_select
},
{
"IsExists"
,
scriptlib
::
group_is_exists
},
{
"CheckWithSumEqual"
,
scriptlib
::
group_check_with_sum_equal
},
{
"SelectWithSumEqual"
,
scriptlib
::
group_select_with_sum_equal
},
...
...
Classes/ocgcore/operations.cpp
View file @
fafebe6e
...
...
@@ -1409,7 +1409,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
peffect
->
owner
=
equip_card
;
peffect
->
handler
=
equip_card
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
if
(
equip_card
->
get_type
()
==
TYPE_TRAP
)
{
if
(
equip_card
->
get_type
()
&
TYPE_TRAP
)
{
peffect
->
code
=
EFFECT_ADD_TYPE
;
peffect
->
value
=
TYPE_EQUIP
;
}
else
if
(
equip_card
->
data
.
type
&
TYPE_UNION
)
{
...
...
@@ -1433,8 +1433,6 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
cset
.
insert
(
equip_card
);
raise_single_event
(
target
,
&
cset
,
EVENT_EQUIP
,
core
.
reason_effect
,
0
,
core
.
reason_player
,
PLAYER_NONE
,
0
);
raise_event
(
&
cset
,
EVENT_EQUIP
,
core
.
reason_effect
,
0
,
core
.
reason_player
,
PLAYER_NONE
,
0
);
if
(
equip_card
->
is_position
(
POS_FACEDOWN
))
raise_event
(
&
cset
,
EVENT_SSET
,
core
.
reason_effect
,
0
,
core
.
reason_player
,
0
,
0
);
core
.
hint_timing
[
target
->
current
.
controler
]
|=
TIMING_EQUIP
;
process_single_event
();
process_instant_event
();
...
...
Classes/ocgcore/processor.cpp
View file @
fafebe6e
...
...
@@ -1312,6 +1312,10 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
card
*
phandler
=
peffect
->
get_handler
();
if
(
phandler
->
is_has_relation
(
*
clit
))
//work around: position and control should be refreshed before raising event
clit
->
set_triggering_state
(
phandler
);
if
(
clit
->
triggering_player
!=
phandler
->
current
.
controler
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_EVENT_PLAYER
))
{
clit
->
triggering_player
=
phandler
->
current
.
controler
;
clit
->
set_triggering_state
(
phandler
);
}
uint8
tp
=
clit
->
triggering_player
;
if
(
check_trigger_effect
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
))
{
if
(
tp
==
core
.
current_player
)
...
...
@@ -1369,6 +1373,10 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit
->
triggering_player
=
phandler
->
current
.
controler
;
clit
->
set_triggering_state
(
phandler
);
}
if
(
clit
->
triggering_player
!=
phandler
->
current
.
controler
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_EVENT_PLAYER
))
{
clit
->
triggering_player
=
phandler
->
current
.
controler
;
clit
->
set_triggering_state
(
phandler
);
}
uint8
tp
=
clit
->
triggering_player
;
if
(
check_nonpublic_trigger
(
*
clit
)
&&
check_trigger_effect
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
...
...
Classes/ocgcore/scriptlib.h
View file @
fafebe6e
...
...
@@ -371,6 +371,7 @@ public:
static
int32
group_select
(
lua_State
*
L
);
static
int32
group_select_unselect
(
lua_State
*
L
);
static
int32
group_random_select
(
lua_State
*
L
);
static
int32
group_cancelable_select
(
lua_State
*
L
);
static
int32
group_is_exists
(
lua_State
*
L
);
static
int32
group_check_with_sum_equal
(
lua_State
*
L
);
static
int32
group_select_with_sum_equal
(
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