Commit 2a566bb5 authored by Nemo Ma's avatar Nemo Ma

fix

parent 61cd7876
......@@ -15,8 +15,9 @@ end
Scl_Library_Switch = true
--Print version number
Debug.Message("You are using Scl's library, Version: " .. Version_Number .. ".")
Debug.Message("If you find any script errors, call Scl to fix them.")
Debug.Message("His QQ/VX: 852415212, Email: 15161685390@163.com.")
Debug.Message("If you find any script errors, Scl won't fix them.")
Debug.Message("Do NOT contact him and try to fix c10100000.lua yourself.")
--Debug.Message("His QQ/VX: 852415212, Email: 15161685390@163.com.")
--this table's contents can be used in anywhere, commonly be used for create effects, or be used in effect's condtions/costs/targets/operations.
Scl = { }
--this table's contents can be used in anywhere, commonly be used for registering effect's condtions/costs/targets/operations/values.
......@@ -3228,7 +3229,7 @@ end
2.extra_check_function: add an additional check to the effect cost/target, call extra_check_function(e, tp, eg, ...) to check.
//return list_typ, extra_check_function
4.
{ 1.list_typ == "ExtraOperation", 2.extra_operate_function }
{ 1.list_typ == "ExtraOperation", 2.extra_operate_function }
Paramas explain:
2.extra_operate_function: add an additional operate to the effect cost/target, call extra_operate_function(current list's selected card(s), all above lists's selected card(s),e, tp, eg, ...) to operate.
//return list_typ, extra_operate_function
......@@ -4716,7 +4717,7 @@ function Scl.ActivateSepllOrTrap(tc, actp, apply_effect, lim_zone)
local tg = te:GetTarget() or aux.TRUE
local op = te:GetOperation() or aux.TRUE
tg(te, actp, ceg, cep, cev, cre, cr, crp, 1)
op(te, actp, ceg, cep, cev, cre, cr, crp)
op(te, actp, ceg, cep, cev, cre, cr, crp)
end
if zone == LOCATION_FZONE then
Duel.RaiseEvent(tc, 4179255, te, 0, tp, tp, Duel.GetCurrentChain())
......@@ -5305,7 +5306,7 @@ end
3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang")
4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(c, "YiFanJiang")
5. Love.IsOriginalSeries(c) -- equal to Scl.IsOriginalSeries(c, "YiFanJiang")
6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER)
6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER)
11~15 Love.IsXXXXSeriesSpell(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL)
16~20 Love.IsXXXXSeriesTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_TRAP)
21~25 Love.IsXXXXSeriesSpellOrTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL + TYPE_TRAP)
......@@ -5377,14 +5378,14 @@ end
--Get target player and that num-format value for an effect that register player target information in Effect.SetTarget
--//return target player, target value
--[[
>>eg1. Duel.SetTargetPlayer(tp)
>>eg1. Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Scl.GetPlayerTargetParamas()
>> return tp, 1000
--]]
function Scl.GetPlayerTargetParamas()
local player, value = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.Draw(p,d,REASON_EFFECT)
return player, value
end
--Add normal summon or set procedure
......@@ -6851,7 +6852,7 @@ s.record_previous_inside_series()
s.previous_xyz_material_record()
s.record_official_filter()
s.add_current_effect_check()
s.add_type_normal_spell_or_trap_scl()
--s.add_type_normal_spell_or_trap_scl()
Scl.RaiseGlobalSetEvent()
......@@ -6861,9 +6862,9 @@ Scl.RaiseGlobalSetEvent()
--[[
10100000 -- Scl's library QQ852415212
10100000 -- Scl's library QQ852415212
60152900 -- LaiBill's library QQ529508379
60152900 -- LaiBill's library QQ529508379
B2Sayaka -- "Miki Sayaka"
......
--食大食蚁兽螳蛉
local m=11451474
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
......@@ -63,15 +62,19 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,e:GetHandler()) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsDisabled() then
Duel.NegateEffect(0)
return
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e))
if #g==0 then return end
local tc=g:GetFirst()
if tc==c then c:CancelToGrave() end
--if tc==c then c:CancelToGrave() end
if Duel.SendtoHand(tc,1-tp,REASON_EFFECT)>0 then
if tc:IsPreviousLocation(LOCATION_HAND) then Duel.ShuffleHand(tp) end
if not tc:IsLocation(LOCATION_HAND) or not tc:IsControler(1-tp) then return end
......
......@@ -82,6 +82,7 @@ function cm.negop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -129,8 +130,7 @@ function cm.tgfilter(c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,13 +23,13 @@ function cm.initial_effect(c)
e1:SetValue(c22348079.splimit)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c22348079.efilter)
c:RegisterEffect(e2)
-- local e2=Effect.CreateEffect(c)
-- e2:SetType(EFFECT_TYPE_SINGLE)
-- e2:SetCode(EFFECT_IMMUNE_EFFECT)
-- e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
-- e2:SetRange(LOCATION_MZONE)
-- e2:SetValue(c22348079.efilter)
-- c:RegisterEffect(e2)
--cannot target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -24,10 +24,10 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(function(e,c,tp,sumtp,sumpos)return (sumpos&POS_ATTACK)>0 end)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
......@@ -39,6 +39,9 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return (sumpos&POS_ATTACK)>0
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPosition,1,nil,POS_DEFENSE)
end
......
......@@ -75,14 +75,14 @@ function c600032.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RegisterFlagEffect(600032,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c600032.filter1(c)
return c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89)) and c:IsAbleToDeck()
return c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89)) and c:IsAbleToDeckAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function c600032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c600032.filter1,tp,LOCATION_GRAVE,0,1,nil)
return Duel.IsExistingMatchingCard(c600032.filter1,tp,LOCATION_GRAVE,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......@@ -116,6 +116,7 @@ function c600032.target2(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c600032.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c600032.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
......
......@@ -38,15 +38,16 @@ function c9910937.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c9910937.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c9910937.negcon)
e1:SetOperation(c9910937.negop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c9910937.negcon)
e1:SetOperation(c9910937.negop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c9910937.negcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_GRAVE
......
......@@ -39,16 +39,17 @@ function c9910939.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c9910939.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetValue(1)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetValue(1)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c9910939.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local loc=LOCATION_GRAVE
......
......@@ -41,30 +41,31 @@ function c9910941.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c9910941.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_SZONE)
e1:SetTarget(c9910941.distg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c9910941.disop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(c9910941.distg)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9910941.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_SZONE)
e1:SetTarget(c9910941.distg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c9910941.disop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(c9910941.distg)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c9910941.cfilter(c)
......
......@@ -38,15 +38,16 @@ function c9910945.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c9910945.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c9910945.negcon)
e1:SetOperation(c9910945.negop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c9910945.negcon)
e1:SetOperation(c9910945.negop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c9910945.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
......
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