Commit 5819d7ff authored by argon's avatar argon

new

parent 75da1ed1
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
const unsigned short PRO_VERSION = 0x1310; const unsigned short PRO_VERSION = 0x1400;
namespace ygo { namespace ygo {
......
...@@ -541,7 +541,7 @@ public: ...@@ -541,7 +541,7 @@ public:
#define GLOBALFLAG_BRAINWASHING_CHECK 0x2 #define GLOBALFLAG_BRAINWASHING_CHECK 0x2
#define GLOBALFLAG_SCRAP_CHIMERA 0x4 #define GLOBALFLAG_SCRAP_CHIMERA 0x4
#define GLOBALFLAG_DELAYED_QUICKEFFECT 0x8 #define GLOBALFLAG_DELAYED_QUICKEFFECT 0x8
#define GLOBALFLAG_DETACH_EVENT 0x10
// //
#define PROCESSOR_NONE 0 #define PROCESSOR_NONE 0
#define PROCESSOR_WAITING 0x10000 #define PROCESSOR_WAITING 0x10000
......
...@@ -2864,7 +2864,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2864,7 +2864,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel->write_buffer32(ptop->data.code | 0x80000000); pduel->write_buffer32(ptop->data.code | 0x80000000);
} }
} }
if(detach.size()) { if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && detach.size()) {
for(auto iter = detach.begin(); iter != detach.end(); ++iter) { for(auto iter = detach.begin(); iter != detach.end(); ++iter) {
if((*iter)->current.location & LOCATION_MZONE) if((*iter)->current.location & LOCATION_MZONE)
raise_single_event(*iter, 0, EVENT_DETACH_MATERIAL, reason_effect, reason, reason_player, 0, 0); raise_single_event(*iter, 0, EVENT_DETACH_MATERIAL, reason_effect, reason, reason_player, 0, 0);
...@@ -2872,14 +2872,13 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2872,14 +2872,13 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
} }
adjust_instant(); adjust_instant();
process_single_event(); process_single_event();
if(leave.size()) { if(leave.size())
raise_event(&leave, EVENT_LEAVE_FIELD, reason_effect, reason, reason_player, 0, 0); raise_event(&leave, EVENT_LEAVE_FIELD, reason_effect, reason, reason_player, 0, 0);
process_instant_event(); if(discard.size())
}
if(discard.size()) {
raise_event(&discard, EVENT_DISCARD, reason_effect, reason, reason_player, 0, 0); raise_event(&discard, EVENT_DISCARD, reason_effect, reason, reason_player, 0, 0);
process_instant_event(); if((core.global_flag & GLOBALFLAG_DETACH_EVENT) && detach.size())
} raise_event(&detach, EVENT_DETACH_MATERIAL, reason_effect, reason, reason_player, 0, 0);
process_instant_event();
return FALSE; return FALSE;
} }
case 5: { case 5: {
......
--BK 拘束蛮兵リードブロー --BK 拘束蛮兵リードブロー
function c23232295.initial_effect(c) function c23232295.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsSetCard,0x84),4),2) aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsSetCard,0x84),4),2)
c:EnableReviveLimit() c:EnableReviveLimit()
......
--紋章の記録
function c37241623.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c37241623.condition)
e1:SetTarget(c37241623.target)
e1:SetOperation(c37241623.activate)
c:RegisterEffect(e1)
if not c37241623.global_check then
c37241623.global_check=true
c37241623[0]=nil
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DETACH_MATERIAL)
ge1:SetOperation(c37241623.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c37241623.checkop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetCurrentChain()
if cid>0 then
c37241623[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID)
end
end
function c37241623.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==c37241623[0] and re:IsActiveType(TYPE_XYZ) and Duel.IsChainNegatable(ev)
end
function c37241623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c37241623.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
...@@ -20,12 +20,14 @@ function c59957503.initial_effect(c) ...@@ -20,12 +20,14 @@ function c59957503.initial_effect(c)
end end
end end
function c59957503.checkop(e,tp,eg,ep,ev,re,r,rp) function c59957503.checkop(e,tp,eg,ep,ev,re,r,rp)
c59957503[0]=re local cid=Duel.GetCurrentChain()
if cid>0 then
c59957503[0]=Duel.GetChainInfo(cid,CHAININFO_CHAIN_ID)
end
end end
function c59957503.condition(e,tp,eg,ep,ev,re,r,rp) function c59957503.condition(e,tp,eg,ep,ev,re,r,rp)
local acte=c59957503[0] return rp~=tp and Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==c59957503[0]
c59957503[0]=nil and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
return re==acte and rp~=tp and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end end
function c59957503.target(e,tp,eg,ep,ev,re,r,rp,chk) function c59957503.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--幻蝶の護り
function c63630268.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_ARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c63630268.target)
e1:SetOperation(c63630268.operation)
c:RegisterEffect(e1)
end
function c63630268.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsPosition(POS_FACEUP_ATTACK) end
if chk==0 then return Duel.IsExistingTarget(Card.IsPosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,POS_FACEUP_ATTACK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.SelectTarget(tp,Card.IsPosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,POS_FACEUP_ATTACK)
end
function c63630268.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE)
end
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:SetValue(c63630268.damval)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
function c63630268.damval(e,re,val,r,rp,rc)
return val/2
end
--オーバーレイ・キャプチャー
function c74852810.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_ARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c74852810.target)
e1:SetOperation(c74852810.operation)
c:RegisterEffect(e1)
end
function c74852810.filter1(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
end
function c74852810.filter2(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c74852810.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c74852810.filter1,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c74852810.filter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c74852810.filter1,tp,0,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c74852810.filter2,tp,LOCATION_MZONE,0,1,1,nil)
end
function c74852810.operation(e,tp,eg,ep,ev,re,r,rp)
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
local mg=tc1:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc2,mg)
end
end
end
...@@ -624,6 +624,7 @@ GLOBALFLAG_DECK_REVERSE_CHECK =0x1 ...@@ -624,6 +624,7 @@ GLOBALFLAG_DECK_REVERSE_CHECK =0x1
GLOBALFLAG_BRAINWASHING_CHECK =0x2 GLOBALFLAG_BRAINWASHING_CHECK =0x2
GLOBALFLAG_SCRAP_CHIMERA =0x4 GLOBALFLAG_SCRAP_CHIMERA =0x4
GLOBALFLAG_DELAYED_QUICKEFFECT =0x8 GLOBALFLAG_DELAYED_QUICKEFFECT =0x8
GLOBALFLAG_DETACH_EVENT =0x10
-- --
DUEL_TEST_MODE =0x01 DUEL_TEST_MODE =0x01
DUEL_ATTACK_FIRST_TURN =0x02 DUEL_ATTACK_FIRST_TURN =0x02
......
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