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
xiaoye
ygopro
Commits
a592b04c
Commit
a592b04c
authored
Jul 16, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
848a183b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
51 deletions
+111
-51
gframe/duelclient.cpp
gframe/duelclient.cpp
+9
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+21
-1
ocgcore/field.h
ocgcore/field.h
+1
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+1
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+76
-48
ocgcore/playerop.cpp
ocgcore/playerop.cpp
+2
-0
ocgcore/processor.cpp
ocgcore/processor.cpp
+1
-0
No files found.
gframe/duelclient.cpp
View file @
a592b04c
...
...
@@ -1365,8 +1365,15 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
select_seq
=
i
;
pcard
->
is_selectable
=
true
;
}
mainGame
->
stHintMsg
->
setText
(
dataManager
.
GetSysString
(
531
));
mainGame
->
stHintMsg
->
setVisible
(
false
);
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetDesc
(
select_hint
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
else
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetSysString
(
531
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
select_hint
=
0
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
mainGame
->
gMutex
.
Unlock
();
return
false
;
}
case
MSG_SELECT_COUNTER
:
{
...
...
gframe/event_handler.cpp
View file @
a592b04c
...
...
@@ -1290,7 +1290,27 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
MSG_SELECT_TRIBUTE
:
case
MSG_SELECT_TRIBUTE
:
{
if
(
selected_cards
.
size
()
==
0
)
{
if
(
select_cancelable
)
{
DuelClient
::
SetResponseI
(
-
1
);
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
else
DuelClient
::
SendResponse
();
}
break
;
}
if
(
mainGame
->
wQuery
->
isVisible
())
{
unsigned
char
respbuf
[
64
];
respbuf
[
0
]
=
selected_cards
.
size
();
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
respbuf
[
i
+
1
]
=
selected_cards
[
i
]
->
select_seq
;
DuelClient
::
SetResponseB
(
respbuf
,
selected_cards
.
size
()
+
1
);
mainGame
->
HideElement
(
mainGame
->
wQuery
,
true
);
break
;
}
}
case
MSG_SELECT_SUM
:
{
if
(
mainGame
->
wQuery
->
isVisible
())
{
unsigned
char
respbuf
[
64
];
...
...
ocgcore/field.h
View file @
a592b04c
...
...
@@ -235,6 +235,7 @@ struct processor {
uint8
reason_player
;
card
*
summoning_card
;
uint8
summon_depth
;
uint8
summon_cancelable
;
card
*
attacker
;
card
*
sub_attacker
;
card
*
attack_target
;
...
...
ocgcore/libduel.cpp
View file @
a592b04c
...
...
@@ -221,6 +221,7 @@ int32 scriptlib::duel_summon(lua_State *L) {
if
(
lua_gettop
(
L
)
>
4
)
min_tribute
=
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
);
return
lua_yield
(
L
,
0
);
}
...
...
ocgcore/operations.cpp
View file @
a592b04c
...
...
@@ -1162,18 +1162,12 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
return
TRUE
;
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_SUMMON
))
return
TRUE
;
if
(
core
.
summon_depth
)
core
.
summon_cancelable
=
FALSE
;
core
.
summon_depth
++
;
target
->
material_cards
.
clear
();
effect_set
eset
;
target
->
filter_effect
(
EFFECT_SUMMON_COST
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
core
.
units
.
begin
()
->
step
=
6
;
core
.
units
.
begin
()
->
step
=
3
;
return
FALSE
;
}
case
1
:
{
...
...
@@ -1212,6 +1206,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
int32
max
=
required
>>
16
;
if
(
min
<
min_tribute
)
min
=
min_tribute
;
required
=
min
+
(
max
<<
16
);
uint32
adv
=
is_player_can_summon
(
SUMMON_TYPE_ADVANCE
,
sumplayer
,
target
);
if
(
max
==
0
||
!
adv
)
{
returns
.
bvalue
[
0
]
=
0
;
...
...
@@ -1228,19 +1223,61 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
sumplayer
,
90
);
core
.
temp_var
[
0
]
=
required
;
core
.
temp_var
[
1
]
=
fcount
;
core
.
units
.
begin
()
->
step
=
19
;
}
else
{
if
(
min
<
-
fcount
+
1
)
{
min
=
-
fcount
+
1
;
required
=
min
+
(
max
<<
16
);
}
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
,
required
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
);
core
.
units
.
begin
()
->
step
=
3
;
}
}
}
return
FALSE
;
}
case
3
:
{
if
(
returns
.
ivalue
[
0
])
returns
.
bvalue
[
0
]
=
0
;
else
{
int32
min
=
1
;
int32
max
=
core
.
temp_var
[
0
]
>>
16
;
if
(
min
<
-
core
.
temp_var
[
1
]
+
1
)
{
min
=
-
core
.
temp_var
[
1
]
+
1
;
}
core
.
temp_var
[
0
]
=
min
+
(
max
<<
16
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
,
core
.
temp_var
[
0
]);
}
return
FALSE
;
}
case
4
:
{
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
core
.
units
.
begin
()
->
step
=
8
;
else
if
(
proc
)
core
.
units
.
begin
()
->
step
=
5
;
else
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
core
.
summon_depth
--
;
return
TRUE
;
}
if
(
returns
.
bvalue
[
0
])
{
card_set
*
tributes
=
new
card_set
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
tributes
->
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
core
.
units
.
begin
()
->
peffect
=
(
effect
*
)
tributes
;
}
}
effect_set
eset
;
target
->
filter_effect
(
EFFECT_SUMMON_COST
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
return
FALSE
;
}
case
5
:
{
card_set
*
tributes
=
(
card_set
*
)
proc
;
int32
min
=
0
;
int32
level
=
target
->
get_level
();
if
(
level
<
5
)
...
...
@@ -1249,7 +1286,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
min
=
1
;
else
min
=
2
;
min
-=
returns
.
bvalue
[
0
];
if
(
tributes
)
min
-=
tributes
->
size
();
if
(
min
>
0
)
{
effect_set
eset
;
target
->
filter_effect
(
EFFECT_DECREASE_TRIBUTE
,
&
eset
);
...
...
@@ -1297,28 +1335,27 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
effect
*
pextra
=
0
;
if
(
!
ignore_count
&&
!
core
.
extra_summon
[
sumplayer
])
pextra
=
target
->
is_affected_by_effect
(
EFFECT_EXTRA_SUMMON_COUNT
);
if
(
returns
.
bvalue
[
0
])
{
card_set
tributes
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
tributes
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]
->
current
.
reason_card
=
target
;
}
target
->
set_material
(
&
tributes
);
release
(
&
tributes
,
0
,
REASON_SUMMON
|
REASON_MATERIAL
,
sumplayer
);
if
(
tributes
.
size
())
if
(
tributes
)
{
for
(
auto
cit
=
tributes
->
begin
();
cit
!=
tributes
->
end
();
++
cit
)
(
*
cit
)
->
current
.
reason_card
=
target
;
target
->
set_material
(
tributes
);
release
(
tributes
,
0
,
REASON_SUMMON
|
REASON_MATERIAL
,
sumplayer
);
if
(
tributes
->
size
())
target
->
summon_info
=
SUMMON_TYPE_NORMAL
|
SUMMON_TYPE_ADVANCE
|
(
LOCATION_HAND
<<
16
);
else
target
->
summon_info
=
SUMMON_TYPE_NORMAL
|
(
LOCATION_HAND
<<
16
);
delete
tributes
;
core
.
units
.
begin
()
->
peffect
=
0
;
adjust_all
();
}
else
target
->
summon_info
=
SUMMON_TYPE_NORMAL
|
(
LOCATION_HAND
<<
16
);
target
->
current
.
reason_effect
=
0
;
target
->
current
.
reason_player
=
sumplayer
;
core
.
units
.
begin
()
->
step
=
4
;
core
.
units
.
begin
()
->
step
=
6
;
core
.
temp_var
[
0
]
=
(
ptr
)
pextra
;
return
FALSE
;
}
case
4
:
{
case
6
:
{
effect
*
pextra
=
0
;
if
(
!
ignore_count
&&
!
core
.
extra_summon
[
sumplayer
])
pextra
=
target
->
is_affected_by_effect
(
EFFECT_EXTRA_SUMMON_COUNT
);
...
...
@@ -1334,7 +1371,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core
.
temp_var
[
0
]
=
(
ptr
)
pextra
;
return
FALSE
;
}
case
5
:
{
case
7
:
{
core
.
summon_depth
--
;
if
(
core
.
summon_depth
)
return
TRUE
;
...
...
@@ -1354,7 +1391,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
}
case
6
:
{
case
8
:
{
if
(
!
returns
.
ivalue
[
0
])
core
.
summon_count
[
sumplayer
]
++
;
else
if
(
core
.
temp_var
[
0
])
{
...
...
@@ -1378,10 +1415,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
target
->
enable_field_effect
(
FALSE
);
move_to_field
(
target
,
sumplayer
,
targetplayer
,
LOCATION_MZONE
,
positions
);
core
.
summoning_card
=
target
;
core
.
units
.
begin
()
->
step
=
8
;
core
.
units
.
begin
()
->
step
=
10
;
return
FALSE
;
}
case
7
:
{
case
9
:
{
core
.
summon_depth
--
;
if
(
core
.
summon_depth
)
return
TRUE
;
...
...
@@ -1411,7 +1448,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
}
case
8
:
{
case
10
:
{
if
(
!
returns
.
ivalue
[
0
])
core
.
summon_count
[
sumplayer
]
++
;
else
if
(
core
.
temp_var
[
0
])
{
...
...
@@ -1426,7 +1463,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core
.
summoning_card
=
target
;
return
FALSE
;
}
case
9
:
{
case
11
:
{
uint8
targetplayer
=
target
->
current
.
controler
;
if
(
target
->
owner
!=
targetplayer
)
set_control
(
target
,
targetplayer
,
0
,
0
);
...
...
@@ -1452,7 +1489,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
process_instant_event
();
return
FALSE
;
}
case
1
0
:
{
case
1
2
:
{
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE_SUMMON
))
core
.
units
.
begin
()
->
step
=
14
;
...
...
@@ -1464,13 +1501,13 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE_SUMMON
))
core
.
units
.
begin
()
->
step
=
15
;
else
core
.
units
.
begin
()
->
step
=
1
1
;
core
.
units
.
begin
()
->
step
=
1
3
;
core
.
reserved
=
core
.
units
.
front
();
return
TRUE
;
}
return
FALSE
;
}
case
1
1
:
{
case
1
3
:
{
target
->
set_status
(
STATUS_SUMMONING
,
TRUE
);
target
->
set_status
(
STATUS_SUMMON_DISABLED
,
FALSE
);
core
.
summoning_card
=
0
;
...
...
@@ -1479,7 +1516,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0x101
,
TRUE
);
return
FALSE
;
}
case
1
2
:
{
case
1
4
:
{
if
(
target
->
is_status
(
STATUS_SUMMONING
))
{
core
.
units
.
begin
()
->
step
=
14
;
return
FALSE
;
...
...
@@ -1530,21 +1567,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
}
return
TRUE
;
}
case
20
:
{
if
(
returns
.
ivalue
[
0
])
returns
.
bvalue
[
0
]
=
0
;
else
{
int32
min
=
1
;
int32
max
=
core
.
temp_var
[
0
]
>>
16
;
if
(
min
<
-
core
.
temp_var
[
1
]
+
1
)
{
min
=
-
core
.
temp_var
[
1
]
+
1
;
}
core
.
temp_var
[
0
]
=
min
+
(
max
<<
16
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
,
core
.
temp_var
[
0
]);
}
core
.
units
.
begin
()
->
step
=
2
;
return
false
;
}
}
return
TRUE
;
}
...
...
@@ -4506,6 +4528,8 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
return
FALSE
;
}
case
2
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
core
.
operated_set
.
insert
(
pcard
);
...
...
@@ -4525,6 +4549,8 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
return
FALSE
;
}
case
4
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
core
.
operated_set
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
uint32
rmin
=
core
.
operated_set
.
size
();
...
...
@@ -4559,6 +4585,8 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
return
FALSE
;
}
case
6
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
core
.
operated_set
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
return
FALSE
;
...
...
ocgcore/playerop.cpp
View file @
a592b04c
...
...
@@ -452,6 +452,8 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
}
return
FALSE
;
}
else
{
if
(
cancelable
&&
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
byte
c
[
64
];
memset
(
c
,
0
,
64
);
if
(
returns
.
bvalue
[
0
]
>
max
)
{
...
...
ocgcore/processor.cpp
View file @
a592b04c
...
...
@@ -2746,6 +2746,7 @@ int32 field::process_idle_command(uint16 step) {
}
case
5
:
{
card
*
target
=
core
.
summonable_cards
[
returns
.
ivalue
[
0
]
>>
16
];
core
.
summon_cancelable
=
TRUE
;
summon
(
infos
.
turn_player
,
target
,
0
,
FALSE
,
0
);
core
.
units
.
begin
()
->
step
=
-
1
;
return
FALSE
;
...
...
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