Commit 0119ea38 authored by VanillaSalt's avatar VanillaSalt

fix

parent 2b0d540e
......@@ -1693,6 +1693,9 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 min, int32 max,
auto iter = core.xmaterial_lst.begin();
while((iter != core.xmaterial_lst.end()) && ((iter->first > core.xmaterial_lst.size()) || (iter->first > max)))
core.xmaterial_lst.erase(iter++);
} else {
for(auto pcard : cv)
core.xmaterial_lst.insert(std::make_pair(0, pcard));
}
} else {
pduel->game_field->get_xyz_material(scard, findex, max);
......
......@@ -52,6 +52,7 @@ function c2095764.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
function c2095764.sccon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2
end
......
......@@ -52,6 +52,7 @@ function c30106950.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
function c30106950.sccon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2
end
......
......@@ -52,6 +52,7 @@ function c35089369.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
function c35089369.sccon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2
end
......
......@@ -7,7 +7,6 @@ function c43577607.initial_effect(c)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
......@@ -65,8 +64,8 @@ end
function c43577607.confilter(c)
return c:IsSetCard(0x9e) and c:IsType(TYPE_MONSTER)
end
function c43577607.effcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c43577607.confilter,tp,LOCATION_GRAVE,0,nil)
function c43577607.effcon(e)
local g=Duel.GetMatchingGroup(c43577607.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetAttribute)>=e:GetLabel()
end
function c43577607.atktg(e,c)
......
......@@ -29,7 +29,7 @@ function c53466826.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e1)
......
......@@ -52,6 +52,7 @@ function c66500065.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
function c66500065.sccon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2
end
......
......@@ -49,16 +49,16 @@ function c69327790.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g1=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
local g2=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
local mg=e:GetHandler():GetMaterial()
if mg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,g1:GetFirst())
and Duel.SelectYesNo(tp,aux.Stringid(69327790,2)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g3=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1:GetFirst())
local g3=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g3,1,0,0)
else
e:SetLabel(0)
......
......@@ -23,10 +23,10 @@ function c77723643.initial_effect(c)
c:RegisterEffect(e2)
end
function c77723643.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 chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c77723643.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -36,13 +36,13 @@ function c79967395.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(def)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetValue(atk)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
......@@ -14,7 +14,7 @@ function c91110378.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c91110378.spcon)
e2:SetTarget(c91110378.sptg)
......@@ -43,6 +43,7 @@ function c91110378.spop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.GetOperatedGroup():GetFirst()
if dc:IsSetCard(0x86) and dc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(91110378,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEUP)
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