local m=19251405 local cm=_G["c"..m] cm.name="念之法袍" function cm.initial_effect(c) c:SetUniqueOnField(1,0,m) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetRange(LOCATION_SZONE) e2:SetTarget(cm.sptg) e2:SetOperation(cm.spop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(function(_,tp) return Duel.GetTurnPlayer()==tp end) e3:SetTarget(cm.rmtg) e3:SetOperation(cm.rmop) c:RegisterEffect(e3) end function cm.spfilter(c,e,tp) return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and not c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.CheckLPCost(tp,c:GetLevel()*200) end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e) then Duel.PayLPCost(tp,tc:GetLevel()*200) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) end function cm.rmfilter(c) return c:IsRace(RACE_PSYCHO) and c:IsPosition(POS_FACEUP) end function cm.rmop(e,tp,eg,ep,ev,re,r,rp) local num=Duel.GetMatchingGroupCount(cm.rmfilter,tp,LOCATION_REMOVED,0,nil) Duel.Recover(tp,num*200,REASON_EFFECT) if num>=5 then local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Draw(tp,2,REASON_EFFECT) end end