Commit 55faecea authored by argon.sun's avatar argon.sun

fix

parent 5db2e987
......@@ -1194,21 +1194,28 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
else
min = 2;
min -= returns.bvalue[0];
effect_set eset;
target->filter_effect(EFFECT_DECREASE_TRIBUTE, &eset);
for(int32 i = 0; i < eset.count; ++i) {
if(!(eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT)) {
int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff;
if(min > 0) {
effect_set eset;
target->filter_effect(EFFECT_DECREASE_TRIBUTE, &eset);
for(int32 i = 0; i < eset.count; ++i) {
if(!(eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT)) {
int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff;
}
}
}
for(int32 i = 0; i < eset.count; ++i) {
if(min <= 0)
break;
if((eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT) && (eset[i]->reset_count & 0xf00) > 0) {
int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff;
eset[i]->dec_count();
for(int32 i = 0; i < eset.count && min > 0; ++i) {
if((eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT) && (eset[i]->reset_count & 0xf00) > 0 && eset[i]->target) {
int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff;
eset[i]->dec_count();
}
}
for(int32 i = 0; i < eset.count && min > 0; ++i) {
if((eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT) && (eset[i]->reset_count & 0xf00) > 0 && !eset[i]->target) {
int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff;
eset[i]->dec_count();
}
}
}
if(returns.bvalue[0]) {
......
......@@ -16,7 +16,6 @@ function c18988391.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c18988391.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(18988391,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DECREASE_TRIBUTE)
e1:SetTargetRange(LOCATION_HAND,0)
......
--ヴェルズ·ケルキオン
function c4756629.initial_effect(c)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetDescription(aux.Stringid(4756629,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c4756629.thcost)
e1:SetTarget(c4756629.thtg)
e1:SetOperation(c4756629.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(4756629,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c4756629.sumcon)
e2:SetTarget(c4756629.sumtg)
e2:SetOperation(c4756629.sumop)
c:RegisterEffect(e2)
--decrease tribute
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c4756629.decop)
c:RegisterEffect(e3)
end
function c4756629.rmfilter(c,tp)
return c:IsSetCard(0xa) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
and Duel.IsExistingTarget(c4756629.filter,tp,LOCATION_GRAVE,0,1,c)
end
function c4756629.filter(c)
return c:IsSetCard(0xa) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c4756629.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,4756629)==0
and Duel.IsExistingMatchingCard(c4756629.rmfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c4756629.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,4756629,RESET_PHASE+PHASE_END,0,1)
end
function c4756629.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c4756629.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c4756629.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c4756629.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:RegisterFlagEffect(4756629,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c4756629.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(4756629)~=0
end
function c4756629.sumfilter(c)
return c:IsSetCard(0xa) and c:IsSummonable(true,nil)
end
function c4756629.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4756629.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c4756629.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c4756629.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c4756629.decop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsReason(REASON_RETURN) or Duel.GetFlagEffect(tp,4756630)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DECREASE_TRIBUTE)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetTarget(c4756629.rfilter)
e1:SetCountLimit(1)
e1:SetValue(0x1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,4756630,RESET_PHASE+PHASE_END,0,1)
end
function c4756629.rfilter(e,c)
return c:IsSetCard(0xa)
end
......@@ -13,15 +13,18 @@ end
function c55465441.filter(c,e,tp)
return c:GetLevel()>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENCE,1-tp)
end
function c55465441.filter2(c)
return c:IsFaceup() and not c:IsType(TYPE_XYZ)
end
function c55465441.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c55465441.filter2,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c55465441.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c55465441.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
local g2=Duel.SelectTarget(tp,c55465441.filter2,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g2:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
......
--セイクリッド·ソンブレス
function c78358521.initial_effect(c)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetDescription(aux.Stringid(78358521,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c78358521.thcost)
e1:SetTarget(c78358521.thtg)
e1:SetOperation(c78358521.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(78358521,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c78358521.sumcon)
e2:SetTarget(c78358521.sumtg)
e2:SetOperation(c78358521.sumop)
c:RegisterEffect(e2)
--decrease tribute
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c78358521.decop)
c:RegisterEffect(e3)
end
function c78358521.rmfilter(c,tp)
return c:IsSetCard(0x53) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
and Duel.IsExistingTarget(c78358521.filter,tp,LOCATION_GRAVE,0,1,c)
end
function c78358521.filter(c)
return c:IsSetCard(0x53) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c78358521.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,78358521)==0
and Duel.IsExistingMatchingCard(c78358521.rmfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c78358521.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,78358521,RESET_PHASE+PHASE_END,0,1)
end
function c78358521.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c78358521.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c78358521.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c78358521.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:RegisterFlagEffect(78358521,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c78358521.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(78358521)~=0
end
function c78358521.sumfilter(c)
return c:IsSetCard(0x53) and c:IsSummonable(true,nil)
end
function c78358521.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78358521.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c78358521.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c78358521.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c78358521.decop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsReason(REASON_RETURN) or Duel.GetFlagEffect(tp,78358522)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DECREASE_TRIBUTE)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetTarget(c78358521.rfilter)
e1:SetCountLimit(1)
e1:SetValue(0x1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,78358522,RESET_PHASE+PHASE_END,0,1)
end
function c78358521.rfilter(e,c)
return c:IsSetCard(0x53)
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