Commit 0fdc029e authored by Nemo Ma's avatar Nemo Ma

bugfix 0718

parent 542e3616
......@@ -85,11 +85,11 @@ function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.setfilter(c,e,tp)
return (c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0))
or ((rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and rc:IsSSetable())
return (c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (not c:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0))
or ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable())
end
function cm.setfilter1(c,e,tp)
return not c:IsType(TYPE_MONSTER) and ((tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and tc:IsSSetable())
return not c:IsType(TYPE_MONSTER) and ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.setfilter(chkc) end
......
......@@ -33,11 +33,23 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e3:SetValue(cm.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--cannot trigger
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_TRIGGER)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetTargetRange(0,LOCATION_ONFIELD)
e4:SetTarget(cm.distg)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.aclimit(e,re,tp)
local loc=re:GetHandler():GetLocation()
return (loc==LOCATION_GRAVE or loc==LOCATION_HAND or (loc==LOCATION_ONFIELD and re:GetHandler():IsFacedown())) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.distg(e,c)
return c:IsFacedown()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254036,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
......
......@@ -3,17 +3,21 @@ local m=13254038
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--discard deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES,CATEGORY_DRAW)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DECKDES,CATEGORY_DRAW)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -4,7 +4,6 @@ local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription()
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
......
......@@ -26,8 +26,8 @@ function c71400043.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c32912040.con2)
e2:SetOperation(c32912040.op2)
e2:SetCondition(c71400043.con2)
e2:SetOperation(c71400043.op2)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
......@@ -71,7 +71,7 @@ function c71400043.con2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c71400043.filter2,tp,LOCATION_MZONE,0,nil)
return Duel.GetTurnPlayer()~=tp and g:GetCount()>0 and g:FilterCount(c71400043.filter2a,nil)==g:GetCount()
end
function c71400025.op2(e,tp,eg,ep,ev,re,r,rp)
function c71400043.op2(e,tp,eg,ep,ev,re,r,rp)
yume.FieldActivation(tp,nil,2)
end
function c71400043.filter3a(c)
......
......@@ -171,6 +171,16 @@ function tama.tamas_getSubElements(c)
end
return {}
end
function tama.tamas_checkElementsHasElement(codes,element)
local i=1
if codes~=nil and #codes~=0 then
while codes[i] do
if codes[i][1]==element then return true end
i=i+1
end
end
return false
end
function tama.tamas_decreaseElements(codes,reduce)
local i=1
local toReduce=tama.DeepCopy(codes)
......@@ -192,12 +202,16 @@ function tama.tamas_increaseElements(codes,add)
local i=1
while toAdd[i] do
local j=1
local h=true
while add[j] do
if toAdd[i][1]==add[j][1] then
toAdd[i][2]=toAdd[i][2]+add[j][2]
end
j=j+1
end
if not h then
table.insert(toAdd,add[j])
end
i=i+1
end
else
......
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