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
wyykak
ygopro
Commits
54fadd0e
Commit
54fadd0e
authored
May 03, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4965567f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
146 additions
and
8 deletions
+146
-8
gframe/network.h
gframe/network.h
+7
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+0
-0
gframe/tag_duel.h
gframe/tag_duel.h
+60
-0
ocgcore/duel.h
ocgcore/duel.h
+1
-1
ocgcore/field.cpp
ocgcore/field.cpp
+41
-0
ocgcore/field.h
ocgcore/field.h
+5
-0
ocgcore/ocgapi.cpp
ocgcore/ocgapi.cpp
+14
-0
ocgcore/ocgapi.h
ocgcore/ocgapi.h
+1
-0
script/c18605135.lua
script/c18605135.lua
+3
-3
script/c43509019.lua
script/c43509019.lua
+1
-1
script/c65301952.lua
script/c65301952.lua
+1
-1
script/c9720537.lua
script/c9720537.lua
+10
-1
strings.conf
strings.conf
+1
-0
system.conf
system.conf
+1
-1
No files found.
gframe/network.h
View file @
54fadd0e
...
...
@@ -175,6 +175,11 @@ public:
#define CTOS_HS_NOTREADY 0x23
#define CTOS_HS_KICK 0x24
#define CTOS_HS_START 0x25
#define CTOS_HT_CHANGEPOS 0x30
#define CTOS_HT_READY 0x31
#define CTOS_HT_NOTREADY 0x32
#define CTOS_HT_KICK 0x33
#define CTOS_HT_START 0x34
#define STOC_GAME_MSG 0x1
#define STOC_ERROR_MSG 0x2
...
...
@@ -196,6 +201,8 @@ public:
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_WATCH_CHANGE 0x22
#define STOC_HT_PLAYER_ENTER 0x30
#define STOC_HT_PLAYER_CHANGE 0x31
#define PLAYERCHANGE_READY 0x1
#define PLAYERCHANGE_NOTREADY 0x2
...
...
gframe/tag_duel.cpp
0 → 100644
View file @
54fadd0e
gframe/tag_duel.h
0 → 100644
View file @
54fadd0e
#ifndef TAG_DUEL_H
#define TAG_DUEL_H
#include "config.h"
#include "network.h"
#include "Replay.h"
namespace
ygo
{
class
TagDuel
:
public
DuelMode
{
public:
TagDuel
();
virtual
~
TagDuel
();
virtual
void
Chat
(
DuelPlayer
*
dp
,
void
*
pdata
,
int
len
);
virtual
void
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
);
virtual
void
LeaveGame
(
DuelPlayer
*
dp
);
virtual
void
ToDuelist
(
DuelPlayer
*
dp
);
virtual
void
ToObserver
(
DuelPlayer
*
dp
);
virtual
void
PlayerReady
(
DuelPlayer
*
dp
,
bool
ready
);
virtual
void
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
);
virtual
void
UpdateDeck
(
DuelPlayer
*
dp
,
void
*
pdata
);
virtual
void
StartDuel
(
DuelPlayer
*
dp
);
virtual
void
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
);
virtual
void
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
);
virtual
void
Process
();
virtual
void
Surrender
(
DuelPlayer
*
dp
);
virtual
int
Analyze
(
char
*
msgbuffer
,
unsigned
int
len
);
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
void
*
pdata
,
unsigned
int
len
);
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
);
virtual
void
EndDuel
();
void
DuelEndProc
();
void
WaitforResponse
(
int
playerid
);
void
RefreshMzone
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshSzone
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshHand
(
int
player
,
int
flag
=
0x181fff
,
int
use_cache
=
1
);
void
RefreshGrave
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0x181fff
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
protected:
DuelPlayer
*
players
[
4
];
DuelPlayer
*
pplayer
[
4
];
bool
ready
[
4
];
Deck
pdeck
[
4
];
unsigned
char
hand_result
[
2
];
unsigned
char
last_response
;
Replay
last_replay
;
unsigned
char
tp_player
;
unsigned
short
time_limit
[
2
];
unsigned
short
time_elapsed
;
};
}
#endif //TAG_DUEL_H
ocgcore/duel.h
View file @
54fadd0e
...
...
@@ -75,5 +75,5 @@ public:
#define DUEL_NO_CHAIN_HINT 0x04
#define DUEL_ENABLE_PRIORITY 0x08
#define DUEL_PSEUDO_SHUFFLE 0x10
#define DUEL_TAG_MODE 0x20
#endif
/* DUEL_H_ */
ocgcore/field.cpp
View file @
54fadd0e
...
...
@@ -545,6 +545,47 @@ void field::reverse_deck(uint8 playerid) {
player
[
playerid
].
list_main
[
count
-
1
-
i
]
=
tmp
;
}
}
void
field
::
tag_swap
(
uint8
playerid
)
{
card_vector
::
iterator
clit
;
//main
for
(
clit
=
player
[
playerid
].
list_main
.
begin
();
clit
!=
player
[
playerid
].
list_main
.
end
();
++
clit
)
{
(
*
clit
)
->
enable_field_effect
(
false
);
(
*
clit
)
->
cancel_field_effect
();
}
card_vector
cl
=
player
[
playerid
].
list_grave
;
player
[
playerid
].
list_main
=
player
[
playerid
].
tag_list_main
;
player
[
playerid
].
list_main
=
cl
;
for
(
clit
=
player
[
playerid
].
list_main
.
begin
();
clit
!=
player
[
playerid
].
list_main
.
end
();
++
clit
)
{
(
*
clit
)
->
apply_field_effect
();
(
*
clit
)
->
enable_field_effect
(
true
);
}
//hand
for
(
clit
=
player
[
playerid
].
list_hand
.
begin
();
clit
!=
player
[
playerid
].
list_hand
.
end
();
++
clit
)
{
(
*
clit
)
->
enable_field_effect
(
false
);
(
*
clit
)
->
cancel_field_effect
();
}
cl
=
player
[
playerid
].
list_grave
;
player
[
playerid
].
list_hand
=
player
[
playerid
].
tag_list_hand
;
player
[
playerid
].
list_hand
=
cl
;
for
(
clit
=
player
[
playerid
].
list_hand
.
begin
();
clit
!=
player
[
playerid
].
list_hand
.
end
();
++
clit
)
{
(
*
clit
)
->
apply_field_effect
();
(
*
clit
)
->
enable_field_effect
(
true
);
}
//extra
for
(
clit
=
player
[
playerid
].
list_extra
.
begin
();
clit
!=
player
[
playerid
].
list_extra
.
end
();
++
clit
)
{
(
*
clit
)
->
enable_field_effect
(
false
);
(
*
clit
)
->
cancel_field_effect
();
}
cl
=
player
[
playerid
].
list_grave
;
player
[
playerid
].
list_extra
=
player
[
playerid
].
tag_list_extra
;
player
[
playerid
].
list_extra
=
cl
;
for
(
clit
=
player
[
playerid
].
list_extra
.
begin
();
clit
!=
player
[
playerid
].
list_extra
.
end
();
++
clit
)
{
(
*
clit
)
->
apply_field_effect
();
(
*
clit
)
->
enable_field_effect
(
true
);
}
pduel
->
write_buffer8
(
MSG_TAG_SWAP
);
pduel
->
write_buffer8
(
playerid
);
}
void
field
::
add_effect
(
effect
*
peffect
,
uint8
owner_player
)
{
if
(
!
peffect
->
handler
)
{
peffect
->
flag
|=
EFFECT_FLAG_FIELD_ONLY
;
...
...
ocgcore/field.h
View file @
54fadd0e
...
...
@@ -73,6 +73,9 @@ struct player_info {
card_vector
list_hand
;
card_vector
list_remove
;
card_vector
list_extra
;
card_vector
tag_list_main
;
card_vector
tag_list_hand
;
card_vector
tag_list_extra
;
};
struct
field_effect
{
typedef
std
::
multimap
<
uint32
,
effect
*>
effect_container
;
...
...
@@ -293,6 +296,7 @@ public:
void
reset_sequence
(
uint8
playerid
,
uint8
location
);
void
swap_deck_and_grave
(
uint8
playerid
);
void
reverse_deck
(
uint8
playerid
);
void
tag_swap
(
uint8
playerid
);
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
remove_effect
(
effect
*
peffect
);
...
...
@@ -721,4 +725,5 @@ public:
#define MSG_ANNOUNCE_CARD 142
#define MSG_ANNOUNCE_NUMBER 143
#define MSG_CARD_HINT 160
#define MSG_TAG_SWAP 161
#endif
/* FIELD_H_ */
ocgcore/ocgapi.cpp
View file @
54fadd0e
...
...
@@ -127,6 +127,20 @@ extern "C" DECL_DLLEXPORT void new_card(ptr pduel, uint32 code, uint8 owner, uin
}
}
}
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
if
(
owner
>
1
||
!
(
location
&
0x41
))
return
;
card
*
pcard
=
ptduel
->
new_card
(
code
);
switch
(
location
)
{
case
LOCATION_DECK
:
ptduel
->
game_field
->
player
[
owner
].
tag_list_main
.
push_back
(
pcard
);
break
;
case
LOCATION_EXTRA
:
ptduel
->
game_field
->
player
[
owner
].
tag_list_extra
.
push_back
(
pcard
);
break
;
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
)
{
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
...
...
ocgcore/ocgapi.h
View file @
54fadd0e
...
...
@@ -43,6 +43,7 @@ extern "C" DECL_DLLEXPORT void get_log_message(ptr pduel, byte* buf);
extern
"C"
DECL_DLLEXPORT
int32
get_message
(
ptr
pduel
,
byte
*
buf
);
extern
"C"
DECL_DLLEXPORT
int32
process
(
ptr
pduel
);
extern
"C"
DECL_DLLEXPORT
void
new_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
uint8
position
);
extern
"C"
DECL_DLLEXPORT
void
new_tag_card
(
ptr
pduel
,
uint32
code
,
uint8
owner
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
int32
query_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
uint8
sequence
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_count
(
ptr
pduel
,
uint8
playerid
,
uint8
location
);
extern
"C"
DECL_DLLEXPORT
int32
query_field_card
(
ptr
pduel
,
uint8
playerid
,
uint8
location
,
int32
query_flag
,
byte
*
buf
,
int32
use_cache
);
...
...
script/c18605135.lua
View file @
54fadd0e
...
...
@@ -28,13 +28,13 @@ function c18605135.filter(c)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
22702055
)
end
function
c18605135
.
actcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c18605135
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
1
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
c18605135
.
filter
,
0
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
or
Duel
.
GetEnvironment
()
==
22702055
end
function
c18605135
.
abdcon
(
e
)
return
Duel
.
GetAttackTarget
()
==
nil
or
Duel
.
GetAttackTarget
():
IsAttackPos
()
or
Duel
.
GetAttacker
():
GetAttack
()
>
Duel
.
GetAttackTarget
():
GetDefence
()
end
function
c18605135
.
sdcon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
c18605135
.
filter
,
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
1
,
nil
)
or
Duel
.
GetEnvironment
()
=
=
22702055
return
not
Duel
.
IsExistingMatchingCard
(
c18605135
.
filter
,
0
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
GetEnvironment
()
~
=
22702055
end
script/c43509019.lua
View file @
54fadd0e
...
...
@@ -21,7 +21,7 @@ function c43509019.cbtg(e,tp,eg,ep,ev,re,r,rp,chk)
if
chk
==
0
then
return
true
end
local
bt
=
Duel
.
GetAttackTarget
()
if
Duel
.
CheckEvent
(
EVENT_BE_BATTLE_TARGET
)
and
bt
:
IsFaceup
()
and
bt
:
IsLevelBelow
(
4
)
and
bt
:
IsType
(
TYPE_TOON
)
and
bt
:
GetControler
()
==
e
:
GetHandlerPlayer
()
and
Duel
.
Select
y
esNo
(
tp
,
aux
.
Stringid
(
43509019
,
1
))
then
and
bt
:
GetControler
()
==
e
:
GetHandlerPlayer
()
and
Duel
.
Select
Y
esNo
(
tp
,
aux
.
Stringid
(
43509019
,
1
))
then
e
:
SetLabel
(
1
)
else
e
:
SetLabel
(
0
)
end
end
...
...
script/c65301952.lua
View file @
54fadd0e
...
...
@@ -51,7 +51,7 @@ end
function
c65301952
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsSSetable
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c65301952
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
...
...
script/c9720537.lua
View file @
54fadd0e
...
...
@@ -9,14 +9,23 @@ function c9720537.initial_effect(c)
e1
:
SetOperation
(
c9720537
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9720537
.
filter
(
c
)
return
c
:
GetControler
()
~=
c
:
GetOwner
()
end
function
c9720537
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
)
>
0
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c9720537
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
end
function
c9720537
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
)
local
tc
=
g
:
GetFirst
()
while
tc
do
tc
:
ResetEffect
(
EFFECT_SET_CONTROL
,
RESET_CODE
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_CONTROL
)
e1
:
SetValue
(
tc
:
GetOwner
())
e1
:
SetReset
(
RESET_EVENT
+
0xec0000
)
tc
:
RegisterEffect
(
e1
)
tc
=
g
:
GetNext
()
end
end
strings.conf
View file @
54fadd0e
...
...
@@ -246,6 +246,7 @@
!
system
1243
专有卡禁止
!
system
1244
单局模式
!
system
1245
比赛模式
!
system
1246
TAG
!
system
1250
决斗准备
!
system
1251
→决斗者
!
system
1252
→观战
...
...
system.conf
View file @
54fadd0e
...
...
@@ -5,7 +5,7 @@ antialias = 2
errorlog
=
1
nickname
=
Player
gamename
=
Game
lastdeck
=
test
lastdeck
=
sample
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
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