diff --git a/lua/c56158661.lua b/lua/c56158661.lua index 77c71bc..c1ded58 100644 --- a/lua/c56158661.lua +++ b/lua/c56158661.lua @@ -29,6 +29,13 @@ function s.initial_effect(c) e2:SetTarget(s.pentg) e2:SetOperation(s.penop) c:RegisterEffect(e2) + --pendulum effect + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_IGNITION) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetRange(LOCATION_PZONE) + e3:SetTarget(s.gytarget) + c:RegisterEffect(e3) end --halve and gain functions @@ -84,3 +91,27 @@ function s.penop(e,tp,eg,ep,ev,re,r,rp) Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end +--pendulum effect functions +function s.gytarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end + if chk==0 then return Duel.IsExistingTarget(Card.IsLocation,tp,0,LOCATION_GRAVE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + Duel.SelectTarget(tp,Card.IsLocation,tp,0,LOCATION_GRAVE,1,1,nil) +end + +--[[function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(c, LOCATION_GRAVE) end + if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,0,LOCATION_GRAVE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) + local g=Duel.SelectTarget(tp,s.thfilter,tp,0,LOCATION_GRAVE,1,1,nil) + local d=g:GetFirst():GetAttack() + Duel.SetTargetPlayer(tp) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,d) +end +function s.thop(e,tp,eg,ep,ev,re,r,rp) + local tc=Duel.GetFirstTarget() + local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) + if tc and tc:IsRelateToEffect(e) and Duel.Damage(p,tc:GetAttack(),REASON_EFFECT) then + Duel.Destroy(tc, REASON_DESTROY) + end +end]] \ No newline at end of file