Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
35ba22db
Commit
35ba22db
authored
Dec 22, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update_core
parent
a6ba4d3e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
15 deletions
+50
-15
ocgcore/card.cpp
ocgcore/card.cpp
+14
-4
ocgcore/effect.h
ocgcore/effect.h
+6
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+5
-7
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+17
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+1
-1
ocgcore/processor.cpp
ocgcore/processor.cpp
+5
-3
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+2
-0
No files found.
ocgcore/card.cpp
View file @
35ba22db
...
...
@@ -1174,12 +1174,22 @@ uint32 card::get_link_marker() {
if
(
!
(
data
.
type
&
TYPE_LINK
))
return
0
;
effect_set
effects
;
effect_set
effects2
;
uint32
link_marker
=
data
.
link_marker
;
filter_effect
(
710253
,
&
effects
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
){
filter_effect
(
EFFECT_ADD_LINK_MARKER_KOISHI
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_REMOVE_LINK_MARKER_KOISHI
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_LINK_MARKER_KOISHI
,
&
effects2
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
card
*
ocard
=
effects
[
i
]
->
get_handler
();
if
(
!
(
effects
[
i
]
->
type
&
EFFECT_TYPE_FIELD
)
||
!
(
ocard
&&
ocard
->
get_status
(
STATUS_TO_LEAVE_FROMEX
)))
link_marker
=
effects
[
i
]
->
get_value
(
this
);
if
(
effects
[
i
]
->
code
==
EFFECT_ADD_LINK_MARKER_KOISHI
&&
(
!
(
effects
[
i
]
->
type
&
EFFECT_TYPE_FIELD
)
||
!
(
ocard
&&
ocard
->
get_status
(
STATUS_TO_LEAVE_FROMEX
))))
link_marker
|=
effects
[
i
]
->
get_value
(
this
);
else
if
(
effects
[
i
]
->
code
==
EFFECT_REMOVE_LINK_MARKER_KOISHI
&&
(
!
(
effects
[
i
]
->
type
&
EFFECT_TYPE_FIELD
)
||
!
(
ocard
&&
ocard
->
get_status
(
STATUS_TO_LEAVE_FROMEX
))))
link_marker
&=
~
(
effects
[
i
]
->
get_value
(
this
));
}
for
(
int32
i
=
0
;
i
<
effects2
.
size
();
++
i
)
{
card
*
ocard
=
effects2
[
i
]
->
get_handler
();
if
(
!
(
effects2
[
i
]
->
type
&
EFFECT_TYPE_FIELD
)
||
!
(
ocard
&&
ocard
->
get_status
(
STATUS_TO_LEAVE_FROMEX
)))
link_marker
=
effects2
[
i
]
->
get_value
(
this
);
}
return
link_marker
;
}
...
...
ocgcore/effect.h
View file @
35ba22db
...
...
@@ -436,6 +436,12 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_ADD_LINK_ATTRIBUTE 356
#define EFFECT_ADD_LINK_RACE 357
// KoishiPro effects
#define EFFECT_CHANGE_LINK_MARKER_KOISHI 710253
#define EFFECT_ADD_LINK_MARKER_KOISHI 37564151
#define EFFECT_REMOVE_LINK_MARKER_KOISHI 37564152
#define EFFECT_CANNOT_LOSE_KOISHI 37564153
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
#define EVENT_FREE_CHAIN 1002
...
...
ocgcore/interpreter.cpp
View file @
35ba22db
...
...
@@ -21,6 +21,8 @@ static const struct luaL_Reg cardlib[] = {
//modded
{
"SetEntityCode"
,
scriptlib
::
card_set_entity_code
},
{
"SetCardData"
,
scriptlib
::
card_set_card_data
},
{
"GetLinkMarker"
,
scriptlib
::
card_get_link_marker
},
{
"GetOriginalLinkMarker"
,
scriptlib
::
card_get_origin_link_marker
},
{
"GetCode"
,
scriptlib
::
card_get_code
},
{
"GetOriginalCode"
,
scriptlib
::
card_get_origin_code
},
...
...
@@ -752,15 +754,11 @@ int32 interpreter::load_card_script(uint32 code) {
lua_pushvalue
(
current_state
,
-
2
);
lua_rawset
(
current_state
,
-
3
);
//load extra scripts
sprintf
(
script_name
,
"./beta/script/c%d.lua"
,
code
);
sprintf
(
script_name
,
"./expansions/script/c%d.lua"
,
code
);
if
(
!
load_script
(
script_name
))
{
sprintf
(
script_name
,
"./
expansions/
script/c%d.lua"
,
code
);
sprintf
(
script_name
,
"./script/c%d.lua"
,
code
);
if
(
!
load_script
(
script_name
))
{
sprintf
(
script_name
,
"./script/c%d.lua"
,
code
);
if
(
!
load_script
(
script_name
))
{
return
OPERATION_FAIL
;
}
return
OPERATION_FAIL
;
}
}
}
...
...
ocgcore/libcard.cpp
View file @
35ba22db
...
...
@@ -83,6 +83,23 @@ int32 scriptlib::card_set_card_data(lua_State *L) {
}
return
0
;
}
int32
scriptlib
::
card_get_link_marker
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushinteger
(
L
,
pcard
->
get_link_marker
());
return
1
;
}
int32
scriptlib
::
card_get_origin_link_marker
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
pcard
->
status
&
STATUS_NO_LEVEL
)
lua_pushinteger
(
L
,
0
);
else
lua_pushinteger
(
L
,
pcard
->
data
.
link_marker
);
return
1
;
}
int32
scriptlib
::
card_get_code
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
ocgcore/operations.cpp
View file @
35ba22db
...
...
@@ -510,7 +510,7 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea
pduel
->
write_buffer32
(
amount
);
raise_event
(
reason_card
,
EVENT_DAMAGE
,
reason_effect
,
reason
,
reason_player
,
playerid
,
amount
);
if
(
reason
==
REASON_BATTLE
&&
reason_card
)
{
if
((
player
[
playerid
].
lp
<=
0
)
&&
(
core
.
attack_target
==
0
)
&&
reason_card
->
is_affected_by_effect
(
EFFECT_MATCH_KILL
))
{
if
((
player
[
playerid
].
lp
<=
0
)
&&
(
core
.
attack_target
==
0
)
&&
reason_card
->
is_affected_by_effect
(
EFFECT_MATCH_KILL
)
&&
!
(
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_LOSE_KOISHI
))
)
{
pduel
->
write_buffer8
(
MSG_MATCH_KILL
);
pduel
->
write_buffer32
(
reason_card
->
data
.
code
);
}
...
...
ocgcore/processor.cpp
View file @
35ba22db
...
...
@@ -5136,7 +5136,9 @@ int32 field::adjust_step(uint16 step) {
case
1
:
{
//win check(deck=0 or lp=0)
uint32
winp
=
5
,
rea
=
1
;
if
(
player
[
0
].
lp
<=
0
&&
player
[
1
].
lp
>
0
)
{
bool
lp_zero_0
=
(
player
[
0
].
lp
<=
0
&&
!
is_player_affected_by_effect
(
0
,
EFFECT_CANNOT_LOSE_KOISHI
));
bool
lp_zero_1
=
(
player
[
1
].
lp
<=
0
&&
!
is_player_affected_by_effect
(
1
,
EFFECT_CANNOT_LOSE_KOISHI
));
if
(
lp_zero_0
&&
!
lp_zero_1
)
{
winp
=
1
;
rea
=
1
;
}
...
...
@@ -5144,7 +5146,7 @@ int32 field::adjust_step(uint16 step) {
winp
=
1
;
rea
=
2
;
}
if
(
player
[
1
].
lp
<=
0
&&
player
[
0
].
lp
>
0
)
{
if
(
lp_zero_1
&&
!
lp_zero_
0
)
{
winp
=
0
;
rea
=
1
;
}
...
...
@@ -5152,7 +5154,7 @@ int32 field::adjust_step(uint16 step) {
winp
=
0
;
rea
=
2
;
}
if
(
player
[
1
].
lp
<=
0
&&
player
[
0
].
lp
<=
0
)
{
if
(
lp_zero_0
&&
lp_zero_1
)
{
winp
=
PLAYER_NONE
;
rea
=
1
;
}
...
...
ocgcore/scriptlib.h
View file @
35ba22db
...
...
@@ -21,6 +21,8 @@ public:
//modded
static
int32
card_set_entity_code
(
lua_State
*
L
);
static
int32
card_set_card_data
(
lua_State
*
L
);
static
int32
card_get_link_marker
(
lua_State
*
L
);
static
int32
card_get_origin_link_marker
(
lua_State
*
L
);
static
int32
effect_set_owner
(
lua_State
*
L
);
static
int32
effect_get_range
(
lua_State
*
L
);
static
int32
effect_get_count_limit
(
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