Commit 147d0098 authored by argon.sun's avatar argon.sun

fix

parent 940734a9
......@@ -885,6 +885,7 @@ void card::reset(uint32 id, uint32 reset_type) {
attacked_cards.clear();
announce_count = 0;
attacked_count = 0;
attack_all_target = TRUE;
}
if(id & 0x5fe0000) {
battled_cards.clear();
......
......@@ -92,6 +92,7 @@ public:
uint32 operation_param;
uint8 announce_count;
uint8 attacked_count;
uint8 attack_all_target;
uint16 cardid;
uint32 fieldid;
uint32 fieldid_r;
......@@ -188,7 +189,7 @@ public:
effect* check_equip_control_effect();
int32 fusion_check(group* fusion_m, card* cg, int32 chkf);
void fusion_select(uint8 playerid, group* fusion_m, card* cg, int32 chkf);
int32 is_equipable(card* pcard);
int32 is_summonable();
int32 is_summonable(effect* peffect);
......
......@@ -1366,15 +1366,8 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
if(atarget && atarget->is_affected_by_effect(EFFECT_MUST_BE_ATTACKED))
must_be_attack.push_back(atarget);
}
if((peffect = pcard->is_affected_by_effect(EFFECT_ATTACK_ALL))) {
if(pcard->attack_all_target && (peffect = pcard->is_affected_by_effect(EFFECT_ATTACK_ALL))) {
if(pcard->announced_cards.size()) {
for(auto ait = pcard->announced_cards.begin(); ait != pcard->announced_cards.end(); ++ait) {
if(ait->first == 0)
continue;
pduel->lua->add_param(ait->second, PARAM_TYPE_CARD);
if(!peffect->check_value_condition(1))
return 0;
}
if(must_be_attack.size())
pv = &must_be_attack;
else
......@@ -1423,6 +1416,20 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
pcard->operation_param = 1;
return must_be_attack.size() ? TRUE : FALSE;
}
void field::attack_all_target_check() {
if(!core.attacker)
return;
if(!core.attack_target) {
core.attacker->attack_all_target = FALSE;
return;
}
effect* peffect = core.attacker->is_affected_by_effect(EFFECT_ATTACK_ALL);
if(!peffect)
return;
pduel->lua->add_param(core.attack_target, PARAM_TYPE_CARD);
if(!peffect->check_value_condition(1))
core.attacker->attack_all_target = FALSE;
}
int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, int32 min, int32 max) {
card* tuner;
for(uint8 p = 0; p < 2; ++p) {
......
......@@ -337,6 +337,7 @@ public:
uint32 get_field_counter(uint8 self, uint8 s, uint8 o, uint16 countertype);
int32 effect_replace_check(uint32 code, tevent& e);
int32 get_attack_target(card* pcard, card_vector* v, uint8 chain_attack = FALSE);
void attack_all_target_check();
int32 check_synchro_material(card* pcard, int32 findex1, int32 findex2, int32 min, int32 max);
int32 check_tuner_material(card* pcard, card* tuner, int32 findex1, int32 findex2, int32 min, int32 max);
int32 check_with_sum_limit(card_vector* mats, int32 acc, int32 index, int32 count, int32 min, int32 max);
......
......@@ -2784,6 +2784,7 @@ int32 field::process_battle_command(uint16 step) {
}
core.attacker->attacked_count++;
core.attacker->announce_count++;
attack_all_target_check();
}
if(!peffect->value)
add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_BATTLE, 0);
......@@ -2802,6 +2803,7 @@ int32 field::process_battle_command(uint16 step) {
else
core.attacker->announced_cards[0] = 0;
core.attacker->announce_count++;
attack_all_target_check();
if(!atk_disabled) {
if(core.attack_target)
core.attacker->attacked_cards[core.attack_target->fieldid_r] = core.attack_target;
......@@ -2824,6 +2826,7 @@ int32 field::process_battle_command(uint16 step) {
core.sub_attack_target = (card*)0xffffffff;
core.attacker->announce_count++;
core.attacker->attacked_count++;
attack_all_target_check();
pduel->write_buffer8(MSG_ATTACK);
pduel->write_buffer32(core.attacker->get_info_location());
if(core.attack_target) {
......@@ -2840,6 +2843,7 @@ int32 field::process_battle_command(uint16 step) {
}
if(core.chain_attack && core.chain_attack_target) {
core.attacker->announce_count++;
attack_all_target_check();
if(!(core.chain_attack_target->current.location & LOCATION_MZONE)) {
core.units.begin()->step = -1;
reset_phase(PHASE_DAMAGE);
......@@ -2874,6 +2878,7 @@ int32 field::process_battle_command(uint16 step) {
if(!rollback) {
core.attacker->announce_count++;
core.attacker->attacked_count++;
attack_all_target_check();
if(core.attack_target) {
core.attacker->announced_cards[core.attack_target->fieldid_r] = core.attack_target;
core.attacker->attacked_cards[core.attack_target->fieldid_r] = core.attack_target;
......@@ -2888,6 +2893,7 @@ int32 field::process_battle_command(uint16 step) {
}
if(!core.select_cards.size() && !core.attacker->operation_param) {
core.attacker->announce_count++;
attack_all_target_check();
core.units.begin()->step = -1;
reset_phase(PHASE_DAMAGE);
adjust_instant();
......@@ -2913,6 +2919,7 @@ int32 field::process_battle_command(uint16 step) {
core.attacker->announced_cards[core.attack_target->fieldid_r] = core.attack_target;
else
core.attacker->announced_cards[0] = 0;
attack_all_target_check();
core.units.begin()->step = -1;
reset_phase(PHASE_DAMAGE);
adjust_instant();
......@@ -3593,6 +3600,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
pcard->announced_cards.clear();
pcard->attacked_cards.clear();
pcard->battled_cards.clear();
pcard->attack_all_target = TRUE;
}
for(uint8 i = 0; i < 6; ++i) {
pcard = player[p].list_szone[i];
......
......@@ -11,6 +11,7 @@ function c15893860.initial_effect(c)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
......@@ -34,6 +35,7 @@ function c15893860.operation(e,tp,eg,ep,ev,re,r,rp)
tc:AddCounter(0x15,1)
end
if ct>=3 and Duel.SelectYesNo(tp,aux.Stringid(15893860,2)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
......
......@@ -59,7 +59,7 @@ function c1992816.olop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
if g:GetCount()>1 then
Duel.Overlay(c,g)
end
end
......
......@@ -6,6 +6,7 @@ function c34707034.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c34707034.target)
e1:SetOperation(c34707034.operation)
c:RegisterEffect(e1)
......
......@@ -2,7 +2,7 @@
function c60080151.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
......
......@@ -5,7 +5,7 @@ function c61132951.initial_effect(c)
e1:SetDescription(aux.Stringid(61132951,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetTarget(c61132951.destg)
e1:SetOperation(c61132951.desop)
c:RegisterEffect(e1)
......
......@@ -4,6 +4,7 @@ function c62476197.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62476197,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING)
......
......@@ -26,7 +26,7 @@ function c8719957.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(8719957,0))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetType(EFFECT_TYPE_QUICK_F)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
......
......@@ -9,6 +9,7 @@ function c96704018.initial_effect(c)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
......
......@@ -5,7 +5,7 @@ function c9861795.initial_effect(c)
e1:SetDescription(aux.Stringid(9861795,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c9861795.condition)
e1:SetTarget(c9861795.target)
......
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