Commit 6b5f82a9 authored by salix5's avatar salix5

chain attack

parent d3a8d9d3
......@@ -398,7 +398,7 @@ public:
#define STATUS_CONTINUOUS_POS 0x2000000
#define STATUS_IS_PUBLIC 0x4000000
#define STATUS_ACT_FROM_HAND 0x8000000
#define STATUS_SELF_BATTLE 0x10000000
#define STATUS_OPPO_BATTLE 0x10000000
//Counter
#define COUNTER_NEED_PERMIT 0x1000
#define COUNTER_NEED_ENABLE 0x2000
......
......@@ -1414,12 +1414,12 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
if(lua_gettop(L) > 2)
monsteronly = lua_toboolean(L, 3);
card* attacker = pduel->game_field->core.attacker;
if(pduel->game_field->core.effect_damage_step
|| attacker->is_status(STATUS_BATTLE_DESTROYED)
if(attacker->is_status(STATUS_BATTLE_DESTROYED)
|| attacker->current.controler != pduel->game_field->infos.turn_player
|| attacker->fieldid_r != pduel->game_field->core.pre_field[0]
|| !attacker->is_capable_attack_announce(pduel->game_field->infos.turn_player)
|| (ac != 0 && attacker->announce_count >= ac)) {
|| attacker->fieldid_r != pduel->game_field->core.pre_field[0]
|| !attacker->is_capable_attack_announce(pduel->game_field->infos.turn_player)
|| (ac != 0 && attacker->announce_count >= ac)
|| (ac == 2 && attacker->is_affected_by_effect(EFFECT_EXTRA_ATTACK))) {
lua_pushboolean(L, 0);
return 1;
}
......
......@@ -3484,9 +3484,9 @@ int32 field::process_battle_command(uint16 step) {
core.attack_target->q_cache.defence = dd;
core.attack_target->set_status(STATUS_BATTLE_DESTROYED, FALSE);
pd = core.attack_target->current.controler;
if(pa == pd){
core.attacker->set_status(STATUS_SELF_BATTLE, TRUE);
core.attack_target->set_status(STATUS_SELF_BATTLE, TRUE);
if(pa != pd){
core.attacker->set_status(STATUS_OPPO_BATTLE, TRUE);
core.attack_target->set_status(STATUS_OPPO_BATTLE, TRUE);
}
if(core.attack_target->is_position(POS_ATTACK)) {
d = da;
......@@ -3861,10 +3861,10 @@ int32 field::process_battle_command(uint16 step) {
process_single_event();
process_instant_event();
core.attacker->set_status(STATUS_BATTLE_DESTROYED, FALSE);
core.attacker->set_status(STATUS_SELF_BATTLE, FALSE);
core.attacker->set_status(STATUS_OPPO_BATTLE, FALSE);
if(core.attack_target){
core.attack_target->set_status(STATUS_BATTLE_DESTROYED, FALSE);
core.attack_target->set_status(STATUS_SELF_BATTLE, FALSE);
core.attack_target->set_status(STATUS_OPPO_BATTLE, FALSE);
}
if(!core.effect_damage_step || (core.effect_damage_step != 3)) {
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, FALSE);
......
......@@ -68,7 +68,7 @@ end
function c10032958.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c10032958.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -49,7 +49,7 @@ function c12174035.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c12174035.hdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()==e:GetHandler():GetEquipTarget() and not eg:GetFirst():IsStatus(STATUS_SELF_BATTLE)
return eg:GetFirst()==e:GetHandler():GetEquipTarget() and eg:GetFirst():IsStatus(STATUS_OPPO_BATTLE)
end
function c12174035.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -82,7 +82,7 @@ end
function c12927849.thcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
local bc=ec:GetBattleTarget()
return ec==e:GetHandler():GetEquipTarget() and not ec:IsStatus(STATUS_SELF_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
return ec==e:GetHandler():GetEquipTarget() and ec:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c12927849.thfilter(c)
return c:IsSetCard(0x7e) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......
......@@ -14,7 +14,7 @@ end
function c13438207.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local bc=tc:GetBattleTarget()
return tc:IsRelateToBattle() and not tc:IsStatus(STATUS_SELF_BATTLE) and tc:IsControler(tp) and tc:IsRace(RACE_PLANT)
return tc:IsRelateToBattle() and tc:IsStatus(STATUS_OPPO_BATTLE) and tc:IsControler(tp) and tc:IsRace(RACE_PLANT)
and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE)
end
function c13438207.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -68,8 +68,47 @@ function c18013090.catg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c18013090.caop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
Duel.ChainAttack(tc)
--Duel.ChainAttack(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetLabelObject(tc)
e3:SetTarget(c18013090.exttg)
e3:SetValue(c18013090.extval)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetLabelObject(e1)
e4:SetOperation(aux.atrst)
e4:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e4,tp)
end
end
function c18013090.exttg(e,c)
local tc=e:GetLabelObject()
return c~=tc
end
function c18013090.extval(e,c)
return c==e:GetHandler()
end
......@@ -32,8 +32,7 @@ end
function c21435914.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
and c:IsChainAttackable(2,true) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and not c:IsStatus(STATUS_SELF_BATTLE)
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and c:IsChainAttackable(2,true) and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c21435914.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -42,7 +42,7 @@ end
function c23118924.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c23118924.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c23118924.atop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,7 +27,7 @@ end
function c30314994.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c30314994.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c30314994.atop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -50,7 +50,7 @@ function c33823832.cacon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not d then return false end
if d:IsControler(tp) then a,d=d,a end
if a:IsStatus(STATUS_OPPO_BATTLE) and d:IsControler(tp) then a,d=d,a end
if a:IsType(TYPE_PENDULUM)
and not a:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsStatus(STATUS_BATTLE_DESTROYED) then
e:SetLabelObject(a)
......
......@@ -41,7 +41,7 @@ end
function c35638627.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c35638627.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -105,13 +105,6 @@ function c35884610.atop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetLabelObject(e1)
e2:SetOperation(aux.atrst)
e2:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e2,tp)
end
function c35884610.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
......
......@@ -13,7 +13,7 @@ end
function c46427957.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c46427957.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -10,7 +10,7 @@ function c49202331.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c49202331.damcon)
e1:SetCondition(aux.bdgcon)
e1:SetTarget(c49202331.damtg)
e1:SetOperation(c49202331.damop)
c:RegisterEffect(e1)
......@@ -19,16 +19,12 @@ function c49202331.initial_effect(c)
e2:SetDescription(aux.Stringid(49202331,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCountLimit(1)
e2:SetCondition(c49202331.atcon)
e2:SetCost(c49202331.atcost)
e2:SetOperation(c49202331.atop)
c:RegisterEffect(e2)
end
function c49202331.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c49202331.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetHandler():GetBattleTarget()
......
......@@ -11,7 +11,7 @@ function c57274196.initial_effect(c)
end
function c57274196.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsRace(RACE_SPELLCASTER) and tc:IsChainAttackable()
return tc:IsControler(tp) and tc:IsRace(RACE_SPELLCASTER) and tc:IsChainAttackable() and tc:IsStatus(STATUS_OPPO_BATTLE)
end
function c57274196.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0
......
......@@ -66,7 +66,7 @@ function c58272005.atcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if not eg:IsContains(ec) then return false end
local bc=ec:GetBattleTarget()
return bc:IsReason(REASON_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and ec:IsChainAttackable(2,true)
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and ec:IsChainAttackable(2,true) and ec:IsStatus(STATUS_OPPO_BATTLE)
end
function c58272005.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -17,7 +17,7 @@ function c6330307.initial_effect(c)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--
--chain attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(6330307,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......@@ -64,13 +64,51 @@ function c6330307.atkcon(e,tp,eg,ep,ev,re,r,rp)
end
function c6330307.atkop(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
if at:IsRelateToBattle() and not at:IsImmuneToEffect(e) then
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if at:IsRelateToBattle() and not at:IsImmuneToEffect(e) and at:GetAttack()>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
at:RegisterEffect(e1)
Duel.ChainAttack(at)
--Duel.ChainAttack(at)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
ec:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
ec:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetLabelObject(at)
e4:SetTarget(c6330307.exttg)
e4:SetValue(c6330307.extval)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
ec:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetLabelObject(e2)
e5:SetOperation(aux.atrst)
e5:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e5,tp)
end
end
function c6330307.exttg(e,c)
local tc=e:GetLabelObject()
return c~=tc
end
function c6330307.extval(e,c)
return c==e:GetHandler()
end
......@@ -26,7 +26,7 @@ end
function c65260293.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c65260293.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c65260293.atop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -20,8 +20,8 @@ c65676461.xyz_number=32
function c65676461.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c==Duel.GetAttacker() and c:IsChainAttackable()
and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE)
return c==Duel.GetAttacker() and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE)
and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c65676461.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -8,6 +8,7 @@ function c69069911.initial_effect(c)
e1:SetDescription(aux.Stringid(69069911,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCountLimit(1)
e1:SetCondition(c69069911.atcon)
e1:SetCost(c69069911.atcost)
e1:SetOperation(c69069911.atop)
......@@ -16,8 +17,7 @@ end
function c69069911.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
and c:IsChainAttackable() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and not c:IsStatus(STATUS_SELF_BATTLE)
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c69069911.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -78,7 +78,7 @@ function c72989439.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:GetFlagEffect(72989439)==0
and c:IsChainAttackable() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and not c:IsStatus(STATUS_SELF_BATTLE)
and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c72989439.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -15,7 +15,47 @@ function c75292259.atcon(e,tp,eg,ep,ev,re,r,rp)
and bc:GetBattlePosition()==POS_FACEUP_ATTACK and c:IsChainAttackable(3)
end
function c75292259.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if Duel.SelectYesNo(tp,aux.Stringid(75292259,0)) then
Duel.ChainAttack(e:GetHandler():GetBattleTarget())
--Duel.ChainAttack(e:GetHandler():GetBattleTarget())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetLabelObject(bc)
e3:SetTarget(c75292259.exttg)
e3:SetValue(c75292259.extval)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetLabelObject(e1)
e4:SetOperation(aux.atrst)
e4:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e4,tp)
end
end
function c75292259.exttg(e,c)
local tc=e:GetLabelObject()
return c~=tc
end
function c75292259.extval(e,c)
return c==e:GetHandler()
end
......@@ -58,7 +58,7 @@ end
function c80367387.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c80367387.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -21,9 +21,9 @@ function c86137485.initial_effect(c)
end
function c86137485.atcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
return Duel.GetTurnPlayer()==tp and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
and tc:IsType(TYPE_MONSTER) and c:IsChainAttackable()
local bc=c:GetBattleTarget()
return Duel.GetTurnPlayer()==tp and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c86137485.atop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -34,11 +34,26 @@ function c86137485.atop1(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
Duel.ChainAttack()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetLabelObject(e2)
e3:SetOperation(aux.atrst)
e3:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e3,tp)
end
function c86137485.atcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return Duel.GetTurnPlayer()~=tp and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE) and tc:IsType(TYPE_MONSTER)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return Duel.GetTurnPlayer()~=tp and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE)
and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c86137485.atop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -93,8 +93,7 @@ end
function c88301393.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
and c:IsChainAttackable() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) and not c:IsStatus(STATUS_SELF_BATTLE)
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c88301393.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -148,7 +148,7 @@ STATUS_JUST_POS =0x1000000 --
STATUS_CONTINUOUS_POS =0x2000000 --连续变更表示形式?
STATUS_IS_PUBLIC =0x4000000 --公开展示
STATUS_ACT_FROM_HAND =0x8000000 --在手牌发动
STATUS_SELF_BATTLE =0x10000000 --和自己的怪兽戰鬥
STATUS_OPPO_BATTLE =0x10000000 --和對手的怪兽戰鬥
--Assume
ASSUME_CODE =1
ASSUME_TYPE =2
......
......@@ -960,7 +960,7 @@ end
function Auxiliary.bdocon(e,tp,eg,ep,ev,re,r,rp)
--condition of EVENT_BATTLE_DESTROYING + opponent monster
local c=e:GetHandler()
return c:IsRelateToBattle() and not c:IsStatus(STATUS_SELF_BATTLE)
return c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function Auxiliary.bdgcon(e,tp,eg,ep,ev,re,r,rp)
--condition of EVENT_BATTLE_DESTROYING + to_grave
......@@ -972,5 +972,5 @@ function Auxiliary.bdogcon(e,tp,eg,ep,ev,re,r,rp)
--condition of EVENT_BATTLE_DESTROYING + opponent monster + to_grave
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and not c:IsStatus(STATUS_SELF_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
return c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
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