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
05faa6b8
Commit
05faa6b8
authored
Apr 20, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
60a6d555
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
26 deletions
+34
-26
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+19
-0
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-0
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+2
-19
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+6
-4
Classes/ocgcore/premake4.lua
Classes/ocgcore/premake4.lua
+4
-1
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+2
-2
No files found.
Classes/ocgcore/field.cpp
View file @
05faa6b8
...
@@ -3359,6 +3359,25 @@ int32 field::check_hand_trigger(chain& ch) {
...
@@ -3359,6 +3359,25 @@ int32 field::check_hand_trigger(chain& ch) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
check_trigger_effect
(
const
chain
&
ch
)
const
{
effect
*
peffect
=
ch
.
triggering_effect
;
card
*
phandler
=
peffect
->
get_handler
();
if
(
core
.
duel_rule
>=
5
)
return
phandler
->
is_has_relation
(
ch
);
else
{
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
return
phandler
->
is_has_relation
(
ch
);
else
{
if
((
ch
.
triggering_location
&
(
LOCATION_DECK
|
LOCATION_HAND
|
LOCATION_EXTRA
))
&&
(
ch
.
triggering_position
&
POS_FACEDOWN
))
return
TRUE
;
if
(
!
(
phandler
->
current
.
location
&
(
LOCATION_DECK
|
LOCATION_HAND
|
LOCATION_EXTRA
))
||
phandler
->
is_position
(
POS_FACEUP
))
return
TRUE
;
return
FALSE
;
}
}
}
int32
field
::
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
{
int32
field
::
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
{
effect
*
peffect
=
ch
.
triggering_effect
;
effect
*
peffect
=
ch
.
triggering_effect
;
uint8
tp
=
ch
.
triggering_player
;
uint8
tp
=
ch
.
triggering_player
;
...
...
Classes/ocgcore/field.h
View file @
05faa6b8
...
@@ -482,6 +482,7 @@ public:
...
@@ -482,6 +482,7 @@ public:
int32
get_cteffect_evt
(
effect
*
feffect
,
int32
playerid
,
const
tevent
&
e
,
int32
store
);
int32
get_cteffect_evt
(
effect
*
feffect
,
int32
playerid
,
const
tevent
&
e
,
int32
store
);
int32
check_cteffect_hint
(
effect
*
peffect
,
uint8
playerid
);
int32
check_cteffect_hint
(
effect
*
peffect
,
uint8
playerid
);
int32
check_hand_trigger
(
chain
&
ch
);
int32
check_hand_trigger
(
chain
&
ch
);
int32
check_trigger_effect
(
const
chain
&
ch
)
const
;
int32
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
;
int32
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
;
int32
is_able_to_enter_bp
();
int32
is_able_to_enter_bp
();
...
...
Classes/ocgcore/libduel.cpp
View file @
05faa6b8
...
@@ -3627,9 +3627,6 @@ int32 scriptlib::duel_announce_card(lua_State * L) {
...
@@ -3627,9 +3627,6 @@ int32 scriptlib::duel_announce_card(lua_State * L) {
pduel
->
game_field
->
core
.
select_options
.
clear
();
pduel
->
game_field
->
core
.
select_options
.
clear
();
if
(
lua_gettop
(
L
)
==
1
)
{
if
(
lua_gettop
(
L
)
==
1
)
{
pduel
->
game_field
->
core
.
select_options
.
push_back
(
TRUE
);
pduel
->
game_field
->
core
.
select_options
.
push_back
(
TRUE
);
}
else
if
(
lua_gettop
(
L
)
==
2
)
{
pduel
->
game_field
->
core
.
select_options
.
push_back
((
uint32
)
lua_tointeger
(
L
,
2
));
pduel
->
game_field
->
core
.
select_options
.
push_back
(
OPCODE_ISTYPE
);
}
else
{
}
else
{
for
(
int32
i
=
2
;
i
<=
lua_gettop
(
L
);
++
i
)
for
(
int32
i
=
2
;
i
<=
lua_gettop
(
L
);
++
i
)
pduel
->
game_field
->
core
.
select_options
.
push_back
((
uint32
)
lua_tointeger
(
L
,
i
));
pduel
->
game_field
->
core
.
select_options
.
push_back
((
uint32
)
lua_tointeger
(
L
,
i
));
...
@@ -4135,15 +4132,7 @@ int32 scriptlib::duel_is_player_can_additional_summon(lua_State * L) {
...
@@ -4135,15 +4132,7 @@ int32 scriptlib::duel_is_player_can_additional_summon(lua_State * L) {
}
}
int32
scriptlib
::
duel_is_chain_negatable
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_is_chain_negatable
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
int32
chaincount
=
(
int32
)
lua_tointeger
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
chain
*
ch
=
pduel
->
game_field
->
get_chain
(
chaincount
);
if
(
!
ch
)
return
0
;
if
(
ch
->
triggering_location
==
LOCATION_DECK
)
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
1
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_is_chain_disablable
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_is_chain_disablable
(
lua_State
*
L
)
{
...
@@ -4154,13 +4143,7 @@ int32 scriptlib::duel_is_chain_disablable(lua_State * L) {
...
@@ -4154,13 +4143,7 @@ int32 scriptlib::duel_is_chain_disablable(lua_State * L) {
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_chain_disablable
(
chaincount
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_chain_disablable
(
chaincount
));
return
1
;
return
1
;
}
}
chain
*
ch
=
pduel
->
game_field
->
get_chain
(
chaincount
);
lua_pushboolean
(
L
,
1
);
if
(
!
ch
)
return
0
;
if
(
ch
->
triggering_location
==
LOCATION_DECK
)
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
1
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_check_chain_target
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_chain_target
(
lua_State
*
L
)
{
...
...
Classes/ocgcore/operations.cpp
View file @
05faa6b8
...
@@ -29,8 +29,9 @@ int32 field::negate_chain(uint8 chaincount) {
...
@@ -29,8 +29,9 @@ int32 field::negate_chain(uint8 chaincount) {
}
}
pduel
->
write_buffer8
(
MSG_CHAIN_NEGATED
);
pduel
->
write_buffer8
(
MSG_CHAIN_NEGATED
);
pduel
->
write_buffer8
(
chaincount
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_location
==
LOCATION_DECK
)
if
(
pchain
.
triggering_location
==
LOCATION_DECK
return
FALSE
;
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
pchain
.
triggering_effect
->
handler
->
release_relation
(
pchain
);
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -48,8 +49,9 @@ int32 field::disable_chain(uint8 chaincount) {
...
@@ -48,8 +49,9 @@ int32 field::disable_chain(uint8 chaincount) {
core
.
current_chain
[
chaincount
-
1
].
disable_player
=
core
.
reason_player
;
core
.
current_chain
[
chaincount
-
1
].
disable_player
=
core
.
reason_player
;
pduel
->
write_buffer8
(
MSG_CHAIN_DISABLED
);
pduel
->
write_buffer8
(
MSG_CHAIN_DISABLED
);
pduel
->
write_buffer8
(
chaincount
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_location
==
LOCATION_DECK
)
if
(
pchain
.
triggering_location
==
LOCATION_DECK
return
FALSE
;
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
pchain
.
triggering_effect
->
handler
->
release_relation
(
pchain
);
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
...
Classes/ocgcore/premake4.lua
View file @
05faa6b8
...
@@ -2,6 +2,9 @@ project "ocgcore"
...
@@ -2,6 +2,9 @@ project "ocgcore"
kind
"StaticLib"
kind
"StaticLib"
files
{
"**.cc"
,
"**.cpp"
,
"**.c"
,
"**.h"
}
files
{
"**.cc"
,
"**.cpp"
,
"**.c"
,
"**.h"
}
includedirs
{
"../lua"
}
configuration
"windows"
includedirs
{
"../lua"
}
configuration
"not vs*"
configuration
"not vs*"
buildoptions
{
"-std=c++14"
}
buildoptions
{
"-std=c++14"
}
configuration
"not windows"
includedirs
{
"/usr/include/lua5.3"
}
Classes/ocgcore/processor.cpp
View file @
05faa6b8
...
@@ -1310,7 +1310,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1310,7 +1310,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
if
(
phandler
->
is_has_relation
(
*
clit
))
//work around: position and control should be refreshed before raising event
if
(
phandler
->
is_has_relation
(
*
clit
))
//work around: position and control should be refreshed before raising event
clit
->
set_triggering_state
(
phandler
);
clit
->
set_triggering_state
(
phandler
);
uint8
tp
=
clit
->
triggering_player
;
uint8
tp
=
clit
->
triggering_player
;
if
(
phandler
->
is_has_relation
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
))
{
if
(
check_trigger_effect
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
))
{
if
(
tp
==
core
.
current_player
)
if
(
tp
==
core
.
current_player
)
core
.
select_chains
.
push_back
(
*
clit
);
core
.
select_chains
.
push_back
(
*
clit
);
}
else
{
}
else
{
...
@@ -1367,7 +1367,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1367,7 +1367,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit
->
set_triggering_state
(
phandler
);
clit
->
set_triggering_state
(
phandler
);
}
}
uint8
tp
=
clit
->
triggering_player
;
uint8
tp
=
clit
->
triggering_player
;
if
(
check_hand_trigger
(
*
clit
)
&&
phandler
->
is_has_relation
(
*
clit
)
if
(
check_hand_trigger
(
*
clit
)
&&
check_trigger_effect
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
check_spself_from_hand_trigger
(
*
clit
))
{
&&
check_spself_from_hand_trigger
(
*
clit
))
{
if
(
tp
==
core
.
current_player
)
if
(
tp
==
core
.
current_player
)
...
...
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