Commit 9278ea7f authored by VanillaSalt's avatar VanillaSalt

fix

parent b15d2da5
......@@ -1641,9 +1641,9 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
for(uint8 p = 0; p < 2; ++p) {
for(int32 i = 0; i < 5; ++i) {
pm = player[p].list_mzone[i];
if(mg && !mg->has_card(pm))
continue;
if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) {
if(mg && !mg->has_card(pm))
continue;
if(pcheck)
pcheck->get_value(pm);
if(!pduel->lua->check_matching(pm, findex2, 0))
......
......@@ -3867,10 +3867,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return TRUE;
}
case 3: {
if(!smat) {
returns.ivalue[0] = TRUE;
if(!smat)
return FALSE;
}
card* tuner = core.limit_tuner;
int32 l = tuner->get_synchro_level(pcard);
int32 l1 = l & 0xffff;
......@@ -3880,22 +3878,11 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
l = smat->get_synchro_level(pcard);
l1 = l & 0xffff;
lv -= l1;
min--;
max--;
if(min == 0) {
if(lv == 0 || max == 0)
core.units.begin()->step = 5;
else
add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, playerid, 210);
} else
returns.ivalue[0] = TRUE;
if(lv == 0)
core.units.begin()->step = 5;
return FALSE;
}
case 4: {
if(!returns.ivalue[0]) {
core.units.begin()->step = 5;
return FALSE;
}
card* tuner = core.limit_tuner;
effect* pcheck = tuner->is_affected_by_effect(EFFECT_SYNCHRO_CHECK);
int32 l = tuner->get_synchro_level(pcard);
......@@ -3917,6 +3904,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) {
if(pcheck)
pcheck->get_value(pm);
if(mg && !mg->has_card(pm))
continue;
if(!pduel->lua->check_matching(pm, -1, 0))
continue;
core.select_cards.push_back(pm);
......
......@@ -528,7 +528,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
if(core.select_cards.empty())
return TRUE;
pduel->write_buffer8(MSG_SELECT_SUM);
if(min)
if(max)
pduel->write_buffer8(0);
else
pduel->write_buffer8(1);
......
......@@ -59,7 +59,7 @@ function c20366274.exfilter(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
function c20366274.fuscon(e,g,gc,chkf)
if g==nil then return false end
if g==nil then return true end
local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup()
......
......@@ -19,6 +19,7 @@ function c2095764.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c2095764.sccon)
e2:SetTarget(c2095764.sctg)
e2:SetOperation(c2095764.scop)
......
......@@ -35,7 +35,7 @@ function c24610207.efop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(c24610207.drtg)
e1:SetOperation(c24610207.drop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -19,6 +19,7 @@ function c30106950.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c30106950.sccon)
e2:SetTarget(c30106950.sctg)
e2:SetOperation(c30106950.scop)
......
......@@ -28,11 +28,12 @@ function c30398342.initial_effect(c)
e3:SetTarget(c30398342.sumlimit)
c:RegisterEffect(e3)
end
function c30398342.cfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
function c30398342.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c30398342.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c30398342.cfilter,1,nil)
return eg:IsExists(c30398342.cfilter,1,nil,tp)
end
function c30398342.filter(c,e,tp)
return c:IsSetCard(0x9e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -22,7 +22,7 @@ function c34143852.efop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(c34143852.atkcon)
e1:SetOperation(c34143852.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -19,6 +19,7 @@ function c35089369.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c35089369.sccon)
e2:SetTarget(c35089369.sctg)
e2:SetOperation(c35089369.scop)
......
......@@ -60,7 +60,7 @@ function c3606728.efop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(c3606728.atktg)
e1:SetOperation(c3606728.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -4,7 +4,7 @@ function c37445295.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,37445295)
e1:SetTarget(c37445295.target)
e1:SetOperation(c37445295.operation)
......@@ -25,18 +25,19 @@ end
function c37445295.filter(c,e,tp)
return c:IsSetCard(0x9d) and not c:IsCode(37445295) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN)
end
function c37445295.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c37445295.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c37445295.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c37445295.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
and Duel.IsExistingTarget(c37445295.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c37445295.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c37445295.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37445295.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE)
Duel.ConfirmCards(1-tp,g)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE)
Duel.ConfirmCards(1-tp,tc)
end
end
function c37445295.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -37,7 +37,7 @@ function c38331564.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c38331564.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ and e:GetHandler():GetReasonCard():GetMaterial():IsExists(Card.IsLocation,3,nil,LOCATION_MZONE)
return r==REASON_XYZ and e:GetHandler():GetReasonCard():GetMaterial():IsExists(Card.IsPreviousLocation,3,nil,LOCATION_MZONE)
end
function c38331564.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,38331564)
......@@ -53,7 +53,7 @@ function c38331564.effop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(c38331564.destg)
e1:SetOperation(c38331564.desop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -5,6 +5,7 @@ function c44394295.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,44394295+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c44394295.target)
e1:SetOperation(c44394295.activate)
c:RegisterEffect(e1)
......
......@@ -31,7 +31,7 @@ function c4904633.activate(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,4904633,0,0x21,1450,1950,9,RACE_SPELLCASTER,ATTRIBUTE_DARK) then return end
c:AddTrapMonsterAttribute(TYPE_EFFECT,ATTRIBUTE_DARK,RACE_FIEND,6,1000,2400)
c:AddTrapMonsterAttribute(TYPE_EFFECT,ATTRIBUTE_DARK,RACE_SPELLCASTER,9,1450,1950)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterBlock()
c:RegisterFlagEffect(4904633,RESET_EVENT+0x1fe0000,0,1)
......
......@@ -25,6 +25,7 @@ function c60549248.initial_effect(c)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_REPEAT)
e4:SetCountLimit(1)
e4:SetCondition(c60549248.descon)
e4:SetTarget(c60549248.destg)
e4:SetOperation(c60549248.desop)
c:RegisterEffect(e4)
......@@ -57,6 +58,9 @@ function c60549248.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c60549248.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c60549248.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
......
......@@ -23,8 +23,8 @@ function c64726269.filter(c,e,tp)
end
function c64726269.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c64726269.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
and Duel.IsExistingMatchingCard(c64726269.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c64726269.tdfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
......@@ -32,7 +32,7 @@ end
function c64726269.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c64726269.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c64726269.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local sg=Duel.GetMatchingGroup(c64726269.tdfilter,tp,LOCATION_GRAVE,0,nil)
......@@ -43,8 +43,13 @@ function c64726269.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
<<<<<<< HEAD:script/c64726269.lua
function c64726269.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ and e:GetHandler():GetReasonCard():GetMaterial():IsExists(Card.IsLocation,3,nil,LOCATION_MZONE)
=======
function c64226269.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ and e:GetHandler():GetReasonCard():GetMaterial():IsExists(Card.IsPreviousLocation,3,nil,LOCATION_MZONE)
>>>>>>> fix:script/c64226269.lua
end
function c64726269.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -57,7 +62,7 @@ function c64726269.effop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(c64726269.drcon)
e1:SetOperation(c64726269.drop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -19,6 +19,7 @@ function c66500065.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c66500065.sccon)
e2:SetTarget(c66500065.sctg)
e2:SetOperation(c66500065.scop)
......
......@@ -23,10 +23,12 @@ function c77783947.initial_effect(c)
--synchro effect
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c77783947.sccon)
e4:SetCost(c77783947.sccost)
e4:SetTarget(c77783947.sctg)
e4:SetOperation(c77783947.scop)
c:RegisterEffect(e4)
......@@ -47,6 +49,10 @@ end
function c77783947.spfilter(c,mg)
return mg:IsExists(c77783947.cfilter,1,nil,c)
end
function c77783947.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c77783947.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c77783947.mfilter,tp,LOCATION_MZONE,0,nil)
......
......@@ -49,6 +49,7 @@ function c79844764.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_RELEASE_SUM)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
......
......@@ -32,9 +32,9 @@ end
function c83755611.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local ct=e:GetHandler():Filter(Card.IsSetCard,nil,0x9e):GetClassCount(Card.GetOriginalAttribute)
local ct=e:GetHandler():GetMaterial():Filter(Card.IsSetCard,nil,0x9e):GetClassCount(Card.GetOriginalAttribute)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,ct,nil)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c83755611.tdop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -46,7 +46,7 @@ function c8696773.effop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(c8696773.mattg)
e1:SetOperation(c8696773.matop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
--エルシャドール・ネフィリム
--エルシャドール・ミドラーシュ
function c94977269.initial_effect(c)
c:EnableReviveLimit()
--fusion material
......@@ -33,7 +33,7 @@ function c94977269.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetTarget(c94977269.splimit2)
c:RegisterEffect(e3)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -63,7 +63,7 @@ function c94977269.exfilter(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
function c94977269.fuscon(e,g,gc,chkf)
if g==nil then return false end
if g==nil then return true end
local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup()
......
......@@ -137,7 +137,8 @@ function Auxiliary.SynCondition(f1,f2,minc,maxc)
local ct=-ft
if minc<ct then minc=ct end
if maxc<minc then return false end
if smat and f1(smat) then return Duel.CheckTunerMaterial(c,smat,f1,f2,minc,maxc,mg) end
if smat and smat:IsType(TYPE_TUNER) and (not f1 or f1(smat)) then
return Duel.CheckTunerMaterial(c,smat,f1,f2,minc,maxc,mg) end
return Duel.CheckSynchroMaterial(c,f1,f2,minc,maxc,smat,mg)
end
end
......@@ -147,7 +148,7 @@ function Auxiliary.SynOperation(f1,f2,minc,maxc)
local ft=Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)
local ct=-ft
if minc<ct then minc=ct end
if smat and f1(smat) then
if smat and smat:IsType(TYPE_TUNER) and (not f1 or f1(smat)) then
g=Duel.SelectTunerMaterial(c:GetControler(),c,smat,f1,f2,minc,maxc,mg)
else
g=Duel.SelectSynchroMaterial(c:GetControler(),c,f1,f2,minc,maxc,smat,mg)
......@@ -219,7 +220,7 @@ function Auxiliary.XyzCondition2(f,minc,maxc,alterf,desc)
local ct=-ft
if minc<=ct then return false end
if ct<1 and Duel.IsExistingMatchingCard(alterf,c:GetControler(),LOCATION_MZONE,0,1,nil) then return true end
Duel.CheckXyzMaterial(c,f,minc,maxc,og)
return Duel.CheckXyzMaterial(c,f,minc,maxc,og)
end
end
function Auxiliary.XyzOperation2(f,minc,maxc,alterf,desc,op)
......
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