Commit 2541f026 authored by argon.sun's avatar argon.sun

new scripts

parent f3f7ccd6
......@@ -119,7 +119,8 @@ bool DataManager::GetData(int code, CardData* pData) {
auto cdit = _datas.find(code);
if(cdit == _datas.end())
return false;
*pData = *((CardData*)&cdit->second);
if(pData)
*pData = *((CardData*)&cdit->second);
return true;
}
code_pointer DataManager::GetCodePointer(int code) {
......@@ -228,6 +229,14 @@ int DataManager::DecodeUTF8(const char * src, wchar_t * wstr) {
*wp = 0;
return wp - wstr;
}
int DataManager::GetVal(const wchar_t* pstr) {
int ret = 0;
while(*pstr >= L'0' && *pstr <= L'9') {
ret = ret * 10 + (*pstr - L'0');
pstr++;
}
return ret;
}
const wchar_t* DataManager::FormatLocation(int location) {
switch(location) {
case LOCATION_DECK:
......
......@@ -28,7 +28,8 @@ public:
const wchar_t* GetNumString(int num);
static int EncodeUTF8(const wchar_t * wsrc, char * str);
static int DecodeUTF8(const char * src, wchar_t * wstr);
static int GetVal(const wchar_t* pstr);
std::unordered_map<unsigned int, CardDataC> _datas;
std::unordered_map<unsigned int, CardString> _strings;
std::unordered_map<unsigned int, wchar_t*> _sysStrings;
......
......@@ -88,25 +88,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_atktype = 1;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_atktype = 1;
filter_atk = GetVal(pstr);
filter_atk = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_atktype = 2;
filter_atk = GetVal(pstr + 2);
filter_atk = DataManager::GetVal(pstr + 2);
} else {
filter_atktype = 3;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_atktype = 4;
filter_atk = GetVal(pstr + 2);
filter_atk = DataManager::GetVal(pstr + 2);
} else {
filter_atktype = 5;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'?') {
filter_atktype = 6;
......@@ -117,25 +117,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_deftype = 1;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_deftype = 1;
filter_def = GetVal(pstr);
filter_def = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_deftype = 2;
filter_def = GetVal(pstr + 2);
filter_def = DataManager::GetVal(pstr + 2);
} else {
filter_deftype = 3;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_deftype = 4;
filter_def = GetVal(pstr + 2);
filter_def = DataManager::GetVal(pstr + 2);
} else {
filter_deftype = 5;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'?') {
filter_deftype = 6;
......@@ -146,25 +146,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_lvtype = 1;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_lvtype = 1;
filter_lv = GetVal(pstr);
filter_lv = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_lvtype = 2;
filter_lv = GetVal(pstr + 2);
filter_lv = DataManager::GetVal(pstr + 2);
} else {
filter_lvtype = 3;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_lvtype = 4;
filter_lv = GetVal(pstr + 2);
filter_lv = DataManager::GetVal(pstr + 2);
} else {
filter_lvtype = 5;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
}
} else filter_lvtype = 0;
}
......@@ -186,25 +186,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_atktype = 1;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_atktype = 1;
filter_atk = GetVal(pstr);
filter_atk = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_atktype = 2;
filter_atk = GetVal(pstr + 2);
filter_atk = DataManager::GetVal(pstr + 2);
} else {
filter_atktype = 3;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_atktype = 4;
filter_atk = GetVal(pstr + 2);
filter_atk = DataManager::GetVal(pstr + 2);
} else {
filter_atktype = 5;
filter_atk = GetVal(pstr + 1);
filter_atk = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'?') {
filter_atktype = 6;
......@@ -215,25 +215,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_deftype = 1;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_deftype = 1;
filter_def = GetVal(pstr);
filter_def = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_deftype = 2;
filter_def = GetVal(pstr + 2);
filter_def = DataManager::GetVal(pstr + 2);
} else {
filter_deftype = 3;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_deftype = 4;
filter_def = GetVal(pstr + 2);
filter_def = DataManager::GetVal(pstr + 2);
} else {
filter_deftype = 5;
filter_def = GetVal(pstr + 1);
filter_def = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'?') {
filter_deftype = 6;
......@@ -244,25 +244,25 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
else {
if(*pstr == L'=') {
filter_lvtype = 1;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
} else if(*pstr >= L'0' && *pstr <= L'9') {
filter_lvtype = 1;
filter_lv = GetVal(pstr);
filter_lv = DataManager::GetVal(pstr);
} else if(*pstr == L'>') {
if(*(pstr + 1) == L'=') {
filter_lvtype = 2;
filter_lv = GetVal(pstr + 2);
filter_lv = DataManager::GetVal(pstr + 2);
} else {
filter_lvtype = 3;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
}
} else if(*pstr == L'<') {
if(*(pstr + 1) == L'=') {
filter_lvtype = 4;
filter_lv = GetVal(pstr + 2);
filter_lv = DataManager::GetVal(pstr + 2);
} else {
filter_lvtype = 5;
filter_lv = GetVal(pstr + 1);
filter_lv = DataManager::GetVal(pstr + 1);
}
} else filter_lvtype = 0;
}
......@@ -281,6 +281,20 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break;
}
case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) {
case SCROLL_KEYWORD: {
irr::SEvent me;
me.EventType = irr::EET_GUI_EVENT;
me.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED;
me.GUIEvent.Caller = mainGame->btnStartFilter;
me.GUIEvent.Element = mainGame->btnStartFilter;
device->postEventFromUser(me);
break;
}
}
break;
}
case irr::gui::EGET_COMBO_BOX_CHANGED: {
switch(id) {
case COMBOBOX_DBLFLIST: {
......@@ -591,17 +605,17 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
return false;
}
int DeckBuilder::GetVal(const wchar_t * pstr) {
int ret = 0;
while(*pstr >= L'0' && *pstr <= L'9') {
ret = ret * 10 + (*pstr - L'0');
pstr++;
}
return ret;
}
void DeckBuilder::FilterCards() {
results.clear();
const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = DataManager::GetVal(pstr);
if(mainGame->dataManager.GetData(trycode, 0)) {
results.push_back(mainGame->dataManager.GetCodePointer(trycode));
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
myswprintf(result_string, L"%d", results.size());
return;
}
if(pstr[0] == 0)
pstr = 0;
auto strpointer = mainGame->dataManager._strings.begin();
......@@ -689,6 +703,14 @@ void DeckBuilder::FilterCards() {
void DeckBuilder::FilterCardsFromResult() {
int offset = 0;
const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = DataManager::GetVal(pstr);
if(mainGame->dataManager.GetData(trycode, 0)) {
results.push_back(mainGame->dataManager.GetCodePointer(trycode));
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
myswprintf(result_string, L"%d", results.size());
return;
}
if(pstr[0] == 0)
pstr = 0;
for(int i = 0; i < results.size(); ++i) {
......
......@@ -11,7 +11,6 @@ namespace ygo {
class DeckBuilder: public irr::IEventReceiver {
public:
virtual bool OnEvent(const irr::SEvent& event);
int GetVal(const wchar_t* pstr);
void FilterCards();
void FilterCardsFromResult();
......
......@@ -832,6 +832,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
switch(id) {
case EDITBOX_ANCARD: {
const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = DataManager::GetVal(pname);
CardString cstr;
if(mainGame->dataManager.GetString(trycode, &cstr)) {
mainGame->lstANCard->clear();
ancard.clear();
mainGame->lstANCard->addItem(cstr.name);
ancard.push_back(trycode);
break;
}
if(pname[0] == 0 || pname[1] == 0)
break;
mainGame->lstANCard->clear();
......@@ -851,6 +860,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
switch(id) {
case EDITBOX_ANCARD: {
const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = DataManager::GetVal(pname);
CardString cstr;
if(mainGame->dataManager.GetString(trycode, &cstr)) {
mainGame->lstANCard->clear();
ancard.clear();
mainGame->lstANCard->addItem(cstr.name);
ancard.push_back(trycode);
break;
}
if(pname[0] == 0)
break;
mainGame->lstANCard->clear();
......
......@@ -347,7 +347,7 @@ bool Game::Initialize() {
ebStar = env->addEditBox(L"", rect<s32>(60, 72, 140, 92), true, wFilter);
ebStar->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(L"关键字:", rect<s32>(205, 74, 280, 94), false, false, wFilter);
ebCardName = env->addEditBox(L"", rect<s32>(260, 72, 390, 92), true, wFilter);
ebCardName = env->addEditBox(L"", rect<s32>(260, 72, 390, 92), true, wFilter, SCROLL_KEYWORD);
ebCardName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnEffectFilter = env->addButton(rect<s32>(345, 28, 390, 69), wFilter, BUTTON_EFFECT_FILTER, L"效果");
btnStartFilter = env->addButton(rect<s32>(205, 96, 290, 118), wFilter, BUTTON_START_FILTER, L"重新搜索");
......
......@@ -403,6 +403,7 @@ extern Game* mainGame;
#define BUTTON_START_FILTER 212
#define BUTTON_RESULT_FILTER 213
#define SCROLL_FILTER 214
#define SCROLL_KEYWORD 215
#define BUTTON_REPLAY_START 220
#define BUTTON_REPLAY_PAUSE 221
#define BUTTON_REPLAY_STEP 222
......
......@@ -182,6 +182,7 @@ static const struct luaL_reg cardlib[] = {
{ "TrapMonsterBlock", scriptlib::card_trap_monster_block },
{ "CancelToGrave", scriptlib::card_cancel_to_grave },
{ "GetTributeRequirement", scriptlib::card_get_tribute_requirement },
{ "GetBattleTarget", scriptlib::card_get_battle_target },
{ NULL, NULL }
};
......
......@@ -1611,3 +1611,15 @@ int32 scriptlib::card_get_tribute_requirement(lua_State *L) {
lua_pushinteger(L, (rcount >> 16) & 0xffff);
return 2;
}
int32 scriptlib::card_get_battle_target(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel;
if(pduel->game_field->core.attacker == pcard)
interpreter::card2value(L, pduel->game_field->core.attack_target);
else if(pduel->game_field->core.attack_target == pcard)
interpreter::card2value(L, pduel->game_field->core.attacker);
else lua_pushnil(L);
return 1;
}
......@@ -182,6 +182,7 @@ public:
static int32 card_trap_monster_block(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_battle_target(lua_State *L);
//Effect functions
static int32 effect_new(lua_State *L);
static int32 effect_clone(lua_State *L);
......
--ジュラシックワールド
function c10080320.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_DINOSAUR))
e2:SetValue(300)
c:RegisterEffect(e2)
--Def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_DINOSAUR))
e3:SetValue(300)
c:RegisterEffect(e3)
end
--ジュラック·ヘレラ
function c16111820.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16111820,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c16111820.condition)
e1:SetTarget(c16111820.target)
e1:SetOperation(c16111820.operation)
c:RegisterEffect(e1)
end
function c16111820.filter(c,tp)
return c:GetPreviousControler()==tp and c:GetControler()==tp and c:IsLocation(LOCATION_GRAVE) and c:IsPreviousPosition(POS_DEFENCE)
and c:IsSetCard(0x22) and c:GetCode()~=16111820
end
function c16111820.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c16111820.filter,1,nil,tp)
end
function c16111820.target(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.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),0,0,0)
end
function c16111820.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--ジュラック·メテオ
function c17548456.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x22),aux.NonTuner(Card.IsRace,RACE_DINOSAUR),2)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17548456,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c17548456.descon)
e1:SetTarget(c17548456.destg)
e1:SetOperation(c17548456.desop)
c:RegisterEffect(e1)
end
function c17548456.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c17548456.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c17548456.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c17548456.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
local sg=Duel.GetMatchingGroup(c17548456.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if sg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(17548456,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sp=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(sp,0,tp,tp,false,false,POS_FACEUP)
end
end
--ジュラック·デイノ
function c17948378.initial_effect(c)
--reg
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetOperation(c17948378.regop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17948378,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c17948378.drcon)
e2:SetCost(c17948378.drcost)
e2:SetTarget(c17948378.drtg)
e2:SetOperation(c17948378.drop)
c:RegisterEffect(e2)
end
function c17948378.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(17948378,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c17948378.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(17948378)~=0
end
function c17948378.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x22) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x22)
Duel.Release(g,REASON_COST)
end
function c17948378.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c17948378.drop(e,tp,eg,ep,ev,re,r,rp,chk)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--ジュラック·プロトプス
function c23927545.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c23927545.val)
c:RegisterEffect(e1)
end
function c23927545.val(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)*100
end
--ブラック·ブルドラゴ
function c24221808.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),aux.NonTuner(Card.IsRace,RACE_PSYCHO),2)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24221808,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
--e1:SetCountLimit(1)
e1:SetTarget(c24221808.rmtg)
e1:SetOperation(c24221808.rmop)
c:RegisterEffect(e1)
local sg=Group.CreateGroup()
sg:KeepAlive()
e1:SetLabelObject(sg)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24221808,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c24221808.spcon)
e2:SetTarget(c24221808.sptg)
e2:SetOperation(c24221808.spop)
e2:SetLabelObject(sg)
c:RegisterEffect(e2)
end
function c24221808.rmfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToRemove()
end
function c24221808.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c24221808.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24221808.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.SelectTarget(tp,c24221808.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c24221808.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local sg=e:GetLabelObject()
if c:GetFlagEffect(24221808)==0 then
sg:Clear()
c:RegisterFlagEffect(24221808,RESET_EVENT+0x1680000,0,1)
end
if c:IsRelateToEffect(e) then
sg:AddCard(tc)
tc:CreateRelation(c,RESET_EVENT+0x1fe0000)
end
end
end
function c96029574.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c96029574.spfilter(c,e,tp)
end
function c96029574.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c96029574.spop(e,tp,eg,ep,ev,re,r,rp)
end
--天狼王 ブルー·セイリオス
function c32995007.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32995007,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c32995007.atkcon)
e1:SetTarget(c32995007.atktg)
e1:SetOperation(c32995007.atkop)
c:RegisterEffect(e1)
end
function c32995007.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
end
function c32995007.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 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 c32995007.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2400)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
--エクスプローシブ·マジシャン
function c33413279.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_SPELLCASTER),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33413279,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c33413279.descost)
e1:SetTarget(c33413279.destg)
e1:SetOperation(c33413279.desop)
c:RegisterEffect(e1)
end
function c33413279.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x3001,2,REASON_COST)
end
function c33413279.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c33413279.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c33413279.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33413279.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c33413279.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c33413279.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ジュラック·モノロフ
function c36717258.initial_effect(c)
--attack all
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetValue(1)
c:RegisterEffect(e1)
end
......@@ -9,7 +9,6 @@ function c39823987.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c39823987.descon)
e1:SetTarget(c39823987.destg)
e1:SetOperation(c39823987.desop)
......@@ -31,15 +30,16 @@ function c39823987.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c39823987.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetReasonCard()
if chk==0 then return tc:IsLocation(LOCATION_MZONE) end
tc:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack()/2)
if tc:IsRelateToBattle() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack()/2)
end
end
function c39823987.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetReasonCard()
if not tc:IsRelateToEffect(e) then return end
if not tc:IsRelateToBattle() then return end
local atk=tc:GetAttack()/2
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
......
--大噴火
function c42175079.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,0)
e1:SetCondition(c42175079.condition)
e1:SetTarget(c42175079.target)
e1:SetOperation(c42175079.activate)
c:RegisterEffect(e1)
end
function c42175079.filter(c)
return c:IsFaceup() and c:IsCode(10080320)
end
function c42175079.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c42175079.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c42175079.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c42175079.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--ジュラック·ガリム
function c43332022.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43332022,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c43332022.descon)
e1:SetTarget(c43332022.destg)
e1:SetOperation(c43332022.desop)
c:RegisterEffect(e1)
end
function c43332022.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c43332022.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetReasonCard()
if tc:IsRelateToBattle() and not Duel.IsExistingMatchingCard(Card.IsDiscardable,1-tp,LOCATION_HAND,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
end
function c43332022.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetReasonCard()
if not tc:IsRelateToBattle() then return end
if Duel.IsExistingMatchingCard(Card.IsDiscardable,1-tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(43332022,1)) then
Duel.DiscardHand(1-tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil)
else Duel.Destroy(tc,REASON_EFFECT) end
end
--ジュラック·スピノス
function c44689688.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44689688,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c44689688.spcon)
e1:SetTarget(c44689688.sptg)
e1:SetOperation(c44689688.spop)
c:RegisterEffect(e1)
end
function c44689688.spcon(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 c44689688.sptg(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)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c44689688.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,44689689,0,0x4011,300,0,1,RACE_DINOSAUR,ATTRIBUTE_FIRE,POS_FACEUP_ATTACK,1-tp) then
local token=Duel.CreateToken(tp,44689689)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP_ATTACK)
end
end
--ジュラック·プティラ
function c45711266.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45711266,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_END)
e1:SetCondition(c45711266.condition)
e1:SetTarget(c45711266.target)
e1:SetOperation(c45711266.operation)
c:RegisterEffect(e1)
end
function c45711266.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget()
end
function c45711266.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=Duel.GetAttacker()
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
function c45711266.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() then
local lv=tc:GetLevel()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
if not c:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENCE)
e1:SetValue(lv*100)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
end
--ジュラック·スタウリコ
function c48411996.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48411996,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetTarget(c48411996.target)
e1:SetOperation(c48411996.operation)
c:RegisterEffect(e1)
end
function c48411996.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function c48411996.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,48411997,0x22,0x4011,0,0,1,RACE_DINOSAUR,ATTRIBUTE_FIRE) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,48411997)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASEABLE_SUM)
e1:SetValue(c48411996.sumlimit)
e1:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c48411996.sumlimit(e,c)
return not c:IsSetCard(0x22)
end
--ジュラック·ティラヌス
function c62701967.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62701967,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(500)
e1:SetCost(c62701967.atkcost)
e1:SetOperation(c62701967.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62701967,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetLabel(300)
e2:SetCondition(c62701967.atkcon)
e2:SetOperation(c62701967.operation)
c:RegisterEffect(e2)
end
function c62701967.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_DINOSAUR) end
local sg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_DINOSAUR)
Duel.Release(sg,REASON_COST)
end
function c62701967.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(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c62701967.atkcon(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 c65961683.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_DINOSAUR),1)
c:EnableReviveLimit()
--Atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c65961683.valop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65961683,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCondition(c65961683.descon)
e2:SetTarget(c65961683.destg)
e2:SetOperation(c65961683.desop)
c:RegisterEffect(e2)
end
function c65961683.valop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()~=SUMMON_TYPE_SYNCHRO then return end
local g=c:GetMaterial()
local tc=g:GetFirst()
local atk=0
while tc do
local tatk=tc:GetTextAttack()
if tatk<0 then tatk=0 end
atk=atk+tatk
tc=g:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE)
c:RegisterEffect(e2)
end
function c65961683.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsPosition(POS_FACEDOWN_DEFENCE)
end
function c65961683.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetAttackTarget(),1,0,0)
end
function c65961683.desop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d:IsRelateToBattle() then
Duel.Destroy(d,REASON_EFFECT)
end
end
......@@ -51,7 +51,7 @@ end
function c66818682.spfilter(c,e,tp)
return c:IsCode(39823987) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c66818682.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c66818682.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c66818682.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c66818682.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......
--神聖騎士パーシアス
function c69514125.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsAttribute,ATTRIBUTE_LIGHT),1)
c:EnableReviveLimit()
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69514125,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c69514125.postg)
e1:SetOperation(c69514125.posop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
end
function c69514125.postg(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)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c69514125.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE,0,POS_FACEUP_ATTACK,0)
end
end
--ジュラック·イグアノン
function c71106375.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71106375,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetTarget(c71106375.thtg)
e1:SetOperation(c71106375.thop)
c:RegisterEffect(e1)
end
function c71106375.filter(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function c71106375.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c71106375.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71106375.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c71106375.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c71106375.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
......@@ -6,7 +6,6 @@ function c78792195.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c78792195.con)
e2:SetCost(c78792195.cost)
......
--ジュラック·ギガノト
function c80032567.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_DINOSAUR),1)
c:EnableReviveLimit()
--Atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x22))
e1:SetValue(c80032567.val)
c:RegisterEffect(e1)
end
function c80032567.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_GRAVE,0,nil,0x22)*200
end
--キラーザウルス
function c80186010.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80186010,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c80186010.cost)
e1:SetTarget(c80186010.target)
e1:SetOperation(c80186010.operation)
c:RegisterEffect(e1)
end
function c80186010.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c80186010.filter(c)
return c:GetCode()==10080320 and c:IsAbleToHand()
end
function c80186010.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c80186010.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c80186010.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c80186010.filter,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
--ジュラック·アウロ
function c80727721.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80727721,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c80727721.spcost)
e1:SetTarget(c80727721.sptg)
e1:SetOperation(c80727721.spop)
c:RegisterEffect(e1)
end
function c80727721.spcost(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 c80727721.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x22) and c:GetCode()~=80727721 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80727721.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c80727721.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c80727721.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c80727721.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c80727721.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 c85028288.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c85028288.efilter)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80102359,0))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c85028288.atkcost)
e3:SetOperation(c85028288.atkop)
c:RegisterEffect(e3)
end
function c85028288.efilter(e,re)
return re:GetHandler():IsType(TYPE_TRAP+TYPE_MONSTER)
end
function c85028288.cfilter(c)
return c:IsAttackBelow(1700) and c:IsSetCard(0x22) and c:IsAbleToRemoveAsCost()
end
function c85028288.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c85028288.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c85028288.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c85028288.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--ジュラック·ブラキス
function c8594079.initial_effect(c)
--battle indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(c8594079.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c8594079.filter(c)
return c:IsFaceup() and c:IsSetCard(0x22)
end
function c8594079.indcon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c8594079.filter,c:GetControler(),LOCATION_MZONE,0,1,c)
end
--ヘル·ツイン·コップ
function c86137485.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--chain attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86137485,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c86137485.atcon1)
e1:SetOperation(c86137485.atop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86137485,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c86137485.atcon2)
e2:SetOperation(c86137485.atop2)
c:RegisterEffect(e2)
end
function c86137485.atcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return Duel.GetTurnPlayer()==tp and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE) and e:GetHandler():IsChainAttackable()
end
function c86137485.atop1(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_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
Duel.ChainAttack()
end
function c86137485.atcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return Duel.GetTurnPlayer()~=tp and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
end
function c86137485.atop2(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_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
--ブラック·ブルドラゴ
function c96029574.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsType,TYPE_DUAL),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(96029574,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c96029574.descost)
e1:SetTarget(c96029574.destg)
e1:SetOperation(c96029574.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(96029574,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c96029574.spcon)
e2:SetTarget(c96029574.sptg)
e2:SetOperation(c96029574.spop)
c:RegisterEffect(e2)
end
function c96029574.cfilter(c)
return c:IsType(TYPE_DUAL) and c:IsAbleToGraveAsCost()
end
function c96029574.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96029574.cfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c96029574.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c96029574.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c96029574.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c96029574.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c96029574.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.SelectTarget(tp,c96029574.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c96029574.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c96029574.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c96029574.spfilter(c,e,tp)
return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96029574.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96029574.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c96029574.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SelectTarget(tp,c96029574.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c96029574.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
tc:EnableDualState()
end
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