Commit 16be3c45 authored by argon.sun's avatar argon.sun

fix

parent 6381de9d
...@@ -139,7 +139,7 @@ void Replay::SaveReplay(const wchar_t* name) { ...@@ -139,7 +139,7 @@ void Replay::SaveReplay(const wchar_t* name) {
fclose(fp); fclose(fp);
} }
bool Replay::OpenReplay(const wchar_t* name) { bool Replay::OpenReplay(const wchar_t* name) {
wchar_t fname[64]; wchar_t fname[256];
myswprintf(fname, L"./replay/%ls", name); myswprintf(fname, L"./replay/%ls", name);
#ifdef WIN32 #ifdef WIN32
fp = _wfopen(fname, L"rb"); fp = _wfopen(fname, L"rb");
...@@ -170,7 +170,7 @@ bool Replay::OpenReplay(const wchar_t* name) { ...@@ -170,7 +170,7 @@ bool Replay::OpenReplay(const wchar_t* name) {
return true; return true;
} }
bool Replay::CheckReplay(const wchar_t* name) { bool Replay::CheckReplay(const wchar_t* name) {
wchar_t fname[64]; wchar_t fname[256];
myswprintf(fname, L"./replay/%ls", name); myswprintf(fname, L"./replay/%ls", name);
#ifdef WIN32 #ifdef WIN32
FILE* rfp = _wfopen(fname, L"rb"); FILE* rfp = _wfopen(fname, L"rb");
......
...@@ -1236,7 +1236,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign ...@@ -1236,7 +1236,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
peset->add_item(eset[i]); peset->add_item(eset[i]);
if(!pduel->game_field->is_player_can_summon(SUMMON_TYPE_NORMAL, playerid, this)) if(!pduel->game_field->is_player_can_summon(SUMMON_TYPE_NORMAL, playerid, this))
return FALSE; return FALSE;
uint32 rcount = get_summon_tribute_count(); int32 rcount = get_summon_tribute_count();
int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff; int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff;
if(min > 0 && !pduel->game_field->is_player_can_summon(SUMMON_TYPE_ADVANCE, playerid, this)) if(min > 0 && !pduel->game_field->is_player_can_summon(SUMMON_TYPE_ADVANCE, playerid, this))
return FALSE; return FALSE;
...@@ -1271,7 +1271,7 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore ...@@ -1271,7 +1271,7 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
peset->add_item(eset[i]); peset->add_item(eset[i]);
if(!pduel->game_field->is_player_can_mset(SUMMON_TYPE_NORMAL, playerid, this)) if(!pduel->game_field->is_player_can_mset(SUMMON_TYPE_NORMAL, playerid, this))
return FALSE; return FALSE;
uint32 rcount = get_set_tribute_count(); int32 rcount = get_set_tribute_count();
int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff; int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff;
if(min > 0 && !pduel->game_field->is_player_can_mset(SUMMON_TYPE_ADVANCE, playerid, this)) if(min > 0 && !pduel->game_field->is_player_can_mset(SUMMON_TYPE_ADVANCE, playerid, this))
return FALSE; return FALSE;
...@@ -1644,7 +1644,7 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect ...@@ -1644,7 +1644,7 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
return TRUE; return TRUE;
} }
int32 card::is_setable_szone(uint8 playerid) { int32 card::is_setable_szone(uint8 playerid) {
if(!(data.type & TYPE_FIELD) && pduel->game_field->get_useable_count(current.controler, LOCATION_SZONE, current.controler, LOCATION_REASON_TOFIELD) == 0) if(!(data.type & TYPE_FIELD) && pduel->game_field->get_useable_count(current.controler, LOCATION_SZONE, current.controler, LOCATION_REASON_TOFIELD) <= 0)
return FALSE; return FALSE;
if(data.type & TYPE_MONSTER && !is_affected_by_effect(EFFECT_MONSTER_SSET)) if(data.type & TYPE_MONSTER && !is_affected_by_effect(EFFECT_MONSTER_SSET))
return FALSE; return FALSE;
...@@ -1932,9 +1932,9 @@ int32 card::is_control_can_be_changed() { ...@@ -1932,9 +1932,9 @@ int32 card::is_control_can_be_changed() {
return FALSE; return FALSE;
if(current.location != LOCATION_MZONE) if(current.location != LOCATION_MZONE)
return FALSE; return FALSE;
if(pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL) == 0) if(pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL) <= 0)
return FALSE; return FALSE;
if((data.type & TYPE_TRAPMONSTER) && pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL)) if((data.type & TYPE_TRAPMONSTER) && pduel->game_field->get_useable_count(1 - current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_CONTROL) <= 0)
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_CONTROL)) if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_CONTROL))
return FALSE; return FALSE;
......
...@@ -391,13 +391,16 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui ...@@ -391,13 +391,16 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
if (location != LOCATION_MZONE && location != LOCATION_SZONE) if (location != LOCATION_MZONE && location != LOCATION_SZONE)
return 0; return 0;
uint32 flag = player[playerid].disabled_location | player[playerid].used_location; uint32 flag = player[playerid].disabled_location | player[playerid].used_location;
uint32 used_flag = player[playerid].used_location;
effect_set eset; effect_set eset;
if (location == LOCATION_MZONE) { if (location == LOCATION_MZONE) {
flag = (flag & 0x1f); flag = (flag & 0x1f);
used_flag = (used_flag & 0x1f);
if(uplayer < 2) if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_MZONE, &eset); filter_player_effect(playerid, EFFECT_MAX_MZONE, &eset);
} else { } else {
flag = (flag & 0x1f00) >> 8; flag = (flag & 0x1f00) >> 8;
used_flag = (used_flag & 0x1f00) >> 8;
if(uplayer < 2) if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_SZONE, &eset); filter_player_effect(playerid, EFFECT_MAX_SZONE, &eset);
} }
...@@ -405,11 +408,12 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui ...@@ -405,11 +408,12 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
*list = flag; *list = flag;
if(eset.count) { if(eset.count) {
int32 max = 5; int32 max = 5;
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
pduel->lua->add_param(uplayer, PARAM_TYPE_INT); pduel->lua->add_param(uplayer, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT); pduel->lua->add_param(reason, PARAM_TYPE_INT);
max = eset.get_last()->get_value(2); max = eset.get_last()->get_value(3);
int32 block = 5 - field_used_count[flag]; int32 block = 5 - field_used_count[flag];
int32 limit = max - field_used_count[player[playerid].used_location]; int32 limit = max - field_used_count[used_flag];
return block < limit ? block : limit; return block < limit ? block : limit;
} else { } else {
return 5 - field_used_count[flag]; return 5 - field_used_count[flag];
......
...@@ -1466,6 +1466,7 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) { ...@@ -1466,6 +1466,7 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
int32 countertype = lua_tointeger(L, 2); int32 countertype = lua_tointeger(L, 2);
effect* peffect = pcard->pduel->new_effect(); effect* peffect = pcard->pduel->new_effect();
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE; peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_COUNTER_PERMIT | countertype; peffect->code = EFFECT_COUNTER_PERMIT | countertype;
peffect->flag = EFFECT_FLAG_SINGLE_RANGE; peffect->flag = EFFECT_FLAG_SINGLE_RANGE;
...@@ -1482,6 +1483,7 @@ int32 scriptlib::card_set_counter_limit(lua_State *L) { ...@@ -1482,6 +1483,7 @@ int32 scriptlib::card_set_counter_limit(lua_State *L) {
int32 countertype = lua_tointeger(L, 2); int32 countertype = lua_tointeger(L, 2);
int32 limit = lua_tointeger(L, 3); int32 limit = lua_tointeger(L, 3);
effect* peffect = pcard->pduel->new_effect(); effect* peffect = pcard->pduel->new_effect();
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE; peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_COUNTER_LIMIT | countertype; peffect->code = EFFECT_COUNTER_LIMIT | countertype;
peffect->value = limit; peffect->value = limit;
......
...@@ -764,9 +764,9 @@ int32 field::get_control(uint16 step, effect * reason_effect, uint8 reason_playe ...@@ -764,9 +764,9 @@ int32 field::get_control(uint16 step, effect * reason_effect, uint8 reason_playe
return TRUE; return TRUE;
if(pcard->current.location != LOCATION_MZONE) if(pcard->current.location != LOCATION_MZONE)
return TRUE; return TRUE;
if(get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_CONTROL) == 0) if(get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_CONTROL) <= 0)
return TRUE; return TRUE;
if(pcard->data.type & TYPE_TRAPMONSTER && get_useable_count(playerid, LOCATION_SZONE, playerid, LOCATION_REASON_CONTROL) == 0) if(pcard->data.type & TYPE_TRAPMONSTER && get_useable_count(playerid, LOCATION_SZONE, playerid, LOCATION_REASON_CONTROL) <= 0)
return TRUE; return TRUE;
if(!pcard->is_capable_change_control()) if(!pcard->is_capable_change_control())
return TRUE; return TRUE;
...@@ -875,7 +875,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card* equip_card, card* targ ...@@ -875,7 +875,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card* equip_card, card* targ
change_position(equip_card, 0, equip_player, POS_FACEUP, 0); change_position(equip_card, 0, equip_player, POS_FACEUP, 0);
return FALSE; return FALSE;
} }
if(get_useable_count(equip_player, LOCATION_SZONE, equip_player, LOCATION_REASON_TOFIELD) == 0) if(get_useable_count(equip_player, LOCATION_SZONE, equip_player, LOCATION_REASON_TOFIELD) <= 0)
return TRUE; return TRUE;
equip_card->enable_field_effect(FALSE); equip_card->enable_field_effect(FALSE);
move_to_field(equip_card, equip_player, equip_player, LOCATION_SZONE, (up || equip_card->is_position(POS_FACEUP)) ? POS_FACEUP : POS_FACEDOWN); move_to_field(equip_card, equip_player, equip_player, LOCATION_SZONE, (up || equip_card->is_position(POS_FACEUP)) ? POS_FACEUP : POS_FACEDOWN);
...@@ -990,9 +990,9 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -990,9 +990,9 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
return FALSE; return FALSE;
} }
core.select_cards.clear(); core.select_cards.clear();
uint32 required = target->get_summon_tribute_count(); int32 required = target->get_summon_tribute_count();
uint32 min = required & 0xffff; int32 min = required & 0xffff;
uint32 max = required >> 16; int32 max = required >> 16;
uint32 adv = is_player_can_summon(SUMMON_TYPE_ADVANCE, sumplayer, target); uint32 adv = is_player_can_summon(SUMMON_TYPE_ADVANCE, sumplayer, target);
if(max == 0 || !adv) { if(max == 0 || !adv) {
returns.bvalue[0] = 0; returns.bvalue[0] = 0;
...@@ -1372,9 +1372,9 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1372,9 +1372,9 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
return FALSE; return FALSE;
} }
core.select_cards.clear(); core.select_cards.clear();
uint32 required = target->get_set_tribute_count(); int32 required = target->get_set_tribute_count();
uint32 min = required & 0xffff; int32 min = required & 0xffff;
uint32 max = required >> 16; int32 max = required >> 16;
uint32 adv = is_player_can_mset(SUMMON_TYPE_ADVANCE, setplayer, target); uint32 adv = is_player_can_mset(SUMMON_TYPE_ADVANCE, setplayer, target);
if(max == 0 || !adv) if(max == 0 || !adv)
returns.bvalue[0] = 0; returns.bvalue[0] = 0;
...@@ -1435,6 +1435,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1435,6 +1435,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
return FALSE; return FALSE;
} }
case 5: { case 5: {
core.temp_var[0] = 0;
if(!ignore_count) { if(!ignore_count) {
returns.ivalue[0] = FALSE; returns.ivalue[0] = FALSE;
effect* pextra = core.extra_summon[setplayer] ? 0 : target->is_affected_by_effect(EFFECT_EXTRA_SET_COUNT); effect* pextra = core.extra_summon[setplayer] ? 0 : target->is_affected_by_effect(EFFECT_EXTRA_SET_COUNT);
...@@ -1505,7 +1506,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1505,7 +1506,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
switch(step) { switch(step) {
case 0: { case 0: {
if(!(target->data.type & TYPE_FIELD) && get_useable_count(toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) == 0) if(!(target->data.type & TYPE_FIELD) && get_useable_count(toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) <= 0)
return TRUE; return TRUE;
if(target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET)) if(target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET))
return TRUE; return TRUE;
...@@ -1738,7 +1739,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) { ...@@ -1738,7 +1739,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
if(!result || (target->current.location == LOCATION_MZONE) if(!result || (target->current.location == LOCATION_MZONE)
|| !is_player_can_spsummon(core.reason_effect, target->summon_type, positions, target->summon_player, playerid, target) || !is_player_can_spsummon(core.reason_effect, target->summon_type, positions, target->summon_player, playerid, target)
|| target->is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON) || target->is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON)
|| get_useable_count(playerid, LOCATION_MZONE, target->summon_player, LOCATION_REASON_TOFIELD) == 0 || get_useable_count(playerid, LOCATION_MZONE, target->summon_player, LOCATION_REASON_TOFIELD) <= 0
|| (!nocheck && !(target->data.type & TYPE_MONSTER))) || (!nocheck && !(target->data.type & TYPE_MONSTER)))
result = FALSE; result = FALSE;
if(result && !nocheck) { if(result && !nocheck) {
...@@ -2653,7 +2654,7 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret ...@@ -2653,7 +2654,7 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
if(!(location == LOCATION_SZONE && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL))) { if(!(location == LOCATION_SZONE && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL))) {
uint32 flag; uint32 flag;
uint32 ct = get_useable_count(playerid, location, move_player, LOCATION_REASON_TOFIELD, &flag); uint32 ct = get_useable_count(playerid, location, move_player, LOCATION_REASON_TOFIELD, &flag);
if(ret && (ct == 0 || !(target->data.type & TYPE_MONSTER))) { if(ret && (ct <= 0 || !(target->data.type & TYPE_MONSTER))) {
send_to(target, core.reason_effect, REASON_EFFECT, core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, 0); send_to(target, core.reason_effect, REASON_EFFECT, core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, 0);
return TRUE; return TRUE;
} }
...@@ -3246,7 +3247,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in ...@@ -3246,7 +3247,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field, uint8 cancelable, int32 min, int32 max) { int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field, uint8 cancelable, int32 min, int32 max) {
switch(step) { switch(step) {
case 0: { case 0: {
if(core.release_cards_ex.size() == 0 || (check_field && get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD) == 0)) { if(core.release_cards_ex.size() == 0 || (check_field && get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD) <= 0)) {
core.select_cards.clear(); core.select_cards.clear();
for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit) for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit)
core.select_cards.push_back(*cit); core.select_cards.push_back(*cit);
...@@ -3313,7 +3314,7 @@ int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field, ...@@ -3313,7 +3314,7 @@ int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field,
int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable, int32 min, int32 max) { int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable, int32 min, int32 max) {
switch(step) { switch(step) {
case 0: { case 0: {
if(core.release_cards_ex.size() == 0 || (get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD) == 0 && min < 2)) { if(core.release_cards_ex.size() == 0 || (get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_TOFIELD) <= 0 && min < 2)) {
core.select_cards.clear(); core.select_cards.clear();
for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit) for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit)
core.select_cards.push_back(*cit); core.select_cards.push_back(*cit);
......
...@@ -60,7 +60,7 @@ function c10000000.initial_effect(c) ...@@ -60,7 +60,7 @@ function c10000000.initial_effect(c)
end end
function c10000000.ttcon(e,c) function c10000000.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000000.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000000.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -60,7 +60,7 @@ function c10000001.initial_effect(c) ...@@ -60,7 +60,7 @@ function c10000001.initial_effect(c)
end end
function c10000001.ttcon(e,c) function c10000001.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000001.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000001.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -55,7 +55,7 @@ function c10000010.initial_effect(c) ...@@ -55,7 +55,7 @@ function c10000010.initial_effect(c)
end end
function c10000010.ttcon(e,c) function c10000010.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000010.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000010.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -55,7 +55,7 @@ function c10000011.initial_effect(c) ...@@ -55,7 +55,7 @@ function c10000011.initial_effect(c)
end end
function c10000011.ttcon(e,c) function c10000011.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000011.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000011.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -67,7 +67,7 @@ function c10000020.initial_effect(c) ...@@ -67,7 +67,7 @@ function c10000020.initial_effect(c)
end end
function c10000020.ttcon(e,c) function c10000020.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000020.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000020.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -67,7 +67,7 @@ function c10000021.initial_effect(c) ...@@ -67,7 +67,7 @@ function c10000021.initial_effect(c)
end end
function c10000021.ttcon(e,c) function c10000021.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c10000021.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c10000021.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -29,7 +29,8 @@ end ...@@ -29,7 +29,8 @@ end
function c10000040.spcon(e,c) function c10000040.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000000) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000000)
and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000010) and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000010)
and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000020) and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000020)
end end
......
...@@ -36,7 +36,8 @@ function c102380.initial_effect(c) ...@@ -36,7 +36,8 @@ function c102380.initial_effect(c)
end end
function c102380.spcon(e,c) function c102380.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,2,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,2,nil)
end end
function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c) function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......
...@@ -48,7 +48,8 @@ function c11224103.spfilter(c,e,tp) ...@@ -48,7 +48,8 @@ function c11224103.spfilter(c,e,tp)
return c:IsCode(48229808) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(48229808) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c11224103.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c11224103.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11224103.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c11224103.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c11224103.spop(e,tp,eg,ep,ev,re,r,rp) function c11224103.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -49,7 +49,8 @@ function c12817939.spfilter(c,e,tp) ...@@ -49,7 +49,8 @@ function c12817939.spfilter(c,e,tp)
return c:IsCode(58206034) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(58206034) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c12817939.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c12817939.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12817939.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c12817939.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c12817939.spop(e,tp,eg,ep,ev,re,r,rp) function c12817939.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -26,7 +26,8 @@ function c13361027.filter(c,e,sp) ...@@ -26,7 +26,8 @@ function c13361027.filter(c,e,sp)
end end
function c13361027.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c13361027.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c13361027.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c13361027.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c13361027.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c13361027.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c13361027.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c13361027.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
...@@ -29,7 +29,8 @@ end ...@@ -29,7 +29,8 @@ end
function c14466224.spcon(e,c) function c14466224.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,nil) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,2,nil)
and Duel.IsExistingMatchingCard(c14466224.gfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c14466224.gfilter,tp,LOCATION_GRAVE,0,1,nil)
end end
function c14466224.spop(e,tp,eg,ep,ev,re,r,rp,c) function c14466224.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -17,16 +17,17 @@ function c14785765.costfilter(c) ...@@ -17,16 +17,17 @@ function c14785765.costfilter(c)
return c:IsFaceup() and c:IsAbleToHandAsCost() return c:IsFaceup() and c:IsAbleToHandAsCost()
end end
function c14785765.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c14785765.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then if chk==0 then
if not c14785765[tp] then return false end if not c14785765[tp] or ft<0 then return false end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then if ft==0 then
return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_MZONE,0,1,nil)
else else
return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then if ft==0 then
local g=Duel.SelectMatchingCard(tp,c14785765.costfilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c14785765.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST) Duel.SendtoHand(g,nil,REASON_COST)
else else
......
...@@ -22,8 +22,9 @@ function c16984449.filter(c,e,sp) ...@@ -22,8 +22,9 @@ function c16984449.filter(c,e,sp)
return c:IsType(TYPE_DUAL) and c:GetCode()~=16984449 and c:IsCanBeSpecialSummoned(e,0,sp,false,false) return c:IsType(TYPE_DUAL) and c:GetCode()~=16984449 and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end end
function c16984449.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c16984449.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and c16984449.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c16984449.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c16984449.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c16984449.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c16984449.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c16984449.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
...@@ -32,7 +32,7 @@ function c17132130.spcon(e,c) ...@@ -32,7 +32,7 @@ function c17132130.spcon(e,c)
local g=Duel.GetReleaseGroup(c:GetControler()) local g=Duel.GetReleaseGroup(c:GetControler())
local d=g:FilterCount(Card.IsSetCard,nil,0xc008) local d=g:FilterCount(Card.IsSetCard,nil,0xc008)
local ct=g:GetCount() local ct=g:GetCount()
return d>0 and ct>2 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and d>0 and ct>2
end end
function c17132130.spop(e,tp,eg,ep,ev,re,r,rp,c) function c17132130.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(c:GetControler()) local g=Duel.GetReleaseGroup(c:GetControler())
......
...@@ -41,7 +41,8 @@ function c1995985.spfilter(c,e,tp) ...@@ -41,7 +41,8 @@ function c1995985.spfilter(c,e,tp)
return c:IsCode(74388798) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(74388798) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c1995985.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c1995985.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1995985.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c1995985.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c1995985.spop(e,tp,eg,ep,ev,re,r,rp) function c1995985.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -19,7 +19,8 @@ function c20638610.spfilter(c,e,tp) ...@@ -19,7 +19,8 @@ function c20638610.spfilter(c,e,tp)
end end
function c20638610.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c20638610.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c20638610.rmfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c20638610.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20638610.rmfilter,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c20638610.rmfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c20638610.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c20638610.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c20638610.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c20638610.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
......
--宇宙の収縮
function c20644748.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c20644748.condition)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
c:RegisterEffect(e1)
--adjust
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c20644748.adjustop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_MAX_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(c20644748.mvalue)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EFFECT_MAX_SZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetValue(c20644748.svalue)
c:RegisterEffect(e4)
end
function c20644748.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)<=5
and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)<=5
end
function c20644748.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
local c1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local c2=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if c1>5 or c2>5 then
local g=Group.CreateGroup()
if c1>5 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,c1-5,c1-5,nil)
g:Merge(g1)
end
if c2>5 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_ONFIELD,0,c2-5,c2-5,nil)
g:Merge(g2)
end
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Readjust()
end
end
function c20644748.mvalue(e,fp,rp,r)
return 5-Duel.GetFieldGroupCount(fp,LOCATION_SZONE,0)
end
function c20644748.svalue(e,fp,rp,r)
return 5-Duel.GetFieldGroupCount(fp,LOCATION_MZONE,0)
end
...@@ -32,7 +32,8 @@ function c20663556.filter(c,e,tp) ...@@ -32,7 +32,8 @@ function c20663556.filter(c,e,tp)
return c:IsSetCard(0x12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c20663556.target(e,tp,eg,ep,ev,re,r,rp,chk) function c20663556.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20663556.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c20663556.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c20663556.operation(e,tp,eg,ep,ev,re,r,rp) function c20663556.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -64,7 +64,8 @@ function c2067935.filter(c,e,tp) ...@@ -64,7 +64,8 @@ function c2067935.filter(c,e,tp)
return not c:IsCode(2067935) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,112,tp,false,false) return not c:IsCode(2067935) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,112,tp,false,false)
end end
function c2067935.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c2067935.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c2067935.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c2067935.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c2067935.spop(e,tp,eg,ep,ev,re,r,rp) function c2067935.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -19,7 +19,8 @@ function c21143940.filter(c,e,tp) ...@@ -19,7 +19,8 @@ function c21143940.filter(c,e,tp)
end end
function c21143940.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21143940.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c21143940.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c21143940.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c21143940.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c21143940.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c21143940.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c21143940.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
......
...@@ -39,7 +39,7 @@ function c21208154.initial_effect(c) ...@@ -39,7 +39,7 @@ function c21208154.initial_effect(c)
end end
function c21208154.ttcon(e,c) function c21208154.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c21208154.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c21208154.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -23,7 +23,8 @@ function c23408872.filter(c,e,tp) ...@@ -23,7 +23,8 @@ function c23408872.filter(c,e,tp)
end end
function c23408872.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c23408872.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c23408872.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c23408872.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c23408872.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c23408872.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c23408872.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c23408872.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
...@@ -106,7 +106,8 @@ function c23756165.spfilter(c,e,tp) ...@@ -106,7 +106,8 @@ function c23756165.spfilter(c,e,tp)
return c:IsCode(50140163) and c:IsCanBeSpecialSummoned(e,1,tp,true,false) return c:IsCode(50140163) and c:IsCanBeSpecialSummoned(e,1,tp,true,false)
end end
function c23756165.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c23756165.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23756165.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c23756165.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c23756165.spop(e,tp,eg,ep,ev,re,r,rp) function c23756165.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -31,7 +31,7 @@ function c25290459.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,7 +31,7 @@ function c25290459.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(g:GetFirst():GetCode()) e:SetLabel(g:GetFirst():GetCode())
end end
function c25290459.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25290459.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c25290459.activate(e,tp,eg,ep,ev,re,r,rp) function c25290459.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -31,7 +31,7 @@ function c25573054.filter(c,e,tp) ...@@ -31,7 +31,7 @@ function c25573054.filter(c,e,tp)
return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c25573054.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25573054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND)
end end
......
...@@ -80,6 +80,7 @@ function c25862681.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,6 +80,7 @@ function c25862681.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=fg:Select(tp,1,1,nil) local sg=fg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end end
end end
end end
......
...@@ -29,7 +29,6 @@ function c25924653.initial_effect(c) ...@@ -29,7 +29,6 @@ function c25924653.initial_effect(c)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c25924653.leave) e3:SetOperation(c25924653.leave)
c:RegisterEffect(e3) c:RegisterEffect(e3)
e1:SetLabelObject(e3)
end end
function c25924653.spgcon(e,tp,eg,ep,ev,re,r,rp) function c25924653.spgcon(e,tp,eg,ep,ev,re,r,rp)
local st=e:GetHandler():GetSummonType() local st=e:GetHandler():GetSummonType()
...@@ -39,9 +38,9 @@ function c25924653.spgfilter(c,e,tp) ...@@ -39,9 +38,9 @@ function c25924653.spgfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,104,tp,false,false) return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,104,tp,false,false)
end end
function c25924653.spgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c25924653.spgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and c25924653.spgfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c25924653.spgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end and Duel.IsExistingTarget(c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
...@@ -52,26 +51,34 @@ function c25924653.spgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,26 +51,34 @@ function c25924653.spgop(e,tp,eg,ep,ev,re,r,rp)
if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,104,tp,tp,false,false,POS_FACEUP)>0 if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,104,tp,tp,false,false,POS_FACEUP)>0
and c:IsFaceup() and c:IsRelateToEffect(e) then and c:IsFaceup() and c:IsRelateToEffect(e) then
c:SetCardTarget(tc) c:SetCardTarget(tc)
e:GetLabelObject():SetLabelObject(tc) tc:RegisterFlagEffect(25924653,RESET_EVENT+0x13e0000,0,1)
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x13e0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCondition(c25924653.discon) e1:SetCondition(c25924653.discon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c25924653.disop)
c:RegisterEffect(e2)
end end
end end
function c25924653.discon(e) function c25924653.discon(e)
local o=e:GetOwner() return e:GetOwner():IsHasCardTarget(e:GetHandler())
local c=e:GetHandler() end
return not o:IsDisabled() and o:IsRelateToCard(c) function c25924653.disop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():GetFlagEffect(25924653)~=0 then
Duel.NegateEffect(ev)
end
end end
function c25924653.leave(e,tp,eg,ep,ev,re,r,rp) function c25924653.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=e:GetLabelObject() local tc=c:GetFirstCardTarget()
if tc and tc:IsRelateToCard(c) then if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end end
end end
...@@ -87,7 +94,8 @@ function c25924653.filter(c,e,tp) ...@@ -87,7 +94,8 @@ function c25924653.filter(c,e,tp)
return not c:IsCode(25924653) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,104,tp,false,false) return not c:IsCode(25924653) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,104,tp,false,false)
end end
function c25924653.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c25924653.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25924653.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c25924653.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c25924653.spop(e,tp,eg,ep,ev,re,r,rp) function c25924653.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -58,7 +58,8 @@ function c2619149.filter(c,e,tp) ...@@ -58,7 +58,8 @@ function c2619149.filter(c,e,tp)
return not c:IsCode(2619149) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,108,tp,false,false) return not c:IsCode(2619149) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,108,tp,false,false)
end end
function c2619149.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c2619149.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c2619149.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c2619149.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c2619149.spop(e,tp,eg,ep,ev,re,r,rp) function c2619149.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -24,8 +24,8 @@ function c27178262.filter(c,e,tp) ...@@ -24,8 +24,8 @@ function c27178262.filter(c,e,tp)
return c:IsSetCard(0x3d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x3d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c27178262.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c27178262.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp and c27178262.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c27178262.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c27178262.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c27178262.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c27178262.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c27178262.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -13,11 +13,10 @@ function c27243130.initial_effect(c) ...@@ -13,11 +13,10 @@ function c27243130.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c27243130.condition(e,tp,eg,ep,ev,re,r,rp) function c27243130.condition(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_DAMAGE and Duel.IsDamageCalculated() then return false end return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
return true
end end
function c27243130.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c27243130.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
...@@ -50,7 +50,8 @@ end ...@@ -50,7 +50,8 @@ end
function c27346636.sprcon(e,c) function c27346636.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c27346636.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c27346636.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp)
end end
function c27346636.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c27346636.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27346636,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27346636,2))
......
...@@ -35,7 +35,8 @@ function c31247589.filter(c,e,tp) ...@@ -35,7 +35,8 @@ function c31247589.filter(c,e,tp)
return not c:IsCode(31247589) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,107,tp,false,false) return not c:IsCode(31247589) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,107,tp,false,false)
end end
function c31247589.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c31247589.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31247589.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c31247589.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end end
function c31247589.spop(e,tp,eg,ep,ev,re,r,rp) function c31247589.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -33,7 +33,8 @@ function c31516413.initial_effect(c) ...@@ -33,7 +33,8 @@ function c31516413.initial_effect(c)
end end
function c31516413.hspcon(e,c) function c31516413.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsSetCard,1,nil,0x69) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsSetCard,1,nil,0x69)
end end
function c31516413.hspop(e,tp,eg,ep,ev,re,r,rp,c) function c31516413.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69) local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
......
...@@ -20,7 +20,8 @@ end ...@@ -20,7 +20,8 @@ end
function c31764353.spcon(e,c) function c31764353.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c31764353.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c31764353.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end end
function c31764353.spop(e,tp,eg,ep,ev,re,r,rp,c) function c31764353.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -20,7 +20,8 @@ end ...@@ -20,7 +20,8 @@ end
function c31887905.spcon(e,c) function c31887905.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c31887905.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c31887905.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end end
function c31887905.spop(e,tp,eg,ep,ev,re,r,rp,c) function c31887905.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -33,7 +33,8 @@ function c3300267.initial_effect(c) ...@@ -33,7 +33,8 @@ function c3300267.initial_effect(c)
end end
function c3300267.hspcon(e,c) function c3300267.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsSetCard,1,nil,0x69) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsSetCard,1,nil,0x69)
end end
function c3300267.hspop(e,tp,eg,ep,ev,re,r,rp,c) function c3300267.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69) local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
......
...@@ -40,7 +40,8 @@ function c34088136.spfilter(c,e,tp) ...@@ -40,7 +40,8 @@ function c34088136.spfilter(c,e,tp)
return c:IsCode(34830502) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(34830502) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c34088136.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c34088136.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34088136.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34088136.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c34088136.spop(e,tp,eg,ep,ev,re,r,rp) function c34088136.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -25,7 +25,8 @@ function c34230233.spfilter(c) ...@@ -25,7 +25,8 @@ function c34230233.spfilter(c)
end end
function c34230233.spcon(e,c) function c34230233.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c34230233.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34230233.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function c34230233.spop(e,tp,eg,ep,ev,re,r,rp,c) function c34230233.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
...@@ -19,7 +19,8 @@ function c34627841.filter(c,e,tp) ...@@ -19,7 +19,8 @@ function c34627841.filter(c,e,tp)
return c:GetCode()==89631139 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetCode()==89631139 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c34627841.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c34627841.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34627841.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34627841.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c34627841.spop(e,tp,eg,ep,ev,re,r,rp) function c34627841.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,7 +40,8 @@ function c34830502.spfilter(c,e,tp) ...@@ -40,7 +40,8 @@ function c34830502.spfilter(c,e,tp)
return c:IsCode(19877898) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(19877898) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c34830502.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c34830502.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34830502.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34830502.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c34830502.spop(e,tp,eg,ep,ev,re,r,rp) function c34830502.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -16,7 +16,7 @@ function c35059553.initial_effect(c) ...@@ -16,7 +16,7 @@ function c35059553.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
LOCATION_REASON_TOFIELD=1 LOCATION_REASON_TOFIELD=1
function c35059553.value(e,rp,r) function c35059553.value(e,fp,rp,r)
if rp==e:GetHandlerPlayer() or r~=LOCATION_REASON_TOFIELD then return 5 end if rp==e:GetHandlerPlayer() or r~=LOCATION_REASON_TOFIELD then return 5 end
local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0) local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)
return limit>0 and limit or 5 return limit>0 and limit or 5
......
...@@ -19,7 +19,8 @@ function c36262024.filter(c,e,tp) ...@@ -19,7 +19,8 @@ function c36262024.filter(c,e,tp)
return c:GetCode()==74677422 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetCode()==74677422 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c36262024.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c36262024.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36262024.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c36262024.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c36262024.spop(e,tp,eg,ep,ev,re,r,rp) function c36262024.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -30,7 +30,8 @@ end ...@@ -30,7 +30,8 @@ end
function c3825890.otcon(e,c) function c3825890.otcon(e,c)
if c==nil then return true end if c==nil then return true end
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(Card.IsSetCard,1,nil,0x2e) return c:GetLevel()>6 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and g:IsExists(Card.IsSetCard,1,nil,0x2e)
end end
function c3825890.otop(e,tp,eg,ep,ev,re,r,rp,c) function c3825890.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
......
...@@ -67,8 +67,8 @@ function c38369349.spcon(e,c) ...@@ -67,8 +67,8 @@ function c38369349.spcon(e,c)
local lv=c:GetLevel() local lv=c:GetLevel()
local tp=c:GetControler() local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil) elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end end
function c38369349.spop(e,tp,eg,ep,ev,re,r,rp,c) function c38369349.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel() local lv=c:GetLevel()
......
...@@ -56,7 +56,8 @@ function c41470137.filter(c,e,tp) ...@@ -56,7 +56,8 @@ function c41470137.filter(c,e,tp)
return not c:IsCode(41470137) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,102,tp,false,false) return not c:IsCode(41470137) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,102,tp,false,false)
end end
function c41470137.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c41470137.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41470137.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c41470137.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c41470137.spop(e,tp,eg,ep,ev,re,r,rp) function c41470137.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -35,7 +35,8 @@ function c4253484.filter(c,e,tp) ...@@ -35,7 +35,8 @@ function c4253484.filter(c,e,tp)
return not c:IsCode(4253484) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,101,tp,false,false) return not c:IsCode(4253484) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,101,tp,false,false)
end end
function c4253484.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c4253484.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4253484.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c4253484.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c4253484.spop(e,tp,eg,ep,ev,re,r,rp) function c4253484.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -50,7 +50,8 @@ function c42592719.filter(c,e,tp) ...@@ -50,7 +50,8 @@ function c42592719.filter(c,e,tp)
return not c:IsCode(42592719) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,111,tp,false,false) return not c:IsCode(42592719) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,111,tp,false,false)
end end
function c42592719.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c42592719.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42592719.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c42592719.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c42592719.spop(e,tp,eg,ep,ev,re,r,rp) function c42592719.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -44,7 +44,8 @@ end ...@@ -44,7 +44,8 @@ end
function c43378048.spcon(e,c) function c43378048.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,6007213) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,6007213)
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,32491822) and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,32491822)
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,69890967) and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,69890967)
end end
......
...@@ -19,7 +19,7 @@ function c43434803.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -19,7 +19,7 @@ function c43434803.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return Duel.IsExistingTarget(c43434803.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) return Duel.IsExistingTarget(c43434803.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c43434803.filter,1-tp,LOCATION_GRAVE,0,1,nil,e,1-tp) and Duel.IsExistingTarget(c43434803.filter,1-tp,LOCATION_GRAVE,0,1,nil,e,1-tp)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE,1-tp)>0
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectTarget(tp,c43434803.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local sg=Duel.SelectTarget(tp,c43434803.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -20,7 +20,8 @@ end ...@@ -20,7 +20,8 @@ end
function c4376658.spcon(e,c) function c4376658.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c4376658.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c4376658.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end end
function c4376658.spop(e,tp,eg,ep,ev,re,r,rp,c) function c4376658.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -79,7 +79,8 @@ function c46384672.spfilter(c,e,tp) ...@@ -79,7 +79,8 @@ function c46384672.spfilter(c,e,tp)
return c:IsCode(73879377) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(73879377) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c46384672.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c46384672.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c46384672.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c46384672.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c46384672.spop(e,tp,eg,ep,ev,re,r,rp) function c46384672.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -59,7 +59,8 @@ function c47507260.spfilter(c,e,tp) ...@@ -59,7 +59,8 @@ function c47507260.spfilter(c,e,tp)
return c:IsCode(74591968) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(74591968) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c47507260.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c47507260.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c47507260.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c47507260.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c47507260.spop(e,tp,eg,ep,ev,re,r,rp) function c47507260.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -58,7 +58,8 @@ end ...@@ -58,7 +58,8 @@ end
function c48156348.sprcon(e,c) function c48156348.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c48156348.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c48156348.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp)
end end
function c48156348.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c48156348.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48156348,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48156348,2))
......
...@@ -58,7 +58,8 @@ function c48964966.filter2(c,e,sp) ...@@ -58,7 +58,8 @@ function c48964966.filter2(c,e,sp)
end end
function c48964966.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c48964966.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c48964966.filter2(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c48964966.filter2(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c48964966.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c48964966.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c48964966.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c48964966.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
...@@ -23,7 +23,7 @@ function c49080532.filter(c,e,tp) ...@@ -23,7 +23,7 @@ function c49080532.filter(c,e,tp)
return c:GetCode()==49080532 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetCode()==49080532 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c49080532.target(e,tp,eg,ep,ev,re,r,rp,chk) function c49080532.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c49080532.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c49080532.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
......
...@@ -37,7 +37,8 @@ function c49441499.spfilter(c,e,tp) ...@@ -37,7 +37,8 @@ function c49441499.spfilter(c,e,tp)
return c:IsCode(34088136) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(34088136) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c49441499.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c49441499.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49441499.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c49441499.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c49441499.spop(e,tp,eg,ep,ev,re,r,rp) function c49441499.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -15,7 +15,8 @@ function c49674183.spfilter(c) ...@@ -15,7 +15,8 @@ function c49674183.spfilter(c)
end end
function c49674183.spcon(e,c) function c49674183.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c49674183.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c49674183.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function c49674183.spop(e,tp,eg,ep,ev,re,r,rp,c) function c49674183.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
...@@ -51,7 +51,8 @@ function c50088247.filter(c,e,tp) ...@@ -51,7 +51,8 @@ function c50088247.filter(c,e,tp)
end end
function c50088247.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c50088247.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c50088247.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c50088247.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c50088247.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c50088247.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c50088247.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c50088247.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
......
...@@ -35,7 +35,8 @@ function c50893987.scfilter(c) ...@@ -35,7 +35,8 @@ function c50893987.scfilter(c)
return c:IsSetCard(0x19) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x19) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c50893987.sctg(e,tp,eg,ep,ev,re,r,rp,chk) function c50893987.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c50893987.scfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c50893987.scfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c50893987.scop(e,tp,eg,ep,ev,re,r,rp) function c50893987.scop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -24,7 +24,8 @@ end ...@@ -24,7 +24,8 @@ end
function c5186893.otcon(e,c) function c5186893.otcon(e,c)
if c==nil then return true end if c==nil then return true end
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) return c:GetLevel()>6 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE)
end end
function c5186893.otop(e,tp,eg,ep,ev,re,r,rp,c) function c5186893.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
......
...@@ -67,8 +67,8 @@ function c53183600.spcon(e,c) ...@@ -67,8 +67,8 @@ function c53183600.spcon(e,c)
local lv=c:GetLevel() local lv=c:GetLevel()
local tp=c:GetControler() local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil) elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end end
function c53183600.spop(e,tp,eg,ep,ev,re,r,rp,c) function c53183600.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel() local lv=c:GetLevel()
......
...@@ -9,6 +9,7 @@ function c53334471.initial_effect(c) ...@@ -9,6 +9,7 @@ function c53334471.initial_effect(c)
--adjust --adjust
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST) e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c53334471.adjustop) e2:SetOperation(c53334471.adjustop)
...@@ -16,6 +17,7 @@ function c53334471.initial_effect(c) ...@@ -16,6 +17,7 @@ function c53334471.initial_effect(c)
--adjust --adjust
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c53334471.adjustop2) e3:SetOperation(c53334471.adjustop2)
...@@ -75,17 +77,23 @@ function c53334471.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,17 +77,23 @@ function c53334471.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if g1:GetCount()==0 then c53334471[tp]=0 if g1:GetCount()==0 then c53334471[tp]=0
else else
if c53334471[tp]==0 then c53334471[tp]=Duel.AnnounceAttribute(tp,1,c53334471.getattribute(g1)) end if c53334471[tp]==0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53334471,0))
c53334471[tp]=Duel.AnnounceAttribute(tp,1,c53334471.getattribute(g1))
end
g1:Remove(c53334471.rmfilter,nil,c53334471[tp]) g1:Remove(c53334471.rmfilter,nil,c53334471[tp])
end end
if g2:GetCount()==0 then c53334471[1-tp]=0 if g2:GetCount()==0 then c53334471[1-tp]=0
else else
if c53334471[1-tp]==0 then c53334471[1-tp]=Duel.AnnounceAttribute(1-tp,1,c53334471.getattribute(g2)) end if c53334471[1-tp]==0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53334471,0))
c53334471[1-tp]=Duel.AnnounceAttribute(1-tp,1,c53334471.getattribute(g2))
end
g2:Remove(c53334471.rmfilter,nil,c53334471[1-tp]) g2:Remove(c53334471.rmfilter,nil,c53334471[1-tp])
end end
g1:Merge(g2) g1:Merge(g2)
if g1:GetCount()>0 then if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_RULE) Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.Readjust() Duel.Readjust()
end end
end end
......
...@@ -21,10 +21,10 @@ function c5338223.spfilter(c,e,tp) ...@@ -21,10 +21,10 @@ function c5338223.spfilter(c,e,tp)
end end
function c5338223.target(e,tp,eg,ep,ev,re,r,rp,chk) function c5338223.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=(e:GetLabel()==1) local chkf=(e:GetLabel()==1) and 0 or -1
e:SetLabel(0) e:SetLabel(0)
return Duel.IsExistingMatchingCard(c5338223.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) return Duel.IsExistingMatchingCard(c5338223.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and (chkf or Duel.GetLocationCount(tp,LOCATION_MZONE)>0) and Duel.GetLocationCount(tp,LOCATION_MZONE)>chkf
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetLabel(0) e:SetLabel(0)
......
...@@ -22,7 +22,8 @@ function c54913680.filter(c,e,tp) ...@@ -22,7 +22,8 @@ function c54913680.filter(c,e,tp)
return c:IsCode(63176202) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(63176202) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c54913680.target(e,tp,eg,ep,ev,re,r,rp,chk) function c54913680.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c54913680.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingTarget(c54913680.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_DECK)
end end
function c54913680.activate(e,tp,eg,ep,ev,re,r,rp) function c54913680.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -28,7 +28,9 @@ end ...@@ -28,7 +28,9 @@ end
function c55794644.hspcon(e,c) function c55794644.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=-1 then return false end
if ft<=0 then
return Duel.IsExistingMatchingCard(c55794644.spfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c55794644.spfilter,tp,LOCATION_MZONE,0,1,nil)
else return Duel.IsExistingMatchingCard(c55794644.spfilter,tp,0x16,0,1,nil) end else return Duel.IsExistingMatchingCard(c55794644.spfilter,tp,0x16,0,1,nil) end
end end
......
...@@ -56,7 +56,8 @@ function c57731460.filter(c,e,tp) ...@@ -56,7 +56,8 @@ function c57731460.filter(c,e,tp)
return not c:IsCode(57731460) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,103,tp,false,false) return not c:IsCode(57731460) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,103,tp,false,false)
end end
function c57731460.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c57731460.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c57731460.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c57731460.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c57731460.spop(e,tp,eg,ep,ev,re,r,rp) function c57731460.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -51,7 +51,7 @@ function c57793869.initial_effect(c) ...@@ -51,7 +51,7 @@ function c57793869.initial_effect(c)
end end
function c57793869.ttcon(e,c) function c57793869.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c57793869.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c57793869.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -28,7 +28,8 @@ function c5861892.initial_effect(c) ...@@ -28,7 +28,8 @@ function c5861892.initial_effect(c)
end end
function c5861892.spcon(e,c) function c5861892.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,nil)
end end
function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c) function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -34,7 +34,8 @@ c59464593.lvdncount=3 ...@@ -34,7 +34,8 @@ c59464593.lvdncount=3
c59464593.lvdn={73879377,46384672,980973} c59464593.lvdn={73879377,46384672,980973}
function c59464593.spcon(e,c) function c59464593.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,73879377) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,nil,73879377)
end end
function c59464593.spop(e,tp,eg,ep,ev,re,r,rp,c) function c59464593.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsCode,1,1,nil,73879377) local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsCode,1,1,nil,73879377)
......
...@@ -56,7 +56,8 @@ function c5975022.filter(c,e,tp) ...@@ -56,7 +56,8 @@ function c5975022.filter(c,e,tp)
return not c:IsCode(5975022) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,105,tp,false,false) return not c:IsCode(5975022) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,105,tp,false,false)
end end
function c5975022.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c5975022.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5975022.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c5975022.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c5975022.spop(e,tp,eg,ep,ev,re,r,rp) function c5975022.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -53,7 +53,8 @@ function c612115.filter(c,e,tp) ...@@ -53,7 +53,8 @@ function c612115.filter(c,e,tp)
return not c:IsCode(612115) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,109,tp,false,false) return not c:IsCode(612115) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,109,tp,false,false)
end end
function c612115.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c612115.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c612115.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c612115.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c612115.spop(e,tp,eg,ep,ev,re,r,rp) function c612115.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -34,7 +34,7 @@ function c62180201.initial_effect(c) ...@@ -34,7 +34,7 @@ function c62180201.initial_effect(c)
end end
function c62180201.ttcon(e,c) function c62180201.ttcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetTributeCount(c)>=3 return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end end
function c62180201.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c62180201.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3) local g=Duel.SelectTribute(tp,c,3,3)
......
...@@ -25,7 +25,7 @@ function c62560742.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -25,7 +25,7 @@ function c62560742.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end end
function c62560742.mgfilter(c,e,tp,sync) function c62560742.mgfilter(c,e,tp,sync)
return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE) return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE) or not c:IsType(TYPE_SYNCHRO)
or bit.band(c:GetReason(),0x80008)~=0x80008 or c:GetReasonCard()~=sync or bit.band(c:GetReason(),0x80008)~=0x80008 or c:GetReasonCard()~=sync
or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -45,7 +45,8 @@ function c63014935.initial_effect(c) ...@@ -45,7 +45,8 @@ function c63014935.initial_effect(c)
end end
function c63014935.spcon(e,c) function c63014935.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,1,nil) return Duel.GetLocationCount(1-c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,1,nil)
end end
function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c) function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......
...@@ -42,7 +42,8 @@ function c63259351.spfilter(c,lv,e,tp) ...@@ -42,7 +42,8 @@ function c63259351.spfilter(c,lv,e,tp)
return c:IsLevelBelow(lv) and c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(lv) and c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c63259351.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c63259351.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63259351.spfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetCounter(0x14),e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c63259351.spfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetCounter(0x14),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c63259351.spop(e,tp,eg,ep,ev,re,r,rp) function c63259351.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -47,7 +47,8 @@ end ...@@ -47,7 +47,8 @@ end
function c63487632.spcon(e,c) function c63487632.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c63487632.spfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c63487632.spfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c63487632.spop(e,tp,eg,ep,ev,re,r,rp,c) function c63487632.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
...@@ -23,7 +23,8 @@ function c64034255.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,7 +23,8 @@ function c64034255.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
function c64034255.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c64034255.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c64034255.spop(e,tp,eg,ep,ev,re,r,rp,c) function c64034255.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -67,8 +67,8 @@ function c65458948.spcon(e,c) ...@@ -67,8 +67,8 @@ function c65458948.spcon(e,c)
local lv=c:GetLevel() local lv=c:GetLevel()
local tp=c:GetControler() local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil) elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end end
function c65458948.spop(e,tp,eg,ep,ev,re,r,rp,c) function c65458948.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel() local lv=c:GetLevel()
......
...@@ -20,7 +20,8 @@ end ...@@ -20,7 +20,8 @@ end
function c68881649.spcon(e,c) function c68881649.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c68881649.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c68881649.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end end
function c68881649.spop(e,tp,eg,ep,ev,re,r,rp,c) function c68881649.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -28,7 +28,8 @@ function c69831560.initial_effect(c) ...@@ -28,7 +28,8 @@ function c69831560.initial_effect(c)
end end
function c69831560.spcon(e,c) function c69831560.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,nil)
end end
function c69831560.spop(e,tp,eg,ep,ev,re,r,rp,c) function c69831560.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -41,7 +41,8 @@ function c69890967.initial_effect(c) ...@@ -41,7 +41,8 @@ function c69890967.initial_effect(c)
end end
function c69890967.spcon(e,c) function c69890967.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsRace,3,nil,RACE_FIEND) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsRace,3,nil,RACE_FIEND)
end end
function c69890967.spop(e,tp,eg,ep,ev,re,r,rp,c) function c69890967.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsRace,3,3,nil,RACE_FIEND) local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsRace,3,3,nil,RACE_FIEND)
......
...@@ -25,9 +25,9 @@ function c70156997.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -25,9 +25,9 @@ function c70156997.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c70156997.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c70156997.filter(chkc,e,tp) end
if chk==0 then if chk==0 then
if e:GetLabel()==1 then if e:GetLabel()==1 then
local res=Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
e:SetLabel(0) e:SetLabel(0)
return res return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
else else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
......
...@@ -25,7 +25,8 @@ function c70861343.filter(c,lv,e,tp) ...@@ -25,7 +25,8 @@ function c70861343.filter(c,lv,e,tp)
return c:IsLevelBelow(lv) and c:IsRace(RACE_BEAST+RACE_WINDBEAST+RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(lv) and c:IsRace(RACE_BEAST+RACE_WINDBEAST+RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c70861343.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c70861343.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.CheckReleaseGroup(tp,c70861343.cfilter,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(tp,c70861343.cfilter,1,nil,e,tp) end
local rg=Duel.SelectReleaseGroup(tp,c70861343.cfilter,1,1,nil,e,tp) local rg=Duel.SelectReleaseGroup(tp,c70861343.cfilter,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel()+3) e:SetLabel(rg:GetFirst():GetLevel()+3)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
......
...@@ -56,7 +56,8 @@ end ...@@ -56,7 +56,8 @@ end
function c72258771.otcon(e,c) function c72258771.otcon(e,c)
if c==nil then return true end if c==nil then return true end
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(Card.IsSetCard,1,nil,0x1d) return c:GetLevel()>6 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and g:IsExists(Card.IsSetCard,1,nil,0x1d)
end end
function c72258771.otop(e,tp,eg,ep,ev,re,r,rp,c) function c72258771.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
......
...@@ -49,7 +49,8 @@ function c73665146.spfilter(c,e,tp) ...@@ -49,7 +49,8 @@ function c73665146.spfilter(c,e,tp)
return c:IsCode(72443568) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(72443568) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c73665146.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c73665146.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73665146.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c73665146.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c73665146.spop(e,tp,eg,ep,ev,re,r,rp) function c73665146.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -49,7 +49,8 @@ function c74388798.spfilter(c,e,tp) ...@@ -49,7 +49,8 @@ function c74388798.spfilter(c,e,tp)
return c:IsCode(37267041) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(37267041) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c74388798.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c74388798.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74388798.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c74388798.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c74388798.spop(e,tp,eg,ep,ev,re,r,rp) function c74388798.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -67,7 +67,8 @@ function c74591968.spfilter(c,e,tp) ...@@ -67,7 +67,8 @@ function c74591968.spfilter(c,e,tp)
return c:IsCode(60482781) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(60482781) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c74591968.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c74591968.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74591968.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c74591968.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c74591968.spop(e,tp,eg,ep,ev,re,r,rp) function c74591968.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -44,7 +44,8 @@ function c74713516.spfilter(c,e,tp) ...@@ -44,7 +44,8 @@ function c74713516.spfilter(c,e,tp)
return c:IsCode(1102515) and c:IsCanBeSpecialSummoned(e,1,tp,true,true) return c:IsCode(1102515) and c:IsCanBeSpecialSummoned(e,1,tp,true,true)
end end
function c74713516.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c74713516.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74713516.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c74713516.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c74713516.spop(e,tp,eg,ep,ev,re,r,rp) function c74713516.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -42,7 +42,8 @@ function c75830094.spfilter(c,e,tp) ...@@ -42,7 +42,8 @@ function c75830094.spfilter(c,e,tp)
return c:IsCode(11224103) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(11224103) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c75830094.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c75830094.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75830094.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c75830094.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c75830094.spop(e,tp,eg,ep,ev,re,r,rp) function c75830094.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -25,12 +25,12 @@ function c77642288.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,12 +25,12 @@ function c77642288.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end end
function c77642288.spop(e,tp,eg,ep,ev,re,r,rp) function c77642288.spop(e,tp,eg,ep,ev,re,r,rp)
local zc=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if zc==0 then return end if ft==0 then return end
if not Duel.IsExistingMatchingCard(c77642288.filter,tp,LOCATION_DECK,0,2,nil,e,tp) then return end if not Duel.IsExistingMatchingCard(c77642288.filter,tp,LOCATION_DECK,0,2,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c77642288.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c77642288.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if zc==1 then if ft==1 then
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst() local sc=sg:GetFirst()
g:RemoveCard(sc) g:RemoveCard(sc)
......
...@@ -35,7 +35,8 @@ function c78868776.filter(c,e,tp) ...@@ -35,7 +35,8 @@ function c78868776.filter(c,e,tp)
return not c:IsCode(78868776) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,100,tp,false,false) return not c:IsCode(78868776) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,100,tp,false,false)
end end
function c78868776.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c78868776.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78868776.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c78868776.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c78868776.spop(e,tp,eg,ep,ev,re,r,rp) function c78868776.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,7 +40,8 @@ end ...@@ -40,7 +40,8 @@ end
function c79229522.sprcon(e,c) function c79229522.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp)
end end
function c79229522.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c79229522.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79205581,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79205581,0))
......
...@@ -58,7 +58,8 @@ function c79580323.filter(c,e,tp) ...@@ -58,7 +58,8 @@ function c79580323.filter(c,e,tp)
return not c:IsCode(79580323) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,110,tp,false,false) return not c:IsCode(79580323) and c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,110,tp,false,false)
end end
function c79580323.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c79580323.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79580323.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c79580323.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c79580323.spop(e,tp,eg,ep,ev,re,r,rp) function c79580323.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -28,7 +28,8 @@ end ...@@ -28,7 +28,8 @@ end
function c81254059.otcon(e,c) function c81254059.otcon(e,c)
if c==nil then return true end if c==nil then return true end
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and g:IsExists(c81254059.cfilter,1,nil) return c:GetLevel()>6 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and g:IsExists(c81254059.cfilter,1,nil)
end end
function c81254059.otop(e,tp,eg,ep,ev,re,r,rp,c) function c81254059.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c) local g=Duel.GetTributeGroup(c)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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