Commit e3528ec3 authored by VanillaSalt's avatar VanillaSalt

fix

parent 194e0a73
...@@ -441,16 +441,23 @@ uint32 card::get_level() { ...@@ -441,16 +441,23 @@ uint32 card::get_level() {
effect_set effects; effect_set effects;
int32 level = data.level; int32 level = data.level;
temp.level = data.level; temp.level = data.level;
int32 up = 0, upc = 0;
filter_effect(EFFECT_UPDATE_LEVEL, &effects, FALSE); filter_effect(EFFECT_UPDATE_LEVEL, &effects, FALSE);
filter_effect(EFFECT_CHANGE_LEVEL, &effects); filter_effect(EFFECT_CHANGE_LEVEL, &effects);
for (int32 i = 0; i < effects.count; ++i) { for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->code == EFFECT_UPDATE_LEVEL) if (effects[i]->code == EFFECT_UPDATE_LEVEL) {
level += effects[i]->get_value(this); if ((effects[i]->type & EFFECT_TYPE_SINGLE) && !(effects[i]->flag & EFFECT_FLAG_SINGLE_RANGE))
else up += effects[i]->get_value(this);
else
upc += effects[i]->get_value(this);
} else {
level = effects[i]->get_value(this); level = effects[i]->get_value(this);
up = 0;
}
temp.level = level; temp.level = level;
} }
if(level < 1 && (get_type()&TYPE_MONSTER)) level += up + upc;
if(level < 1 && (get_type() & TYPE_MONSTER))
level = 1; level = 1;
temp.level = 0xffffffff; temp.level = 0xffffffff;
return level; return level;
......
...@@ -10,13 +10,14 @@ function c18426196.initial_effect(c) ...@@ -10,13 +10,14 @@ function c18426196.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18426196,0)) e1:SetDescription(aux.Stringid(18426196,0))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CVAL_CHECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c18426196.thcon) e1:SetCondition(c18426196.thcon)
e1:SetCost(c18426196.thcost) e1:SetCost(c18426196.thcost)
e1:SetTarget(c18426196.thtg) e1:SetTarget(c18426196.thtg)
e1:SetOperation(c18426196.thop) e1:SetOperation(c18426196.thop)
e1:SetValue(c18426196.valcheck)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c18426196.condtion(e) function c18426196.condtion(e)
...@@ -28,10 +29,15 @@ function c18426196.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,10 +29,15 @@ function c18426196.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
end end
function c18426196.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c18426196.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) if Duel.GetFlagEffect(tp,18426196)==0 then
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.RegisterFlagEffect(tp,18426196,RESET_CHAIN,0,1)
Duel.SendtoGrave(g,REASON_COST) c18426196[0]=Duel.GetMatchingGroupCount(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,nil)
c18426196[1]=0
end
return c18426196[0]-c18426196[1]>=1
end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end end
function c18426196.filter(c) function c18426196.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand() return c:IsLevelBelow(4) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
...@@ -50,3 +56,6 @@ function c18426196.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,3 +56,6 @@ function c18426196.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end end
end end
function c18426196.valcheck(e)
c18426196[1]=c18426196[1]+1
end
...@@ -82,10 +82,11 @@ function c26400609.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,10 +82,11 @@ function c26400609.retop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c26400609.dfilter(c) function c26400609.dfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end end
function c26400609.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c26400609.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26400609)==0 and e:GetHandler():IsDiscardable() if chk==0 then return Duel.GetFlagEffect(tp,26400609)==0
and e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c26400609.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(c26400609.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c26400609.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c26400609.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
...@@ -94,14 +95,14 @@ function c26400609.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -94,14 +95,14 @@ function c26400609.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,26400609,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,26400609,RESET_PHASE+PHASE_END,0,1)
end end
function c26400609.tgfilter(c) function c26400609.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function c26400609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c26400609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26400609.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c26400609.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function c26400609.tgop(e,tp,eg,ep,ev,re,r,rp) function c26400609.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c26400609.tgfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c26400609.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
......
...@@ -16,12 +16,13 @@ function c27415516.costfilter(c) ...@@ -16,12 +16,13 @@ function c27415516.costfilter(c)
end end
function c27415516.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c27415516.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() and if chk==0 then return Duel.GetFlagEffect(tp,27415516)==0 and c:IsDiscardable()
Duel.IsExistingMatchingCard(c27415516.costfilter,tp,LOCATION_HAND,0,1,c) end and Duel.IsExistingMatchingCard(c27415516.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c27415516.costfilter,tp,LOCATION_HAND,0,1,1,c) local g=Duel.SelectMatchingCard(tp,c27415516.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c) g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,27415516,RESET_PHASE+PHASE_END,0,1)
end end
function c27415516.spfilter(c,e,tp) function c27415516.spfilter(c,e,tp)
return c:IsCode(26400609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(26400609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -34,7 +35,12 @@ end ...@@ -34,7 +35,12 @@ end
function c27415516.spop(e,tp,eg,ep,ev,re,r,rp) function c27415516.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
local tc=Duel.GetFirstMatchingCard(c27415516.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local tc=Duel.GetFirstMatchingCard(c27415516.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end end
end end
...@@ -4,16 +4,24 @@ function c30042158.initial_effect(c) ...@@ -4,16 +4,24 @@ function c30042158.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30042158,0)) e1:SetDescription(aux.Stringid(30042158,0))
e1:SetCategory(CATEGORY_DRAW) e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CVAL_CHECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_REMOVE) e1:SetCode(EVENT_REMOVE)
e1:SetCost(c30042158.cost) e1:SetCost(c30042158.cost)
e1:SetTarget(c30042158.target) e1:SetTarget(c30042158.target)
e1:SetOperation(c30042158.operation) e1:SetOperation(c30042158.operation)
e1:SetValue(c30042158.valcheck)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c30042158.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c30042158.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then
if Duel.GetFlagEffect(tp,30042158)==0 then
Duel.RegisterFlagEffect(tp,30042158,RESET_CHAIN,0,1)
c30042158[0]=Duel.GetMatchingGroupCount(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,nil)
c30042158[1]=0
end
return c30042158[0]-c30042158[1]>=1
end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST) Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end end
function c30042158.target(e,tp,eg,ep,ev,re,r,rp,chk) function c30042158.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -26,3 +34,6 @@ function c30042158.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,3 +34,6 @@ function c30042158.operation(e,tp,eg,ep,ev,re,r,rp)
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.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
function c30042158.valcheck(e)
c30042158[1]=c30042158[1]+1
end
...@@ -26,17 +26,18 @@ function c40619825.initial_effect(c) ...@@ -26,17 +26,18 @@ function c40619825.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(40619825,0)) e4:SetDescription(aux.Stringid(40619825,0))
e4:SetCategory(CATEGORY_TODECK) e4:SetCategory(CATEGORY_TODECK)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CVAL_CHECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c40619825.tdcon) e4:SetCondition(c40619825.tdcon)
e4:SetCost(c40619825.tdcost) e4:SetCost(c40619825.tdcost)
e4:SetTarget(c40619825.tdtg) e4:SetTarget(c40619825.tdtg)
e4:SetOperation(c40619825.tdop) e4:SetOperation(c40619825.tdop)
e4:SetValue(c40619825.valcheck)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c40619825.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c40619825.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
...@@ -52,9 +53,16 @@ function c40619825.tdcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,9 +53,16 @@ function c40619825.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function c40619825.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) function c40619825.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.TRUE,1,nil) end if chk==0 then
local rg=Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,nil) if Duel.GetFlagEffect(tp,40619825)==0 then
Duel.Release(rg,REASON_COST) Duel.RegisterFlagEffect(tp,40619825,RESET_CHAIN,0,1)
c40619825[0]=Duel.GetReleaseGroupCount(tp)
c40619825[1]=0
end
return c40619825[0]-c40619825[1]>=1
end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end end
function c40619825.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c40619825.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end if chk==0 then return e:GetHandler():IsAbleToDeck() end
...@@ -65,3 +73,6 @@ function c40619825.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,3 +73,6 @@ function c40619825.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT) Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT)
end end
end end
function c40619825.valcheck(e)
c40619825[1]=c40619825[1]+1
end
...@@ -42,7 +42,7 @@ function c47754278.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,7 +42,7 @@ function c47754278.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if Duel.GetFlagEffect(tp,47754278)==0 then if Duel.GetFlagEffect(tp,47754278)==0 then
Duel.RegisterFlagEffect(tp,47754278,RESET_CHAIN,0,1) Duel.RegisterFlagEffect(tp,47754278,RESET_CHAIN,0,1)
c47754278[0]=Duel.GetReleaseGroup():GetCount() c47754278[0]=Duel.GetReleaseGroupCount(tp)
c47754278[1]=0 c47754278[1]=0
end end
return c47754278[0]-c47754278[1]>=1 return c47754278[0]-c47754278[1]>=1
......
...@@ -52,7 +52,7 @@ function c49221191.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function c49221191.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0) e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE_FINAL) e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
......
...@@ -83,10 +83,11 @@ function c53804307.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,10 +83,11 @@ function c53804307.retop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c53804307.dfilter(c) function c53804307.dfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDiscardable() return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end end
function c53804307.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c53804307.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,53804307)==0 and e:GetHandler():IsDiscardable() if chk==0 then return Duel.GetFlagEffect(tp,53804307)==0
and e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c53804307.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(c53804307.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c53804307.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c53804307.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
......
...@@ -11,9 +11,6 @@ function c54813225.initial_effect(c) ...@@ -11,9 +11,6 @@ function c54813225.initial_effect(c)
e1:SetOperation(c54813225.spop) e1:SetOperation(c54813225.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c54813225.cfilter(c)
return c:IsFaceup() and c:IsAbleToHandAsCost()
end
function c54813225.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c54813225.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1 local ct=-ft+1
......
...@@ -21,7 +21,7 @@ function c65961085.retcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,7 +21,7 @@ function c65961085.retcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,65961085,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,65961085,RESET_PHASE+PHASE_END,0,1)
end end
function c65961085.filter(c) function c65961085.filter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToDeck() return c:IsFaceup() and c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end end
function c65961085.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c65961085.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c65961085.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c65961085.filter(chkc) end
...@@ -31,7 +31,7 @@ function c65961085.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -31,7 +31,7 @@ function c65961085.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end end
function c65961085.filter2(c) function c65961085.filter2(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) return c:IsFaceup() and c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL)
end end
function c65961085.retop(e,tp,eg,ep,ev,re,r,rp) function c65961085.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
......
...@@ -15,7 +15,7 @@ function c80208323.initial_effect(c) ...@@ -15,7 +15,7 @@ function c80208323.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c80208323.spfilter(c,tp) function c80208323.spfilter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp and c:IsType(TYPE_MONSTER) return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:GetPreviousControler()==tp and c:IsType(TYPE_MONSTER)
end end
function c80208323.spcon(e,tp,eg,ep,ev,re,r,rp) function c80208323.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c80208323.spfilter,1,nil,tp) return eg:IsExists(c80208323.spfilter,1,nil,tp)
......
...@@ -4,7 +4,7 @@ function c82050203.initial_effect(c) ...@@ -4,7 +4,7 @@ function c82050203.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82050203,0)) e1:SetDescription(aux.Stringid(82050203,0))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c82050203.retcon) e1:SetCondition(c82050203.retcon)
......
...@@ -63,7 +63,7 @@ function c85121942.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +63,7 @@ function c85121942.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c85121942.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c85121942.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetFirst():GetTextAttack()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,g:GetFirst():GetAttack())
end end
function c85121942.desop(e,tp,eg,ep,ev,re,r,rp) function c85121942.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -32,10 +32,10 @@ function c88177324.negcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,10 +32,10 @@ function c88177324.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c88177324.filter1(c) function c88177324.filter1(c)
return c:IsType(TYPE_EFFECT) return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end end
function c88177324.filter2(c) function c88177324.filter2(c)
return c:GetAttack()~=c:GetBaseAttack() or c:GetDefence()~=c:GetBaseDefence() return c:IsFaceup() and (c:GetAttack()~=c:GetBaseAttack() or c:GetDefence()~=c:GetBaseDefence())
end end
function c88177324.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function c88177324.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return if chk==0 then return
......
...@@ -82,10 +82,11 @@ function c89399912.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,10 +82,11 @@ function c89399912.retop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c89399912.dfilter(c) function c89399912.dfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsDiscardable() return c:IsAttribute(ATTRIBUTE_WIND) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end end
function c89399912.shcost(e,tp,eg,ep,ev,re,r,rp,chk) function c89399912.shcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,89399912)==0 and e:GetHandler():IsDiscardable() if chk==0 then return Duel.GetFlagEffect(tp,89399912)==0
and e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c89399912.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(c89399912.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c89399912.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c89399912.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
......
...@@ -83,10 +83,11 @@ function c90411554.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,10 +83,11 @@ function c90411554.retop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c90411554.dfilter(c) function c90411554.dfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsDiscardable() return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end end
function c90411554.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c90411554.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,90411554)==0 and e:GetHandler():IsDiscardable() if chk==0 then return Duel.GetFlagEffect(tp,90411554)==0
and e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c90411554.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(c90411554.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c90411554.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c90411554.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
......
...@@ -16,12 +16,13 @@ function c91020571.costfilter(c) ...@@ -16,12 +16,13 @@ function c91020571.costfilter(c)
end end
function c91020571.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c91020571.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() and if chk==0 then return Duel.GetFlagEffect(tp,91020571)==0 and c:IsDiscardable()
Duel.IsExistingMatchingCard(c91020571.costfilter,tp,LOCATION_HAND,0,1,c) end and Duel.IsExistingMatchingCard(c91020571.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c91020571.costfilter,tp,LOCATION_HAND,0,1,1,c) local g=Duel.SelectMatchingCard(tp,c91020571.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c) g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,91020571,RESET_PHASE+PHASE_END,0,1)
end end
function c91020571.spfilter(c,e,tp) function c91020571.spfilter(c,e,tp)
return c:IsCode(90411554) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(90411554) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -34,7 +35,12 @@ end ...@@ -34,7 +35,12 @@ end
function c91020571.spop(e,tp,eg,ep,ev,re,r,rp) function c91020571.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
local tc=Duel.GetFirstMatchingCard(c91020571.spfilter,tp,LOCATION_DECK,0,nil,e,tp) local tc=Duel.GetFirstMatchingCard(c91020571.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end end
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