Commit a857fbbf authored by feihuaduo's avatar feihuaduo
parents 0b5e60a4 012a191f
......@@ -3279,6 +3279,36 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
pduel->game_field->restore_lp_cost();
return TRUE;
}
uint8 card::get_spsummonable_position(effect* reason_effect, uint32 sumtype, uint8 sumpos, uint8 sumplayer, uint8 toplayer) {
uint8 position = 0;
uint8 positions[4] = { POS_FACEUP_ATTACK, POS_FACEDOWN_ATTACK, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE };
effect_set eset;
for(int32 p = 0; p < 4; ++p) {
bool poscheck = true;
if(!(positions[p] & sumpos))
continue;
if((data.type & (TYPE_TOKEN | TYPE_LINK)) && (positions[p] & POS_FACEDOWN))
continue;
pduel->game_field->filter_player_effect(sumplayer, EFFECT_CANNOT_SPECIAL_SUMMON, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
if(!eset[i]->target)
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
pduel->lua->add_param(sumtype, PARAM_TYPE_INT);
pduel->lua->add_param(positions[p], PARAM_TYPE_INT);
pduel->lua->add_param(toplayer, PARAM_TYPE_INT);
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
if(pduel->lua->check_condition(eset[i]->target, 7))
poscheck = false;
}
eset.clear();
if(poscheck)
position |= positions[p];
}
return position;
}
int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect, uint8 min_tribute, uint32 zone) {
if(!is_summonable_card())
return FALSE;
......
......@@ -346,6 +346,7 @@ public:
int32 is_can_be_flip_summoned(uint8 playerid);
int32 is_special_summonable(uint8 playerid, uint32 summon_type, material_info info = null_info);
int32 is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, uint8 sumpos, uint8 sumplayer, uint8 toplayer, uint8 nocheck, uint8 nolimit, uint32 zone);
uint8 get_spsummonable_position(effect* reason_effect, uint32 sumtype, uint8 sumpos, uint8 sumplayer, uint8 toplayer);
int32 is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect, uint8 min_tribute, uint32 zone = 0x1f);
int32 is_setable_szone(uint8 playerid, uint8 ignore_fd = 0);
int32 is_affect_by_effect(effect* reason_effect);
......
......@@ -201,7 +201,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_IMMEDIATELY_APPLY = 0x80000000,
};
enum effect_flag2 : uint32 {
EFFECT_FLAG2_MILLENNIUM_RESTRICT = 0x0001,
// EFFECT_FLAG2_MILLENNIUM_RESTRICT = 0x0001,
EFFECT_FLAG2_COF = 0x0002,
EFFECT_FLAG2_WICKED = 0x0004,
EFFECT_FLAG2_OPTION = 0x0008,
......
......@@ -1824,6 +1824,9 @@ int32 field::get_summon_count_limit(uint8 playerid) {
return count;
}
int32 field::get_draw_count(uint8 playerid) {
if ((core.duel_rule >= 3) && (infos.turn_id == 1) && (infos.turn_player == playerid)) {
return 0;
}
effect_set eset;
filter_player_effect(playerid, EFFECT_DRAW_COUNT, &eset);
int32 count = player[playerid].draw_count;
......@@ -3069,7 +3072,8 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
return FALSE;
if(pcard->data.type & TYPE_LINK)
sumpos &= POS_FACEUP_ATTACK;
if(sumpos == 0)
uint8 position = pcard->get_spsummonable_position(reason_effect, sumtype, sumpos, playerid, toplayer);
if(position == 0)
return FALSE;
sumtype |= SUMMON_TYPE_SPECIAL;
save_lp_cost();
......@@ -3078,8 +3082,8 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
return FALSE;
}
restore_lp_cost();
if(sumpos & POS_FACEDOWN && is_player_affected_by_effect(playerid, EFFECT_DIVINE_LIGHT))
sumpos = (sumpos & POS_FACEUP) | ((sumpos & POS_FACEDOWN) >> 1);
if(position & POS_FACEDOWN && is_player_affected_by_effect(playerid, EFFECT_DIVINE_LIGHT))
position = (position & POS_FACEUP) | ((position & POS_FACEDOWN) >> 1);
effect_set eset;
filter_player_effect(playerid, EFFECT_CANNOT_SPECIAL_SUMMON, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
......@@ -3089,7 +3093,7 @@ int32 field::is_player_can_spsummon(effect* reason_effect, uint32 sumtype, uint8
pduel->lua->add_param(pcard, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
pduel->lua->add_param(sumtype, PARAM_TYPE_INT);
pduel->lua->add_param(sumpos, PARAM_TYPE_INT);
pduel->lua->add_param(position, PARAM_TYPE_INT);
pduel->lua->add_param(toplayer, PARAM_TYPE_INT);
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
if (pduel->lua->check_condition(eset[i]->target, 7))
......@@ -3377,8 +3381,9 @@ int32 field::get_cteffect(effect* peffect, int32 playerid, int32 store) {
continue;
uint32 code = efit.first;
if(code == EVENT_FREE_CHAIN || code == EVENT_PHASE + infos.phase) {
nil_event.event_code = code;
if(get_cteffect_evt(feffect, playerid, nil_event, store) && !store)
tevent test_event;
test_event.event_code = code;
if(get_cteffect_evt(feffect, playerid, test_event, store) && !store)
return TRUE;
} else {
for(const auto& ev : core.point_event) {
......@@ -3427,8 +3432,9 @@ int32 field::check_cteffect_hint(effect* peffect, uint8 playerid) {
continue;
uint32 code = efit.first;
if(code == EVENT_FREE_CHAIN || code == EVENT_PHASE + infos.phase) {
nil_event.event_code = code;
if(get_cteffect_evt(feffect, playerid, nil_event, FALSE)
tevent test_event;
test_event.event_code = code;
if(get_cteffect_evt(feffect, playerid, test_event, FALSE)
&& (code != EVENT_FREE_CHAIN || check_hint_timing(feffect)))
return TRUE;
} else {
......
......@@ -2747,11 +2747,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
else
targetplayer = 1 - sumplayer;
}
if(positions == 0)
positions = POS_FACEUP_ATTACK;
std::vector<int32> retval;
peffect->get_value(target, 0, &retval);
uint32 summon_info = retval.size() > 0 ? retval[0] : 0;
positions = target->get_spsummonable_position(peffect, ((summon_info & 0xf00ffff) | SUMMON_TYPE_SPECIAL), positions, sumplayer, targetplayer);
if(positions == 0)
positions = POS_FACEUP_ATTACK;
uint32 zone = retval.size() > 1 ? retval[1] : 0xff;
target->summon_info = (summon_info & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)target->current.location << 16);
target->enable_field_effect(false);
......@@ -2958,7 +2959,8 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
if(ct1 == 0)
zone = flag1;
}
move_to_field(pcard, sumplayer, sumplayer, LOCATION_MZONE, POS_FACEUP, FALSE, 0, FALSE, zone);
uint8 positions = pcard->get_spsummonable_position(peffect, ((peffect->get_value(pcard) & 0xff00ffff) | SUMMON_TYPE_SPECIAL), POS_FACEUP, sumplayer, sumplayer);
move_to_field(pcard, sumplayer, sumplayer, LOCATION_MZONE, positions, FALSE, 0, FALSE, zone);
return FALSE;
}
case 24: {
......@@ -3154,7 +3156,8 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
zone &= flag1;
}
}
move_to_field(target, target->summon_player, playerid, LOCATION_MZONE, positions, FALSE, 0, FALSE, zone);
uint8 sumpositions = target->get_spsummonable_position(core.reason_effect, (target->summon_info & 0xff00ffff), positions, target->summon_player, playerid);
move_to_field(target, target->summon_player, playerid, LOCATION_MZONE, sumpositions, FALSE, 0, FALSE, zone);
return FALSE;
}
case 2: {
......@@ -5089,8 +5092,9 @@ int32 field::activate_effect(uint16 step, effect* peffect) {
case 0: {
card* phandler = peffect->get_handler();
int32 playerid = phandler->current.controler;
nil_event.event_code = EVENT_FREE_CHAIN;
if(!peffect->is_activateable(playerid, nil_event))
tevent test_event;
test_event.event_code = EVENT_FREE_CHAIN;
if(!peffect->is_activateable(playerid, test_event))
return TRUE;
chain newchain;
newchain.flag = 0;
......
This diff is collapsed.
......@@ -640,6 +640,7 @@
!counter 0x5e 皇之键指示物
!counter 0x5f 拼图指示物
!counter 0x60 指示物(北极天熊辐射)
!counter 0x61 指示物(命运的囚人)
#setnames, using tab for comment
!setname 0x1 正义盟军 AOJ
!setname 0x2 次世代 ジェネクス
......@@ -1130,3 +1131,4 @@
!setname 0x179 兽带斗神 セリオンズ
!setname 0x17a 肆世坏 スケアクロー
!setname 0x17b 野蛮人 バーバリアン
!setname 0x17c 漫读使灵 Libromancer
......@@ -639,6 +639,7 @@
!counter 0x5e Emperor's Key Counter
!counter 0x5f Peace Counter
!counter 0x60 Counter(Ursarctic Radiation)
!counter 0x60 Counter(Prisoner of Destiny)
#setnames, using tab for comment
!setname 0x1 Ally of Justice
!setname 0x2 Genex
......@@ -1122,3 +1123,4 @@
!setname 0x179 Therions
!setname 0x17a Scareclaw
!setname 0x17b Battleguard
!setname 0x17c Libromancer
......@@ -24,11 +24,11 @@
!system 29 배틀 페이즈 종료시
!system 30 리플레이가 발생했습니다. 이 공격을 계속하겠습니까?
!system 31 이 몬스터로 직접 공격하겠습니까?
!system 40 미지 스텝 개시시
!system 41 미지 계산 전
!system 42 미지 계산 동안
!system 43 미지 계산 후
!system 44 미지 스텝 종료
!system 40 미지 스텝 개시시
!system 41 미지 계산 전
!system 42 미지 계산 동안
!system 43 미지 계산 후
!system 44 미지 스텝 종료
!system 60 앞면
!system 61 뒷면
!system 62 앞면 효과
......@@ -226,7 +226,7 @@
!system 1111 표시
!system 1112 컨트롤
!system 1113 공수 변화
!system 1114 관통 미지
!system 1114 관통 미지
!system 1115 연속 공격
!system 1116 공격 제한
!system 1117 직접 공격
......@@ -234,7 +234,7 @@
!system 1119 토큰
!system 1120 종족 관련
!system 1121 소재 관련
!system 1122 LP 미지
!system 1122 LP 미지
!system 1123 LP 회복
!system 1124 파괴
!system 1125 선택
......@@ -508,8 +508,8 @@
!system 1610 [%ls](%ls,%d)이(가) 대상이 되었습니다
!system 1611 자신은 카드를 %d장 드로우했습니다
!system 1612 상대은 카드를 %d장 드로우했습니다
!system 1613 자신이 %d 미지를 받았습니다
!system 1614 상대가 %d 미지를 받았습니다
!system 1613 자신이 %d 미지를 받았습니다
!system 1614 상대가 %d 미지를 받았습니다
!system 1615 자신이 %d LP로 회복했습니다
!system 1616 상대가 %d LP호 회복했습니다
!system 1617 [%ls] 에 %d개의 [%ls] 를 놓습니다
......@@ -639,6 +639,7 @@
!counter 0x5e 황의 열쇠 카운터
!counter 0x5f 피스 카운터
!counter 0x60 카운터(베어루크티 라디에이션)
!counter 0x61 카운터(운명의 수인(囚人))
#setnames, using tab for comment
!setname 0x1 얼리 오브 저스티스(정발명:A·O·J)
!setname 0x2 제넥스
......@@ -1129,3 +1130,4 @@
!setname 0x179 세리온즈
!setname 0x17a 스케어클로우
!setname 0x17b 바바리안
!setname 0x17c 리브로맨서(Libromancer)
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