Commit b48ae168 authored by argon.sun's avatar argon.sun

new scripts

parent 1eeb45e5
...@@ -28,7 +28,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -28,7 +28,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_JOIN_HOST: { case BUTTON_JOIN_HOST: {
if(DuelClient::StartClient(0x7f000001, 7911, false)) { if(DuelClient::StartClient(0xc0a80264, 7911, false)) {
mainGame->btnCreateHost->setEnabled(false); mainGame->btnCreateHost->setEnabled(false);
mainGame->btnJoinHost->setEnabled(false); mainGame->btnJoinHost->setEnabled(false);
mainGame->btnJoinCancel->setEnabled(false); mainGame->btnJoinCancel->setEnabled(false);
...@@ -48,7 +48,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -48,7 +48,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case BUTTON_HOST_CONFIRM: { case BUTTON_HOST_CONFIRM: {
if(!NetServer::StartServer(mainGame->gameConf.serverport)) if(!NetServer::StartServer(mainGame->gameConf.serverport))
break; break;
if(!DuelClient::StartClient(0x7f000001, mainGame->gameConf.serverport)) { if(!DuelClient::StartClient(0xc0a80264, mainGame->gameConf.serverport)) {
NetServer::StopServer(); NetServer::StopServer();
break; break;
} }
......
...@@ -93,9 +93,9 @@ int NetServer::ServerThread(void* param) { ...@@ -93,9 +93,9 @@ int NetServer::ServerThread(void* param) {
void NetServer::DisconnectPlayer(DuelPlayer* dp) { void NetServer::DisconnectPlayer(DuelPlayer* dp) {
auto bit = users.find(dp->bev); auto bit = users.find(dp->bev);
if(bit != users.end()) { if(bit != users.end()) {
users.erase(bit);
bufferevent_disable(dp->bev, EV_READ); bufferevent_disable(dp->bev, EV_READ);
bufferevent_free(dp->bev); bufferevent_free(dp->bev);
users.erase(bit);
} }
} }
void NetServer::HandleCTOSPacket(DuelPlayer* dp, char* data, unsigned int len) { void NetServer::HandleCTOSPacket(DuelPlayer* dp, char* data, unsigned int len) {
......
...@@ -132,7 +132,7 @@ void SingleDuel::PlayerReady(DuelPlayer* dp) { ...@@ -132,7 +132,7 @@ void SingleDuel::PlayerReady(DuelPlayer* dp) {
return; return;
ready[dp->type] = !ready[dp->type] ; ready[dp->type] = !ready[dp->type] ;
STOC_HS_PlayerChange scpc; STOC_HS_PlayerChange scpc;
scpc.status = (dp->type << 4) | ready[dp->type] ? PLAYERCHANGE_READY : PLAYERCHANGE_NOTREADY; scpc.status = (dp->type << 4) | (ready[dp->type] ? PLAYERCHANGE_READY : PLAYERCHANGE_NOTREADY);
if(players[1 - dp->type]) if(players[1 - dp->type])
NetServer::SendPacketToPlayer(players[1 - dp->type], STOC_HS_PLAYER_CHANGE, scpc); NetServer::SendPacketToPlayer(players[1 - dp->type], STOC_HS_PLAYER_CHANGE, scpc);
for(auto pit = observers.begin(); pit != observers.end(); ++pit) for(auto pit = observers.begin(); pit != observers.end(); ++pit)
......
...@@ -13,8 +13,7 @@ function c15839054.initial_effect(c) ...@@ -13,8 +13,7 @@ function c15839054.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c15839054.condition(e,tp,eg,ep,ev,re,r,rp) function c15839054.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c15839054.filter(c) function c15839054.filter(c)
return c:IsSetCard(0x46) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() return c:IsSetCard(0x46) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
......
...@@ -35,7 +35,7 @@ function c16825874.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc) ...@@ -35,7 +35,7 @@ function c16825874.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc)
Duel.SetSynchroMaterial(g) Duel.SetSynchroMaterial(g)
end end
function c16825874.ccon(e,tp,eg,ep,ev,re,r,rp) function c16825874.ccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_SYNCHRO) return r==REASON_SYNCHRO
end end
function c16825874.cop(e,tp,eg,ep,ev,re,r,rp) function c16825874.cop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--ニードル·ガンナー
function c17841097.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c17841097.pscon)
e1:SetOperation(c17841097.psop)
c:RegisterEffect(e1)
end
function c17841097.pscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c17841097.psop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
...@@ -12,8 +12,7 @@ function c19642774.initial_effect(c) ...@@ -12,8 +12,7 @@ function c19642774.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c19642774.con(e,tp,eg,ep,ev,re,r,rp) function c19642774.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c19642774.filter(c,e,tp) function c19642774.filter(c,e,tp)
return c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -13,8 +13,7 @@ function c25652655.initial_effect(c) ...@@ -13,8 +13,7 @@ function c25652655.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25652655.condition(e,tp,eg,ep,ev,re,r,rp) function c25652655.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c25652655.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c25652655.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
......
...@@ -12,8 +12,7 @@ function c26381750.initial_effect(c) ...@@ -12,8 +12,7 @@ function c26381750.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c26381750.spcon(e,tp,eg,ep,ev,re,r,rp) function c26381750.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
and Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_GRAVE,0,nil,0x39):GetClassCount(Card.GetCode)>=3 and Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_GRAVE,0,nil,0x39):GetClassCount(Card.GetCode)>=3
end end
function c26381750.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c26381750.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -44,8 +44,7 @@ function c3606728.ffilter(c) ...@@ -44,8 +44,7 @@ function c3606728.ffilter(c)
end end
function c3606728.efcon(e,tp,eg,ep,ev,re,r,rp) function c3606728.efcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetReasonCard() local ec=e:GetHandler():GetReasonCard()
if ec:GetMaterial():IsExists(c3606728.ffilter,1,nil) then return false end return not ec:GetMaterial():IsExists(c3606728.ffilter,1,nil) and r==REASON_XYZ
return bit.band(e:GetHandler():GetReason(),0x200008)==0x200008
end end
function c3606728.efop(e,tp,eg,ep,ev,re,r,rp) function c3606728.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -13,8 +13,7 @@ function c37300735.initial_effect(c) ...@@ -13,8 +13,7 @@ function c37300735.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c37300735.damcon(e,tp,eg,ep,ev,re,r,rp) function c37300735.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c37300735.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c37300735.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -14,7 +14,7 @@ function c39980304.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -14,7 +14,7 @@ function c39980304.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
...@@ -37,14 +37,9 @@ end ...@@ -37,14 +37,9 @@ end
function c39980304.chain_target(e,te,tp) function c39980304.chain_target(e,te,tp)
return Duel.GetMatchingGroup(c39980304.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK,0,nil,te) return Duel.GetMatchingGroup(c39980304.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK,0,nil,te)
end end
function c39980304.deckf(c)
return c:GetLocation()==LOCATION_DECK
end
function c39980304.chain_operation(e,te,tp,tc,mat,sumtype) function c39980304.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end if not sumtype then sumtype=SUMMON_TYPE_FUSION end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local sf=false
if mat:FilterCount(c39980304.deckf,nil)>0 then sf=true end
Duel.Remove(mat,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.Remove(mat,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
...@@ -52,13 +47,13 @@ function c39980304.chain_operation(e,te,tp,tc,mat,sumtype) ...@@ -52,13 +47,13 @@ function c39980304.chain_operation(e,te,tp,tc,mat,sumtype)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetOwnerPlayer(tp) e1:SetOwnerPlayer(tp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetOperation(c39980304.desop) e1:SetOperation(c39980304.desop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1) e1:SetCountLimit(1)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if sf then Duel.ShuffleDeck(tp) end
end end
function c39980304.desop(e,tp,eg,ep,ev,re,r,rp) function c39980304.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
......
...@@ -13,8 +13,7 @@ function c40048324.initial_effect(c) ...@@ -13,8 +13,7 @@ function c40048324.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c40048324.condition(e,tp,eg,ep,ev,re,r,rp) function c40048324.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c40048324.filter(c) function c40048324.filter(c)
return c:IsCode(80280737) and c:IsAbleToHand() return c:IsCode(80280737) and c:IsAbleToHand()
......
...@@ -12,7 +12,7 @@ function c40348946.initial_effect(c) ...@@ -12,7 +12,7 @@ function c40348946.initial_effect(c)
end end
function c40348946.con(e,tp,eg,ep,ev,re,r,rp) function c40348946.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008 and c:GetReasonCard():IsRace(RACE_DRAGON) return c:IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO and c:GetReasonCard():IsRace(RACE_DRAGON)
end end
function c40348946.op(e,tp,eg,ep,ev,re,r,rp) function c40348946.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -13,7 +13,7 @@ function c41431329.initial_effect(c) ...@@ -13,7 +13,7 @@ function c41431329.initial_effect(c)
end end
function c41431329.thcon(e,tp,eg,ep,ev,re,r,rp) function c41431329.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008 return c:IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
and c:GetReasonCard():IsAttribute(ATTRIBUTE_LIGHT) and c:GetReasonCard():IsAttribute(ATTRIBUTE_LIGHT)
end end
function c41431329.filter(c) function c41431329.filter(c)
......
--バイス·バーサーカー
function c43014054.initial_effect(c)
--damage & atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43014054,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c43014054.damcon)
e1:SetTarget(c43014054.damtg)
e1:SetOperation(c43014054.damop)
c:RegisterEffect(e1)
end
function c43014054.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c43014054.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rc=e:GetHandler():GetReasonCard()
Duel.SetTargetPlayer(rc:GetControler())
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rc:GetControler(),2000)
end
function c43014054.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local rc=e:GetHandler():GetReasonCard()
if rc:IsFaceup() and rc:IsOnField() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(2000)
rc:RegisterEffect(e1)
end
end
--ネクロ·リンカー
function c44236692.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44236692,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c44236692.spcost)
e1:SetTarget(c44236692.sptg)
e1:SetOperation(c44236692.spop)
c:RegisterEffect(e1)
end
function c44236692.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c44236692.filter(c,e,tp)
return c:IsSetCard(0x17) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c44236692.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c44236692.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c44236692.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c44236692.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c44236692.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--ミラー·レディバグ
function c45358284.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c45358284.spcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--level change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(45358284,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c45358284.lvcon)
e2:SetOperation(c45358284.lvop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetCondition(c45358284.descon)
c:RegisterEffect(e3)
end
function c45358284.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsFaceup,c:GetControler(),LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_GRAVE,0,1,nil,TYPE_MONSTER)
end
function c45358284.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c45358284.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,c)
local lvs=g:GetSum(Card.GetLevel)
if lvs~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lvs)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c45358284.descon(e)
return e:GetHandler():GetLevel()>12
end
--暴君の威圧
function c4638410.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c4638410.cost)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c4638410.etarget)
e2:SetValue(c4638410.efilter)
c:RegisterEffect(e2)
end
function c4638410.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local rg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(rg,REASON_COST)
end
function c4638410.etarget(e,c)
return c:GetOwner()==e:GetHandlerPlayer()
end
function c4638410.efilter(e,te)
return e~=te and te:GetOwner():IsType(TYPE_TRAP)
end
...@@ -19,8 +19,8 @@ function c49460512.initial_effect(c) ...@@ -19,8 +19,8 @@ function c49460512.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c49460512.cfilter(c,tp) function c49460512.cfilter(c,tp)
return c:IsSetCard(0x33) and c:GetPreviousControler()==tp and c:GetPreviousLocation(LOCATION_MZONE) return c:IsSetCard(0x33) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and bit.band(c:GetPreviousPosition(),POS_FACEUP)~=0 and bit.band(c:GetReason(),0x41)==0x41 and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetReason(),0x41)==0x41
end end
function c49460512.spcon(e,tp,eg,ep,ev,re,r,rp) function c49460512.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c49460512.cfilter,1,nil,tp) return eg:IsExists(c49460512.cfilter,1,nil,tp)
......
...@@ -9,8 +9,7 @@ function c52840598.initial_effect(c) ...@@ -9,8 +9,7 @@ function c52840598.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c52840598.con(e,tp,eg,ep,ev,re,r,rp) function c52840598.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c52840598.op(e,tp,eg,ep,ev,re,r,rp) function c52840598.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -54,8 +54,7 @@ function c52900379.clear(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,8 +54,7 @@ function c52900379.clear(e,tp,eg,ep,ev,re,r,rp)
c52900379[1]=0 c52900379[1]=0
end end
function c52900379.reccon(e,tp,eg,ep,ev,re,r,rp) function c52900379.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c52900379.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c52900379.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -13,7 +13,7 @@ function c53116300.initial_effect(c) ...@@ -13,7 +13,7 @@ function c53116300.initial_effect(c)
end end
function c53116300.spcon(e,tp,eg,ep,ev,re,r,rp) function c53116300.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x1a)==0x1a and c:GetReasonCard():IsSetCard(0x100a) return c:IsLocation(LOCATION_GRAVE) and r==REASON_SUMMON and c:GetReasonCard():IsSetCard(0x100a)
end end
function c53116300.filter(c,e,tp) function c53116300.filter(c,e,tp)
return c:IsSetCard(0x100a) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x100a) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -42,8 +42,7 @@ function c53855409.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,7 @@ function c53855409.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c53855409.tcon(e,tp,eg,ep,ev,re,r,rp) function c53855409.tcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c53855409.ttg(e,tp,eg,ep,ev,re,r,rp,chk) function c53855409.ttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
......
...@@ -13,8 +13,7 @@ function c5519829.initial_effect(c) ...@@ -13,8 +13,7 @@ function c5519829.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c5519829.con(e,tp,eg,ep,ev,re,r,rp) function c5519829.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c5519829.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c5519829.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end if chk==0 then return Duel.CheckLPCost(tp,500) end
......
--ハーフ·カウンター
function c6799227.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c6799227.condition)
e1:SetTarget(c6799227.target)
e1:SetOperation(c6799227.activate)
c:RegisterEffect(e1)
end
function c6799227.condition(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetAttackTarget()
return t and t:IsControler(tp)
end
function c6799227.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttackTarget()
if chkc then return chkc==tg end
if chk==0 then return Duel.GetAttacker():IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function c6799227.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=Duel.GetAttacker():GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(atk/2)
tc:RegisterEffect(e1)
end
end
...@@ -28,9 +28,8 @@ function c68473226.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -28,9 +28,8 @@ function c68473226.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST) Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST)
end end
function c68473226.regcon(e,tp,eg,ep,ev,re,r,rp) function c68473226.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local rc=e:GetHandler():GetReasonCard()
local rc=c:GetReasonCard() return r==REASON_SUMMON and rc:IsFaceup() and rc:IsLevelAbove(7)
return bit.band(c:GetReason(),0x18)==0x18 and rc:IsFaceup() and rc:IsLevelAbove(7)
end end
function c68473226.regop(e,tp,eg,ep,ev,re,r,rp) function c68473226.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--パワー·ブレイカー
function c6903857.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6903857,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c6903857.condition)
e1:SetTarget(c6903857.target)
e1:SetOperation(c6903857.operation)
c:RegisterEffect(e1)
--to defence
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(6903857,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(c6903857.poscon)
e2:SetOperation(c6903857.posop)
c:RegisterEffect(e2)
end
function c6903857.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp~=tp
and (not c:IsReason(REASON_BATTLE) or c==Duel.GetAttackTarget())
end
function c6903857.dfilter(c)
return c:IsFaceup() and c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c6903857.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c6903857.dfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c6903857.dfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c6903857.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c6903857.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
end
function c6903857.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttack() and c:IsRelateToBattle() then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
--パワー·ジャイアント
function c7025445.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c7025445.spcon)
e1:SetOperation(c7025445.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--level change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c7025445.lvcon)
e2:SetOperation(c7025445.lvop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--dam reduce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetOperation(c7025445.damop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_BATTLE_TARGET)
e4:SetOperation(c7025445.damop)
c:RegisterEffect(e4)
end
function c7025445.cfilter(c)
return c:IsLevelBelow(4) and c:IsAbleToGraveAsCost()
end
function c7025445.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c7025445.cfilter,c:GetControler(),LOCATION_HAND,0,1,c)
end
function c7025445.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c7025445.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(g:GetFirst():GetLevel())
end
function c7025445.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c7025445.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-e:GetLabelObject():GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
function c7025445.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c7025445.damval)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c7025445.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0
else return val end
end
--D2シールド
function c71249758.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c71249758.condition)
e1:SetTarget(c71249758.target)
e1:SetOperation(c71249758.activate)
c:RegisterEffect(e1)
end
function c71249758.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c71249758.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsPosition(POS_FACEUP_DEFENCE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsPosition,tp,LOCATION_MZONE,0,1,nil,POS_FACEUP_DEFENCE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsPosition,tp,LOCATION_MZONE,0,1,1,nil,POS_FACEUP_DEFENCE)
end
function c71249758.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local def=tc:GetBaseDefence()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(def*2)
tc:RegisterEffect(e1)
end
end
--リード·バタフライ
function c71353388.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c71353388.spcon)
c:RegisterEffect(e1)
end
function c71353388.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c71353388.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c71353388.cfilter,c:GetControler(),0,LOCATION_MZONE,1,nil)
and not Duel.IsExistingMatchingCard(c71353388.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
...@@ -13,7 +13,7 @@ function c76683171.initial_effect(c) ...@@ -13,7 +13,7 @@ function c76683171.initial_effect(c)
end end
function c76683171.spcon(e,tp,eg,ep,ev,re,r,rp) function c76683171.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x1a)==0x1a and c:GetReasonCard():IsSetCard(0x3e) return c:IsLocation(LOCATION_GRAVE) and r==REASON_SUMMON and c:GetReasonCard():IsSetCard(0x3e)
end end
function c76683171.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c76683171.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
......
--ランサー·デーモン
function c79418153.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79418153,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c79418153.piercecon)
e1:SetTarget(c79418153.piercetg)
e1:SetOperation(c79418153.pierceop)
c:RegisterEffect(e1)
end
function c79418153.piercecon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and a:IsControler(tp) and d:IsDefence()
end
function c79418153.piercetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.GetAttacker():CreateEffectRelation(e)
end
function c79418153.pierceop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if a:IsRelateToEffect(e) and a:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+0x1fe0000)
a:RegisterEffect(e1)
end
end
\ No newline at end of file
...@@ -15,7 +15,7 @@ function c8903700.initial_effect(c) ...@@ -15,7 +15,7 @@ function c8903700.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c8903700.condition(e,tp,eg,ep,ev,re,r,rp) function c8903700.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RITUAL) return r==REASON_RITUAL
end end
function c8903700.operation(e,tp,eg,ep,ev,re,r,rp) function c8903700.operation(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard() local rc=e:GetHandler():GetReasonCard()
......
...@@ -23,8 +23,7 @@ function c92676637.slevel(e,c) ...@@ -23,8 +23,7 @@ function c92676637.slevel(e,c)
return 2*65536+lv return 2*65536+lv
end end
function c92676637.drcon(e,tp,eg,ep,ev,re,r,rp) function c92676637.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008
end end
function c92676637.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function c92676637.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -14,7 +14,7 @@ function c96182448.initial_effect(c) ...@@ -14,7 +14,7 @@ function c96182448.initial_effect(c)
end end
function c96182448.drcon(e,tp,eg,ep,ev,re,r,rp) function c96182448.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008 and c:GetReasonCard():IsCode(18013090) return c:IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO and c:GetReasonCard():IsCode(18013090)
end end
function c96182448.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function c96182448.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--チェーンドッグ
function c96930127.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(96930127,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c96930127.condition)
e1:SetTarget(c96930127.target)
e1:SetOperation(c96930127.operation)
c:RegisterEffect(e1)
--syn limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(c96930127.synlimit)
c:RegisterEffect(e2)
end
function c96930127.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST)
end
function c96930127.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(c96930127.cfilter,tp,LOCATION_MZONE,0,nil)==2
end
function c96930127.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c96930127.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function c96930127.synlimit(e,c)
if not c then return false end
return not c:IsRace(RACE_BEAST)
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