Commit 4a961cad authored by sidschingis's avatar sidschingis

merge upstream

parents 9ee2a8b9 e7b949ff
...@@ -238,7 +238,7 @@ uint32 card::get_another_code() { ...@@ -238,7 +238,7 @@ uint32 card::get_another_code() {
} }
int32 card::is_set_card(uint32 set_code) { int32 card::is_set_card(uint32 set_code) {
uint32 code = get_code(); uint32 code = get_code();
uint32 setcode; uint64 setcode;
if (code == data.code) { if (code == data.code) {
setcode = data.setcode; setcode = data.setcode;
} else { } else {
...@@ -252,6 +252,8 @@ int32 card::is_set_card(uint32 set_code) { ...@@ -252,6 +252,8 @@ int32 card::is_set_card(uint32 set_code) {
return TRUE; return TRUE;
if (((setcode >> 16) & 0xfff) == settype && ((setcode >> 16) & 0xf000 & setsubtype) == setsubtype) if (((setcode >> 16) & 0xfff) == settype && ((setcode >> 16) & 0xf000 & setsubtype) == setsubtype)
return TRUE; return TRUE;
if (((setcode >> 24) & 0xfff) == settype && ((setcode >> 24) & 0xf000 & setsubtype) == setsubtype)
return TRUE;
return FALSE; return FALSE;
} }
uint32 card::get_type() { uint32 card::get_type() {
......
...@@ -704,9 +704,10 @@ void field::add_effect(effect* peffect, uint8 owner_player) { ...@@ -704,9 +704,10 @@ void field::add_effect(effect* peffect, uint8 owner_player) {
} }
} }
void field::remove_effect(effect* peffect) { void field::remove_effect(effect* peffect) {
if (effects.indexer.find(peffect) == effects.indexer.end()) auto eit = effects.indexer.find(peffect);
if (eit == effects.indexer.end())
return; return;
auto it = effects.indexer[peffect]; auto it = eit->second;
if (!(peffect->type & EFFECT_TYPE_ACTIONS)) if (!(peffect->type & EFFECT_TYPE_ACTIONS))
effects.aura_effect.erase(it); effects.aura_effect.erase(it);
else { else {
......
...@@ -508,9 +508,6 @@ int32 scriptlib::effect_get_activate_location(lua_State *L) { ...@@ -508,9 +508,6 @@ int32 scriptlib::effect_get_activate_location(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
if(peffect->type & (EFFECT_TYPE_ACTIVATE | EFFECT_TYPE_IGNITION | EFFECT_TYPE_QUICK_O | EFFECT_TYPE_QUICK_F))
lua_pushinteger(L, peffect->handler->current.location);
else
lua_pushinteger(L, peffect->s_range); lua_pushinteger(L, peffect->s_range);
return 1; return 1;
} }
\ No newline at end of file
...@@ -2368,9 +2368,9 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2368,9 +2368,9 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
dest = ((*cit)->operation_param >> 8) & 0xff; dest = ((*cit)->operation_param >> 8) & 0xff;
if(!dest) if(!dest)
dest = LOCATION_GRAVE; dest = LOCATION_GRAVE;
if((dest == LOCATION_HAND && (*cit)->is_affected_by_effect(EFFECT_CANNOT_TO_HAND)) if((dest == LOCATION_HAND && !(*cit)->is_capable_send_to_hand(reason_player))
|| (dest == LOCATION_DECK && (*cit)->is_affected_by_effect(EFFECT_CANNOT_TO_DECK)) || (dest == LOCATION_DECK && !(*cit)->is_capable_send_to_deck(reason_player))
|| (dest == LOCATION_REMOVED && (*cit)->is_affected_by_effect(EFFECT_CANNOT_REMOVE))) || (dest == LOCATION_REMOVED && !(*cit)->is_removeable(reason_player)))
dest = LOCATION_GRAVE; dest = LOCATION_GRAVE;
(*cit)->operation_param = ((*cit)->operation_param & 0xffff00ff) + (dest << 8); (*cit)->operation_param = ((*cit)->operation_param & 0xffff00ff) + (dest << 8);
} }
...@@ -2794,28 +2794,19 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2794,28 +2794,19 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
} else if(dest == LOCATION_REMOVED) { } else if(dest == LOCATION_REMOVED) {
core.hint_timing[pcard->current.controler] |= TIMING_REMOVE; core.hint_timing[pcard->current.controler] |= TIMING_REMOVE;
} }
if(pcard->current.location != dest) {
pduel->write_buffer8(MSG_MOVE); pduel->write_buffer8(MSG_MOVE);
pduel->write_buffer32(pcard->data.code); pduel->write_buffer32(pcard->data.code);
pduel->write_buffer32(pcard->get_info_location());
if(pcard->overlay_target) { if(pcard->overlay_target) {
pduel->write_buffer8(pcard->overlay_target->current.controler);
pduel->write_buffer8(pcard->overlay_target->current.location | LOCATION_OVERLAY);
pduel->write_buffer8(pcard->overlay_target->current.sequence);
pduel->write_buffer8(pcard->current.sequence);
detach.insert(pcard->overlay_target); detach.insert(pcard->overlay_target);
pcard->overlay_target->xyz_remove(pcard); pcard->overlay_target->xyz_remove(pcard);
} else {
pduel->write_buffer8(pcard->current.controler);
pduel->write_buffer8(pcard->current.location);
pduel->write_buffer8(pcard->current.sequence);
pduel->write_buffer8(pcard->current.position);
} }
move_card(playerid, pcard, dest, seq); move_card(playerid, pcard, dest, seq);
pcard->current.position = (pcard->operation_param >> 24); pcard->current.position = (pcard->operation_param >> 24);
pduel->write_buffer8(pcard->current.controler); pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer8(pcard->current.location);
pduel->write_buffer8(pcard->current.sequence);
pduel->write_buffer8(pcard->current.position);
pduel->write_buffer32(pcard->current.reason); pduel->write_buffer32(pcard->current.reason);
}
if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENCE)) if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENCE))
show_decktop[pcard->current.controler] = true; show_decktop[pcard->current.controler] = true;
pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE); pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE);
...@@ -3179,25 +3170,13 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret ...@@ -3179,25 +3170,13 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
} }
pduel->write_buffer8(MSG_MOVE); pduel->write_buffer8(MSG_MOVE);
pduel->write_buffer32(target->data.code); pduel->write_buffer32(target->data.code);
if(target->overlay_target) { pduel->write_buffer32(target->get_info_location());
pduel->write_buffer8(target->overlay_target->current.controler); if(target->overlay_target)
pduel->write_buffer8(target->overlay_target->current.location | LOCATION_OVERLAY);
pduel->write_buffer8(target->overlay_target->current.sequence);
pduel->write_buffer8(target->current.sequence);
target->overlay_target->xyz_remove(target); target->overlay_target->xyz_remove(target);
} else {
pduel->write_buffer8(target->current.controler);
pduel->write_buffer8(target->current.location);
pduel->write_buffer8(target->current.sequence);
pduel->write_buffer8(target->current.position);
}
move_card(playerid, target, location, target->temp.sequence); move_card(playerid, target, location, target->temp.sequence);
target->current.position = returns.ivalue[0]; target->current.position = returns.ivalue[0];
target->set_status(STATUS_LEAVE_CONFIRMED | STATUS_ACTIVATED, FALSE); target->set_status(STATUS_LEAVE_CONFIRMED | STATUS_ACTIVATED, FALSE);
pduel->write_buffer8(target->current.controler); pduel->write_buffer32(target->get_info_location());
pduel->write_buffer8(target->current.location);
pduel->write_buffer8(target->current.sequence);
pduel->write_buffer8(target->current.position);
pduel->write_buffer32(target->current.reason); pduel->write_buffer32(target->current.reason);
if((target->current.location != LOCATION_MZONE)) { if((target->current.location != LOCATION_MZONE)) {
if(target->equiping_cards.size()) { if(target->equiping_cards.size()) {
......
...@@ -481,7 +481,7 @@ int32 field::process() { ...@@ -481,7 +481,7 @@ int32 field::process() {
if(!attacker if(!attacker
|| (attacker->fieldid_r != core.pre_field[0]) || (attacker->fieldid_r != core.pre_field[0])
|| (attacker->current.position & POS_FACEDOWN) || (attacker->current.position & POS_FACEDOWN)
|| (attacker->current.position & POS_DEFENCE && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK))) || ((attacker->current.position & POS_DEFENCE) && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK)))
|| attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED) || attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED)
|| !attacker->is_affect_by_effect(core.reason_effect)) { || !attacker->is_affect_by_effect(core.reason_effect)) {
returns.ivalue[0] = 0; returns.ivalue[0] = 0;
...@@ -1964,6 +1964,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1964,6 +1964,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
pr = effects.activate_effect.equal_range(evit->event_code); pr = effects.activate_effect.equal_range(evit->event_code);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, *evit)) { if(peffect->is_chainable(priority) && peffect->is_activateable(priority, *evit)) {
newchain.flag = 0; newchain.flag = 0;
newchain.chain_id = infos.field_id++; newchain.chain_id = infos.field_id++;
...@@ -1981,6 +1983,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -1981,6 +1983,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
pr = effects.quick_o_effect.equal_range(evit->event_code); pr = effects.quick_o_effect.equal_range(evit->event_code);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, *evit)) { if(peffect->is_chainable(priority) && peffect->is_activateable(priority, *evit)) {
newchain.flag = 0; newchain.flag = 0;
newchain.chain_id = infos.field_id++; newchain.chain_id = infos.field_id++;
...@@ -2028,6 +2032,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -2028,6 +2032,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if(core.global_flag & GLOBALFLAG_DELAYED_QUICKEFFECT) { if(core.global_flag & GLOBALFLAG_DELAYED_QUICKEFFECT) {
for(auto eit = core.delayed_quick.begin(); eit != core.delayed_quick.end(); ++eit) { for(auto eit = core.delayed_quick.begin(); eit != core.delayed_quick.end(); ++eit) {
peffect = eit->first; peffect = eit->first;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
const tevent& evt = eit->second; const tevent& evt = eit->second;
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, evt, TRUE, FALSE, FALSE)) { if(peffect->is_chainable(priority) && peffect->is_activateable(priority, evt, TRUE, FALSE, FALSE)) {
newchain.flag = 0; newchain.flag = 0;
...@@ -2048,6 +2054,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -2048,6 +2054,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) { if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) {
newchain.flag = 0; newchain.flag = 0;
newchain.chain_id = infos.field_id++; newchain.chain_id = infos.field_id++;
...@@ -2065,6 +2073,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) { ...@@ -2065,6 +2073,8 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) { if(peffect->is_chainable(priority) && peffect->is_activateable(priority, nil_event)) {
newchain.flag = 0; newchain.flag = 0;
newchain.chain_id = infos.field_id++; newchain.chain_id = infos.field_id++;
...@@ -2392,6 +2402,8 @@ int32 field::process_idle_command(uint16 step) { ...@@ -2392,6 +2402,8 @@ int32 field::process_idle_command(uint16 step) {
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
newchain.triggering_effect = peffect; newchain.triggering_effect = peffect;
if(peffect->is_activateable(infos.turn_player, nil_event)) if(peffect->is_activateable(infos.turn_player, nil_event))
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
...@@ -2399,12 +2411,16 @@ int32 field::process_idle_command(uint16 step) { ...@@ -2399,12 +2411,16 @@ int32 field::process_idle_command(uint16 step) {
pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
newchain.triggering_effect = peffect; newchain.triggering_effect = peffect;
if(peffect->is_activateable(infos.turn_player, nil_event)) if(peffect->is_activateable(infos.turn_player, nil_event))
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
} }
for(eit = effects.ignition_effect.begin(); eit != effects.ignition_effect.end(); ++eit) { for(eit = effects.ignition_effect.begin(); eit != effects.ignition_effect.end(); ++eit) {
peffect = eit->second; peffect = eit->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
newchain.triggering_effect = peffect; newchain.triggering_effect = peffect;
if(peffect->is_activateable(infos.turn_player, nil_event)) if(peffect->is_activateable(infos.turn_player, nil_event))
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
...@@ -2619,6 +2635,8 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2619,6 +2635,8 @@ int32 field::process_battle_command(uint16 step) {
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
newchain.triggering_effect = peffect; newchain.triggering_effect = peffect;
if(peffect->is_activateable(infos.turn_player, nil_event) && peffect->get_speed() > 1) if(peffect->is_activateable(infos.turn_player, nil_event) && peffect->get_speed() > 1)
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
...@@ -2626,6 +2644,8 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2626,6 +2644,8 @@ int32 field::process_battle_command(uint16 step) {
pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN); pr = effects.quick_o_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location;
peffect->o_range = peffect->handler->current.sequence;
newchain.triggering_effect = peffect; newchain.triggering_effect = peffect;
if(peffect->is_activateable(infos.turn_player, nil_event)) if(peffect->is_activateable(infos.turn_player, nil_event))
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
...@@ -3745,7 +3765,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3745,7 +3765,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
card* pcard; card* pcard;
for(auto elit = core.used_event.begin(); elit != core.used_event.end(); ++elit) { for(auto elit = core.used_event.begin(); elit != core.used_event.end(); ++elit) {
if(elit->event_cards) if(elit->event_cards)
pduel->delete_group((group*)elit->event_cards); pduel->delete_group(elit->event_cards);
} }
core.used_event.clear(); core.used_event.clear();
for(auto eit = core.reseted_effects.begin(); eit != core.reseted_effects.end(); ++eit) { for(auto eit = core.reseted_effects.begin(); eit != core.reseted_effects.end(); ++eit) {
......
...@@ -27,7 +27,8 @@ function c10560119.sdcon(e) ...@@ -27,7 +27,8 @@ function c10560119.sdcon(e)
return Duel.IsExistingMatchingCard(c10560119.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c10560119.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
function c10560119.spcon(e,tp,eg,ep,ev,re,r,rp) function c10560119.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c10560119.cfilter,tp,LOCATION_MZONE,0,1,nil) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return g:GetCount()>0 and not g:IsExists(c10560119.cfilter,1,nil)
end end
function c10560119.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c10560119.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10560119)==0 end if chk==0 then return Duel.GetFlagEffect(tp,10560119)==0 end
......
--エクシーズ・チェンジ・タクティクス
function c11705261.initial_effect(c)
c:SetUniqueOnField(1,0,11705261)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11705261,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c11705261.condition)
e2:SetCost(c11705261.cost)
e2:SetTarget(c11705261.target)
e2:SetOperation(c11705261.operation)
c:RegisterEffect(e2)
end
function c11705261.filter(c,tp)
return c:IsSetCard(0x7f) and c:IsControler(tp) and c:GetSummonType()==SUMMON_TYPE_XYZ
end
function c11705261.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11705261.filter,1,nil,tp)
end
function c11705261.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c11705261.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c11705261.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--SZW-天聖輝狼剣
function c12927849.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12927849,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c12927849.sptg)
e1:SetOperation(c12927849.spop)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12927849,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(c12927849.eqtg)
e2:SetOperation(c12927849.eqop)
c:RegisterEffect(e2)
--salvage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12927849,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c12927849.thcon)
e3:SetTarget(c12927849.thtg)
e3:SetOperation(c12927849.thop)
c:RegisterEffect(e3)
end
function c12927849.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x7e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12927849.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c12927849.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c12927849.filter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c12927849.filter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c12927849.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c12927849.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x7f)
end
function c12927849.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c12927849.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c12927849.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c12927849.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c12927849.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c12927849.eqlimit)
c:RegisterEffect(e1)
end
function c12927849.eqlimit(e,c)
return c:IsSetCard(0x7f)
end
function c12927849.thcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
local bc=ec:GetBattleTarget()
return ec==e:GetHandler():GetEquipTarget() and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE)
end
function c12927849.thfilter(c)
return c:IsSetCard(0x7e) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c12927849.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c12927849.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c12927849.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c12927849.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c12927849.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
...@@ -27,15 +27,17 @@ end ...@@ -27,15 +27,17 @@ end
function c18605135.filter(c) function c18605135.filter(c)
return c:IsFaceup() and c:IsCode(22702055) return c:IsFaceup() and c:IsCode(22702055)
end end
function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp) function c18605135.check()
return Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) return Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.GetEnvironment()==22702055 or Duel.GetEnvironment()==22702055
end end
function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp)
return c18605135.check()
end
function c18605135.abdcon(e) function c18605135.abdcon(e)
return (Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.GetEnvironment()==22702055)and local at=Duel.GetAttackTarget()
Duel.GetAttackTarget()==nil or Duel.GetAttackTarget():IsAttackPos() or Duel.GetAttacker():GetAttack()>Duel.GetAttackTarget():GetDefence() return c18605135.check() and (at==nil or at:IsAttackPos() or Duel.GetAttacker():GetAttack()>at:GetDefence())
end end
function c18605135.sdcon(e) function c18605135.sdcon(e)
return not Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) return not c18605135.check()
and Duel.GetEnvironment()~=22702055
end end
...@@ -21,7 +21,7 @@ function c22796548.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,7 +21,7 @@ function c22796548.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,500) Duel.PayLPCost(tp,500)
end end
function c22796548.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22796548.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp) local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac) e:SetLabel(ac)
......
...@@ -9,6 +9,7 @@ function c23649496.initial_effect(c) ...@@ -9,6 +9,7 @@ function c23649496.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCost(c23649496.cost) e1:SetCost(c23649496.cost)
e1:SetTarget(c23649496.target) e1:SetTarget(c23649496.target)
......
...@@ -11,34 +11,69 @@ function c25573054.initial_effect(c) ...@@ -11,34 +11,69 @@ function c25573054.initial_effect(c)
e1:SetOperation(c25573054.activate) e1:SetOperation(c25573054.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25573054.cfilter1(c) function c25573054.tgfilter(c)
return c:IsCode(57116033) and c:IsAbleToGraveAsCost() return c:IsCode(57116033) and c:IsAbleToGraveAsCost()
end end
function c25573054.cfilter2(c) function c25573054.spfilter(c,e,tp)
return not c:IsCode(98585345) and c:IsAbleToGraveAsCost() return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c25573054.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c25573054.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25573054.cfilter1,tp,LOCATION_MZONE,0,1,nil) local sg=Duel.GetMatchingGroup(c25573054.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
and Duel.IsExistingMatchingCard(c25573054.cfilter2,tp,LOCATION_HAND,0,2,e:GetHandler()) end local hg=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,e:GetHandler())
if chk==0 then
if sg:GetCount()==0 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if ft==0 then
if not Duel.IsExistingMatchingCard(c25573054.tgfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
else
if not Duel.IsExistingMatchingCard(c25573054.tgfilter,tp,LOCATION_ONFIELD,0,1,nil) then return false end
end
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
return hg:GetCount()>1
else
return hg:GetCount()>2
end
end
local cg=nil
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c25573054.cfilter1,tp,LOCATION_MZONE,0,1,1,nil) cg=Duel.SelectMatchingCard(tp,c25573054.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c25573054.cfilter2,tp,LOCATION_HAND,0,2,2,nil) cg=Duel.SelectMatchingCard(tp,c25573054.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
g1:Merge(g2) end
Duel.SendtoGrave(g1,REASON_COST) local ct=sg:GetCount()
end if ct>2 or sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
function c25573054.filter(c,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) local g=hg:Select(tp,2,2,nil)
cg:Merge(g)
elseif ct==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=hg:Select(tp,2,2,sg:GetFirst())
cg:Merge(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=hg:Select(tp,1,1,nil)
if sg:IsContains(g1:GetFirst()) then
hg:Sub(sg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=hg:Select(tp,1,1,g1:GetFirst())
cg:Merge(g1)
cg:Merge(g2)
end
Duel.SendtoGrave(cg,REASON_COST)
end end
function c25573054.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25573054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return true end
and Duel.IsExistingMatchingCard(c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND)
end end
function c25573054.activate(e,tp,eg,ep,ev,re,r,rp) function c25573054.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c25573054.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
......
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
function c32559361.target(e,tp,eg,ep,ev,re,r,rp,chk) function c32559361.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local tc=c:GetBattleTarget() local tc=c:GetBattleTarget()
if chk==0 then return c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end
end end
function c32559361.operation(e,tp,eg,ep,ev,re,r,rp) function c32559361.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--ドラゴン・目覚めの旋律
function c48800175.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c48800175.cost)
e1:SetTarget(c48800175.target)
e1:SetOperation(c48800175.activate)
c:RegisterEffect(e1)
end
function c48800175.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function c48800175.filter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttackAbove(3000) and c:IsDefenceBelow(2500) and c:IsAbleToHand()
end
function c48800175.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48800175.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c48800175.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c48800175.filter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--サイバネティック・フュージョン・サポート
function c58199906.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c58199906.cost)
e1:SetOperation(c58199906.activate)
c:RegisterEffect(e1)
end
function c58199906.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,58199906)==0 end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
Duel.RegisterFlagEffect(tp,58199906,RESET_PHASE+PHASE_END,0,1)
end
function c58199906.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(58199906,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHAIN_MATERIAL)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c58199906.chain_target)
e1:SetOperation(c58199906.chain_operation)
e1:SetValue(aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE))
Duel.RegisterEffect(e1,tp)
end
function c58199906.filter(c,e)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c58199906.chain_target(e,te,tp)
return Duel.GetMatchingGroup(c58199906.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,nil,te)
end
function c58199906.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
tc:SetMaterial(mat)
Duel.Remove(mat,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
e:Reset()
end
--ゴゴゴゴラム
function c59911557.initial_effect(c)
--pos change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59911557,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c59911557.operation)
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)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(59911557,1))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c59911557.tgcon)
e4:SetTarget(c59911557.tgtg)
e4:SetOperation(c59911557.tgop)
c:RegisterEffect(e4)
end
function c59911557.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE,0,POS_FACEUP_ATTACK,0)
end
end
function c59911557.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c59911557.tgfilter(c)
return c:IsSetCard(0x59) and c:IsAbleToGrave()
end
function c59911557.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_DECK)
end
function c59911557.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c59911557.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
...@@ -12,7 +12,7 @@ function c72403299.initial_effect(c) ...@@ -12,7 +12,7 @@ function c72403299.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c72403299.target(e,tp,eg,ep,ev,re,r,rp,chk) function c72403299.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp) local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac) e:SetLabel(ac)
......
--強化蘇生
function c84298614.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c84298614.target)
e1:SetOperation(c84298614.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c84298614.descon)
e2:SetOperation(c84298614.desop)
c:RegisterEffect(e2)
end
function c84298614.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84298614.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c84298614.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c84298614.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c84298614.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c84298614.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(100)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_UPDATE_LEVEL)
e3:SetValue(1)
tc:RegisterEffect(e3)
end
end
function c84298614.descon(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 c84298614.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--ドドドドライバー
function c85310252.initial_effect(c)
--lv change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c85310252.spcon)
e1:SetOperation(c85310252.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85310252,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(2)
e2:SetCondition(c85310252.condition)
e2:SetTarget(c85310252.target)
e2:SetOperation(c85310252.operation)
c:RegisterEffect(e2)
end
function c85310252.spcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x82)
end
function c85310252.spop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(85310252,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c85310252.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(85310252)>0
end
function c85310252.filter(c)
return c:IsFaceup() and c:IsSetCard(0x82) and c:IsLevelAbove(1)
end
function c85310252.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c85310252.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c85310252.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c85310252.filter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
local op=0
if tc:GetLevel()==1 then op=Duel.SelectOption(tp,aux.Stringid(85310252,1))
else op=Duel.SelectOption(tp,aux.Stringid(85310252,1),aux.Stringid(85310252,2)) end
e:SetLabel(op)
end
function c85310252.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1fe0000)
if e:GetLabel()==0 then
e1:SetValue(1)
else e1:SetValue(-1) end
tc:RegisterEffect(e1)
end
end
--SNo.39 希望皇ホープONE
function c86532744.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),4),3,c86532744.ovfilter,aux.Stringid(86532744,1))
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetDescription(aux.Stringid(86532744,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c86532744.condition)
e1:SetCost(c86532744.cost)
e1:SetTarget(c86532744.target)
e1:SetOperation(c86532744.operation)
c:RegisterEffect(e1)
end
function c86532744.ovfilter(c)
return c:IsFaceup() and c:IsCode(84013237)
end
function c86532744.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-3000
end
function c86532744.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>10 and e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST)
Duel.PayLPCost(tp,Duel.GetLP(tp)-10)
end
function c86532744.filter(c)
return c:IsDestructable() and c:IsAbleToRemove()
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c86532744.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c86532744.filter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c86532744.filter,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(c86532744.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,sg:GetCount()*300)
end
function c86532744.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c86532744.filter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_REMOVED)
if ct>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,ct*300,REASON_EFFECT)
end
end
...@@ -69,7 +69,7 @@ function c94933468.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +69,7 @@ function c94933468.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
function c94933468.deckcon(e,tp,eg,ep,ev,re,r,rp) function c94933468.deckcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and e:GetHandler():GetCardTarget()~=nil return tp~=Duel.GetTurnPlayer() and e:GetHandler():GetFirstCardTarget()~=nil
end end
function c94933468.decktg(e,tp,eg,ep,ev,re,r,rp,chk) function c94933468.decktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -50,7 +50,7 @@ function c96594609.tgfilter(c) ...@@ -50,7 +50,7 @@ function c96594609.tgfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGrave() return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGrave()
end end
function c96594609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c96594609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c96594609.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function c96594609.tgop(e,tp,eg,ep,ev,re,r,rp) function c96594609.tgop(e,tp,eg,ep,ev,re,r,rp)
......
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