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
971f808f
Commit
971f808f
authored
Nov 24, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
60d8b81d
8ec990d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
6 deletions
+45
-6
field.cpp
field.cpp
+39
-0
field.h
field.h
+1
-0
libduel.cpp
libduel.cpp
+2
-2
operations.cpp
operations.cpp
+1
-2
processor.cpp
processor.cpp
+2
-2
No files found.
field.cpp
View file @
971f808f
...
...
@@ -3242,6 +3242,45 @@ int32 field::get_cteffect_evt(effect* feffect, int32 playerid, const tevent& e,
}
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
()
{
return
((
core
.
duel_options
&
DUEL_ATTACK_FIRST_TURN
)
||
infos
.
turn_id
!=
1
)
&&
infos
.
phase
<
PHASE_BATTLE_START
...
...
field.h
View file @
971f808f
...
...
@@ -468,6 +468,7 @@ public:
chain
*
get_chain
(
uint32
chaincount
);
int32
get_cteffect
(
effect
*
peffect
,
int32
playerid
,
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
();
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
);
...
...
libduel.cpp
View file @
971f808f
...
...
@@ -1115,7 +1115,7 @@ int32 scriptlib::duel_damage(lua_State *L) {
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
amount
=
lua_tointeger
(
L
,
2
);
int32
amount
=
std
::
round
(
lua_tonumber
(
L
,
2
)
);
if
(
amount
<
0
)
amount
=
0
;
uint32
reason
=
lua_tointeger
(
L
,
3
);
...
...
@@ -1133,7 +1133,7 @@ int32 scriptlib::duel_recover(lua_State *L) {
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
amount
=
lua_tointeger
(
L
,
2
);
int32
amount
=
std
::
round
(
lua_tonumber
(
L
,
2
)
);
if
(
amount
<
0
)
amount
=
0
;
uint32
reason
=
lua_tointeger
(
L
,
3
);
...
...
operations.cpp
View file @
971f808f
...
...
@@ -2925,7 +2925,6 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
core
.
special_summoning
.
insert
(
target
);
target
->
enable_field_effect
(
false
);
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
)
{
uint32
flag1
,
flag2
;
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
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
;
}
case
2
:
{
...
...
processor.cpp
View file @
971f808f
...
...
@@ -1455,7 +1455,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
continue
;
peffect
->
id
=
infos
.
field_id
++
;
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
.
select_chains
.
push_back
(
newchain
);
fc_count
++
;
...
...
@@ -2153,7 +2153,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
newchain
.
set_triggering_place
(
phandler
);
newchain
.
triggering_player
=
priority
;
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
]
++
;
}
}
...
...
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