Commit 07d68cc7 authored by sidschingis's avatar sidschingis

Merge remote-tracking branch 'upstream/master'

parents dca9be63 fd628446
......@@ -54,7 +54,7 @@ bool DataManager::LoadDB(const char* file) {
if(len) {
cs.desc[i - 14] = new wchar_t[len + 1];
memcpy(cs.desc[i - 14], strBuffer, (len + 1)*sizeof(wchar_t));
} else break;
} else cs.desc[i - 14] = 0;
}
_strings.insert(std::make_pair(cd.code, cs));
}
......
#[2013.9][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
#[2013.9][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2013.9
#forbidden
20663556 0 --イレカエル
......@@ -153,6 +153,169 @@
53582587 2 --激流葬
29401950 2 --奈落の落とし穴
!2014.1.1 TCG
#forbidden
20663556 0 --イレカエル
53797637 0 --炎征竜-バーナー
40044918 0 --E·HERO エアーマン
44910027 0 --ヴィクトリー・ドラゴン
82301904 0 --混沌帝龍 -終焉の使者-
08131171 0 --キラー・スネーク
26202165 0 --クリッター
78010363 0 --黒き森のウィッチ
67441435 0 --グローアップ·バルブ
07391448 0 --ゴヨウ·ガーディアン
40737112 0 --混沌の黒魔術師
34124316 0 --サイバーポッド
63519819 0 --サウザンド·アイズ·サクリファイス
81122844 0 --発条空母ゼンマイティ
21593977 0 --処刑人-マキュラ
27415516 0 --水征竜-ストリーム
32646477 0 --ダーク·ダイブ·ボンバー
91020571 0 --地征竜-リアクタン
56570271 0 --DHERO ディスクガイ
69015963 0 --デビル·フランケン
33184167 0 --同族感染ウィルス
54719828 0 --No.16 色の支配者ショック·ルーラー
52687916 0 --氷結界の龍 トリシューラ
50321796 0 --氷結界の龍 ブリューナク
78706415 0 --ファイバーポッド
93369354 0 --フィッシュボーグ-ガンナー
89185742 0 --風征竜-ライトニング
34206604 0 --魔導サイエンティスト
96782886 0 --メンタルマスター
03078576 0 --八汰烏
14878871 0 --レスキューキャット
41482598 0 --悪夢の蜃気楼
44763025 0 --いたずら好きな双子悪魔
19613556 0 --大嵐
29762407 0 --王家の神殿
17375316 0 --押収
74191942 0 --苦渋の選択
42829885 0 --強引な番兵
45986603 0 --強奪
55144522 0 --強欲な壺
04031928 0 --心変わり
12580477 0 --サンダー·ボルト
23557835 0 --次元融合
83764718 0 --死者蘇生
57953380 0 --生還の宝札
87910978 0 --洗脳-ブレインコントロール
60682203 0 --大寒波
67169062 0 --貪欲な壺
27770341 0 --超再生能力
69243953 0 --蝶の短剣-エルマ
72892473 0 --手札抹殺
79571449 0 --天使の施し
42703248 0 --ハリケーン
18144506 0 --ハーピィの羽根帚
70828912 0 --早すぎた埋葬
34906152 0 --マスドライバー
46448938 0 --魔導書の神判
77565204 0 --未来融合-フューチャー·フュージョン
27970830 0 --六武の門
46411259 0 --突然変異
85602018 0 --遺言状
62265044 0 --竜の渓谷
27174286 0 --異次元からの帰還
61740673 0 --王宮の勅命
93016201 0 --王宮の弾圧
41420027 0 --神の宣告
17484499 0 --現世と冥界の逆転
57728570 0 --死のデッキ破壊ウイルス
57585212 0 --自爆スイッチ
03280747 0 --第六感
64697231 0 --ダスト·シュート
35316708 0 --刻の封印
80604091 0 --血の代償
83555666 0 --破壊輪
28566710 0 --ラストバトル!
#limit
64034255 1 --A·ジェネクス·バードマン
45222299 1 --イビリチュア·ガストクラーケ
11877465 1 --イビリチュア·マインドオーガス
68184115 1 --甲虫装機 ダンセル
69207766 1 --甲虫装機 ホーネット
01662004 1 --炎星師-チョウテン
53804307 1 --焔征竜-ブラスター
37742478 1 --オネスト
74311226 1 --海皇の竜騎隊
72989439 1 --カオス·ソルジャー -開闢の使者-
90411554 1 --巌征竜-レドックス
41470137 1 --剣闘獣ベストロウリィ
78868119 1 --深海のディーヴァ
29981921 1 --真六武衆-シエン
31560081 1 --聖なる魔術師
59297550 1 --ゼンマイマジシャン
65192027 1 --ダーク·アームド·ドラゴン
15341821 1 --ダンディライオン
90953320 1 --TG ハイパー·ライブラリアン
14943837 1 --デブリ·ドラゴン
16226786 1 --深淵の暗殺者
80344569 1 --N·グラン·モール
28297833 1 --ネクロフェイス
26400609 1 --瀑征竜-タイダル
70583986 1 --氷結界の虎王ドゥローレン
33396948 1 --封印されしエクゾディア
07902349 1 --封印されし者の左腕
70903634 1 --封印されし者の右腕
44519536 1 --封印されし者の左足
08124921 1 --封印されし者の右足
50091196 1 --フォーミュラ·シンクロン
02009101 1 --BF-疾風のゲイル
44330098 1 --冥府の使者ゴーズ
33508719 1 --メタモルポット
71564252 1 --ライオウ
89399912 1 --嵐征竜-テンペスト
85138716 1 --レスキューラビット
88264978 1 --レッドアイズ·ダークネスメタルドラゴン
48976825 1 --異次元からの埋葬
33782437 1 --一時休戦
66957584 1 --インフェルニティガン
23701465 1 --原初の種
72405967 1 --王家の生け贄
81439173 1 --おろかな埋葬
97997309 1 --ゲーテの魔導書
45725480 1 --七星の宝刀
95308449 1 --終焉のカウントダウン
37520316 1 --精神操作
32807846 1 --増援
14087893 1 --月の書
81674782 1 --次元の裂け目
94886282 1 --光の援軍
75500286 1 --封印の黄金櫃
53129443 1 --ブラック·ホール
15854426 1 --霞の谷の神風
43040603 1 --モンスターゲート
01475311 1 --闇の誘惑
23171610 1 --リミッター解除
02295440 1 --ワン·フォー·ワン
84749824 1 --神の警告
94192409 1 --強制脱出装置
53582587 1 --激流葬
73599290 1 --ソウルドレイン
36468556 1 --停戦協定
46652477 1 --転生の予言
29401950 1 --奈落の落とし穴
17078030 1 --光の護封壁
30241314 1 --マクロコスモス
32723153 1 --マジカル·エクスプロージョン
54974237 1 --闇のデッキ破壊ウイルス
#semi limit
85087012 2 --カードガンナー
09596126 2 --カオス·ソーサラー
00423585 2 --召喚僧サモンプリースト
98777036 2 --トラゴエディア
10028593 2 --輪廻天狗
48686504 2 --ローンファイア·ブロッサム
46052429 2 --高等儀式術
98494543 2 --魔法石の採掘
58577036 2 --名推理
91623717 2 --連鎖爆撃
29843091 2 --おジャマトリオ
70342110 2 --次元幽閉
44095762 2 --聖なるバリア-ミラーフォース-
!2013.10.11 TCG
#forbidden
20663556 0 --イレカエル
......
......@@ -326,6 +326,16 @@ int32 card::get_attack(uint8 swap) {
for (int32 i = 0; i < eset.count; ++i) {
switch (eset[i]->code) {
case EFFECT_UPDATE_ATTACK:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for (int32 j = 0; j < effects.count; ++j) {
if (effects[j]->flag & EFFECT_FLAG_REPEAT) {
base = effects[j]->get_value(this);
up = 0;
upc = 0;
temp.attack = base;
}
}
}
if (eset[i]->type & EFFECT_TYPE_SINGLE)
up += eset[i]->get_value(this);
else
......@@ -337,7 +347,7 @@ int32 card::get_attack(uint8 swap) {
up = 0;
break;
case EFFECT_SET_ATTACK_FINAL:
if (eset[i]->type & EFFECT_TYPE_SINGLE) {
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
base = eset[i]->get_value(this);
up = 0;
upc = 0;
......@@ -349,20 +359,10 @@ int32 card::get_attack(uint8 swap) {
temp.attack = base + up + upc;
else
temp.attack = base - up - upc;
for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->flag & EFFECT_FLAG_REPEAT) {
base = effects[i]->get_value(this);
up = 0;
upc = 0;
temp.attack = base;
}
}
}
for (int32 i = 0; i < effects.count; ++i) {
if (!(effects[i]->flag & EFFECT_FLAG_REPEAT)) {
final = effects[i]->get_value(this);
temp.attack = final;
}
final = effects[i]->get_value(this);
temp.attack = final;
}
if (final == -1) {
if (!rev)
......@@ -424,6 +424,16 @@ int32 card::get_defence(uint8 swap) {
for (int32 i = 0; i < eset.count; ++i) {
switch (eset[i]->code) {
case EFFECT_UPDATE_DEFENCE:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for (int32 j = 0; j < effects.count; ++j) {
if (effects[j]->flag & EFFECT_FLAG_REPEAT) {
base = effects[j]->get_value(this);
up = 0;
upc = 0;
temp.defence = base;
}
}
}
if (eset[i]->type & EFFECT_TYPE_SINGLE)
up += eset[i]->get_value(this);
else
......@@ -435,7 +445,7 @@ int32 card::get_defence(uint8 swap) {
up = 0;
break;
case EFFECT_SET_DEFENCE_FINAL:
if (eset[i]->type & EFFECT_TYPE_SINGLE) {
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
base = eset[i]->get_value(this);
up = 0;
upc = 0;
......@@ -447,20 +457,10 @@ int32 card::get_defence(uint8 swap) {
temp.defence = base + up + upc;
else
temp.defence = base - up - upc;
for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->flag & EFFECT_FLAG_REPEAT) {
base = effects[i]->get_value(this);
up = 0;
upc = 0;
temp.defence = base;
}
}
}
for (int32 i = 0; i < effects.count; ++i) {
if (!(effects[i]->flag & EFFECT_FLAG_REPEAT)) {
final = effects[i]->get_value(this);
temp.defence = final;
}
final = effects[i]->get_value(this);
temp.defence = final;
}
if (final == -1) {
if (!rev)
......@@ -2156,8 +2156,8 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
}
return TRUE;
}
int32 card::is_can_be_fusion_material() {
if(!(get_type()&TYPE_MONSTER))
int32 card::is_can_be_fusion_material(uint8 ignore_mon) {
if(!ignore_mon && !(get_type() & TYPE_MONSTER))
return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
......
......@@ -235,7 +235,7 @@ public:
int32 is_control_can_be_changed();
int32 is_capable_be_battle_target(card* pcard);
int32 is_capable_be_effect_target(effect* peffect, uint8 playerid);
int32 is_can_be_fusion_material();
int32 is_can_be_fusion_material(uint8 ignore_mon = FALSE);
int32 is_can_be_synchro_material(card* scard, card* tuner = 0);
int32 is_can_be_xyz_material(card* scard);
};
......
......@@ -1698,7 +1698,10 @@ int32 scriptlib::card_is_can_be_fusion_material(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushboolean(L, pcard->is_can_be_fusion_material());
uint32 ign = FALSE;
if(lua_gettop(L) >= 2)
ign = lua_toboolean(L, 2);
lua_pushboolean(L, pcard->is_can_be_fusion_material(ign));
return 1;
}
int32 scriptlib::card_is_can_be_synchro_material(lua_State *L) {
......
--݆h칷
--輪廻天狗
function c10028593.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
......
......@@ -40,6 +40,7 @@ function c10275411.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g1=Duel.GetOverlayGroup(tp,0,1)
if g1:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10275411,0))
local mg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,mg)
......
......@@ -21,7 +21,7 @@ function c11047543.filter2(c,e,tp,lv)
and Duel.IsExistingMatchingCard(c11047543.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv+clv)
end
function c11047543.spfilter(c,e,tp,lv)
return c:IsRace(RACE_PSYCHO) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_SYNCHRO) and c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11047543.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......
--サイバー・ネットワーク
function c12670770.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c12670770.target1)
e1:SetOperation(c12670770.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(c12670770.condition)
e2:SetTarget(c12670770.target2)
e2:SetOperation(c12670770.operation)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c12670770.spcon)
e3:SetCost(c12670770.spcost)
e3:SetTarget(c12670770.sptg)
e3:SetOperation(c12670770.spop)
c:RegisterEffect(e3)
if not c12670770.global_check then
c12670770.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_BATTLE)
ge1:SetOperation(c12670770.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c12670770.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(Duel.GetTurnPlayer(),12670770,RESET_PHASE+PHASE_END,0,1)
end
function c12670770.filter1(c)
return c:IsFaceup() and c:IsCode(70095154)
end
function c12670770.filter2(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemove()
end
function c12670770.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c12670770.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c12670770.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetOperation(c12670770.sdesop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
c:RegisterEffect(e1)
c:SetTurnCounter(0)
if Duel.IsExistingMatchingCard(c12670770.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(c12670770.filter2,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(12670770,0)) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
c:RegisterFlagEffect(12670770,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c12670770.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():GetFlagEffect(12670770)==0
and Duel.IsExistingMatchingCard(c12670770.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(12670770,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c12670770.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(12670770)==0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c12670770.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c12670770.sdesop(e,tp,eg,ep,ev,re,r,rp)
if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
end
end
function c12670770.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c12670770.spfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12670770.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()~=tp or Duel.GetFlagEffect(tp,12670770)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12670770.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c12670770.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c12670770.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12670770.spfilter,tp,LOCATION_REMOVED,0,ft,ft,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
local dg=Duel.GetMatchingGroup(c12670770.desfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
......@@ -14,7 +14,7 @@ function c13166204.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x54)
end
function c13166204.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c13166204.filter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c13166204.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -30,9 +30,7 @@ function c13455953.sumop(e,tp,eg,ep,ev,re,r,rp)
end
function c13455953.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
return c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c13455953.filter(c)
return c:IsSetCard(0x5042) and c:IsAbleToHand()
......
......@@ -29,16 +29,16 @@ function c16304628.atkcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c16304628.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()~=tp and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,g:GetCount(),0,0)
end
function c16304628.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -46,10 +46,11 @@ function c16304628.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(atk/2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(atk/2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
......
......@@ -32,7 +32,7 @@ end
function c1639384.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if not tc:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
......
......@@ -12,7 +12,7 @@ function c23323812.initial_effect(c)
c:RegisterEffect(e1)
end
function c23323812.filter(c,tp)
return c:GetPreviousControler()==tp and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
return c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
and c==Duel.GetAttackTarget() and c:IsRace(RACE_PSYCHO)
end
function c23323812.condition(e,tp,eg,ep,ev,re,r,rp)
......
--サイバー・ドラゴン・コア
function c23893227.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23893227,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c23893227.cost)
e1:SetTarget(c23893227.target)
e1:SetOperation(c23893227.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23893227,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c23893227.spcon)
e2:SetCost(c23893227.spcost)
e2:SetTarget(c23893227.sptg)
e2:SetOperation(c23893227.spop)
c:RegisterEffect(e2)
--code
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetValue(70095154)
c:RegisterEffect(e3)
end
function c23893227.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23893227)==0 end
Duel.RegisterFlagEffect(tp,23893227,RESET_PHASE+PHASE_END,0,1)
end
function c23893227.filter(c)
return (c:IsSetCard(0x93) or c:IsSetCard(0x94)) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c23893227.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23893227.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c23893227.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c23893227.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c23893227.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c23893227.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23893227)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,23893227,RESET_PHASE+PHASE_END,0,1)
end
function c23893227.spfilter(c,e,tp)
return c:IsSetCard(0x1093) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23893227.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c23893227.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c23893227.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c23893227.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -14,11 +14,7 @@ function c24419823.initial_effect(c)
end
function c24419823.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsLocation(LOCATION_DECK) then return false end
if Duel.GetCurrentPhase()==PHASE_DAMAGE and c:GetPreviousLocation()==LOCATION_MZONE then
return bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
end
return bit.band(c:GetPreviousPosition(),POS_FACEUP)~=0
return not c:IsLocation(LOCATION_DECK) and c:IsPreviousPosition(POS_FACEUP)
end
function c24419823.filter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand()
......
--除雪機関車ハッスル・ラッセル
function c24731453.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24731453,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c24731453.spcon)
e1:SetTarget(c24731453.sptg)
e1:SetOperation(c24731453.spop)
c:RegisterEffect(e1)
--cannot special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c24731453.splimit)
c:RegisterEffect(e2)
end
function c24731453.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
function c24731453.cfilter(c)
return c:GetSequence()~=5
end
function c24731453.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.IsExistingMatchingCard(c24731453.cfilter,tp,LOCATION_SZONE,0,1,nil)
end
function c24731453.filter(c)
return c:GetSequence()~=5 and c:IsDestructable()
end
function c24731453.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local g=Duel.GetMatchingGroup(c24731453.filter,tp,LOCATION_SZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c24731453.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c24731453.filter,tp,LOCATION_SZONE,0,nil)
local ct=Duel.Destroy(g,REASON_EFFECT)
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
end
--無頼特急バトレイン
function c24919805.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24919805,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c24919805.damcost)
e1:SetTarget(c24919805.damtg)
e1:SetOperation(c24919805.damop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c24919805.regop)
c:RegisterEffect(e2)
end
function c24919805.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c24919805.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c24919805.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c24919805.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24919805,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c24919805.thcost)
e1:SetTarget(c24919805.thtg)
e1:SetOperation(c24919805.thop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c24919805.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,24919805)==0 end
Duel.RegisterFlagEffect(tp,24919805,RESET_PHASE+PHASE_END,0,1)
end
function c24919805.filter(c)
return c:GetLevel()==10 and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function c24919805.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24919805.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c24919805.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c24919805.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -21,7 +21,7 @@ function c25435080.cfilter(c,tp)
return c:IsSetCard(0x33) and Duel.IsExistingTarget(c25435080.tfilter,tp,LOCATION_MZONE,0,1,c)
end
function c25435080.tfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33) and c:IsType(TYPE_SYNCHRO)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c25435080.cost(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1)
......
......@@ -16,7 +16,7 @@ function c26842483.initial_effect(c)
end
function c26842483.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return ep~=tp and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
return ep~=tp and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and bit.band(re:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)~=0
end
function c26842483.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -38,7 +38,7 @@ function c27346636.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c27346636.spfilter1(c,tp)
return c:IsCode(78868776) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial()
return c:IsCode(78868776) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial(true)
and Duel.IsExistingMatchingCard(c27346636.spfilter2,tp,LOCATION_MZONE,0,2,c)
end
function c27346636.spfilter2(c)
......
......@@ -19,6 +19,7 @@ function c2830693.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e2:SetCondition(c2830693.spcon)
e2:SetCost(c2830693.spcost)
e2:SetTarget(c2830693.sptg)
......@@ -27,7 +28,7 @@ function c2830693.initial_effect(c)
end
function c2830693.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2830693)==0 end
Duel.RegisterFlagEffect(tp,2830693,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.RegisterFlagEffect(tp,2830693,RESET_PHASE+PHASE_END,0,1)
end
function c2830693.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttacker()
......@@ -53,7 +54,6 @@ function c2830693.eqop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
......@@ -66,7 +66,7 @@ function c2830693.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c2830693.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2830694)==0 end
Duel.RegisterFlagEffect(tp,2830694,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.RegisterFlagEffect(tp,2830694,RESET_PHASE+PHASE_END,0,1)
end
function c2830693.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -11,9 +11,10 @@ function c30459350.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
--
--30459350 chk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(30459350)
......
......@@ -69,11 +69,8 @@ function c30604579.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c30604579.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ctl=c:GetPreviousControler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if ctl==tp and rp~=tp and c:IsReason(REASON_DESTROY)
and bit.band(c:GetPreviousLocation(),LOCATION_ONFIELD)~=0 and bit.band(pos,POS_FACEUP)~=0 then
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
c:RegisterFlagEffect(30604579,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -68,8 +68,8 @@ function c31480215.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_WIND)
end
function c31480215.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x101b) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x101b)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x101b) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,e:GetHandler(),0x101b)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,31480215,RESET_PHASE+PHASE_END,0,1)
end
......
......@@ -39,6 +39,7 @@ end
function c31516413.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
Duel.Release(g,REASON_COST)
c:RegisterFlagEffect(0,RESET_EVENT+0x4fc0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(31516413,2))
end
function c31516413.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,e:GetHandler(),0x69) end
......
......@@ -39,6 +39,7 @@ end
function c3300267.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsSetCard,1,1,nil,0x69)
Duel.Release(g,REASON_COST)
c:RegisterFlagEffect(0,RESET_EVENT+0x4fc0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(3300267,2))
end
function c3300267.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,e:GetHandler(),0x69) end
......
......@@ -43,8 +43,8 @@ function c3370104.disop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c3370104.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and bit.band(e:GetHandler():GetBattlePosition(),POS_FACEUP)~=0
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP)
end
function c3370104.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
......@@ -13,15 +13,9 @@ function c3536537.initial_effect(c)
c:RegisterEffect(e1)
end
function c3536537.descon(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_DESTROY)==0 then return false end
if bit.band(r,REASON_BATTLE)~=0 then
return bit.band(e:GetHandler():GetBattlePosition(),POS_FACEUP)~=0
and e:GetHandler():GetPreviousControler()==tp and rp~=tp
else
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():IsPreviousPosition(POS_FACEUP)
and e:GetHandler():GetPreviousControler()==tp and rp~=tp
end
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c3536537.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:IsDestructable()
......
......@@ -21,12 +21,13 @@ function c37675138.initial_effect(c)
end
function c37675138.descon(e,tp,eg,ep,ev,re,r,rp)
return re:GetOwner():IsRace(RACE_ZOMBIE) and e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
and e:GetHandler():GetPreviousControler()==tp
end
function c37675138.desfilter(c)
return c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c37675138.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c37675138.desfilter(chkc) end
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c37675138.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c37675138.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c37675138.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
......
......@@ -14,12 +14,8 @@ function c40343749.initial_effect(c)
end
function c40343749.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_BATTLE) then
return c:GetReasonPlayer()~=tp and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
else
return rp~=tp and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
return rp~=tp and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function c40343749.filter(c,e,tp)
return c:IsSetCard(0x80) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -25,7 +25,6 @@ end
function c43642620.dmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and (not c:IsReason(REASON_BATTLE) or bit.band(c:GetBattlePosition(),POS_FACEUP)~=0)
end
function c43642620.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -27,8 +27,8 @@ function c44364207.indesval(e,re)
return re:GetHandler():IsType(TYPE_TRAP)
end
function c44364207.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and bit.band(e:GetHandler():GetBattlePosition(),POS_FACEUP)~=0
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP)
end
function c44364207.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==4 and c:IsAbleToHand()
......
......@@ -14,10 +14,7 @@ function c46572756.initial_effect(c)
end
function c46572756.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if Duel.GetCurrentPhase()==PHASE_DAMAGE and c==Duel.GetAttackTarget() then pos=c:GetBattlePosition() end
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
and bit.band(pos,POS_FACEUP)~=0
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
end
function c46572756.filter(c)
return c:IsSetCard(0x2) and c:IsAbleToDeck()
......
......@@ -46,7 +46,7 @@ function c48156348.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c48156348.spfilter1(c,tp)
return c:IsCode(41470137) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial()
return c:IsCode(41470137) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial(true)
and Duel.IsExistingMatchingCard(c48156348.spfilter2,tp,LOCATION_MZONE,0,1,c)
end
function c48156348.spfilter2(c)
......
......@@ -25,7 +25,8 @@ end
function c50074392.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c50074392.cfilter,tp,LOCATION_MZONE,0,1,nil,RACE_FISH)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50074392.cfilter,tp,LOCATION_MZONE,0,1,nil,RACE_FISH)
and Duel.IsExistingMatchingCard(c50074392.cfilter,tp,LOCATION_MZONE,0,1,nil,RACE_WINDBEAST)
end
function c50074392.lvcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -10,8 +10,10 @@ function c50260683.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c50260683.condition)
e1:SetCost(c50260683.cost)
e1:SetTarget(c50260683.target)
e1:SetOperation(c50260683.operation)
......@@ -28,6 +30,9 @@ function c50260683.initial_effect(c)
e2:SetOperation(c50260683.desop)
c:RegisterEffect(e2)
end
function c50260683.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c50260683.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
......
--深夜急行騎士ナイト・エクスプレス・ナイト
function c51126152.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_DECK)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--summon with no tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51126152,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(c51126152.ntcon)
e2:SetOperation(c51126152.ntop)
c:RegisterEffect(e2)
end
function c51126152.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c51126152.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--change base attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(0)
c:RegisterEffect(e1)
end
......@@ -27,10 +27,8 @@ function c51402908.initial_effect(c)
end
function c51402908.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if Duel.GetCurrentPhase()==PHASE_DAMAGE then pos=c:GetBattlePosition() end
if c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
and bit.band(pos,POS_FACEUP)~=0 then
and c:IsPreviousPosition(POS_FACEUP) then
c:RegisterFlagEffect(51402908,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,2)
end
end
......
......@@ -19,7 +19,7 @@ function c51435705.shcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c51435705.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c51435705.shcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and c:IsAbleToGraveAsCost() end
if chk==0 then return e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end
function c51435705.filter(c)
......
......@@ -35,6 +35,7 @@ function c51858306.filter(c)
and c:IsAbleToRemove()
end
function c51858306.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,30459350) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c51858306.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
......
......@@ -55,8 +55,7 @@ function c53347303.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local loc,tg=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(c) then return false end
if (not Duel.IsChainNegatable(ev)) or loc==LOCATION_DECK then return false end
return true
return Duel.IsChainDisablable(ev) and loc~=LOCATION_DECK
end
function c53347303.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -15,9 +15,7 @@ function c56840658.initial_effect(c)
end
function c56840658.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsPreviousLocation(LOCATION_ONFIELD) then return false end
if bit.band(r,REASON_BATTLE)~=0 then return bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
else return bit.band(c:GetPreviousPosition(),POS_FACEUP)~=0 end
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c56840658.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
--サイバー・ドラゴン・ノヴァ
function c58069384.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),5),2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58069384,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c58069384.cost)
e1:SetTarget(c58069384.target)
e1:SetOperation(c58069384.operation)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58069384,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c58069384.atkcon)
e2:SetCost(c58069384.atkcost)
e2:SetOperation(c58069384.atkop)
c:RegisterEffect(e2)
--spsummon2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58069384,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c58069384.spcon)
e3:SetTarget(c58069384.sptg)
e3:SetOperation(c58069384.spop)
c:RegisterEffect(e3)
end
function c58069384.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c58069384.filter(c,e,tp)
return c:IsCode(70095154) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58069384.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c58069384.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c58069384.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c58069384.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c58069384.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c58069384.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c58069384.atkfilter(c)
return c:IsCode(70095154) and c:IsAbleToRemoveAsCost() and (not c:IsOnField() or c:IsFaceup())
end
function c58069384.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58069384.atkfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c58069384.atkfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c58069384.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2100)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c58069384.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():GetPreviousControler()==tp
end
function c58069384.spfilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58069384.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c58069384.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c58069384.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c58069384.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -29,7 +29,6 @@ end
function c58185394.dmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and (not c:IsReason(REASON_BATTLE) or bit.band(c:GetBattlePosition(),POS_FACEUP)~=0)
end
function c58185394.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -33,7 +33,7 @@ function c5851097.descon(e,tp,eg,ep,ev,re,r,rp)
end
function c5851097.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsStatus(STATUS_CHAINING) end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
end
function c5851097.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -31,6 +31,11 @@ function c59048135.initial_effect(c)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c59048135.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_SUMMON_SUCCESS)
ge2:SetOperation(c59048135.checkop)
Duel.RegisterEffect(ge2,0)
end
end
function c59048135.checkop(e,tp,eg,ep,ev,re,r,rp)
......@@ -67,6 +72,9 @@ function c59048135.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetTargetRange(1,0)
e1:SetTarget(c59048135.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c59048135.splimit(e,c)
return not (c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_XYZ)) and not c:IsSetCard(0x76)
......
--サイバー・ドラゴン・ドライ
function c59281922.initial_effect(c)
--lv
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59281922,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c59281922.lvcost)
e1:SetTarget(c59281922.lvtg)
e1:SetOperation(c59281922.lvop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59281922,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetTarget(c59281922.target)
e2:SetOperation(c59281922.operation)
c:RegisterEffect(e2)
--code
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetValue(70095154)
c:RegisterEffect(e3)
if not c59281922.global_check then
c59281922.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c59281922.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c59281922.checkop(e,tp,eg,ep,ev,re,r,rp)
local p1=nil
local p2=nil
local tc=eg:GetFirst()
while tc do
if not tc:IsRace(RACE_MACHINE) then
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,59281922,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,59281922,RESET_PHASE+PHASE_END,0,1) end
end
function c59281922.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,59281922)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c59281922.splimit)
Duel.RegisterEffect(e1,tp)
end
function c59281922.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_MACHINE)
end
function c59281922.filter(c)
return c:IsFaceup() and c:IsCode(70095154)
end
function c59281922.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c59281922.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c59281922.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c59281922.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(5)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c59281922.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c59281922.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c59281922.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c59281922.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c59281922.operation(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_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
......@@ -14,7 +14,7 @@ end
function c59312550.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
and c:GetBattlePosition()==POS_FACEUP_ATTACK and c:GetPreviousControler()==tp
and c:IsPreviousPosition(POS_FACEUP_ATTACK) and c:GetPreviousControler()==tp
end
function c59312550.filter(c,e,tp)
return c:IsSetCard(0x22) and c:IsAttackBelow(1700) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -26,6 +26,9 @@ function c64605089.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
if Duel.GetAttacker():GetAttack()<e:GetHandler():GetDefence() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetAttacker(),1,0,0)
end
end
function c64605089.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -31,7 +31,7 @@ function c64689404.raccost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c64689404.ractg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return e:GetLabelObject():GetLabel()~=0x7fffff end
if e:GetHandler():GetFlagEffect(64689404)==0 then
e:GetHandler():RegisterFlagEffect(64689404,RESET_EVENT+0x1fe0000,0,0)
e:GetLabelObject():SetLabel(0)
......
......@@ -68,11 +68,8 @@ function c67098114.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c67098114.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ctl=c:GetPreviousControler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if ctl==tp and rp~=tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
c:RegisterFlagEffect(67098114,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -5,8 +5,8 @@ function c73146473.initial_effect(c)
e1:SetDescription(aux.Stringid(73146473,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c73146473.spcost)
e1:SetTarget(c73146473.sptg)
e1:SetOperation(c73146473.spop)
c:RegisterEffect(e1)
......@@ -22,25 +22,28 @@ function c73146473.initial_effect(c)
e2:SetOperation(c73146473.thop)
c:RegisterEffect(e2)
end
function c73146473.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c73146473.filter(c,e,tp)
return c:IsSetCard(0x1f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73146473.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c73146473.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c73146473.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c73146473.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.SendtoGrave(tc,REASON_EFFECT)
if not tc:IsLocation(LOCATION_GRAVE) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c73146473.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -18,12 +18,7 @@ function c76891401.synfilter(c)
return c:GetLevel()==3
end
function c76891401.filter(c)
if not c:IsLevelBelow(3) then return false end
local loc=c:GetPreviousLocation()
if not (bit.band(loc,LOCATION_ONFIELD)>0) then return false end
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
return bit.band(pos,POS_FACEUP)>0
return c:IsLevelBelow(3) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c76891401.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c76891401.filter,1,nil)
......@@ -32,7 +27,7 @@ function c76891401.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(3000)
c:RegisterEffect(e1)
......
......@@ -25,7 +25,7 @@ function c77153811.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetDescription(aux.Stringid(77153811,0))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c77153811.distg)
e1:SetCode(EFFECT_DISABLE)
......
......@@ -26,11 +26,9 @@ end
function c80402389.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local ph=Duel.GetCurrentPhase()
while tc do
local pos=(ph==PHASE_DAMAGE) and tc:GetBattlePosition() or tc:GetPreviousPosition()
if tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsReason(REASON_DESTROY)
and tc:IsRace(RACE_INSECT) and tc:GetLevel()~=0 and bit.band(pos,POS_FACEUP)~=0 then
and tc:IsRace(RACE_INSECT) and tc:GetLevel()~=0 and tc:IsPreviousPosition(POS_FACEUP) then
Duel.RaiseSingleEvent(c,80402389,e,r,rp,tc:GetControler(),tc:GetLevel())
end
tc=eg:GetNext()
......
......@@ -29,5 +29,7 @@ function c81816475.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(81816475,1))
local tc=g2:Select(tp,1,1,nil):GetFirst()
local oc=mg:GetFirst():GetOverlayTarget()
Duel.Overlay(tc,mg)
Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
......@@ -13,8 +13,7 @@ function c83982270.initial_effect(c)
end
function c83982270.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP)
end
function c83982270.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
--サイバー・リペア・プラント
function c86686671.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c86686671.condition)
e1:SetCost(c86686671.cost)
e1:SetTarget(c86686671.target)
e1:SetOperation(c86686671.activate)
c:RegisterEffect(e1)
end
function c86686671.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,70095154)
end
function c86686671.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,86686671)==0 end
Duel.RegisterFlagEffect(tp,86686671,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c86686671.filter1(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function c86686671.filter2(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c86686671.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()~=0 then
return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c86686671.filter2(chkc)
else return false end
end
local b1=Duel.IsExistingMatchingCard(c86686671.filter1,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingTarget(c86686671.filter2,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,3,nil,70095154) then
op=Duel.SelectOption(tp,aux.Stringid(86686671,0),aux.Stringid(86686671,1),aux.Stringid(86686671,2))
else
op=Duel.SelectOption(tp,aux.Stringid(86686671,0),aux.Stringid(86686671,1))
end
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(86686671,0))
else
op=Duel.SelectOption(tp,aux.Stringid(86686671,1))+1
end
e:SetLabel(op)
if op~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c86686671.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
else
e:SetProperty(0)
end
end
function c86686671.activate(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c86686671.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
if op~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
end
......@@ -13,9 +13,8 @@ function c87340664.initial_effect(c)
c:RegisterEffect(e1)
end
function c87340664.condition(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1-e:GetHandler():GetPreviousControler())
return e:GetHandler():IsReason(REASON_BATTLE)
and bit.band(e:GetHandler():GetBattlePosition(),POS_FACEUP)~=0
e:SetLabel(e:GetHandler():GetReasonPlayer())
return e:GetHandler():IsReason(REASON_BATTLE) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c87340664.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
......
......@@ -16,8 +16,7 @@ function c88753985.initial_effect(c)
end
function c88753985.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0 then
if c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88753985,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
......
......@@ -47,7 +47,7 @@ function c90957527.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c90957527.spfilter1(c,tp)
return c:IsCode(79580323) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial()
return c:IsCode(79580323) and c:IsAbleToDeckAsCost() and c:IsCanBeFusionMaterial(true)
and Duel.IsExistingMatchingCard(c90957527.spfilter2,tp,LOCATION_MZONE,0,1,c)
end
function c90957527.spfilter2(c)
......
--No.58 炎圧鬼バーナー・バイサー
function c93108839.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,4),2)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93108839,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c93108839.eqtg)
e1:SetOperation(c93108839.eqop)
c:RegisterEffect(e1)
end
function c93108839.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c93108839.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c93108839.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(93108839)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
e:GetHandler():RegisterFlagEffect(93108839,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c93108839.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
--unequip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93108839,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetTarget(c93108839.sptg)
e1:SetOperation(c93108839.spop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--direct
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(93108839,2))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c93108839.damcon)
e3:SetCost(c93108839.damcost)
e3:SetTarget(c93108839.damtg)
e3:SetOperation(c93108839.damop)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
--eqlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(c93108839.eqlimit)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
end
function c93108839.eqlimit(e,c)
return c:IsType(TYPE_XYZ)
end
function c93108839.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(93108839)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
e:GetHandler():RegisterFlagEffect(93108839,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c93108839.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
end
end
function c93108839.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c93108839.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c93108839.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c93108839.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -62,11 +62,8 @@ function c93483212.imfilter(e,re)
end
function c93483212.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ctl=c:GetPreviousControler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if ctl==tp and rp~=tp and c:IsReason(REASON_DESTROY)
and bit.band(c:GetPreviousLocation(),LOCATION_ONFIELD)~=0 and bit.band(pos,POS_FACEUP)~=0 then
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
c:RegisterFlagEffect(93483212,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
--臨時ダイヤ
function c97520701.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c97520701.cost)
e1:SetTarget(c97520701.target)
e1:SetOperation(c97520701.operation)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97520701,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c97520701.thcon)
e2:SetTarget(c97520701.thtg)
e2:SetOperation(c97520701.thop)
c:RegisterEffect(e2)
end
function c97520701.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,97520701)==0 end
Duel.RegisterFlagEffect(tp,97520701,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c97520701.filter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttackAbove(3000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c97520701.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c97520701.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c97520701.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c97520701.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c97520701.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c97520701.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEDOWN)
end
function c97520701.thfilter(c)
return c:GetLevel()==10 and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c97520701.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c97520701.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97520701.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c97520701.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c97520701.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--カオス·ハンター
--カオスハンター
function c97940434.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
......@@ -20,6 +20,14 @@ function c97940434.initial_effect(c)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
c:RegisterEffect(e2)
--30459350 chk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(30459350)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
end
function c97940434.spfilter(c,sp)
return c:GetSummonPlayer()==sp
......
......@@ -28,7 +28,7 @@ function c98024118.indcon(e)
end
function c98024118.filter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsType(TYPE_TUNER)
and c:GetPreviousControler()==tp and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
end
function c98024118.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c98024118.filter,1,nil,tp)
......
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