Commit ea5e9392 authored by argon.sun's avatar argon.sun

fix

parent 9010d12a
......@@ -369,6 +369,7 @@ public:
void raise_event(card_set* event_cards, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value);
void raise_single_event(card* trigger_card, card_set* event_cards, uint32 event_code, effect* reason_effect, uint32 reason, uint8 reason_player, uint8 event_player, uint32 event_value );
int32 check_event(uint32 code, tevent* pe = 0);
int32 check_event_c(effect* peffect, uint8 playerid, int32 neglect_con, int32 neglect_cost, int32 copy_info, tevent* pe = 0);
int32 check_hint_timing(effect* peffect);
int32 process_phase_event(int16 step, int32 phase_event);
int32 process_point_event(int16 step, int32 special, int32 skip_new);
......
......@@ -711,13 +711,34 @@ int32 scriptlib::card_get_activate_effect(lua_State *L) {
return count;
}
int32 scriptlib::card_check_activate_effect(lua_State *L) {
check_param_count(L, 3);
check_param_count(L, 4);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 neglect_con = lua_toboolean(L, 2);
int32 neglect_cost = lua_toboolean(L, 3);
int32 copy_info = lua_toboolean(L, 4);
duel* pduel = pcard->pduel;
return 1;
tevent pe;
for(auto eit = pcard->field_effect.begin(); eit != pcard->field_effect.end(); ++eit) {
effect* peffect = eit->second;
if((peffect->type & EFFECT_TYPE_ACTIVATE)
&& pduel->game_field->check_event_c(peffect, pduel->game_field->core.reason_player, neglect_con, neglect_cost, copy_info, &pe)) {
if(!copy_info || (peffect->code == EVENT_FREE_CHAIN)) {
interpreter::effect2value(L, peffect);
return 1;
} else {
interpreter::effect2value(L, peffect);
interpreter::group2value(L, pe.event_cards);
lua_pushinteger(L, pe.event_player);
lua_pushinteger(L, pe.event_value);
interpreter::effect2value(L, pe.reason_effect);
lua_pushinteger(L, pe.reason);
lua_pushinteger(L, pe.reason_player);
return 7;
}
}
}
return 0;
}
int32 scriptlib::card_register_effect(lua_State *L) {
check_param_count(L, 2);
......
......@@ -1199,15 +1199,14 @@ void field::raise_single_event(card* trigger_card, card_set* event_cards, uint32
core.single_event.push_back(new_event);
}
int32 field::check_event(uint32 code, tevent * pe) {
event_list::iterator eit;
for(eit = core.point_event.begin(); eit != core.point_event.end(); ++eit) {
for(auto eit = core.point_event.begin(); eit != core.point_event.end(); ++eit) {
if(eit->event_code == code) {
if(pe)
*pe = *eit;
return TRUE;
}
}
for(eit = core.instant_event.begin(); eit != core.instant_event.end(); ++eit) {
for(auto eit = core.instant_event.begin(); eit != core.instant_event.end(); ++eit) {
if(eit->event_code == code) {
if(pe)
*pe = *eit;
......@@ -1216,6 +1215,34 @@ int32 field::check_event(uint32 code, tevent * pe) {
}
return FALSE;
}
int32 field::check_event_c(effect* peffect, uint8 playerid, int32 neglect_con, int32 neglect_cost, int32 copy_info, tevent* pe) {
if(peffect->code == EVENT_FREE_CHAIN) {
return peffect->is_activate_ready(playerid, nil_event, neglect_con, neglect_cost, FALSE);
}
for(auto eit = core.point_event.begin(); eit != core.point_event.end(); ++eit) {
if(eit->event_code == peffect->code &&
peffect->is_activate_ready(playerid, *eit, neglect_con, neglect_cost, FALSE)) {
if(pe)
*pe = *eit;
if(copy_info && !pduel->lua->no_action && core.current_chain.size()) {
core.current_chain.rbegin()->evt = *eit;
}
return TRUE;
}
}
for(auto eit = core.instant_event.begin(); eit != core.instant_event.end(); ++eit) {
if(eit->event_code == peffect->code &&
peffect->is_activate_ready(playerid, *eit, neglect_con, neglect_cost, FALSE)) {
if(pe)
*pe = *eit;
if(copy_info && !pduel->lua->no_action && core.current_chain.size()) {
core.current_chain.rbegin()->evt = *eit;
}
return TRUE;
}
}
return FALSE;
}
int32 field::check_hint_timing(effect* peffect) {
int32 p = peffect->get_handler_player();
if(p == 0)
......
......@@ -19,25 +19,8 @@ function c22628574.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c22628574.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c22628574.check_effect(ce,e,tp,eg,ep,ev,re,r,rp)
local ecode=ce:GetCode()
if ecode~=EVENT_FREE_CHAIN and not Duel.CheckEvent(ecode) then return false end
local con=ce:GetCondition()
if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end
local tg=ce:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
end
function c22628574.filter(c,e,tp,eg,ep,ev,re,r,rp)
if c:GetType()~=0x4 or c:IsCode(22628574) then return false end
local e1,e2,e3,e4,e5=c:GetActivateEffect()
if e1 and c22628574.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e2 and c22628574.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e3 and c22628574.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e4 and c22628574.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e5 and c22628574.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then return true
end
return false
return c:GetType()==0x4 and not c:IsCode(22628574) and c:CheckActivateEffect(false,true,false)~=nil
end
function c22628574.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
......@@ -45,23 +28,16 @@ function c22628574.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,1,true)
end
if chk==0 then return Duel.IsExistingTarget(c22628574.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp,eg,ep,ev,re,r,rp) end
if chk==0 then return Duel.IsExistingTarget(c22628574.filter,tp,0,LOCATION_GRAVE,1,nil) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22628574,0))
local g=Duel.SelectTarget(tp,c22628574.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local e1,e2,e3,e4,e5=g:GetFirst():GetActivateEffect()
local se=nil
if e1 and c22628574.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then se=e1
elseif e2 and c22628574.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then se=e2
elseif e3 and c22628574.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then se=e3
elseif e4 and c22628574.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then se=e4
elseif e5 and c22628574.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then se=e5
end
e:SetLabelObject(se)
local g=Duel.SelectTarget(tp,c22628574.filter,tp,0,LOCATION_GRAVE,1,1,nil)
local te,eg,ep,ev,re,r,rp=g:GetFirst():CheckActivateEffect(false,true,true)
e:SetLabelObject(te)
Duel.ClearTargetCard()
local tg=se:GetTarget()
e:SetCategory(se:GetCategory())
e:SetProperty(se:GetProperty())
local tg=te:GetTarget()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end
function c22628574.operation(e,tp,eg,ep,ev,re,r,rp)
......
--マジシャンズ·クロス
function c36045450.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c36045450.condition)
e1:SetTarget(c36045450.target)
e1:SetOperation(c36045450.operation)
c:RegisterEffect(e1)
end
function c36045450.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_SPELLCASTER)
end
function c36045450.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c36045450.filter,tp,LOCATION_MZONE,0,2,nil)
end
function c36045450.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c36045450.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c36045450.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c36045450.filter,tp,LOCATION_MZONE,0,1,1,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c36045450.ftarget)
e1:SetLabel(g:GetFirst():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c36045450.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(3000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c36045450.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID() and c:IsRace(RACE_SPELLCASTER)
end
......@@ -16,10 +16,10 @@ function c55713623.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c55713623.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsFaceup() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c55713623.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -28,7 +28,7 @@ function c55713623.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(atk/2)
tc:RegisterEffect(e1)
end
......
......@@ -8,48 +8,25 @@ function c58242947.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e1)
e1:SetCost(c58242947.cost)
e1:SetTarget(c58242947.tg)
e1:SetOperation(c58242947.op)
e1:SetTarget(c58242947.target)
e1:SetOperation(c58242947.operation)
c:RegisterEffect(e1)
end
function c58242947.check_effect(ce,e,tp,eg,ep,ev,re,r,rp)
local ecode=ce:GetCode()
if ecode~=EVENT_FREE_CHAIN and not Duel.CheckEvent(ecode) then return false end
local con=ce:GetCondition()
if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end
local tg=ce:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
end
function c58242947.filter(c,e,tp,eg,ep,ev,re,r,rp)
if c:GetType()~=0x4 or not c:IsAbleToRemoveAsCost() then return false end
local e1,e2,e3,e4,e5=c:GetActivateEffect()
if e1 and c58242947.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e2 and c58242947.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e3 and c58242947.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e4 and c58242947.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e5 and c58242947.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then return true
end
return false
function c58242947.filter(c)
return c:GetType()==0x4 and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(false,true,false)~=nil
end
function c58242947.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c58242947.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
and Duel.IsExistingMatchingCard(c58242947.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(58242947,1))
local g=Duel.SelectMatchingCard(tp,c58242947.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local e1,e2,e3,e4,e5=g:GetFirst():GetActivateEffect()
if e1 and c58242947.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then e:SetLabelObject(e1)
elseif e2 and c58242947.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then e:SetLabelObject(e2)
elseif e3 and c58242947.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then e:SetLabelObject(e3)
elseif e4 and c58242947.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then e:SetLabelObject(e4)
elseif e5 and c58242947.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then e:SetLabelObject(e5)
end
local g=Duel.SelectMatchingCard(tp,c58242947.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te=g:GetFirst():CheckActivateEffect(false,true,true)
e:SetLabelObject(te)
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c58242947.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c58242947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=e:GetLabelObject()
if chkc then
local tg=te:GetTarget()
......@@ -57,12 +34,12 @@ function c58242947.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
if chk==0 then return true end
if not te then return end
local tg=te:GetTarget()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end
function c58242947.op(e,tp,eg,ep,ev,re,r,rp)
function c58242947.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
local op=te:GetOperation()
......
--防御輪
function c58641905.initial_effect(c)
--reflect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c58641905.condition)
e1:SetOperation(c58641905.operation)
c:RegisterEffect(e1)
end
function c58641905.condition(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_TRAP) then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
return ex
end
function c58641905.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetLabel(cid)
e1:SetValue(c58641905.refcon)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c58641905.refcon(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid==e:GetLabel() then return 0 end
return val
end
--ユニオン·アタック
function c60399954.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c60399954.condition)
e1:SetTarget(c60399954.target)
e1:SetOperation(c60399954.operation)
c:RegisterEffect(e1)
end
function c60399954.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c60399954.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c60399954.ftarget)
e1:SetLabel(g:GetFirst():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c60399954.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=0
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,tc)
local bc=g:GetFirst()
while bc do
atk=atk+bc:GetAttack()
bc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c60399954.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--威圧する魔眼
function c60577362.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c60577362.target)
e1:SetOperation(c60577362.activate)
c:RegisterEffect(e1)
end
function c60577362.filter(c)
return c:IsFaceup() and c:IsAttackBelow(2000) and c:IsRace(RACE_ZOMBIE)
end
function c60577362.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c60577362.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60577362.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c60577362.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c60577362.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
......@@ -4,9 +4,8 @@ function c63665875.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(63665875,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c63665875.ddcon)
e1:SetTarget(c63665875.ddtg)
e1:SetOperation(c63665875.ddop)
......@@ -23,7 +22,7 @@ function c63665875.initial_effect(c)
c:RegisterEffect(e2)
end
function c63665875.ddcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and (Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler())
return ep~=tp
end
function c63665875.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -18,25 +18,8 @@ function c79766336.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c79766336.check_effect(ce,e,tp,eg,ep,ev,re,r,rp)
local ecode=ce:GetCode()
if ecode~=EVENT_FREE_CHAIN and not Duel.CheckEvent(ecode) then return false end
local con=ce:GetCondition()
if con and not con(e,tp,eg,ep,ev,re,r,rp) then return false end
local tg=ce:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
end
function c79766336.filter(c,e,tp,eg,ep,ev,re,r,rp)
if c:GetType()~=0x4 or c:IsCode(79766336) then return false end
local e1,e2,e3,e4,e5=c:GetActivateEffect()
if e1 and c79766336.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e2 and c79766336.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e3 and c79766336.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e4 and c79766336.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then return true
elseif e5 and c79766336.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then return true
end
return false
return c:GetType()==0x4 and not c:IsCode(79766336) and c:IsAbleToRemove() and c:CheckActivateEffect(false,true,false)~=nil
end
function c79766336.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
......@@ -44,32 +27,24 @@ function c79766336.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,1,true)
end
if chk==0 then return Duel.IsExistingTarget(c79766336.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
if chk==0 then return Duel.IsExistingTarget(c79766336.filter,tp,LOCATION_GRAVE,0,1,nil) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79766336,0))
local g=Duel.SelectTarget(tp,c79766336.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local e1,e2,e3,e4,e5=g:GetFirst():GetActivateEffect()
local se=nil
if e1 and c79766336.check_effect(e1,e,tp,eg,ep,ev,re,r,rp) then se=e1
elseif e2 and c79766336.check_effect(e2,e,tp,eg,ep,ev,re,r,rp) then se=e2
elseif e3 and c79766336.check_effect(e3,e,tp,eg,ep,ev,re,r,rp) then se=e3
elseif e4 and c79766336.check_effect(e4,e,tp,eg,ep,ev,re,r,rp) then se=e4
elseif e5 and c79766336.check_effect(e5,e,tp,eg,ep,ev,re,r,rp) then se=e5
end
e:SetLabelObject(se)
local g=Duel.SelectTarget(tp,c79766336.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,eg,ep,ev,re,r,rp=g:GetFirst():CheckActivateEffect(false,true,true)
e:SetLabelObject(te)
Duel.ClearTargetCard()
se:GetHandler():CreateEffectRelation(e)
local tg=se:GetTarget()
e:SetCategory(se:GetCategory())
e:SetProperty(se:GetProperty())
g:GetFirst():CreateEffectRelation(e)
local tg=te:GetTarget()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end
function c79766336.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te:GetHandler():IsRelateToEffect(e) then return end
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if te:GetHandler():IsRelateToEffect(e) then
Duel.Remove(te:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
Duel.Remove(te:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--ブラッド·サッカー
function c97783659.initial_effect(c)
--handes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97783659,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c97783659.ddcon)
e1:SetTarget(c97783659.ddtg)
e1:SetOperation(c97783659.ddop)
c:RegisterEffect(e1)
end
function c97783659.ddcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c97783659.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,0,0,1-tp,1)
end
function c97783659.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,1,REASON_EFFECT)
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