Commit ed3be43f authored by mercury233's avatar mercury233

update scripts

parent e8b1ac7d
......@@ -25,7 +25,10 @@ function c100257011.initial_effect(c)
c:RegisterEffect(e2)
end
function c100257011.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkAttribute)==1 or g:GetClassCount(Card.GetLinkRace)==1
if #g<2 then return false end
local c1=g:GetFirst()
local c2=g:GetNext()
return c1:GetLinkAttribute()&c2:GetLinkAttribute()>0 or c1:GetLinkRace()&c2:GetLinkRace()>0
end
function c100257011.lmlimit(e)
local c=e:GetHandler()
......@@ -36,7 +39,8 @@ function c100257011.cfilter(c,tp)
and Duel.IsExistingMatchingCard(c100257011.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c:GetOriginalAttribute(),c:GetOriginalRace(),tp)
end
function c100257011.eqfilter(c,att,race,tp)
return (c:GetOriginalAttribute()==att or c:GetOriginalRace()==race) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
return c:IsType(TYPE_MONSTER) and (c:GetOriginalAttribute()==att or c:GetOriginalRace()==race)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function c100257011.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100257011.cfilter(chkc,tp) end
......
......@@ -120,7 +120,7 @@ end
function c100257051.rltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sel=e:GetLabel()
local cat=e:GetCategory()
local cat=0
if sel==1 then
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
e:SetCategory(bit.bor(cat,CATEGORY_DESTROY))
......
--武神姫-アハシマ
--Scripted by nekrozar
function c100257056.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--link summon
aux.AddLinkProcedure(c,c100257056.mfilter,2,2,c100257056.lcheck)
c:EnableReviveLimit()
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--xyz summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100257056,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,100257056)
e2:SetCondition(c100257056.spcon)
e2:SetTarget(c100257056.sptg)
e2:SetOperation(c100257056.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100257056.regcon)
e3:SetOperation(aux.chainreg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100257056,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetCountLimit(1,100257156)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c100257056.descon)
e4:SetTarget(c100257056.destg)
e4:SetOperation(c100257056.desop)
c:RegisterEffect(e4)
if not c100257056.global_check then
c100257056.global_check=true
c100257056[0]=nil
c100257056[1]=nil
c100257056[2]=nil
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DETACH_MATERIAL)
ge1:SetOperation(c100257056.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c100257056.checkop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetCurrentChain()
if cid>0 then
c100257056[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID)
c100257056[1]=Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_LOCATION)
local seq=Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_SEQUENCE)
local te=Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if tc:IsRelateToEffect(te) then
if tc:IsControler(1) then seq=seq+16 end
else
if tc:GetPreviousControler()==1 then seq=seq+16 end
end
c100257056[2]=seq
end
end
function c100257056.mfilter(c)
return c:IsLevelAbove(1)
end
function c100257056.lcheck(g,lc)
return g:GetClassCount(Card.GetLevel)==1
end
function c100257056.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100257056.spfilter(c,e,tp)
return c:IsLevelAbove(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100257056.fselect(g,tp)
return g:GetClassCount(Card.GetLocation)==g:GetCount() and g:GetClassCount(Card.GetLevel)==1
and Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,g,2,2)
end
function c100257056.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100257056.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.GetLocationCountFromEx(tp)>0
and g:CheckSubGroup(c100257056.fselect,2,2,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c100257056.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100257056.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c100257056.fselect,false,2,2,tp)
if sg and sg:GetCount()==2 then
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e3)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
if Duel.GetLocationCountFromEx(tp,tp,sg)<=0 then return end
local xyzg=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,sg,2,2)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,sg)
end
end
end
function c100257056.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=(c:GetLinkedZone(0) & 0x7f) | ((c:GetLinkedZone(1) & 0x7f)<<0x10)
return bit.extract(zone,c100257056[2])~=0
end
function c100257056.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)==c100257056[0]
and c100257056[1]==LOCATION_MZONE and re:IsActiveType(TYPE_XYZ)
and e:GetHandler():GetFlagEffect(1)>0
end
function c100257056.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100257056.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -35,7 +35,6 @@ function c100259009.initial_effect(c)
c:RegisterEffect(e2)
end
c100259009.material_setcode=0x8
c100259009.card_code_list={89943723}
c100259009.neos_fusion=true
function c100259009.damcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
......
......@@ -41,7 +41,7 @@ function c100259017.initial_effect(c)
e3:SetOperation(c100259017.spop)
c:RegisterEffect(e3)
end
c100259017.synmat_syn=true
c100259017.material_type=TYPE_SYNCHRO
function c100259017.tfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
......
......@@ -42,7 +42,7 @@ function c100259025.ovfilter(c)
return c:IsFaceup() and c:IsCode(65305468)
end
function c100259025.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsHasType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and Duel.IsChainNegatable(ev)
end
function c100259025.discost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -51,18 +51,17 @@ function c100259025.discost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c100259025.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetCategory(CATEGORY_NEGATE)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE and re:GetHandler():IsRelateToEffect(re)
and not re:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_CONTROL))
e:SetCategory(CATEGORY_NEGATE+CATEGORY_CONTROL)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,1,0,0)
end
end
function c100259025.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:GetHandler():IsAbleToChangeControler() then
and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.GetControl(re:GetHandler(),tp)
end
end
......@@ -70,7 +70,7 @@ end
function c100259033.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Group.FromCards(c)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCountFromEx(tp)>0 then
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCountFromEx(tp,tp,c)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100259033.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
......
......@@ -38,7 +38,8 @@ function c100259041.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000)
end
function c100259041.cfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:GetLink()<=3 and not c:IsCode(100259041) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsLinkBelow(3) and not c:IsCode(100259041)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100259041.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
......@@ -57,7 +57,7 @@ function c100337033.cfilter(c)
return c:IsSetCard(0x9d) and c:IsAbleToRemoveAsCost()
end
function c100337033.posfilter(c)
return c:IsFacedown() or (c:IsFaceup() and c:IsCanTurnSet())
return c:IsFaceup() and c:IsCanTurnSet()
end
function c100337033.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -68,12 +68,32 @@ function c100337033.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c100337033.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100337033.posfilter,tp,LOCATION_MZONE,0,1,nil) end
local b1=Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c100337033.posfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 end
local s=0
if b1 and not b2 then
s=Duel.SelectOption(tp,aux.Stringid(100337033,2))
end
if not b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100337033,3))+1
end
if b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100337033,2),aux.Stringid(100337033,3))
end
e:SetLabel(s)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
end
function c100337033.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c100337033.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=nil
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil)
end
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
g=Duel.SelectMatchingCard(tp,c100337033.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
......
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