Commit 3d92e441 authored by argon.sun's avatar argon.sun

fix

parent bafb8e1a
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
const unsigned short PRO_VERSION = 0x1290; const unsigned short PRO_VERSION = 0x12a0;
namespace ygo { namespace ygo {
......
...@@ -85,7 +85,7 @@ int32 effect::is_available() { ...@@ -85,7 +85,7 @@ int32 effect::is_available() {
} }
if (type & EFFECT_TYPE_FIELD) { if (type & EFFECT_TYPE_FIELD) {
if (!(flag & EFFECT_FLAG_FIELD_ONLY)) { if (!(flag & EFFECT_FLAG_FIELD_ONLY)) {
if(handler->current.controler == PLAYER_NONE) if(handler->is_position(POS_FACEDOWN) || handler->current.controler == PLAYER_NONE)
return FALSE; return FALSE;
if((flag & EFFECT_FLAG_OWNER_RELATE) && !(flag & EFFECT_FLAG_CANNOT_DISABLE) && owner->is_status(STATUS_DISABLED)) if((flag & EFFECT_FLAG_OWNER_RELATE) && !(flag & EFFECT_FLAG_CANNOT_DISABLE) && owner->is_status(STATUS_DISABLED))
return FALSE; return FALSE;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <map> #include <map>
#include <list> #include <list>
#include <array> #include <array>
#include <unordered_map>
class card; class card;
struct card_data; struct card_data;
...@@ -200,6 +201,7 @@ struct processor { ...@@ -200,6 +201,7 @@ struct processor {
effect_vector delayed_ntp; effect_vector delayed_ntp;
event_list delayed_tev; event_list delayed_tev;
event_list delayed_ntev; event_list delayed_ntev;
std::unordered_map<card*, uint32> readjust_map;
ptr temp_var[4]; ptr temp_var[4];
uint16 pre_field[5]; uint16 pre_field[5];
int32 chain_limit; int32 chain_limit;
......
...@@ -267,6 +267,7 @@ static const struct luaL_Reg grouplib[] = { ...@@ -267,6 +267,7 @@ static const struct luaL_Reg grouplib[] = {
{ "Remove", scriptlib::group_remove }, { "Remove", scriptlib::group_remove },
{ "Merge", scriptlib::group_merge }, { "Merge", scriptlib::group_merge },
{ "Sub", scriptlib::group_sub }, { "Sub", scriptlib::group_sub },
{ "Equal", scriptlib::group_equal },
{ "IsContains", scriptlib::group_is_contains }, { "IsContains", scriptlib::group_is_contains },
{ "SearchCard", scriptlib::group_search_card }, { "SearchCard", scriptlib::group_search_card },
{ NULL, NULL } { NULL, NULL }
......
...@@ -1367,11 +1367,23 @@ int32 scriptlib::duel_chain_attack(lua_State *L) { ...@@ -1367,11 +1367,23 @@ int32 scriptlib::duel_chain_attack(lua_State *L) {
} }
int32 scriptlib::duel_readjust(lua_State *L) { int32 scriptlib::duel_readjust(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
card* adjcard = pduel->game_field->core.reason_effect->handler;
pduel->game_field->core.readjust_map[adjcard]++;
if(pduel->game_field->core.readjust_map[adjcard] > 3) {
pduel->game_field->send_to(adjcard, 0, REASON_RULE, pduel->game_field->core.reason_player, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
pduel->game_field->core.subunits.begin()->type = PROCESSOR_SENDTO_S;
return lua_yield(L, 0);
}
pduel->game_field->core.re_adjust = TRUE; pduel->game_field->core.re_adjust = TRUE;
return 0; return 0;
} }
int32 scriptlib::duel_adjust_instantly(lua_State *L) { int32 scriptlib::duel_adjust_instantly(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
if(lua_gettop(L) > 0) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
pcard->filter_disable_related_cards();
}
pduel->game_field->adjust_instant(); pduel->game_field->adjust_instant();
return 0; return 0;
} }
......
...@@ -512,6 +512,27 @@ int32 scriptlib::group_sub(lua_State *L) { ...@@ -512,6 +512,27 @@ int32 scriptlib::group_sub(lua_State *L) {
} }
return 0; return 0;
} }
int32 scriptlib::group_equal(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_GROUP, 1);
check_param(L, PARAM_TYPE_GROUP, 2);
group* pgroup = *(group**) lua_touserdata(L, 1);
group* sgroup = *(group**) lua_touserdata(L, 2);
if(pgroup->container.size() != sgroup->container.size()) {
lua_pushboolean(L, 0);
return 1;
}
auto pit = pgroup->container.begin();
auto sit = sgroup->container.begin();
for (; pit != pgroup->container.end(); ++pit, ++sit) {
if((*pit) != (*sit)) {
lua_pushboolean(L, 0);
return 1;
}
}
lua_pushboolean(L, 1);
return 1;
}
int32 scriptlib::group_is_contains(lua_State *L) { int32 scriptlib::group_is_contains(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_GROUP, 1); check_param(L, PARAM_TYPE_GROUP, 1);
......
...@@ -4167,6 +4167,7 @@ void field::adjust_instant() { ...@@ -4167,6 +4167,7 @@ void field::adjust_instant() {
adjust_disable_check_list(); adjust_disable_check_list();
} }
void field::adjust_all() { void field::adjust_all() {
core.readjust_map.clear();
add_process(PROCESSOR_ADJUST, 0, 0, 0, 0, 0); add_process(PROCESSOR_ADJUST, 0, 0, 0, 0, 0);
} }
void field::refresh_location_info_instant() { void field::refresh_location_info_instant() {
......
...@@ -264,6 +264,7 @@ public: ...@@ -264,6 +264,7 @@ public:
static int32 group_remove(lua_State *L); static int32 group_remove(lua_State *L);
static int32 group_merge(lua_State *L); static int32 group_merge(lua_State *L);
static int32 group_sub(lua_State *L); static int32 group_sub(lua_State *L);
static int32 group_equal(lua_State *L);
static int32 group_is_contains(lua_State *L); static int32 group_is_contains(lua_State *L);
static int32 group_search_card(lua_State *L); static int32 group_search_card(lua_State *L);
......
--キッズ·ガード --キッズ·ガード
function c20759529.initial_effect(c) function c10759529.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c20759529.condition) e1:SetCondition(c10759529.condition)
e1:SetCost(c20759529.cost) e1:SetCost(c10759529.cost)
e1:SetTarget(c20759529.target) e1:SetTarget(c10759529.target)
e1:SetOperation(c20759529.activate) e1:SetOperation(c10759529.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c20759529.condition(e,tp,eg,ep,ev,re,r,rp) function c10759529.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c20759529.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c10759529.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,32679370) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,32679370) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,32679370) local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,32679370)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c20759529.filter(c) function c10759529.filter(c)
return c:IsSetCard(0x3008) and c:IsAbleToHand() return c:IsSetCard(0x3008) and c:IsAbleToHand()
end end
function c20759529.target(e,tp,eg,ep,ev,re,r,rp,chk) function c10759529.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20759529.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c10759529.filter,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 c20759529.activate(e,tp,eg,ep,ev,re,r,rp) function c10759529.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack() Duel.NegateAttack()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c20759529.filter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c10759529.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
--遠心分離フィールド
function c1801154.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1801154,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(c1801154.sptg)
e2:SetOperation(c1801154.spop)
c:RegisterEffect(e2)
end
function c1801154.filter2(c,code)
if not c.material_count or not c:IsReason(REASON_DESTROY) then return false end
for i=1,c.material_count do
if code==c.material[i] then return true end
end
return false
end
function c1801154.filter1(c,e,tp,eg)
if not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return false end
return eg:IsExists(c1801154.filter2,1,nil,c:GetCode())
end
function c1801154.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1801154.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1801154.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1801154.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -49,7 +49,7 @@ function c20951752.sumcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function c20951752.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()==1 return e:GetLabel()==1
end end
function c20951752.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) function c20951752.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_FAIRY) end if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.GetReleaseGroup(tp) local g=Duel.GetReleaseGroup(tp)
local rg=g:Filter(Card.IsRace,nil,RACE_FAIRY) local rg=g:Filter(Card.IsRace,nil,RACE_FAIRY)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
......
...@@ -78,7 +78,7 @@ end ...@@ -78,7 +78,7 @@ end
function c32919136.damop(e,tp,eg,ep,ev,re,r,rp) function c32919136.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
function c32919136.desfilter(c) function c32919136.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x45) return c:IsFaceup() and c:IsSetCard(0x45)
......
...@@ -28,12 +28,12 @@ function c3370104.initial_effect(c) ...@@ -28,12 +28,12 @@ function c3370104.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c3370104.distg(e,c) function c3370104.distg(e,c)
if c:GetCardTargetCount()~=1 then return false end if not e:GetHandler():IsAttackPos() or c:GetCardTargetCount()~=1 then return false end
local tc=c:GetFirstCardTarget() local tc=c:GetFirstCardTarget()
return tc:IsControler(e:GetHandlerPlayer()) and tc:IsRace(RACE_MACHINE) return tc:IsControler(e:GetHandlerPlayer()) and tc:IsRace(RACE_MACHINE)
end end
function c3370104.disop(e,tp,eg,ep,ev,re,r,rp) function c3370104.disop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_MONSTER) then return end if not e:GetHandler():IsAttackPos() or re:IsActiveType(TYPE_MONSTER) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return end if not g or g:GetCount()~=1 then return end
......
...@@ -18,10 +18,8 @@ function c37534148.initial_effect(c) ...@@ -18,10 +18,8 @@ function c37534148.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon --special summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37534148,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetCondition(c37534148.regcon) e3:SetCondition(c37534148.regcon)
e3:SetOperation(c37534148.regop) e3:SetOperation(c37534148.regop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -47,14 +45,15 @@ function c37534148.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,14 +45,15 @@ function c37534148.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c37534148.regcon(e,tp,eg,ep,ev,re,r,rp) function c37534148.regcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local c=e:GetHandler()
e:SetLabelObject(tc) local ec=c:GetPreviousEquipTarget()
return e:GetHandler():GetPreviousEquipTarget()==tc and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE) return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_BATTLE) and ec:IsLocation(LOCATION_GRAVE)
end end
function c37534148.regop(e,tp,eg,ep,ev,re,r,rp) function c37534148.regop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler()) local ec=c:GetPreviousEquipTarget()
e1:SetDescription(aux.Stringid(37534148,1)) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37534148,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
...@@ -62,18 +61,21 @@ function c37534148.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,18 +61,21 @@ function c37534148.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(c37534148.sptg) e1:SetTarget(c37534148.sptg)
e1:SetOperation(c37534148.spop) e1:SetOperation(c37534148.spop)
e1:SetLabelObject(tc) e1:SetLabelObject(ec)
e1:SetReset(RESET_EVENT+0x16c0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x16c0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1) e:GetHandler():RegisterEffect(e1)
tc:RegisterFlagEffect(37534148,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) ec:RegisterFlagEffect(37534148,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
function c37534148.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c37534148.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():GetFlagEffect(37534148)~=0 end local ec=e:GetHandler():GetPreviousEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetLabelObject(),1,0,0) if chk==0 then return ec:GetFlagEffect(37534148)~=0 end
Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end end
function c37534148.spop(e,tp,eg,ep,ev,re,r,rp) function c37534148.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if e:GetLabelObject():GetFlagEffect(37534148)~=0 then local tc=Duel.GetFirstTarget()
Duel.SpecialSummon(e:GetLabelObject(),0,tp,tp,false,false,POS_FACEUP) if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
--墓場からの誘い
function c57270476.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c57270476.target)
e1:SetOperation(c57270476.activate)
c:RegisterEffect(e1)
end
function c57270476.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
end
function c57270476.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(1-tp,1)
local g=Duel.GetDecktopGroup(1-tp,1)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.ShuffleDeck(1-tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_TO_HAND)
e1:SetOperation(c57270476.tgop)
e1:SetReset(RESET_EVENT+0x1de0000)
tc:RegisterEffect(e1)
end
end
function c57270476.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsReason(REASON_DRAW) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
--エレメンタルバースト
function c61411502.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetCost(c61411502.cost)
e1:SetTarget(c61411502.target)
e1:SetOperation(c61411502.activate)
c:RegisterEffect(e1)
end
function c61411502.cfilter1(c,rg)
if not c:IsAttribute(ATTRIBUTE_WIND) then return false end
rg:RemoveCard(c)
local ret=rg:IsExists(c61411502.cfilter2,1,nil,rg)
rg:AddCard(c)
return ret
end
function c61411502.cfilter2(c,rg)
if not c:IsAttribute(ATTRIBUTE_WATER) then return false end
rg:RemoveCard(c)
local ret=rg:IsExists(c61411502.cfilter3,1,nil,rg)
rg:AddCard(c)
return ret
end
function c61411502.cfilter3(c,rg)
if not c:IsAttribute(ATTRIBUTE_FIRE) then return false end
rg:RemoveCard(c)
local ret=rg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH)
rg:AddCard(c)
return ret
end
function c61411502.rfilter(c)
return c:IsFaceup() and c:IsHasEffect(EFFECT_EXTRA_RELEASE) and c:IsReleasable()
end
function c61411502.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c61411502.rfilter,tp,0,LOCATION_MZONE,nil)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>3 and g1:IsExists(c61411502.cfilter1,1,nil,g1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg1=g1:FilterSelect(tp,c61411502.cfilter1,1,1,nil,g1)
g1:Sub(rg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg2=g1:FilterSelect(tp,c61411502.cfilter2,1,1,nil,g1)
g1:Sub(rg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg3=g1:FilterSelect(tp,c61411502.cfilter3,1,1,nil,g1)
g1:Sub(rg3)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg4=g1:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_EARTH)
rg1:Merge(rg2)
rg1:Merge(rg3)
rg1:Merge(rg4)
Duel.Release(rg1,REASON_COST)
end
function c61411502.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c61411502.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
...@@ -40,6 +40,6 @@ function c67045174.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,6 +40,6 @@ function c67045174.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end end
function c67045174.activate(e,tp,eg,ep,ev,re,r,rp) function c67045174.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
end end
...@@ -80,14 +80,14 @@ function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,14 +80,14 @@ function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=cg:Select(tp,lv,lv,nil) local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST) Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
e:SetLabel(lv) Duel.SetTargetParam(lv)
end end
function c6733059.dfilter(c,lv) function c6733059.dfilter(c,lv)
return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable() return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable()
end end
function c6733059.operation(e,tp,eg,ep,ev,re,r,rp) function c6733059.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local lv=e:GetLabel() local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if lv==0 then return end if lv==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c6733059.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv) local g=Duel.SelectMatchingCard(tp,c6733059.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv)
......
--ポールポジション
function c73578229.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local g=Group.CreateGroup()
g:KeepAlive()
--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(c73578229.adjustop)
e2:SetLabelObject(g)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTarget(c73578229.etarget)
e3:SetValue(c73578229.efilter)
e3:SetLabelObject(g)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetOperation(c73578229.desop)
c:RegisterEffect(e4)
end
function c73578229.etarget(e,c)
return e:GetLabelObject():IsContains(c)
end
function c73578229.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
function c73578229.adjustop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local ag=g:GetMaxGroup(Card.GetAttack)
local preg=e:GetLabelObject()
if ag:Equal(preg) then return end
preg:Clear()
preg:Merge(ag)
Duel.AdjustInstantly(e:GetHandler())
Duel.Readjust()
end
function c73578229.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_ACTIVATED) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local ag=g:GetMaxGroup(Card.GetAttack)
Duel.Destroy(ag,REASON_EFFECT)
end
end
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