Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
91e5065a
Commit
91e5065a
authored
May 23, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步游戏逻辑改动
parent
836cc324
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
130 additions
and
91 deletions
+130
-91
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+1
-1
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+32
-65
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+0
-2
Classes/ocgcore/interpreter.cpp
Classes/ocgcore/interpreter.cpp
+2
-0
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+84
-14
Classes/ocgcore/scriptlib.h
Classes/ocgcore/scriptlib.h
+2
-0
mobile/assets/changelog.html
mobile/assets/changelog.html
+1
-1
mobile/assets/data/conf/strings.conf
mobile/assets/data/conf/strings.conf
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/cirno.zh-CN.json
mobile/assets/data/windbot/windbot/Dialogs/cirno.zh-CN.json
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/copy.zh-CN.json
mobile/assets/data/windbot/windbot/Dialogs/copy.zh-CN.json
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/default.json
mobile/assets/data/windbot/windbot/Dialogs/default.json
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/mokey.zh-CN.json
mobile/assets/data/windbot/windbot/Dialogs/mokey.zh-CN.json
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/near.zh-CN.json
mobile/assets/data/windbot/windbot/Dialogs/near.zh-CN.json
+1
-1
mobile/assets/data/windbot/windbot/Dialogs/swordsman.zh-CN.json
.../assets/data/windbot/windbot/Dialogs/swordsman.zh-CN.json
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-1
No files found.
Classes/gframe/drawing.cpp
View file @
91e5065a
...
...
@@ -817,7 +817,7 @@ void Game::DrawSpec() {
}
case
2
:
{
driver
->
draw2DImage
(
imageManager
.
GetTexture
(
showcardcode
),
recti
(
574
*
mainGame
->
xScale
,
150
*
mainGame
->
yScale
,
(
574
+
CARD_IMG_WIDTH
)
*
mainGame
->
xScale
,
(
150
+
CARD_IMG_HEIGHT
)
*
mainGame
->
yScale
),
recti
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
((
574
+
showcarddif
)
*
mainGame
->
xScale
,
150
*
mainGame
->
yScale
,
7
6
1
*
mainGame
->
xScale
,
404
*
mainGame
->
yScale
),
recti
(
0
,
0
,
(
CARD_IMG_WIDTH
-
showcarddif
),
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tMask
,
recti
((
574
+
showcarddif
)
*
mainGame
->
xScale
,
150
*
mainGame
->
yScale
,
7
5
1
*
mainGame
->
xScale
,
404
*
mainGame
->
yScale
),
recti
(
0
,
0
,
(
CARD_IMG_WIDTH
-
showcarddif
),
CARD_IMG_HEIGHT
),
0
,
0
,
true
);
showcarddif
+=
15
;
if
(
showcarddif
>=
CARD_IMG_WIDTH
)
{
showcard
=
0
;
...
...
Classes/ocgcore/card.cpp
View file @
91e5065a
...
...
@@ -1375,72 +1375,39 @@ int32 card::is_link_state() {
int32
card
::
is_extra_link_state
()
{
if
(
current
.
location
!=
LOCATION_MZONE
)
return
FALSE
;
card_set
cset
;
card_set
excset
;
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
card
*
pcard1
=
pduel
->
game_field
->
player
[
p
].
list_mzone
[
5
];
if
(
pcard1
)
excset
.
insert
(
pcard1
);
card
*
pcard2
=
pduel
->
game_field
->
player
[
p
].
list_mzone
[
6
];
if
(
pcard2
)
excset
.
insert
(
pcard2
);
card
*
pcard3
=
pduel
->
game_field
->
player
[
1
-
p
].
list_mzone
[
5
];
if
(
pcard3
)
excset
.
insert
(
pcard3
);
card
*
pcard4
=
pduel
->
game_field
->
player
[
1
-
p
].
list_mzone
[
6
];
if
(
pcard4
)
excset
.
insert
(
pcard4
);
}
if
(
excset
.
size
()
<
2
)
return
FALSE
;
auto
cit
=
excset
.
begin
();
card
*
pcard
=
*
cit
;
excset
.
erase
(
pcard
);
card_set
linked_group1
;
pcard
->
get_mutual_linked_cards
(
&
linked_group1
);
if
(
!
linked_group1
.
size
())
return
FALSE
;
cset
.
insert
(
pcard
);
return
check_extra_link
(
&
cset
,
&
excset
,
&
linked_group1
);
}
int32
card
::
check_extra_link
(
card_set
*
cset
,
card_set
*
excset
,
card_set
*
linked_group1
)
{
for
(
auto
cit
=
linked_group1
->
begin
();
cit
!=
linked_group1
->
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
cset
->
find
(
pcard
)
!=
cset
->
end
())
continue
;
if
(
excset
->
find
(
pcard
)
!=
excset
->
end
())
{
card_set
omitted
;
if
(
check_extra_link_finish
(
cset
,
&
omitted
))
return
TRUE
;
}
card_set
linked_group2
;
pcard
->
get_mutual_linked_cards
(
&
linked_group2
);
if
(
!
linked_group2
.
size
())
continue
;
cset
->
insert
(
pcard
);
int32
result
=
check_extra_link
(
cset
,
excset
,
&
linked_group2
);
cset
->
erase
(
pcard
);
if
(
result
)
return
TRUE
;
}
return
FALSE
;
}
int32
card
::
check_extra_link_finish
(
card_set
*
cset
,
card_set
*
omitted
)
{
if
(
cset
->
find
(
this
)
!=
cset
->
end
())
return
TRUE
;
for
(
auto
cit
=
cset
->
begin
();
cit
!=
cset
->
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
omitted
->
find
(
pcard
)
!=
omitted
->
end
())
continue
;
card_set
linked_group3
;
pcard
->
get_mutual_linked_cards
(
&
linked_group3
);
if
(
!
linked_group3
.
size
())
continue
;
omitted
->
insert
(
pcard
);
int32
result
=
check_extra_link_finish
(
&
linked_group3
,
omitted
);
omitted
->
erase
(
pcard
);
if
(
result
)
uint32
checked
=
1u
<<
current
.
sequence
;
uint32
linked_zone
=
get_mutual_linked_zone
();
const
auto
&
list_mzone0
=
pduel
->
game_field
->
player
[
current
.
controler
].
list_mzone
;
const
auto
&
list_mzone1
=
pduel
->
game_field
->
player
[
1
-
current
.
controler
].
list_mzone
;
while
(
true
)
{
if
(((
linked_zone
>>
5
)
|
(
linked_zone
>>
(
16
+
6
)))
&
((
linked_zone
>>
6
)
|
(
linked_zone
>>
(
16
+
5
)))
&
1
)
return
TRUE
;
int32
checking
=
(
int32
)(
linked_zone
&
~
checked
);
if
(
!
checking
)
return
FALSE
;
int32
rightmost
=
checking
&
(
-
checking
);
checked
|=
(
uint32
)
rightmost
;
if
(
rightmost
<
0x10000
)
{
for
(
int32
i
=
0
;
i
<
7
;
++
i
)
{
if
(
rightmost
&
1
)
{
card
*
pcard
=
list_mzone0
[
i
];
linked_zone
|=
pcard
->
get_mutual_linked_zone
();
break
;
}
rightmost
>>=
1
;
}
}
else
{
rightmost
>>=
16
;
for
(
int32
i
=
0
;
i
<
7
;
++
i
)
{
if
(
rightmost
&
1
)
{
card
*
pcard
=
list_mzone1
[
i
];
uint32
zone
=
pcard
->
get_mutual_linked_zone
();
linked_zone
|=
(
zone
<<
16
)
|
(
zone
>>
16
);
break
;
}
rightmost
>>=
1
;
}
}
}
return
FALSE
;
}
...
...
Classes/ocgcore/card.h
View file @
91e5065a
...
...
@@ -228,8 +228,6 @@ public:
void
get_mutual_linked_cards
(
card_set
*
cset
);
int32
is_link_state
();
int32
is_extra_link_state
();
int32
check_extra_link
(
card_set
*
cset
,
card_set
*
excset
,
card_set
*
linked_group1
);
int32
check_extra_link_finish
(
card_set
*
cset
,
card_set
*
omitted
);
int32
is_position
(
int32
pos
);
void
set_status
(
uint32
status
,
int32
enabled
);
int32
get_status
(
uint32
status
);
...
...
Classes/ocgcore/interpreter.cpp
View file @
91e5065a
...
...
@@ -111,6 +111,8 @@ static const struct luaL_Reg cardlib[] = {
{
"IsLevel"
,
scriptlib
::
card_is_level
},
{
"IsRank"
,
scriptlib
::
card_is_rank
},
{
"IsLink"
,
scriptlib
::
card_is_link
},
{
"IsAttack"
,
scriptlib
::
card_is_attack
},
{
"IsDefense"
,
scriptlib
::
card_is_defense
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsLinkRace"
,
scriptlib
::
card_is_link_race
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
...
...
Classes/ocgcore/libcard.cpp
View file @
91e5065a
...
...
@@ -893,33 +893,103 @@ int32 scriptlib::card_is_level(lua_State *L) {
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tlevel
=
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_level
()
==
tlevel
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
uint32
level
=
pcard
->
get_level
();
uint32
count
=
lua_gettop
(
L
)
-
1
;
uint32
result
=
FALSE
;
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tlevel
=
lua_tointeger
(
L
,
i
+
2
);
if
(
level
==
tlevel
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
}
int32
scriptlib
::
card_is_rank
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
trank
=
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_rank
()
==
trank
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
uint32
rank
=
pcard
->
get_rank
();
uint32
count
=
lua_gettop
(
L
)
-
1
;
uint32
result
=
FALSE
;
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
trank
=
lua_tointeger
(
L
,
i
+
2
);
if
(
rank
==
trank
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
}
int32
scriptlib
::
card_is_link
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tlink
=
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_link
()
==
tlink
)
lua_pushboolean
(
L
,
1
);
else
uint32
link
=
pcard
->
get_link
();
uint32
count
=
lua_gettop
(
L
)
-
1
;
uint32
result
=
FALSE
;
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tlink
=
lua_tointeger
(
L
,
i
+
2
);
if
(
link
==
tlink
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
return
1
;
}
int32
scriptlib
::
card_is_attack
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
!
(
pcard
->
get_type
()
&
TYPE_MONSTER
)
&&
!
(
pcard
->
current
.
location
&
LOCATION_MZONE
))
lua_pushboolean
(
L
,
0
);
else
{
uint32
atk
=
pcard
->
get_attack
();
uint32
count
=
lua_gettop
(
L
)
-
1
;
uint32
result
=
FALSE
;
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tatk
=
lua_tointeger
(
L
,
i
+
2
);
if
(
atk
==
tatk
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
}
return
1
;
}
int32
scriptlib
::
card_is_defense
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
((
pcard
->
data
.
type
&
TYPE_LINK
)
||
(
!
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
!
(
pcard
->
get_type
()
&
TYPE_MONSTER
)
&&
!
(
pcard
->
current
.
location
&
LOCATION_MZONE
)))
lua_pushboolean
(
L
,
0
);
else
{
uint32
def
=
pcard
->
get_defense
();
uint32
count
=
lua_gettop
(
L
)
-
1
;
uint32
result
=
FALSE
;
for
(
uint32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
lua_isnil
(
L
,
i
+
2
))
continue
;
uint32
tdef
=
lua_tointeger
(
L
,
i
+
2
);
if
(
def
==
tdef
)
{
result
=
TRUE
;
break
;
}
}
lua_pushboolean
(
L
,
result
);
}
return
1
;
}
int32
scriptlib
::
card_is_race
(
lua_State
*
L
)
{
...
...
Classes/ocgcore/scriptlib.h
View file @
91e5065a
...
...
@@ -113,6 +113,8 @@ public:
static
int32
card_is_level
(
lua_State
*
L
);
static
int32
card_is_rank
(
lua_State
*
L
);
static
int32
card_is_link
(
lua_State
*
L
);
static
int32
card_is_attack
(
lua_State
*
L
);
static
int32
card_is_defense
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_link_race
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
...
...
mobile/assets/changelog.html
View file @
91e5065a
...
...
@@ -22,7 +22,7 @@
更新:
1.更新ygo内核;
2.TCG2018.5.21禁卡表
3.新卡:CP18;
3.新卡:CP18
+VJ
;
新增:
1.萌卡聊天室
2.开放单人模式——离线人机★
...
...
mobile/assets/data/conf/strings.conf
View file @
91e5065a
...
...
@@ -387,7 +387,7 @@
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1385
人机模式未实装,努力中……
T
.
T
!
system
1385
列表为空,可能误删了文件,请卸载重装或者清除应用数据重启
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
...
...
mobile/assets/data/windbot/windbot/Dialogs/cirno.zh-CN.json
View file @
91e5065a
{
"welcome"
:
[
"本小姐是最强的!"
,
"
尸体大佬让本小姐
来手机陪你,还不快谢主隆恩!"
,
"
开发大佬让本小姐屈尊
来手机陪你,还不快谢主隆恩!"
,
"饼蛙是什么,好吃吗?"
],
"deckerror"
:
[
...
...
mobile/assets/data/windbot/windbot/Dialogs/copy.zh-CN.json
View file @
91e5065a
{
"welcome"
:
[
"你好,我是一个机器人。"
,
"
尸体
大佬让我来你的手机玩,要谢谢大佬们的努力"
"
开发
大佬让我来你的手机玩,要谢谢大佬们的努力"
],
"deckerror"
:
[
"我的超主流卡组需要{0}才能玩。"
...
...
mobile/assets/data/windbot/windbot/Dialogs/default.json
View file @
91e5065a
{
"welcome"
:
[
"Hi, I'm WindBot.
Mercury233
let me here and play with you"
"Hi, I'm WindBot.
developers
let me here and play with you"
],
"deckerror"
:
[
"Sorry, it seems that I have too much {0} in my deck."
...
...
mobile/assets/data/windbot/windbot/Dialogs/mokey.zh-CN.json
View file @
91e5065a
{
"welcome"
:
[
"你好,我是一个机器人。"
,
"
尸体
大佬让我来你的手机当专属沙包,有问题请反馈。"
,
"
开发
大佬让我来你的手机当专属沙包,有问题请反馈。"
,
"总有人叫我沙包……"
],
"deckerror"
:
[
...
...
mobile/assets/data/windbot/windbot/Dialogs/near.zh-CN.json
View file @
91e5065a
...
...
@@ -2,7 +2,7 @@
"welcome"
:
[
"你好,我是一个机器人,我的名字叫尼亚,但我并不是本体,只是一个分身哦。"
,
"终有一天,我的力量将会强过本体的!你们走着瞧吧!"
,
"
尸体
让我来你手机报社你,来社保我啊!"
"
开发大佬
让我来你手机报社你,来社保我啊!"
],
"deckerror"
:
[
"什么,居然不让我使用我无敌的{0}!"
...
...
mobile/assets/data/windbot/windbot/Dialogs/swordsman.zh-CN.json
View file @
91e5065a
{
"welcome"
:
[
"你好,我是一个机器人。"
,
"
尸体大佬让我来你的手机陪你决斗,有问题不要怪我
……"
"
开发大佬让我来你的手机陪你决斗,渣操了请及时反馈
……"
],
"deckerror"
:
[
"抱歉,我的卡组里的{0}的数量似乎出了问题。"
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
91e5065a
...
...
@@ -51,7 +51,7 @@ public interface Constants {
String
DEFAULT_FONT_NAME
=
"ygo.ttf"
;
String
DATABASE_NAME
=
"cards.cdb"
;
String
BOT_CONF
=
"bot.conf"
;
String
WINDBOT_PATH
=
"windbot"
;
String
WINDBOT_PATH
=
"windbot"
;
String
FONT_DIRECTORY
=
"fonts"
;
String
CORE_STRING_PATH
=
"strings.conf"
;
String
CORE_LIMIT_PATH
=
"lflist.conf"
;
...
...
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