Commit 221e59a7 authored by VanillaSalt's avatar VanillaSalt

fix

parent 0554c3f1
...@@ -349,7 +349,7 @@ int32 card::get_attack(uint8 swap) { ...@@ -349,7 +349,7 @@ int32 card::get_attack(uint8 swap) {
int32 card::get_base_defence(uint8 swap) { int32 card::get_base_defence(uint8 swap) {
if (current.location != LOCATION_MZONE) if (current.location != LOCATION_MZONE)
return data.defence; return data.defence;
if (temp.base_attack != -1) if (temp.base_defence != -1)
return temp.base_defence; return temp.base_defence;
if(!swap && is_affected_by_effect(EFFECT_SWAP_BASE_AD)) if(!swap && is_affected_by_effect(EFFECT_SWAP_BASE_AD))
return get_base_attack(TRUE); return get_base_attack(TRUE);
...@@ -1274,6 +1274,8 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign ...@@ -1274,6 +1274,8 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
int32 fcount = pduel->game_field->get_useable_count(current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_TOFIELD); int32 fcount = pduel->game_field->get_useable_count(current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_TOFIELD);
if(max <= -fcount) if(max <= -fcount)
return FALSE; return FALSE;
if(min < -fcount + 1)
min = -fcount + 1;
if(min == 0) if(min == 0)
return TRUE; return TRUE;
int32 m = pduel->game_field->get_summon_release_list(this, 0, 0); int32 m = pduel->game_field->get_summon_release_list(this, 0, 0);
...@@ -1309,6 +1311,8 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore ...@@ -1309,6 +1311,8 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
int32 fcount = pduel->game_field->get_useable_count(current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_TOFIELD); int32 fcount = pduel->game_field->get_useable_count(current.controler, LOCATION_MZONE, current.controler, LOCATION_REASON_TOFIELD);
if(max <= -fcount) if(max <= -fcount)
return FALSE; return FALSE;
if(min < -fcount + 1)
min = -fcount + 1;
if(min == 0) if(min == 0)
return TRUE; return TRUE;
int32 m = pduel->game_field->get_summon_release_list(this, 0, 0); int32 m = pduel->game_field->get_summon_release_list(this, 0, 0);
...@@ -1879,6 +1883,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) { ...@@ -1879,6 +1883,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
return FALSE; return FALSE;
if(!is_capable_send_to_grave(playerid)) if(!is_capable_send_to_grave(playerid))
return FALSE; return FALSE;
operation_param = dest << 8;
if(current.location & LOCATION_ONFIELD) if(current.location & LOCATION_ONFIELD)
redirect = leave_field_redirect(REASON_COST) & 0xffff; redirect = leave_field_redirect(REASON_COST) & 0xffff;
if(redirect) dest = redirect; if(redirect) dest = redirect;
...@@ -1899,6 +1904,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) { ...@@ -1899,6 +1904,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) {
return FALSE; return FALSE;
if(!is_capable_send_to_hand(playerid)) if(!is_capable_send_to_hand(playerid))
return FALSE; return FALSE;
operation_param = dest << 8;
if(current.location & LOCATION_ONFIELD) if(current.location & LOCATION_ONFIELD)
redirect = leave_field_redirect(REASON_COST) & 0xffff; redirect = leave_field_redirect(REASON_COST) & 0xffff;
if(redirect) dest = redirect; if(redirect) dest = redirect;
...@@ -1919,6 +1925,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) { ...@@ -1919,6 +1925,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) {
return FALSE; return FALSE;
if(!is_capable_send_to_deck(playerid)) if(!is_capable_send_to_deck(playerid))
return FALSE; return FALSE;
operation_param = dest << 8;
if(current.location & LOCATION_ONFIELD) if(current.location & LOCATION_ONFIELD)
redirect = leave_field_redirect(REASON_COST) & 0xffff; redirect = leave_field_redirect(REASON_COST) & 0xffff;
if(redirect) dest = redirect; if(redirect) dest = redirect;
...@@ -1939,6 +1946,7 @@ int32 card::is_capable_cost_to_extra(uint8 playerid) { ...@@ -1939,6 +1946,7 @@ int32 card::is_capable_cost_to_extra(uint8 playerid) {
return FALSE; return FALSE;
if(!is_capable_send_to_deck(playerid)) if(!is_capable_send_to_deck(playerid))
return FALSE; return FALSE;
operation_param = dest << 8;
if(current.location & LOCATION_ONFIELD) if(current.location & LOCATION_ONFIELD)
redirect = leave_field_redirect(REASON_COST) & 0xffff; redirect = leave_field_redirect(REASON_COST) & 0xffff;
if(redirect) dest = redirect; if(redirect) dest = redirect;
......
...@@ -1178,7 +1178,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1178,7 +1178,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
} else { } else {
if(min < -fcount + 1) { if(min < -fcount + 1) {
min = -fcount + 1; min = -fcount + 1;
required = min + (max >> 16); required = min + (max << 16);
} }
add_process(PROCESSOR_SELECT_TRIBUTE, 0, 0, 0, sumplayer, required); add_process(PROCESSOR_SELECT_TRIBUTE, 0, 0, 0, sumplayer, required);
} }
...@@ -1706,7 +1706,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1706,7 +1706,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
if(min < -core.temp_var[1] + 1) { if(min < -core.temp_var[1] + 1) {
min = -core.temp_var[1] + 1; min = -core.temp_var[1] + 1;
} }
core.temp_var[0] = min + (max >> 16); core.temp_var[0] = min + (max << 16);
add_process(PROCESSOR_SELECT_TRIBUTE, 0, 0, 0, setplayer, core.temp_var[0]); add_process(PROCESSOR_SELECT_TRIBUTE, 0, 0, 0, setplayer, core.temp_var[0]);
} }
core.units.begin()->step = 2; core.units.begin()->step = 2;
......
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
function c10449150.rmop(e,tp,eg,ep,ev,re,r,rp) function c10449150.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then
c:RegisterFlagEffect(10449150,RESET_EVENT+0x1fe0000,0,1) c:RegisterFlagEffect(10449150,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end end
end end
function c10449150.spcon(e,tp,eg,ep,ev,re,r,rp) function c10449150.spcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -41,7 +41,7 @@ function c42548470.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +41,7 @@ function c42548470.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv1) e1:SetValue(lv1)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e1) tc2:RegisterEffect(e1)
if lv1<lv2 then Duel.Draw(tp,1,REASON_EFFECT) end if lv1<lv2 then Duel.Draw(tp,1,REASON_EFFECT) end
else else
...@@ -49,7 +49,7 @@ function c42548470.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function c42548470.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv2) e1:SetValue(lv2)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1) tc1:RegisterEffect(e1)
if lv2<lv1 then Duel.Draw(tp,1,REASON_EFFECT) end if lv2<lv1 then Duel.Draw(tp,1,REASON_EFFECT) end
end end
......
...@@ -18,6 +18,7 @@ function c49398568.cfilter(c) ...@@ -18,6 +18,7 @@ function c49398568.cfilter(c)
end end
function c49398568.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c49398568.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
hg:RemoveCard(e:GetHandler())
if chk==0 then return hg:GetCount()>0 and hg:FilterCount(c49398568.cfilter,nil)==hg:GetCount() end if chk==0 then return hg:GetCount()>0 and hg:FilterCount(c49398568.cfilter,nil)==hg:GetCount() end
Duel.SendtoGrave(hg,REASON_COST) Duel.SendtoGrave(hg,REASON_COST)
end end
......
...@@ -32,12 +32,16 @@ function c54974237.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,12 +32,16 @@ function c54974237.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c54974237.tgfilter,tp,0,LOCATION_ONFIELD,nil,ty) local g=Duel.GetMatchingGroup(c54974237.tgfilter,tp,0,LOCATION_ONFIELD,nil,ty)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c54974237.cffilter(c)
return c:IsLocation(LOCATION_HAND) or (c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c54974237.activate(e,tp,eg,ep,ev,re,r,rp) function c54974237.activate(e,tp,eg,ep,ev,re,r,rp)
local ty=e:GetLabel() local ty=e:GetLabel()
local conf=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD+LOCATION_HAND) local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD+LOCATION_HAND)
if conf:GetCount()>0 then if g:GetCount()>0 then
Duel.ConfirmCards(tp,conf) local cg=g:Filter(c54974237.cffilter,nil)
local dg=conf:Filter(Card.IsType,nil,ty) Duel.ConfirmCards(tp,cg)
local dg=g:Filter(Card.IsType,nil,ty)
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
end end
......
...@@ -11,15 +11,15 @@ function c68396778.initial_effect(c) ...@@ -11,15 +11,15 @@ function c68396778.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c68396778.filter(c) function c68396778.filter(c)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c68396778.spfilter(c,e,tp) function c68396778.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(4) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c68396778.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c68396778.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c68396778.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c68396778.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c68396778.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c68396778.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c68396778.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c68396778.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c68396778.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c68396778.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
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