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
baichixing
ygopro
Commits
dc22d6cf
Commit
dc22d6cf
authored
Dec 17, 2014
by
fluorohydride
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chain activity counter
parent
fbd7df74
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
168 additions
and
56 deletions
+168
-56
ocgcore/field.cpp
ocgcore/field.cpp
+60
-1
ocgcore/field.h
ocgcore/field.h
+5
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+16
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+32
-14
ocgcore/processor.cpp
ocgcore/processor.cpp
+3
-0
script/c24861088.lua
script/c24861088.lua
+4
-13
script/c82301904.lua
script/c82301904.lua
+41
-21
script/constant.lua
script/constant.lua
+7
-6
No files found.
ocgcore/field.cpp
View file @
dc22d6cf
...
@@ -1411,7 +1411,7 @@ effect* field::check_unique_onfield(card* pcard, uint8 controler) {
...
@@ -1411,7 +1411,7 @@ effect* field::check_unique_onfield(card* pcard, uint8 controler) {
return
0
;
return
0
;
}
}
void
field
::
CheckC
ounter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
)
{
void
field
::
check_card_c
ounter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
)
{
auto
&
counter_map
=
(
counter_type
==
1
)
?
core
.
summon_counter
:
auto
&
counter_map
=
(
counter_type
==
1
)
?
core
.
summon_counter
:
(
counter_type
==
2
)
?
core
.
normalsummon_counter
:
(
counter_type
==
2
)
?
core
.
normalsummon_counter
:
(
counter_type
==
3
)
?
core
.
spsummon_counter
:
(
counter_type
==
3
)
?
core
.
spsummon_counter
:
...
@@ -1429,6 +1429,65 @@ void field::CheckCounter(card* pcard, int32 counter_type, int32 playerid) {
...
@@ -1429,6 +1429,65 @@ void field::CheckCounter(card* pcard, int32 counter_type, int32 playerid) {
}
}
}
}
}
}
void
field
::
check_card_counter
(
card_set
*
pcards
,
int32
counter_type
,
int32
playerid
)
{
auto
&
counter_map
=
(
counter_type
==
1
)
?
core
.
summon_counter
:
(
counter_type
==
2
)
?
core
.
normalsummon_counter
:
(
counter_type
==
3
)
?
core
.
spsummon_counter
:
(
counter_type
==
4
)
?
core
.
flipsummon_counter
:
core
.
attack_counter
;
for
(
auto
iter
=
counter_map
.
begin
();
iter
!=
counter_map
.
end
();
++
iter
)
{
auto
&
info
=
iter
->
second
;
if
(
info
.
first
)
{
for
(
auto
piter
=
pcards
->
begin
();
piter
!=
pcards
->
end
();
++
piter
)
{
pduel
->
lua
->
add_param
(
*
piter
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
1
))
{
if
(
playerid
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
break
;
}
}
}
}
}
void
field
::
check_card_counter
(
card_vector
*
pcards
,
int32
counter_type
,
int32
playerid
)
{
auto
&
counter_map
=
(
counter_type
==
1
)
?
core
.
summon_counter
:
(
counter_type
==
2
)
?
core
.
normalsummon_counter
:
(
counter_type
==
3
)
?
core
.
spsummon_counter
:
(
counter_type
==
4
)
?
core
.
flipsummon_counter
:
core
.
attack_counter
;
for
(
auto
iter
=
counter_map
.
begin
();
iter
!=
counter_map
.
end
();
++
iter
)
{
auto
&
info
=
iter
->
second
;
if
(
info
.
first
)
{
for
(
auto
piter
=
pcards
->
begin
();
piter
!=
pcards
->
end
();
++
piter
)
{
pduel
->
lua
->
add_param
(
*
piter
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
1
))
{
if
(
playerid
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
break
;
}
}
}
}
}
void
field
::
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
)
{
for
(
auto
iter
=
core
.
chain_counter
.
begin
();
iter
!=
core
.
chain_counter
.
end
();
++
iter
)
{
auto
&
info
=
iter
->
second
;
if
(
info
.
first
)
{
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
chainid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
3
))
{
if
(
playerid
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
break
;
}
}
}
}
int32
field
::
check_lp_cost
(
uint8
playerid
,
uint32
lp
)
{
int32
field
::
check_lp_cost
(
uint8
playerid
,
uint32
lp
)
{
effect_set
eset
;
effect_set
eset
;
int32
val
=
lp
;
int32
val
=
lp
;
...
...
ocgcore/field.h
View file @
dc22d6cf
...
@@ -277,6 +277,7 @@ struct processor {
...
@@ -277,6 +277,7 @@ struct processor {
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
spsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
spsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
flipsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
flipsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
attack_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
attack_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
chain_counter
;
};
};
class
field
{
class
field
{
public:
public:
...
@@ -356,7 +357,10 @@ public:
...
@@ -356,7 +357,10 @@ public:
void
add_unique_card
(
card
*
pcard
);
void
add_unique_card
(
card
*
pcard
);
void
remove_unique_card
(
card
*
pcard
);
void
remove_unique_card
(
card
*
pcard
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
);
void
CheckCounter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
card_set
*
pcards
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
card_vector
*
pcards
,
int32
counter_type
,
int32
playerid
);
void
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
);
int32
check_lp_cost
(
uint8
playerid
,
uint32
cost
);
int32
check_lp_cost
(
uint8
playerid
,
uint32
cost
);
void
save_lp_cost
();
void
save_lp_cost
();
...
...
ocgcore/libduel.cpp
View file @
dc22d6cf
...
@@ -3138,6 +3138,14 @@ int32 scriptlib::duel_add_custom_activity_counter(lua_State *L) {
...
@@ -3138,6 +3138,14 @@ int32 scriptlib::duel_add_custom_activity_counter(lua_State *L) {
pduel
->
game_field
->
core
.
attack_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
pduel
->
game_field
->
core
.
attack_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
break
;
}
}
case
6
:
break
;
case
7
:
{
auto
iter
=
pduel
->
game_field
->
core
.
chain_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
chain_counter
.
end
())
break
;
pduel
->
game_field
->
core
.
chain_counter
[
counter_id
]
=
std
::
make_pair
(
counter_filter
,
0
);
break
;
}
default:
default:
break
;
break
;
}
}
...
@@ -3181,6 +3189,14 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
...
@@ -3181,6 +3189,14 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
val
=
iter
->
second
.
second
;
val
=
iter
->
second
.
second
;
break
;
break
;
}
}
case
6
:
break
;
case
7
:
{
auto
iter
=
pduel
->
game_field
->
core
.
chain_counter
.
find
(
counter_id
);
if
(
iter
!=
pduel
->
game_field
->
core
.
chain_counter
.
end
())
val
=
iter
->
second
.
second
;
break
;
}
default:
default:
break
;
break
;
}
}
...
...
ocgcore/operations.cpp
View file @
dc22d6cf
...
@@ -1407,8 +1407,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
...
@@ -1407,8 +1407,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
pduel
->
write_buffer8
(
target
->
current
.
position
);
pduel
->
write_buffer8
(
target
->
current
.
position
);
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
CheckC
ounter
(
target
,
1
,
sumplayer
);
check_card_c
ounter
(
target
,
1
,
sumplayer
);
CheckC
ounter
(
target
,
2
,
sumplayer
);
check_card_c
ounter
(
target
,
2
,
sumplayer
);
if
(
target
->
material_cards
.
size
())
{
if
(
target
->
material_cards
.
size
())
{
for
(
auto
mit
=
target
->
material_cards
.
begin
();
mit
!=
target
->
material_cards
.
end
();
++
mit
)
for
(
auto
mit
=
target
->
material_cards
.
begin
();
mit
!=
target
->
material_cards
.
end
();
++
mit
)
raise_single_event
(
*
mit
,
0
,
EVENT_BE_PRE_MATERIAL
,
proc
,
REASON_SUMMON
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
*
mit
,
0
,
EVENT_BE_PRE_MATERIAL
,
proc
,
REASON_SUMMON
,
sumplayer
,
sumplayer
,
0
);
...
@@ -1539,7 +1539,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -1539,7 +1539,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
target
->
fieldid
=
infos
.
field_id
++
;
target
->
fieldid
=
infos
.
field_id
++
;
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
core
.
flipsummon_state_count
[
sumplayer
]
++
;
core
.
flipsummon_state_count
[
sumplayer
]
++
;
CheckC
ounter
(
target
,
4
,
sumplayer
);
check_card_c
ounter
(
target
,
4
,
sumplayer
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer8
(
target
->
current
.
controler
);
pduel
->
write_buffer8
(
target
->
current
.
controler
);
...
@@ -1771,7 +1771,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
...
@@ -1771,7 +1771,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
set_control
(
target
,
setplayer
,
0
,
0
);
set_control
(
target
,
setplayer
,
0
,
0
);
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
core
.
normalsummon_state_count
[
setplayer
]
++
;
core
.
normalsummon_state_count
[
setplayer
]
++
;
CheckC
ounter
(
target
,
2
,
setplayer
);
check_card_c
ounter
(
target
,
2
,
setplayer
);
target
->
set_status
(
STATUS_SUMMON_TURN
,
TRUE
);
target
->
set_status
(
STATUS_SUMMON_TURN
,
TRUE
);
pduel
->
write_buffer8
(
MSG_SET
);
pduel
->
write_buffer8
(
MSG_SET
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
...
@@ -2035,7 +2035,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2035,7 +2035,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
target
->
current
.
reason_player
=
sumplayer
;
target
->
current
.
reason_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
core
.
spsummon_state_count
[
sumplayer
]
++
;
core
.
spsummon_state_count
[
sumplayer
]
++
;
CheckC
ounter
(
target
,
3
,
sumplayer
);
check_card_c
ounter
(
target
,
3
,
sumplayer
);
break_effect
();
break_effect
();
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2184,6 +2184,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2184,6 +2184,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
if
(
pgroup
->
container
.
size
()
==
0
)
if
(
pgroup
->
container
.
size
()
==
0
)
return
TRUE
;
return
TRUE
;
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
check_card_counter
(
&
pgroup
->
container
,
3
,
sumplayer
);
pgroup
->
it
=
pgroup
->
container
.
begin
();
pgroup
->
it
=
pgroup
->
container
.
begin
();
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2197,7 +2198,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2197,7 +2198,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pcard
->
summon_player
=
sumplayer
;
pcard
->
summon_player
=
sumplayer
;
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xff00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
pcard
->
current
.
location
<<
16
);
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xff00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
pcard
->
current
.
location
<<
16
);
move_to_field
(
pcard
,
sumplayer
,
sumplayer
,
LOCATION_MZONE
,
POS_FACEUP
);
move_to_field
(
pcard
,
sumplayer
,
sumplayer
,
LOCATION_MZONE
,
POS_FACEUP
);
CheckCounter
(
pcard
,
3
,
sumplayer
);
return
FALSE
;
return
FALSE
;
}
}
case
24
:
{
case
24
:
{
...
@@ -2342,9 +2342,6 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
...
@@ -2342,9 +2342,6 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
if
(
!
targets
)
if
(
!
targets
)
core
.
special_summoning
.
insert
(
target
);
core
.
special_summoning
.
insert
(
target
);
target
->
enable_field_effect
(
FALSE
);
target
->
enable_field_effect
(
FALSE
);
core
.
spsummon_state_count
[
target
->
summon_player
]
++
;
CheckCounter
(
target
,
3
,
target
->
summon_player
);
core
.
hint_timing
[
target
->
summon_player
]
|=
TIMING_SPSUMMON
;
move_to_field
(
target
,
target
->
summon_player
,
playerid
,
LOCATION_MZONE
,
positions
);
move_to_field
(
target
,
target
->
summon_player
,
playerid
,
LOCATION_MZONE
,
positions
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2369,11 +2366,32 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
...
@@ -2369,11 +2366,32 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
int32
field
::
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
)
{
int32
field
::
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
card_vector
cv
(
targets
->
container
.
begin
(),
targets
->
container
.
end
());
card_vector
cvs
,
cvo
;
if
(
cv
.
size
()
>
1
)
for
(
auto
iter
=
targets
->
container
.
begin
();
iter
!=
targets
->
container
.
end
();
++
iter
)
{
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
auto
pcard
=
*
iter
;
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
if
(
pcard
->
summon_player
==
infos
.
turn_player
)
add_process
(
PROCESSOR_SPSUMMON_STEP
,
0
,
0
,
targets
,
0
,
(
ptr
)(
*
cvit
));
cvs
.
push_back
(
pcard
);
else
cvo
.
push_back
(
pcard
);
}
if
(
!
cvs
.
empty
())
{
if
(
cvs
.
size
()
>
1
)
std
::
sort
(
cvs
.
begin
(),
cvs
.
end
(),
card
::
card_operation_sort
);
core
.
spsummon_state_count
[
infos
.
turn_player
]
++
;
check_card_counter
(
&
cvs
,
3
,
infos
.
turn_player
);
core
.
hint_timing
[
infos
.
turn_player
]
|=
TIMING_SPSUMMON
;
for
(
auto
cvit
=
cvs
.
begin
();
cvit
!=
cvs
.
end
();
++
cvit
)
add_process
(
PROCESSOR_SPSUMMON_STEP
,
0
,
0
,
targets
,
0
,
(
ptr
)(
*
cvit
));
}
if
(
!
cvo
.
empty
())
{
if
(
cvo
.
size
()
>
1
)
std
::
sort
(
cvo
.
begin
(),
cvo
.
end
(),
card
::
card_operation_sort
);
core
.
spsummon_state_count
[
1
-
infos
.
turn_player
]
++
;
check_card_counter
(
&
cvo
,
3
,
1
-
infos
.
turn_player
);
core
.
hint_timing
[
1
-
infos
.
turn_player
]
|=
TIMING_SPSUMMON
;
for
(
auto
cvit
=
cvo
.
begin
();
cvit
!=
cvo
.
end
();
++
cvit
)
add_process
(
PROCESSOR_SPSUMMON_STEP
,
0
,
0
,
targets
,
0
,
(
ptr
)(
*
cvit
));
}
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
...
...
ocgcore/processor.cpp
View file @
dc22d6cf
...
@@ -4045,6 +4045,8 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
...
@@ -4045,6 +4045,8 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
iter
->
second
.
second
=
0
;
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
attack_counter
.
begin
();
iter
!=
core
.
attack_counter
.
end
();
++
iter
)
for
(
auto
iter
=
core
.
attack_counter
.
begin
();
iter
!=
core
.
attack_counter
.
end
();
++
iter
)
iter
->
second
.
second
=
0
;
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
chain_counter
.
begin
();
iter
!=
core
.
attack_counter
.
end
();
++
iter
)
iter
->
second
.
second
=
0
;
infos
.
turn_id
++
;
infos
.
turn_id
++
;
infos
.
turn_player
=
turn_player
;
infos
.
turn_player
=
turn_player
;
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
...
@@ -4356,6 +4358,7 @@ int32 field::add_chain(uint16 step) {
...
@@ -4356,6 +4358,7 @@ int32 field::add_chain(uint16 step) {
if
((
phandler
->
current
.
location
==
LOCATION_HAND
))
if
((
phandler
->
current
.
location
==
LOCATION_HAND
))
clit
->
flag
|=
CHAIN_HAND_EFFECT
;
clit
->
flag
|=
CHAIN_HAND_EFFECT
;
core
.
current_chain
.
push_back
(
*
clit
);
core
.
current_chain
.
push_back
(
*
clit
);
check_chain_counter
(
peffect
,
clit
->
triggering_controler
,
clit
->
chain_count
);
// triggered events which are not caused by RaiseEvent create relation with the handler
// triggered events which are not caused by RaiseEvent create relation with the handler
if
(
!
(
peffect
->
flag
&
EFFECT_FLAG_FIELD_ONLY
)
&&
(
!
(
peffect
->
type
&
0x2a0
)
||
(
peffect
->
code
&
EVENT_PHASE
)
==
EVENT_PHASE
))
{
if
(
!
(
peffect
->
flag
&
EFFECT_FLAG_FIELD_ONLY
)
&&
(
!
(
peffect
->
type
&
0x2a0
)
||
(
peffect
->
code
&
EVENT_PHASE
)
==
EVENT_PHASE
))
{
peffect
->
handler
->
create_relation
(
peffect
);
peffect
->
handler
->
create_relation
(
peffect
);
...
...
script/c24861088.lua
View file @
dc22d6cf
...
@@ -22,19 +22,10 @@ function c24861088.initial_effect(c)
...
@@ -22,19 +22,10 @@ function c24861088.initial_effect(c)
e2
:
SetTarget
(
c24861088
.
sptg
)
e2
:
SetTarget
(
c24861088
.
sptg
)
e2
:
SetOperation
(
c24861088
.
spop
)
e2
:
SetOperation
(
c24861088
.
spop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
if
not
c24861088
.
global_check
then
Duel
.
AddCustomActivityCounter
(
24861088
,
ACTIVITY_CHAIN
,
c24861088
.
chainfilter
)
c24861088
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAIN_SOLVED
)
ge1
:
SetOperation
(
c24861088
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
end
function
c24861088
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c24861088
.
chainfilter
(
re
,
tp
,
cid
)
if
not
re
:
GetHandler
():
IsSetCard
(
0x70
)
then
return
re
:
GetHandler
():
IsSetCard
(
0x70
)
Duel
.
RegisterFlagEffect
(
rp
,
24861089
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
function
c24861088
.
filter
(
c
)
function
c24861088
.
filter
(
c
)
return
c
:
IsSetCard
(
0x70
)
and
not
c
:
IsCode
(
24861088
)
and
c
:
IsAbleToHand
()
return
c
:
IsSetCard
(
0x70
)
and
not
c
:
IsCode
(
24861088
)
and
c
:
IsAbleToHand
()
...
@@ -59,7 +50,7 @@ function c24861088.spcon(e,tp,eg,ep,ev,re,r,rp)
...
@@ -59,7 +50,7 @@ function c24861088.spcon(e,tp,eg,ep,ev,re,r,rp)
and
not
Duel
.
IsExistingMatchingCard
(
c24861088
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
not
Duel
.
IsExistingMatchingCard
(
c24861088
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
end
function
c24861088
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c24861088
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
Get
FlagEffect
(
tp
,
24861089
)
==
0
end
if
chk
==
0
then
return
Duel
.
Get
CustomActivityCount
(
24861088
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
...
...
script/c82301904.lua
View file @
dc22d6cf
--混沌帝龍 -終焉の使者-
--混沌帝龍 -終焉の使者-
function
c82301904
.
initial_effect
(
c
)
function
c82301904
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--special summon
--
cannot
special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
82301904
,
0
))
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCondition
(
c82301904
.
spcon
)
e1
:
SetOperation
(
c82301904
.
spop
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
--
to grave
--
special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
82301904
,
1
))
e2
:
SetDescription
(
aux
.
Stringid
(
82301904
,
0
))
e2
:
Set
Category
(
CATEGORY_TOGRAVE
+
CATEGORY_DAMAGE
)
e2
:
Set
Type
(
EFFECT_TYPE_FIELD
)
e2
:
Set
Type
(
EFFECT_TYPE_IGNITION
)
e2
:
Set
Code
(
EFFECT_SPSUMMON_PROC
)
e2
:
Set
Range
(
LOCATION_MZON
E
)
e2
:
Set
Property
(
EFFECT_FLAG_UNCOPYABL
E
)
e2
:
Set
Cost
(
c82301904
.
sgcost
)
e2
:
Set
Range
(
LOCATION_HAND
)
e2
:
Set
Target
(
c82301904
.
sgtg
)
e2
:
Set
Condition
(
c82301904
.
spcon
)
e2
:
SetOperation
(
c82301904
.
s
g
op
)
e2
:
SetOperation
(
c82301904
.
s
p
op
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
--to grave
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
82301904
,
1
))
e3
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_DAMAGE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCost
(
c82301904
.
sgcost
)
e3
:
SetTarget
(
c82301904
.
sgtg
)
e3
:
SetOperation
(
c82301904
.
sgop
)
c
:
RegisterEffect
(
e3
)
Duel
.
AddCustomActivityCounter
(
82301904
,
ACTIVITY_CHAIN
,
aux
.
FALSE
)
end
end
function
c82301904
.
spfilter
(
c
,
att
)
function
c82301904
.
spfilter
(
c
,
att
)
return
c
:
IsAttribute
(
att
)
and
c
:
IsAbleToRemoveAsCost
()
return
c
:
IsAttribute
(
att
)
and
c
:
IsAbleToRemoveAsCost
()
...
@@ -41,8 +48,16 @@ function c82301904.spop(e,tp,eg,ep,ev,re,r,rp,c)
...
@@ -41,8 +48,16 @@ function c82301904.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel
.
Remove
(
g1
,
POS_FACEUP
,
REASON_COST
)
Duel
.
Remove
(
g1
,
POS_FACEUP
,
REASON_COST
)
end
end
function
c82301904
.
sgcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c82301904
.
sgcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
1000
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
1000
)
and
Duel
.
GetCustomActivityCount
(
82301904
,
tp
,
ACTIVITY_CHAIN
)
==
0
end
else
Duel
.
PayLPCost
(
tp
,
1000
)
end
Duel
.
PayLPCost
(
tp
,
1000
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
aux
.
FALSE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
c82301904
.
sgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c82301904
.
sgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
true
end
...
@@ -50,11 +65,16 @@ function c82301904.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -50,11 +65,16 @@ function c82301904.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
0
,
0
,
1
-
tp
,
g
:
GetCount
()
*
300
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
0
,
0
,
1
-
tp
,
g
:
GetCount
()
*
300
)
end
end
function
c82301904
.
sgfilter
(
c
,
p
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
and
c
:
IsControler
(
p
)
end
function
c82301904
.
sgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c82301904
.
sgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0xe
,
0xe
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0xe
,
0xe
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
local
og
=
Duel
.
GetOperatedGroup
()
local
og
=
Duel
.
GetOperatedGroup
()
local
ct
=
og
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_GRAVE
)
local
ct
=
og
:
FilterCount
(
c82301904
.
sgfilter
,
nil
,
1
-
tp
)
Duel
.
BreakEffect
()
if
ct
>
0
then
Duel
.
Damage
(
1
-
tp
,
ct
*
300
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
Duel
.
Damage
(
1
-
tp
,
ct
*
300
,
REASON_EFFECT
)
end
end
end
script/constant.lua
View file @
dc22d6cf
...
@@ -666,9 +666,10 @@ DUEL_PSEUDO_SHUFFLE =0x10 --不洗牌
...
@@ -666,9 +666,10 @@ DUEL_PSEUDO_SHUFFLE =0x10 --不洗牌
DUEL_TAG_MODE
=
0x20
--双打
DUEL_TAG_MODE
=
0x20
--双打
DUEL_SIMPLE_AI
=
0x40
--AI
DUEL_SIMPLE_AI
=
0x40
--AI
--
--
ACTIVITY_SUMMON
=
1
ACTIVITY_SUMMON
=
1
--
ACTIVITY_NORMALSUMMON
=
2
ACTIVITY_NORMALSUMMON
=
2
--
ACTIVITY_SPSUMMON
=
3
ACTIVITY_SPSUMMON
=
3
--
ACTIVITY_FLIPSUMMON
=
4
ACTIVITY_FLIPSUMMON
=
4
--
ACTIVITY_ATTACK
=
5
ACTIVITY_ATTACK
=
5
-- only available in custom counter
ACTIVITY_BATTLE_PHASE
=
6
ACTIVITY_BATTLE_PHASE
=
6
-- not available in custom counter
ACTIVITY_CHAIN
=
7
-- only available in custom counter
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