Commit 2f31074e authored by VanillaSalt's avatar VanillaSalt

fix

parent 39d3291c
......@@ -12,6 +12,7 @@
#include "effect.h"
#include "interpreter.h"
#include <iostream>
#include <cstring>
int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5};
......
......@@ -60,7 +60,7 @@ function c11458071.tgfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c11458071.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chk:IsLocation(LOCATION_MZONE) and c11458071.tgfilter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c11458071.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11458071.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c11458071.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -31,7 +31,7 @@ function c14005031.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()==0 and c:IsAttribute(ATTRIBUTE_WIND)
end
function c14005031.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c14005031.filter(chk) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c14005031.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c14005031.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c14005031.filter,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -31,7 +31,7 @@ function c18096222.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c18096222.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c18096222.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c18096222.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c18096222.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c18096222.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -62,8 +62,12 @@ function c18096222.eqlimit(e,c)
return c:GetControler()==e:GetOwnerPlayer() and c:IsType(TYPE_DUAL)
end
function c18096222.dacon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_DESTROY)
and e:GetHandler():GetEquipTarget()~=nil
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if c:IsReason(REASON_LOST_TARGET) then
ec=c:GetPreviousEquipTarget()
end
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_DESTROY) and ec~=nil
end
function c18096222.dafilter(c)
return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState()
......
......@@ -21,7 +21,7 @@ function c18318842.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c18318842.filter,1,1,REASON_COST+REASON_DISCARD)
end
function c18318842.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chk:IsAbleToHand() end
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
......
......@@ -34,7 +34,7 @@ function c1896112.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g1=Duel.SelectTarget(tp,c1896112.filter,tp,LOCATION_REMOVED,0,1,ft1,nil,e,tp)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft2>2 then ft2=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(1-tp,c1896112.filter,1-tp,LOCATION_REMOVED,0,1,ft2,nil,e,1-tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,g1:GetCount(),0,0)
......@@ -44,7 +44,7 @@ function c1896112.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=g:Filter(Card.IsControler,nil,tp)
local g2=g:Filter(Card.IsControler,nil,1-tp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1>g1:GetCount() then
if ft1>=g1:GetCount() then
local tc=g1:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -52,7 +52,7 @@ function c1896112.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft2>g2:GetCount() then
if ft2>=g2:GetCount() then
local tc=g2:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP)
......
......@@ -27,11 +27,14 @@ function c24845628.initial_effect(c)
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e6:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e6)
local e7=e3:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e7)
--search
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(24845628,0))
......
......@@ -61,7 +61,7 @@ function c25343017.filter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToRemove()
end
function c25343017.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chk:IsControler(tp) and c25343017.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c25343017.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c25343017.cfilter,tp,LOCATION_GRAVE,0,1,nil,e,PLAYER_NONE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c25343017.filter,tp,LOCATION_GRAVE,0,1,1,nil)
......
......@@ -55,7 +55,7 @@ function c25460258.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g1,REASON_COST)
end
function c25460258.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chk:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
......
......@@ -32,7 +32,7 @@ function c28529976.filter(c,lv,e,tp)
return c:GetLevel()<=lv and c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28529976.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(tp,c28529976.cfilter,1,nil,e,tp) end
local rg=Duel.SelectReleaseGroup(tp,c28529976.cfilter,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel()+3)
......@@ -62,5 +62,5 @@ function c28529976.descon2(e,tp,eg,ep,ev,re,r,rp)
return tc and eg:IsContains(tc)
end
function c28529976.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(), REASON_EFFECT)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
......@@ -14,7 +14,7 @@ function c32441317.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToExtra()
end
function c32441317.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c32441317.filter(chk) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c32441317.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32441317.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c32441317.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -20,7 +20,7 @@ function c40424929.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,40424929,RESET_PHASE+PHASE_END,0,1)
end
function c40424929.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
......
......@@ -37,7 +37,7 @@ function c41147577.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c41147577.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
......
......@@ -29,7 +29,7 @@ function c41309158.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c41309158.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefencePos() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefencePos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefencePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEFENCE)
Duel.SelectTarget(tp,Card.IsDefencePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -37,7 +37,7 @@ function c51808422.spcon(e,c)
Duel.IsExistingMatchingCard(c51808422.spfilter,c:GetControler(),LOCATION_MZONE,0,2,nil)
end
function c51808422.filter(c,e,tp)
return c:IsSetCard(0x100d) and c:GetLevel()<=4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x100d) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c51808422.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c51808422.filter(chkc,e,tp) end
......
......@@ -83,7 +83,7 @@ function c59170782.spfilter(c,e,tp)
return c:IsSetCard(0x74) and c:GetCode()~=59170782 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c59170782.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chk:IsLocation(LOCATION_GRAVE) and c59170782.spfilter(chkc,e,tp) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c59170782.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c59170782.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -19,7 +19,7 @@ function c62560742.filter(c)
return c:IsFaceup() and c:IsSetCard(0x27) and c:IsType(TYPE_SYNCHRO)
end
function c62560742.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c62560742.filter(chk) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c62560742.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c62560742.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(62560742,2))
local g=Duel.SelectTarget(tp,c62560742.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
......
......@@ -26,7 +26,7 @@ function c62950604.filter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToRemove()
end
function c62950604.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chk:IsControler(tp) and c62950604.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c62950604.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c62950604.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c62950604.filter,tp,LOCATION_GRAVE,0,1,1,nil)
......
......@@ -56,10 +56,10 @@ function c71541986.spop(e,tp,eg,ep,ev,re,r,rp)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
tc:RegisterEffect(e5)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
......
......@@ -4,16 +4,17 @@ function c74458486.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_CAL)
e1:SetCondition(c74458486.condition)
e1:SetTarget(c74458486.target)
e1:SetOperation(c74458486.activate)
c:RegisterEffect(e1)
end
function c74458486.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_DAMAGE and not Duel.IsDamageCalculated()
local phase=Duel.GetCurrentPhase()
return (phase==PHASE_DAMAGE or phase==PHASE_DAMAGE_CAL) and not Duel.IsDamageCalculated()
and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()
end
function c74458486.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -32,6 +32,6 @@ function c77334267.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c77334267.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:IsRelateToEffect(e) then
Duel.Destroy(g,REASON_EFFECT)
local dg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(dg,REASON_EFFECT)
end
......@@ -11,19 +11,40 @@ function c77631175.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c77631175.reptg)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77631175,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(77631175)
e2:SetTarget(c77631175.target)
e2:SetOperation(c77631175.operation)
c:RegisterEffect(e2)
end
function c77631175.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReason(REASON_BATTLE) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if Duel.SelectYesNo(tp,aux.Stringid(77631175,0)) then
local c=e:GetHandler()
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
Duel.Damage(1-tp,500,REASON_EFFECT)
Duel.RaiseSingleEvent(c,77631175,e,0,0,0,0)
return true
else return false end
end
function c77631175.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c77631175.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -15,7 +15,7 @@ function c78610936.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsAbleToExtra() and c:GetOverlayCount()>0
end
function c78610936.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c78610936.filter(chk) end
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c78610936.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c78610936.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78610936.filter,tp,0,LOCATION_MZONE,1,1,nil)
......
......@@ -12,13 +12,9 @@ end
function c78783370.condition(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex then return true end
if ex and (cp==tp or cp==PLAYER_ALL) then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
if not ex then return false end
if cp~=PLAYER_ALL then return Duel.IsPlayerAffectedByEffect(cp,EFFECT_REVERSE_RECOVER)
else return Duel.IsPlayerAffectedByEffect(0,EFFECT_REVERSE_RECOVER)
or Duel.IsPlayerAffectedByEffect(1,EFFECT_REVERSE_RECOVER)
end
return ex and (cp==tp or cp==PLAYER_ALL) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)
end
function c78783370.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
......
......@@ -42,11 +42,11 @@ end
function c847915.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c847915.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c847915.dfilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x48)
function c847915.dfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x48)
end
function c847915.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c847915.dfilter,1,nil)
return eg:IsExists(c847915.dfilter,1,nil,tp)
end
function c847915.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
......
......@@ -23,10 +23,10 @@ function c86016245.drcon(e,tp,eg,ep,ev,re,r,rp)
local bc=tc:GetBattleTarget()
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and eg:GetCount()==1
and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
and bc:IsRelateToBattle() and bc:IsLevelBelow(2)
and bc:IsRelateToBattle() and bc:IsControler(tp) and bc:IsLevelBelow(2)
end
function c86016245.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
......
......@@ -50,7 +50,6 @@ function c87911394.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......@@ -62,6 +61,8 @@ function c87911394.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
Duel.AdjustInstantly(tc)
local atk=tc:GetAttack()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -32,9 +32,9 @@ function c9156135.filter(c)
end
function c9156135.addct(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c9156135.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9156135.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c9156135.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SelectTarget(tp,c9156135.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x3001)
end
function c9156135.addc(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,7 +14,7 @@ function c95286165.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsAbleToExtra()
end
function c95286165.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c95286165.filter(chk) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c95286165.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c95286165.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c95286165.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -55,7 +55,7 @@ function c9596126.tgfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c9596126.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chk:IsLocation(LOCATION_MZONE) and c9596126.tgfilter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c9596126.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9596126.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c9596126.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -73,7 +73,7 @@ function c99365553.spfilter3(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99365553.sptg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chk:IsLocation(LOCATION_GRAVE) and c99365553.spfilter3(chkc,e,tp) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c99365553.spfilter3(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c99365553.spfilter3,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
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