Commit c1ef7f4d authored by Fluorohydride's avatar Fluorohydride

Merge pull request #212 from VanillaSalt/patch23

fix
parents 8d9733f9 620cfa06
......@@ -2966,7 +2966,7 @@ int32 scriptlib::duel_venom_swamp_check(lua_State *L) {
up += eset[i]->get_value(pcard);
else
upc += eset[i]->get_value(pcard);
if(pcard->temp.attack)
if(pcard->temp.attack > 0)
peffect = eset[i];
break;
}
......
......@@ -849,7 +849,7 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play
set_control(pcard1, p2, reset_phase, reset_count);
set_control(pcard2, p1, reset_phase, reset_count);
pcard1->reset(RESET_CONTROL, RESET_EVENT);
pcard1->reset(RESET_CONTROL, RESET_EVENT);
pcard2->reset(RESET_CONTROL, RESET_EVENT);
pcard1->filter_disable_related_cards();
pcard2->filter_disable_related_cards();
adjust_instant();
......@@ -962,7 +962,7 @@ int32 field::control_adjust(uint16 step) {
add_card(p2, pcard1, l2, s2);
add_card(p1, pcard2, l1, s1);
pcard1->reset(RESET_CONTROL, RESET_EVENT);
pcard1->reset(RESET_CONTROL, RESET_EVENT);
pcard2->reset(RESET_CONTROL, RESET_EVENT);
pduel->write_buffer8(MSG_SWAP);
pduel->write_buffer32(pcard1->data.code);
pduel->write_buffer8(pcard2->current.controler);
......@@ -2553,7 +2553,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
}
if((s1 != d1) && (s1 > 0)) {
card* ptop = player[1].list_main[s0];
card* ptop = player[1].list_main[s1];
if(core.deck_reversed || (ptop->current.position == POS_FACEUP_DEFENCE)) {
pduel->write_buffer8(MSG_DECK_TOP);
pduel->write_buffer8(1);
......
......@@ -18,7 +18,7 @@ function c1801154.initial_effect(c)
c:RegisterEffect(e2)
end
function c1801154.filter2(c,code)
if not c.material_count or not c:IsReason(REASON_DESTROY) then return false end
if not c.material_count or not c:IsReason(REASON_DESTROY) or not c:IsReason(REASON_EFFECT) then return false end
for i=1,c.material_count do
if code==c.material[i] then return true end
end
......
......@@ -30,6 +30,7 @@ function c21237481.target1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SelectYesNo(tp,aux.Stringid(21237481,1)) then
e:SetCategory(CATEGORY_DAMAGE)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c21237481.costfilter,tp,LOCATION_HAND,0,1,60,nil)
Duel.SendtoGrave(cg,REASON_COST+REASON_DISCARD)
local dam=cg:GetCount()*500
......@@ -45,6 +46,7 @@ function c21237481.target1(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c21237481.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21237481.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c21237481.costfilter,tp,LOCATION_HAND,0,1,60,nil)
Duel.SendtoGrave(cg,REASON_COST+REASON_DISCARD)
e:SetLabel(cg:GetCount())
......
......@@ -58,7 +58,7 @@ function c30353551.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c30353551.filter,tp,LOCATION_DECK,0,c30353551[tp],c30353551[tp],nil,e,tp)
if g:GetCount()==0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,0)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
elseif ft>=g:GetCount() then
......
......@@ -36,7 +36,7 @@ function c33981008.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(c33981008.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function c33981008.filter(c)
return c:IsSetCard(0x106e) and c:GetCode()~=33981008 and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
return c:IsSetCard(0x106e) and c:GetCode()~=33981008 and c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c33981008.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(c33981008.filter,tp,LOCATION_GRAVE,0,1,nil) end
......
......@@ -11,6 +11,9 @@ function c35073065.initial_effect(c)
e1:SetTarget(c35073065.sptg)
e1:SetOperation(c35073065.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_MSET)
c:RegisterEffect(e2)
end
function c35073065.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
......@@ -18,7 +21,7 @@ function c35073065.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c35073065.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetTargetCard(eg)
......@@ -27,7 +30,7 @@ end
function c35073065.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=eg:GetFirst()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) then
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
if ec:IsRelateToEffect(e) and ec:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -30,7 +30,6 @@ end
function c36623431.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
......
......@@ -14,7 +14,6 @@ function c4335645.initial_effect(c)
end
function c4335645.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and e:GetHandler():GetReasonCard():IsRelateToBattle()
end
function c4335645.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
......
......@@ -26,7 +26,7 @@ function c49460512.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c49460512.cfilter,1,nil,tp)
end
function c49460512.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
......
......@@ -34,10 +34,16 @@ end
function c5556499.spcon(e,c)
if c==nil then return true end
local g=Duel.GetMatchingGroup(c5556499.spfilter,c:GetControler(),LOCATION_HAND,0,nil,c)
if c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) then
g:RemoveCard(c)
end
return g:CheckWithSumGreater(Card.GetLevel,8)
end
function c5556499.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c5556499.spfilter,c:GetControler(),LOCATION_HAND,0,nil,c)
if c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) then
g:RemoveCard(c)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=g:SelectWithSumGreater(tp,Card.GetLevel,8)
Duel.SendtoGrave(sg,REASON_COST+REASON_DISCARD)
......
......@@ -41,7 +41,7 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp)
e:SetProperty(te:GetProperty())
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
Duel.ChangePosition(tc,POS_FACEUP)
if tc:GetType()==TYPE_TYPE then
if tc:GetType()==TYPE_TRAP then
tc:CancelToGrave(false)
end
tc:CreateEffectRelation(te)
......
......@@ -62,7 +62,7 @@ function c73398797.desop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c73398797.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c73398797[tp] and e:GetHandler():IsReleasable()end
if chk==0 then return c73398797[tp] and e:GetHandler():IsReleasable() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......@@ -77,8 +77,8 @@ function c73398797.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73398797.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c73398797.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,18 +24,18 @@ end
function c77700347.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END+RESET_OPPO_TURN)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END+RESET_OPPO_TURN)
tc:RegisterEffect(e2)
end
end
......@@ -38,7 +38,7 @@ function c88307361.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function c88307361.sumop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,0)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c88307361.filter,tp,LOCATION_DECK,0,ft,ft,nil,e,tp)
......
......@@ -41,7 +41,6 @@ end
function c91819979.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
......
......@@ -19,7 +19,7 @@ function c9327502.filter(c,e,tp)
end
function c9327502.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c9327502.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c9327502.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9327502.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
......
......@@ -50,7 +50,7 @@ function c94243005.spfilter(c,e,tp)
end
function c94243005.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c94243005.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c94243005.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c94243005.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp)
......
......@@ -16,7 +16,7 @@ function c98495314.initial_effect(c)
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e3)
--Equip limit
local e4=Effect.CreateEffect(c)
......
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