Commit 0d54c9e0 authored by POLYMER's avatar POLYMER

fix

parent 9c537387
No preview for this file type
...@@ -16,10 +16,6 @@ function s.initial_effect(c) ...@@ -16,10 +16,6 @@ function s.initial_effect(c)
ge1:SetCondition(s.lostcon) ge1:SetCondition(s.lostcon)
ge1:SetOperation(s.lostop) ge1:SetOperation(s.lostop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCondition(s.lostcon2)
ge2:SetOperation(s.lostop2)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone() local ge3=ge1:Clone()
ge3:SetCode(EVENT_SUMMON) ge3:SetCode(EVENT_SUMMON)
Duel.RegisterEffect(ge3,0) Duel.RegisterEffect(ge3,0)
......
...@@ -4,7 +4,7 @@ function s.initial_effect(c) ...@@ -4,7 +4,7 @@ function s.initial_effect(c)
--act in hand --act in hand
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(id,1)) e0:SetDescription(aux.Stringid(id,1))
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND) e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(s.handcon) e0:SetCondition(s.handcon)
c:RegisterEffect(e0) c:RegisterEffect(e0)
......
...@@ -75,8 +75,8 @@ function c98920431.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,8 +75,8 @@ function c98920431.spop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local atk=tc:GetAttack() local atk=tc:GetAttack()
local lp=tp:GetLP() local lp=Duel.GetLP(e:GetHandlerPlayer())
Duel.SetLP(tp,lp-atk) Duel.SetLP(e:GetHandlerPlayer(),lp-atk)
end end
end end
function c98920431.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c98920431.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -13,9 +13,13 @@ function Auxiliary.PreloadUds() ...@@ -13,9 +13,13 @@ function Auxiliary.PreloadUds()
EFFECT_FLAG_CANNOT_NEGATE=EFFECT_FLAG_CANNOT_NEGATE or 0x200 EFFECT_FLAG_CANNOT_NEGATE=EFFECT_FLAG_CANNOT_NEGATE or 0x200
EFFECT_FLAG_CAN_FORBIDDEN=EFFECT_FLAG_CAN_FORBIDDEN or 0x200 EFFECT_FLAG_CAN_FORBIDDEN=EFFECT_FLAG_CAN_FORBIDDEN or 0x200
table_range=table_range or {}
effect_handler=effect_handler or {}
effect_registered=effect_registered or {}
require_list=require_list or {}
function require(str) function require(str)
require_list=require_list or {}
if not require_list[str] then if not require_list[str] then
if string.find(str,"%.") then if string.find(str,"%.") then
require_list[str]=loadfile(str) require_list[str]=loadfile(str)
...@@ -92,20 +96,16 @@ function Auxiliary.PreloadUds() ...@@ -92,20 +96,16 @@ function Auxiliary.PreloadUds()
local _CreateEffect=Effect.CreateEffect local _CreateEffect=Effect.CreateEffect
function Effect.CreateEffect(c,...) function Effect.CreateEffect(c,...)
local e=_CreateEffect(c,...) local e=_CreateEffect(c,...)
effect_handler=effect_handler or {}
if e and c then effect_handler[e]=c end if e and c then effect_handler[e]=c end
return e return e
end end
local _SetRange=Effect.SetRange local _SetRange=Effect.SetRange
function Effect.SetRange(e,r,...) function Effect.SetRange(e,r,...)
table_range=table_range or {}
if e and r then table_range[e]=r end if e and r then table_range[e]=r end
return _SetRange(e,r,...) return _SetRange(e,r,...)
end end
local _Clone=Effect.Clone local _Clone=Effect.Clone
function Effect.Clone(e,...) function Effect.Clone(e,...)
effect_handler=effect_handler or {}
table_range=table_range or {}
local clone_e=_Clone(e,...) local clone_e=_Clone(e,...)
if e and clone_e then if e and clone_e then
effect_handler[clone_e]=effect_handler[e] effect_handler[clone_e]=effect_handler[e]
...@@ -118,6 +118,7 @@ function Auxiliary.PreloadUds() ...@@ -118,6 +118,7 @@ function Auxiliary.PreloadUds()
if table_range and table_range[e] then if table_range and table_range[e] then
return table_range[e] return table_range[e]
end end
Debug.Message("Effect.GetRange没有及时加载该效果的Range信息。")
return 0 return 0
end end
end end
...@@ -126,8 +127,16 @@ function Auxiliary.PreloadUds() ...@@ -126,8 +127,16 @@ function Auxiliary.PreloadUds()
function Card.RegisterEffect(c,e,...) function Card.RegisterEffect(c,e,...)
if aux.GetValueType(c)~="Card" then Debug.Message("Card.RegisterEffect没有输入正确的Card参数。") return end if aux.GetValueType(c)~="Card" then Debug.Message("Card.RegisterEffect没有输入正确的Card参数。") return end
if aux.GetValueType(e)~="Effect" then Debug.Message("Card.RegisterEffect没有输入正确的Effect参数。") return end if aux.GetValueType(e)~="Effect" then Debug.Message("Card.RegisterEffect没有输入正确的Effect参数。") return end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not table_range[e] then
table_range[e]=LOCATION_HAND+LOCATION_SZONE
elseif e:IsHasType(EFFECT_TYPE_EQUIP) and not table_range[e] then
table_range[e]=LOCATION_SZONE
elseif e:IsHasType(EFFECT_TYPE_FLIP) and not table_range[e] then
table_range[e]=LOCATION_MZONE
elseif e:IsHasType(EFFECT_TYPE_XMATERIAL) and not table_range[e] then
table_range[e]=LOCATION_OVERLAY
end
local eid=_CRegisterEffect(c,e,...) local eid=_CRegisterEffect(c,e,...)
effect_registered=effect_registered or {}
if e and eid then effect_registered[e]=true end if e and eid then effect_registered[e]=true end
return eid return eid
end end
...@@ -135,14 +144,12 @@ function Auxiliary.PreloadUds() ...@@ -135,14 +144,12 @@ function Auxiliary.PreloadUds()
function Duel.RegisterEffect(e,p,...) function Duel.RegisterEffect(e,p,...)
if aux.GetValueType(e)~="Effect" then Debug.Message("Duel.RegisterEffect没有输入正确的Effect参数。") return end if aux.GetValueType(e)~="Effect" then Debug.Message("Duel.RegisterEffect没有输入正确的Effect参数。") return end
_DRegisterEffect(e,p,...) _DRegisterEffect(e,p,...)
effect_registered=effect_registered or {}
if e then effect_registered[e]=true end if e then effect_registered[e]=true end
end end
local _GetHandler=Effect.GetHandler local _GetHandler=Effect.GetHandler
function Effect.GetHandler(e,...) function Effect.GetHandler(e,...)
--warning!!! --warning!!!
effect_registered=effect_registered or {}
if _Effect.IsHasType(e,EFFECT_TYPE_XMATERIAL) and not effect_registered[e] then return effect_handler[e] end if _Effect.IsHasType(e,EFFECT_TYPE_XMATERIAL) and not effect_registered[e] then return effect_handler[e] end
local c=_GetHandler(e,...) local c=_GetHandler(e,...)
if not c then return effect_handler[e] end if not c then return effect_handler[e] 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