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

new feature

parent feacb1c0
......@@ -384,26 +384,30 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
if(hovered_pos == 0 || hovered_seq == -1)
break;
click_pos = hovered_pos;
dragx = event.MouseInput.X;
dragy = event.MouseInput.Y;
draging_pointer = mainGame->dataManager.GetCodePointer(hovered_code);
int limitcode = draging_pointer->second.alias ? draging_pointer->second.alias : draging_pointer->first;
if(hovered_pos == 4) {
int limit = 3;
if(filterList->count(hovered_code))
limit = (*filterList)[hovered_code];
if(filterList->count(limitcode))
limit = (*filterList)[limitcode];
for(int i = 0; i < mainGame->deckManager.deckhost.main.size(); ++i)
if(mainGame->deckManager.deckhost.main[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.main[i]->first == limitcode
|| mainGame->deckManager.deckhost.main[i]->second.alias == limitcode)
limit--;
for(int i = 0; i < mainGame->deckManager.deckhost.extra.size(); ++i)
if(mainGame->deckManager.deckhost.extra[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.extra[i]->first == limitcode
|| mainGame->deckManager.deckhost.extra[i]->second.alias == limitcode)
limit--;
for(int i = 0; i < mainGame->deckManager.deckhost.side.size(); ++i)
if(mainGame->deckManager.deckhost.side[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.side[i]->first == limitcode
|| mainGame->deckManager.deckhost.side[i]->second.alias == limitcode)
limit--;
if(limit <= 0)
break;
}
click_pos = hovered_pos;
dragx = event.MouseInput.X;
dragy = event.MouseInput.Y;
draging_pointer = mainGame->dataManager.GetCodePointer(hovered_code);
if(hovered_pos == 1)
mainGame->deckManager.deckhost.main.erase(mainGame->deckManager.deckhost.main.begin() + hovered_seq);
else if(hovered_pos == 2)
......@@ -474,17 +478,21 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
is_draging = false;
}
} else {
int limitcode = draging_pointer->second.alias ? draging_pointer->second.alias : draging_pointer->first;
int limit = 3;
if(filterList->count(hovered_code))
limit = (*filterList)[hovered_code];
if(filterList->count(limitcode))
limit = (*filterList)[limitcode];
for(int i = 0; i < mainGame->deckManager.deckhost.main.size(); ++i)
if(mainGame->deckManager.deckhost.main[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.main[i]->first == limitcode
|| mainGame->deckManager.deckhost.main[i]->second.alias == limitcode)
limit--;
for(int i = 0; i < mainGame->deckManager.deckhost.extra.size(); ++i)
if(mainGame->deckManager.deckhost.extra[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.extra[i]->first == limitcode
|| mainGame->deckManager.deckhost.extra[i]->second.alias == limitcode)
limit--;
for(int i = 0; i < mainGame->deckManager.deckhost.side.size(); ++i)
if(mainGame->deckManager.deckhost.side[i]->first == hovered_code)
if(mainGame->deckManager.deckhost.side[i]->first == limitcode
|| mainGame->deckManager.deckhost.side[i]->second.alias == limitcode)
limit--;
if(limit <= 0)
break;
......
......@@ -58,23 +58,29 @@ bool DeckManager::CheckLFList(Deck& deck, int lfindex) {
if(deck.main.size() < 40 || deck.main.size() > 60 || deck.extra.size() > 15 || deck.side.size() > 15)
return false;
for(int i = 0; i < deck.main.size(); ++i) {
ccount[deck.main[i]->first]++;
dc = ccount[deck.main[i]->first];
auto it = list->find(deck.main[i]->first);
code_pointer cit = mainGame->dataManager.GetCodePointer(deck.main[i]->first);
int code = cit->second.alias ? cit->second.alias : cit->first;
ccount[code]++;
dc = ccount[code];
auto it = list->find(code);
if(dc > 3 || (it != list->end() && dc > it->second))
return false;
}
for(int i = 0; i < deck.extra.size(); ++i) {
ccount[deck.extra[i]->first]++;
dc = ccount[deck.extra[i]->first];
auto it = list->find(deck.extra[i]->first);
code_pointer cit = mainGame->dataManager.GetCodePointer(deck.extra[i]->first);
int code = cit->second.alias ? cit->second.alias : cit->first;
ccount[code]++;
dc = ccount[code];
auto it = list->find(code);
if(dc > 3 || (it != list->end() && dc > it->second))
return false;
}
for(int i = 0; i < deck.side.size(); ++i) {
ccount[deck.side[i]->first]++;
dc = ccount[deck.side[i]->first];
auto it = list->find(deck.side[i]->first);
code_pointer cit = mainGame->dataManager.GetCodePointer(deck.side[i]->first);
int code = cit->second.alias ? cit->second.alias : cit->first;
ccount[code]++;
dc = ccount[code];
auto it = list->find(code);
if(dc > 3 || (it != list->end() && dc > it->second))
return false;
}
......
......@@ -1366,8 +1366,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if(mcard->location & 0xe) {
std::wstring str;
if(mcard->type & TYPE_MONSTER) {
myswprintf(formatBuffer, L"%ls[%d]", mainGame->dataManager.GetName(mcard->code), mcard->code);
str.append(formatBuffer);
if(!mcard->alias || mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10) {
myswprintf(formatBuffer, L"%ls[%d]", mainGame->dataManager.GetName(mcard->code), mcard->code);
str.append(formatBuffer);
}
if(mcard->alias && mcard->alias != mcard->code) {
myswprintf(formatBuffer, L"\n(%ls[%d])", mainGame->dataManager.GetName(mcard->alias), mcard->alias);
str.append(formatBuffer);
......
......@@ -605,7 +605,7 @@ void Game::ShowCardInfo(int code) {
wchar_t formatBuffer[256];
dataManager.GetData(code, &cd);
imgCard->setImage(imageManager.GetTexture(code));
myswprintf(formatBuffer, L"%ls[%d]", dataManager.GetName(code), code);
myswprintf(formatBuffer, L"%ls", dataManager.GetName(code));
stName->setText(formatBuffer);
if(cd.type & TYPE_MONSTER) {
myswprintf(formatBuffer, L"[%ls] %ls/%ls", DataManager::FormatType(cd.type), DataManager::FormatRace(cd.race), DataManager::FormatAttribute(cd.attribute));
......
--サイバー·エンド·ドラゴン
function c1546124.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeRep(c,70095154,3,false,true)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
end
c1546124.material_count=1
c1546124.material={70095154}
--青眼の究極竜
function c23995347.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeRep(c,89631139,3,true,true)
end
c23995347.material_count=1
c23995347.material={89631139}
......@@ -84,7 +84,8 @@ function c25343017.spcon(e,tp,eg,ep,ev,re,r,rp)
local rg=e:GetLabelObject()
local act=e:GetLabel()
e:SetLabel(0)
if act==1 and e:GetHandler():GetFlagEffect(25343017) then return true
if act==1 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():GetFlagEffect(25343017) then return true
else rg:Clear() return false end
end
function c25343017.spfilter(c,e,tp)
......
--No.34 電算機獣テラ·バイト
function c32003339.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,3),3)
c:EnableReviveLimit()
--control
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetDescription(aux.Stringid(32003339,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c32003339.cost)
e1:SetTarget(c32003339.target)
e1:SetOperation(c32003339.operation)
c:RegisterEffect(e1)
end
function c32003339.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 c32003339.filter(c)
return c:IsFaceup() and c:IsAttack() and c:IsLevelBelow(4) and c:IsControlerCanBeChanged()
end
function c32003339.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:GetControler()~=tp and c32003339.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32003339.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c32003339.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c32003339.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--ブラック·マジシャン·ガール
function c38033122.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c38033122.val)
c:RegisterEffect(e1)
end
function c38033122.val(e,c)
return Duel.GetMatchingGroupCount(c38033122.filter,c:GetControler(),LOCATION_GRAVE,LOCATION_GRAVE,nil)*300
end
function c38033122.filter(c)
local code=c:GetCode()
return code==46986414 or code==40737112
end
--ブラック·マジシャン·ガール
function c38033123.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c38033123.val)
c:RegisterEffect(e1)
end
function c38033123.val(e,c)
return Duel.GetMatchingGroupCount(c38033123.filter,c:GetControler(),LOCATION_GRAVE,LOCATION_GRAVE,nil)*300
end
function c38033123.filter(c)
local code=c:GetCode()
return code==46986414 or code==40737112
end
--ブラック·マジシャン·ガール
function c38033124.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c38033124.val)
c:RegisterEffect(e1)
end
function c38033124.val(e,c)
return Duel.GetMatchingGroupCount(c38033124.filter,c:GetControler(),LOCATION_GRAVE,LOCATION_GRAVE,nil)*300
end
function c38033124.filter(c)
local code=c:GetCode()
return code==46986414 or code==40737112
end
--クリボー
function c40640058.initial_effect(c)
--no damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40640058,0))
e1:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c40640058.con)
e1:SetCost(c40640058.cost)
e1:SetOperation(c40640058.op)
c:RegisterEffect(e1)
end
function c40640058.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttacker():GetAttack()>0
end
function c40640058.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 c40640058.op(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_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
--クリボー
function c40640059.initial_effect(c)
--no damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40640059,0))
e1:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c40640059.con)
e1:SetCost(c40640059.cost)
e1:SetOperation(c40640059.op)
c:RegisterEffect(e1)
end
function c40640059.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttacker():GetAttack()>0
end
function c40640059.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 c40640059.op(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_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
--ハネクリボー
function c57116034.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57116034,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c57116034.con)
e1:SetOperation(c57116034.op)
c:RegisterEffect(e1)
end
function c57116034.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end
function c57116034.op(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 c70095155.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(c70095155.spcon)
c:RegisterEffect(e1)
end
function c70095155.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)>0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
--人造人間-サイコ·ショッカー
function c77585514.initial_effect(c)
--cannot trigger
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0xa,0xa)
e1:SetTarget(c77585514.distg)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e2:SetTarget(c77585514.distg)
c:RegisterEffect(e2)
--disable effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c77585514.disop)
c:RegisterEffect(e3)
--disable trap monster
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c77585514.distg)
c:RegisterEffect(e4)
end
function c77585514.distg(e,c)
return c:IsType(TYPE_TRAP)
end
function c77585514.disop(e,tp,eg,ep,ev,re,r,rp)
local te,tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_LOCATION)
if tl==LOCATION_SZONE and Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_TRAP then
Duel.NegateEffect(ev)
end
end
--バスター·ブレイダー
function c78193832.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c78193832.val)
c:RegisterEffect(e1)
end
function c78193832.val(e,c)
return Duel.GetMatchingGroupCount(c78193832.filter,c:GetControler(),0,LOCATION_GRAVE+LOCATION_MZONE,nil)*500
end
function c78193832.filter(c)
return c:IsRace(RACE_DRAGON) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
......@@ -67,7 +67,7 @@ function c94243005.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x13)
e:SetLabel(ct)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
and ct>0 and rp~=tp and bit.band(r,REASON_EFFECT)~=0
end
function c94243005.thfilter(c,lv)
......
......@@ -27,7 +27,7 @@ function c96216229.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c96216229.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandle():IsRelateToEffect(re) then
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--超魔導剣士-ブラック·パラディン
function c98502114.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,46986414,78193831,true,true)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98502114,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c98502114.discon)
e1:SetCost(c98502114.discost)
e1:SetTarget(c98502114.distg)
e1:SetOperation(c98502114.disop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c98502114.val)
c:RegisterEffect(e2)
--spsummon condition
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(c98502114.splimit)
c:RegisterEffect(e3)
end
c98502114.material_count=2
c98502114.material={46986414,78193831}
function c98502114.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c98502114.val(e,c)
return Duel.GetMatchingGroupCount(c98502114.filter,0,0x14,0x14,nil)*500
end
function c98502114.filter(c)
return c:IsRace(RACE_DRAGON) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function c98502114.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
end
function c98502114.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST,nil)
end
function c98502114.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c98502114.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--超魔導剣士-ブラック·パラディン
function c98502115.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,46986414,78193831,true,true)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98502115,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c98502115.discon)
e1:SetCost(c98502115.discost)
e1:SetTarget(c98502115.distg)
e1:SetOperation(c98502115.disop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c98502115.val)
c:RegisterEffect(e2)
--spsummon condition
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(c98502115.splimit)
c:RegisterEffect(e3)
end
c98502115.material_count=2
c98502115.material={46986414,78193831}
function c98502115.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c98502115.val(e,c)
return Duel.GetMatchingGroupCount(c98502115.filter,0,0x14,0x14,nil)*500
end
function c98502115.filter(c)
return c:IsRace(RACE_DRAGON) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function c98502115.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
end
function c98502115.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST,nil)
end
function c98502115.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c98502115.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -43,6 +43,13 @@ function c98585345.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c98585345.dfilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
local dg=Duel.GetOperatedGroup()
local s=dg:GetSum(Card.GetTextAttack)
Duel.Damage(1-tp,s,REASON_EFFECT)
local tc=dg:GetFirst()
local dam=0
while tc do
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
dam=dam+atk
tc=dg:GetNext()
end
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
......@@ -48,7 +48,7 @@ function c99659159.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,c99659159.filter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()==0 then return end
local sc=sg:GetFirst()
Duel.Equip(tp,sc,tc,false)
Duel.Equip(tp,sc,tc,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
......
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