Commit 72b210fe authored by POLYMER's avatar POLYMER

fix

parent 47ca82eb
No preview for this file type
...@@ -51,6 +51,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -51,6 +51,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.GetCurrentChain=function() return _GetCurrentChain()-1 end Duel.GetCurrentChain=function() return _GetCurrentChain()-1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,e:GetHandler())
if not g or #g==0 then Duel.GetCurrentChain=_GetCurrentChain e:SetLabelObject(nil) return end
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true) local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.GetCurrentChain=_GetCurrentChain Duel.GetCurrentChain=_GetCurrentChain
Duel.ClearTargetCard() Duel.ClearTargetCard()
......
...@@ -68,7 +68,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -68,7 +68,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if e:IsHasType(EFFECT_TYPE_QUICK_O) then g:RemoveCard(e:GetHandler()) end if e:IsHasType(EFFECT_TYPE_QUICK_O) then g:RemoveCard(e:GetHandler()) end
for tc in aux.Next(g) do for tc in aux.Next(g) do
tc:AddMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_DARK,RACE_SPELLCASTER,6,0,0) tc:AddMonsterAttribute(TYPE_EFFECT,ATTRIBUTE_DARK,RACE_SPELLCASTER,6,0,0)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -112,7 +112,7 @@ end ...@@ -112,7 +112,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
for tc in aux.Next(g) do for tc in aux.Next(g) do
tc:AddMonsterAttribute(TYPE_NORMAL,ATTRIBUTE_DARK,RACE_SPELLCASTER,6,0,0) tc:AddMonsterAttribute(TYPE_EFFECT,ATTRIBUTE_DARK,RACE_SPELLCASTER,6,0,0)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -127,16 +127,19 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -127,16 +127,19 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(6) e2:SetValue(6)
e2:SetReset(RESET_EVENT+0x5fe0000) e2:SetReset(RESET_EVENT+0x5fe0000)
tc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
cm[tc]={e1,e2}
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EVENT_MOVE) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetLabelObject(tc) e3:SetLabelObject(tc)
e3:SetOperation(cm.adjustop) e3:SetOperation(cm.adjustop)
e3:SetReset(RESET_PHASE+PHASE_END) e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_NEGATED)
Duel.RegisterEffect(e4,tp)
cm[tc]={e1,e2,e3,e4}
end end
local xyzg=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,tp) local xyzg=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,tp)
if #xyzg>0 then if #xyzg>0 then
......
...@@ -16,7 +16,19 @@ function cm.initial_effect(c) ...@@ -16,7 +16,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
if not cm.global_check then if not cm.global_check then
cm.global_check=true cm.global_check=true
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _ChangeChainOperation=Duel.ChangeChainOperation local _ChangeChainOperation=Duel.ChangeChainOperation
function Effect.GetActiveType(e)
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP+TYPE_COUNTER
end
return _GetActiveType(e)
end
function Effect.IsActiveType(e,typ)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Duel.ChangeChainOperation(ev,...) function Duel.ChangeChainOperation(ev,...)
local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT) local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then if aux.GetValueType(re)=="Effect" then
...@@ -212,7 +224,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -212,7 +224,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp) function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
re:SetType(EFFECT_TYPE_QUICK_F) re:SetType(EFFECT_TYPE_QUICK_F+EFFECT_TYPE_ACTIVATE)
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true) rc:SetStatus(STATUS_EFFECT_ENABLED,true)
local _NegateActivation=Duel.NegateActivation local _NegateActivation=Duel.NegateActivation
......
--黑衣之战栗 加百列
local m=40009891
local cm=_G["c"..m]
cm.named_with_Relief=1
function cm.initial_effect(c)
--recover 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.rdcon)
e1:SetTarget(cm.rdtg)
e1:SetOperation(cm.rdop)
c:RegisterEffect(e1)
cm.discard_effect=e1
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCondition(cm.adcon)
e2:SetTarget(cm.adtg)
e2:SetOperation(cm.adop)
c:RegisterEffect(e2)
end
function cm.rdcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)<8000
end
function cm.rdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
local rec=math.abs(8000-Duel.GetLP(tp))
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,rec)
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local rec=math.abs(8000-Duel.GetLP(tp))
local dam=Duel.Recover(tp,rec,REASON_EFFECT)
Duel.BreakEffect()
Duel.Damage(tp,dam,REASON_EFFECT)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and ev>=1000
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=math.floor(ev/1000)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=math.floor(ev/1000)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,dg)
local g=Duel.GetDecktopGroup(tp,dg)
if g:GetCount()>0 then
local ct=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if ct:GetFirst():IsAbleToGrave() then
local atk=Duel.SendtoGrave(ct,REASON_EFFECT+REASON_REVEAL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
Duel.ShuffleDeck(tp)
end
--黑衣之战栗 加百列
local m=40009892
local cm=_G["c"..m]
cm.named_with_Relief=1
function cm.initial_effect(c)
--recover 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.rdcon)
e1:SetTarget(cm.rdtg)
e1:SetOperation(cm.rdop)
c:RegisterEffect(e1)
cm.discard_effect=e1
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCondition(cm.adcon)
e2:SetTarget(cm.adtg)
e2:SetOperation(cm.adop)
c:RegisterEffect(e2)
end
function cm.rdcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)<8000
end
function cm.rdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
local rec=math.abs(8000-Duel.GetLP(tp))
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,rec)
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local rec=math.abs(8000-Duel.GetLP(tp))
local dam=Duel.Recover(tp,rec,REASON_EFFECT)
Duel.BreakEffect()
Duel.Damage(tp,dam,REASON_EFFECT)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and ev>=1000
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=math.floor(ev/1000)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=math.floor(ev/1000)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,dg)
local g=Duel.GetDecktopGroup(tp,dg)
if g:GetCount()>0 then
local ct=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if ct:GetFirst():IsAbleToGrave() then
local atk=Duel.SendtoGrave(ct,REASON_EFFECT+REASON_REVEAL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
Duel.ShuffleDeck(tp)
end
--黑衣之战栗 加百列
local m=40009909
local cm=_G["c"..m]
cm.named_with_Relief=1
function cm.initial_effect(c)
--recover 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.rdcon)
e1:SetTarget(cm.rdtg)
e1:SetOperation(cm.rdop)
c:RegisterEffect(e1)
cm.discard_effect=e1
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCondition(cm.adcon)
e2:SetTarget(cm.adtg)
e2:SetOperation(cm.adop)
c:RegisterEffect(e2)
end
function cm.rdcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)<8000
end
function cm.rdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
local rec=math.abs(8000-Duel.GetLP(tp))
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,rec)
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local rec=math.abs(8000-Duel.GetLP(tp))
local dam=Duel.Recover(tp,rec,REASON_EFFECT)
Duel.BreakEffect()
Duel.Damage(tp,dam,REASON_EFFECT)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and ev>=1000
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=math.floor(ev/1000)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=math.floor(ev/1000)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,dg)
local g=Duel.GetDecktopGroup(tp,dg)
if g:GetCount()>0 then
local ct=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if ct:GetFirst():IsAbleToGrave() then
local atk=Duel.SendtoGrave(ct,REASON_EFFECT+REASON_REVEAL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
Duel.ShuffleDeck(tp)
end
\ No newline at end of file
...@@ -36,8 +36,8 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,8 +36,8 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local num=Duel.GetFlagEffect(0,m) local num=Duel.GetFlagEffect(0,m)
local g=Duel.GetDecktopGroup(tp,num) local g=Duel.GetDecktopGroup(tp,num)
Debug.Message(tp) --Debug.Message(tp)
Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil)) --Debug.Message(g:IsExists(Card.IsAbleToHand,1,nil))
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0 return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,tp) and g:GetCount()>=num and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.GetMZoneCount(tp)>0
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
......
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