Commit 4d1dc353 authored by argon.sun's avatar argon.sun

bug fix & new scripts

parent 794d407e
......@@ -1366,11 +1366,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if(mcard->location & 0xe) {
std::wstring str;
if(mcard->type & TYPE_MONSTER) {
if(!mcard->alias || mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10) {
myswprintf(formatBuffer, L"%ls", mainGame->dataManager.GetName(mcard->code));
str.append(formatBuffer);
}
if(mcard->alias && mcard->alias != mcard->code) {
myswprintf(formatBuffer, L"%ls", mainGame->dataManager.GetName(mcard->code));
str.append(formatBuffer);
if(mcard->alias && (mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10)) {
myswprintf(formatBuffer, L"\n(%ls)", mainGame->dataManager.GetName(mcard->alias));
str.append(formatBuffer);
}
......@@ -1389,11 +1387,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer);
}
} else {
if(!mcard->alias || mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10) {
myswprintf(formatBuffer, L"%ls", mainGame->dataManager.GetName(mcard->code));
str.append(formatBuffer);
}
if(mcard->alias && mcard->alias != mcard->code) {
myswprintf(formatBuffer, L"%ls", mainGame->dataManager.GetName(mcard->code));
str.append(formatBuffer);
if(mcard->alias && (mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10)) {
myswprintf(formatBuffer, L"\n%ls", mainGame->dataManager.GetName(mcard->alias));
str.append(formatBuffer);
}
......
......@@ -90,6 +90,7 @@ public:
bool RefreshExtra(int player, int flag = 0x181fff, int use_cache = 1);
bool RefreshSingle(int player, int location, int sequence, int flag = 0x181fff);
void ReplayRefresh(int flag = 0x181fff);
void ReplayRefreshHand(int player, int flag = 0x181fff);
void ReplayRefreshGrave(int player, int flag = 0x181fff);
void ReplayRefreshSingle(int player, int location, int sequence, int flag = 0x181fff);
......
......@@ -176,6 +176,10 @@ void Game::ReplayRefresh(int flag) {
len = query_field_card(dInfo.pDuel, 1, LOCATION_HAND, flag, (unsigned char*)queryBuffer, 0);
dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_HAND, queryBuffer);
}
void Game::ReplayRefreshHand(int player, int flag) {
int len = query_field_card(dInfo.pDuel, player, LOCATION_HAND, flag, (unsigned char*)queryBuffer, 0);
dField.UpdateFieldCard(mainGame->LocalPlayer(player), LOCATION_HAND, queryBuffer);
}
void Game::ReplayRefreshGrave(int player, int flag) {
int len = query_field_card(dInfo.pDuel, 0, LOCATION_GRAVE, flag, (unsigned char*)queryBuffer, 0);
dField.UpdateFieldCard(mainGame->LocalPlayer(player), LOCATION_GRAVE, queryBuffer);
......@@ -3300,7 +3304,7 @@ bool Game::AnalyzeReplay(void* pd, char* engbuf) {
(*cit)->aniFrame = 5;
}
mainGame->WaitFrameSignal(20);
mainGame->ReplayRefresh();
mainGame->ReplayRefreshHand(player);
for (auto cit = mainGame->dField.hand[player].begin(); cit != mainGame->dField.hand[player].end(); ++cit) {
(*cit)->is_hovered = false;
mainGame->dField.MoveCard(*cit, 5);
......
......@@ -248,6 +248,10 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
pduel->write_buffer32(pcard->get_info_location());
}
return;
} else if(location == LOCATION_HAND) {
if(preplayer == playerid)
return;
remove_card(pcard);
} else {
if(location == LOCATION_GRAVE) {
if(pcard->current.sequence == player[pcard->current.controler].list_grave.size() - 1)
......
......@@ -60,6 +60,7 @@ static const struct luaL_reg cardlib[] = {
{ "GetSummonType", scriptlib::card_get_summon_type },
{ "GetSummonPlayer", scriptlib::card_get_summon_player },
{ "GetDestination", scriptlib::card_get_destination },
{ "GetLeaveFieldDest", scriptlib::card_get_leave_field_dest },
{ "GetTurnID", scriptlib::card_get_turnid },
{ "GetFieldID", scriptlib::card_get_fieldid },
{ "IsCode", scriptlib::card_is_code },
......
......@@ -274,6 +274,13 @@ int32 scriptlib::card_get_destination(lua_State *L) {
lua_pushinteger(L, (pcard->operation_param >> 8) & 0xff);
return 1;
}
int32 scriptlib::card_get_leave_field_dest(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->leave_field_redirect());
return 1;
}
int32 scriptlib::card_get_turnid(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
......
......@@ -2133,12 +2133,12 @@ int32 field::release(uint16 step, group * targets, effect * reason_effect, uint3
return TRUE;
}
int32 field::send_to(uint16 step, group * targets, card * target) {
//uint8 playerid = (target->operation_param >> 16) & 0xff;
uint8 playerid = (target->operation_param >> 16) & 0xff;
uint8 dest = (target->operation_param >> 8) & 0xff;
//uint8 seq = (target->operation_param) & 0xff;
if(targets->container.find(target) == targets->container.end())
return TRUE;
if(target->current.location == dest) {
if(target->current.location == dest && target->current.controler == playerid) {
target->current.reason = target->temp.reason;
target->current.reason_effect = target->temp.reason_effect;
target->current.reason_player = target->temp.reason_player;
......@@ -2178,8 +2178,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
if(reason & REASON_RULE)
return FALSE;
pair<effect_container::iterator, effect_container::iterator> pr;
pr = effects.continuous_effect.equal_range(EFFECT_SEND_REPLACE);
auto pr = effects.continuous_effect.equal_range(EFFECT_SEND_REPLACE);
for (; pr.first != pr.second; ++pr.first)
add_process(PROCESSOR_OPERATION_REPLACE, 5, pr.first->second, targets, 0, 0);
return FALSE;
......
......@@ -2371,7 +2371,7 @@ int32 field::process_battle_command(uint16 step) {
core.to_ep = TRUE;
if(must_attack.size() || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_M2))
core.to_m2 = FALSE;
if(must_attack.size() || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_EP))
if(must_attack.size())
core.to_ep = FALSE;
add_process(PROCESSOR_SELECT_BATTLECMD, 0, 0, 0, infos.turn_player, 0);
return FALSE;
......@@ -3517,10 +3517,11 @@ int32 field::add_chain(uint16 step) {
for(cit = clit->target_cards->container.begin(); cit != clit->target_cards->container.end(); ++cit)
(*cit)->create_relation(clit->triggering_effect);
if(clit->triggering_effect->flag & EFFECT_FLAG_CARD_TARGET) {
for(cit = clit->target_cards->container.begin(); cit != clit->target_cards->container.end(); ++cit) {
for(cit = clit->target_cards->container.begin(); cit != clit->target_cards->container.end(); ++cit)
raise_single_event(*cit, EVENT_BECOME_TARGET, clit->triggering_effect, 0, clit->triggering_player, 0, clit->chain_count);
}
process_single_event();
if(clit->target_cards->container.size())
raise_event(&clit->target_cards->container, EVENT_BECOME_TARGET, clit->triggering_effect, 0, clit->triggering_player, clit->triggering_player, clit->chain_count);
}
}
if(peffect->type & EFFECT_TYPE_ACTIVATE) {
......
......@@ -60,6 +60,7 @@ public:
static int32 card_get_summon_type(lua_State *L);
static int32 card_get_summon_player(lua_State *L);
static int32 card_get_destination(lua_State *L);
static int32 card_get_leave_field_dest(lua_State *L);
static int32 card_get_turnid(lua_State *L);
static int32 card_get_fieldid(lua_State *L);
static int32 card_is_code(lua_State *L);
......
--オベリスクの巨神兵
function c10000001.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c10000001.ttcon)
e1:SetOperation(c10000001.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c10000001.setcon)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c10000001.sumsuc)
c:RegisterEffect(e4)
--cannot be target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(1)
c:RegisterEffect(e5)
--to grave
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(10000001,0))
e6:SetCategory(CATEGORY_TOGRAVE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_REPEAT)
e6:SetCountLimit(1)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetCondition(c10000001.tgcon)
e6:SetTarget(c10000001.tgtg)
e6:SetOperation(c10000001.tgop)
c:RegisterEffect(e6)
--destroy
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(10000001,1))
e7:SetCategory(CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetRange(LOCATION_MZONE)
e7:SetCost(c10000001.descost)
e7:SetTarget(c10000001.destg)
e7:SetOperation(c10000001.desop)
c:RegisterEffect(e7)
end
function c10000001.ttcon(e,c)
if c==nil then return true end
return Duel.GetTributeCount(c)>=3
end
function c10000001.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c10000001.setcon(e,c)
if not c then return true end
return false
end
function c10000001.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c10000001.tgcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c10000001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c10000001.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c10000001.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 and Duel.CheckReleaseGroup(tp,nil,2,nil) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
local g=Duel.SelectReleaseGroup(tp,nil,2,2,nil)
Duel.Release(g,REASON_COST)
end
function c10000001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10000001.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--ラーの翼神竜
function c10000011.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c10000011.ttcon)
e1:SetOperation(c10000011.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c10000011.setcon)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c10000011.sumsuc)
c:RegisterEffect(e4)
--cannot special summon
local e5=Effect.CreateEffect(c)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e5)
--One Turn Kill
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(10000011,0))
e6:SetCategory(CATEGORY_ATKCHANGE)
e6:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetCost(c10000011.atkcost)
e6:SetOperation(c10000011.atkop)
c:RegisterEffect(e6)
--destroy
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(10000011,1))
e7:SetCategory(CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCost(c10000011.descost)
e7:SetTarget(c10000011.destg)
e7:SetOperation(c10000011.desop)
c:RegisterEffect(e7)
end
function c10000011.ttcon(e,c)
if c==nil then return true end
return Duel.GetTributeCount(c)>=3
end
function c10000011.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c10000011.setcon(e,c)
if not c then return true end
return false
end
function c10000011.genchainlm(c)
return function (e,rp,tp)
return e:GetHandler()==c
end
end
function c10000011.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c10000011.genchainlm(e:GetHandler()))
end
function c10000011.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end
local lp=Duel.GetLP(tp)
e:SetLabel(lp-100)
Duel.PayLPCost(tp,lp-100)
end
function c10000011.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:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e2)
end
end
function c10000011.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c10000011.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocatioin(LOCATION_MZONE) and chkcLIsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10000011.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--オシリスの天空竜
function c10000020.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c10000020.ttcon)
e1:SetOperation(c10000020.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c10000020.setcon)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c10000020.sumsuc)
c:RegisterEffect(e4)
--to grave
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(10000020,0))
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_REPEAT)
e5:SetCountLimit(1)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetCondition(c10000020.tgcon)
e5:SetTarget(c10000020.tgtg)
e5:SetOperation(c10000020.tgop)
c:RegisterEffect(e5)
--atk/def
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(c10000020.adval)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e7)
--atkdown
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(10000020,1))
e8:SetCategory(CATEGORY_ATKCHANGE)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetCondition(c10000020.atkcon)
e8:SetTarget(c10000020.atktg)
e8:SetOperation(c10000020.atkop)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c10000020.ttcon(e,c)
if c==nil then return true end
return Duel.GetTributeCount(c)>=3
end
function c10000020.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c10000020.setcon(e,c)
if not c then return true end
return false
end
function c10000020.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c10000020.tgcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c10000020.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c10000020.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c10000020.adval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*1000
end
function c10000020.atkfilter(c,e,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
end
function c10000020.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10000020.atkfilter,1,nil,nil,1-tp)
end
function c10000020.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetCard(eg)
end
function c10000020.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c10000020.atkfilter,nil,e,1-tp)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if tc:GetAttack()==0 then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
--オシリスの天空竜
function c10000021.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c10000021.ttcon)
e1:SetOperation(c10000021.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c10000021.setcon)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
--summon success
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c10000021.sumsuc)
c:RegisterEffect(e4)
--to grave
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(10000021,0))
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_REPEAT)
e5:SetCountLimit(1)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetCondition(c10000021.tgcon)
e5:SetTarget(c10000021.tgtg)
e5:SetOperation(c10000021.tgop)
c:RegisterEffect(e5)
--atk/def
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(c10000021.adval)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e7)
--atkdown
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(10000021,1))
e8:SetCategory(CATEGORY_ATKCHANGE)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_SUMMON_SUCCESS)
e8:SetCondition(c10000021.atkcon)
e8:SetTarget(c10000021.atktg)
e8:SetOperation(c10000021.atkop)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c10000021.ttcon(e,c)
if c==nil then return true end
return Duel.GetTributeCount(c)>=3
end
function c10000021.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c10000021.setcon(e,c)
if not c then return true end
return false
end
function c10000021.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c10000021.tgcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c10000021.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c10000021.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c10000021.adval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*1000
end
function c10000021.atkfilter(c,e,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
end
function c10000021.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10000021.atkfilter,1,nil,nil,1-tp)
end
function c10000021.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetCard(eg)
end
function c10000021.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c10000021.atkfilter,nil,e,1-tp)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if tc:GetAttack()==0 then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
--マジマジ☆マジシャンギャル
function c10000030.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c10000030.xyzfilter,2)
c:EnableReviveLimit()
--effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10000030,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c10000030.cost)
e1:SetTarget(c10000030.target)
e1:SetOperation(c10000030.operation)
c:RegisterEffect(e1)
end
function c10000030.xyzfilter(c)
return c:GetLevel()==6 and c:IsRace(RACE_SPELLCASTER)
end
function c10000030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
function c10000030.filter1(c)
return c:IsControlerCanBeChanged()
end
function c10000030.filter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10000030.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c10000030.filter1(chkc)
else return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c10000030.filter2(chkc,e,tp) end
end
if chk==0 then return Duel.IsExistingTarget(c10000030.filter1,tp,0,LOCATION_MZONE,1,nil)
or (Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c10000030.filter2,tp,0,LOCATION_GRAVE,1,nil,e,tp)) end
local b1=Duel.IsExistingTarget(c10000030.filter1,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)~=0 and Duel.IsExistingTarget(c10000030.filter2,tp,0,LOCATION_GRAVE,1,nil,e,tp)
local op=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10000030,0))
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(10000030,1),aux.Stringid(10000030,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(10000030,1))
else op=Duel.SelectOption(tp,aux.Stringid(10000030,2))+1 end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_CONTROL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c10000030.filter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c10000030.filter2,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
end
function c10000030.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetLabel()==0 then
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
else
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--アマゾネスペット虎
function c10979723.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c10979723.val)
c:RegisterEffect(e1)
--at limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetTarget(c10979723.atlimit)
e2:SetValue(1)
c:RegisterEffect(e2)
--only 1 can exists
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_SUMMON)
e3:SetCondition(c10979723.excon)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_SPSUMMON_CONDITION)
e5:SetValue(c10979723.splimit)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_SELF_DESTROY)
e6:SetCondition(c10979723.descon)
c:RegisterEffect(e6)
end
function c10979723.val(e,c)
return Duel.GetMatchingGroupCount(c10979723.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*400
end
function c10979723.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
function c10979723.atlimit(e,c)
return c:IsSetCard(0x4) and c~=e:GetHandler()
end
function c10979723.exfilter(c,fid)
return c:IsFaceup() and c:GetCode()==10979723 and (fid==nil or c:GetFieldID()<fid)
end
function c10979723.excon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c10979723.exfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end
function c10979723.splimit(e,se,sp,st,spos,tgp)
if bit.band(spos,POS_FACEDOWN) then return true end
return not Duel.IsExistingMatchingCard(c10979723.exfilter,tgp,LOCATION_ONFIELD,0,1,nil)
end
function c10979723.descon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c10979723.exfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil,c:GetFieldID())
end
......@@ -13,8 +13,8 @@ function c11384280.initial_effect(c)
c:RegisterEffect(e1)
end
function c11384280.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.TRUE,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(sg,REASON_COST)
end
function c11384280.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -23,7 +23,7 @@ function c11384280.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c11384280.operation(e,tp,eg,ep,ev,re,r,rp,chk)
function c11384280.operation(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
......@@ -27,4 +27,33 @@ function c12181376.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local c=e:GetHandler()
--cannot trigger
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0,LOCATION_SZONE)
e1:SetTarget(c12181376.distg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(0,LOCATION_SZONE)
e2:SetTarget(c12181376.distg)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--disable trap monster
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(c12181376.distg)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c12181376.distg(e,c)
return c:IsType(TYPE_TRAP)
end
--アマゾネス女王
function c15951532.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x4))
e1:SetValue(1)
c:RegisterEffect(e1)
end
--アマゾネスの意地
function c22082163.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c22082163.target)
e1:SetOperation(c22082163.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c22082163.desop)
c:RegisterEffect(e2)
--Destroy2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c22082163.descon2)
e3:SetOperation(c22082163.desop2)
c:RegisterEffect(e3)
--cannot bp
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_EP)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetCondition(c22082163.becon)
c:RegisterEffect(e4)
end
function c22082163.filter(c,e,tp)
return c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22082163.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:GetControler()==tp and c22082163.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c22082163.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c22082163.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c22082163.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)==0 then return end
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCondition(c22082163.cpcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetCondition(c22082163.cpcon)
tc:RegisterEffect(e2)
end
end
function c22082163.cpcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
function c22082163.becon(e)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and tc:IsAttackable()
end
function c22082163.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c22082163.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY)
end
function c22082163.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--アマゾネスの鎖使い
function c29654737.initial_effect(c)
--get card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29654737,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c29654737.condition)
e1:SetCost(c29654737.cost)
e1:SetOperation(c29654737.operation)
c:RegisterEffect(e1)
end
function c29654737.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0
end
function c29654737.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
Duel.CheckLPCost(tp,1500)
end
function c29654737.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=tg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end
end
--アマゾネスの闘志
function c36100154.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c36100154.atkup)
c:RegisterEffect(e2)
end
function c36100154.atkup(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsSetCard(0x4) or not d or a:GetAttack()>=d:GetAttack() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
e1:SetValue(1000)
a:RegisterEffect(e1)
end
......@@ -30,7 +30,7 @@ function c41458579.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c41458579.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(e) then
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--アマゾネスの聖戦士
function c47480070.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c47480070.val)
c:RegisterEffect(e1)
end
function c47480070.val(e,c)
return Duel.GetMatchingGroupCount(c47480070.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*100
end
function c47480070.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
--アマゾネスの賢者
function c53162898.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53162898,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c53162898.condition)
e1:SetCost(c53162898.target)
e1:SetOperation(c53162898.operation)
c:RegisterEffect(e1)
end
function c53162898.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
end
function c53162898.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c53162898.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c53162898.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c53162898.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c53162898.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--アマゾネスの格闘戦士
function c55821894.initial_effect(c)
--battle dam 0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
--女王の選択
function c58477767.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c58477767.condition)
e1:SetTarget(c58477767.target)
e1:SetOperation(c58477767.operation)
c:RegisterEffect(e1)
end
function c58477767.check(c1,c2,tp)
return c1:IsLocation(LOCATION_GRAVE) and c1:IsReason(REASON_BATTLE) and c1:GetPreviousControler()~=tp and c2:IsSetCard(0x4)
end
function c58477767.condition(e,tp,eg,ep,ev,re,r,rp)
local dc=eg:GetFirst()
local bc=dc:GetBattleTarget()
return c58477767.check(dc,bc,tp) or c58477767.check(bc,dc,tp)
end
function c58477767.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58477767.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c58477767.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c58477767.operation(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,c58477767.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
--アマゾネス転生術
function c6459419.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c6459419.target)
e1:SetOperation(c6459419.activate)
c:RegisterEffect(e1)
end
function c6459419.dfilter(c)
return c:IsFaceup() and c:IsSetCard(0x4) and c:IsDestructable()
end
function c6459419.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6459419.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6459419.dfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c6459419.dfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c6459419.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c6459419.dfilter,tp,LOCATION_MZONE,0,nil)
local ct=Duel.Destroy(g,REASON_EFFECT)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct==0 or ft==0 then return end
if ft>ct then ft=ct end
local sg=Duel.GetMatchingGroup(c6459419.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6459419,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fg=sg:Select(tp,ft,ft,nil)
Duel.SpecialSummon(fg,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
......@@ -26,7 +26,7 @@ function c64697231.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(p,g)
local tg=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=tg:Select(p,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
......
--アマゾネスの弩弓隊
function c67987611.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c67987611.condition)
e1:SetTarget(c67987611.target)
e1:SetOperation(c67987611.activate)
c:RegisterEffect(e1)
end
function c67987611.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
function c67987611.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(c67987611.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c67987611.filter(c)
return not c:IsPosition(POS_FACEUP_ATTACK)
end
function c67987611.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c67987611.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c67987611.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c67987611.filter,tp,0,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,true)
local fg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=fg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=fg:GetNext()
end
end
--ハーピィズペット仔竜
function c6924874.initial_effect(c)
--at limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetTarget(c6924874.atlimit)
e1:SetValue(1)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetCondition(c6924874.adcon)
e2:SetValue(2400)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENCE)
e3:SetValue(1200)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(6924874,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(c6924874.descon)
e4:SetTarget(c6924874.destg)
e4:SetOperation(c6924874.desop)
c:RegisterEffect(e4)
end
function c6924874.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x64) and c:GetCode()~=6924874
end
function c6924874.atlimit(e,c)
return c:IsSetCard(0x64) and c:GetCode()~=6924874
end
function c6924874.adcon(e)
return Duel.IsExistingMatchingCard(c6924874.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,2,nil)
end
function c6924874.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c6924874.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,3,nil)
end
function c6924874.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c6924874.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--アマゾネス·スカウト
function c71209500.initial_effect(c)
--effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71209500,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0+TIMING_DRAW_PHASE)
e1:SetCost(c71209500.efcost)
e1:SetOperation(c71209500.efop)
c:RegisterEffect(e1)
end
function c71209500.efcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c71209500.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
function c71209500.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c71209500.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--アマゾネスの里
function c712559.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x4))
e2:SetValue(200)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(712559,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1)
e3:SetCondition(c712559.condition)
e3:SetTarget(c712559.target)
e3:SetOperation(c712559.operation)
c:RegisterEffect(e3)
end
function c712559.cfilter(c)
return c:IsReason(REASON_DESTROY) and c:IsLevelAbove(1) and c:IsSetCard(0x4)
end
function c712559.condition(e,tp,eg,ep,ev,re,r,rp)
local lv=0
local tc=eg:GetFirst()
while tc do
if tc:IsReason(REASON_DESTROY) and tc:IsSetCard(0x4) then
local tlv=tc:GetLevel()
if tlv>lv then lv=tlv end
end
tc=eg:GetNext()
end
if lv>0 then e:SetLabel(lv) end
return lv>0
end
function c712559.spfilter(c,e,tp,lv)
return c:IsLevelBelow(lv) and c:IsSetCard(0x4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c712559.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c712559.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,e:GetLabel()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c712559.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c712559.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--アマゾネスの吹き矢兵
function c73574678.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73574678,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_REPEAT)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c73574678.condition)
e1:SetTarget(c73574678.target)
e1:SetOperation(c73574678.operation)
c:RegisterEffect(e1)
end
function c73574678.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c73574678.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c73574678.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_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
......@@ -34,7 +34,7 @@ function c7478431.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c7478431.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(e) then
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ハーピィ·クィーン
function c75064463.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75064463,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c75064463.cost)
e1:SetTarget(c75064463.target)
e1:SetOperation(c75064463.operation)
c:RegisterEffect(e1)
--change name
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetValue(76812113)
c:RegisterEffect(e2)
end
function c75064463.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c75064463.filter(c)
return c:GetCode()==75782277 and c:IsAbleToHand()
end
function c75064463.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c75064463.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75064463.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c75064463.filter,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
......@@ -12,16 +12,11 @@ function c76372778.initial_effect(c)
e1:SetOperation(c76372778.operation)
c:RegisterEffect(e1)
end
function c76372778.condition(e,tp,eg,ep,ev,re,r,rp,chk)
function c76372778.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if c==a then
return d and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsAbleToGraveAsCost()
else
return a:IsStatus(STATUS_BATTLE_DESTROYED) and a:IsAbleToGraveAsCost()
end
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and not bc:IsType(TYPE_TOKEN) and bc:GetLeaveFieldDest()==0
end
function c76372778.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......@@ -29,16 +24,15 @@ function c76372778.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c76372778.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if tc:IsRelateToBattle() then
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c76372778.reptg)
e1:SetOperation(c76372778.repop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
tc:RegisterEffect(e1)
bc:RegisterEffect(e1)
end
end
function c76372778.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -30,7 +30,7 @@ function c76865611.cona(e)
return e:GetHandler():IsAttack()
end
function c76865611.refval(e,re,val,r,rp,rc)
return rp~=e:GetHandler():GetControler()
return rp~=e:GetHandlerPlayer() and bit.band(r,REASON_EFFECT)~=0
end
function c76865611.check(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
--ヒステリック·パーティー
function c77778835.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c77778835.cost)
e1:SetTarget(c77778835.target)
e1:SetOperation(c77778835.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c77778835.desop)
c:RegisterEffect(e2)
end
function c77778835.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c77778835.filter(c,e,tp)
return c:IsCode(76812113) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c77778835.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c77778835.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c77778835.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c77778835.filter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp)
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
c:SetCardTarget(tc)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
function c77778835.desfilter(c,rc)
return rc:IsHasCardTarget(c)
end
function c77778835.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c77778835.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--アマゾネスの秘宝
function c79965360.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c79965360.target)
e1:SetOperation(c79965360.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c79965360.eqlimit)
c:RegisterEffect(e2)
--destroy rep
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(c79965360.reptg)
e3:SetCountLimit(1)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(79965360,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c79965360.descon)
e4:SetTarget(c79965360.destg)
e4:SetOperation(c79965360.desop)
c:RegisterEffect(e4)
end
function c79965360.eqlimit(e,c)
return c:IsSetCard(0x4)
end
function c79965360.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
function c79965360.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c79965360.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c79965360.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c79965360.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c79965360.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c79965360.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if chk==0 then return tc:IsReason(REASON_BATTLE) end
return true
end
function c79965360.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()==Duel.GetAttacker() and Duel.GetAttackTarget()
end
function c79965360.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetAttackTarget(),1,0,0)
end
function c79965360.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget()
if tc:IsRelateToBattle() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--救出劇
function c80193355.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetCondition(c80193355.condition)
e1:SetTarget(c80193355.target)
e1:SetOperation(c80193355.activate)
c:RegisterEffect(e1)
end
function c80193355.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x4)
end
function c80193355.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c80193355.cfilter,1,nil)
end
function c80193355.spfilter(c,e,tp,g)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not g or not g:IsContains(c))
end
function c80193355.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80193355.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
local g=eg:Filter(c80193355.cfilter,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c80193355.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c80193355.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,g)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -24,7 +24,7 @@ function c81066751.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c81066751.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(e) then
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--アマゾネスの呪詛師
function c81325903.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c81325903.target)
e1:SetOperation(c81325903.activate)
c:RegisterEffect(e1)
end
function c81325903.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
function c81325903.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c81325903.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c81325903.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c81325903.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=g:GetFirst()
local tc2=g:GetNext()
if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then
local atk1=tc1:GetBaseAttack()
local atk2=tc2:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(atk2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(atk1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e2)
end
end
--アマゾネス訓練生
function c89567993.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_END)
e1:SetCondition(c89567993.tdcon)
e1:SetOperation(c89567993.tdop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(89567993,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c89567993.atkcon)
e2:SetOperation(c89567993.atkop)
c:RegisterEffect(e2)
end
function c89567993.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and not bc:IsType(TYPE_TOKEN) and bc:GetLeaveFieldDest()==0
end
function c89567993.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c89567993.reptg)
e1:SetOperation(c89567993.repop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
bc:RegisterEffect(e1)
end
function c89567993.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_BATTLE) end
return true
end
function c89567993.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,1,REASON_EFFECT)
end
function c89567993.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and e:GetHandler():IsRelateToBattle()
end
function c89567993.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(200)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--アマゾネスの射手
function c91869203.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(91869203,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c91869203.cost)
e1:SetTarget(c91869203.target)
e1:SetOperation(c91869203.operation)
c:RegisterEffect(e1)
end
function c91869203.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,2,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,2,2,nil)
Duel.Release(sg,REASON_COST)
end
function c91869203.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1200)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1200)
end
function c91869203.operation(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 c94004268.initial_effect(c)
--reflect battle dam
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
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