Commit cc3e0748 authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent 76f3a4dd
...@@ -411,6 +411,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -411,6 +411,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
break; break;
} }
case MSG_SHUFFLE_SET_CARD: { case MSG_SHUFFLE_SET_CARD: {
pbuf++;
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += count * 8; pbuf += count * 8;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
...@@ -741,6 +742,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -741,6 +742,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
xcard->overlayTarget = ccard; xcard->overlayTarget = ccard;
xcard->location = 0x80; xcard->location = 0x80;
xcard->sequence = ccard->overlayed.size() - 1; xcard->sequence = ccard->overlayed.size() - 1;
xcard->owner = p;
xcard->controler = p;
} }
} }
} }
......
...@@ -1564,6 +1564,7 @@ void card::xyz_overlay(card_set* materials) { ...@@ -1564,6 +1564,7 @@ void card::xyz_overlay(card_set* materials) {
pduel->game_field->remove_unique_card(pcard); pduel->game_field->remove_unique_card(pcard);
if(pcard->equiping_target) if(pcard->equiping_target)
pcard->unequip(); pcard->unequip();
pcard->clear_card_target();
xyz_add(pcard, &des); xyz_add(pcard, &des);
} else { } else {
field::card_vector cv; field::card_vector cv;
...@@ -1576,6 +1577,7 @@ void card::xyz_overlay(card_set* materials) { ...@@ -1576,6 +1577,7 @@ void card::xyz_overlay(card_set* materials) {
pduel->game_field->remove_unique_card(*cvit); pduel->game_field->remove_unique_card(*cvit);
if((*cvit)->equiping_target) if((*cvit)->equiping_target)
(*cvit)->unequip(); (*cvit)->unequip();
(*cvit)->clear_card_target();
xyz_add(*cvit, &des); xyz_add(*cvit, &des);
} }
} }
...@@ -1993,20 +1995,6 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -1993,20 +1995,6 @@ void card::reset(uint32 id, uint32 reset_type) {
} }
if(id & 0xd7e0000) { if(id & 0xd7e0000) {
counters.clear(); counters.clear();
for(auto cit = effect_target_owner.begin(); cit != effect_target_owner.end(); ++cit)
(*cit)->effect_target_cards.erase(this);
for(auto cit = effect_target_cards.begin(); cit != effect_target_cards.end(); ++cit) {
card* pcard = *cit;
pcard->effect_target_owner.erase(this);
for(auto it = pcard->single_effect.begin(); it != pcard->single_effect.end();) {
auto rm = it++;
effect* peffect = rm->second;
if((peffect->owner == this) && peffect->is_flag(EFFECT_FLAG_OWNER_RELATE))
pcard->remove_effect(peffect, rm);
}
}
effect_target_owner.clear();
effect_target_cards.clear();
} }
if(id & 0x3fe0000) { if(id & 0x3fe0000) {
auto pr = field_effect.equal_range(EFFECT_USE_EXTRA_MZONE); auto pr = field_effect.equal_range(EFFECT_USE_EXTRA_MZONE);
...@@ -2342,6 +2330,22 @@ void card::cancel_card_target(card* pcard) { ...@@ -2342,6 +2330,22 @@ void card::cancel_card_target(card* pcard) {
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
} }
} }
void card::clear_card_target() {
for(auto cit = effect_target_owner.begin(); cit != effect_target_owner.end(); ++cit)
(*cit)->effect_target_cards.erase(this);
for(auto cit = effect_target_cards.begin(); cit != effect_target_cards.end(); ++cit) {
card* pcard = *cit;
pcard->effect_target_owner.erase(this);
for(auto it = pcard->single_effect.begin(); it != pcard->single_effect.end();) {
auto rm = it++;
effect* peffect = rm->second;
if((peffect->owner == this) && peffect->is_flag(EFFECT_FLAG_OWNER_RELATE))
pcard->remove_effect(peffect, rm);
}
}
effect_target_owner.clear();
effect_target_cards.clear();
}
void card::filter_effect(int32 code, effect_set* eset, uint8 sort) { void card::filter_effect(int32 code, effect_set* eset, uint8 sort) {
effect* peffect; effect* peffect;
auto rg = single_effect.equal_range(code); auto rg = single_effect.equal_range(code);
......
...@@ -277,6 +277,7 @@ public: ...@@ -277,6 +277,7 @@ public:
void set_material(card_set* materials); void set_material(card_set* materials);
void add_card_target(card* pcard); void add_card_target(card* pcard);
void cancel_card_target(card* pcard); void cancel_card_target(card* pcard);
void clear_card_target();
void filter_effect(int32 code, effect_set* eset, uint8 sort = TRUE); void filter_effect(int32 code, effect_set* eset, uint8 sort = TRUE);
void filter_single_effect(int32 code, effect_set* eset, uint8 sort = TRUE); void filter_single_effect(int32 code, effect_set* eset, uint8 sort = TRUE);
......
...@@ -3933,6 +3933,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3933,6 +3933,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pcard->previous.location = 0; pcard->previous.location = 0;
} else if(oloc & LOCATION_ONFIELD) { } else if(oloc & LOCATION_ONFIELD) {
pcard->reset(RESET_LEAVE + RESET_MSCHANGE, RESET_EVENT); pcard->reset(RESET_LEAVE + RESET_MSCHANGE, RESET_EVENT);
pcard->clear_card_target();
param->leave.insert(pcard); param->leave.insert(pcard);
} }
if(param->predirect->operation) { if(param->predirect->operation) {
...@@ -3974,6 +3975,22 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3974,6 +3975,22 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel->write_buffer32(ptop->data.code | 0x80000000); pduel->write_buffer32(ptop->data.code | 0x80000000);
} }
} }
for(auto cit = param->targets->container.begin(); cit != param->targets->container.end(); ++cit) {
card* pcard = *cit;
uint8 nloc = pcard->current.location;
if(nloc == LOCATION_HAND)
pcard->reset(RESET_TOHAND, RESET_EVENT);
else if(nloc == LOCATION_DECK || nloc == LOCATION_EXTRA)
pcard->reset(RESET_TODECK, RESET_EVENT);
else if(nloc == LOCATION_GRAVE)
pcard->reset(RESET_TOGRAVE, RESET_EVENT);
if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && pcard->sendto_param.location == LOCATION_REMOVED)) {
if(pcard->current.reason & REASON_TEMPORARY)
pcard->reset(RESET_TEMP_REMOVE, RESET_EVENT);
else
pcard->reset(RESET_REMOVE, RESET_EVENT);
}
}
for(auto iter = param->leave.begin(); iter != param->leave.end(); ++iter) for(auto iter = param->leave.begin(); iter != param->leave.end(); ++iter)
raise_single_event(*iter, 0, EVENT_LEAVE_FIELD, (*iter)->current.reason_effect, (*iter)->current.reason, (*iter)->current.reason_player, 0, 0); raise_single_event(*iter, 0, EVENT_LEAVE_FIELD, (*iter)->current.reason_effect, (*iter)->current.reason, (*iter)->current.reason_player, 0, 0);
if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && param->detach.size()) { if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && param->detach.size()) {
...@@ -4011,18 +4028,16 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -4011,18 +4028,16 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
equipings.insert(equipc); equipings.insert(equipc);
} }
} }
pcard->clear_card_target();
if(!(pcard->data.type & TYPE_TOKEN)) { if(!(pcard->data.type & TYPE_TOKEN)) {
pcard->enable_field_effect(true); pcard->enable_field_effect(true);
if(nloc == LOCATION_HAND) { if(nloc == LOCATION_HAND) {
tohand.insert(pcard); tohand.insert(pcard);
pcard->reset(RESET_TOHAND, RESET_EVENT);
raise_single_event(pcard, 0, EVENT_TO_HAND, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_TO_HAND, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} else if(nloc == LOCATION_DECK || nloc == LOCATION_EXTRA) { } else if(nloc == LOCATION_DECK || nloc == LOCATION_EXTRA) {
todeck.insert(pcard); todeck.insert(pcard);
pcard->reset(RESET_TODECK, RESET_EVENT);
raise_single_event(pcard, 0, EVENT_TO_DECK, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_TO_DECK, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} else if(nloc == LOCATION_GRAVE) { } else if(nloc == LOCATION_GRAVE) {
pcard->reset(RESET_TOGRAVE, RESET_EVENT);
if(pcard->current.reason & REASON_RETURN) { if(pcard->current.reason & REASON_RETURN) {
retgrave.insert(pcard); retgrave.insert(pcard);
raise_single_event(pcard, 0, EVENT_RETURN_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_RETURN_TO_GRAVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
...@@ -4034,10 +4049,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -4034,10 +4049,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
} }
if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && pcard->sendto_param.location == LOCATION_REMOVED)) { if(nloc == LOCATION_REMOVED || ((pcard->data.type & TYPE_TOKEN) && pcard->sendto_param.location == LOCATION_REMOVED)) {
remove.insert(pcard); remove.insert(pcard);
if(pcard->current.reason & REASON_TEMPORARY)
pcard->reset(RESET_TEMP_REMOVE, RESET_EVENT);
else
pcard->reset(RESET_REMOVE, RESET_EVENT);
raise_single_event(pcard, 0, EVENT_REMOVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); raise_single_event(pcard, 0, EVENT_REMOVE, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0);
} }
if(pcard->current.reason & REASON_DISCARD) { if(pcard->current.reason & REASON_DISCARD) {
...@@ -4386,6 +4397,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret, ...@@ -4386,6 +4397,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
} }
if((target->previous.location == LOCATION_SZONE) && target->equiping_target) if((target->previous.location == LOCATION_SZONE) && target->equiping_target)
target->unequip(); target->unequip();
target->clear_card_target();
if(target->current.location == LOCATION_MZONE) { if(target->current.location == LOCATION_MZONE) {
effect_set eset; effect_set eset;
filter_player_effect(0, EFFECT_MUST_USE_MZONE, &eset, FALSE); filter_player_effect(0, EFFECT_MUST_USE_MZONE, &eset, FALSE);
...@@ -4499,6 +4511,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec ...@@ -4499,6 +4511,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED))
pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE); pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE);
pcard->reset(RESET_TURN_SET, RESET_EVENT); pcard->reset(RESET_TURN_SET, RESET_EVENT);
pcard->clear_card_target();
pcard->set_status(STATUS_SET_TURN, TRUE); pcard->set_status(STATUS_SET_TURN, TRUE);
pcard->enable_field_effect(false); pcard->enable_field_effect(false);
pcard->summon_info &= 0xdf00ffff; pcard->summon_info &= 0xdf00ffff;
......
...@@ -24,7 +24,10 @@ ...@@ -24,7 +24,10 @@
1.更新ygo内核; 1.更新ygo内核;
2.更新LP显示; 2.更新LP显示;
3.自定义头像; 3.自定义头像;
4.新卡1006; 4.新卡1006+VJ+VF;
修复:
1.若干已知卡图错误;
2.本地脚本问题;
优化: 优化:
1.把过去的更新日志删了加快初启动速度; 1.把过去的更新日志删了加快初启动速度;
2.可以自行设置头像; 2.可以自行设置头像;
......
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 33030720 versionCode 33030722
versionName "3.3.3" versionName "3.3.3"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
......
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