Commit 06a86980 authored by salix5's avatar salix5

Merge branch 'master' into patch

parents 82be3e08 4d6c71e8
......@@ -1195,7 +1195,6 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
rcount += pcard->operation_param;
}
}
int32 ex_count = 0;
int32 ex_sum_max = 0;
for(int i = 0; i < 5; ++i) {
pcard = player[1 - p].list_mzone[i];
......@@ -1221,14 +1220,11 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
pcard->operation_param = 2;
else
pcard->operation_param = 1;
ex_count++;
if(ex_sum_max < pcard->operation_param)
ex_sum_max = pcard->operation_param;
}
}
if(ex_count)
rcount += ex_sum_max;
return rcount;
return rcount + ex_sum_max;
}
int32 field::get_summon_count_limit(uint8 playerid) {
effect_set eset;
......
......@@ -3341,6 +3341,7 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
}
if(core.attacker->current.location != LOCATION_MZONE || core.attacker->fieldid_r != core.pre_field[0]
|| ((core.attacker->current.position & POS_DEFENCE) && !(core.attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK)))
|| (core.attack_target && (core.attack_target->current.location != LOCATION_MZONE || core.attack_target->fieldid_r != core.pre_field[1]))) {
core.units.begin()->arg1 = 0;
core.damage_calculated = TRUE;
......@@ -4030,6 +4031,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.quick_f_chain.clear();
core.delayed_quick_tmp.clear();
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_SP)) {
core.units.begin()->step = 5;
reset_phase(PHASE_STANDBY);
adjust_all();
return FALSE;
......
......@@ -28,7 +28,7 @@ function c22123627.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-p,hg)
Duel.ShuffleHand(p)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,2,2,nil)
Duel.ConfirmCards(1-p,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
......
......@@ -16,5 +16,5 @@ function c24326617.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c24326617.filter,tp,0,LOCATION_SZONE,1,nil)
and Duel.IsExistingMatchingCard(c24326617.filter,tp,0,LOCATION_SZONE,2,nil)
end
......@@ -20,7 +20,7 @@ function c42829885.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.ShuffleHand(1-p)
......
......@@ -60,7 +60,8 @@ function c47198668.atkop1(e,tp,eg,ep,ev,re,r,rp)
end
function c47198668.filter2(c,e,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsType(TYPE_MONSTER)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsCanBeEffectTarget(e)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsCanBeEffectTarget(e)
end
function c47198668.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsDirectAttacked() end
......
......@@ -21,5 +21,5 @@ function c56784842.regop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
function c56784842.aclimit(e,re,tp)
return re:GetHandler():IsActiveType(TYPE_MONSTER)
return re:IsActiveType(TYPE_MONSTER)
end
......@@ -27,7 +27,7 @@ function c6540606.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE)
local sg=g:Select(p,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.ShuffleHand(1-p)
......
......@@ -62,10 +62,9 @@ function c67030233.synfilter1(c,lv,g)
if lv-tlv<=0 then return false end
local t=false
if c:IsType(TYPE_TUNER) then t=true end
g:RemoveCard(c)
local res=g:IsExists(c67030233.synfilter2,1,nil,lv-tlv,g,t)
g:AddCard(c)
return res
local wg=g:Clone()
wg:RemoveCard(c)
return wg:IsExists(c67030233.synfilter2,1,nil,lv-tlv,wg,t)
end
function c67030233.synfilter2(c,lv,g,tuner)
if not c:IsCode(70902743) then return false end
......@@ -89,39 +88,26 @@ function c67030233.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner)
local g=Group.CreateGroup()
local mg=Duel.GetMatchingGroup(c67030233.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
local lv=c:GetLevel()
if tuner then
local lv1=tuner:GetLevel()
local t=false
if tuner:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(tuner)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c67030233.synfilter2,1,1,nil,lv-lv1,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
local lv2=m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c67030233.synfilter3,1,1,nil,lv-lv1-lv2)
g:Merge(t3)
else
local m1=tuner
if not tuner then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t1=mg:FilterSelect(tp,c67030233.synfilter1,1,1,nil,lv,mg)
local m1=t1:GetFirst()
m1=t1:GetFirst()
g:AddCard(m1)
local lv1=m1:GetLevel()
local t=false
if m1:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(m1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c67030233.synfilter2,1,1,nil,lv-lv1,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
local lv2=m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c67030233.synfilter3,1,1,nil,lv-lv1-lv2)
g:Merge(t3)
end
lv=lv-m1:GetLevel()
local t=false
if m1:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(m1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c67030233.synfilter2,1,1,nil,lv,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
lv=lv-m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c67030233.synfilter3,1,1,nil,lv)
g:Merge(t3)
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
end
......
......@@ -38,5 +38,9 @@ function c72648577.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=dg:Select(tp,2,2,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
else
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.ShuffleDeck(tp)
end
end
end
......@@ -64,10 +64,9 @@ function c7841112.synfilter1(c,lv,g)
if lv-tlv<=0 then return false end
local t=false
if c:IsType(TYPE_TUNER) then t=true end
g:RemoveCard(c)
local res=g:IsExists(c7841112.synfilter2,1,nil,lv-tlv,g,t)
g:AddCard(c)
return res
local wg=g:Clone()
wg:RemoveCard(c)
return wg:IsExists(c7841112.synfilter2,1,nil,lv-tlv,wg,t)
end
function c7841112.synfilter2(c,lv,g,tuner)
if not c:IsCode(44508094) then return false end
......@@ -91,39 +90,26 @@ function c7841112.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner)
local g=Group.CreateGroup()
local mg=Duel.GetMatchingGroup(c7841112.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
local lv=c:GetLevel()
if tuner then
local lv1=tuner:GetLevel()
local t=false
if tuner:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(tuner)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c7841112.synfilter2,1,1,nil,lv-lv1,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
local lv2=m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c7841112.synfilter3,1,1,nil,lv-lv1-lv2)
g:Merge(t3)
else
local m1=tuner
if not tuner then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t1=mg:FilterSelect(tp,c7841112.synfilter1,1,1,nil,lv,mg)
local m1=t1:GetFirst()
m1=t1:GetFirst()
g:AddCard(m1)
local lv1=m1:GetLevel()
local t=false
if m1:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(m1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c7841112.synfilter2,1,1,nil,lv-lv1,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
local lv2=m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c7841112.synfilter3,1,1,nil,lv-lv1-lv2)
g:Merge(t3)
end
lv=lv-m1:GetLevel()
local t=false
if m1:IsType(TYPE_TUNER) then t=true end
mg:RemoveCard(m1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t2=mg:FilterSelect(tp,c7841112.synfilter2,1,1,nil,lv,mg,t)
local m2=t2:GetFirst()
g:AddCard(m2)
lv=lv-m2:GetLevel()
mg:RemoveCard(m2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local t3=mg:FilterSelect(tp,c7841112.synfilter3,1,1,nil,lv)
g:Merge(t3)
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
end
......
......@@ -51,7 +51,7 @@ function c84764038.ssop(e,tp,eg,ep,ev,re,r,rp)
end
function c84764038.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) then
if not c:IsReason(REASON_RETURN) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84764038,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
......
......@@ -35,7 +35,7 @@ function c87902575.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCountLimit(1)
e4:SetOperation(c87902575.clearop)
......@@ -77,13 +77,16 @@ function c87902575.retop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(p,LOCATION_MZONE)
if g:GetCount()>ft then
local sg=g
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(87902575,2))
Duel.Hint(HINT_SELECTMSG,p,aux.Stringid(87902575,2))
g=g:Select(p,ft,ft,nil)
sg:Sub(g)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
local tc=g:GetFirst()
while tc do Duel.ReturnToField(tc) tc=g:GetNext() end
while tc do
Duel.ReturnToField(tc,POS_FACEUP_ATTACK)
tc=g:GetNext()
end
end
function c87902575.clfilter(c,ec,tp)
return (not c:IsRelateToCard(ec)) or c:GetPreviousControler()==tp
......
......@@ -28,7 +28,7 @@ function c98891840.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-p,hg)
Duel.ShuffleHand(p)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,2,2,nil)
Duel.ConfirmCards(1-p,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
......
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