Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
63f1a25e
Commit
63f1a25e
authored
Nov 24, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
ab3cab9f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
6 deletions
+45
-6
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+39
-0
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-0
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+2
-2
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+1
-2
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+2
-2
No files found.
Classes/ocgcore/field.cpp
View file @
63f1a25e
...
@@ -3245,6 +3245,45 @@ int32 field::get_cteffect_evt(effect* feffect, int32 playerid, const tevent& e,
...
@@ -3245,6 +3245,45 @@ int32 field::get_cteffect_evt(effect* feffect, int32 playerid, const tevent& e,
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
check_cteffect_hint
(
effect
*
peffect
,
uint8
playerid
)
{
card
*
phandler
=
peffect
->
get_handler
();
if
(
phandler
->
data
.
type
!=
(
TYPE_TRAP
|
TYPE_CONTINUOUS
))
return
FALSE
;
if
(
!
(
peffect
->
type
&
EFFECT_TYPE_ACTIVATE
))
return
FALSE
;
if
(
peffect
->
code
!=
EVENT_FREE_CHAIN
)
return
FALSE
;
if
(
peffect
->
cost
||
peffect
->
target
||
peffect
->
operation
)
return
FALSE
;
for
(
auto
&
efit
:
phandler
->
field_effect
)
{
effect
*
feffect
=
efit
.
second
;
if
(
!
(
feffect
->
type
&
(
EFFECT_TYPE_TRIGGER_F
|
EFFECT_TYPE_TRIGGER_O
|
EFFECT_TYPE_QUICK_O
)))
continue
;
if
(
!
feffect
->
in_range
(
phandler
))
continue
;
uint32
code
=
efit
.
first
;
if
(
code
==
EVENT_FREE_CHAIN
||
code
==
EVENT_PHASE
+
infos
.
phase
)
{
nil_event
.
event_code
=
code
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
nil_event
,
FALSE
)
&&
(
code
!=
EVENT_FREE_CHAIN
||
check_hint_timing
(
feffect
)))
return
TRUE
;
}
else
{
for
(
const
auto
&
ev
:
core
.
point_event
)
{
if
(
code
!=
ev
.
event_code
)
continue
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
ev
,
FALSE
))
return
TRUE
;
}
for
(
const
auto
&
ev
:
core
.
instant_event
)
{
if
(
code
!=
ev
.
event_code
)
continue
;
if
(
get_cteffect_evt
(
feffect
,
playerid
,
ev
,
FALSE
))
return
TRUE
;
}
}
}
return
FALSE
;
}
int32
field
::
is_able_to_enter_bp
()
{
int32
field
::
is_able_to_enter_bp
()
{
return
((
core
.
duel_options
&
DUEL_ATTACK_FIRST_TURN
)
||
infos
.
turn_id
!=
1
)
return
((
core
.
duel_options
&
DUEL_ATTACK_FIRST_TURN
)
||
infos
.
turn_id
!=
1
)
&&
infos
.
phase
<
PHASE_BATTLE_START
&&
infos
.
phase
<
PHASE_BATTLE_START
...
...
Classes/ocgcore/field.h
View file @
63f1a25e
...
@@ -468,6 +468,7 @@ public:
...
@@ -468,6 +468,7 @@ public:
chain
*
get_chain
(
uint32
chaincount
);
chain
*
get_chain
(
uint32
chaincount
);
int32
get_cteffect
(
effect
*
peffect
,
int32
playerid
,
int32
store
);
int32
get_cteffect
(
effect
*
peffect
,
int32
playerid
,
int32
store
);
int32
get_cteffect_evt
(
effect
*
feffect
,
int32
playerid
,
const
tevent
&
e
,
int32
store
);
int32
get_cteffect_evt
(
effect
*
feffect
,
int32
playerid
,
const
tevent
&
e
,
int32
store
);
int32
check_cteffect_hint
(
effect
*
peffect
,
uint8
playerid
);
int32
is_able_to_enter_bp
();
int32
is_able_to_enter_bp
();
void
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
ptr
arg1
,
ptr
arg2
,
ptr
arg3
=
0
,
ptr
arg4
=
0
,
void
*
ptr1
=
NULL
,
void
*
ptr2
=
NULL
);
void
add_process
(
uint16
type
,
uint16
step
,
effect
*
peffect
,
group
*
target
,
ptr
arg1
,
ptr
arg2
,
ptr
arg3
=
0
,
ptr
arg4
=
0
,
void
*
ptr1
=
NULL
,
void
*
ptr2
=
NULL
);
...
...
Classes/ocgcore/libduel.cpp
View file @
63f1a25e
...
@@ -1115,7 +1115,7 @@ int32 scriptlib::duel_damage(lua_State *L) {
...
@@ -1115,7 +1115,7 @@ int32 scriptlib::duel_damage(lua_State *L) {
uint32
playerid
=
lua_tointeger
(
L
,
1
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
amount
=
lua_tointeger
(
L
,
2
);
int32
amount
=
std
::
round
(
lua_tonumber
(
L
,
2
)
);
if
(
amount
<
0
)
if
(
amount
<
0
)
amount
=
0
;
amount
=
0
;
uint32
reason
=
lua_tointeger
(
L
,
3
);
uint32
reason
=
lua_tointeger
(
L
,
3
);
...
@@ -1133,7 +1133,7 @@ int32 scriptlib::duel_recover(lua_State *L) {
...
@@ -1133,7 +1133,7 @@ int32 scriptlib::duel_recover(lua_State *L) {
uint32
playerid
=
lua_tointeger
(
L
,
1
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
amount
=
lua_tointeger
(
L
,
2
);
int32
amount
=
std
::
round
(
lua_tonumber
(
L
,
2
)
);
if
(
amount
<
0
)
if
(
amount
<
0
)
amount
=
0
;
amount
=
0
;
uint32
reason
=
lua_tointeger
(
L
,
3
);
uint32
reason
=
lua_tointeger
(
L
,
3
);
...
...
Classes/ocgcore/operations.cpp
View file @
63f1a25e
...
@@ -2925,7 +2925,6 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
...
@@ -2925,7 +2925,6 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
core
.
special_summoning
.
insert
(
target
);
core
.
special_summoning
.
insert
(
target
);
target
->
enable_field_effect
(
false
);
target
->
enable_field_effect
(
false
);
check_card_counter
(
target
,
3
,
target
->
summon_player
);
check_card_counter
(
target
,
3
,
target
->
summon_player
);
uint32
move_player
=
(
target
->
data
.
type
&
TYPE_TOKEN
)
?
target
->
owner
:
target
->
summon_player
;
if
(
targets
&&
core
.
duel_rule
>=
4
)
{
if
(
targets
&&
core
.
duel_rule
>=
4
)
{
uint32
flag1
,
flag2
;
uint32
flag1
,
flag2
;
int32
ct1
=
get_tofield_count
(
target
,
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
int32
ct1
=
get_tofield_count
(
target
,
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
...
@@ -2944,7 +2943,7 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
...
@@ -2944,7 +2943,7 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
zone
&=
flag1
;
zone
&=
flag1
;
}
}
}
}
move_to_field
(
target
,
move
_player
,
playerid
,
LOCATION_MZONE
,
positions
,
FALSE
,
0
,
FALSE
,
zone
);
move_to_field
(
target
,
target
->
summon
_player
,
playerid
,
LOCATION_MZONE
,
positions
,
FALSE
,
0
,
FALSE
,
zone
);
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
...
...
Classes/ocgcore/processor.cpp
View file @
63f1a25e
...
@@ -1455,7 +1455,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
...
@@ -1455,7 +1455,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
continue
;
continue
;
peffect
->
id
=
infos
.
field_id
++
;
peffect
->
id
=
infos
.
field_id
++
;
newchain
.
triggering_effect
=
peffect
;
newchain
.
triggering_effect
=
peffect
;
if
(
check_hint_timing
(
peffect
))
if
(
check_hint_timing
(
peffect
)
||
check_cteffect_hint
(
peffect
,
check_player
)
)
core
.
spe_effect
[
check_player
]
++
;
core
.
spe_effect
[
check_player
]
++
;
core
.
select_chains
.
push_back
(
newchain
);
core
.
select_chains
.
push_back
(
newchain
);
fc_count
++
;
fc_count
++
;
...
@@ -2153,7 +2153,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2153,7 +2153,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
newchain
.
set_triggering_place
(
phandler
);
newchain
.
set_triggering_place
(
phandler
);
newchain
.
triggering_player
=
priority
;
newchain
.
triggering_player
=
priority
;
core
.
select_chains
.
push_back
(
newchain
);
core
.
select_chains
.
push_back
(
newchain
);
if
(
check_hint_timing
(
peffect
))
if
(
check_hint_timing
(
peffect
)
||
check_cteffect_hint
(
peffect
,
priority
)
)
core
.
spe_effect
[
priority
]
++
;
core
.
spe_effect
[
priority
]
++
;
}
}
}
}
...
...
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