Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
f6b9f6d3
Commit
f6b9f6d3
authored
Nov 10, 2014
by
Argon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
counter
parent
17fd24d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
13 deletions
+121
-13
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+60
-10
ocgcore/operations.cpp
ocgcore/operations.cpp
+51
-3
ocgcore/processor.cpp
ocgcore/processor.cpp
+10
-0
No files found.
ocgcore/libduel.cpp
View file @
f6b9f6d3
...
...
@@ -3074,16 +3074,41 @@ int32 scriptlib::duel_add_custom_activity_counter(lua_State *L) {
int32
counter_filter
=
interpreter
::
get_function_handle
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
switch
(
activity_type
)
{
case
1
:
case
1
:
{
auto
iter
=
pduel
->
game_field
->
core
.
summon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
summon_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
summon_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
case
2
:
}
case
2
:
{
auto
iter
=
pduel
->
game_field
->
core
.
normalsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
normalsummon_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
normalsummon_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
case
3
:
}
case
3
:
{
auto
iter
=
pduel
->
game_field
->
core
.
spsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
spsummon_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
spsummon_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
case
4
:
}
case
4
:
{
auto
iter
=
pduel
->
game_field
->
core
.
flipsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
flipsummon_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
flipsummon_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
case
5
:
}
case
5
:
{
auto
iter
=
pduel
->
game_field
->
core
.
attack_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
attack_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
attack_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
}
default:
break
;
}
...
...
@@ -3095,20 +3120,45 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
int32
playerid
=
lua_tointeger
(
L
,
2
);
int32
activity_type
=
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
val
=
0
;
switch
(
activity_type
)
{
case
1
:
case
1
:{
auto
iter
=
pduel
->
game_field
->
core
.
summon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
summon_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
case
2
:
}
case
2
:
{
auto
iter
=
pduel
->
game_field
->
core
.
normalsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
normalsummon_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
case
3
:
}
case
3
:
{
auto
iter
=
pduel
->
game_field
->
core
.
spsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
spsummon_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
case
4
:
}
case
4
:
{
auto
iter
=
pduel
->
game_field
->
core
.
flipsummon_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
flipsummon_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
case
5
:
}
case
5
:
{
auto
iter
=
pduel
->
game_field
->
core
.
attack_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
attack_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
}
default:
break
;
}
if
(
playerid
==
0
)
lua_pushinteger
(
L
,
val
&
0xffff
);
else
lua_pushinteger
(
L
,
(
val
>>
16
)
&
0xffff
);
return
0
;
}
int32
scriptlib
::
duel_venom_swamp_check
(
lua_State
*
L
)
{
...
...
ocgcore/operations.cpp
View file @
f6b9f6d3
...
...
@@ -2006,6 +2006,23 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
target
->
current
.
reason_effect
=
peffect
;
target
->
current
.
reason_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
core
.
spsummon_state_count
[
sumplayer
]
++
;
for
(
auto
&
iter
:
core
.
spsummon_counter
)
{
auto
&
info
=
iter
.
second
;
if
(
info
.
first
)
{
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
target
->
summon_info
&
0xff00ffff
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
positions
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
5
))
{
if
(
sumplayer
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
}
}
}
break_effect
();
return
FALSE
;
}
...
...
@@ -2022,7 +2039,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pduel
->
write_buffer8
(
target
->
current
.
location
);
pduel
->
write_buffer8
(
target
->
current
.
sequence
);
pduel
->
write_buffer8
(
target
->
current
.
position
);
core
.
spsummon_state_count
[
sumplayer
]
++
;
return
FALSE
;
}
case
5
:
{
...
...
@@ -2166,8 +2182,25 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
sumplayer
;
pcard
->
summon_player
=
sumplayer
;
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xf00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
target
->
current
.
location
<<
16
);
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xf
f
00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
target
->
current
.
location
<<
16
);
move_to_field
(
pcard
,
sumplayer
,
sumplayer
,
LOCATION_MZONE
,
POS_FACEUP
);
core
.
spsummon_state_count
[
sumplayer
]
++
;
for
(
auto
&
iter
:
core
.
spsummon_counter
)
{
auto
&
info
=
iter
.
second
;
if
(
info
.
first
)
{
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
target
->
summon_info
&
0xff00ffff
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
POS_FACEUP
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
5
))
{
if
(
sumplayer
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
}
}
}
return
FALSE
;
}
case
24
:
{
...
...
@@ -2179,7 +2212,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
position
);
core
.
spsummon_state_count
[
sumplayer
]
++
;
if
(
pgroup
->
it
!=
pgroup
->
container
.
end
())
core
.
units
.
begin
()
->
step
=
22
;
return
FALSE
;
...
...
@@ -2312,6 +2344,22 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
target
->
enable_field_effect
(
FALSE
);
target
->
set_status
(
STATUS_FLIP_SUMMONED
,
FALSE
);
core
.
spsummon_state_count
[
target
->
summon_player
]
++
;
for
(
auto
&
iter
:
core
.
spsummon_counter
)
{
auto
&
info
=
iter
.
second
;
if
(
info
.
first
)
{
pduel
->
lua
->
add_param
(
core
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
target
->
summon_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
target
->
summon_info
&
0xff00ffff
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
positions
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
5
))
{
if
(
playerid
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
}
}
}
core
.
hint_timing
[
target
->
summon_player
]
|=
TIMING_SPSUMMON
;
move_to_field
(
target
,
target
->
summon_player
,
playerid
,
LOCATION_MZONE
,
positions
);
return
FALSE
;
...
...
ocgcore/processor.cpp
View file @
f6b9f6d3
...
...
@@ -4000,6 +4000,16 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
for
(
auto
rit
=
effects
.
rechargeable
.
begin
();
rit
!=
effects
.
rechargeable
.
end
();
++
rit
)
if
(
!
((
*
rit
)
->
flag
&
EFFECT_FLAG_NO_TURN_RESET
))
(
*
rit
)
->
recharge
();
for
(
auto
&
iter
:
core
.
summon_counter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
normalsummon_counter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
spsummon_counter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
flipsummon_counter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
attack_counter
)
iter
.
second
.
second
=
0
;
infos
.
turn_id
++
;
infos
.
turn_player
=
turn_player
;
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
...
...
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