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
3afeebf2
Commit
3afeebf2
authored
Jan 28, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
f3070210
eb1c8767
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
4 deletions
+51
-4
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+7
-0
libcard.cpp
libcard.cpp
+36
-0
processor.cpp
processor.cpp
+4
-4
scriptlib.h
scriptlib.h
+3
-0
No files found.
effect.h
View file @
3afeebf2
...
...
@@ -452,6 +452,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_MATERIAL_LIMIT 361
#define EFFECT_SET_BATTLE_ATTACK 362
#define EFFECT_SET_BATTLE_DEFENSE 363
#define EFFECT_OVERLAY_RITUAL_MATERIAL 364
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
...
...
field.cpp
View file @
3afeebf2
...
...
@@ -1868,6 +1868,9 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
))
material
->
insert
(
pcard
);
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_OVERLAY_RITUAL_MATERIAL
))
for
(
auto
&
mcard
:
pcard
->
xyz_materials
)
material
->
insert
(
mcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
...
...
@@ -1898,12 +1901,16 @@ void field::get_fusion_material(uint8 playerid, card_set* material) {
void
field
::
ritual_release
(
card_set
*
material
)
{
card_set
rel
;
card_set
rem
;
card_set
xyz
;
for
(
auto
&
pcard
:
*
material
)
{
if
(
pcard
->
current
.
location
==
LOCATION_GRAVE
)
rem
.
insert
(
pcard
);
else
if
(
pcard
->
current
.
location
==
LOCATION_OVERLAY
)
xyz
.
insert
(
pcard
);
else
rel
.
insert
(
pcard
);
}
send_to
(
&
xyz
,
core
.
reason_effect
,
REASON_RITUAL
+
REASON_EFFECT
+
REASON_MATERIAL
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
release
(
&
rel
,
core
.
reason_effect
,
REASON_RITUAL
+
REASON_EFFECT
+
REASON_MATERIAL
,
core
.
reason_player
);
send_to
(
&
rem
,
core
.
reason_effect
,
REASON_RITUAL
+
REASON_EFFECT
+
REASON_MATERIAL
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_REMOVED
,
0
,
POS_FACEUP
);
}
...
...
libcard.cpp
View file @
3afeebf2
...
...
@@ -1161,6 +1161,28 @@ int32 scriptlib::card_is_summon_type(lua_State *L) {
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_summon_location
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tloc
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(((
pcard
->
summon_info
>>
16
)
&
0xff
)
&
tloc
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_summon_player
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
con
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
pcard
->
summon_player
==
con
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_status
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
@@ -2425,6 +2447,17 @@ int32 scriptlib::card_is_controler(lua_State *L) {
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_pre_controler
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
con
=
(
uint32
)
lua_tointeger
(
L
,
2
);
if
(
pcard
->
previous
.
controler
==
con
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_onfield
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
@@ -3245,6 +3278,8 @@ static const struct luaL_Reg cardlib[] = {
{
"IsLinkAttribute"
,
scriptlib
::
card_is_link_attribute
},
{
"IsReason"
,
scriptlib
::
card_is_reason
},
{
"IsSummonType"
,
scriptlib
::
card_is_summon_type
},
{
"IsSummonLocation"
,
scriptlib
::
card_is_summon_location
},
{
"IsSummonPlayer"
,
scriptlib
::
card_is_summon_player
},
{
"IsStatus"
,
scriptlib
::
card_is_status
},
{
"IsNotTuner"
,
scriptlib
::
card_is_not_tuner
},
{
"SetStatus"
,
scriptlib
::
card_set_status
},
...
...
@@ -3343,6 +3378,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsPosition"
,
scriptlib
::
card_is_position
},
{
"IsPreviousPosition"
,
scriptlib
::
card_is_pre_position
},
{
"IsControler"
,
scriptlib
::
card_is_controler
},
{
"IsPreviousControler"
,
scriptlib
::
card_is_pre_controler
},
{
"IsOnField"
,
scriptlib
::
card_is_onfield
},
{
"IsLocation"
,
scriptlib
::
card_is_location
},
{
"IsPreviousLocation"
,
scriptlib
::
card_is_pre_location
},
...
...
processor.cpp
View file @
3afeebf2
...
...
@@ -1820,7 +1820,7 @@ int32 field::process_instant_event() {
}
}
}
if
(
ev
.
event_code
==
EVENT_ADJUST
||
ev
.
event_code
==
EVENT_BREAK_EFFECT
||
((
ev
.
event_code
&
0xf000
)
==
EVENT_PHASE_START
))
if
(
ev
.
event_code
==
EVENT_ADJUST
||
ev
.
event_code
==
EVENT_BREAK_EFFECT
||
((
ev
.
event_code
&
0xf000
)
==
EVENT_PHASE_START
)
&&
((
ev
.
event_code
&
EVENT_CUSTOM
)
==
0
)
)
continue
;
//triggers
pr
=
effects
.
trigger_f_effect
.
equal_range
(
ev
.
event_code
);
...
...
@@ -3338,7 +3338,7 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
if
(
eset
.
size
())
{
pierce
=
true
;
uint8
dp
[
2
]
=
{};
for
(
u
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
dp
[
1
-
eset
[
i
]
->
get_handler_player
()]
=
1
;
if
(
dp
[
0
])
core
.
battle_damage
[
0
]
=
a
-
d
;
...
...
@@ -3435,7 +3435,7 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
bool
double_dam
=
false
;
bool
half_dam
=
false
;
int32
dam_value
=
-
1
;
for
(
u
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
int32
val
=
-
1
;
if
(
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
{
pduel
->
lua
->
add_param
(
p
,
PARAM_TYPE_INT
);
...
...
@@ -3555,7 +3555,7 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
bool
double_dam
=
false
;
bool
half_dam
=
false
;
int32
dam_value
=
-
1
;
for
(
u
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
int32
val
=
-
1
;
if
(
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
{
pduel
->
lua
->
add_param
(
p
,
PARAM_TYPE_INT
);
...
...
scriptlib.h
View file @
3afeebf2
...
...
@@ -123,6 +123,8 @@ public:
static
int32
card_is_link_attribute
(
lua_State
*
L
);
static
int32
card_is_reason
(
lua_State
*
L
);
static
int32
card_is_summon_type
(
lua_State
*
L
);
static
int32
card_is_summon_location
(
lua_State
*
L
);
static
int32
card_is_summon_player
(
lua_State
*
L
);
static
int32
card_is_status
(
lua_State
*
L
);
static
int32
card_is_not_tuner
(
lua_State
*
L
);
static
int32
card_set_status
(
lua_State
*
L
);
...
...
@@ -221,6 +223,7 @@ public:
static
int32
card_is_position
(
lua_State
*
L
);
static
int32
card_is_pre_position
(
lua_State
*
L
);
static
int32
card_is_controler
(
lua_State
*
L
);
static
int32
card_is_pre_controler
(
lua_State
*
L
);
static
int32
card_is_onfield
(
lua_State
*
L
);
static
int32
card_is_location
(
lua_State
*
L
);
static
int32
card_is_pre_location
(
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