Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
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
MyCard
ygopro-core
Commits
5b7d6581
Commit
5b7d6581
authored
Dec 04, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
2ad65dff
fe782145
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
6 deletions
+48
-6
interpreter.cpp
interpreter.cpp
+2
-0
libduel.cpp
libduel.cpp
+37
-0
operations.cpp
operations.cpp
+2
-2
processor.cpp
processor.cpp
+5
-4
scriptlib.h
scriptlib.h
+2
-0
No files found.
interpreter.cpp
View file @
5b7d6581
...
...
@@ -553,6 +553,8 @@ static const struct luaL_Reg duellib[] = {
{
"IsPlayerCanDiscardDeck"
,
scriptlib
::
duel_is_player_can_discard_deck
},
{
"IsPlayerCanDiscardDeckAsCost"
,
scriptlib
::
duel_is_player_can_discard_deck_as_cost
},
{
"IsPlayerCanSummon"
,
scriptlib
::
duel_is_player_can_summon
},
{
"IsPlayerCanMSet"
,
scriptlib
::
duel_is_player_can_mset
},
{
"IsPlayerCanSSet"
,
scriptlib
::
duel_is_player_can_sset
},
{
"IsPlayerCanSpecialSummon"
,
scriptlib
::
duel_is_player_can_spsummon
},
{
"IsPlayerCanFlipSummon"
,
scriptlib
::
duel_is_player_can_flipsummon
},
{
"IsPlayerCanSpecialSummonMonster"
,
scriptlib
::
duel_is_player_can_spsummon_monster
},
...
...
libduel.cpp
View file @
5b7d6581
...
...
@@ -3825,6 +3825,43 @@ int32 scriptlib::duel_is_player_can_summon(lua_State * L) {
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_mset
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
{
lua_pushboolean
(
L
,
0
);
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
lua_gettop
(
L
)
==
1
)
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_action
(
playerid
,
EFFECT_CANNOT_MSET
));
else
{
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
int32
sumtype
=
lua_tointeger
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_mset
(
sumtype
,
playerid
,
pcard
,
playerid
));
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_sset
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
{
lua_pushboolean
(
L
,
0
);
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
lua_gettop
(
L
)
==
1
)
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_action
(
playerid
,
EFFECT_CANNOT_SSET
));
else
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_sset
(
playerid
,
pcard
));
}
return
1
;
}
int32
scriptlib
::
duel_is_player_can_spsummon
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
...
...
operations.cpp
View file @
5b7d6581
...
...
@@ -4692,7 +4692,7 @@ int32 field::operation_replace(uint16 step, effect* replace_effect, group* targe
}
case
1
:
{
if
(
returns
.
ivalue
[
0
])
{
if
(
!
target
->
current
.
reason_effect
->
is_self_destroy_related
(
))
{
if
(
!
(
target
->
current
.
reason_effect
&&
target
->
current
.
reason_effect
->
is_self_destroy_related
()
))
{
targets
->
container
.
erase
(
target
);
target
->
current
.
reason
=
target
->
temp
.
reason
;
target
->
current
.
reason_effect
=
target
->
temp
.
reason_effect
;
...
...
@@ -4758,7 +4758,7 @@ int32 field::operation_replace(uint16 step, effect* replace_effect, group* targe
if
(
returns
.
ivalue
[
0
])
{
for
(
auto
cit
=
targets
->
container
.
begin
();
cit
!=
targets
->
container
.
end
();)
{
auto
rm
=
cit
++
;
if
(
replace_effect
->
get_value
(
*
rm
)
&&
!
(
*
rm
)
->
current
.
reason_effect
->
is_self_destroy_related
(
))
{
if
(
replace_effect
->
get_value
(
*
rm
)
&&
!
((
*
rm
)
->
current
.
reason_effect
&&
(
*
rm
)
->
current
.
reason_effect
->
is_self_destroy_related
()
))
{
(
*
rm
)
->
current
.
reason
=
(
*
rm
)
->
temp
.
reason
;
(
*
rm
)
->
current
.
reason_effect
=
(
*
rm
)
->
temp
.
reason_effect
;
(
*
rm
)
->
current
.
reason_player
=
(
*
rm
)
->
temp
.
reason_player
;
...
...
processor.cpp
View file @
5b7d6581
...
...
@@ -504,10 +504,11 @@ int32 field::process() {
if
(
it
->
step
==
0
)
{
card
*
attacker
=
core
.
attacker
;
if
(
!
attacker
||
(
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
])
||
(
attacker
->
current
.
location
!=
LOCATION_MZONE
)
||
!
attacker
->
is_capable_attack
()
||
!
attacker
->
is_affect_by_effect
(
core
.
reason_effect
))
{
||
core
.
effect_damage_step
!=
0
||
(
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
])
||
(
attacker
->
current
.
location
!=
LOCATION_MZONE
)
||
!
attacker
->
is_capable_attack
()
||
!
attacker
->
is_affect_by_effect
(
core
.
reason_effect
))
{
returns
.
ivalue
[
0
]
=
0
;
core
.
units
.
pop_front
();
}
else
{
...
...
scriptlib.h
View file @
5b7d6581
...
...
@@ -549,6 +549,8 @@ public:
static
int32
duel_is_player_can_discard_deck
(
lua_State
*
L
);
static
int32
duel_is_player_can_discard_deck_as_cost
(
lua_State
*
L
);
static
int32
duel_is_player_can_summon
(
lua_State
*
L
);
static
int32
duel_is_player_can_mset
(
lua_State
*
L
);
static
int32
duel_is_player_can_sset
(
lua_State
*
L
);
static
int32
duel_is_player_can_spsummon
(
lua_State
*
L
);
static
int32
duel_is_player_can_flipsummon
(
lua_State
*
L
);
static
int32
duel_is_player_can_spsummon_monster
(
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