Commit 2d0d9709 authored by argon.sun's avatar argon.sun

gaov & new feature

parent 054bf77e
...@@ -28,7 +28,8 @@ ClientCard::ClientCard() { ...@@ -28,7 +28,8 @@ ClientCard::ClientCard() {
defence = 0; defence = 0;
base_attack = 0; base_attack = 0;
base_defence = 0; base_defence = 0;
turnCounter = 0; cHint = 0;
chValue = 0;
atkstring[0] = 0; atkstring[0] = 0;
defstring[0] = 0; defstring[0] = 0;
lvstring[0] = 0; lvstring[0] = 0;
......
...@@ -78,7 +78,8 @@ public: ...@@ -78,7 +78,8 @@ public:
u8 position; u8 position;
u8 is_disabled; u8 is_disabled;
u8 is_public; u8 is_public;
u32 turnCounter; u8 cHint;
u32 chValue;
u32 opParam; u32 opParam;
u32 symbol; u32 symbol;
u32 cmdFlag; u32 cmdFlag;
......
...@@ -25,7 +25,7 @@ mtrandom DuelClient::rnd; ...@@ -25,7 +25,7 @@ mtrandom DuelClient::rnd;
bool DuelClient::is_refreshing = false; bool DuelClient::is_refreshing = false;
std::vector<HostPacket> DuelClient::hosts; std::vector<HostPacket> DuelClient::hosts;
std::set<int> DuelClient::remotes; std::set<unsigned int> DuelClient::remotes;
event* DuelClient::resp_event = 0; event* DuelClient::resp_event = 0;
bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_game) { bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_game) {
...@@ -1564,6 +1564,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1564,6 +1564,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
ClientCard* pcard = mainGame->dField.GetCard(pc, pl, ps); ClientCard* pcard = mainGame->dField.GetCard(pc, pl, ps);
if (code != 0 && pcard->code != code) if (code != 0 && pcard->code != code)
pcard->SetCode(code); pcard->SetCode(code);
pcard->cHint = 0;
pcard->chValue = 0;
if((pl & LOCATION_ONFIELD) && (cl != pl)) if((pl & LOCATION_ONFIELD) && (cl != pl))
pcard->counters.clear(); pcard->counters.clear();
if(cl != pl) if(cl != pl)
...@@ -2366,25 +2368,29 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -2366,25 +2368,29 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
DuelClient::SendResponse(); DuelClient::SendResponse();
return true; return true;
} }
case MSG_COUNT_TURN: { case MSG_CARD_HINT: {
int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l = BufferIO::ReadInt8(pbuf); int l = BufferIO::ReadInt8(pbuf);
int s = BufferIO::ReadInt8(pbuf); int s = BufferIO::ReadInt8(pbuf);
BufferIO::ReadInt8(pbuf); BufferIO::ReadInt8(pbuf);
int ct = BufferIO::ReadInt16(pbuf); int chtype = BufferIO::ReadInt8(pbuf);
int value = BufferIO::ReadInt32(pbuf);
ClientCard* pcard = mainGame->dField.GetCard(c, l, s); ClientCard* pcard = mainGame->dField.GetCard(c, l, s);
pcard->turnCounter = ct; pcard->cHint = chtype;
if(ct == 0) pcard->chValue = value;
return true; if(chtype == CHINT_TURN) {
if(pcard->location & LOCATION_ONFIELD) if(value == 0)
pcard->is_selectable = true; return true;
mainGame->showcardcode = pcard->code; if(pcard->location & LOCATION_ONFIELD)
mainGame->showcarddif = 0; pcard->is_highlighting = true;
mainGame->showcardp = ct - 1; mainGame->showcardcode = pcard->code;
mainGame->showcard = 6; mainGame->showcarddif = 0;
mainGame->WaitFrameSignal(30); mainGame->showcardp = value - 1;
pcard->is_selectable = false; mainGame->showcard = 6;
mainGame->showcard = 0; mainGame->WaitFrameSignal(30);
pcard->is_highlighting = false;
mainGame->showcard = 0;
}
return true; return true;
} }
} }
...@@ -2425,7 +2431,7 @@ void DuelClient::BeginRefreshHost() { ...@@ -2425,7 +2431,7 @@ void DuelClient::BeginRefreshHost() {
return; return;
} }
timeval timeout = {5, 0}; timeval timeout = {5, 0};
resp_event = event_new(broadev, reply, EV_TIMEOUT | EV_READ, BroadcastReply, broadev); resp_event = event_new(broadev, reply, EV_TIMEOUT | EV_READ | EV_PERSIST, BroadcastReply, broadev);
event_add(resp_event, &timeout); event_add(resp_event, &timeout);
Thread::NewThread(RefreshThread, broadev); Thread::NewThread(RefreshThread, broadev);
//send request //send request
...@@ -2441,7 +2447,7 @@ void DuelClient::BeginRefreshHost() { ...@@ -2441,7 +2447,7 @@ void DuelClient::BeginRefreshHost() {
for(int i = 0; i < 8; ++i) { for(int i = 0; i < 8; ++i) {
if(host->h_addr_list[i] == 0) if(host->h_addr_list[i] == 0)
break; break;
int local_addr = *(unsigned int*)host->h_addr_list[i]; unsigned int local_addr = *(unsigned int*)host->h_addr_list[i];
local.sin_addr.s_addr = local_addr; local.sin_addr.s_addr = local_addr;
SOCKET sSend = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); SOCKET sSend = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(sSend == INVALID_SOCKET) if(sSend == INVALID_SOCKET)
...@@ -2474,7 +2480,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void* arg) { ...@@ -2474,7 +2480,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void* arg) {
int sz = sizeof(sockaddr_in); int sz = sizeof(sockaddr_in);
char buf[256]; char buf[256];
int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz); int ret = recvfrom(fd, buf, 256, 0, (sockaddr*)&bc_addr, &sz);
int ipaddr = bc_addr.sin_addr.s_addr; unsigned int ipaddr = bc_addr.sin_addr.s_addr;
HostPacket* pHP = (HostPacket*)buf; HostPacket* pHP = (HostPacket*)buf;
if(pHP->identifier == NETWORK_SERVER_ID && pHP->version == PRO_VERSION && remotes.find(ipaddr) == remotes.end() ) { if(pHP->identifier == NETWORK_SERVER_ID && pHP->version == PRO_VERSION && remotes.find(ipaddr) == remotes.end() ) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
......
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
protected: protected:
static bool is_refreshing; static bool is_refreshing;
static event* resp_event; static event* resp_event;
static std::set<int> remotes; static std::set<unsigned int> remotes;
public: public:
static std::vector<HostPacket> hosts; static std::vector<HostPacket> hosts;
static void BeginRefreshHost(); static void BeginRefreshHost();
......
...@@ -1249,8 +1249,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1249,8 +1249,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer); str.append(formatBuffer);
} }
} }
if(mcard->turnCounter && (mcard->location & LOCATION_ONFIELD)) { if(mcard->cHint && mcard->chValue && (mcard->location & LOCATION_ONFIELD)) {
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(211), mcard->turnCounter); if(mcard->cHint == CHINT_TURN)
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(211), mcard->chValue);
else if(mcard->cHint == CHINT_CARD)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(212), dataManager.GetName(mcard->chValue));
else if(mcard->cHint == CHINT_RACE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(213), dataManager.FormatRace(mcard->chValue));
else if(mcard->cHint == CHINT_ATTRIBUTE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(214), dataManager.FormatAttribute(mcard->chValue));
else if(mcard->cHint == CHINT_NUMBER)
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(215), mcard->chValue);
str.append(formatBuffer); str.append(formatBuffer);
} }
} else { } else {
...@@ -1266,8 +1275,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1266,8 +1275,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer); str.append(formatBuffer);
} }
} }
if(mcard->turnCounter && (mcard->location & LOCATION_ONFIELD)) { if(mcard->cHint && mcard->chValue && (mcard->location & LOCATION_ONFIELD)) {
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(211), mcard->turnCounter); if(mcard->cHint == CHINT_TURN)
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(211), mcard->chValue);
else if(mcard->cHint == CHINT_CARD)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(212), dataManager.GetName(mcard->chValue));
else if(mcard->cHint == CHINT_RACE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(213), dataManager.FormatRace(mcard->chValue));
else if(mcard->cHint == CHINT_ATTRIBUTE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(214), dataManager.FormatAttribute(mcard->chValue));
else if(mcard->cHint == CHINT_NUMBER)
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(215), mcard->chValue);
str.append(formatBuffer); str.append(formatBuffer);
} }
} }
......
...@@ -546,8 +546,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -546,8 +546,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
pbuf += 4 * count; pbuf += 4 * count;
return ReadReplayResponse(); return ReadReplayResponse();
} }
case MSG_COUNT_TURN: { case MSG_CARD_HINT: {
pbuf += 6; pbuf += 9;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
break; break;
} }
......
...@@ -1216,8 +1216,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -1216,8 +1216,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
WaitforResponse(player); WaitforResponse(player);
return 1; return 1;
} }
case MSG_COUNT_TURN: { case MSG_CARD_HINT: {
pbuf += 6; pbuf += 9;
NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[0], STOC_GAME_MSG, offset, pbuf - offset);
NetServer::ReSendToPlayer(players[1]); NetServer::ReSendToPlayer(players[1]);
for(auto oit = observers.begin(); oit != observers.end(); ++oit) for(auto oit = observers.begin(); oit != observers.end(); ++oit)
......
...@@ -968,9 +968,10 @@ uint8 card::refresh_control_status() { ...@@ -968,9 +968,10 @@ uint8 card::refresh_control_status() {
} }
void card::count_turn(uint16 ct) { void card::count_turn(uint16 ct) {
turn_counter = ct; turn_counter = ct;
pduel->write_buffer8(MSG_COUNT_TURN); pduel->write_buffer8(MSG_CARD_HINT);
pduel->write_buffer32(get_info_location()); pduel->write_buffer32(get_info_location());
pduel->write_buffer16(ct); pduel->write_buffer8(CHINT_TURN);
pduel->write_buffer32(ct);
} }
void card::create_relation(card* target, uint32 reset) { void card::create_relation(card* target, uint32 reset) {
if (relations.find(target) != relations.end()) if (relations.find(target) != relations.end())
......
...@@ -623,6 +623,12 @@ public: ...@@ -623,6 +623,12 @@ public:
#define HINT_CODE 8 #define HINT_CODE 8
#define HINT_NUMBER 9 #define HINT_NUMBER 9
#define HINT_CARD 10 #define HINT_CARD 10
//
#define CHINT_TURN 1
#define CHINT_CARD 2
#define CHINT_RACE 3
#define CHINT_ATTRIBUTE 4
#define CHINT_NUMBER 5
//Messages //Messages
#define MSG_RETRY 1 #define MSG_RETRY 1
#define MSG_HINT 2 #define MSG_HINT 2
...@@ -703,5 +709,5 @@ public: ...@@ -703,5 +709,5 @@ public:
#define MSG_ANNOUNCE_ATTRIB 141 #define MSG_ANNOUNCE_ATTRIB 141
#define MSG_ANNOUNCE_CARD 142 #define MSG_ANNOUNCE_CARD 142
#define MSG_ANNOUNCE_NUMBER 143 #define MSG_ANNOUNCE_NUMBER 143
#define MSG_COUNT_TURN 160 #define MSG_CARD_HINT 160
#endif /* FIELD_H_ */ #endif /* FIELD_H_ */
...@@ -181,6 +181,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -181,6 +181,7 @@ static const struct luaL_Reg cardlib[] = {
{ "CancelToGrave", scriptlib::card_cancel_to_grave }, { "CancelToGrave", scriptlib::card_cancel_to_grave },
{ "GetTributeRequirement", scriptlib::card_get_tribute_requirement }, { "GetTributeRequirement", scriptlib::card_get_tribute_requirement },
{ "GetBattleTarget", scriptlib::card_get_battle_target }, { "GetBattleTarget", scriptlib::card_get_battle_target },
{ "SetHint", scriptlib::card_set_hint },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -1685,3 +1685,18 @@ int32 scriptlib::card_get_battle_target(lua_State *L) { ...@@ -1685,3 +1685,18 @@ int32 scriptlib::card_get_battle_target(lua_State *L) {
else lua_pushnil(L); else lua_pushnil(L);
return 1; return 1;
} }
int32 scriptlib::card_set_hint(lua_State *L) {
check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel;
uint32 type = lua_tointeger(L, 2);
uint32 value = lua_tointeger(L, 3);
if(type > CHINT_NUMBER)
return 0;
pduel->write_buffer8(MSG_CARD_HINT);
pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer8(type);
pduel->write_buffer32(value);
return 0;
}
...@@ -183,6 +183,7 @@ public: ...@@ -183,6 +183,7 @@ public:
static int32 card_cancel_to_grave(lua_State *L); static int32 card_cancel_to_grave(lua_State *L);
static int32 card_get_tribute_requirement(lua_State *L); static int32 card_get_tribute_requirement(lua_State *L);
static int32 card_get_battle_target(lua_State *L); static int32 card_get_battle_target(lua_State *L);
static int32 card_set_hint(lua_State *L);
//Effect functions //Effect functions
static int32 effect_new(lua_State *L); static int32 effect_new(lua_State *L);
static int32 effect_clone(lua_State *L); static int32 effect_clone(lua_State *L);
......
--嵐
function c13210191.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c13210191.target)
e1:SetOperation(c13210191.activate)
c:RegisterEffect(e1)
end
function c13210191.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c13210191.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c13210191.filter,tp,LOCATION_ONFIELD,0,1,c) end
local g1=Duel.GetMatchingGroup(c13210191.filter,tp,LOCATION_ONFIELD,0,c)
local g2=Duel.GetMatchingGroup(c13210191.filter,tp,0,LOCATION_ONFIELD,nil)
local ct1=g1:GetCount()
local ct2=g2:GetCount()
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,ct1+((ct1>ct2) and ct2 or ct1),0,0)
end
function c13210191.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c13210191.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local ct1=Duel.Destroy(g1,REASON_EFFECT)
if ct1==0 then return end
local g2=Duel.GetMatchingGroup(c13210191.filter,tp,0,LOCATION_ONFIELD,nil)
if g2:GetCount()<=ct1 then
Duel.Destroy(g2,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g3=g2:Select(tp,ct1,ct1,nil)
Duel.Destroy(g3,REASON_EFFECT)
end
end
--フレア·リゾネーター
function c13708425.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c13708425.atkcon)
e1:SetOperation(c13708425.atkop)
c:RegisterEffect(e1)
end
function c13708425.atkcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function c13708425.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sync=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+0x1fe0000)
sync:RegisterEffect(e1)
end
...@@ -16,6 +16,7 @@ function c15800838.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,6 +16,7 @@ function c15800838.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
e:GetHandler():SetHint(CHINT_CARD,ac)
end end
function c15800838.operation(e,tp,eg,ep,ev,re,r,rp) function c15800838.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel() local ac=e:GetLabel()
......
...@@ -28,6 +28,6 @@ function c16366944.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,6 +28,6 @@ function c16366944.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16366944.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c16366944.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -30,6 +30,7 @@ function c17078030.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,6 +30,7 @@ function c17078030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local announce=Duel.AnnounceNumber(tp,unpack(t)) local announce=Duel.AnnounceNumber(tp,unpack(t))
Duel.PayLPCost(tp,announce) Duel.PayLPCost(tp,announce)
e:GetLabelObject():SetLabel(announce) e:GetLabelObject():SetLabel(announce)
e:GetHandler():SetHint(CHINT_NUMBER,announce)
end end
function c17078030.atktarget(e,c) function c17078030.atktarget(e,c)
return c:GetAttack()<=e:GetLabel() return c:GetAttack()<=e:GetLabel()
......
--下降潮流
function c26099457.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c26099457.target)
e1:SetOperation(c26099457.activate)
c:RegisterEffect(e1)
end
function c26099457.filter(c)
return c:IsFaceup() and not c:IsType(TYPE_XYZ)
end
function c26099457.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c26099457.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26099457.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c26099457.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,567)
local lv=Duel.AnnounceNumber(tp,1,2,3)
e:SetLabel(lv)
end
function c26099457.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_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
...@@ -29,9 +29,9 @@ function c28150174.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -29,9 +29,9 @@ function c28150174.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c28150174.posop(e,tp,eg,ep,ev,re,r,rp) function c28150174.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsDefence() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK) Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
if tc:IsFaceup() then if tc:IsPosition(POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
......
--素早いマンボウ
function c2843014.initial_effect(c)
--battle destroyed
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2843014,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c2843014.condition)
e1:SetTarget(c2843014.target)
e1:SetOperation(c2843014.operation)
c:RegisterEffect(e1)
end
function c2843014.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c2843014.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c2843014.filter1(c)
return c:IsRace(RACE_FISH) and c:IsAbleToGrave()
end
function c2843014.filter2(c,e,tp)
return c:IsCode(2843014) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c2843014.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c2843014.filter1,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
if ft==0 then return end
local tc=Duel.GetFirstMatchingCard(c2843014.filter2,tp,LOCATION_DECK,0,nil,e,tp)
if tc and Duel.SelectYesNo(tp,aux.Stringid(2843014,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--猛突進
function c32854013.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c32854013.target)
e1:SetOperation(c32854013.activate)
c:RegisterEffect(e1)
end
function c32854013.dfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST) and c:IsDestructable()
end
function c32854013.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c32854013.dfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c32854013.dfilter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g2,1,0,0)
end
function c32854013.activate(e)
local tc1=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc2==tc1 then tc2=g:GetNext() end
if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and Duel.Destroy(tc1,REASON_EFFECT)~=0 then
Duel.SendtoDeck(tc2,nil,2,REASON_EFFECT)
end
end
...@@ -15,6 +15,7 @@ function c33423043.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -15,6 +15,7 @@ function c33423043.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
e:GetHandler():SetHint(CHINT_CARD,ac)
end end
function c33423043.operation(e,tp,eg,ep,ev,re,r,rp) function c33423043.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel() local ac=e:GetLabel()
......
...@@ -63,7 +63,7 @@ function c38522377.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,7 +63,7 @@ function c38522377.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1ff0000)
e:GetHandler():RegisterEffect(e1) e:GetHandler():RegisterEffect(e1)
end end
end end
......
--ピューマン
function c38837163.initial_effect(c)
c:EnableReviveLimit()
--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(c38837163.spcon)
e1:SetOperation(c38837163.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(38837163,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c38837163.cost)
e2:SetTarget(c38837163.target)
e2:SetOperation(c38837163.operation)
c:RegisterEffect(e2)
end
function c38837163.spfilter(c)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToRemoveAsCost()
end
function c38837163.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c38837163.spfilter,tp,LOCATION_GRAVE,0,2,nil)
end
function c38837163.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c38837163.spfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c38837163.cfilter(c)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsDiscardable()
end
function c38837163.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c38837163.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c38837163.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c38837163.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local opt=Duel.SelectOption(tp,aux.Stringid(38837163,1),aux.Stringid(38837163,2))
e:SetLabel(opt)
end
function c38837163.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if e:GetLabel()==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()*2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
...@@ -8,10 +8,14 @@ function c41639001.initial_effect(c) ...@@ -8,10 +8,14 @@ function c41639001.initial_effect(c)
e1:SetCode(EVENT_BECOME_TARGET) e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(c41639001.spcon)
e1:SetTarget(c41639001.sptg) e1:SetTarget(c41639001.sptg)
e1:SetOperation(c41639001.spop) e1:SetOperation(c41639001.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c41639001.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c41639001.spfilter(c,e,tp) function c41639001.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not c:IsHasEffect(EFFECT_NECRO_VALLEY) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
......
...@@ -31,8 +31,16 @@ function c45812361.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,8 +31,16 @@ function c45812361.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(45812361)~=0 and Duel.GetCurrentPhase()==PHASE_MAIN1 return e:GetHandler():GetFlagEffect(45812361)~=0 and Duel.GetCurrentPhase()==PHASE_MAIN1
end end
function c45812361.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c45812361.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end if chk==0 then return not Duel.CheckSpecialSummonActivity(tp) and e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
--oath effects
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end end
function c45812361.target(e,tp,eg,ep,ev,re,r,rp,chk) function c45812361.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
......
--バウンサー・ガード
function c48582558.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(c48582558.target)
e1:SetOperation(c48582558.activate)
c:RegisterEffect(e1)
end
function c48582558.filter(c)
return c:IsFaceup() and c:IsSetCard(0x6b)
end
function c48582558.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c48582558.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c48582558.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c48582558.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c48582558.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)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c48582558.atktg)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function c48582558.atktg(e,c)
return c~=e:GetHandler()
end
--奇策
function c49204190.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCost(c49204190.cost)
e1:SetTarget(c49204190.target)
e1:SetOperation(c49204190.activate)
c:RegisterEffect(e1)
end
function c49204190.cfilter(c)
return c:GetAttack()>0 and c:IsDiscardable()
end
function c49204190.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49204190.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c49204190.cfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetAttack())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c49204190.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 c49204190.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_UPDATE_ATTACK)
e1:SetValue(-e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
...@@ -22,6 +22,7 @@ function c56769674.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,6 +22,7 @@ function c56769674.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,562) Duel.Hint(HINT_SELECTMSG,tp,562)
local rc=Duel.AnnounceAttribute(tp,1,0xffff) local rc=Duel.AnnounceAttribute(tp,1,0xffff)
e:GetLabelObject():SetLabel(rc) e:GetLabelObject():SetLabel(rc)
e:GetHandler():SetHint(CHINT_ATTRIBUTE,rc)
end end
function c56769674.value(e,c) function c56769674.value(e,c)
return e:GetLabel() return e:GetLabel()
......
--ダーク砂バク
function c70187958.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70187958,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_REMOVE)
e1:SetTarget(c70187958.target)
e1:SetOperation(c70187958.operation)
c:RegisterEffect(e1)
end
function c70187958.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c70187958.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c70187958.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c70187958.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c70187958.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c70187958.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -21,6 +21,7 @@ function c74701381.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,6 +21,7 @@ function c74701381.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,563) Duel.Hint(HINT_SELECTMSG,tp,563)
local rc=Duel.AnnounceRace(tp,1,0xffffff) local rc=Duel.AnnounceRace(tp,1,0xffffff)
e:GetLabelObject():SetLabel(rc) e:GetLabelObject():SetLabel(rc)
e:GetHandler():SetHint(CHINT_RACE,rc)
end end
function c74701381.value(e,c) function c74701381.value(e,c)
return e:GetLabel() return e:GetLabel()
......
--隷属の鱗粉
function c75987257.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c75987257.condition)
e1:SetTarget(c75987257.target)
e1:SetOperation(c75987257.operation)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75987257,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCategory(CATEGORY_POSITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c75987257.poscon)
e2:SetOperation(c75987257.posop)
c:RegisterEffect(e2)
end
function c75987257.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c75987257.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return tg:IsOnField() and tg:IsDestructable() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
end
function c75987257.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE)
if c:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(c75987257.eqlimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
end
function c75987257.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c75987257.poscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_BATTLE or ph==PHASE_MAIN2) and e:GetHandler():GetEquipTarget()
end
function c75987257.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ec=c:GetEquipTarget()
if ec then
Duel.ChangePosition(ec,POS_FACEUP_DEFENCE,0,POS_FACEUP_ATTACK,0)
end
end
--ファイバーポッド
function c78706415.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetOperation(c78706415.operation)
c:RegisterEffect(e1)
end
function c78706415.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0x1e,0x1e)
if c:IsStatus(STATUS_BATTLE_DESTROYED) then g:RemoveCard(c) end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
Duel.BreakEffect()
Duel.Draw(tp,5,REASON_EFFECT)
Duel.Draw(1-tp,5,REASON_EFFECT)
end
...@@ -13,20 +13,13 @@ function c80651316.evolreg(c) ...@@ -13,20 +13,13 @@ function c80651316.evolreg(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80651316,0)) e2:SetDescription(aux.Stringid(80651316,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c80651316.schcon)
e2:SetTarget(c80651316.schtg) e2:SetTarget(c80651316.schtg)
e2:SetOperation(c80651316.schop) e2:SetOperation(c80651316.schop)
e2:SetReset(RESET_EVENT+0x1ff0000) e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c80651316.schcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:GetReasonCard()==e:GetHandler()
and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
end
function c80651316.sfilter(c) function c80651316.sfilter(c)
return c:IsSetCard(0x304e) and c:IsAbleToHand() return c:IsSetCard(0x304e) and c:IsAbleToHand()
end end
......
--ガムシャラ
function c85709845.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetTarget(c85709845.target)
e1:SetOperation(c85709845.activate)
c:RegisterEffect(e1)
end
function c85709845.target(e,tp,eg,ep,ev,re,r,rp,chk)
local d=Duel.GetAttackTarget()
if chk==0 then return d:IsDefence() and d:IsControler(tp) end
Duel.SetTargetCard(d)
end
function c85709845.activate(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)
local a=Duel.GetAttacker()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetOperation(c85709845.damop)
e1:SetLabel(1-tp)
e1:SetReset(RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e1)
end
end
function c85709845.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
if atk<0 then atk=0 end
if atk>0 then
Duel.Hint(HINT_CARD,tp,99004752)
Duel.Hint(HINT_CARD,1-tp,99004752)
Duel.Damage(e:GetLabel(),atk,REASON_EFFECT)
end
end
--No.15 ギミック・パペット-ジャイアントキラー
function c88120966.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,8),2)
c:EnableReviveLimit()
--attack up
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetDescription(aux.Stringid(88120966,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(2)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c88120966.cost)
e1:SetTarget(c88120966.target)
e1:SetOperation(c88120966.operation)
c:RegisterEffect(e1)
end
function c88120966.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c88120966.filter(c)
return c:IsDestructable() and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c88120966.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 c88120966.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88120966.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c88120966.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c88120966.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsType(TYPE_XYZ) then
Duel.BreakEffect()
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
--ドロール&ロックバード
function c94145021.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(94145021,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c94145021.condition)
e1:SetCost(c94145021.cost)
e1:SetOperation(c94145021.operation)
c:RegisterEffect(e1)
end
function c94145021.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c94145021.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(c94145021.cfilter,1,nil,1-tp)
end
function c94145021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c94145021.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
...@@ -33,7 +33,7 @@ function c97268402.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -33,7 +33,7 @@ function c97268402.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c97268402.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c97268402.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function c97268402.operation(e,tp,eg,ep,ev,re,r,rp,chk) function c97268402.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsRelateToEffect(e) then
......
--ミニマム・ガッツ
function c99004752.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c99004752.cost)
e1:SetTarget(c99004752.target)
e1:SetOperation(c99004752.activate)
c:RegisterEffect(e1)
end
function c99004752.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c99004752.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:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c99004752.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_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCondition(c99004752.damcon)
e2:SetOperation(c99004752.damop)
e2:SetReset(RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c99004752.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==c:GetControler()
end
function c99004752.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
if atk<0 then atk=0 end
if atk>0 then
Duel.Hint(HINT_CARD,tp,99004752)
Duel.Hint(HINT_CARD,1-tp,99004752)
Duel.Damage(tp,atk,REASON_EFFECT)
end
end
...@@ -511,6 +511,12 @@ HINT_ATTRIB =7 ...@@ -511,6 +511,12 @@ HINT_ATTRIB =7
HINT_CODE =8 HINT_CODE =8
HINT_NUMBER =9 HINT_NUMBER =9
HINT_CARD =10 HINT_CARD =10
--Card Hint
CHINT_TURN =1
CHINT_CARD =2
CHINT_RACE =3
CHINT_ATTRIBUTE =4
CHINT_NUMBER =5
--Hint Message --Hint Message
HINTMSG_RELEASE =500 HINTMSG_RELEASE =500
HINTMSG_DISCARD =501 HINTMSG_DISCARD =501
......
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
!system 209 当前所选的卡已满足选择条件 !system 209 当前所选的卡已满足选择条件
!system 210 是否要继续选择? !system 210 是否要继续选择?
!system 211 回合计数: !system 211 回合计数:
!system 212 已宣言卡:
!system 213 已宣言种族:
!system 214 已宣言属性:
!system 215 已宣言数字:
!system 500 请选择要解放的卡 !system 500 请选择要解放的卡
!system 501 请选择要丢弃的手牌 !system 501 请选择要丢弃的手牌
!system 502 请选择要破坏的卡 !system 502 请选择要破坏的卡
......
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