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
488c081c
Commit
488c081c
authored
Mar 21, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
db3e17aa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
36 deletions
+76
-36
ocgcore/card.cpp
ocgcore/card.cpp
+7
-4
ocgcore/card.h
ocgcore/card.h
+1
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+42
-19
ocgcore/processor.cpp
ocgcore/processor.cpp
+26
-13
No files found.
ocgcore/card.cpp
View file @
488c081c
...
...
@@ -2077,9 +2077,9 @@ int32 card::is_destructable_by_battle(card * pcard) {
return
FALSE
;
return
TRUE
;
}
int32
card
::
is_
destructable_by_effect
(
effect
*
peffect
,
uint8
playerid
)
{
effect
*
card
::
check_in
destructable_by_effect
(
effect
*
peffect
,
uint8
playerid
)
{
if
(
!
peffect
)
return
TRUE
;
return
0
;
effect_set
eset
;
filter_effect
(
EFFECT_INDESTRUCTABLE_EFFECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
@@ -2087,9 +2087,12 @@ int32 card::is_destructable_by_effect(effect* peffect, uint8 playerid) {
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
return
FALSE
;
return
eset
[
i
]
;
}
return
TRUE
;
return
0
;
}
int32
card
::
is_destructable_by_effect
(
effect
*
peffect
,
uint8
playerid
)
{
return
!
check_indestructable_by_effect
(
peffect
,
playerid
);
}
int32
card
::
is_removeable
(
uint8
playerid
)
{
if
(
!
pduel
->
game_field
->
is_player_can_remove
(
playerid
,
this
))
...
...
ocgcore/card.h
View file @
488c081c
...
...
@@ -226,6 +226,7 @@ public:
int32
is_affect_by_effect
(
effect
*
peffect
);
int32
is_destructable
();
int32
is_destructable_by_battle
(
card
*
pcard
);
effect
*
check_indestructable_by_effect
(
effect
*
peffect
,
uint8
playerid
);
int32
is_destructable_by_effect
(
effect
*
peffect
,
uint8
playerid
);
int32
is_removeable
(
uint8
playerid
);
int32
is_removeable_as_cost
(
uint8
playerid
);
...
...
ocgcore/operations.cpp
View file @
488c081c
...
...
@@ -2488,23 +2488,30 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
case
0
:
{
card_set
extra
;
effect_set
eset
;
card_set
indestructable_set
;
std
::
set
<
effect
*>
indestructable_effect_set
;
for
(
auto
cit
=
targets
->
container
.
begin
();
cit
!=
targets
->
container
.
end
();)
{
auto
rm
=
cit
++
;
card
*
pcard
=
*
rm
;
if
(
!
(
pcard
->
current
.
reason
&
REASON_RULE
))
{
if
(
!
pcard
->
is_destructable
()
||
!
pcard
->
is_affect_by_effect
(
pcard
->
current
.
reason_effect
)
||
!
pcard
->
is_destructable_by_effect
(
pcard
->
current
.
reason_effect
,
reason_player
))
{
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pcard
->
current
.
reason_effect
=
pcard
->
temp
.
reason_effect
;
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
pcard
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
targets
->
container
.
erase
(
pcard
);
int32
is_destructable
=
true
;
if
(
pcard
->
is_destructable
()
&&
pcard
->
is_affect_by_effect
(
pcard
->
current
.
reason_effect
))
{
effect
*
indestructable_effect
=
pcard
->
check_indestructable_by_effect
(
pcard
->
current
.
reason_effect
,
reason_player
);
if
(
indestructable_effect
)
{
indestructable_effect_set
.
insert
(
indestructable_effect
);
is_destructable
=
false
;
}
}
else
is_destructable
=
false
;
if
(
!
is_destructable
)
{
indestructable_set
.
insert
(
pcard
);
continue
;
}
}
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_INDESTRUCTABLE_COUNT
,
&
eset
);
if
(
eset
.
size
())
{
bool
i
ndes
=
fals
e
;
bool
i
s_destructable
=
tru
e
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
!
(
eset
[
i
]
->
flag
&
EFFECT_FLAG_COUNT_LIMIT
)
||
(
eset
[
i
]
->
reset_count
&
0xf00
)
==
0
)
continue
;
...
...
@@ -2513,19 +2520,17 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pduel
->
lua
->
add_param
(
pcard
->
current
.
reason_player
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
eset
[
i
]
->
dec_count
();
indes
=
true
;
indestructable_effect_set
.
insert
(
eset
[
i
]);
is_destructable
=
false
;
break
;
}
}
eset
.
clear
();
if
(
indes
)
{
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pcard
->
current
.
reason_effect
=
pcard
->
temp
.
reason_effect
;
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
pcard
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
targets
->
container
.
erase
(
pcard
);
if
(
!
is_destructable
)
{
indestructable_set
.
insert
(
pcard
);
continue
;
}
}
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_DESTROY_SUBSTITUTE
,
&
eset
);
if
(
eset
.
size
())
{
bool
sub
=
false
;
...
...
@@ -2536,6 +2541,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
extra
.
insert
(
eset
[
i
]
->
handler
);
sub
=
true
;
break
;
}
}
if
(
sub
)
{
...
...
@@ -2546,7 +2552,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
targets
->
container
.
erase
(
pcard
);
}
}
eset
.
clear
();
}
for
(
auto
cit
=
extra
.
begin
();
cit
!=
extra
.
end
();
++
cit
)
{
card
*
rep
=
*
cit
;
...
...
@@ -2561,6 +2566,19 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
targets
->
container
.
insert
(
rep
);
}
}
for
(
auto
cit
=
indestructable_set
.
begin
();
cit
!=
indestructable_set
.
end
();
++
cit
)
{
(
*
cit
)
->
current
.
reason
=
(
*
cit
)
->
temp
.
reason
;
(
*
cit
)
->
current
.
reason_effect
=
(
*
cit
)
->
temp
.
reason_effect
;
(
*
cit
)
->
current
.
reason_player
=
(
*
cit
)
->
temp
.
reason_player
;
(
*
cit
)
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
targets
->
container
.
erase
(
*
cit
);
}
for
(
auto
eit
=
indestructable_effect_set
.
begin
();
eit
!=
indestructable_effect_set
.
end
();
++
eit
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_CARD
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
((
*
eit
)
->
owner
->
data
.
code
);
}
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_DESTROY_REPLACE
);
for
(;
pr
.
first
!=
pr
.
second
;
++
pr
.
first
)
add_process
(
PROCESSOR_OPERATION_REPLACE
,
5
,
pr
.
first
->
second
,
targets
,
0
,
1
);
...
...
@@ -2656,6 +2674,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
continue
;
}
}
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_INDESTRUCTABLE_COUNT
,
&
eset
);
if
(
eset
.
size
())
{
bool
indes
=
false
;
...
...
@@ -2667,10 +2686,14 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pduel
->
lua
->
add_param
(
pcard
->
current
.
reason_player
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
eset
[
i
]
->
dec_count
();
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_CARD
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
(
eset
[
i
]
->
owner
->
data
.
code
);
indes
=
true
;
break
;
}
}
eset
.
clear
();
if
(
indes
)
{
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pcard
->
current
.
reason_effect
=
pcard
->
temp
.
reason_effect
;
...
...
@@ -2680,6 +2703,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
continue
;
}
}
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_DESTROY_SUBSTITUTE
,
&
eset
);
if
(
eset
.
size
())
{
bool
sub
=
false
;
...
...
@@ -2700,7 +2724,6 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
targets
->
container
.
erase
(
pcard
);
}
}
eset
.
clear
();
}
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_DESTROY_REPLACE
);
for
(;
pr
.
first
!=
pr
.
second
;
++
pr
.
first
)
...
...
ocgcore/processor.cpp
View file @
488c081c
...
...
@@ -3491,10 +3491,28 @@ int32 field::process_battle_command(uint16 step) {
card
*
reason_card
=
0
;
uint8
bd
[
2
];
calculate_battle_damage
(
&
damchange
,
&
reason_card
,
bd
);
if
(
bd
[
0
])
core
.
attacker
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
if
(
bd
[
0
])
{
effect
*
indestructable_effect
=
core
.
attacker
->
is_affected_by_effect
(
EFFECT_INDESTRUCTABLE_BATTLE
,
core
.
attack_target
);
if
(
indestructable_effect
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_CARD
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
(
indestructable_effect
->
owner
->
data
.
code
);
bd
[
0
]
=
FALSE
;
}
else
core
.
attacker
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
}
if
(
bd
[
1
])
core
.
attack_target
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
effect
*
indestructable_effect
=
core
.
attack_target
->
is_affected_by_effect
(
EFFECT_INDESTRUCTABLE_BATTLE
,
core
.
attacker
);
if
(
indestructable_effect
)
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_CARD
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer32
(
indestructable_effect
->
owner
->
data
.
code
);
bd
[
1
]
=
FALSE
;
}
else
core
.
attack_target
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
}
pduel
->
write_buffer8
(
MSG_BATTLE
);
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
pduel
->
write_buffer32
(
aa
);
...
...
@@ -3902,8 +3920,7 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
reason_card
=
core
.
attacker
;
}
}
if
(
core
.
attack_target
->
is_destructable_by_battle
(
core
.
attacker
))
bd
[
1
]
=
TRUE
;
bd
[
1
]
=
TRUE
;
}
else
if
(
a
<
d
)
{
damchange
=
core
.
attack_target
->
is_affected_by_effect
(
EFFECT_BATTLE_DAMAGE_TO_EFFECT
);
if
(
damchange
)
{
...
...
@@ -3924,14 +3941,11 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
reason_card
=
core
.
attack_target
;
}
}
if
(
core
.
attacker
->
is_destructable_by_battle
(
core
.
attack_target
))
bd
[
0
]
=
TRUE
;
bd
[
0
]
=
TRUE
;
}
else
{
if
(
a
!=
0
)
{
if
(
core
.
attack_target
->
is_destructable_by_battle
(
core
.
attacker
))
bd
[
1
]
=
TRUE
;
if
(
core
.
attacker
->
is_destructable_by_battle
(
core
.
attack_target
))
bd
[
0
]
=
TRUE
;
bd
[
0
]
=
TRUE
;
bd
[
1
]
=
TRUE
;
}
}
}
else
{
...
...
@@ -3969,8 +3983,7 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
core
.
battle_damage
[
1
-
pd
]
=
a
-
d
;
reason_card
=
core
.
attacker
;
}
if
(
core
.
attack_target
->
is_destructable_by_battle
(
core
.
attacker
))
bd
[
1
]
=
TRUE
;
bd
[
1
]
=
TRUE
;
}
else
if
(
a
<
d
)
{
damchange
=
core
.
attack_target
->
is_affected_by_effect
(
EFFECT_BATTLE_DAMAGE_TO_EFFECT
);
if
(
damchange
)
{
...
...
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