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
f1e3e93e
Commit
f1e3e93e
authored
Oct 15, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
68a26517
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
31 deletions
+27
-31
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+2
-0
Classes/gframe/premake4.lua
Classes/gframe/premake4.lua
+1
-1
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+7
-6
Classes/ocgcore/interpreter.cpp
Classes/ocgcore/interpreter.cpp
+1
-1
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+7
-16
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+9
-7
No files found.
Classes/gframe/game.cpp
View file @
f1e3e93e
...
@@ -195,6 +195,8 @@ bool Game::Initialize() {
...
@@ -195,6 +195,8 @@ bool Game::Initialize() {
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
driver
,
fs
,
gameConf
.
numfont
,
(
int
)
48
*
yScale
,
isAntialias
,
true
);
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
driver
,
fs
,
gameConf
.
numfont
,
(
int
)
48
*
yScale
,
isAntialias
,
true
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
driver
,
fs
,
gameConf
.
textfont
,
(
int
)
gameConf
.
textfontsize
*
yScale
,
isAntialias
,
true
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
driver
,
fs
,
gameConf
.
textfont
,
(
int
)
gameConf
.
textfontsize
*
yScale
,
isAntialias
,
true
);
textFont
=
guiFont
;
textFont
=
guiFont
;
if
(
!
numFont
||
!
textFont
)
return
false
;
smgr
=
device
->
getSceneManager
();
smgr
=
device
->
getSceneManager
();
device
->
setWindowCaption
(
L"[---]"
);
device
->
setWindowCaption
(
L"[---]"
);
device
->
setResizable
(
false
);
device
->
setResizable
(
false
);
...
...
Classes/gframe/premake4.lua
View file @
f1e3e93e
...
@@ -18,6 +18,6 @@ project "ygopro"
...
@@ -18,6 +18,6 @@ project "ygopro"
configuration
"not vs*"
configuration
"not vs*"
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
configuration
"not windows"
configuration
"not windows"
includedirs
{
"/usr/include/
lua"
,
"/usr/include/lua5.3"
,
"/usr/include/lua/5.3"
,
"/usr/include/
irrlicht"
,
"/usr/include/freetype2"
}
includedirs
{
"/usr/include/irrlicht"
,
"/usr/include/freetype2"
}
excludes
{
"COSOperator.*"
}
excludes
{
"COSOperator.*"
}
links
{
"event_pthreads"
,
"GL"
,
"dl"
,
"pthread"
}
links
{
"event_pthreads"
,
"GL"
,
"dl"
,
"pthread"
}
Classes/ocgcore/field.h
View file @
f1e3e93e
...
@@ -190,6 +190,7 @@ struct processor {
...
@@ -190,6 +190,7 @@ struct processor {
event_list
sub_solving_event
;
event_list
sub_solving_event
;
chain_array
select_chains
;
chain_array
select_chains
;
chain_array
current_chain
;
chain_array
current_chain
;
chain_array
tmp_chains
;
chain_list
continuous_chain
;
chain_list
continuous_chain
;
chain_list
solving_continuous
;
chain_list
solving_continuous
;
chain_list
sub_solving_continuous
;
chain_list
sub_solving_continuous
;
...
@@ -556,11 +557,11 @@ public:
...
@@ -556,11 +557,11 @@ public:
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
destroy
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
);
int32
destroy
_replace
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
);
int32
destroy
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
destroy
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
release
(
uint16
step
,
group
*
targets
,
card
*
target
);
int32
release
_replace
(
uint16
step
,
group
*
targets
,
card
*
target
);
int32
release
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
release
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
send_
to
(
uint16
step
,
group
*
targets
,
card
*
target
);
int32
send_
replace
(
uint16
step
,
group
*
targets
,
card
*
target
);
int32
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
);
int32
discard_deck
(
uint16
step
,
uint8
playerid
,
uint8
count
,
uint32
reason
);
int32
discard_deck
(
uint16
step
,
uint8
playerid
,
uint8
count
,
uint32
reason
);
int32
move_to_field
(
uint16
step
,
card
*
target
,
uint32
enable
,
uint32
ret
,
uint32
is_equip
,
uint32
zone
);
int32
move_to_field
(
uint16
step
,
card
*
target
,
uint32
enable
,
uint32
ret
,
uint32
is_equip
,
uint32
zone
);
...
@@ -707,9 +708,9 @@ public:
...
@@ -707,9 +708,9 @@ public:
#define PROCESSOR_MOVETOFIELD 53
#define PROCESSOR_MOVETOFIELD 53
#define PROCESSOR_CHANGEPOS 54
#define PROCESSOR_CHANGEPOS 54
#define PROCESSOR_OPERATION_REPLACE 55
#define PROCESSOR_OPERATION_REPLACE 55
#define PROCESSOR_DESTROY_
STEP
56
#define PROCESSOR_DESTROY_
REPLACE
56
#define PROCESSOR_RELEASE_
STEP
57
#define PROCESSOR_RELEASE_
REPLACE
57
#define PROCESSOR_SENDTO_
STEP
58
#define PROCESSOR_SENDTO_
REPLACE
58
#define PROCESSOR_SUMMON_RULE 60
#define PROCESSOR_SUMMON_RULE 60
#define PROCESSOR_SPSUMMON_RULE 61
#define PROCESSOR_SPSUMMON_RULE 61
#define PROCESSOR_SPSUMMON 62
#define PROCESSOR_SPSUMMON 62
...
...
Classes/ocgcore/interpreter.cpp
View file @
f1e3e93e
...
@@ -608,9 +608,9 @@ interpreter::interpreter(duel* pd): coroutines(256) {
...
@@ -608,9 +608,9 @@ interpreter::interpreter(duel* pd): coroutines(256) {
luaL_getsubtable
(
lua_state
,
LUA_REGISTRYINDEX
,
LUA_LOADED_TABLE
);
luaL_getsubtable
(
lua_state
,
LUA_REGISTRYINDEX
,
LUA_LOADED_TABLE
);
lua_pushnil
(
lua_state
);
lua_pushnil
(
lua_state
);
lua_setfield
(
lua_state
,
-
2
,
"io"
);
lua_setfield
(
lua_state
,
-
2
,
"io"
);
luaL_getsubtable
(
lua_state
,
LUA_REGISTRYINDEX
,
LUA_LOADED_TABLE
);
lua_pushnil
(
lua_state
);
lua_pushnil
(
lua_state
);
lua_setfield
(
lua_state
,
-
2
,
"os"
);
lua_setfield
(
lua_state
,
-
2
,
"os"
);
lua_pop
(
lua_state
,
1
);
//open all libs
//open all libs
luaL_newlib
(
lua_state
,
cardlib
);
luaL_newlib
(
lua_state
,
cardlib
);
lua_pushstring
(
lua_state
,
"__index"
);
lua_pushstring
(
lua_state
,
"__index"
);
...
...
Classes/ocgcore/operations.cpp
View file @
f1e3e93e
...
@@ -3087,9 +3087,7 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
...
@@ -3087,9 +3087,7 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
}
}
return
TRUE
;
return
TRUE
;
}
}
// destroy: step version
int32
field
::
destroy_replace
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
)
{
// PROCESSOR_DESTROY_STEP goes here
int32
field
::
destroy
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
)
{
if
(
target
->
current
.
location
&
(
LOCATION_GRAVE
|
LOCATION_REMOVED
))
{
if
(
target
->
current
.
location
&
(
LOCATION_GRAVE
|
LOCATION_REMOVED
))
{
target
->
current
.
reason
=
target
->
temp
.
reason
;
target
->
current
.
reason
=
target
->
temp
.
reason
;
target
->
current
.
reason_effect
=
target
->
temp
.
reason_effect
;
target
->
current
.
reason_effect
=
target
->
temp
.
reason_effect
;
...
@@ -3112,7 +3110,6 @@ int32 field::destroy(uint16 step, group* targets, card* target, uint8 battle) {
...
@@ -3112,7 +3110,6 @@ int32 field::destroy(uint16 step, group* targets, card* target, uint8 battle) {
}
}
return
TRUE
;
return
TRUE
;
}
}
// PROCESSOR_DESTROY goes here
int32
field
::
destroy
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
int32
field
::
destroy
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
@@ -3250,7 +3247,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3250,7 +3247,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
}
case
1
:
{
case
1
:
{
for
(
auto
&
pcard
:
targets
->
container
)
{
for
(
auto
&
pcard
:
targets
->
container
)
{
add_process
(
PROCESSOR_DESTROY_
STEP
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
add_process
(
PROCESSOR_DESTROY_
REPLACE
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
}
}
return
FALSE
;
return
FALSE
;
}
}
...
@@ -3432,7 +3429,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3432,7 +3429,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
}
case
11
:
{
case
11
:
{
for
(
auto
&
pcard
:
targets
->
container
)
{
for
(
auto
&
pcard
:
targets
->
container
)
{
add_process
(
PROCESSOR_DESTROY_
STEP
,
0
,
NULL
,
targets
,
0
,
TRUE
,
0
,
0
,
pcard
);
add_process
(
PROCESSOR_DESTROY_
REPLACE
,
0
,
NULL
,
targets
,
0
,
TRUE
,
0
,
0
,
pcard
);
}
}
return
FALSE
;
return
FALSE
;
}
}
...
@@ -3445,8 +3442,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3445,8 +3442,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
}
return
TRUE
;
return
TRUE
;
}
}
// PROCESSOR_RELEASE_STEP goes here
int32
field
::
release_replace
(
uint16
step
,
group
*
targets
,
card
*
target
)
{
int32
field
::
release
(
uint16
step
,
group
*
targets
,
card
*
target
)
{
if
(
!
(
target
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_HAND
)))
{
if
(
!
(
target
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_HAND
)))
{
target
->
current
.
reason
=
target
->
temp
.
reason
;
target
->
current
.
reason
=
target
->
temp
.
reason
;
target
->
current
.
reason_effect
=
target
->
temp
.
reason_effect
;
target
->
current
.
reason_effect
=
target
->
temp
.
reason_effect
;
...
@@ -3465,7 +3461,6 @@ int32 field::release(uint16 step, group* targets, card* target) {
...
@@ -3465,7 +3461,6 @@ int32 field::release(uint16 step, group* targets, card* target) {
}
}
return
TRUE
;
return
TRUE
;
}
}
// PROCESSOR_RELEASE goes here
int32
field
::
release
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
int32
field
::
release
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
@@ -3490,7 +3485,7 @@ int32 field::release(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3490,7 +3485,7 @@ int32 field::release(uint16 step, group * targets, effect * reason_effect, uint3
}
}
case
1
:
{
case
1
:
{
for
(
auto
&
pcard
:
targets
->
container
)
{
for
(
auto
&
pcard
:
targets
->
container
)
{
add_process
(
PROCESSOR_RELEASE_
STEP
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
add_process
(
PROCESSOR_RELEASE_
REPLACE
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
}
}
return
FALSE
;
return
FALSE
;
}
}
...
@@ -3537,8 +3532,7 @@ int32 field::release(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3537,8 +3532,7 @@ int32 field::release(uint16 step, group * targets, effect * reason_effect, uint3
}
}
return
TRUE
;
return
TRUE
;
}
}
// PROCESSOR_SENDTO_STEP goes here
int32
field
::
send_replace
(
uint16
step
,
group
*
targets
,
card
*
target
)
{
int32
field
::
send_to
(
uint16
step
,
group
*
targets
,
card
*
target
)
{
uint8
playerid
=
target
->
sendto_param
.
playerid
;
uint8
playerid
=
target
->
sendto_param
.
playerid
;
uint8
dest
=
target
->
sendto_param
.
location
;
uint8
dest
=
target
->
sendto_param
.
location
;
if
(
targets
->
container
.
find
(
target
)
==
targets
->
container
.
end
())
if
(
targets
->
container
.
find
(
target
)
==
targets
->
container
.
end
())
...
@@ -3559,9 +3553,6 @@ int32 field::send_to(uint16 step, group * targets, card * target) {
...
@@ -3559,9 +3553,6 @@ int32 field::send_to(uint16 step, group * targets, card * target) {
}
}
return
TRUE
;
return
TRUE
;
}
}
// PROCESSOR_SENDTO goes here
// step 1: call PROCESSOR_SENDTO_STEP
// step 6: move cards
int32
field
::
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
int32
field
::
send_to
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
)
{
struct
exargs
{
struct
exargs
{
group
*
targets
;
group
*
targets
;
...
@@ -3599,7 +3590,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3599,7 +3590,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
}
case
1
:
{
case
1
:
{
for
(
auto
&
pcard
:
targets
->
container
)
{
for
(
auto
&
pcard
:
targets
->
container
)
{
add_process
(
PROCESSOR_SENDTO_
STEP
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
add_process
(
PROCESSOR_SENDTO_
REPLACE
,
0
,
NULL
,
targets
,
0
,
0
,
0
,
0
,
pcard
);
}
}
return
FALSE
;
return
FALSE
;
}
}
...
...
Classes/ocgcore/processor.cpp
View file @
f1e3e93e
...
@@ -310,22 +310,22 @@ int32 field::process() {
...
@@ -310,22 +310,22 @@ int32 field::process() {
it
->
step
++
;
it
->
step
++
;
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_DESTROY_
STEP
:
{
case
PROCESSOR_DESTROY_
REPLACE
:
{
if
(
destroy
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
,
it
->
arg2
))
if
(
destroy
_replace
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
,
it
->
arg2
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
it
->
step
++
;
it
->
step
++
;
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_RELEASE_
STEP
:
{
case
PROCESSOR_RELEASE_
REPLACE
:
{
if
(
release
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
))
if
(
release
_replace
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
it
->
step
++
;
it
->
step
++
;
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SENDTO_
STEP
:
{
case
PROCESSOR_SENDTO_
REPLACE
:
{
if
(
send_
to
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
))
if
(
send_
replace
(
it
->
step
,
it
->
ptarget
,
(
card
*
)
it
->
ptr1
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
it
->
step
++
;
it
->
step
++
;
...
@@ -1879,7 +1879,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1879,7 +1879,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
newchain
.
triggering_effect
=
peffect
;
newchain
.
triggering_effect
=
peffect
;
newchain
.
set_triggering_place
(
phandler
);
newchain
.
set_triggering_place
(
phandler
);
newchain
.
triggering_player
=
infos
.
turn_player
;
newchain
.
triggering_player
=
infos
.
turn_player
;
core
.
select
_chains
.
push_back
(
newchain
);
core
.
tmp
_chains
.
push_back
(
newchain
);
}
}
}
}
}
}
...
@@ -2038,6 +2038,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2038,6 +2038,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
}
}
case
2
:
{
case
2
:
{
chain
newchain
;
chain
newchain
;
if
(
core
.
tmp_chains
.
size
())
core
.
select_chains
.
swap
(
core
.
tmp_chains
);
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
end
();
++
evit
)
{
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
end
();
++
evit
)
{
if
(
evit
==
core
.
point_event
.
end
())
if
(
evit
==
core
.
point_event
.
end
())
evit
=
core
.
instant_event
.
begin
();
evit
=
core
.
instant_event
.
begin
();
...
...
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