Commit 09697189 authored by salix5's avatar salix5

Merge pull request #1051 from DailyShana/patch-2

custom attack activity counter
parents 642d9aa9 67f14fdb
......@@ -3065,6 +3065,7 @@ int32 field::process_battle_command(uint16 step) {
core.sub_attacker = 0;
core.sub_attack_target = (card*)0xffffffff;
core.attack_state_count[infos.turn_player]++;
check_card_counter(core.attacker,5,infos.turn_player);
pduel->write_buffer8(MSG_ATTACK);
pduel->write_buffer32(core.attacker->get_info_location());
if(core.attack_target) {
......
......@@ -10,20 +10,10 @@ function c17655904.initial_effect(c)
e1:SetTarget(c17655904.target)
e1:SetOperation(c17655904.activate)
c:RegisterEffect(e1)
if not c17655904.global_check then
c17655904.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c17655904.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(17655904,ACTIVITY_ATTACK,c17655904.counterfilter)
end
function c17655904.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsCode(89631139) then
Duel.RegisterFlagEffect(tc:GetControler(),17655904,RESET_PHASE+PHASE_END,0,1)
end
function c17655904.counterfilter(c)
return not c:IsCode(89631139)
end
function c17655904.cfilter(c)
return c:IsFaceup() and c:IsCode(89631139)
......@@ -32,7 +22,7 @@ function c17655904.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17655904.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c17655904.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,17655904)==0 end
if chk==0 then return Duel.GetCustomActivityCount(17655904,tp,ACTIVITY_ATTACK)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......
......@@ -672,6 +672,6 @@ ACTIVITY_SUMMON =1 --
ACTIVITY_NORMALSUMMON =2 --
ACTIVITY_SPSUMMON =3 --
ACTIVITY_FLIPSUMMON =4 --
ACTIVITY_ATTACK =5 -- only available in custom counter
ACTIVITY_ATTACK =5 --
ACTIVITY_BATTLE_PHASE =6 -- not available in custom counter
ACTIVITY_CHAIN =7 -- only available in custom counter
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