Commit 3c81ab61 authored by salix5's avatar salix5

Merge pull request #1368 from Tianchenglipu/patch-2

Fix for "Always treated as a 'Utopia' card" etc.
parents ebb0f479 7f79d3c1
...@@ -270,6 +270,14 @@ int32 card::is_set_card(uint32 set_code) { ...@@ -270,6 +270,14 @@ int32 card::is_set_card(uint32 set_code) {
return TRUE; return TRUE;
setcode = setcode >> 16; setcode = setcode >> 16;
} }
//add set code
effect_set eset;
filter_effect(EFFECT_ADD_SET_CODE, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
uint32 value = eset[i]->get_value(this);
if ((value & 0xfff) == settype && (value & 0xf000 & setsubtype) == setsubtype)
return TRUE;
}
//another code //another code
uint32 code2 = get_another_code(); uint32 code2 = get_another_code();
uint64 setcode2; uint64 setcode2;
...@@ -280,10 +288,8 @@ int32 card::is_set_card(uint32 set_code) { ...@@ -280,10 +288,8 @@ int32 card::is_set_card(uint32 set_code) {
} else { } else {
return FALSE; return FALSE;
} }
uint32 settype2 = setcode2 & 0xfff;
uint32 setsubtype2 = setcode2 & 0xf000;
while(setcode2) { while(setcode2) {
if ((setcode2 & 0xfff) == settype2 && (setcode2 & 0xf000 & setsubtype2) == setsubtype2) if ((setcode2 & 0xfff) == settype && (setcode2 & 0xf000 & setsubtype) == setsubtype)
return TRUE; return TRUE;
setcode2 = setcode2 >> 16; setcode2 = setcode2 >> 16;
} }
......
...@@ -377,7 +377,7 @@ public: ...@@ -377,7 +377,7 @@ public:
#define EFFECT_LEFT_SPSUMMON_COUNT 331 #define EFFECT_LEFT_SPSUMMON_COUNT 331
#define EFFECT_CANNOT_SELECT_BATTLE_TARGET 332 #define EFFECT_CANNOT_SELECT_BATTLE_TARGET 332
#define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333 #define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333
#define EFFECT_ADD_SET_CODE 340
#define EVENT_STARTUP 1000 #define EVENT_STARTUP 1000
#define EVENT_FLIP 1001 #define EVENT_FLIP 1001
#define EVENT_FREE_CHAIN 1002 #define EVENT_FREE_CHAIN 1002
......
...@@ -25,6 +25,13 @@ function c21521304.initial_effect(c) ...@@ -25,6 +25,13 @@ function c21521304.initial_effect(c)
e2:SetTarget(c21521304.sptg) e2:SetTarget(c21521304.sptg)
e2:SetOperation(c21521304.spop) e2:SetOperation(c21521304.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--treat as utopia
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_SET_CODE)
e3:SetValue(0x7f)
c:RegisterEffect(e3)
end end
c21521304.xyz_number=39 c21521304.xyz_number=39
function c21521304.atkcon(e,tp,eg,ep,ev,re,r,rp) function c21521304.atkcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -31,6 +31,13 @@ function c23204029.initial_effect(c) ...@@ -31,6 +31,13 @@ function c23204029.initial_effect(c)
e3:SetTarget(c23204029.target) e3:SetTarget(c23204029.target)
e3:SetOperation(c23204029.operation) e3:SetOperation(c23204029.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--treat as EHERO
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_ADD_SET_CODE)
e4:SetValue(0x3008)
c:RegisterEffect(e4)
end end
function c23204029.splimit(e,se,sp,st) function c23204029.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
...@@ -11,6 +11,13 @@ function c34566435.initial_effect(c) ...@@ -11,6 +11,13 @@ function c34566435.initial_effect(c)
e1:SetTarget(c34566435.target) e1:SetTarget(c34566435.target)
e1:SetOperation(c34566435.operation) e1:SetOperation(c34566435.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--treat as fightfur
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_ADD_SET_CODE)
e2:SetValue(0xad)
c:RegisterEffect(e2)
end end
function c34566435.filter(c) function c34566435.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_FUSION) and c:IsSetCard(0xad) return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_FUSION) and c:IsSetCard(0xad)
......
...@@ -18,6 +18,13 @@ function c36953371.initial_effect(c) ...@@ -18,6 +18,13 @@ function c36953371.initial_effect(c)
e2:SetTarget(c36953371.destg) e2:SetTarget(c36953371.destg)
e2:SetOperation(c36953371.desop) e2:SetOperation(c36953371.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--treat as choujuubusha
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_SET_CODE)
e3:SetValue(0x9a)
c:RegisterEffect(e3)
end end
function c36953371.descon(e,tp,eg,ep,ev,re,r,rp) function c36953371.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
......
...@@ -21,6 +21,13 @@ function c494922.initial_effect(c) ...@@ -21,6 +21,13 @@ function c494922.initial_effect(c)
e2:SetTarget(c494922.settg) e2:SetTarget(c494922.settg)
e2:SetOperation(c494922.setop) e2:SetOperation(c494922.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--treat as choujuubusha
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_SET_CODE)
e3:SetValue(0x9a)
c:RegisterEffect(e3)
end end
function c494922.filter(c) function c494922.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
......
...@@ -474,6 +474,8 @@ EFFECT_LEFT_SPSUMMON_COUNT =331 --剩餘召喚次數(召喚限制網) ...@@ -474,6 +474,8 @@ EFFECT_LEFT_SPSUMMON_COUNT =331 --剩餘召喚次數(召喚限制網)
EFFECT_CANNOT_SELECT_BATTLE_TARGET =332 --對手不能選擇為攻擊對象 EFFECT_CANNOT_SELECT_BATTLE_TARGET =332 --對手不能選擇為攻擊對象
EFFECT_CANNOT_SELECT_EFFECT_TARGET =333 --對手不能選擇為效果對象 EFFECT_CANNOT_SELECT_EFFECT_TARGET =333 --對手不能選擇為效果對象
EFFECT_ADD_SET_CODE =340 --追加SetCode(规则上视具「XX」字段等用)
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发) --下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --游戏开始时 EVENT_STARTUP =1000 --游戏开始时
EVENT_FLIP =1001 --翻转时 EVENT_FLIP =1001 --翻转时
......
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