Commit fc2ee127 authored by POLYMER's avatar POLYMER

fix

parent a71f7946
No preview for this file type
......@@ -36,12 +36,6 @@ function Card.IsCanBeSynchroMaterial(c,...)
end
return _IsCanBeSynchroMaterial(c,...)
end
function cm.nfilter(c,g)
return g:FilterCount(cm.sfilter,nil,c)<3
end
function cm.sfilter(c,sc)
return c:GetOriginalCode()==sc:GetOriginalCode()
end
local KOISHI_CHECK=false
if Duel.Exile then KOISHI_CHECK=true end
local A=1103515245
......@@ -62,6 +56,14 @@ function cm.roll(min,max)
return cm.r
end
--if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end
if not Effect.GetRange then
function Effect.GetRange(e)
if table_range and table_range[e] then
return table_range[e]
end
return 0
end
end
if not require and loadfile then
function require(str)
require_list=require_list or {}
......@@ -174,6 +176,6 @@ end
if not apricot_nightfall then
apricot_nightfall=true
pcall(dofile,"expansions/script/special.lua")
if Auxiliary.PreloadUds then Auxiliary.PreloadUds() end
if Auxiliary.PreloadUds and not PreloadUds_Done then Auxiliary.PreloadUds() end
--Debug.Message("Protocol Request Complete. 杏花宵®漏洞解决方案已上线。")
end
\ No newline at end of file
......@@ -100,7 +100,7 @@ function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
Duel.Hint(HINT_CARD,0,m)
local dr=Duel.IsPlayerCanDraw(tp,1)
local sp=c:GetFlagEffect(m)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local sp=c:GetFlagEffect(m)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if not dr and not sp then return end
local op=aux.SelectFromOptions(tp,{dr,aux.Stringid(m,5)},{sp,aux.Stringid(m,6)})
if op==1 then
......
......@@ -110,7 +110,7 @@ function c28381214.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,500,REASON_EFFECT,true)
Duel.RDComplete()
elseif sel==2 then
if not Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28381214.hkfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
......
......@@ -119,7 +119,7 @@ function c28381466.regop(e,tp,eg,ep,ev,re,r,rp)
ge2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ge2:SetRange(LOCATION_MZONE)
ge2:SetTargetRange(LOCATION_MZONE,0)
ge2:SetTarget(function(e,c,tp,r)return c:GetControl()==tp and r==REASON_EFFECT and c:IsSetCard(0x283) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup()end)
ge2:SetTarget(c28381466.indtg)
ge2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(ge2)
end
......@@ -205,6 +205,9 @@ function c28381466.regop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(28381466,5))
end
end
function c28381466.indtg(e,c,r,tp)
return c:IsSetCard(0x283) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and r==REASON_EFFECT and c:GetControl()==tp
end
function c28381466.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
and ((re:IsActiveType(TYPE_MONSTER) and Duel.GetFlagEffect(tp,28381466)==0)
......
......@@ -41,25 +41,23 @@ end
function cm.lvplus(c)
if c:IsType(TYPE_NORMAL) then return c:GetLevel()-3 else return c:GetLevel() end
end
function cm.fselect(g,lv,tp)
return g:GetSum(Card.GetLevel)<=lv and aux.dncheck(g)
function cm.fselect(g,lv)
return g:GetSum(Card.GetLevel)<=lv
end
function cm.hspcheck(g,lv,tp)
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
return g:GetSum(Card.GetLevel)<=lv
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
function cm.hspgcheck(lv)
return function(g)
return g:GetSum(cm.lvplus)<=lv and aux.dncheck(g)
end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local op,ct,tc=0,0,e:GetLabelObject()
local res=false
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
if tc:IsRelateToEffect(e) then
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(tc))
local hastur=g:CheckSubGroup(cm.hspcheck,1,3,cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
if hastur then res=true end
......@@ -79,8 +77,8 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
aux.GCheckAdditional=cm.hspgcheck
local sg=g:SelectSubGroup(tp,cm.hspcheck,false,1,3,tc:GetLevel(),tp)
aux.GCheckAdditional=cm.hspgcheck(tc:GetLevel())
local sg=g:SelectSubGroup(tp,cm.hspcheck,false,1,3,tc:GetLevel())
aux.GCheckAdditional=nil
if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
......
......@@ -163,7 +163,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e8,tp)
end
function cm.lockcon(e)
return Duel.GetCurrentPhase()~=PHASE_MAIN1
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function cm.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
......
function Auxiliary.PreloadUds()
PreloadUds_Done=true
function require(str)
require_list=require_list or {}
if not require_list[str] then
......@@ -57,6 +58,12 @@ function Auxiliary.PreloadUds()
if not Auxiliary.GetMustMaterialGroup then
Auxiliary.GetMustMaterialGroup=Duel.GetMustMaterial
end
local _SetRange=Effect.SetRange
function Effect.SetRange(e,r,...)
table_range=table_range or {}
table_range[e]=r
return _SetRange(e,r,...)
end
EFFECT_FLAG_CANNOT_NEGATE=EFFECT_FLAG_CANNOT_NEGATE or 0x200
--require("script/procedure.lua")
end
\ No newline at end of file
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