Commit a4c70a25 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #183 from VanillaSalt/patch18

fix script
parents 82ec05c8 1154ff2e
...@@ -82,7 +82,7 @@ function c131182.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,7 +82,7 @@ function c131182.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c131182.descon(e,tp,eg,ep,ev,re,r,rp) function c131182.descon(e,tp,eg,ep,ev,re,r,rp)
return not bit.band(r,REASON_BATTLE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) return bit.band(r,REASON_EFFECT)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end end
function c131182.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c131182.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end
......
...@@ -29,12 +29,13 @@ function c21843307.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,12 +29,13 @@ function c21843307.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,ec:GetCode(),0,0x11,0,0,ec:GetLevel(),RACE_WARRIOR,ATTRIBUTE_LIGHT) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,ec:GetCode(),0,0x11,0,0,ec:GetLevel(),RACE_WARRIOR,ATTRIBUTE_LIGHT) then return end
c:AddTrapMonsterAttribute(true,ATTRIBUTE_LIGHT,RACE_WARRIOR,ec:GetLevel(),0,0) c:AddTrapMonsterAttribute(true,ATTRIBUTE_LIGHT,RACE_WARRIOR,ec:GetLevel(),0,0)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(ec:GetCode()) e1:SetValue(ec:GetCode())
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
c:TrapMonsterBlock()
end end
...@@ -48,8 +48,8 @@ function c25123082.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,8 +48,8 @@ function c25123082.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c25123082.shcon(e,tp,eg,ep,ev,re,r,rp) function c25123082.shcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=e:GetLabelObject()
return tc==e:GetLabelObject() and tc:GetFlagEffect(25123082)~=0 return eg:IsContains(tc) and tc:GetFlagEffect(25123082)~=0
end end
function c25123082.shfilter(c) function c25123082.shfilter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
......
...@@ -5,23 +5,24 @@ function c25262697.initial_effect(c) ...@@ -5,23 +5,24 @@ function c25262697.initial_effect(c)
e1:SetDescription(aux.Stringid(25262697,0)) e1:SetDescription(aux.Stringid(25262697,0))
e1:SetCategory(CATEGORY_POSITION) e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c25262697.poscon) e1:SetCondition(c25262697.poscon)
e1:SetTarget(c25262697.postg) e1:SetTarget(c25262697.postg)
e1:SetOperation(c25262697.posop) e1:SetOperation(c25262697.posop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25262697.poscon(e,tp,eg,ep,ev,re,r,rp,chk) function c25262697.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetEnvironment()==47355498 return Duel.GetEnvironment()==47355498
end end
function c25262697.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c25262697.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()~=tp and chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function c25262697.posop(e,tp,eg,ep,ev,re,r,rp,chk) function c25262697.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE,0,POS_FACEUP_ATTACK,0) Duel.ChangePosition(tc,POS_FACEUP_DEFENCE,0,POS_FACEUP_ATTACK,0)
......
...@@ -21,7 +21,7 @@ function c26931058.filter3(c,e,tp) ...@@ -21,7 +21,7 @@ function c26931058.filter3(c,e,tp)
end end
function c26931058.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c26931058.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
local b1=Duel.IsExistingMatchingCard(c26931058.filter1,tp,LOCATION_MZONE,0,2,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local b1=Duel.IsExistingMatchingCard(c26931058.filter1,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingMatchingCard(c26931058.filter3,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b2=Duel.IsExistingMatchingCard(c26931058.filter3,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
......
...@@ -25,7 +25,7 @@ function c57139487.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -25,7 +25,7 @@ function c57139487.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end end
function c57139487.efilter(c,e) function c57139487.efilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e) return c:IsFaceup() and c:IsAttackBelow(1000) and c:IsRelateToEffect(e)
end end
function c57139487.activate(e,tp,eg,ep,ev,re,r,rp) function c57139487.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
......
...@@ -43,6 +43,7 @@ function c68815401.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,6 +43,7 @@ function c68815401.activate(e,tp,eg,ep,ev,re,r,rp)
local dg2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local dg2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if Duel.Destroy(dg2,REASON_EFFECT)>0 if Duel.Destroy(dg2,REASON_EFFECT)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,68815402,0,0x4011,1000,1000,3,RACE_PYRO,ATTRIBUTE_FIRE) then and Duel.IsPlayerCanSpecialSummonMonster(tp,68815402,0,0x4011,1000,1000,3,RACE_PYRO,ATTRIBUTE_FIRE) then
Duel.BreakEffect()
local token=Duel.CreateToken(tp,68815402) local token=Duel.CreateToken(tp,68815402)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end end
......
...@@ -23,7 +23,8 @@ function c73417207.target(e,syncard,f,minc,maxc) ...@@ -23,7 +23,8 @@ function c73417207.target(e,syncard,f,minc,maxc)
end end
function c73417207.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc) function c73417207.operation(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local lv=syncard:GetLevel()-e:GetHandler():GetLevel() local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
local g=Duel.GetMatchingGroup(c73417207.synfilter,syncard:GetControler(),LOCATION_HAND,0,c,syncard,f) local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,c,syncard,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,2,2,syncard) local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,2,2,syncard)
Duel.SetSynchroMaterial(sg) Duel.SetSynchroMaterial(sg)
end end
...@@ -18,7 +18,7 @@ function c78663366.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -18,7 +18,7 @@ function c78663366.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c78663366.operation(e,tp,eg,ep,ev,re,r,rp) function c78663366.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 then if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
......
...@@ -14,14 +14,15 @@ function c90219263.cfilter(c) ...@@ -14,14 +14,15 @@ function c90219263.cfilter(c)
return c:IsFaceup() and c:IsCode(76812113) return c:IsFaceup() and c:IsCode(76812113)
end end
function c90219263.condition(e,tp,eg,ep,ev,re,r,rp) function c90219263.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c90219263.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c90219263.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end end
function c90219263.filter(c,e,tp) function c90219263.filter(c,e,tp)
local code=c:GetCode() local code=c:GetCode()
return (code==76812113 or code==12206212) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return (code==76812113 or code==12206212) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c90219263.target(e,tp,eg,ep,ev,re,r,rp,chk) function c90219263.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c90219263.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c90219263.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c90219263.activate(e,tp,eg,ep,ev,re,r,rp) function c90219263.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -16,5 +16,5 @@ function c91468551.initial_effect(c) ...@@ -16,5 +16,5 @@ function c91468551.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c91468551.atktg(e,c) function c91468551.atktg(e,c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL) and c:IsPreviousLocation(LOCATION_GRAVE) return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:IsPreviousLocation(LOCATION_GRAVE)
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