Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
cdf07eb6
Commit
cdf07eb6
authored
Apr 21, 2014
by
Fluorohydride
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmaterial count
parent
d60a2384
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
13 deletions
+35
-13
ocgcore/field.cpp
ocgcore/field.cpp
+3
-0
ocgcore/field.h
ocgcore/field.h
+4
-1
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+2
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+12
-1
ocgcore/operations.cpp
ocgcore/operations.cpp
+3
-0
ocgcore/processor.cpp
ocgcore/processor.cpp
+7
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+2
-1
script/utility.lua
script/utility.lua
+2
-9
No files found.
ocgcore/field.cpp
View file @
cdf07eb6
...
@@ -1629,6 +1629,9 @@ int32 field::check_with_sum_limit(card_vector* mats, int32 acc, int32 index, int
...
@@ -1629,6 +1629,9 @@ int32 field::check_with_sum_limit(card_vector* mats, int32 acc, int32 index, int
||
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
+
1
,
count
+
1
,
min
,
max
))
||
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
+
1
,
count
+
1
,
min
,
max
))
||
check_with_sum_limit
(
mats
,
acc
,
index
+
1
,
count
,
min
,
max
);
||
check_with_sum_limit
(
mats
,
acc
,
index
+
1
,
count
,
min
,
max
);
}
}
int32
field
::
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
min
,
min32
max
,
group
*
mg
)
{
return
TRUE
;
}
int32
field
::
is_player_can_draw
(
uint8
playerid
)
{
int32
field
::
is_player_can_draw
(
uint8
playerid
)
{
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DRAW
);
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DRAW
);
}
}
...
...
ocgcore/field.h
View file @
cdf07eb6
...
@@ -361,7 +361,8 @@ public:
...
@@ -361,7 +361,8 @@ public:
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_with_sum_limit
(
card_vector
*
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
int32
check_with_sum_limit
(
card_vector
*
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
min
,
min32
max
,
group
*
mg
);
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
);
...
@@ -474,6 +475,7 @@ public:
...
@@ -474,6 +475,7 @@ public:
int32
change_position
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint8
reason_player
,
uint32
enable
);
int32
change_position
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint8
reason_player
,
uint32
enable
);
int32
operation_replace
(
uint16
step
,
effect
*
replace_effect
,
group
*
targets
,
ptr
arg
,
ptr
replace_type
);
int32
operation_replace
(
uint16
step
,
effect
*
replace_effect
,
group
*
targets
,
ptr
arg
,
ptr
replace_type
);
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
);
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
);
int32
select_xyz_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
);
int32
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
check_field
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
check_field
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
...
@@ -652,6 +654,7 @@ public:
...
@@ -652,6 +654,7 @@ public:
#define PROCESSOR_SPSUMMON_STEP_S 136
#define PROCESSOR_SPSUMMON_STEP_S 136
#define PROCESSOR_SPSUMMON_COMP_S 137
#define PROCESSOR_SPSUMMON_COMP_S 137
#define PROCESSOR_RANDOM_SELECT_S 138
#define PROCESSOR_RANDOM_SELECT_S 138
#define PROCESSOR_SELECT_XMATERIAL 139
#define PROCESSOR_DRAW_S 140
#define PROCESSOR_DRAW_S 140
#define PROCESSOR_DAMAGE_S 141
#define PROCESSOR_DAMAGE_S 141
#define PROCESSOR_RECOVER_S 142
#define PROCESSOR_RECOVER_S 142
...
...
ocgcore/interpreter.cpp
View file @
cdf07eb6
...
@@ -427,7 +427,8 @@ static const struct luaL_Reg duellib[] = {
...
@@ -427,7 +427,8 @@ static const struct luaL_Reg duellib[] = {
{
"SetOperationInfo"
,
scriptlib
::
duel_set_operation_info
},
{
"SetOperationInfo"
,
scriptlib
::
duel_set_operation_info
},
{
"GetOperationInfo"
,
scriptlib
::
duel_get_operation_info
},
{
"GetOperationInfo"
,
scriptlib
::
duel_get_operation_info
},
{
"GetOperationCount"
,
scriptlib
::
duel_get_operation_count
},
{
"GetOperationCount"
,
scriptlib
::
duel_get_operation_count
},
{
"GetXyzMaterial"
,
scriptlib
::
duel_get_xyz_material
},
{
"CheckXyzMaterial"
,
scriptlib
::
duel_get_xyz_material
},
{
"SelectXyzMaterial"
,
scriptlib
::
duel_select_xyz_material
},
{
"Overlay"
,
scriptlib
::
duel_overlay
},
{
"Overlay"
,
scriptlib
::
duel_overlay
},
{
"GetOverlayGroup"
,
scriptlib
::
duel_get_overlay_group
},
{
"GetOverlayGroup"
,
scriptlib
::
duel_get_overlay_group
},
{
"GetOverlayCount"
,
scriptlib
::
duel_get_overlay_count
},
{
"GetOverlayCount"
,
scriptlib
::
duel_get_overlay_count
},
...
...
ocgcore/libduel.cpp
View file @
cdf07eb6
...
@@ -2393,7 +2393,18 @@ int32 scriptlib::duel_get_operation_count(lua_State *L) {
...
@@ -2393,7 +2393,18 @@ int32 scriptlib::duel_get_operation_count(lua_State *L) {
}
}
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_get_xyz_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_xyz_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
scard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
scard
->
pduel
;
group
*
pgroup
=
pduel
->
new_group
();
group
*
mgroup
=
pduel
->
new_group
();
pduel
->
game_field
->
get_xyz_material
(
scard
,
&
pgroup
->
container
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
duel_select_xyz_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
scard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
scard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
...
...
ocgcore/operations.cpp
View file @
cdf07eb6
...
@@ -3884,6 +3884,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3884,6 +3884,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
select_xyz_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
)
{
return
TRUE
;
}
int32
field
::
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
check_field
,
uint8
cancelable
,
int32
min
,
int32
max
)
{
int32
field
::
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
check_field
,
uint8
cancelable
,
int32
min
,
int32
max
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
...
ocgcore/processor.cpp
View file @
cdf07eb6
...
@@ -870,6 +870,13 @@ int32 field::process() {
...
@@ -870,6 +870,13 @@ int32 field::process() {
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SELECT_XMATERIAL
:
{
if
(
select_xyz_material
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
(
group
*
)
it
->
peffect
))
core
.
units
.
pop_front
();
else
core
.
units
.
begin
()
->
step
++
;
return
pduel
->
bufferlen
;
}
case
PROCESSOR_DRAW_S
:
{
case
PROCESSOR_DRAW_S
:
{
if
(
it
->
step
==
0
)
{
if
(
it
->
step
==
0
)
{
add_process
(
PROCESSOR_DRAW
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
);
add_process
(
PROCESSOR_DRAW
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
);
...
...
ocgcore/scriptlib.h
View file @
cdf07eb6
...
@@ -425,7 +425,8 @@ public:
...
@@ -425,7 +425,8 @@ public:
static
int32
duel_set_operation_info
(
lua_State
*
L
);
static
int32
duel_set_operation_info
(
lua_State
*
L
);
static
int32
duel_get_operation_info
(
lua_State
*
L
);
static
int32
duel_get_operation_info
(
lua_State
*
L
);
static
int32
duel_get_operation_count
(
lua_State
*
L
);
static
int32
duel_get_operation_count
(
lua_State
*
L
);
static
int32
duel_get_xyz_material
(
lua_State
*
L
);
static
int32
duel_check_xyz_material
(
lua_State
*
L
);
static
int32
duel_select_xyz_material
(
lua_State
*
L
);
static
int32
duel_overlay
(
lua_State
*
L
);
static
int32
duel_overlay
(
lua_State
*
L
);
static
int32
duel_get_overlay_group
(
lua_State
*
L
);
static
int32
duel_get_overlay_group
(
lua_State
*
L
);
static
int32
duel_get_overlay_count
(
lua_State
*
L
);
static
int32
duel_get_overlay_count
(
lua_State
*
L
);
...
...
script/utility.lua
View file @
cdf07eb6
...
@@ -197,12 +197,7 @@ function Auxiliary.XyzCondition(f,minc,maxc)
...
@@ -197,12 +197,7 @@ function Auxiliary.XyzCondition(f,minc,maxc)
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ct
=-
ft
local
ct
=-
ft
if
minc
<=
ct
then
return
false
end
if
minc
<=
ct
then
return
false
end
if
og
then
return
Duel
.
CheckXyzMaterial
(
c
,
f
,
minc
,
maxc
,
og
)
return
og
:
IsExists
(
f
,
minc
,
nil
)
else
local
g
=
Duel
.
GetXyzMaterial
(
c
)
return
g
:
IsExists
(
f
,
minc
,
nil
)
end
end
end
end
end
function
Auxiliary
.
XyzOperation
(
f
,
minc
,
maxc
)
function
Auxiliary
.
XyzOperation
(
f
,
minc
,
maxc
)
...
@@ -211,9 +206,7 @@ function Auxiliary.XyzOperation(f,minc,maxc)
...
@@ -211,9 +206,7 @@ function Auxiliary.XyzOperation(f,minc,maxc)
c
:
SetMaterial
(
og
)
c
:
SetMaterial
(
og
)
Duel
.
Overlay
(
c
,
og
)
Duel
.
Overlay
(
c
,
og
)
else
else
local
g
=
Duel
.
GetXyzMaterial
(
c
)
local
mg
=
Duel
.
SelectXyzMaterial
(
tp
,
c
,
f
,
minc
,
maxc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_XMATERIAL
)
local
mg
=
g
:
FilterSelect
(
tp
,
f
,
minc
,
maxc
,
nil
)
c
:
SetMaterial
(
mg
)
c
:
SetMaterial
(
mg
)
Duel
.
Overlay
(
c
,
mg
)
Duel
.
Overlay
(
c
,
mg
)
end
end
...
...
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