Union dragon monster effect fully working

This commit is contained in:
2021-12-13 19:04:25 +01:00
parent 2a9ddae28b
commit 910124aaf1

View File

@@ -26,15 +26,16 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
local d=g:GetFirst():GetAttack()
Duel.SetTargetPlayer(tp)
Duel.SetTargetPlayer(1-tp) --tp changed to 1-tp cuz of line 27
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 tc=Duel.GetFirstTarget() --target card?
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