Commit 25d4abc7 authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent 3c205315
...@@ -636,12 +636,31 @@ int32 field::is_location_useable(uint32 playerid, uint32 location, uint32 sequen ...@@ -636,12 +636,31 @@ int32 field::is_location_useable(uint32 playerid, uint32 location, uint32 sequen
} }
return TRUE; return TRUE;
} }
/**
* Return usable count in zone of playerid's MZONE or SZONE(0~4) when uplayer moves pcard to playerid's field (can be negative).
* for LOCATION_MZONE, "usable" means not used, not disabled, satisfying EFFECT_MUST_USE_MZONE, satisfying EFFECT_MAX_MZONE
* for LOCATION_SZONE, "usable" means not used, not disabled, satisfying EFFECT_MAX_SZONE
*
* @param pcard the card about to move
* @param playerid the target player
* @param location LOCATION_MZONE or LOCATION_SZONE
* @param uplayer the request player, PLAYER_NONE means ignoring EFFECT_MUST_USE_MZONE of uplayer, ignoring EFFECT_MAX_MZONE, EFFECT_MAX_SZONE of playerid
* @param reason location reason
* @param zone specified zones, 0xff by default
* @param list storing unavailable or unspecified zones
*
* @return usable count in zone of playerid's MZONE or SZONE(0~4) (can be negative)
*/
int32 field::get_useable_count(card* pcard, uint8 playerid, uint8 location, uint8 uplayer, uint32 reason, uint32 zone, uint32* list) { int32 field::get_useable_count(card* pcard, uint8 playerid, uint8 location, uint8 uplayer, uint32 reason, uint32 zone, uint32* list) {
if(location == LOCATION_MZONE && pcard && pcard->current.location == LOCATION_EXTRA) if(location == LOCATION_MZONE && pcard && pcard->current.location == LOCATION_EXTRA)
return get_useable_count_fromex(pcard, playerid, uplayer, zone, list); return get_useable_count_fromex(pcard, playerid, uplayer, zone, list);
else else
return get_useable_count_other(pcard, playerid, location, uplayer, reason, zone, list); return get_useable_count_other(pcard, playerid, location, uplayer, reason, zone, list);
} }
/**
* @param pcard the card about to move from Extra Deck (NULL means any card in Extra Deck)
* @return usable count in zone of playerid's MZONE for pcard
*/
int32 field::get_useable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer, uint32 zone, uint32* list) { int32 field::get_useable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer, uint32 zone, uint32* list) {
bool use_temp_card = false; bool use_temp_card = false;
if(!pcard) { if(!pcard) {
...@@ -658,12 +677,20 @@ int32 field::get_useable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer ...@@ -658,12 +677,20 @@ int32 field::get_useable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer
pcard->current.location = 0; pcard->current.location = 0;
return useable_count; return useable_count;
} }
/**
* @return the number of available grids in zone of playerid's MZONE for pcard sp_summoned by playerid
* for LOCATION_MZONE, "available" means not used, not disabled, satisfying EFFECT_MUST_USE_MZONE
*/
int32 field::get_spsummonable_count(card* pcard, uint8 playerid, uint32 zone, uint32* list) { int32 field::get_spsummonable_count(card* pcard, uint8 playerid, uint32 zone, uint32* list) {
if(pcard->current.location == LOCATION_EXTRA) if(pcard->current.location == LOCATION_EXTRA)
return get_spsummonable_count_fromex(pcard, playerid, playerid, zone, list); return get_spsummonable_count_fromex(pcard, playerid, playerid, zone, list);
else else
return get_tofield_count(pcard, playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD, zone, list); return get_tofield_count(pcard, playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD, zone, list);
} }
/**
* @param pcard the card about to move from Extra Deck (NULL means any card in Extra Deck)
* @return the number of available grids in zone of playerid's MZONE for pcard
*/
int32 field::get_spsummonable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer, uint32 zone, uint32* list) { int32 field::get_spsummonable_count_fromex(card* pcard, uint8 playerid, uint8 uplayer, uint32 zone, uint32* list) {
bool use_temp_card = false; bool use_temp_card = false;
if(!pcard) { if(!pcard) {
...@@ -680,7 +707,9 @@ int32 field::get_spsummonable_count_fromex(card* pcard, uint8 playerid, uint8 up ...@@ -680,7 +707,9 @@ int32 field::get_spsummonable_count_fromex(card* pcard, uint8 playerid, uint8 up
pcard->current.location = 0; pcard->current.location = 0;
return spsummonable_count; return spsummonable_count;
} }
// return: usable count of main mzone or szone(0~4) of playerid requested by uplayer (may be negative) /**
* @return usable count in zone of Main MZONE or SZONE(0~4)
*/
int32 field::get_useable_count_other(card* pcard, uint8 playerid, uint8 location, uint8 uplayer, uint32 reason, uint32 zone, uint32* list) { int32 field::get_useable_count_other(card* pcard, uint8 playerid, uint8 location, uint8 uplayer, uint32 reason, uint32 zone, uint32* list) {
int32 count = get_tofield_count(pcard, playerid, location, uplayer, reason, zone, list); int32 count = get_tofield_count(pcard, playerid, location, uplayer, reason, zone, list);
int32 limit; int32 limit;
...@@ -692,10 +721,11 @@ int32 field::get_useable_count_other(card* pcard, uint8 playerid, uint8 location ...@@ -692,10 +721,11 @@ int32 field::get_useable_count_other(card* pcard, uint8 playerid, uint8 location
count = limit; count = limit;
return count; return count;
} }
// uplayer: request player, PLAYER_NONE means ignoring EFFECT_MUST_USE_MZONE, EFFECT_MAX_MZONE, EFFECT_MAX_SZONE /**
// list: store unavailable flag in list * @return the number of available grids in zone of Main MZONE or SZONE(0~4)
// for LOCATION_MZONE, return the available count of zone in main mzone (not used, not disabled, satisfying EFFECT_MUST_USE_MZONE) * for LOCATION_MZONE, "available" means not used, not disabled, satisfying EFFECT_MUST_USE_MZONE
// for LOCATION_SZONE, return the available count of zone in szone(0~4) (not used, not disabled) * for LOCATION_SZONE, "available" means not used, not disabled
*/
int32 field::get_tofield_count(card* pcard, uint8 playerid, uint8 location, uint32 uplayer, uint32 reason, uint32 zone, uint32* list) { int32 field::get_tofield_count(card* pcard, uint8 playerid, uint8 location, uint32 uplayer, uint32 reason, uint32 zone, uint32* list) {
if (location != LOCATION_MZONE && location != LOCATION_SZONE) if (location != LOCATION_MZONE && location != LOCATION_SZONE)
return 0; return 0;
...@@ -747,6 +777,13 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui ...@@ -747,6 +777,13 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
count++; count++;
return count; return count;
} }
/**
* @param playerid the target player
* @param uplayer the request player, PLAYER_NONE means ignoring EFFECT_MAX_MZONE
* @param reason location reason
*
* @return the remaining count in playerid's MZONE after applying EFFECT_MAX_MZONE (can be negative).
*/
int32 field::get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason) { int32 field::get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason) {
uint32 used_flag = player[playerid].used_location; uint32 used_flag = player[playerid].used_location;
used_flag = used_flag & 0x1f; used_flag = used_flag & 0x1f;
...@@ -773,6 +810,13 @@ int32 field::get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason) { ...@@ -773,6 +810,13 @@ int32 field::get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason) {
int32 limit = max - used_count; int32 limit = max - used_count;
return limit; return limit;
} }
/**
* @param playerid the target player
* @param uplayer the request player, PLAYER_NONE means ignoring EFFECT_MAX_SZONE
* @param reason location reason
*
* @return the remaining count in playerid's SZONE(0~4) after applying EFFECT_MAX_SZONE.
*/
int32 field::get_szone_limit(uint8 playerid, uint8 uplayer, uint32 reason) { int32 field::get_szone_limit(uint8 playerid, uint8 uplayer, uint32 reason) {
uint32 used_flag = player[playerid].used_location; uint32 used_flag = player[playerid].used_location;
used_flag = (used_flag >> 8) & 0x1f; used_flag = (used_flag >> 8) & 0x1f;
...@@ -813,6 +857,13 @@ uint32 field::get_rule_zone_fromex(int32 playerid, card* pcard) { ...@@ -813,6 +857,13 @@ uint32 field::get_rule_zone_fromex(int32 playerid, card* pcard) {
return 0x1f; return 0x1f;
} }
} }
/**
* @param playerid the target player
* @param uplayer the request player, PLAYER_NONE means ignoring EFFECT_MUST_USE_MZONE of uplayer
* @param reason location reason
* @param pcard the card about to move
* @param flag storing the zones in MZONE blocked by EFFECT_MUST_USE_MZONE
*/
void field::filter_must_use_mzone(uint8 playerid, uint8 uplayer, uint32 reason, card* pcard, uint32* flag) { void field::filter_must_use_mzone(uint8 playerid, uint8 uplayer, uint32 reason, card* pcard, uint32* flag) {
effect_set eset; effect_set eset;
if(uplayer < 2) if(uplayer < 2)
......
...@@ -282,7 +282,7 @@ struct processor { ...@@ -282,7 +282,7 @@ struct processor {
uint8 extra_summon[2]; uint8 extra_summon[2];
int32 spe_effect[2]; int32 spe_effect[2];
int32 duel_options; int32 duel_options;
int32 duel_rule; int32 duel_rule; //current rule: 5, Master Rule 2020
uint32 copy_reset; uint32 copy_reset;
uint8 copy_reset_count; uint8 copy_reset_count;
uint32 last_control_changed_id; uint32 last_control_changed_id;
......
...@@ -13,15 +13,18 @@ group::group(duel* pd) { ...@@ -13,15 +13,18 @@ group::group(duel* pd) {
ref_handle = 0; ref_handle = 0;
pduel = pd; pduel = pd;
is_readonly = FALSE; is_readonly = FALSE;
it = container.begin();
} }
group::group(duel* pd, card* pcard) { group::group(duel* pd, card* pcard) {
container.insert(pcard); container.insert(pcard);
ref_handle = 0; ref_handle = 0;
pduel = pd; pduel = pd;
is_readonly = FALSE; is_readonly = FALSE;
it = container.begin();
} }
group::group(duel* pd, const card_set& cset): container(cset) { group::group(duel* pd, const card_set& cset): container(cset) {
ref_handle = 0; ref_handle = 0;
pduel = pd; pduel = pd;
is_readonly = FALSE; is_readonly = FALSE;
it = container.begin();
} }
...@@ -1844,6 +1844,7 @@ int32 scriptlib::duel_check_summon_count(lua_State *L) { ...@@ -1844,6 +1844,7 @@ int32 scriptlib::duel_check_summon_count(lua_State *L) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
// Return usable count in zone of playerid's Main MZONE or SZONE(0~4) when uplayer moves a card to playerid's field (can be negative).
int32 scriptlib::duel_get_location_count(lua_State *L) { int32 scriptlib::duel_get_location_count(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
uint32 playerid = (uint32)lua_tointeger(L, 1); uint32 playerid = (uint32)lua_tointeger(L, 1);
...@@ -1865,6 +1866,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) { ...@@ -1865,6 +1866,7 @@ int32 scriptlib::duel_get_location_count(lua_State *L) {
lua_pushinteger(L, list); lua_pushinteger(L, list);
return 2; return 2;
} }
// Return usable count in zone of playerid's Main MZONE after mcard or mgroup leaves the field.
int32 scriptlib::duel_get_mzone_count(lua_State *L) { int32 scriptlib::duel_get_mzone_count(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 playerid = (uint32)lua_tointeger(L, 1); uint32 playerid = (uint32)lua_tointeger(L, 1);
...@@ -1919,6 +1921,8 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) { ...@@ -1919,6 +1921,8 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) {
} }
return 2; return 2;
} }
// Condition: uplayer moves scard or any card with type from Extra Deck to playerid's field
// Return usable count in zone of playerid's MZONE after mcard or mgroup leaves the field
int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 playerid = (uint32)lua_tointeger(L, 1); uint32 playerid = (uint32)lua_tointeger(L, 1);
...@@ -1992,6 +1996,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { ...@@ -1992,6 +1996,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
} }
return 2; return 2;
} }
// Return the number of available grids in playerid's Main MZONE and Extra MZONE
int32 scriptlib::duel_get_usable_mzone_count(lua_State *L) { int32 scriptlib::duel_get_usable_mzone_count(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 playerid = (uint32)lua_tointeger(L, 1); uint32 playerid = (uint32)lua_tointeger(L, 1);
......
...@@ -2050,6 +2050,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) { ...@@ -2050,6 +2050,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
case 1: { case 1: {
target->previous.position = target->current.position; target->previous.position = target->current.position;
target->current.position = POS_FACEUP_ATTACK; target->current.position = POS_FACEUP_ATTACK;
target->summon_player = sumplayer;
target->fieldid = infos.field_id++; target->fieldid = infos.field_id++;
core.phase_action = TRUE; core.phase_action = TRUE;
pduel->write_buffer8(MSG_FLIPSUMMONING); pduel->write_buffer8(MSG_FLIPSUMMONING);
......
...@@ -16,20 +16,18 @@ ...@@ -16,20 +16,18 @@
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力. 特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
</pre> </pre>
<ul> <ul>
<li style="color:#ffff00">3.7.10</li> <li style="color:#ffff00">3.7.11</li>
</ul> </ul>
<pre> <pre>
更新: 更新:
1.更新ygo内核; 1.更新ygo内核;
2.新卡SD40+MAGO+VJ; 2.新卡STL1+PGB1+VJ;
变更:
1.变更界面一些文字描述;
</pre> </pre>
<h3 style="color:#ff0000">注意</h3> <h3 style="color:#ff0000">注意</h3>
<pre> <pre>
①:卸载本软件将删除包含卡组在内的重要文件,卸载前请慎重; ①:卸载本软件将删除包含卡组在内的重要文件,卸载前请慎重;
②:背景音乐播放流畅性视手机性能强度而定 ②:背景音乐播放流畅性视手机性能强度而定
如果游戏过程中感觉卡顿,掉帧或者不习惯,是可以在左侧辅助功能选项卡里关闭的; 如果游戏过程中感觉卡顿,掉帧或者不习惯,是可以关闭的;
④:出现点击不准,不灵敏的情况 ④:出现点击不准,不灵敏的情况
·选择功能菜单>设置>开启沉浸式画面 ·选择功能菜单>设置>开启沉浸式画面
目前手头缺少多种机型,适配坑深难以一步到位 目前手头缺少多种机型,适配坑深难以一步到位
......
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 370901201 versionCode 371101230
versionName "3.7.10" versionName "3.7.11"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
ndk { ndk {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment