Commit 78dea945 authored by VanillaSalt's avatar VanillaSalt

fix

parent 71794635
...@@ -352,8 +352,7 @@ int32 card::get_attack(uint8 swap) { ...@@ -352,8 +352,7 @@ int32 card::get_attack(uint8 swap) {
} }
} }
up += eset[i]->get_value(this); up += eset[i]->get_value(this);
} } else
else
upc += eset[i]->get_value(this); upc += eset[i]->get_value(this);
break; break;
case EFFECT_SET_ATTACK: case EFFECT_SET_ATTACK:
...@@ -448,10 +447,8 @@ int32 card::get_defence(uint8 swap) { ...@@ -448,10 +447,8 @@ int32 card::get_defence(uint8 swap) {
temp.defence = base; temp.defence = base;
} }
} }
}
if (eset[i]->type & EFFECT_TYPE_SINGLE)
up += eset[i]->get_value(this); up += eset[i]->get_value(this);
else } else
upc += eset[i]->get_value(this); upc += eset[i]->get_value(this);
break; break;
case EFFECT_SET_DEFENCE: case EFFECT_SET_DEFENCE:
......
...@@ -1396,7 +1396,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1396,7 +1396,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core.normalsummon_state[sumplayer] = TRUE; core.normalsummon_state[sumplayer] = TRUE;
core.summoned_cards_pt[sumplayer].insert(target); core.summoned_cards_pt[sumplayer].insert(target);
core.normalsummoned_cards_pt[sumplayer].insert(target); core.normalsummoned_cards_pt[sumplayer].insert(target);
if (target->material_cards.size()) { if (target->material_cards.size()) {
for (auto mit = target->material_cards.begin(); mit != target->material_cards.end(); ++mit) for (auto mit = target->material_cards.begin(); mit != target->material_cards.end(); ++mit)
raise_single_event(*mit, 0, EVENT_BE_PRE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0); raise_single_event(*mit, 0, EVENT_BE_PRE_MATERIAL, proc, REASON_SUMMON, sumplayer, sumplayer, 0);
...@@ -1404,7 +1403,9 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1404,7 +1403,9 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
} }
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
return FALSE;
}
case 10: {
if(core.current_chain.size() == 0) { if(core.current_chain.size() == 0) {
if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SUMMON)) if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SUMMON))
core.units.begin()->step = 14; core.units.begin()->step = 14;
...@@ -1416,13 +1417,13 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1416,13 +1417,13 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SUMMON)) if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SUMMON))
core.units.begin()->step = 15; core.units.begin()->step = 15;
else else
core.units.begin()->step = 10; core.units.begin()->step = 11;
core.reserved = core.units.front(); core.reserved = core.units.front();
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
case 10: { case 11: {
target->set_status(STATUS_SUMMONING, TRUE); target->set_status(STATUS_SUMMONING, TRUE);
target->set_status(STATUS_SUMMON_DISABLED, FALSE); target->set_status(STATUS_SUMMON_DISABLED, FALSE);
core.summoning_card = 0; core.summoning_card = 0;
...@@ -1431,7 +1432,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1431,7 +1432,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, TRUE, TRUE); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, TRUE, TRUE);
return FALSE; return FALSE;
} }
case 11: { case 12: {
if(target->is_status(STATUS_SUMMONING)) { if(target->is_status(STATUS_SUMMONING)) {
core.units.begin()->step = 14; core.units.begin()->step = 14;
return FALSE; return FALSE;
...@@ -2025,11 +2026,9 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -2025,11 +2026,9 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
pduel->write_buffer8(target->current.position); pduel->write_buffer8(target->current.position);
core.spsummon_state[sumplayer] = TRUE; core.spsummon_state[sumplayer] = TRUE;
core.spsummoned_cards_pt[sumplayer].insert(target); core.spsummoned_cards_pt[sumplayer].insert(target);
return FALSE; return FALSE;
} }
case 5:{ case 5: {
effect* proc = core.units.begin()->peffect; effect* proc = core.units.begin()->peffect;
int32 matreason = proc->value == SUMMON_TYPE_SYNCHRO ? REASON_SYNCHRO : proc->value == SUMMON_TYPE_XYZ ? REASON_XYZ : REASON_SPSUMMON; int32 matreason = proc->value == SUMMON_TYPE_SYNCHRO ? REASON_SYNCHRO : proc->value == SUMMON_TYPE_XYZ ? REASON_XYZ : REASON_SPSUMMON;
if (target->material_cards.size()) { if (target->material_cards.size()) {
...@@ -2048,12 +2047,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -2048,12 +2047,10 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
else else
core.units.begin()->step = 9; core.units.begin()->step = 9;
return FALSE; return FALSE;
} } else if (core.current_chain.size() > 1) {
else if (core.current_chain.size() > 1) {
core.units.begin()->step = 14; core.units.begin()->step = 14;
return FALSE; return FALSE;
} } else {
else {
if (target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) if (target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON))
core.units.begin()->step = 15; core.units.begin()->step = 15;
else else
...@@ -2061,6 +2058,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -2061,6 +2058,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
core.reserved = core.units.front(); core.reserved = core.units.front();
return TRUE; return TRUE;
} }
return FALSE;
} }
case 10: { case 10: {
core.summoning_card = 0; core.summoning_card = 0;
......
...@@ -480,6 +480,7 @@ int32 field::process() { ...@@ -480,6 +480,7 @@ int32 field::process() {
card* attacker = core.attacker; card* attacker = core.attacker;
if(!attacker if(!attacker
|| (attacker->fieldid_r != core.pre_field[0]) || (attacker->fieldid_r != core.pre_field[0])
|| (attacker->current.location != LOCATION_MZONE)
|| (attacker->current.position & POS_FACEDOWN) || (attacker->current.position & POS_FACEDOWN)
|| ((attacker->current.position & POS_DEFENCE) && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK))) || ((attacker->current.position & POS_DEFENCE) && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK)))
|| attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED) || attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED)
......
...@@ -34,6 +34,7 @@ function c22900598.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,6 +34,7 @@ function c22900598.activate(e,tp,eg,ep,ev,re,r,rp)
local cost=te:GetCost() local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sg=Duel.GetMatchingGroup(c22900598.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local sg=Duel.GetMatchingGroup(c22900598.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(22900598,0)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(22900598,0)) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -63,7 +63,7 @@ function c55742055.confilter(c) ...@@ -63,7 +63,7 @@ function c55742055.confilter(c)
end end
function c55742055.effcon(e,tp,eg,ep,ev,re,r,rp) function c55742055.effcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end if Duel.GetTurnPlayer()~=tp then return false end
local g=Duel.GetMatchingGroup(c55742055.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c55742055.confilter,tp,LOCATION_GRAVE+LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=e:GetLabel() return g:GetClassCount(Card.GetCode)>=e:GetLabel()
end end
function c55742055.filter1(c) function c55742055.filter1(c)
...@@ -124,7 +124,7 @@ function c55742055.operation3(e,tp,eg,ep,ev,re,r,rp) ...@@ -124,7 +124,7 @@ function c55742055.operation3(e,tp,eg,ep,ev,re,r,rp)
end end
function c55742055.condition4(e,tp,eg,ep,ev,re,r,rp) function c55742055.condition4(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end if Duel.GetTurnPlayer()~=tp then return false end
local g=Duel.GetMatchingGroup(c55742055.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c55742055.confilter,tp,LOCATION_GRAVE+LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)==12 return g:GetClassCount(Card.GetCode)==12
end end
function c55742055.target4(e,tp,eg,ep,ev,re,r,rp,chk) function c55742055.target4(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -31,7 +31,7 @@ end ...@@ -31,7 +31,7 @@ end
function c56574543.atkop(e,tp,eg,ep,ev,re,r,rp,chk) function c56574543.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
if not a:IsRelateToBattle() or a:IsFacedown() or not d:IsRelateToBattle() or a:IsFacedown() then return end if not a:IsRelateToBattle() or a:IsFacedown() or not d:IsRelateToBattle() or d:IsFacedown() then return end
if a:GetControler()~=tp then a,d=d,a end if a:GetControler()~=tp then a,d=d,a end
if not a:IsImmuneToEffect(e) then return end if not a:IsImmuneToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -39,7 +39,7 @@ function c82962242.initial_effect(c) ...@@ -39,7 +39,7 @@ function c82962242.initial_effect(c)
e4:SetCondition(c82962242.spcon) e4:SetCondition(c82962242.spcon)
e4:SetTarget(c82962242.sptg) e4:SetTarget(c82962242.sptg)
e4:SetOperation(c82962242.spop) e4:SetOperation(c82962242.spop)
e4:SetLabelObject(e4) e4:SetLabelObject(e3)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c82962242.cfilter(c,tp) function c82962242.cfilter(c,tp)
......
...@@ -490,6 +490,7 @@ EVENT_SPSUMMON =1105 ...@@ -490,6 +490,7 @@ EVENT_SPSUMMON =1105
EVENT_MSET =1106 EVENT_MSET =1106
EVENT_SSET =1107 EVENT_SSET =1107
EVENT_BE_MATERIAL =1108 EVENT_BE_MATERIAL =1108
EVENT_BE_PRE_MATERIAL =1109
EVENT_DRAW =1110 EVENT_DRAW =1110
EVENT_DAMAGE =1111 EVENT_DAMAGE =1111
EVENT_RECOVER =1112 EVENT_RECOVER =1112
......
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