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

arcana2

parent 21a611b8
...@@ -88,7 +88,7 @@ int32 effect::is_available() { ...@@ -88,7 +88,7 @@ int32 effect::is_available() {
return FALSE; return FALSE;
if(owner == handler && !(flag & EFFECT_FLAG_CANNOT_DISABLE) && handler->get_status(STATUS_DISABLED)) if(owner == handler && !(flag & EFFECT_FLAG_CANNOT_DISABLE) && handler->get_status(STATUS_DISABLED))
return FALSE; return FALSE;
if(handler->is_status(STATUS_BATTLE_DESTROYED)) if(handler->is_status(STATUS_BATTLE_DESTROYED) && !(flag & EFFECT_FLAG_AVAILABLE_BD))
return FALSE; return FALSE;
if(!(handler->get_status(STATUS_EFFECT_ENABLED))) if(!(handler->get_status(STATUS_EFFECT_ENABLED)))
return FALSE; return FALSE;
......
...@@ -281,6 +281,7 @@ public: ...@@ -281,6 +281,7 @@ public:
#define EFFECT_CANNOT_BP 185 #define EFFECT_CANNOT_BP 185
#define EFFECT_CANNOT_M2 186 #define EFFECT_CANNOT_M2 186
#define EFFECT_CANNOT_EP 187 #define EFFECT_CANNOT_EP 187
#define EFFECT_SKIP_TURN 188
#define EFFECT_DEFENCE_ATTACK 190 #define EFFECT_DEFENCE_ATTACK 190
#define EFFECT_MUST_ATTACK 191 #define EFFECT_MUST_ATTACK 191
#define EFFECT_FIRST_ATTACK 192 #define EFFECT_FIRST_ATTACK 192
...@@ -382,6 +383,7 @@ public: ...@@ -382,6 +383,7 @@ public:
#define EVENT_TOSS_COIN_NEGATE 1152 #define EVENT_TOSS_COIN_NEGATE 1152
#define EVENT_TOSS_DICE_NEGATE 1153 #define EVENT_TOSS_DICE_NEGATE 1153
#define EVENT_LEVEL_UP 1200 #define EVENT_LEVEL_UP 1200
#define EVENT_TURN_END 1210
#define EVENT_PHASE 0x1000 #define EVENT_PHASE 0x1000
#define EVENT_PHASE_START 0x2000 #define EVENT_PHASE_START 0x2000
#define EVENT_ADD_COUNTER 0x10000 #define EVENT_ADD_COUNTER 0x10000
......
...@@ -319,12 +319,58 @@ void field::set_control(card* pcard, uint8 playerid, uint8 reset_phase, uint8 re ...@@ -319,12 +319,58 @@ void field::set_control(card* pcard, uint8 playerid, uint8 reset_phase, uint8 re
} }
card* field::get_field_card(uint8 playerid, uint8 location, uint8 sequence) { card* field::get_field_card(uint8 playerid, uint8 location, uint8 sequence) {
if (location != LOCATION_MZONE && location != LOCATION_SZONE) switch(location) {
return 0; case LOCATION_MZONE: {
if (location == LOCATION_MZONE) if(sequence < 5)
return player[playerid].list_mzone[sequence]; return player[playerid].list_mzone[sequence];
else else
return player[playerid].list_szone[sequence]; return 0;
break;
}
case LOCATION_SZONE: {
if(sequence < 6)
return player[playerid].list_szone[sequence];
else
return 0;
break;
}
case LOCATION_DECK: {
if(sequence < player[playerid].list_main.size())
return player[playerid].list_main[sequence];
else
return 0;
break;
}
case LOCATION_HAND: {
if(sequence < player[playerid].list_hand.size())
return player[playerid].list_hand[sequence];
else
return 0;
break;
}
case LOCATION_GRAVE: {
if(sequence < player[playerid].list_grave.size())
return player[playerid].list_grave[sequence];
else
return 0;
break;
}
case LOCATION_REMOVED: {
if(sequence < player[playerid].list_remove.size())
return player[playerid].list_remove[sequence];
else
return 0;
break;
}
case LOCATION_EXTRA: {
if(sequence < player[playerid].list_extra.size())
return player[playerid].list_extra[sequence];
else
return 0;
break;
}
}
return 0;
} }
int32 field::is_location_useable(uint8 playerid, uint8 location, uint8 sequence) { int32 field::is_location_useable(uint8 playerid, uint8 location, uint8 sequence) {
if (location != LOCATION_MZONE && location != LOCATION_SZONE) if (location != LOCATION_MZONE && location != LOCATION_SZONE)
......
...@@ -104,6 +104,8 @@ static const struct luaL_Reg cardlib[] = { ...@@ -104,6 +104,8 @@ static const struct luaL_Reg cardlib[] = {
{ "RegisterFlagEffect", scriptlib::card_register_flag_effect }, { "RegisterFlagEffect", scriptlib::card_register_flag_effect },
{ "GetFlagEffect", scriptlib::card_get_flag_effect }, { "GetFlagEffect", scriptlib::card_get_flag_effect },
{ "ResetFlagEffect", scriptlib::card_reset_flag_effect }, { "ResetFlagEffect", scriptlib::card_reset_flag_effect },
{ "SetFlagEffectLabel", scriptlib::card_set_flag_effect_label },
{ "GetFlagEffectLabel", scriptlib::card_get_flag_effect_label },
{ "CreateRelation", scriptlib::card_create_relation }, { "CreateRelation", scriptlib::card_create_relation },
{ "ReleaseRelation", scriptlib::card_release_relation }, { "ReleaseRelation", scriptlib::card_release_relation },
{ "CreateEffectRelation", scriptlib::card_create_effect_relation }, { "CreateEffectRelation", scriptlib::card_create_effect_relation },
......
...@@ -751,6 +751,9 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) { ...@@ -751,6 +751,9 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
int32 reset = lua_tointeger(L, 3); int32 reset = lua_tointeger(L, 3);
int32 flag = lua_tointeger(L, 4); int32 flag = lua_tointeger(L, 4);
int32 count = lua_tointeger(L, 5); int32 count = lua_tointeger(L, 5);
int32 lab = 0;
if(lua_gettop(L) >= 6)
lab = lua_tointeger(L, 6);
if(count == 0) if(count == 0)
count = 1; count = 1;
if(reset & (RESET_PHASE) && !(reset & (RESET_SELF_TURN | RESET_OPPO_TURN))) if(reset & (RESET_PHASE) && !(reset & (RESET_SELF_TURN | RESET_OPPO_TURN)))
...@@ -764,6 +767,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) { ...@@ -764,6 +767,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
peffect->reset_flag = reset; peffect->reset_flag = reset;
peffect->flag = flag | EFFECT_FLAG_CANNOT_DISABLE; peffect->flag = flag | EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_count |= count & 0xff; peffect->reset_count |= count & 0xff;
peffect->label = lab;
pcard->add_effect(peffect); pcard->add_effect(peffect);
interpreter::effect2value(L, peffect); interpreter::effect2value(L, peffect);
return 1; return 1;
...@@ -784,6 +788,33 @@ int32 scriptlib::card_reset_flag_effect(lua_State *L) { ...@@ -784,6 +788,33 @@ int32 scriptlib::card_reset_flag_effect(lua_State *L) {
pcard->reset(code, RESET_CODE); pcard->reset(code, RESET_CODE);
return 0; return 0;
} }
int32 scriptlib::card_set_flag_effect_label(lua_State *L) {
check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 code = (lua_tointeger(L, 2) & 0xfffffff) | 0x10000000;
int lab = lua_tointeger(L, 3);
auto eit = pcard->single_effect.find(code);
if(eit == pcard->single_effect.end())
lua_pushboolean(L, FALSE);
else {
eit->second->label = lab;
lua_pushboolean(L, TRUE);
}
return 1;
}
int32 scriptlib::card_get_flag_effect_label(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 code = (lua_tointeger(L, 2) & 0xfffffff) | 0x10000000;
auto eit = pcard->single_effect.find(code);
if(eit == pcard->single_effect.end())
lua_pushnil(L);
else
lua_pushinteger(L, eit->second->label);
return 1;
}
int32 scriptlib::card_create_relation(lua_State *L) { int32 scriptlib::card_create_relation(lua_State *L) {
check_param_count(L, 3); check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -388,7 +388,7 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea ...@@ -388,7 +388,7 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea
filter_player_effect(playerid, EFFECT_CHANGE_DAMAGE, &eset); filter_player_effect(playerid, EFFECT_CHANGE_DAMAGE, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT); pduel->lua->add_param(reason_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(val, PARAM_TYPE_INT); pduel->lua->add_param(amount, PARAM_TYPE_INT);
pduel->lua->add_param(reason, PARAM_TYPE_INT); pduel->lua->add_param(reason, PARAM_TYPE_INT);
pduel->lua->add_param(reason_player, PARAM_TYPE_INT); pduel->lua->add_param(reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(reason_card, PARAM_TYPE_CARD); pduel->lua->add_param(reason_card, PARAM_TYPE_CARD);
......
...@@ -1191,9 +1191,6 @@ int32 field::check_hint_timing(effect* peffect) { ...@@ -1191,9 +1191,6 @@ int32 field::check_hint_timing(effect* peffect) {
int32 field::process_phase_event(int16 step, int32 phase) { int32 field::process_phase_event(int16 step, int32 phase) {
switch(step) { switch(step) {
case 0: { case 0: {
if(infos.phase == PHASE_STANDBY && is_player_affected_by_effect(infos.turn_id, EFFECT_SKIP_SP)) {
core.units.begin()->step = 14;
}
return FALSE; return FALSE;
} }
case 1: { case 1: {
...@@ -1203,6 +1200,7 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1203,6 +1200,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
effect* peffect; effect* peffect;
effect* solve_effect = 0; effect* solve_effect = 0;
nil_event.event_code = phase_event; nil_event.event_code = phase_event;
nil_event.event_player = infos.turn_player;
chain newchain; chain newchain;
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
...@@ -1262,6 +1260,7 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1262,6 +1260,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
pr = effects.trigger_o_effect.equal_range(phase_event); pr = effects.trigger_o_effect.equal_range(phase_event);
effect* peffect; effect* peffect;
nil_event.event_code = phase_event; nil_event.event_code = phase_event;
nil_event.event_player = infos.turn_player;
chain newchain; chain newchain;
core.tpchain.clear(); core.tpchain.clear();
core.ntpchain.clear(); core.ntpchain.clear();
...@@ -1417,6 +1416,7 @@ int32 field::process_phase_event(int16 step, int32 phase) { ...@@ -1417,6 +1416,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
effect_vector::iterator eit; effect_vector::iterator eit;
effect* peffect; effect* peffect;
nil_event.event_code = phase_event; nil_event.event_code = phase_event;
nil_event.event_player = infos.turn_player;
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
uint8 owner_player = peffect->get_handler_player(); uint8 owner_player = peffect->get_handler_player();
...@@ -3331,6 +3331,14 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3331,6 +3331,14 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
infos.turn_player = turn_player; infos.turn_player = turn_player;
pduel->write_buffer8(MSG_NEW_TURN); pduel->write_buffer8(MSG_NEW_TURN);
pduel->write_buffer8(turn_player); pduel->write_buffer8(turn_player);
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_TURN)) {
core.units.begin()->step = 17;
reset_phase(PHASE_DRAW);
reset_phase(PHASE_STANDBY);
reset_phase(PHASE_END);
adjust_all();
return FALSE;
}
infos.phase = PHASE_DRAW; infos.phase = PHASE_DRAW;
core.phase_action = FALSE; core.phase_action = FALSE;
raise_event((card*)0, EVENT_PHASE_START + PHASE_DRAW, 0, 0, 0, turn_player, 0); raise_event((card*)0, EVENT_PHASE_START + PHASE_DRAW, 0, 0, 0, turn_player, 0);
...@@ -3502,6 +3510,15 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3502,6 +3510,15 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
return FALSE; return FALSE;
} }
case 18: { case 18: {
raise_event((card*)0, EVENT_TURN_END, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
}
case 19: {
core.new_fchain.clear();
core.new_ochain.clear();
core.quick_f_chain.clear();
core.units.begin()->step = -1; core.units.begin()->step = -1;
core.units.begin()->arg1 = 1 - core.units.begin()->arg1; core.units.begin()->arg1 = 1 - core.units.begin()->arg1;
return FALSE; return FALSE;
......
...@@ -106,6 +106,8 @@ public: ...@@ -106,6 +106,8 @@ public:
static int32 card_register_flag_effect(lua_State *L); static int32 card_register_flag_effect(lua_State *L);
static int32 card_get_flag_effect(lua_State *L); static int32 card_get_flag_effect(lua_State *L);
static int32 card_reset_flag_effect(lua_State *L); static int32 card_reset_flag_effect(lua_State *L);
static int32 card_set_flag_effect_label(lua_State *L);
static int32 card_get_flag_effect_label(lua_State *L);
static int32 card_create_relation(lua_State *L); static int32 card_create_relation(lua_State *L);
static int32 card_release_relation(lua_State *L); static int32 card_release_relation(lua_State *L);
static int32 card_create_effect_relation(lua_State *L); static int32 card_create_effect_relation(lua_State *L);
......
--アルカナフォースXXI-THE WORLD
function c23846921.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23846921,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c23846921.cointg)
e1:SetOperation(c23846921.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c23846921.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c23846921.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c23846921.arcanareg(c,res)
end
function c23846921.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23846921,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c23846921.skipcon)
e1:SetCost(c23846921.skipcost)
e1:SetOperation(c23846921.skipop)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23846921,2))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_DRAW)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c23846921.thcon)
e2:SetTarget(c23846921.thtg)
e2:SetOperation(c23846921.thop)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c23846921.skipcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==1
end
function c23846921.skipcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c23846921.skipop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
function c23846921.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==0
end
function c23846921.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=Duel.GetFieldCard(1-tp,LOCATION_GRAVE,Duel.GetFieldGroupCount(1-tp,LOCATION_GRAVE,0)-1)
if tc then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
end
function c23846921.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFieldCard(1-tp,LOCATION_GRAVE,Duel.GetFieldGroupCount(1-tp,LOCATION_GRAVE,0)-1)
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(tp,tc)
end
end
...@@ -36,23 +36,27 @@ function c29401950.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,23 +36,27 @@ function c29401950.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c29401950.activate(e,tp,eg,ep,ev,re,r,rp) function c29401950.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if tc and tc:IsRelateToEffect(e) and c29401950.filter(tc,tp,ep) then if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>=1500 then
Duel.Destroy(tc,REASON_EFFECT,LOCATION_REMOVED) Duel.Destroy(tc,REASON_EFFECT,LOCATION_REMOVED)
end end
end end
function c29401950.filter2(c,e,tp) function c29401950.filter2(c,tp)
return c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp return c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp
and (not e or c:IsRelateToEffect(e)) and c:IsDestructable() and c:IsAbleToRemove() and c:IsDestructable() and c:IsAbleToRemove()
end end
function c29401950.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c29401950.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c29401950.filter2,1,nil,nil,tp) end if chk==0 then return eg:IsExists(c29401950.filter2,1,nil,tp) end
local g=eg:Filter(c29401950.filter,nil,nil,tp) local g=eg:Filter(c29401950.filter2,nil,tp)
Duel.SetTargetCard(eg) Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end end
function c29401950.filter3(c,e,tp)
return c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp
and c:IsRelateToEffect(e) and c:IsDestructable()
end
function c29401950.activate2(e,tp,eg,ep,ev,re,r,rp) function c29401950.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c29401950.filter,nil,e,tp) local g=eg:Filter(c29401950.filter3,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED) Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)
end end
......
--アルカナフォースVII-THE CHARIOT
function c34568403.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34568403,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c34568403.cointg)
e1:SetOperation(c34568403.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c34568403.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c34568403.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c34568403.arcanareg(c,res)
if res==0 then
if not Duel.GetControl(c,1-tp) and not c:IsImmuneToEffect(e) and c:IsAbleToChangeControler() then
Duel.Destroy(c,REASON_EFFECT)
end
end
end
function c34568403.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34568403,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c34568403.spcon)
e1:SetTarget(c34568403.sptg)
e1:SetOperation(c34568403.spop)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c34568403.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(36690018)==1 and e:GetHandler():IsRelateToBattle()
end
function c34568403.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and not tc:IsLocation(LOCATION_SZONE) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end
function c34568403.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--アルカナフォースIII-THE EMPRESS
function c35781051.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35781051,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c35781051.cointg)
e1:SetOperation(c35781051.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c35781051.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c35781051.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c35781051.arcanareg(c,res)
end
function c35781051.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35781051,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c35781051.spcon)
e1:SetTarget(c35781051.sptg)
e1:SetOperation(c35781051.spop)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35781051,2))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c35781051.tgcon)
e2:SetTarget(c35781051.tgtg)
e2:SetOperation(c35781051.tgop)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c35781051.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==1
end
function c35781051.spfilter(c,e,tp)
return c:IsSetCard(0x5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c35781051.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)
and Duel.IsExistingMatchingCard(c35781051.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c35781051.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,c35781051.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c35781051.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==0
end
function c35781051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function c35781051.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
...@@ -21,6 +21,7 @@ end ...@@ -21,6 +21,7 @@ end
function c36690018.activate(e,tp,eg,ep,ev,re,r,rp) function c36690018.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and c36690018.filter(tc) then if tc:IsRelateToEffect(e) and tc:IsFaceup() and c36690018.filter(tc) then
tc:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1) local val=tc:GetFlagEffectLabel(36690018)
tc:SetFlagEffectLabel(36690018,1-val)
end end
end end
--アルカナフォースEX-THE LIGHT RULER
function c5861892.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c5861892.spcon)
e1:SetOperation(c5861892.spop)
c:RegisterEffect(e1)
--cannot special summon
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--coin
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(5861892,0))
e3:SetCategory(CATEGORY_COIN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c5861892.cointg)
e3:SetOperation(c5861892.coinop)
c:RegisterEffect(e3)
end
function c5861892.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,nil)
end
function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,c:GetControler(),LOCATION_MZONE,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c5861892.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c5861892.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c5861892.arcanareg(c,res)
end
function c5861892.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34568403,1))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c5861892.thcon)
e1:SetTarget(c5861892.thtg)
e1:SetOperation(c5861892.thop)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c5861892.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffectLabel(36690018)==1 and c:IsRelateToBattle()
and c:GetBattleTarget():IsLocation(LOCATION_GRAVE)
end
function c5861892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c5861892.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
--アルカナフォースXIV-TEMPERANCE
function c60953118.initial_effect(c)
--no damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60953118,1))
e1:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c60953118.damcon)
e1:SetCost(c60953118.damcost)
e1:SetOperation(c60953118.damop)
c:RegisterEffect(e1)
--coin
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60953118,0))
e2:SetCategory(CATEGORY_COIN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c60953118.cointg)
e2:SetOperation(c60953118.coinop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c60953118.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c60953118.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c60953118.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
function c60953118.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c60953118.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c60953118.arcanareg(c,res)
end
function c60953118.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_AVAILABLE_BD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetCondition(c60953118.rdcon1)
e1:SetValue(c60953118.rdval)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetTargetRange(0,1)
e2:SetCondition(c60953118.rdcon2)
c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c60953118.rdcon1(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==1
end
function c60953118.rdcon2(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==0
end
function c60953118.rdval(e,re,val,r,rp,rc)
if bit.band(r,REASON_BATTLE) then
return val/2
else
return val
end
end
--アルカナフォースIV-THE EMPEROR
function c61175706.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61175706,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c61175706.cointg)
e1:SetOperation(c61175706.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c61175706.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c61175706.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c61175706.arcanareg(c,res)
end
function c61175706.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c61175706.atktg)
e1:SetValue(c61175706.atkval)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
--
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c61175706.atktg(e,c)
return c:IsSetCard(0x5)
end
function c61175706.atkval(e,c)
if e:GetHandler():GetFlagEffectLabel(36690018)==1 then
return 500
else return -500 end
end
...@@ -71,24 +71,21 @@ function c62892347.arcanareg(c,coin) ...@@ -71,24 +71,21 @@ function c62892347.arcanareg(c,coin)
e3:SetTarget(c62892347.distg) e3:SetTarget(c62892347.distg)
e3:SetReset(RESET_EVENT+0x1ff0000) e3:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e3) c:RegisterEffect(e3)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1) c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
if coin==0 then
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1)
end
end end
function c62892347.distg(e,c) function c62892347.distg(e,c)
local ec=e:GetHandler() local ec=e:GetHandler()
if c==ec or c:GetCardTargetCount()==0 then return false end if c==ec or c:GetCardTargetCount()==0 then return false end
local ct=ec:GetFlagEffect(36690018) local val=ec:GetFlagEffectLabel(36690018)
if ct%2==1 then if val==1 then
return c:GetControler()==ec:GetControler() and c:GetCardTarget():IsContains(ec) return c:GetControler()==ec:GetControler() and c:GetCardTarget():IsContains(ec)
else return c:GetControler()~=ec:GetControler() and c:GetCardTarget():IsContains(ec) end else return c:GetControler()~=ec:GetControler() and c:GetCardTarget():IsContains(ec) end
end end
function c62892347.disop(e,tp,eg,ep,ev,re,r,rp) function c62892347.disop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler() local ec=e:GetHandler()
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local ct=ec:GetFlagEffect(36690018) local val=ec:GetFlagEffectLabel(36690018)
if (ct%2==1 and rp~=ec:GetControler()) or (ct%2==0 and rp==ec:GetControler()) then return end if (val==1 and rp~=ec:GetControler()) or (val==0 and rp==ec:GetControler()) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(ec) then return end if not g or not g:IsContains(ec) then return end
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
......
...@@ -38,16 +38,13 @@ function c8396952.arcanareg(c,coin) ...@@ -38,16 +38,13 @@ function c8396952.arcanareg(c,coin)
e1:SetOperation(c8396952.speop) e1:SetOperation(c8396952.speop)
e1:SetReset(RESET_EVENT+0x1ff0000) e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1) c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
if coin==0 then
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1)
end
end end
function c8396952.speop(e,tp,eg,ep,ev,re,r,rp) function c8396952.speop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not re:IsActiveType(TYPE_SPELL) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end if not re:IsActiveType(TYPE_SPELL) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local ct=c:GetFlagEffect(36690018) local val=c:GetFlagEffectLabel(36690018)
if ct%2==1 then if val==1 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
--アルカナフォースXVIII-THE MOON
function c97452817.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97452817,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c97452817.cointg)
e1:SetOperation(c97452817.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c97452817.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c97452817.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c97452817.arcanareg(c,res)
end
function c97452817.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97452817,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(c97452817.spcon)
e1:SetTarget(c97452817.sptg)
e1:SetOperation(c97452817.spop)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97452817,2))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_REPEAT)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c97452817.ctcon)
e2:SetTarget(c97452817.cttg)
e2:SetOperation(c97452817.ctop)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c97452817.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==1
end
function c97452817.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsPlayerCanSpecialSummonMonster(tp,97452818,0,0x4011,0,0,1,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c97452817.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,97452818,0,0x4011,0,0,1,RACE_FAIRY,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,97452818)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
function c97452817.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==0
end
function c97452817.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToChangeControler() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c97452817.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and not Duel.GetControl(tc,1-tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--アルカナフォースVI-THE LOVERS
function c97574404.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97574404,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c97574404.cointg)
e1:SetOperation(c97574404.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c97574404.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c97574404.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c97574404.arcanareg(c,res)
end
function c97574404.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DOUBLE_TRIBUTE)
e1:SetCondition(c97574404.dtcon)
e1:SetValue(c97574404.dtval)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(c97574404.sumcon)
e2:SetTarget(c97574404.sumtg)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e3)
c:RegisterFlagEffect(36690018,RESET_EVENT+0x1ff0000,0,1,coin)
end
function c97574404.dtcon(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==1
end
function c97574404.dtval(e,c)
return c:IsSetCard(0x5)
end
function c97574404.sumcon(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==0
end
function c97574404.sumtg(e,c,tp,sumtp)
return bit.band(sumtp,SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and c:IsSetCard(0x5)
end
...@@ -28,11 +28,9 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,11 +28,9 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(regc,POS_FACEUP,REASON_EFFECT) Duel.Remove(regc,POS_FACEUP,REASON_EFFECT)
local regfun=regc.arcanareg local regfun=regc.arcanareg
if not regfun then return end if not regfun then return end
local ct=tc:GetFlagEffect(36690018) local val=tc:GetFlagEffectLabel(36690018)
tc:ResetEffect(RESET_DISABLE,RESET_EVENT) tc:ResetEffect(RESET_DISABLE,RESET_EVENT)
if ct%2==1 then regfun(tc,val)
regfun(tc,1)
else regfun(tc,0) end
tc:RegisterFlagEffect(99189322,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,1) tc:RegisterFlagEffect(99189322,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -49,9 +47,7 @@ function c99189322.rec_effect(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,9 +47,7 @@ function c99189322.rec_effect(e,tp,eg,ep,ev,re,r,rp)
if tc:GetFlagEffect(99189322)==0 or tc:GetFlagEffect(36690018)==0 then return end if tc:GetFlagEffect(99189322)==0 or tc:GetFlagEffect(36690018)==0 then return end
local regfun=tc.arcanareg local regfun=tc.arcanareg
if not regfun then return end if not regfun then return end
local ct=tc:GetFlagEffect(36690018) local val=tc:GetFlagEffectLabel(36690018)
tc:ResetEffect(RESET_DISABLE,RESET_EVENT) tc:ResetEffect(RESET_DISABLE,RESET_EVENT)
if ct%2==1 then regfun(tc,val)
regfun(tc,1)
else regfun(tc,0) end
end end
...@@ -362,6 +362,7 @@ EFFECT_SKIP_M2 =184 ...@@ -362,6 +362,7 @@ EFFECT_SKIP_M2 =184
EFFECT_CANNOT_BP =185 EFFECT_CANNOT_BP =185
EFFECT_CANNOT_M2 =186 EFFECT_CANNOT_M2 =186
EFFECT_CANNOT_EP =187 EFFECT_CANNOT_EP =187
EFFECT_SKIP_TURN =188
EFFECT_DEFENCE_ATTACK =190 EFFECT_DEFENCE_ATTACK =190
EFFECT_MUST_ATTACK =191 EFFECT_MUST_ATTACK =191
EFFECT_FIRST_ATTACK =192 EFFECT_FIRST_ATTACK =192
...@@ -463,6 +464,7 @@ EVENT_TOSS_COIN =1151 ...@@ -463,6 +464,7 @@ EVENT_TOSS_COIN =1151
EVENT_TOSS_COIN_NEGATE =1152 EVENT_TOSS_COIN_NEGATE =1152
EVENT_TOSS_DICE_NEGATE =1153 EVENT_TOSS_DICE_NEGATE =1153
EVENT_LEVEL_UP =1200 EVENT_LEVEL_UP =1200
EVENT_TURN_END =1210
EVENT_PHASE =0x1000 EVENT_PHASE =0x1000
EVENT_PHASE_START =0x2000 EVENT_PHASE_START =0x2000
EVENT_ADD_COUNTER =0x10000 EVENT_ADD_COUNTER =0x10000
......
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