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

fix

parent 6381de9d
......@@ -139,7 +139,7 @@ void Replay::SaveReplay(const wchar_t* name) {
fclose(fp);
}
bool Replay::OpenReplay(const wchar_t* name) {
wchar_t fname[64];
wchar_t fname[256];
myswprintf(fname, L"./replay/%ls", name);
#ifdef WIN32
fp = _wfopen(fname, L"rb");
......@@ -170,7 +170,7 @@ bool Replay::OpenReplay(const wchar_t* name) {
return true;
}
bool Replay::CheckReplay(const wchar_t* name) {
wchar_t fname[64];
wchar_t fname[256];
myswprintf(fname, L"./replay/%ls", name);
#ifdef WIN32
FILE* rfp = _wfopen(fname, L"rb");
......
......@@ -1236,7 +1236,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
peset->add_item(eset[i]);
if(!pduel->game_field->is_player_can_summon(SUMMON_TYPE_NORMAL, playerid, this))
return FALSE;
uint32 rcount = get_summon_tribute_count();
int32 rcount = get_summon_tribute_count();
int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff;
if(min > 0 && !pduel->game_field->is_player_can_summon(SUMMON_TYPE_ADVANCE, playerid, this))
return FALSE;
......@@ -1271,7 +1271,7 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
peset->add_item(eset[i]);
if(!pduel->game_field->is_player_can_mset(SUMMON_TYPE_NORMAL, playerid, this))
return FALSE;
uint32 rcount = get_set_tribute_count();
int32 rcount = get_set_tribute_count();
int32 min = rcount & 0xffff, max = (rcount >> 16) & 0xffff;
if(min > 0 && !pduel->game_field->is_player_can_mset(SUMMON_TYPE_ADVANCE, playerid, this))
return FALSE;
......@@ -1644,7 +1644,7 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
return TRUE;
}
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;
if(data.type & TYPE_MONSTER && !is_affected_by_effect(EFFECT_MONSTER_SSET))
return FALSE;
......@@ -1932,9 +1932,9 @@ int32 card::is_control_can_be_changed() {
return FALSE;
if(current.location != LOCATION_MZONE)
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;
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;
if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_CONTROL))
return FALSE;
......
......@@ -391,13 +391,16 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
if (location != LOCATION_MZONE && location != LOCATION_SZONE)
return 0;
uint32 flag = player[playerid].disabled_location | player[playerid].used_location;
uint32 used_flag = player[playerid].used_location;
effect_set eset;
if (location == LOCATION_MZONE) {
flag = (flag & 0x1f);
used_flag = (used_flag & 0x1f);
if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_MZONE, &eset);
} else {
flag = (flag & 0x1f00) >> 8;
used_flag = (used_flag & 0x1f00) >> 8;
if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_SZONE, &eset);
}
......@@ -405,11 +408,12 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
*list = flag;
if(eset.count) {
int32 max = 5;
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
pduel->lua->add_param(uplayer, 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 limit = max - field_used_count[player[playerid].used_location];
int32 limit = max - field_used_count[used_flag];
return block < limit ? block : limit;
} else {
return 5 - field_used_count[flag];
......
......@@ -1466,6 +1466,7 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1);
int32 countertype = lua_tointeger(L, 2);
effect* peffect = pcard->pduel->new_effect();
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_COUNTER_PERMIT | countertype;
peffect->flag = EFFECT_FLAG_SINGLE_RANGE;
......@@ -1482,6 +1483,7 @@ int32 scriptlib::card_set_counter_limit(lua_State *L) {
int32 countertype = lua_tointeger(L, 2);
int32 limit = lua_tointeger(L, 3);
effect* peffect = pcard->pduel->new_effect();
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_COUNTER_LIMIT | countertype;
peffect->value = limit;
......
......@@ -764,9 +764,9 @@ int32 field::get_control(uint16 step, effect * reason_effect, uint8 reason_playe
return TRUE;
if(pcard->current.location != LOCATION_MZONE)
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;
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;
if(!pcard->is_capable_change_control())
return TRUE;
......@@ -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);
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;
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);
......@@ -990,9 +990,9 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
return FALSE;
}
core.select_cards.clear();
uint32 required = target->get_summon_tribute_count();
uint32 min = required & 0xffff;
uint32 max = required >> 16;
int32 required = target->get_summon_tribute_count();
int32 min = required & 0xffff;
int32 max = required >> 16;
uint32 adv = is_player_can_summon(SUMMON_TYPE_ADVANCE, sumplayer, target);
if(max == 0 || !adv) {
returns.bvalue[0] = 0;
......@@ -1372,9 +1372,9 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
return FALSE;
}
core.select_cards.clear();
uint32 required = target->get_set_tribute_count();
uint32 min = required & 0xffff;
uint32 max = required >> 16;
int32 required = target->get_set_tribute_count();
int32 min = required & 0xffff;
int32 max = required >> 16;
uint32 adv = is_player_can_mset(SUMMON_TYPE_ADVANCE, setplayer, target);
if(max == 0 || !adv)
returns.bvalue[0] = 0;
......@@ -1435,6 +1435,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
return FALSE;
}
case 5: {
core.temp_var[0] = 0;
if(!ignore_count) {
returns.ivalue[0] = FALSE;
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
int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
switch(step) {
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;
if(target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET))
return TRUE;
......@@ -1738,7 +1739,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
if(!result || (target->current.location == LOCATION_MZONE)
|| !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)
|| 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)))
result = FALSE;
if(result && !nocheck) {
......@@ -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))) {
uint32 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);
return TRUE;
}
......@@ -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) {
switch(step) {
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();
for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit)
core.select_cards.push_back(*cit);
......@@ -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) {
switch(step) {
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();
for(auto cit = core.release_cards.begin(); cit != core.release_cards.end(); ++cit)
core.select_cards.push_back(*cit);
......
......@@ -60,7 +60,7 @@ function c10000000.initial_effect(c)
end
function c10000000.ttcon(e,c)
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
function c10000000.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -60,7 +60,7 @@ function c10000001.initial_effect(c)
end
function c10000001.ttcon(e,c)
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
function c10000001.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -55,7 +55,7 @@ function c10000010.initial_effect(c)
end
function c10000010.ttcon(e,c)
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
function c10000010.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -55,7 +55,7 @@ function c10000011.initial_effect(c)
end
function c10000011.ttcon(e,c)
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
function c10000011.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -67,7 +67,7 @@ function c10000020.initial_effect(c)
end
function c10000020.ttcon(e,c)
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
function c10000020.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -67,7 +67,7 @@ function c10000021.initial_effect(c)
end
function c10000021.ttcon(e,c)
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
function c10000021.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -29,7 +29,8 @@ end
function c10000040.spcon(e,c)
if c==nil then return true end
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,10000020)
end
......
......@@ -36,7 +36,8 @@ function c102380.initial_effect(c)
end
function c102380.spcon(e,c)
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
function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......
......@@ -48,7 +48,8 @@ function c11224103.spfilter(c,e,tp)
return c:IsCode(48229808) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c11224103.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -49,7 +49,8 @@ function c12817939.spfilter(c,e,tp)
return c:IsCode(58206034) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c12817939.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,7 +26,8 @@ function c13361027.filter(c,e,sp)
end
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 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)
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)
......
......@@ -29,7 +29,8 @@ end
function c14466224.spcon(e,c)
if c==nil then return true end
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)
end
function c14466224.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -17,16 +17,17 @@ function c14785765.costfilter(c)
return c:IsFaceup() and c:IsAbleToHandAsCost()
end
function c14785765.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if not c14785765[tp] then return false end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
if not c14785765[tp] or ft<0 then return false end
if ft==0 then
return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_MZONE,0,1,nil)
else
return Duel.IsExistingMatchingCard(c14785765.costfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
end
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)
Duel.SendtoHand(g,nil,REASON_COST)
else
......
......@@ -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)
end
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 chk==0 then return Duel.IsExistingTarget(c16984449.filter,tp,LOCATION_GRAVE,0,1,nil,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.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)
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)
......
......@@ -32,7 +32,7 @@ function c17132130.spcon(e,c)
local g=Duel.GetReleaseGroup(c:GetControler())
local d=g:FilterCount(Card.IsSetCard,nil,0xc008)
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
function c17132130.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(c:GetControler())
......
......@@ -41,7 +41,8 @@ function c1995985.spfilter(c,e,tp)
return c:IsCode(74388798) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c1995985.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -19,7 +19,8 @@ function c20638610.spfilter(c,e,tp)
end
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 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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
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)
return c:IsSetCard(0x12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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)
end
function c20663556.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -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)
end
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)
end
function c2067935.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -19,7 +19,8 @@ function c21143940.filter(c,e,tp)
end
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 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)
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)
......
......@@ -39,7 +39,7 @@ function c21208154.initial_effect(c)
end
function c21208154.ttcon(e,c)
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
function c21208154.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -23,7 +23,8 @@ function c23408872.filter(c,e,tp)
end
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 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)
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)
......
......@@ -106,7 +106,8 @@ function c23756165.spfilter(c,e,tp)
return c:IsCode(50140163) and c:IsCanBeSpecialSummoned(e,1,tp,true,false)
end
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)
end
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)
e:SetLabel(g:GetFirst():GetCode())
end
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)
end
function c25290459.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -31,7 +31,7 @@ function c25573054.filter(c,e,tp)
return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND)
end
......
......@@ -80,6 +80,7 @@ function c25862681.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=fg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
......
......@@ -29,7 +29,6 @@ function c25924653.initial_effect(c)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c25924653.leave)
c:RegisterEffect(e3)
e1:SetLabelObject(e3)
end
function c25924653.spgcon(e,tp,eg,ep,ev,re,r,rp)
local st=e:GetHandler():GetSummonType()
......@@ -39,9 +38,9 @@ function c25924653.spgfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,104,tp,false,false)
end
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 chk==0 then return Duel.IsExistingTarget(c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c25924653.spgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
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)
......@@ -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
and c:IsFaceup() and c:IsRelateToEffect(e) then
c:SetCardTarget(tc)
e:GetLabelObject():SetLabelObject(tc)
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
tc:RegisterFlagEffect(25924653,RESET_EVENT+0x13e0000,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x13e0000)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCondition(c25924653.discon)
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
function c25924653.discon(e)
local o=e:GetOwner()
local c=e:GetHandler()
return not o:IsDisabled() and o:IsRelateToCard(c)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
function c25924653.disop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():GetFlagEffect(25924653)~=0 then
Duel.NegateEffect(ev)
end
end
function c25924653.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc and tc:IsRelateToCard(c) then
local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
......@@ -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)
end
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)
end
function c25924653.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -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)
end
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)
end
function c2619149.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,8 +24,8 @@ function c27178262.filter(c,e,tp)
return c:IsSetCard(0x3d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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 chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
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)>-1
and Duel.IsExistingTarget(c27178262.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
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)
c:RegisterEffect(e1)
end
function c27243130.condition(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_DAMAGE and Duel.IsDamageCalculated() then return false end
return true
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -50,7 +50,8 @@ end
function c27346636.sprcon(e,c)
if c==nil then return true end
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
function c27346636.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27346636,2))
......
......@@ -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)
end
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)
end
function c31247589.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,7 +33,8 @@ function c31516413.initial_effect(c)
end
function c31516413.hspcon(e,c)
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
function c31516413.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
......
......@@ -20,7 +20,8 @@ end
function c31764353.spcon(e,c)
if c==nil then return true end
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
function c31764353.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -20,7 +20,8 @@ end
function c31887905.spcon(e,c)
if c==nil then return true end
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
function c31887905.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -33,7 +33,8 @@ function c3300267.initial_effect(c)
end
function c3300267.hspcon(e,c)
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
function c3300267.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
......
......@@ -40,7 +40,8 @@ function c34088136.spfilter(c,e,tp)
return c:IsCode(34830502) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c34088136.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,7 +25,8 @@ function c34230233.spfilter(c)
end
function c34230233.spcon(e,c)
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
function c34230233.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -19,7 +19,8 @@ function c34627841.filter(c,e,tp)
return c:GetCode()==89631139 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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)
end
function c34627841.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -40,7 +40,8 @@ function c34830502.spfilter(c,e,tp)
return c:IsCode(19877898) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c34830502.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,7 +16,7 @@ function c35059553.initial_effect(c)
c:RegisterEffect(e2)
end
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
local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)
return limit>0 and limit or 5
......
......@@ -19,7 +19,8 @@ function c36262024.filter(c,e,tp)
return c:GetCode()==74677422 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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)
end
function c36262024.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,7 +30,8 @@ end
function c3825890.otcon(e,c)
if c==nil then return true end
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
function c3825890.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
......
......@@ -67,8 +67,8 @@ function c38369349.spcon(e,c)
local lv=c:GetLevel()
local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end
elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end
function c38369349.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel()
......
......@@ -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)
end
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)
end
function c41470137.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -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)
end
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)
end
function c4253484.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -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)
end
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)
end
function c42592719.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -44,7 +44,8 @@ end
function c43378048.spcon(e,c)
if c==nil then return true end
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,69890967)
end
......
......@@ -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)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectTarget(tp,c43434803.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
......@@ -20,7 +20,8 @@ end
function c4376658.spcon(e,c)
if c==nil then return true end
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
function c4376658.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -79,7 +79,8 @@ function c46384672.spfilter(c,e,tp)
return c:IsCode(73879377) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c46384672.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -59,7 +59,8 @@ function c47507260.spfilter(c,e,tp)
return c:IsCode(74591968) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c47507260.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -58,7 +58,8 @@ end
function c48156348.sprcon(e,c)
if c==nil then return true end
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
function c48156348.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48156348,2))
......
......@@ -58,7 +58,8 @@ function c48964966.filter2(c,e,sp)
end
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 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)
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)
......
......@@ -23,7 +23,7 @@ function c49080532.filter(c,e,tp)
return c:GetCode()==49080532 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......
......@@ -37,7 +37,8 @@ function c49441499.spfilter(c,e,tp)
return c:IsCode(34088136) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c49441499.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -15,7 +15,8 @@ function c49674183.spfilter(c)
end
function c49674183.spcon(e,c)
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
function c49674183.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -51,7 +51,8 @@ function c50088247.filter(c,e,tp)
end
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 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)
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)
......
......@@ -35,7 +35,8 @@ function c50893987.scfilter(c)
return c:IsSetCard(0x19) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
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)
end
function c50893987.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,7 +24,8 @@ end
function c5186893.otcon(e,c)
if c==nil then return true end
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
function c5186893.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
......
......@@ -67,8 +67,8 @@ function c53183600.spcon(e,c)
local lv=c:GetLevel()
local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end
elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end
function c53183600.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel()
......
......@@ -9,6 +9,7 @@ function c53334471.initial_effect(c)
--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(c53334471.adjustop)
......@@ -16,6 +17,7 @@ function c53334471.initial_effect(c)
--adjust
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c53334471.adjustop2)
......@@ -75,17 +77,23 @@ function c53334471.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if g1:GetCount()==0 then c53334471[tp]=0
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])
end
if g2:GetCount()==0 then c53334471[1-tp]=0
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])
end
g1:Merge(g2)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_RULE)
Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.Readjust()
end
end
......
......@@ -21,10 +21,10 @@ function c5338223.spfilter(c,e,tp)
end
function c5338223.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=(e:GetLabel()==1)
local chkf=(e:GetLabel()==1) and 0 or -1
e:SetLabel(0)
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetLabel(0)
......
......@@ -22,7 +22,8 @@ function c54913680.filter(c,e,tp)
return c:IsCode(63176202) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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)
end
function c54913680.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,7 +28,9 @@ end
function c55794644.hspcon(e,c)
if c==nil then return true end
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)
else return Duel.IsExistingMatchingCard(c55794644.spfilter,tp,0x16,0,1,nil) end
end
......
......@@ -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)
end
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)
end
function c57731460.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -51,7 +51,7 @@ function c57793869.initial_effect(c)
end
function c57793869.ttcon(e,c)
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
function c57793869.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
......
......@@ -28,7 +28,8 @@ function c5861892.initial_effect(c)
end
function c5861892.spcon(e,c)
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
function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -34,7 +34,8 @@ c59464593.lvdncount=3
c59464593.lvdn={73879377,46384672,980973}
function c59464593.spcon(e,c)
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
function c59464593.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsCode,1,1,nil,73879377)
......
......@@ -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)
end
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)
end
function c5975022.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -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)
end
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)
end
function c612115.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -34,7 +34,7 @@ function c62180201.initial_effect(c)
end
function c62180201.ttcon(e,c)
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
function c62180201.ttop(e,tp,eg,ep,ev,re,r,rp,c)
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)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
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 not c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -45,7 +45,8 @@ function c63014935.initial_effect(c)
end
function c63014935.spcon(e,c)
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
function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......
......@@ -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)
end
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)
end
function c63259351.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -47,7 +47,8 @@ end
function c63487632.spcon(e,c)
if c==nil then return true end
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
function c63487632.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -23,7 +23,8 @@ function c64034255.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
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)
end
function c64034255.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -67,8 +67,8 @@ function c65458948.spcon(e,c)
local lv=c:GetLevel()
local tp=c:GetControler()
if lv<5 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
elseif lv<7 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.CheckReleaseGroup(tp,nil,2,nil) end
elseif lv<7 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.CheckReleaseGroup(tp,nil,1,nil)
else return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
end
function c65458948.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetLevel()
......
......@@ -20,7 +20,8 @@ end
function c68881649.spcon(e,c)
if c==nil then return true end
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
function c68881649.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -28,7 +28,8 @@ function c69831560.initial_effect(c)
end
function c69831560.spcon(e,c)
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
function c69831560.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -41,7 +41,8 @@ function c69890967.initial_effect(c)
end
function c69890967.spcon(e,c)
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
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)
......
......@@ -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 chk==0 then
if e:GetLabel()==1 then
local res=Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
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
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c70156997.filter,tp,LOCATION_GRAVE,0,1,nil,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)
end
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)
e:SetLabel(rg:GetFirst():GetLevel()+3)
Duel.Release(rg,REASON_COST)
......
......@@ -56,7 +56,8 @@ end
function c72258771.otcon(e,c)
if c==nil then return true end
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
function c72258771.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
......
......@@ -49,7 +49,8 @@ function c73665146.spfilter(c,e,tp)
return c:IsCode(72443568) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c73665146.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -49,7 +49,8 @@ function c74388798.spfilter(c,e,tp)
return c:IsCode(37267041) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c74388798.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -67,7 +67,8 @@ function c74591968.spfilter(c,e,tp)
return c:IsCode(60482781) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
function c74591968.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -44,7 +44,8 @@ function c74713516.spfilter(c,e,tp)
return c:IsCode(1102515) and c:IsCanBeSpecialSummoned(e,1,tp,true,true)
end
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)
end
function c74713516.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -42,7 +42,8 @@ function c75830094.spfilter(c,e,tp)
return c:IsCode(11224103) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
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)
end
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)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c77642288.spop(e,tp,eg,ep,ev,re,r,rp)
local zc=Duel.GetLocationCount(tp,LOCATION_MZONE)
if zc==0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 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)
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 sc=sg:GetFirst()
g:RemoveCard(sc)
......
......@@ -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)
end
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)
end
function c78868776.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -40,7 +40,8 @@ end
function c79229522.sprcon(e,c)
if c==nil then return true end
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
function c79229522.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79205581,0))
......
......@@ -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)
end
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)
end
function c79580323.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,7 +28,8 @@ end
function c81254059.otcon(e,c)
if c==nil then return true end
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
function c81254059.otop(e,tp,eg,ep,ev,re,r,rp,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