Commit 6245a9f7 authored by VanillaSalt's avatar VanillaSalt

fix

parent 1069ea5b
......@@ -1270,6 +1270,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} else {
mainGame->PopupElement(mainGame->wQuery);
}
if(mainGame->wOptions->isVisible()) {
DuelClient::SetResponseI(-1);
mainGame->HideElement(mainGame->wOptions);
}
break;
}
case MSG_SORT_CHAIN:
......
......@@ -177,7 +177,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if((handler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED))
&& (code != EVENT_FLIP) && (!handler->is_position(POS_FACEUP) || !handler->is_status(STATUS_EFFECT_ENABLED)))
return FALSE;
if(!(type & EFFECT_TYPE_TRIGGER_F)) {
if(!(type & (EFFECT_TYPE_FLIP | EFFECT_TYPE_TRIGGER_F))) {
if((code < 1132 || code > 1149) && pduel->game_field->infos.phase == PHASE_DAMAGE && !(flag & EFFECT_FLAG_DAMAGE_STEP))
return FALSE;
if((code < 1134 || code > 1136) && pduel->game_field->infos.phase == PHASE_DAMAGE_CAL && !(flag & EFFECT_FLAG_DAMAGE_CAL))
......
......@@ -26,7 +26,7 @@ function c19327348.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c19327348.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c19327348.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c19327348.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c19327348.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -14,7 +14,7 @@ function c28565527.initial_effect(c)
c:RegisterEffect(e1)
end
function c28565527.cfilter(c)
return Duel.IsExistingTarget(Card.IsAbleToHand,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
return Duel.IsExistingTarget(Card.IsAbleToHand,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c28565527.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c28565527.cfilter,1,nil) end
......@@ -22,10 +22,10 @@ function c28565527.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST)
end
function c28565527.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c28565527.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,7 +26,7 @@ function c37744402.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37744402.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c37744402.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c37744402.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c37744402.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -26,7 +26,7 @@ function c37970940.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37970940.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c37970940.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c37970940.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c37970940.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -3,29 +3,53 @@ function c69155991.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c69155991.descon)
e1:SetOperation(c69155991.desop)
e1:SetOperation(c69155991.chop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(69155991,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c69155991.tgcon)
e2:SetTarget(c69155991.tgtg)
e2:SetOperation(c69155991.tgop)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetOperation(c69155991.desop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_BATTLED)
e3:SetProperty(EFFECT_FLAG_AVAILABLE_BD)
e3:SetOperation(c69155991.desop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(69155991,0))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(c69155991.tgcon)
e4:SetTarget(c69155991.tgtg)
e4:SetOperation(c69155991.tgop)
c:RegisterEffect(e4)
end
function c69155991.chop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:GetHandler():IsType(TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(69155991,RESET_EVENT+0x1fe0000+RESET_CHAIN,0,1)
end
end
function c69155991.descon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:GetHandler():IsType(TYPE_MONSTER)
function c69155991.desop1(e,tp,eg,ep,ev,re,r,rp)
if ev>1 or e:GetHandler():GetFlagEffect(69155991)==0 then return end
local ph=Duel.GetCurrentPhase()
if (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and not Duel.IsDamageCalculated() then
e:GetHandler():RegisterFlagEffect(69155992,RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_DAMAGE,0,1)
else
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c69155991.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsLocation(LOCATION_MZONE) and e:GetHandler():IsFaceup() then
function c69155991.desop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(69155992)~=0 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -36,7 +60,7 @@ end
function c69155991.filter(c)
return c:IsSetCard(0x24) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c69155991.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c69155991.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c69155991.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
......
......@@ -26,7 +26,7 @@ function c73318863.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c73318863.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c73318863.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c73318863.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c73318863.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -26,7 +26,7 @@ function c74364659.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c74364659.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c74364659.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c74364659.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c74364659.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -26,7 +26,7 @@ function c759393.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c759393.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
c:CreateRelation(tc,RESET_EVENT+0x5fe0000)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -48,16 +48,20 @@ function c759393.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c759393.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner()
local h=e:GetHandler()
return h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h)
if h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h) then
return true
else
e:SetLabel(2)
return false
end
end
function c759393.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local c=e:GetOwner()
local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h)
and h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end
......@@ -30,24 +30,42 @@ end
function c79229522.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c79229522.spfilter1(c,tp)
return c:IsCode(70095154) and c:IsAbleToGraveAsCost() and (c:IsControler(tp) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp)
function c79229522.spfilter1(c,tp,ft)
if c:IsCode(70095154) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(true) and (c:IsControler(tp) or c:IsFaceup()) then
if ft>0 or (c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)) then
return Duel.IsExistingMatchingCard(c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp)
else
return Duel.IsExistingMatchingCard(c79229522.spfilter2,tp,LOCATION_MZONE,0,1,c,tp)
end
else return false end
end
function c79229522.spfilter2(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial() and (c:IsControler(tp) or c:IsFaceup())
end
function c79229522.sprcon(e,c)
if c==nil then return true end
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp,ft)
end
function c79229522.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,0))
local g1=Duel.SelectMatchingCard(tp,c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
local g1=Duel.SelectMatchingCard(tp,c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp,ft)
local tc=g1:GetFirst()
local g=Duel.GetMatchingGroup(c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tp)
local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,1))
local g2=Duel.SelectMatchingCard(tp,c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,10,g1:GetFirst(),tp)
if ft>0 or (tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE)) then
g2=g:Select(tp,1,10,nil)
else
g2=g:FilterSelect(tp,Card.IsControler,1,1,nil,tp)
if g:GetCount()>1 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,1))
local g3=g:Select(tp,1,9,g2:GetFirst())
g2:Merge(g3)
end
end
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
--spsummon condition
......
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