Commit 03c2cadc authored by argon.sun's avatar argon.sun

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents 8fd49f91 e94ed56b
......@@ -14,7 +14,7 @@
#include <dirent.h>
#endif
const unsigned short PRO_VERSION = 0x1310;
const unsigned short PRO_VERSION = 0x1320;
namespace ygo {
......
......@@ -541,7 +541,7 @@ public:
#define GLOBALFLAG_BRAINWASHING_CHECK 0x2
#define GLOBALFLAG_SCRAP_CHIMERA 0x4
#define GLOBALFLAG_DELAYED_QUICKEFFECT 0x8
#define GLOBALFLAG_DETACH_EVENT 0x10
//
#define PROCESSOR_NONE 0
#define PROCESSOR_WAITING 0x10000
......
......@@ -2864,7 +2864,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
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) {
if((*iter)->current.location & LOCATION_MZONE)
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
}
adjust_instant();
process_single_event();
if(leave.size()) {
if(leave.size())
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);
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;
}
case 5: {
......
--BK 拘束蛮兵リードブロー
function c23232295.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsSetCard,0x84),4),2)
c:EnableReviveLimit()
......
......@@ -4,7 +4,7 @@ function c35307484.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35307484,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CHAIN_UNIQUE+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
......
--紋章の記録
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
......@@ -35,8 +35,10 @@ function c42551040.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c42551040.posop(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)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if tc:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE)
end
if tc:GetDefence()>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -20,12 +20,14 @@ function c59957503.initial_effect(c)
end
end
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
function c59957503.condition(e,tp,eg,ep,ev,re,r,rp)
local acte=c59957503[0]
c59957503[0]=nil
return re==acte and rp~=tp and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
return rp~=tp and Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==c59957503[0]
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c59957503.target(e,tp,eg,ep,ev,re,r,rp,chk)
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
......@@ -45,15 +45,19 @@ function c77205367.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c77205367.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttackTarget()
if chk==0 then return ((at and at:IsFaceup() and Duel.GetAttacker()==e:GetHandler()) or at==e:GetHandler())
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then
local c=e:GetHandler()
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
return ((a==c and at and at:IsFaceup() and at:GetAttack()>0) or (at==c and a:GetAttack()>0))
and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
Duel.SetTargetCard(e:GetHandler():GetBattleTarget())
end
function c77205367.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttacker()>0 then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -624,6 +624,7 @@ GLOBALFLAG_DECK_REVERSE_CHECK =0x1
GLOBALFLAG_BRAINWASHING_CHECK =0x2
GLOBALFLAG_SCRAP_CHIMERA =0x4
GLOBALFLAG_DELAYED_QUICKEFFECT =0x8
GLOBALFLAG_DETACH_EVENT =0x10
--
DUEL_TEST_MODE =0x01
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