Commit 0d7b14ac authored by Nemo Ma's avatar Nemo Ma

update

parent a17bc234
......@@ -79,7 +79,7 @@ end
function cm.cacon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if ec and ec:IsRelateToBattle() and ec:IsStatus(STATUS_OPPO_BATTLE) then
local bc=c:GetBattleTarget()
local bc=ec:GetBattleTarget()
return bc and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
else return false end
end
......
......@@ -99,7 +99,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(11,0,aux.Stringid(sc:GetCode(),4))
local tep=sc:GetControler()
local mt=getmetatable(sc)
if mt then
if mt and type(mt[sc]) == "table" then
local eflist=mt[sc]
local i=1
while eflist[i] do
......
......@@ -102,7 +102,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.codisable(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and not e:GetHandler():IsStatus(STATUS_CHAINING)
return ec and not e:GetHandler():IsStatus(STATUS_CHAINING) and ep~=tp
end
function cm.tgdisable(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
e5:SetDescription(aux.Stringid(m,2))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetRange(LOCATION_MZONE)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.condition)
e5:SetOperation(cm.operation)
c:RegisterEffect(e5)
......@@ -122,7 +122,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x353)
return re:GetHandler():IsRace(RACE_FIEND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -69,6 +69,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--[[
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
......@@ -97,7 +98,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
end]]
function cm.tdfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsSetCard(0x351)
end
......
......@@ -81,7 +81,7 @@ function cm.eqop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g1=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc)
if g1:GetCount()>0 then
local tc1=g:GetFirst()
local tc1=g1:GetFirst()
Duel.Equip(tp,tc1,tc)
end
end
......
......@@ -70,17 +70,17 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_DISABLE,0,1)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_DISABLE,0,1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_DISABLE)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_DISABLE)
e5:SetValue(1000)
c:RegisterEffect(e5)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_UPDATE_DEFENSE)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_DISABLE)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_DISABLE)
e5:SetValue(1000)
c:RegisterEffect(e5)
end
......
......@@ -50,7 +50,7 @@ function c33400305.bacost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
end
function c33400355.bafilter1(c)
function c33400305.bafilter1(c)
return c:IsAttackable() and c:IsSetCard(0x5341) and c:IsFaceup()
end
function c33400305.batg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -14,7 +14,28 @@ function cm.initial_effect(c)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(2,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(2,m)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.negcon)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
--Equip Okatana
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
......@@ -150,7 +171,7 @@ end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
......@@ -196,7 +217,7 @@ function cm.TojiEquip(ec,e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(ec)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(2,m+1)
......
......@@ -58,7 +58,7 @@ function cm.ctfilter(c)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.ctfilter(chkc) end
if chk==0 then return true end
if chk==0 then return Duel.IsExistingTarget(cm.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,cm.ctfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
......
......@@ -115,13 +115,13 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(sc:GetAttack()/2)
e1:SetValue(tc:GetAttack()/2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(sc:GetDefense()/2)
e2:SetValue(tc:GetDefense()/2)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -56,12 +56,14 @@ function c33401201.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1
local g2
if tc:IsSetCard(0x341) then
local g1=Duel.GetMatchingGroup(c33401201.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+2)
local g2=Duel.GetMatchingGroup(c33401201.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+4)
g1=Duel.GetMatchingGroup(c33401201.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+2)
g2=Duel.GetMatchingGroup(c33401201.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+4)
else
local g1=Duel.GetMatchingGroup(c33401201.filter22,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+2)
local g2=Duel.GetMatchingGroup(c33401201.filter22,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+4)
g1=Duel.GetMatchingGroup(c33401201.filter22,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+2)
g2=Duel.GetMatchingGroup(c33401201.filter22,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+4)
end
g2:Merge(g1)
local g3=g2:Select(tp,1,1,nil)
......
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