Commit 279fac13 authored by Nemo Ma's avatar Nemo Ma

fix

parent 5e968c1c
......@@ -40,8 +40,8 @@ function c115020.thfil(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c115020.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,Duel.GetLP(tp)/2) end
Duel.PayLPCost(tp,Duel.GetLP(tp)/2)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c115020.spfil(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -22,6 +22,7 @@ function c115025.initial_effect(c)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,115026)
e3:SetCondition(c115025.stcon)
e3:SetTarget(c115025.sttg)
e3:SetOperation(c115025.stop)
c:RegisterEffect(e3)
......@@ -50,6 +51,9 @@ end
function c115025.stfil(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c115025.stcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c115025.xgfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115025.xgfilter(c)
return c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)
end
......
......@@ -9,6 +9,7 @@ function c115029.initial_effect(c)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,115029)
e1:SetCondition(c115029.thcon)
e1:SetTarget(c115029.thtg)
e1:SetOperation(c115029.thop)
c:RegisterEffect(e1)
......@@ -33,9 +34,15 @@ function c115029.initial_effect(c)
e4:SetOperation(c115029.spop1)
c:RegisterEffect(e4)
end
function c115029.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c115029.sslfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115029.thfil(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c115029.sslfilter(c)
return c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)
end
function c115029.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115029.thfil,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0,nil)
......
......@@ -9,6 +9,7 @@ function c115031.initial_effect(c)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,115031)
e1:SetCondition(c115031.spcon)
e1:SetTarget(c115031.sptg)
e1:SetOperation(c115031.spop)
c:RegisterEffect(e1)
......@@ -37,11 +38,14 @@ function c115031.initial_effect(c)
e4:SetOperation(c115031.spop1)
c:RegisterEffect(e4)
end
function c115031.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c115031.myfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115031.myfilter(c)
return c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)
return c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)
end
function c115031.spfil(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 ))
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 ))
end
function c115031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115031.myfilter,tp,LOCATION_PZONE,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(c115031.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
......
......@@ -24,7 +24,7 @@ function cm.initial_effect(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{TAMA_ELEMENT_ORDER,1}}
local el={{TAMA_ELEMENT_ORDER,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
if chk==0 then
return mg:GetCount()>0 and tama.tamas_isCanSelectElementsForAbove(mg,el)
......@@ -47,7 +47,7 @@ function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{TAMA_ELEMENT_ORDER,2}}
local el={{TAMA_ELEMENT_ORDER,3}}
local mg=tama.tamas_checkGroupElements(Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,e:GetHandler()),el)
if chk==0 then
return mg:GetCount()>0 and tama.tamas_isCanSelectElementsForAbove(mg,el) and e:GetHandler():IsAbleToRemoveAsCost()
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{TAMA_ELEMENT_CHAOS,1}}
local el={{TAMA_ELEMENT_CHAOS,3}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
if chk==0 then
return mg:GetCount()>0 and tama.tamas_isCanSelectElementsForAbove(mg,el)
......
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.remop)
c:RegisterEffect(e1)
elements={{"tama_elements",{{TAMA_ELEMENT_WIND,1},{TAMA_ELEMENT_EARTH,1},{TAMA_ELEMENT_WATER,1},{TAMA_ELEMENT_FIRE,1},{TAMA_ELEMENT_ORDER,1},{TAMA_ELEMENT_CHAOS,1}}}}
cm[c]=elements
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -59,6 +59,7 @@ function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.smop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
......@@ -88,6 +89,7 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if g:GetCount()==0 then return end
......@@ -110,6 +112,7 @@ function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
......
......@@ -10,6 +10,14 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetCountLimit(1,TAMA_THEME_CODE)
e2:SetOperation(cm.reop)
c:RegisterEffect(e2)
--[[
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
e2:SetRange(LOCATION_HAND+LOCATION_DECK)
......@@ -17,14 +25,15 @@ function cm.initial_effect(c)
e2:SetCondition(cm.recon)
e2:SetOperation(cm.reop)
c:RegisterEffect(e2)
]]
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(57953380,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(cm.drcon)
e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop)
c:RegisterEffect(e3)
......@@ -33,6 +42,7 @@ end
function cm.cfilter(c)
return #(tama.tamas_getElements(c))~=0
end
--[[
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==1 and Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,0,nil)>=Duel.GetFieldGroupCount(tp,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,0)*7/10
end
......@@ -44,18 +54,6 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp)
if c:GetPreviousLocation()==LOCATION_HAND then
Duel.Draw(tp,1,REASON_RULE)
end
--[[
Duel.DiscardDeck(tp,5,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
]]
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_HAND_LIMIT)
......@@ -65,6 +63,41 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
]]
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,1-tp,m)
Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=10 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.DiscardDeck(tp,10,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(cm.aclimit)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_HAND_LIMIT)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetValue(3)
Duel.RegisterEffect(e3,tp)
end
function cm.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end
......@@ -78,6 +111,7 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -25,12 +25,12 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return mg:GetCount()>0 and tama.tamas_isCanSelectElementsForAbove(mg,el)
end
local sg=tama.tamas_selectElementsMaterial(mg,el,tp)
local ct=tama.tamas_getElementCount(tamas_sumElements(sg),TAMA_ELEMENT_FIRE)
local ct=tama.tamas_getElementCount(tama.tamas_sumElements(sg),TAMA_ELEMENT_FIRE)
local ct1=tama.tamas_getElementCount(tamas_sumElements(sg),TAMA_ELEMENT_EARTH)-0
e:SetLabel(ct,ct1)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.desfilter(c,ct)
function cm.desfilter(c,ec,ct)
return c:IsAttackBelow(ec:GetAttack()+ct*200)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end
function cm.chainfilter(re,tp,cid)
return re:GetActivateLocation()==LOCATION_HAND
return not re:GetActivateLocation()==LOCATION_HAND
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
......
......@@ -157,8 +157,8 @@ function cm.pcop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
elseif e:GetLabel()==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_EXTRA,0,1,1,nil,c)
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>=g:GetCount() and Duel.SelectYesNo(tp,aux.Stringid(m,6)) then
local g=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,c,tp)
if c:IsRelateToEffect(e) and c:IsFaceup() and g:GetFirst():CheckEquipTarget(c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>=g:GetCount() and Duel.SelectYesNo(tp,aux.Stringid(m,6)) then
local tc=g:GetFirst()
while tc do
Duel.Equip(tp,tc,c,true,true)
......@@ -189,7 +189,7 @@ function cm.tokendes(e)
return not e:GetOwner():GetCardTarget():IsContains(e:GetHandler())
end
function cm.tdfilter(c,ec,tp)
return c:IsSetCard(0x352) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and ((c:CheckEquipTarget(ec) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or c:IsAbleToExtra())
return c:IsSetCard(0x352) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and ((c:CheckEquipTarget(ec) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or c:IsAbleToExtra())
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......
......@@ -38,6 +38,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.bombcost)
e4:SetTarget(cm.bombtg)
e4:SetOperation(cm.bombop)
......
......@@ -32,6 +32,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.bombcost)
e4:SetTarget(cm.bombtg)
e4:SetOperation(cm.bombop)
......
......@@ -24,6 +24,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.bombcost)
e4:SetTarget(cm.bombtg)
e4:SetOperation(cm.bombop)
......
......@@ -44,7 +44,7 @@ function cm.initial_effect(c)
ea:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
ea:SetProperty(EFFECT_FLAG_DELAY)
ea:SetCode(EVENT_SPSUMMON_SUCCESS)
ea:SetCountLimit(1,m+100)
ea:SetCountLimit(1,m+200)
ea:SetTarget(cm.acttg)
ea:SetOperation(cm.actop)
c:RegisterEffect(ea)
......@@ -56,7 +56,7 @@ function cm.initial_effect(c)
eb:SetCode(EVENT_PAY_LPCOST)
eb:SetRange(LOCATION_MZONE)
eb:SetProperty(EFFECT_FLAG_DELAY)
eb:SetCountLimit(1,m+101)
eb:SetCountLimit(1,m+100)
eb:SetCondition(cm.tgcon)
eb:SetTarget(cm.tgtg)
eb:SetOperation(cm.tgop)
......
......@@ -61,11 +61,11 @@ function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function cm.mttg(e,c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsRace(RACE_FAIRY)
end
function cm.mtval(e,c)
if not c then return false end
return c:IsRace(RACE_FAIRY)
return true
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmc,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,re) end
......
......@@ -79,7 +79,7 @@ function c29065509.valcheck(e,c)
end
function c29065509.discon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return re:GetHandler():GetControler()~=tp and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,29065584) and (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and e:GetHandler():GetFlagEffect(29065509)>0
return re:GetHandler():GetControler()~=tp and (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and e:GetHandler():GetFlagEffect(29065509)>0
end
function c29065509.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
......
......@@ -17,9 +17,10 @@ function cm.initial_effect(c)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_TO_HAND)
e5:SetCountLimit(1,m)
e5:SetCondition(cm.spcon)
e5:SetCost(cm.tgcost)
e5:SetTarget(cm.tgtg)
e5:SetOperation(cm.tgop)
......@@ -60,7 +61,7 @@ function cm.costfilter(c,tp)
return c:IsType(TYPE_RITUAL) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function cm.costfilter1(c,tp)
return c:GetOriginalType(TYPE_RITUAL) and (c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) or c:IsFaceup() and c:IsControler(1-tp))
return c:IsType(TYPE_RITUAL) and (c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) or c:IsFaceup() and c:IsControler(1-tp))
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(cm.costfilter,e:GetHandler(),tp)
......
......@@ -16,6 +16,13 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_FZONE)
e2:SetOperation(cm.acop)
c:RegisterEffect(e2)
--Add counter2
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetRange(LOCATION_FZONE)
e5:SetOperation(cm.acop2)
c:RegisterEffect(e5)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -51,14 +58,23 @@ function cm.down(c)
return c:IsSetCard(0x3340) or c:IsSetCard(0x3341)
end
function cm.cfilter(c,tp)
return c:GetPreviousLocation()==LOCATION_ONFIELD and c:GetPreviousControler()==tp
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.cfilter,1,nil,tp) then
e:GetHandler():AddCounter(0x34f,1)
local ct=eg:FilterCount(cm.cfilter,nil,e:GetHandlerPlayer())
if ct>0 then
e:GetHandler():AddCounter(0x34f,ct,true)
end
end
function cm.cfilter2(c,tp,re)
return c:GetPreviousControler()==1-tp and c:IsPreviousLocation(LOCATION_ONFIELD) and ((c:IsType(TYPE_MONSTER) and c:IsReason(REASON_BATTLE) and c:GetReasonCard():IsSetCard(0x3341,0x3340)) or (c:IsReason(REASON_EFFECT) and c:GetReasonEffect():GetHandler():IsSetCard(0x3341,0x3340)))
end
function cm.acop2(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(cm.cfilter2,nil,e:GetHandlerPlayer(),re)
if ct>0 then
e:GetHandler():AddCounter(0x34f,ct,true)
end
end
function cm.ctp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x34f)
......
......@@ -40,14 +40,17 @@ function cm.initial_effect(c)
e4:SetOperation(cm.recop2)
c:RegisterEffect(e4)
end
function cm.filter0(c,tp)
return c:GetOwner()==tp
end
function cm.reccon1(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetMutualLinkedGroup()
return eg:IsExists(Card.IsControler,1,nil,1-tp)
return eg:IsExists(cm.filter0,1,nil,tp)
and (not re or not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) and g:IsExists(Card.IsCode,1,nil,m+1)
end
function cm.recop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local ct=eg:FilterCount(Card.IsControler,nil,1-tp)
local ct=eg:FilterCount(cm.filter0,nil,tp)
Duel.Recover(tp,ct*300,REASON_EFFECT)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -55,18 +58,19 @@ function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) and g:IsExists(Card.IsCode,1,nil,m+1)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,eg:GetCount())
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,eg:FilterCount(cm.filter0,nil,tp))
end
function cm.reccon2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetMutualLinkedGroup()
return e:GetHandler():GetFlagEffect(m)>0 and g:IsExists(Card.IsCode,1,nil,m+1)
end
function cm.recop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local labels={e:GetHandler():GetFlagEffectLabel(m)}
local ct=0
for i=1,#labels do ct=ct+labels[i] end
e:GetHandler():ResetFlagEffect(m)
if ct<=0 then return end
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(tp,ct*300,REASON_EFFECT)
end
function cm.filter(c)
......
......@@ -33,7 +33,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.ovfilter(c)
return c:IsFaceup() and not c:IsCode(m)
return c:IsFaceup() and c:IsSetCard(0x442) and not c:IsCode(m)
end
function cm.xyzcheck(g)
return g:GetClassCount(Card.GetCode)==3
......
......@@ -61,8 +61,11 @@ end
function c7409799.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if tc:IsRelateToEffect(e) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsType(TYPE_MONSTER) and tc:IsCanBeBattleTarget(c) and tc:IsControler(1-tp) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK)>0 and tc:IsLocation(LOCATION_MZONE) then
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK)==0 then return end
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsCanBeBattleTarget(c) and tc:IsControler(1-tp)
and tc:IsLocation(LOCATION_MZONE) then
Duel.CalculateDamage(c,tc)
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