Commit b9efbe89 authored by TanakaKotoha's avatar TanakaKotoha

fix lua

parent 991115b1
# YGOPro-222DIY-cards # YGOPro-222DIY-cards
The custom card data of YGOPro 222DIY Custom Server. see http://koishi.222diy.gdn/pre.html . The custom card data of YGOPro 222DIY Custom Server. see http://koishi.pro/pre.html .
User QQ Group: 642043095 User QQ Group: 642043095
# Sound # Sound
https://github.com/purerosefallen/ygopro-222DIY-sound https://github.com/purerosefallen/ygopro-222DIY-sound
...@@ -5,49 +5,48 @@ function c81015040.initial_effect(c) ...@@ -5,49 +5,48 @@ function c81015040.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x81a),3) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x81a),3)
c:EnableReviveLimit() c:EnableReviveLimit()
--indes --indes
local e1=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e0:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e0:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c81015040.indcon) e0:SetCondition(c81015040.indcon)
e1:SetValue(1) e0:SetValue(1)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--destroy --destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81015040,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,81015040)
e2:SetCondition(c81015040.condition)
e2:SetTarget(c81015040.target)
e2:SetOperation(c81015040.operation)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(81015040,0)) e3:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_HAND) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,81015040) e3:SetHintTiming(TIMING_DAMAGE_STEP)
e3:SetCondition(c81015040.condition) e3:SetCountLimit(1,81015940)
e3:SetTarget(c81015040.target) e3:SetCondition(c81015040.rmcon)
e3:SetOperation(c81015040.operation) e3:SetTarget(c81015040.rmtg)
e3:SetOperation(c81015040.rmop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(81015040,1))
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(TIMING_DAMAGE_STEP)
e4:SetCountLimit(1,81015940)
e4:SetCondition(c81015040.bcondition)
e4:SetTarget(c81015040.btarget)
e4:SetOperation(c81015040.boperation)
c:RegisterEffect(e1)
end end
function c81015040.indcon(e) function c81015040.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function c81015040.cfilter(c) function c81015040.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x119) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x81a)
end end
function c81015040.condition(e,tp,eg,ep,ev,re,r,rp) function c81015040.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c81015040.cfilter,tp,LOCATION_GRAVE,0,3,nil) return Duel.IsExistingMatchingCard(c81015040.cfilter,tp,LOCATION_GRAVE,0,3,nil)
...@@ -67,7 +66,7 @@ function c81015040.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -67,7 +66,7 @@ function c81015040.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c81015040.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c81015040.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:SetLabelObject(g:GetFirst()) e:SetLabelObject(g:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,1-tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_TODECK,lg,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,lg,1,tp,LOCATION_GRAVE)
end end
function c81015040.operation(e,tp,eg,ep,ev,re,r,rp) function c81015040.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -79,17 +78,17 @@ function c81015040.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,17 +78,17 @@ function c81015040.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(sc,REASON_EFFECT) Duel.Destroy(sc,REASON_EFFECT)
end end
end end
function c81015040.bcondition(e,tp,eg,ep,ev,re,r,rp) function c81015040.rmcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and Tenka.ReikaCon(e,tp,eg,ep,ev,re,r,rp) return (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and Tenka.ReikaCon(e)
end end
function c81015040.btarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c81015040.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,2,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE+LOCATION_ONFIELD)
end end
function c81015040.boperation(e,tp,eg,ep,ev,re,r,rp) function c81015040.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT) local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local c=e:GetHandler() local c=e:GetHandler()
......
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