Commit a6f6e761 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #197 from VanillaSalt/patch20

fix script
parents 482f96ce d06e941a
......@@ -2,7 +2,6 @@
function c10759529.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c10759529.condition)
......
......@@ -8,7 +8,6 @@ function c13722870.initial_effect(c)
e1:SetDescription(aux.Stringid(13722870,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c13722870.spcon)
e1:SetTarget(c13722870.sptg)
......
......@@ -8,7 +8,7 @@ function c13803864.initial_effect(c)
e1:SetDescription(aux.Stringid(13803864,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetCondition(c13803864.spcon)
e1:SetTarget(c13803864.sptg)
......
......@@ -54,7 +54,7 @@ function c14291024.filter(c)
end
function c14291024.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c14291024.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c14291024.splimit(e,se,sp,st,pos,top)
......
......@@ -46,14 +46,12 @@ function c20057949.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c20057949.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c20057949.spcon)
e1:SetTarget(c20057949.sptg)
e1:SetOperation(c20057949.spop)
e1:SetCondition(c20057949.spcon1)
e1:SetOperation(c20057949.spop1)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
......@@ -61,18 +59,33 @@ function c20057949.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.RegisterEffect(e1,tp)
end
function c20057949.spcon(e,tp,eg,ep,ev,re,r,rp)
function c20057949.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function c20057949.filter(c,e,tp)
return c:IsSetCard(0x31) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20057949.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20057949.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
function c20057949.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20057949.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(20057949,0)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(20057949,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetTarget(c20057949.sptg2)
e1:SetOperation(c20057949.spop2)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
Duel.RegisterEffect(e1,tp)
end
end
function c20057949.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c20057949.spop(e,tp,eg,ep,ev,re,r,rp)
function c20057949.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>2 then ft=2 end
......
......@@ -16,11 +16,11 @@ function c21296383.spfilter(c,e,tp)
and c:IsCanBeEffectTarget(e)
end
function c21296383.cfilter(c,lv)
return c:IsFaceup() and c:IsAbleToRemove() and c:IsLevelAbove(lv)
return c:IsFaceup() and c:IsAbleToRemoveAsCost() and c:IsLevelAbove(lv)
end
function c21296383.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sg=Duel.GetMatchingGroup(c21296383.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc==0 then return sg:IsContains(chkc) and chkc:IsLevelBelow(e:GetLabel()) end
if chkc then return sg:IsContains(chkc) and chkc:IsLevelBelow(e:GetLabel()) end
if sg:GetCount()==0 then return false end
local sg,mlv=sg:GetMinGroup(Card.GetLevel)
local elv=e:GetHandler():GetLevel()
......
......@@ -27,7 +27,8 @@ end
function c21558682.filter(c)
return c:IsFaceup() and c:IsCode(31709826)
end
function c21558682.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
function c21558682.atktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c21558682.filter(chkc) end
if chk==0 then return true end
e:SetProperty(0)
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer() then
......@@ -39,7 +40,8 @@ function c21558682.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
end
function c21558682.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c21558682.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c21558682.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c21558682.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -20,7 +20,7 @@ function c23842445.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(23842445,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c23842445.damcon)
......
......@@ -39,7 +39,8 @@ end
function c24694698.filter(c)
return c:IsSetCard(0x2a) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c24694698.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c24694698.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c24694698.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24694698.filter,tp,LOCATION_GRAVE,0,2,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c24694698.filter,tp,LOCATION_GRAVE,0,2,2,nil)
......
......@@ -23,12 +23,14 @@ function c25435080.cost(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1)
return true
end
function c25435080.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c25435080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c25435080.tfilter(chkc) end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c25435080.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectMatchingCard(tp,c25435080.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetAttack())
......
......@@ -25,7 +25,7 @@ function c29155212.filter(c)
return c:IsFaceup() and c:IsCode(62121)
end
function c29155212.adval(e,c)
if Duel.IsExistingMatchingCard(c29155212.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
if Duel.IsExistingMatchingCard(c29155212.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return 100+c:GetFlagEffect(29155212)*100
else
return c:GetFlagEffect(29155212)*100
......
......@@ -15,7 +15,7 @@ function c3019642.initial_effect(c)
e2:SetDescription(aux.Stringid(3019642,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetTarget(c3019642.damtg)
e2:SetOperation(c3019642.damop)
......
......@@ -17,7 +17,8 @@ end
function c30494314.filter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and not c:IsType(TYPE_XYZ)
end
function c30494314.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c30494314.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c30494314.filter(chkc) end
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT)
and Duel.IsExistingTarget(c30494314.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
......
......@@ -26,7 +26,8 @@ end
function c3536537.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:IsDestructable()
end
function c3536537.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c3536537.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c3536537.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c3536537.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -18,10 +18,10 @@ end
function c40703393.rmfilter(c)
return c:GetLevel()>0 and c:IsAbleToRemove()
end
function c40703393.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c40703393.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then ft=-ft+1 end
if ft<=0 then ft=-ft+1 else ft=1 end
if chk==0 then
local rg=Duel.GetMatchingGroup(c40703393.rmfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingTarget(c40703393.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,ft,rg)
......@@ -29,16 +29,17 @@ function c40703393.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetMatchingGroup(c40703393.rmfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40703393.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,ft,rg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c40703393.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then ft=-ft+1 end
if ft<=0 then ft=-ft+1 else ft=1 end
if not tc:IsRelateToEffect(e) or not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
local rg=Duel.GetMatchingGroup(c40703393.rmfilter,tp,LOCATION_MZONE,0,nil)
local lv=tc:GetLevel()
if rg:CheckWithSumEqual(Card.GetLevel,lv,ft,99) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rm=rg:SelectWithSumEqual(tp,Card.GetLevel,lv,ft,99)
Duel.Remove(rm,POS_FACEUP,REASON_EFFECT)
Duel.BreakEffect()
......
......@@ -3,10 +3,10 @@ function c41639001.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41639001,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c41639001.spcon)
......@@ -15,7 +15,11 @@ function c41639001.initial_effect(c)
c:RegisterEffect(e1)
end
function c41639001.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
local c=e:GetHandler()
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(c) then return false end
return re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsActiveType(TYPE_MONSTER)
end
function c41639001.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -29,7 +29,7 @@ function c47274077.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCondition(c47274077.damcon)
e4:SetTarget(c47274077.damtg)
e4:SetOperation(c47274077.damop)
......
......@@ -5,7 +5,6 @@ function c50893987.initial_effect(c)
e1:SetDescription(aux.Stringid(50893987,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c50893987.sccon)
e1:SetCost(c50893987.sccost)
......@@ -35,8 +34,7 @@ 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.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c50893987.scfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(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,6 @@ function c5128859.initial_effect(c)
e3:SetDescription(aux.Stringid(5128859,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c5128859.destg)
......
......@@ -18,7 +18,8 @@ end
function c58324930.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c58324930.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c58324930.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c58324930.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c58324930.filter,tp,0,LOCATION_GRAVE,1,1,nil)
......
......@@ -14,7 +14,7 @@ function c61844784.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c61844784.addct(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:Location(LOCATION_SZONE) and chkc:IsControler(tp) and c61844784.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c61844784.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61844784.filter,tp,LOCATION_SZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(61844784,0))
Duel.SelectTarget(tp,c61844784.filter,tp,LOCATION_SZONE,0,1,1,e:GetHandler())
......
......@@ -51,7 +51,8 @@ end
function c6276588.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x11) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6276588.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c6276588.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c6276588.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c6276588.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -19,7 +19,8 @@ function c63442604.cfilter(c,tp)
return c:IsFaceup() and c:GetLevel()>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,63442605,0,0x11,c:GetAttack(),c:GetDefence(),c:GetLevel(),c:GetRace(),c:GetAttribute())
end
function c63442604.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c63442604.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c63442604.cfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsExistingTarget(c63442604.cfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
......
......@@ -6,7 +6,6 @@ function c64514622.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(64514622,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(aux.IsDualState)
e1:SetCost(c64514622.cost)
......
......@@ -53,15 +53,15 @@ function c67775894.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c67775894.drcost(e,tp,eg,ep,ev,re,r,rp,chkc)
function c67775894.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc==0 then return c:IsAbleToGraveAsCost() and c:GetControler()==c:GetEquipTarget():GetControler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:GetControler()==c:GetEquipTarget():GetControler()
and c:GetEquipTarget():IsAbleToGraveAsCost() end
local g=Group.FromCards(c,c:GetEquipTarget())
Duel.SendtoGrave(g,REASON_COST)
end
function c67775894.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
......
......@@ -19,7 +19,7 @@ function c67904682.initial_effect(c)
e2:SetDescription(aux.Stringid(67904682,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c67904682.spcon2)
e2:SetTarget(c67904682.sptg2)
......
......@@ -4,7 +4,6 @@ function c6850209.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c6850209.target)
e1:SetOperation(c6850209.activate)
......
......@@ -4,7 +4,6 @@ function c71717923.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71717923,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c71717923.descost)
......
......@@ -24,7 +24,8 @@ end
function c72580321.filter(c,e,tp)
return c:IsLevelBelow(4) and not c:IsCode(72580321) and c:IsRace(RACE_ROCK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72580321.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c72580321.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c72580321.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c72580321.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -17,7 +17,8 @@ end
function c81601517.filter(c)
return c:IsFaceup() and c:IsType(TYPE_DUAL) and c:IsCanTurnSet()
end
function c81601517.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c81601517.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c81601517.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c81601517.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c81601517.filter,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -4,7 +4,6 @@ function c82052602.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c82052602.condition)
......
......@@ -20,7 +20,8 @@ end
function c84136000.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84136000.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c84136000.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c84136000.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
......
......@@ -2,7 +2,7 @@
function c86988864.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86988864,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
......
......@@ -28,6 +28,6 @@ function c87751584.desop(e,tp,eg,ep,ev,re,r,rp)
if ct==0 or ct>g:GetCount() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,ct,ct,nil)
Duel.HintSelection(sg)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
......@@ -39,9 +39,11 @@ function c88190790.condition(e,tp,eg,ep,ev,re,r,rp)
e:SetLabelObject(tc)
return g:GetCount()==1 and tc:IsFaceup() and tc:IsRace(RACE_WARRIOR)
end
function c88190790.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject() end
Duel.SetTargetCard(e:GetLabelObject())
function c88190790.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject()
if chkc then return chkc==tc end
if chk==0 then return tc and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c88190790.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -54,9 +56,9 @@ end
function c88190790.macon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c88190790.macost(e,tp,eg,ep,ev,re,r,rp,chkc)
function c88190790.macost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc==0 then return c:IsAbleToGraveAsCost() end
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SetTargetCard(c:GetEquipTarget())
Duel.SendtoGrave(c,REASON_COST)
end
......
......@@ -24,7 +24,7 @@ function c89609515.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
......
......@@ -17,7 +17,7 @@ function c93108433.hfilter(c,tp)
return tp~=c:GetOwner()
end
function c93108433.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c93108433.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c93108433.mfilter(chkc,tp) end
if chk==0 then return Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingTarget(c93108433.mfilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),tp)
and not Duel.IsExistingMatchingCard(c93108433.hfilter,tp,LOCATION_HAND,0,1,nil,tp)
......
......@@ -4,7 +4,6 @@ function c94681654.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c94681654.cost)
e1:SetTarget(c94681654.target)
......@@ -24,7 +23,7 @@ function c94681654.filter(c)
return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c94681654.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c94681654.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c94681654.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c94681654.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,12 +30,12 @@ function c9583383.atkcon(e)
return not Duel.IsExistingMatchingCard(c9583383.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c9583383.rfilter(c,tp)
local lv=c:GEtLevel()
local lv=c:GetLevel()
return lv>0 and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c9583383.tfilter,tp,LOCATION_MZONE,0,1,nil,lv)
end
function c9583383.tfilter(c,clv)
local lv=c:GEtLevel()
local lv=c:GetLevel()
return lv>0 and lv~=clv and c:IsFaceup() and c:IsSetCard(0x54)
end
function c9583383.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -23,7 +23,7 @@ function c96458440.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCondition(c96458440.damcon)
e4:SetTarget(c96458440.damtg)
e4:SetOperation(c96458440.damop)
......
......@@ -4,7 +4,6 @@ function c97526666.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97526666,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c97526666.cost)
......
......@@ -3,6 +3,7 @@ function c98792570.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(0)
e1:SetCost(c98792570.cost)
......@@ -17,7 +18,8 @@ end
function c98792570.cfilter(c,e,tp)
return c:GetTextAttack()>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,c)
end
function c98792570.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c98792570.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
......
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