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
2fb9a464
Commit
2fb9a464
authored
Jun 28, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
743805b6
dcfb08ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
11 deletions
+29
-11
effect.h
effect.h
+1
-0
libcard.cpp
libcard.cpp
+15
-0
operations.cpp
operations.cpp
+12
-11
scriptlib.h
scriptlib.h
+1
-0
No files found.
effect.h
View file @
2fb9a464
...
@@ -275,6 +275,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -275,6 +275,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_DUAL_STATUS 75 //
#define EFFECT_DUAL_STATUS 75 //
#define EFFECT_EQUIP_LIMIT 76 //
#define EFFECT_EQUIP_LIMIT 76 //
#define EFFECT_DUAL_SUMMONABLE 77 //
#define EFFECT_DUAL_SUMMONABLE 77 //
#define EFFECT_UNION_LIMIT 78 //
#define EFFECT_REVERSE_DAMAGE 80 //
#define EFFECT_REVERSE_DAMAGE 80 //
#define EFFECT_REVERSE_RECOVER 81 //
#define EFFECT_REVERSE_RECOVER 81 //
#define EFFECT_CHANGE_DAMAGE 82 //
#define EFFECT_CHANGE_DAMAGE 82 //
...
...
libcard.cpp
View file @
2fb9a464
...
@@ -1303,6 +1303,20 @@ int32 scriptlib::card_check_equip_target(lua_State *L) {
...
@@ -1303,6 +1303,20 @@ int32 scriptlib::card_check_equip_target(lua_State *L) {
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_check_union_target
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
target
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_UNION_LIMIT
,
target
)
&&
((
!
pcard
->
is_affected_by_effect
(
EFFECT_OLDUNION_STATUS
)
||
target
->
get_union_count
()
==
0
)
&&
(
!
pcard
->
is_affected_by_effect
(
EFFECT_UNION_STATUS
)
||
target
->
get_old_union_count
()
==
0
)))
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_get_union_count
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_union_count
(
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
);
...
@@ -3221,6 +3235,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -3221,6 +3235,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetEquipTarget"
,
scriptlib
::
card_get_equip_target
},
{
"GetEquipTarget"
,
scriptlib
::
card_get_equip_target
},
{
"GetPreviousEquipTarget"
,
scriptlib
::
card_get_pre_equip_target
},
{
"GetPreviousEquipTarget"
,
scriptlib
::
card_get_pre_equip_target
},
{
"CheckEquipTarget"
,
scriptlib
::
card_check_equip_target
},
{
"CheckEquipTarget"
,
scriptlib
::
card_check_equip_target
},
{
"CheckUnionTarget"
,
scriptlib
::
card_check_union_target
},
{
"GetUnionCount"
,
scriptlib
::
card_get_union_count
},
{
"GetUnionCount"
,
scriptlib
::
card_get_union_count
},
{
"GetOverlayGroup"
,
scriptlib
::
card_get_overlay_group
},
{
"GetOverlayGroup"
,
scriptlib
::
card_get_overlay_group
},
{
"GetOverlayCount"
,
scriptlib
::
card_get_overlay_count
},
{
"GetOverlayCount"
,
scriptlib
::
card_get_overlay_count
},
...
...
operations.cpp
View file @
2fb9a464
...
@@ -467,32 +467,33 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea
...
@@ -467,32 +467,33 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea
}
}
}
}
}
}
uint32
val
=
amount
;
eset.clear();
eset.clear();
filter_player_effect
(
playerid
,
EFFECT_
CHANGE
_DAMAGE
,
&
eset
);
filter_player_effect(playerid, EFFECT_
REFLECT
_DAMAGE, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
for(int32 i = 0; i < eset.size(); ++i) {
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(amount, PARAM_TYPE_INT);
pduel->lua->add_param(amount, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT);
pduel->lua->add_param(reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(reason_card, PARAM_TYPE_CARD);
pduel->lua->add_param(reason_card, PARAM_TYPE_CARD);
val
=
eset
[
i
]
->
get_value
(
5
);
if (eset[i]->check_value_condition(5)) {
returns
.
ivalue
[
0
]
=
val
;
playerid = 1 - playerid;
if
(
val
==
0
)
core.units.begin()->arg2 |= 1 << 29;
return
TRUE
;
break;
}
}
}
uint32 val = amount;
eset.clear();
eset.clear();
filter_player_effect
(
playerid
,
EFFECT_
REFLECT
_DAMAGE
,
&
eset
);
filter_player_effect(playerid, EFFECT_
CHANGE
_DAMAGE, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
for(int32 i = 0; i < eset.size(); ++i) {
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(val, PARAM_TYPE_INT);
pduel->lua->add_param(val, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT);
pduel->lua->add_param(reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(reason_card, PARAM_TYPE_CARD);
pduel->lua->add_param(reason_card, PARAM_TYPE_CARD);
if
(
eset
[
i
]
->
check_value_condition
(
5
))
{
val = eset[i]->get_value(5);
core
.
units
.
begin
()
->
arg2
|=
1
<<
29
;
returns.ivalue[0] = val
;
break
;
if(val == 0)
}
return TRUE;
}
}
core.units.begin()->arg2 = (core.units.begin()->arg2 & 0xff000000) | (val & 0xffffff);
core.units.begin()->arg2 = (core.units.begin()->arg2 & 0xff000000) | (val & 0xffffff);
if(is_step) {
if(is_step) {
...
...
scriptlib.h
View file @
2fb9a464
...
@@ -138,6 +138,7 @@ public:
...
@@ -138,6 +138,7 @@ public:
static
int32
card_get_equip_target
(
lua_State
*
L
);
static
int32
card_get_equip_target
(
lua_State
*
L
);
static
int32
card_get_pre_equip_target
(
lua_State
*
L
);
static
int32
card_get_pre_equip_target
(
lua_State
*
L
);
static
int32
card_check_equip_target
(
lua_State
*
L
);
static
int32
card_check_equip_target
(
lua_State
*
L
);
static
int32
card_check_union_target
(
lua_State
*
L
);
static
int32
card_get_union_count
(
lua_State
*
L
);
static
int32
card_get_union_count
(
lua_State
*
L
);
static
int32
card_get_overlay_group
(
lua_State
*
L
);
static
int32
card_get_overlay_group
(
lua_State
*
L
);
static
int32
card_get_overlay_count
(
lua_State
*
L
);
static
int32
card_get_overlay_count
(
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