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
nanahira
ygopro
Commits
88b80643
Commit
88b80643
authored
Jun 09, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e73969cf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
83 additions
and
9 deletions
+83
-9
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+6
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-1
ocgcore/duel.h
ocgcore/duel.h
+1
-0
ocgcore/libdebug.cpp
ocgcore/libdebug.cpp
+16
-0
ocgcore/ocgapi.cpp
ocgcore/ocgapi.cpp
+1
-1
ocgcore/playerop.cpp
ocgcore/playerop.cpp
+51
-2
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+1
-0
script/c45812361.lua
script/c45812361.lua
+1
-0
script/c48252330.lua
script/c48252330.lua
+2
-2
system.conf
system.conf
+1
-1
No files found.
gframe/duelclient.cpp
View file @
88b80643
...
...
@@ -145,6 +145,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
wChat
->
setVisible
(
false
);
if
(
events
&
BEV_EVENT_EOF
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1401
));
else
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
...
...
gframe/menu_handler.cpp
View file @
88b80643
...
...
@@ -93,7 +93,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_HP_KICK
:
{
int
id
=
caller
-
static_cast
<
IGUIElement
*>
(
mainGame
->
btnHostPrepKick
[
0
]);
int
id
=
0
;
while
(
id
<
4
)
{
if
(
mainGame
->
btnHostPrepKick
[
id
]
==
caller
)
break
;
id
++
;
}
CTOS_Kick
csk
;
csk
.
pos
=
id
;
DuelClient
::
SendPacketToServer
(
CTOS_HS_KICK
,
csk
);
...
...
gframe/single_duel.cpp
View file @
88b80643
...
...
@@ -261,7 +261,7 @@ void SingleDuel::PlayerReady(DuelPlayer* dp, bool is_ready) {
NetServer
::
SendPacketToPlayer
(
*
pit
,
STOC_HS_PLAYER_CHANGE
,
scpc
);
}
void
SingleDuel
::
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
{
if
(
dp
!=
host_player
||
dp
==
players
[
pos
]
||
!
players
[
pos
])
if
(
pos
>
1
||
dp
!=
host_player
||
dp
==
players
[
pos
]
||
!
players
[
pos
])
return
;
LeaveGame
(
players
[
pos
]);
}
...
...
gframe/tag_duel.cpp
View file @
88b80643
...
...
@@ -244,7 +244,7 @@ void TagDuel::PlayerReady(DuelPlayer* dp, bool is_ready) {
NetServer
::
SendPacketToPlayer
(
*
pit
,
STOC_HS_PLAYER_CHANGE
,
scpc
);
}
void
TagDuel
::
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
{
if
(
dp
!=
host_player
||
dp
==
players
[
pos
]
||
!
players
[
pos
])
if
(
pos
>
3
||
dp
!=
host_player
||
dp
==
players
[
pos
]
||
!
players
[
pos
])
return
;
LeaveGame
(
players
[
pos
]);
}
...
...
ocgcore/duel.h
View file @
88b80643
...
...
@@ -76,4 +76,5 @@ public:
#define DUEL_ENABLE_PRIORITY 0x08
#define DUEL_PSEUDO_SHUFFLE 0x10
#define DUEL_TAG_MODE 0x20
#define DUEL_SIMPLE_AI 0x40
#endif
/* DUEL_H_ */
ocgcore/libdebug.cpp
View file @
88b80643
...
...
@@ -48,6 +48,15 @@ int32 scriptlib::debug_add_card(lua_State *L) {
pcard
->
set_status
(
STATUS_PROC_COMPLETE
,
TRUE
);
interpreter
::
card2value
(
L
,
pcard
);
return
1
;
}
else
if
(
location
==
LOCATION_MZONE
)
{
card
*
pcard
=
pduel
->
new_card
(
code
);
pcard
->
owner
=
owner
;
card
*
fcard
=
pduel
->
game_field
->
get_field_card
(
playerid
,
location
,
sequence
);
fcard
->
xyz_materials
.
push_back
(
pcard
);
pcard
->
overlay_target
=
fcard
;
pcard
->
current
.
controler
=
PLAYER_NONE
;
pcard
->
current
.
location
=
LOCATION_OVERLAY
;
pcard
->
current
.
sequence
=
fcard
->
xyz_materials
.
size
()
-
1
;
}
return
0
;
}
...
...
@@ -66,6 +75,13 @@ int32 scriptlib::debug_set_player_info(lua_State *L) {
pd
->
game_field
->
player
[
playerid
].
draw_count
=
drawcount
;
return
0
;
}
int32
scriptlib
::
debug_set_duel_info
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
flag
=
lua_tointeger
(
L
,
1
);
pduel
->
game_field
->
core
.
duel_options
=
flag
;
return
0
;
}
int32
scriptlib
::
debug_reload_field_begin
(
lua_State
*
L
)
{
}
int32
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
...
...
ocgcore/ocgapi.cpp
View file @
88b80643
...
...
@@ -72,7 +72,7 @@ extern "C" DECL_DLLEXPORT ptr create_duel(uint32 seed) {
}
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
ptr
pduel
,
int
options
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
pd
->
game_field
->
core
.
duel_options
=
options
;
pd
->
game_field
->
core
.
duel_options
|
=
options
;
if
(
pd
->
game_field
->
player
[
0
].
start_count
>
0
)
pd
->
game_field
->
draw
(
0
,
REASON_RULE
,
PLAYER_NONE
,
0
,
pd
->
game_field
->
player
[
0
].
start_count
);
if
(
pd
->
game_field
->
player
[
1
].
start_count
>
0
)
...
...
ocgcore/playerop.cpp
View file @
88b80643
...
...
@@ -160,6 +160,10 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
}
int32
field
::
select_effect_yes_no
(
uint16
step
,
uint8
playerid
,
card
*
pcard
)
{
if
(
step
==
0
)
{
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
ivalue
[
0
]
=
1
;
return
TRUE
;
}
pduel
->
write_buffer8
(
MSG_SELECT_EFFECTYN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
pcard
->
data
.
code
);
...
...
@@ -176,6 +180,10 @@ int32 field::select_effect_yes_no(uint16 step, uint8 playerid, card* pcard) {
}
int32
field
::
select_yes_no
(
uint16
step
,
uint8
playerid
,
uint32
description
)
{
if
(
step
==
0
)
{
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
ivalue
[
0
]
=
1
;
return
TRUE
;
}
pduel
->
write_buffer8
(
MSG_SELECT_YESNO
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
description
);
...
...
@@ -194,6 +202,10 @@ int32 field::select_option(uint16 step, uint8 playerid) {
returns
.
ivalue
[
0
]
=
-
1
;
if
(
core
.
select_options
.
size
()
==
0
)
return
TRUE
;
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
ivalue
[
0
]
=
0
;
return
TRUE
;
}
pduel
->
write_buffer8
(
MSG_SELECT_OPTION
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
core
.
select_options
.
size
());
...
...
@@ -219,6 +231,12 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
max
=
core
.
select_cards
.
size
();
if
(
min
>
max
)
min
=
max
;
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
bvalue
[
0
]
=
min
;
for
(
uint8
i
=
0
;
i
<
min
;
++
i
)
returns
.
bvalue
[
i
+
1
]
=
i
+
1
;
return
TRUE
;
}
core
.
units
.
begin
()
->
arg2
=
((
uint32
)
min
)
+
(((
uint32
)
max
)
<<
16
);
pduel
->
write_buffer8
(
MSG_SELECT_CARD
);
pduel
->
write_buffer8
(
playerid
);
...
...
@@ -268,6 +286,13 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
int32
field
::
select_chain
(
uint16
step
,
uint8
playerid
,
uint8
spe_count
,
uint8
forced
)
{
if
(
step
==
0
)
{
returns
.
ivalue
[
0
]
=
-
1
;
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
if
(
core
.
select_chains
.
size
()
==
0
)
returns
.
ivalue
[
0
]
=
-
1
;
else
returns
.
ivalue
[
0
]
=
0
;
return
TRUE
;
}
pduel
->
write_buffer8
(
MSG_SELECT_CHAIN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
core
.
select_chains
.
size
());
...
...
@@ -298,6 +323,26 @@ int32 field::select_place(uint16 step, uint8 playerid, uint32 flag, uint8 count)
if
(
step
==
0
)
{
if
(
count
==
0
)
return
TRUE
;
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
bvalue
[
0
]
=
1
;
flag
=
~
flag
;
if
(
flag
&
0x1f
)
{
returns
.
bvalue
[
1
]
=
LOCATION_MZONE
;
if
(
flag
&
0x4
)
returns
.
bvalue
[
2
]
=
2
;
else
if
(
flag
&
0x2
)
returns
.
bvalue
[
2
]
=
1
;
else
if
(
flag
&
0x8
)
returns
.
bvalue
[
2
]
=
3
;
else
if
(
flag
&
0x1
)
returns
.
bvalue
[
2
]
=
0
;
else
returns
.
bvalue
[
2
]
=
4
;
}
else
{
returns
.
bvalue
[
1
]
=
LOCATION_SZONE
;
if
(
flag
&
0x400
)
returns
.
bvalue
[
2
]
=
2
;
else
if
(
flag
&
0x200
)
returns
.
bvalue
[
2
]
=
1
;
else
if
(
flag
&
0x800
)
returns
.
bvalue
[
2
]
=
3
;
else
if
(
flag
&
0x100
)
returns
.
bvalue
[
2
]
=
0
;
else
returns
.
bvalue
[
2
]
=
4
;
}
return
true
;
}
if
(
core
.
units
.
begin
()
->
type
==
PROCESSOR_SELECT_PLACE
)
pduel
->
write_buffer8
(
MSG_SELECT_PLACE
);
else
...
...
@@ -313,8 +358,8 @@ int32 field::select_place(uint16 step, uint8 playerid, uint32 flag, uint8 count)
p
=
returns
.
bvalue
[
pt
];
l
=
returns
.
bvalue
[
pt
+
1
];
s
=
returns
.
bvalue
[
pt
+
2
];
if
((
p
!=
0
&&
p
!=
1
)
||
(
l
!=
LOCATION_MZONE
&&
l
!=
LOCATION_SZONE
)
||
s
>=
5
||
((
1
<<
s
)
&
(
flag
>>
((
p
==
playerid
?
0
:
16
)
+
(
l
==
LOCATION_MZONE
?
0
:
8
)))))
{
if
((
p
!=
0
&&
p
!=
1
)
||
(
(
l
!=
LOCATION_MZONE
)
&&
(
l
!=
LOCATION_SZONE
)
)
||
s
>=
5
||
((
1
<<
s
)
&
(
flag
>>
((
(
p
==
playerid
)
?
0
:
16
)
+
((
l
==
LOCATION_MZONE
)
?
0
:
8
)))))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
...
...
@@ -541,6 +586,10 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
int32
field
::
sort_card
(
int16
step
,
uint8
playerid
,
uint8
is_chain
)
{
if
(
step
==
0
)
{
returns
.
bvalue
[
0
]
=
0
;
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
returns
.
ivalue
[
0
]
=
-
1
;
return
TRUE
;
}
if
(
core
.
select_cards
.
empty
())
return
TRUE
;
if
(
is_chain
)
...
...
ocgcore/scriptlib.h
View file @
88b80643
...
...
@@ -461,6 +461,7 @@ public:
static
int32
debug_message
(
lua_State
*
L
);
static
int32
debug_add_card
(
lua_State
*
L
);
static
int32
debug_set_player_info
(
lua_State
*
L
);
static
int32
debug_set_duel_info
(
lua_State
*
L
);
static
int32
debug_reload_field_begin
(
lua_State
*
L
);
static
int32
debug_reload_field_end
(
lua_State
*
L
);
};
...
...
script/c45812361.lua
View file @
88b80643
...
...
@@ -49,6 +49,7 @@ end
function
c45812361
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
Duel
.
Draw
(
tp
,
2
,
REASON_EFFECT
)
if
ct
==
0
then
return
end
Duel
.
BreakEffect
()
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
...
...
script/c48252330.lua
View file @
88b80643
...
...
@@ -37,7 +37,7 @@ function c48252330.cfilter(c)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x71
)
end
function
c48252330
.
shcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c48252330
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
return
Duel
.
IsExistingMatchingCard
(
c48252330
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
e
:
GetHandler
())
end
function
c48252330
.
filter
(
c
)
return
c
:
IsType
(
TYPE_FIELD
)
and
c
:
IsAbleToHand
()
...
...
@@ -47,7 +47,7 @@ function c48252330.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c48252330
.
shop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
IsExistingMatchingCard
(
c48252330
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
e
:
GetHandler
())
then
return
end
if
not
Duel
.
IsExistingMatchingCard
(
c48252330
.
cfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
e
:
GetHandler
())
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c48252330
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
...
...
system.conf
View file @
88b80643
...
...
@@ -9,5 +9,5 @@ lastdeck = sample
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
lastip
=
192
.
168
.
2
.
100
lastip
=
192
.
168
.
3
.
235
lastport
=
7911
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