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

fix & new scripts

parent 380b5992
...@@ -462,7 +462,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -462,7 +462,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
deckManager.current_deck.side.insert(deckManager.current_deck.side.begin() + hovered_seq, draging_pointer); deckManager.current_deck.side.insert(deckManager.current_deck.side.begin() + hovered_seq, draging_pointer);
else deckManager.current_deck.side.push_back(draging_pointer); else deckManager.current_deck.side.push_back(draging_pointer);
is_draging = false; is_draging = false;
} } else if (hovered_pos == 4)
is_draging = false;
} else { } else {
if((hovered_pos == 1 && (draging_pointer->second.type & 0x802040)) || (hovered_pos == 2 && !(draging_pointer->second.type & 0x802040)) || hovered_pos == 4) if((hovered_pos == 1 && (draging_pointer->second.type & 0x802040)) || (hovered_pos == 2 && !(draging_pointer->second.type & 0x802040)) || hovered_pos == 4)
hovered_pos = 0; hovered_pos = 0;
......
...@@ -1411,10 +1411,6 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe ...@@ -1411,10 +1411,6 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
effect_set eset; effect_set eset;
filter_effect(EFFECT_SUMMON_COST, &eset); filter_effect(EFFECT_SUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
...@@ -1508,10 +1504,6 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) { ...@@ -1508,10 +1504,6 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) {
effect_set eset; effect_set eset;
filter_effect(EFFECT_FLIPSUMMON_COST, &eset); filter_effect(EFFECT_FLIPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
...@@ -1536,10 +1528,6 @@ int32 card::is_special_summonable(uint8 playerid) { ...@@ -1536,10 +1528,6 @@ int32 card::is_special_summonable(uint8 playerid) {
effect_set eset; effect_set eset;
filter_effect(EFFECT_SPSUMMON_COST, &eset); filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
...@@ -1572,10 +1560,6 @@ int32 card::is_can_be_special_summoned(effect * reason_effect, uint32 sumtype, u ...@@ -1572,10 +1560,6 @@ int32 card::is_can_be_special_summoned(effect * reason_effect, uint32 sumtype, u
effect_set eset; effect_set eset;
filter_effect(EFFECT_SPSUMMON_COST, &eset); filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT); pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
...@@ -1624,10 +1608,6 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect ...@@ -1624,10 +1608,6 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
effect_set eset; effect_set eset;
filter_effect(EFFECT_MSET_COST, &eset); filter_effect(EFFECT_MSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
...@@ -1660,10 +1640,6 @@ int32 card::is_setable_szone(uint8 playerid) { ...@@ -1660,10 +1640,6 @@ int32 card::is_setable_szone(uint8 playerid) {
effect_set eset; effect_set eset;
filter_effect(EFFECT_SSET_COST, &eset); filter_effect(EFFECT_SSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
...@@ -1890,13 +1866,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) { ...@@ -1890,13 +1866,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) {
return FALSE; return FALSE;
pduel->game_field->save_lp_cost(); pduel->game_field->save_lp_cost();
effect_set eset; effect_set eset;
pduel->game_field->filter_player_effect(playerid, EFFECT_ATTACK_COST, &eset); pduel->game_field->filter_player_effect(playerid, EFFECT_ATTACK_COST, &eset, FALSE);
filter_effect(EFFECT_ATTACK_COST, &eset); filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_CARD); pduel->lua->add_param(this, PARAM_TYPE_CARD);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
......
...@@ -205,10 +205,6 @@ int32 effect::is_action_check(uint8 playerid) { ...@@ -205,10 +205,6 @@ int32 effect::is_action_check(uint8 playerid) {
eset.clear(); eset.clear();
pduel->game_field->filter_player_effect(playerid, EFFECT_ACTIVATE_COST, &eset); pduel->game_field->filter_player_effect(playerid, EFFECT_ACTIVATE_COST, &eset);
for(int i = 0; i < eset.count; ++i) { for(int i = 0; i < eset.count; ++i) {
pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_EFFECT); pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
......
...@@ -1175,10 +1175,13 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) { ...@@ -1175,10 +1175,13 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel; duel* pduel = pcard->pduel;
int32 ac = 2;
if(lua_gettop(L) > 1)
ac = lua_tointeger(L, 2);
card* attacker = pduel->game_field->core.attacker; card* attacker = pduel->game_field->core.attacker;
if(attacker->is_status(STATUS_BATTLE_DESTROYED) || attacker->fieldid != pduel->game_field->core.pre_field[0] if(attacker->is_status(STATUS_BATTLE_DESTROYED) || attacker->fieldid != pduel->game_field->core.pre_field[0]
|| !attacker->is_capable_attack_announce(pduel->game_field->infos.turn_player) || !attacker->is_capable_attack_announce(pduel->game_field->infos.turn_player)
|| attacker->announce_count > 1) { || attacker->announce_count >= ac) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
......
...@@ -581,8 +581,14 @@ int32 scriptlib::duel_confirm_decktop(lua_State *L) { ...@@ -581,8 +581,14 @@ int32 scriptlib::duel_confirm_decktop(lua_State *L) {
return 0; return 0;
uint32 count = lua_tointeger(L, 2); uint32 count = lua_tointeger(L, 2);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
if(count > pduel->game_field->player[playerid].list_main.size()) if(count >= pduel->game_field->player[playerid].list_main.size())
count = pduel->game_field->player[playerid].list_main.size(); count = pduel->game_field->player[playerid].list_main.size();
else if(pduel->game_field->core.deck_reversed) {
pduel->write_buffer8(MSG_DECK_TOP);
pduel->write_buffer8(playerid);
pduel->write_buffer8(count);
pduel->write_buffer32((*(pduel->game_field->player[playerid].list_main.rbegin() + count))->data.code);
}
auto cit = pduel->game_field->player[playerid].list_main.rbegin(); auto cit = pduel->game_field->player[playerid].list_main.rbegin();
pduel->write_buffer8(MSG_CONFIRM_DECKTOP); pduel->write_buffer8(MSG_CONFIRM_DECKTOP);
pduel->write_buffer8(playerid); pduel->write_buffer8(playerid);
......
...@@ -946,11 +946,12 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -946,11 +946,12 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SUMMON_COST, &eset); target->filter_effect(EFFECT_SUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT); pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
} }
...@@ -1234,11 +1235,12 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) { ...@@ -1234,11 +1235,12 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_FLIPSUMMON_COST, &eset); target->filter_effect(EFFECT_FLIPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT); pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
} }
...@@ -1314,11 +1316,12 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1314,11 +1316,12 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_MSET_COST, &eset); target->filter_effect(EFFECT_MSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(setplayer, PARAM_TYPE_INT); pduel->lua->add_param(setplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0);
} }
...@@ -1496,11 +1499,12 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { ...@@ -1496,11 +1499,12 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SSET_COST, &eset); target->filter_effect(EFFECT_SSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(setplayer, PARAM_TYPE_INT); pduel->lua->add_param(setplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0);
} }
...@@ -1545,11 +1549,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -1545,11 +1549,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SPSUMMON_COST, &eset); target->filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT); pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
} }
...@@ -1743,11 +1748,12 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) { ...@@ -1743,11 +1748,12 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
eset.clear(); eset.clear();
target->filter_effect(EFFECT_SPSUMMON_COST, &eset); target->filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(target->summon_player, PARAM_TYPE_INT); pduel->lua->add_param(target->summon_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, target->summon_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, target->summon_player, 0);
} }
......
...@@ -2444,11 +2444,12 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2444,11 +2444,12 @@ int32 field::process_battle_command(uint16 step) {
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE); filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset); core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD); pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT); pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.attack_cancelable = FALSE; core.attack_cancelable = FALSE;
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0);
...@@ -3246,8 +3247,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3246,8 +3247,7 @@ int32 field::process_battle_command(uint16 step) {
adjust_all(); adjust_all();
if(core.chain_attack) { if(core.chain_attack) {
if(core.attacker->is_status(STATUS_BATTLE_DESTROYED) || core.attacker->fieldid != core.pre_field[0] if(core.attacker->is_status(STATUS_BATTLE_DESTROYED) || core.attacker->fieldid != core.pre_field[0]
|| !core.attacker->is_capable_attack_announce(infos.turn_player) || !core.attacker->is_capable_attack_announce(infos.turn_player))
|| core.attacker->announce_count > 1)
return FALSE; return FALSE;
if(core.chain_attack_target) { if(core.chain_attack_target) {
if(!core.chain_attack_target->is_capable_be_battle_target(core.attacker) if(!core.chain_attack_target->is_capable_be_battle_target(core.attacker)
...@@ -3263,11 +3263,12 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3263,11 +3263,12 @@ int32 field::process_battle_command(uint16 step) {
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE); filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset); core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD); pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT); pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0);
} }
...@@ -3545,11 +3546,12 @@ int32 field::add_chain(uint16 step) { ...@@ -3545,11 +3546,12 @@ int32 field::add_chain(uint16 step) {
effect_set eset; effect_set eset;
filter_player_effect(clit->triggering_player, EFFECT_ACTIVATE_COST, &eset); filter_player_effect(clit->triggering_player, EFFECT_ACTIVATE_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT); pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT); pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->cost) { if(eset[i]->operation) {
core.sub_solving_event.push_back(clit->evt); core.sub_solving_event.push_back(clit->evt);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, clit->triggering_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, clit->triggering_player, 0);
} }
......
...@@ -25,18 +25,18 @@ function c102380.initial_effect(c) ...@@ -25,18 +25,18 @@ function c102380.initial_effect(c)
e2:SetTarget(c102380.damtg) e2:SetTarget(c102380.damtg)
e2:SetOperation(c102380.damop) e2:SetOperation(c102380.damop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--cannot normal summon --spsummon cost
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c102380.op2) e3:SetCost(c102380.spcost)
e3:SetOperation(c102380.spcop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c102380.spcon(e,c) function c102380.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local p=c:GetControler() return Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,2,nil)
return not Duel.CheckNormalSummonActivity(p) and Duel.IsExistingMatchingCard(Card.IsReleaseable,p,0,LOCATION_MZONE,2,nil)
end end
function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c) function c102380.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
...@@ -53,17 +53,19 @@ end ...@@ -53,17 +53,19 @@ end
function c102380.damop(e,tp,eg,ep,ev,re,r,rp) function c102380.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(e:GetHandler():GetControler(),1000,REASON_EFFECT) Duel.Damage(e:GetHandler():GetControler(),1000,REASON_EFFECT)
end end
function c102380.op2(e,tp,eg,ep,ev,re,r,rp) function c102380.spcost(e,c,tp)
return not Duel.CheckNormalSummonActivity(tp)
end
function c102380.spcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local sp=c:GetSummonPlayer()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+RESET_END) e1:SetReset(RESET_PHASE+RESET_END)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,sp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone(e1) local e2=e1:Clone(e1)
e2:SetCode(EFFECT_CANNOT_MSET) e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,sp) Duel.RegisterEffect(e2,tp)
end end
--クイック·スパナイト
function c11287364.initial_effect(c)
--atk change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11287364,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c11287364.atkcon)
e1:SetTarget(c11287364.atktg)
e1:SetOperation(c11287364.atkop)
c:RegisterEffect(e1)
end
function c11287364.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c11287364.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) 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 c11287364.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-500)
tc:RegisterEffect(e1)
end
end
...@@ -20,6 +20,7 @@ function c13093792.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -20,6 +20,7 @@ function c13093792.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:GetType()==TYPE_SPELL then if tc:GetType()==TYPE_SPELL then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
local ae=tc:GetActivateEffect() local ae=tc:GetActivateEffect()
if tc:GetLocation()==LOCATION_GRAVE and ae then if tc:GetLocation()==LOCATION_GRAVE and ae then
......
--吸血コアラ
function c1371589.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1371589,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c1371589.condition)
e1:SetTarget(c1371589.target)
e1:SetOperation(c1371589.operation)
c:RegisterEffect(e1)
end
function c1371589.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c1371589.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,ev)
end
function c1371589.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--サムライソード·バロン
function c14344682.initial_effect(c)
--pos change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14344682,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c14344682.target)
e1:SetOperation(c14344682.operation)
c:RegisterEffect(e1)
end
function c14344682.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 chkc:IsDefence() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefence,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEFENCE)
local g=Duel.SelectTarget(tp,Card.IsDefence,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c14344682.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsDefence() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
...@@ -13,7 +13,6 @@ function c16762927.initial_effect(c) ...@@ -13,7 +13,6 @@ function c16762927.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetCost(c16762927.atcost) e2:SetCost(c16762927.atcost)
e2:SetValue(1)
e2:SetOperation(c16762927.atop) e2:SetOperation(c16762927.atop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--accumulate --accumulate
......
--灰塵王 アッシュ·ガッシュ
function c19012345.initial_effect(c)
--lvup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19012345,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c19012345.condition)
e1:SetOperation(c19012345.operation)
c:RegisterEffect(e1)
end
function c19012345.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetLevel()<12
end
function c19012345.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
--奇跡の残照
function c21636650.initial_effect(c)
--spsummon
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:SetHintTiming(0,0x1e0)
e1:SetTarget(c21636650.sptg)
e1:SetOperation(c21636650.spop)
c:RegisterEffect(e1)
end
function c21636650.filter(c,e,tp,tid)
return c:GetTurnID()==tid and bit.band(c:GetReason(),REASON_BATTLE)~=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21636650.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tid=Duel.GetTurnCount()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c21636650.filter(chkc,e,tp,tid) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c21636650.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,tid) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21636650.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,tid)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c21636650.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)
end
end
--ラピッド·ウォリアー
function c255998.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(255998,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c255998.condition)
e1:SetCost(c255998.cost)
e1:SetOperation(c255998.operation)
c:RegisterEffect(e1)
end
function c255998.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnCount()~=1
and not e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK)
end
function c255998.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c255998.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c255998.ftarget)
e1:SetLabel(e:GetHandler():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c255998.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--アタック·ゲイナー
function c31175914.initial_effect(c)
--atk change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31175914,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c31175914.atkcon)
e1:SetTarget(c31175914.atktg)
e1:SetOperation(c31175914.atkop)
c:RegisterEffect(e1)
end
function c31175914.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c31175914.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) 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 c31175914.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
end
end
--エクストラ·ヴェーラー
function c32391566.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32391566,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c32391566.spcon)
e1:SetTarget(c32391566.sptg)
e1:SetOperation(c32391566.spop)
c:RegisterEffect(e1)
end
function c32391566.cfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function c32391566.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c32391566.cfilter,1,nil,1-tp)
end
function c32391566.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c32391566.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(c32391566.val)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c32391566.val(e,re,ev,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0
end
--サイバー·ラーバァ
function c35050257.initial_effect(c)
--avoid battle damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35050257,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetOperation(c35050257.op1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35050257,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCondition(c35050257.condition)
e2:SetTarget(c35050257.target)
e2:SetOperation(c35050257.operation)
c:RegisterEffect(e2)
end
function c35050257.op1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c35050257.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c35050257.filter(c,e,tp)
return c:IsCode(35050257) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c35050257.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c35050257.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c35050257.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local tc=Duel.GetFirstMatchingCard(c35050257.filter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -14,7 +14,6 @@ function c38318146.initial_effect(c) ...@@ -14,7 +14,6 @@ function c38318146.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetCost(c38318146.accost) e2:SetCost(c38318146.accost)
e2:SetValue(c38318146.acval)
e2:SetOperation(c38318146.acop) e2:SetOperation(c38318146.acop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -28,10 +27,8 @@ function c38318146.acfilter(c) ...@@ -28,10 +27,8 @@ function c38318146.acfilter(c)
end end
function c38318146.accost(e,te,tp) function c38318146.accost(e,te,tp)
c38318146[0]=false c38318146[0]=false
return Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil)
end
function c38318146.acval(e,te,tp)
return te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE) return te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil)
end end
function c38318146.acop(e,tp,eg,ep,ev,re,r,rp) function c38318146.acop(e,tp,eg,ep,ev,re,r,rp)
if c38318146[0] then return end if c38318146[0] then return end
......
--スパウン·アリゲーター
function c39984786.initial_effect(c)
--tribute check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(c39984786.valcheck)
c:RegisterEffect(e1)
end
function c39984786.valcheck(e,c)
local g=c:GetMaterial()
local tc=g:GetFirst()
local sp=false
while tc do
if tc:IsRace(RACE_REPTILE) then
tc:RegisterFlagEffect(39984786,RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_END,0,1)
sp=true
end
tc=g:GetNext()
end
if sp then
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39984786,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_REPEAT)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c39984786.sptg)
e1:SetOperation(c39984786.spop)
e1:SetReset(RESET_EVENT+0xfc0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c39984786.filter(c,e,tp)
return c:GetFlagEffect(39984786)~=0 and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c39984786.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetHandler():GetMaterial():IsContains(chkc) and c39984786.filter(chkc,e,tp) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local mg=e:GetHandler():GetMaterial()
local g=mg:FilterSelect(tp,c39984786.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c39984786.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)
end
end
--エレクトロ軍曹
function c43359262.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43359262,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c43359262.target)
e1:SetOperation(c43359262.operation)
c:RegisterEffect(e1)
end
function c43359262.filter(c,rc)
return c:IsFacedown() and c:GetSequence()~=5 and not rc:IsHasCardTarget(c)
end
function c43359262.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and c43359262.filter(chkc,e:GetHandler()) end
if chk==0 then return Duel.IsExistingTarget(c43359262.filter,tp,0,LOCATION_SZONE,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,515)
Duel.SelectTarget(tp,c43359262.filter,tp,0,LOCATION_SZONE,1,1,nil,e:GetHandler())
end
function c43359262.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFacedown() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCondition(c43359262.rcon)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
function c43359262.rcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
--ライオ·アリゲーター
function c4611269.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c4611269.condition)
e1:SetTarget(c4611269.target)
c:RegisterEffect(e1)
end
function c4611269.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_REPTILE)
end
function c4611269.condition(e)
return Duel.IsExistingMatchingCard(c4611269.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c4611269.target(e,c)
return c:IsRace(RACE_REPTILE)
end
--ダニポン
function c48588176.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48588176,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c48588176.condition)
e1:SetTarget(c48588176.target)
e1:SetOperation(c48588176.operation)
c:RegisterEffect(e1)
end
function c48588176.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c48588176.filter(c)
return c:IsDefenceBelow(1000) and c:IsRace(RACE_INSECT) and c:IsAbleToHand()
end
function c48588176.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48588176.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c48588176.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c48588176.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ヘル·セキュリティ
function c50732780.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50732780,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c50732780.condition)
e1:SetTarget(c50732780.target)
e1:SetOperation(c50732780.operation)
c:RegisterEffect(e1)
end
function c50732780.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c50732780.filter(c,e,tp)
return c:IsRace(RACE_FIEND) and c:GetLevel()==1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50732780.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c50732780.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,c50732780.filter,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 c5609226.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c5609226.target)
e1:SetOperation(c5609226.activate)
c:RegisterEffect(e1)
end
function c5609226.filter(c)
return c:IsFaceup() and c:IsType(TYPE_TUNER)
end
function c5609226.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c5609226.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c5609226.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c5609226.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c5609226.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e2)
end
end
...@@ -14,7 +14,6 @@ function c58054262.initial_effect(c) ...@@ -14,7 +14,6 @@ function c58054262.initial_effect(c)
e2:SetCode(EFFECT_ATTACK_COST) e2:SetCode(EFFECT_ATTACK_COST)
e2:SetCost(c58054262.atcost) e2:SetCost(c58054262.atcost)
e2:SetOperation(c58054262.atop) e2:SetOperation(c58054262.atop)
e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon --special summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
......
...@@ -34,25 +34,23 @@ function c63014935.initial_effect(c) ...@@ -34,25 +34,23 @@ function c63014935.initial_effect(c)
e3:SetTarget(c63014935.phtg) e3:SetTarget(c63014935.phtg)
e3:SetOperation(c63014935.phop) e3:SetOperation(c63014935.phop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--cannot normal summon --spsummon cost
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EFFECT_SPSUMMON_COST)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetOperation(c63014935.op2) e4:SetCost(c63014935.spcost)
e4:SetOperation(c63014935.spcop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c63014935.spcon(e,c) function c63014935.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local p=c:GetControler() return Duel.IsExistingMatchingCard(Card.IsReleaseable,c:GetControler(),0,LOCATION_MZONE,1,nil)
return not Duel.CheckNormalSummonActivity(p)
and Duel.IsExistingMatchingCard(Card.IsReleaseable,p,0,LOCATION_MZONE,1,nil)
end end
function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c) function c63014935.spop(e,tp,eg,ep,ev,re,r,rp,c)
local p=c:GetControler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(p,Card.IsReleaseable,p,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsReleaseable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Release(g, REASON_COST) Duel.Release(g,REASON_COST)
end end
function c63014935.damcost(e,tp,eg,ep,ev,re,r,rp,chk) function c63014935.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
...@@ -70,19 +68,6 @@ function c63014935.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,19 +68,6 @@ function c63014935.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
function c63014935.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+RESET_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,ep)
local e2=e1:Clone(e1)
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,ep)
end
function c63014935.phcon(e,tp,eg,ep,ev,re,r,rp) function c63014935.phcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
...@@ -95,3 +80,19 @@ function c63014935.phop(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,3 +80,19 @@ function c63014935.phop(e,tp,eg,ep,ev,re,r,rp)
Duel.Release(Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,e:GetHandler()),REASON_EFFECT) Duel.Release(Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,e:GetHandler()),REASON_EFFECT)
else Duel.Damage(tp,1000,REASON_EFFECT) end else Duel.Damage(tp,1000,REASON_EFFECT) end
end end
function c63014935.spcost(e,c,tp)
return not Duel.CheckNormalSummonActivity(tp)
end
function c63014935.spcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+RESET_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone(e1)
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
--トランスフォーム·スフィア
function c66094973.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66094973,0))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c66094973.eqcon)
e1:SetTarget(c66094973.eqtg)
e1:SetOperation(c66094973.eqop)
c:RegisterEffect(e1)
--to defence
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c66094973.poscon)
e2:SetOperation(c66094973.posop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(66094973,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_REPEAT)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c66094973.spcon)
e3:SetTarget(c66094973.sptg)
e3:SetOperation(c66094973.spop)
e3:SetLabelObject(e1)
c:RegisterEffect(e3)
end
function c66094973.eqcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(66094973)
end
function c66094973.filter(c)
return c:IsPosition(POS_FACEUP_DEFENCE) and c:IsAbleToChangeControler()
end
function c66094973.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c66094973.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetFieldGroup(tp,LOCATION_HAND,0)~=0
and Duel.IsExistingTarget(c66094973.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c66094973.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c66094973.eqlimit(e,c)
return e:GetOwner()==c
end
function c66094973.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroup(tp,LOCATION_HAND,0)==0 then return end
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
e:SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c66094973.eqlimit)
tc:RegisterEffect(e1)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(66094973)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
end
function c66094973.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetAttackedCount()>0
end
function c66094973.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttack() then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
function c66094973.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsHasEffect(66094973)
end
function c66094973.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject():GetLabelObject()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end
function c66094973.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE)==0 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
...@@ -19,7 +19,7 @@ function c70046172.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -19,7 +19,7 @@ function c70046172.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end end
function c70046172.activate(e,tp,eg,ep,ev,re,r,rp) function c70046172.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
--星蝕-レベル·クライム-
function c70391588.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_SPSUMMON_SUCCESS)
e1:SetTarget(c70391588.target)
e1:SetOperation(c70391588.activate)
c:RegisterEffect(e1)
end
function c70391588.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
and Duel.IsPlayerCanSpecialSummonMonster(tp,70391589,0,0x4011,0,0,c:GetLevel(),RACE_SPELLCASTER,ATTRIBUTE_DARK)
end
function c70391588.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c70391588.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c70391588.filter,1,nil,e,tp) end
local g=eg:FilterSelect(tp,c70391588.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c70391588.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local tc=Duel.GetFirstTarget()
local lv=1
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
lv=tc:GetLevel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,70391589,0,0x4011,0,0,lv,RACE_SPELLCASTER,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,70391589)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(lv)
e2:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
--レスキュー·ウォリアー
function c70630741.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(70630741,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCondition(c70630741.condition)
e2:SetTarget(c70630741.target)
e2:SetOperation(c70630741.operation)
c:RegisterEffect(e2)
end
function c70630741.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
end
function c70630741.filter(c,tp)
return c:IsFaceup() and c:GetOwner()==tp and c:IsControlerCanBeChanged()
end
function c70630741.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 c70630741.filter(chkc,tp) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c70630741.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c70630741.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--コアラッコアラ
function c7243511.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,87685879,71759912,true,true)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7243511,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c7243511.cost)
e1:SetTarget(c7243511.target)
e1:SetOperation(c7243511.operation)
c:RegisterEffect(e1)
end
c7243511.material_count=2
c7243511.material={87685879,71759912}
function c7243511.cfilter(c)
return c:IsRace(RACE_BEAST) and c:IsAbleToGraveAsCost()
end
function c7243511.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c7243511.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cg=Duel.SelectMatchingCard(tp,c7243511.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(cg,REASON_COST)
end
function c7243511.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 chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c7243511.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ドラゴニック·タクティクス
function c72549351.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:SetCost(c72549351.cost)
e1:SetTarget(c72549351.target)
e1:SetOperation(c72549351.activate)
c:RegisterEffect(e1)
end
function c72549351.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c72549351.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:GetLevel()==8 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72549351.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingMatchingCard(c72549351.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,Card.IsRace,2,nil,RACE_DRAGON)
end
if e:GetLabel()~=0 then
local rg=Duel.SelectReleaseGroup(tp,Card.IsRace,2,2,nil,RACE_DRAGON)
Duel.Release(rg,REASON_COST)
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c72549351.activate(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,c72549351.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 c73048641.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c73048641.condition)
e1:SetTarget(c73048641.target)
e1:SetOperation(c73048641.activate)
c:RegisterEffect(e1)
end
function c73048641.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c73048641.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c73048641.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(atk/2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e2:SetValue(1)
tc:RegisterEffect(e2)
end
end
--モロコシーナ
function c74983881.initial_effect(c)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74983881,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c74983881.spcon)
e1:SetCost(c74983881.spcost)
e1:SetTarget(c74983881.sptg)
e1:SetOperation(c74983881.spop)
c:RegisterEffect(e1)
end
function c74983881.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c74983881.spcost(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 c74983881.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsPlayerCanSpecialSummonMonster(tp,74983882,0,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c74983881.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,74983882,0,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then return end
local token=Duel.CreateToken(tp,74983882)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
--ポセイドン·オオカブト
function c75292259.initial_effect(c)
--chain attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c75292259.atcon)
e1:SetOperation(c75292259.atop)
c:RegisterEffect(e1)
end
function c75292259.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c==Duel.GetAttacker() and bc:IsRelateToBattle()
and bc:GetBattlePosition()==POS_FACEUP_ATTACK and c:IsChainAttackable(3)
end
function c75292259.atop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(75292259,0)) then
Duel.ChainAttack(e:GetHandler():GetBattleTarget())
end
end
...@@ -11,12 +11,13 @@ function c75732622.initial_effect(c) ...@@ -11,12 +11,13 @@ function c75732622.initial_effect(c)
e1:SetCondition(c75732622.spcon) e1:SetCondition(c75732622.spcon)
e1:SetOperation(c75732622.spop) e1:SetOperation(c75732622.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot normal summon --spsummon cost
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EFFECT_SPSUMMON_COST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c75732622.op2) e2:SetCost(c75732622.spcost)
e2:SetOperation(c75732622.spcop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c75732622.spcon(e,c) function c75732622.spcon(e,c)
...@@ -32,17 +33,19 @@ function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -32,17 +33,19 @@ function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c)
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
function c75732622.op2(e,tp,eg,ep,ev,re,r,rp) function c75732622.spcost(e,c,tp)
return not Duel.CheckNormalSummonActivity(tp)
end
function c75732622.spcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local sp=c:GetSummonPlayer()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+RESET_END) e1:SetReset(RESET_PHASE+RESET_END)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,sp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone(e1) local e2=e1:Clone(e1)
e2:SetCode(EFFECT_CANNOT_MSET) e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,sp) Duel.RegisterEffect(e2,tp)
end end
...@@ -27,7 +27,7 @@ function c77841719.filter(c) ...@@ -27,7 +27,7 @@ function c77841719.filter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged() return c:IsFaceup() and c:IsControlerCanBeChanged()
end end
function c77841719.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c77841719.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c77841719.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c77841719.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c77841719.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c77841719.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c77841719.filter,tp,0,LOCATION_MZONE,1,1,nil)
......
...@@ -13,7 +13,6 @@ function c79323590.initial_effect(c) ...@@ -13,7 +13,6 @@ function c79323590.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetCost(c79323590.accost) e2:SetCost(c79323590.accost)
e2:SetValue(c79323590.acval)
e2:SetOperation(c79323590.acop) e2:SetOperation(c79323590.acop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--summon cost --summon cost
...@@ -23,7 +22,6 @@ function c79323590.initial_effect(c) ...@@ -23,7 +22,6 @@ function c79323590.initial_effect(c)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e3:SetCost(c79323590.ccost) e3:SetCost(c79323590.ccost)
e3:SetValue(1)
e3:SetOperation(c79323590.acop) e3:SetOperation(c79323590.acop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e3:Clone()
...@@ -38,14 +36,11 @@ function c79323590.initial_effect(c) ...@@ -38,14 +36,11 @@ function c79323590.initial_effect(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c79323590.accost(e,te,tp) function c79323590.accost(e,te,tp)
return Duel.CheckLPCost(tp,500) return te:GetHandler():IsLocation(LOCATION_HAND) and Duel.CheckLPCost(tp,500)
end end
function c79323590.ccost(e,c,tp) function c79323590.ccost(e,c,tp)
return Duel.CheckLPCost(tp,500) return Duel.CheckLPCost(tp,500)
end end
function c79323590.acval(e,te,tp)
return te:GetHandler():GetLocation()==LOCATION_HAND
end
function c79323590.acop(e,tp,eg,ep,ev,re,r,rp) function c79323590.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500) Duel.PayLPCost(tp,500)
end end
--ガントレット·ウォリアー
function c79337169.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79337169,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c79337169.condition)
e1:SetCost(c79337169.cost)
e1:SetTarget(c79337169.target)
e1:SetOperation(c79337169.operation)
c:RegisterEffect(e1)
end
function c79337169.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c79337169.cost(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 c79337169.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c79337169.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79337169.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
end
function c79337169.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79337169.filter,tp,LOCATION_MZONE,0,e:GetHandler())
local tc=g:GetFirst()
local c=e:GetHandler()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetOperation(c79337169.resetop)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetLabelObject(e2)
tc:RegisterEffect(e3)
tc=g:GetNext()
end
end
function c79337169.resetop(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
local e2=e1:GetLabelObject()
e1:Reset()
e2:Reset()
e:Reset()
end
--シンクロ·ガンナー
function c79796561.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79796561,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c79796561.target)
e1:SetOperation(c79796561.operation)
c:RegisterEffect(e1)
end
function c79796561.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove()
end
function c79796561.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c79796561.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c79796561.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c79796561.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600)
end
function c79796561.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetOperation(c79796561.retop)
Duel.RegisterEffect(e1,tp)
Duel.Damage(1-tp,600,REASON_EFFECT)
end
end
function c79796561.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetLabelObject())
end
end
...@@ -47,7 +47,8 @@ function c80921533.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -47,7 +47,8 @@ function c80921533.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ac=0 local ac=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(80921533,3)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(80921533,3))
if mi==ma then ac=Duel.AnnounceNumber(tp,mi*1000) if mi==ma then ac=Duel.AnnounceNumber(tp,mi*1000)
else ac=Duel.AnnounceNumber(tp,1000,2000) end elseif ma>=2 and Duel.CheckLPCost(tp,2000) then ac=Duel.AnnounceNumber(tp,1000,2000)
else ac=Duel.AnnounceNumber(tp,1000) end
Duel.PayLPCost(tp,ac) Duel.PayLPCost(tp,ac)
e:SetLabel(ac/1000) e:SetLabel(ac/1000)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
......
...@@ -13,7 +13,6 @@ function c82003859.initial_effect(c) ...@@ -13,7 +13,6 @@ function c82003859.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetCost(c82003859.atcost) e2:SetCost(c82003859.atcost)
e2:SetValue(1)
e2:SetOperation(c82003859.atop) e2:SetOperation(c82003859.atop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
......
...@@ -6,7 +6,6 @@ function c82199284.initial_effect(c) ...@@ -6,7 +6,6 @@ function c82199284.initial_effect(c)
e1:SetCode(EFFECT_ATTACK_COST) e1:SetCode(EFFECT_ATTACK_COST)
e1:SetCost(c82199284.atcost) e1:SetCost(c82199284.atcost)
e1:SetOperation(c82199284.atop) e1:SetOperation(c82199284.atop)
e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c82199284.atcost(e,c,tp) function c82199284.atcost(e,c,tp)
......
--バックアップ·ウォリアー
function c95637655.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c95637655.spcon)
c:RegisterEffect(e1)
--spsummon cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_COST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCost(c95637655.spcost)
e2:SetOperation(c95637655.spop)
c:RegisterEffect(e2)
if not c95637655.global_check then
c95637655.global_check=true
c95637655[0]=true
c95637655[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON)
ge1:SetOperation(c95637655.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c95637655.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c95637655.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsType(TYPE_SYNCHRO) then
c95637655[tc:GetControler()]=false
end
end
function c95637655.clear(e,tp,eg,ep,ev,re,r,rp)
c95637655[0]=true
c95637655[1]=true
end
function c95637655.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return c95637655[tp] and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)==2
and not Duel.IsExistingMatchingCard(Card.IsAttack,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c95637655.spcost(e,c,tp)
return c95637655[tp]
end
function c95637655.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c95637655.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95637655.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO
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