Commit f953e5b6 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #494 from VanillaSalt/patch62

fix
parents 4a4945f1 8e2d687d
......@@ -8,7 +8,6 @@ function c14306092.initial_effect(c)
e1:SetDescription(aux.Stringid(14306092,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c14306092.ctcost)
......
......@@ -40,7 +40,7 @@ function c16366810.retcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c16366810.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c16366810.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local prec=e:GetHandler():GetPreviousControler()
......
......@@ -6,7 +6,7 @@ function c2061963.initial_effect(c)
--negate activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2061963,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DAMAGE)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
......@@ -31,7 +31,7 @@ end
function c2061963.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and (ph>PHASE_MAIN1 and ph<PHASE_MAIN2) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
and (ph>PHASE_MAIN1 and ph<PHASE_MAIN2) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c2061963.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......@@ -39,11 +39,11 @@ function c2061963.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c2061963.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c2061963.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) then
if Duel.NegateActivation(ev) then
Duel.Damage(1-tp,800,REASON_EFFECT)
end
end
......
......@@ -11,7 +11,7 @@ function c21558682.initial_effect(c)
--change target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21558682,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
......@@ -21,8 +21,7 @@ function c21558682.initial_effect(c)
c:RegisterEffect(e2)
end
function c21558682.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return tp~=Duel.GetTurnPlayer() and at and (at:IsFacedown() or not at:IsCode(31709826))
return tp~=Duel.GetTurnPlayer() and Duel.GetAttackTarget()~=nil
end
function c21558682.filter(c)
return c:IsFaceup() and c:IsCode(31709826)
......@@ -33,18 +32,19 @@ function c21558682.atktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetProperty(0)
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and tp~=Duel.GetTurnPlayer() then
local at=Duel.GetAttackTarget()
if at and (at:IsFacedown() or not at:IsCode(31709826)) and Duel.IsExistingTarget(c21558682.filter,tp,LOCATION_MZONE,0,1,nil) then
if at and Duel.IsExistingTarget(c21558682.filter,tp,LOCATION_MZONE,0,1,at) and Duel.SelectYesNo(tp,aux.Stringid(21558682,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,at)
end
end
end
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
local at=Duel.GetAttackTarget()
if chk==0 then return Duel.IsExistingTarget(c21558682.filter,tp,LOCATION_MZONE,0,1,at) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c21558682.filter,tp,LOCATION_MZONE,0,1,1,at)
end
function c21558682.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -28,7 +28,7 @@ function c21843307.activate(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,ec:GetCode(),0,0x11,0,0,ec:GetLevel(),RACE_WARRIOR,ATTRIBUTE_LIGHT) then return end
c:AddTrapMonsterAttribute(0,ATTRIBUTE_LIGHT,RACE_WARRIOR,ec:GetLevel(),0,0)
c:AddTrapMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_LIGHT,RACE_WARRIOR,ec:GetLevel(),0,0)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -24,7 +24,7 @@ function c28649820.activate(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,28649820,0,0x11,1600,1800,4,RACE_REPTILE,ATTRIBUTE_EARTH) then return end
c:AddTrapMonsterAttribute(0,ATTRIBUTE_EARTH,RACE_REPTILE,4,1600,1800)
c:AddTrapMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_EARTH,RACE_REPTILE,4,1600,1800)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
end
......@@ -36,7 +36,7 @@ function c29146185.checkop(e,tp,eg,ep,ev,re,r,rp)
c29146185[1]=Duel.GetFlagEffect(1,29146185)
local tc=eg:GetFirst()
while tc do
sump=tc:GetSummonPlayer()
local sump=tc:GetSummonPlayer()
if c29146185[sump]==0 then
if tc:GetCode()==29146185 and Duel.GetFlagEffect(sump,29146186)==0 then
tc:RegisterFlagEffect(29146185,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
......@@ -69,7 +69,7 @@ function c29146185.filter(c)
end
function c29146185.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c29146185.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29146185.filter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c29146185.filter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c29146185.filter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
......@@ -88,10 +88,16 @@ function c29146185.cffilter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and not c:IsPublic()
end
function c29146185.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29146185.cffilter,tp,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c29146185.cffilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.ConfirmCards(1-tp,g)
local g=Duel.GetMatchingGroup(c29146185.cffilter,tp,LOCATION_HAND,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=4 end
local cg=Group.CreateGroup()
for i=1,4 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
cg:Merge(sg)
end
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
end
function c29146185.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -10,17 +10,17 @@ function c43661068.initial_effect(c)
c:RegisterEffect(e1)
end
function c43661068.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c43661068.tfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c43661068.tfilter,tp,LOCATION_MZONE,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c43661068.tfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c43661068.tfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c43661068.tfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c43661068.tfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c43661068.filter(c,atk,def)
return c:IsFaceup() and c:GetLevel()>0 and (c:GetAttack()==atk or c:GetDefence()==def)
end
function c43661068.tfilter(c)
function c43661068.tfilter(c,tp)
return c:IsFaceup() and c:GetLevel()>0
and Duel.IsExistingMatchingCard(c43661068.filter,tp,LOCATION_MZONE,0,1,c,c:GetAttack(),c:GetDefence())
and Duel.IsExistingMatchingCard(c43661068.filter,tp,LOCATION_MZONE,0,1,c,c:GetAttack(),c:GetDefence())
end
function c43661068.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -16,7 +16,7 @@ function c49456901.initial_effect(c)
--negate activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49456901,1))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_HANDES)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_HANDES)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
......@@ -47,7 +47,7 @@ end
function c49456901.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,2061963)
end
function c49456901.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -56,10 +56,10 @@ function c49456901.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c49456901.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c49456901.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and Duel.SelectYesNo(tp,aux.Stringid(49456901,2)) then
if Duel.NegateActivation(ev) and Duel.SelectYesNo(tp,aux.Stringid(49456901,2)) then
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0):RandomSelect(1-tp,1)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_DISCARD+REASON_EFFECT)
......
......@@ -13,7 +13,8 @@ function c5288597.initial_effect(c)
end
function c5288597.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
if chk==0 then return Duel.GetFlagEffect(tp,5288597)==0 end
Duel.RegisterFlagEffect(tp,5288597,RESET_PHASE+PHASE_END,0,1)
end
function c5288597.cfilter(c,e,tp)
local lv=c:GetLevel()
......@@ -30,6 +31,8 @@ function c5288597.target(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c5288597.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c5288597.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
c5288597[0]=tc:GetLevel()
......
......@@ -54,7 +54,7 @@ function c6330307.eqop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
function c6330307.eqlimit(e,c)
return c:IsSetCard(0x7f) and c:IsSetCard(0x7f) and c:IsSetCard(0x1048)
return c:IsSetCard(0x7f) and c:IsSetCard(0x1048)
end
function c6330307.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
......
......@@ -25,7 +25,7 @@ function c66540884.thfilter(c)
return c:IsSetCard(0x45) and c:GetCode()~=66540884 and c:IsAbleToHand()
end
function c66540884.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c66540884.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c66540884.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c66540884.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,6 +13,9 @@ function c80032567.initial_effect(c)
e1:SetValue(c80032567.val)
c:RegisterEffect(e1)
end
function c80032567.filter(c)
return c:IsSetCard(0x22) and c:IsType(TYPE_MONSTER)
end
function c80032567.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0x22)*200
return Duel.GetMatchingGroupCount(c80032567.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)*200
end
......@@ -21,8 +21,8 @@ function c82361206.initial_effect(c)
e3:SetDescription(aux.Stringid(82361206,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_DAMAGE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c82361206.rmcon)
e3:SetTarget(c82361206.rmtg)
......@@ -43,13 +43,16 @@ function c82361206.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c82361206.rmcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler():GetEquipTarget()
return ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c82361206.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c82361206.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c82361206.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c82361206.filter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,2,nil)
local g=Duel.SelectTarget(tp,c82361206.filter,tp,0,LOCATION_GRAVE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c82361206.rmop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -47,14 +47,14 @@ function c91812341.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c91812341.filter(c)
function c91812341.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c91812341.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c91812341.filter(chkc) end
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c91812341.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c91812341.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c91812341.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c91812341.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,7 +24,7 @@ function c92099232.activate(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,92099232,0,0x11,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) then return end
c:AddTrapMonsterAttribute(TYPE_TUNER,ATTRIBUTE_EARTH,RACE_FIEND,2,0,0)
c:AddTrapMonsterAttribute(TYPE_NORMAL+TYPE_TUNER,ATTRIBUTE_EARTH,RACE_FIEND,2,0,0)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_DEFENCE)
c:TrapMonsterBlock()
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