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

bug fix & new script

parent b6311da9
......@@ -1147,8 +1147,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->localAction.Set();
} else {
select_ready = true;
mainGame->stQMessage->setText(L"当前所选的卡已选择条件\n是否要继续选择?");
mainGame->PopupElement(mainGame->wQuery);
if(mainGame->dInfo.curMsg == MSG_SELECT_TRIBUTE) {
mainGame->stQMessage->setText(L"当前所选的卡已满足选择条件\n是否要继续选择?");
mainGame->PopupElement(mainGame->wQuery);
}
}
} else {
select_ready = false;
......
......@@ -659,12 +659,16 @@ void Game::Analyze(void* pd, char* engbuf) {
int cs = pbuf[10];
int cp = pbuf[11];
pbuf += 12;
if(cl == LOCATION_REMOVED && (cp & POS_FACEDOWN))
if(cl == LOCATION_REMOVED && (cp & POS_FACEDOWN)) {
NetManager::WriteInt32(pbufw, 0);
mainGame->SendGameMessage(cc, offset, pbuf - offset);
if (!(cl & 0xb0) && !((cl & 0xc) && (cp & POS_FACEUP)))
NetManager::WriteInt32(pbufw, 0);
mainGame->SendGameMessage(1 - cc, offset, pbuf - offset);
mainGame->SendGameMessage(cc, offset, pbuf - offset);
mainGame->SendGameMessage(1 - cc, offset, pbuf - offset);
} else {
mainGame->SendGameMessage(cc, offset, pbuf - offset);
if (!(cl & 0xb0) && !((cl & 0xc) && (cp & POS_FACEUP)))
NetManager::WriteInt32(pbufw, 0);
mainGame->SendGameMessage(1 - cc, offset, pbuf - offset);
}
if (cl != 0 && (cl & 0x80) == 0 && (cl != pl || pc != cc))
mainGame->RefreshSingle(cc, cl, cs);
break;
......@@ -2503,7 +2507,7 @@ bool Game::SolveMessage(void* pd, char* msg, int len) {
int ct = NetManager::ReadInt8(pbuf);
if (mainGame->dField.chains.size() > 1) {
if (mainGame->dField.last_chain)
mainGame->WaitFrameSignal(30);
mainGame->WaitFrameSignal(10);
for(int i = 0; i < 5; ++i) {
mainGame->dField.chains[ct - 1].solved = false;
mainGame->WaitFrameSignal(3);
......@@ -3303,7 +3307,7 @@ bool Game::AnalyzeReplay(void* pd, char* engbuf) {
(*cit)->is_hovered = false;
(*cit)->aniFrame = 5;
}
mainGame->WaitFrameSignal(20);
mainGame->WaitFrameSignal(10);
mainGame->ReplayRefreshHand(player);
for (auto cit = mainGame->dField.hand[player].begin(); cit != mainGame->dField.hand[player].end(); ++cit) {
(*cit)->is_hovered = false;
......
......@@ -79,17 +79,17 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
if(query_flag & QUERY_CODE) *p++ = data.code;
if(query_flag & QUERY_POSITION) *p++ = get_info_location();
if(!use_cache) {
if(query_flag & QUERY_ALIAS) *p++ = get_code();
if(query_flag & QUERY_TYPE) *p++ = get_type();
if(query_flag & QUERY_LEVEL) *p++ = get_level();
if(query_flag & QUERY_RANK) *p++ = get_rank();
if(query_flag & QUERY_ATTRIBUTE) *p++ = get_attribute();
if(query_flag & QUERY_RACE) *p++ = get_race();
if(query_flag & QUERY_ATTACK) *p++ = get_attack();
if(query_flag & QUERY_DEFENCE) *p++ = get_defence();
if(query_flag & QUERY_BASE_ATTACK) *p++ = get_base_attack();
if(query_flag & QUERY_BASE_DEFENCE) *p++ = get_base_defence();
if(query_flag & QUERY_REASON) *p++ = current.reason;
if(query_flag & QUERY_ALIAS) q_cache.code = *p++ = get_code();
if(query_flag & QUERY_TYPE) q_cache.type = *p++ = get_type();
if(query_flag & QUERY_LEVEL) q_cache.level = *p++ = get_level();
if(query_flag & QUERY_RANK) q_cache.rank = *p++ = get_rank();
if(query_flag & QUERY_ATTRIBUTE) q_cache.attribute = *p++ = get_attribute();
if(query_flag & QUERY_RACE) q_cache.race = *p++ = get_race();
if(query_flag & QUERY_ATTACK) q_cache.attack = *p++ = get_attack();
if(query_flag & QUERY_DEFENCE) q_cache.defence = *p++ = get_defence();
if(query_flag & QUERY_BASE_ATTACK) q_cache.base_attack = *p++ = get_base_attack();
if(query_flag & QUERY_BASE_DEFENCE) q_cache.base_defence = *p++ = get_base_defence();
if(query_flag & QUERY_REASON) q_cache.reason = *p++ = current.reason;
} else {
if((query_flag & QUERY_ALIAS) && ((tdata = get_code()) != q_cache.alias)) {
q_cache.alias = tdata;
......@@ -331,12 +331,12 @@ int32 card::get_attack(uint8 swap) {
final = effects[i]->get_value(this);
temp.attack = final;
}
if (final == -1)
if (final == -1) {
if (!rev)
atk = base + up + upc;
else
atk = base - up - upc;
else
} else
atk = final;
if (atk < 0)
atk = 0;
......@@ -417,12 +417,12 @@ int32 card::get_defence(uint8 swap) {
final = effects[i]->get_value(this);
temp.defence = final;
}
if (final == -1)
if (final == -1) {
if (!rev)
def = base + up + upc;
else
def = base - up - upc;
else
} else
def = final;
if (def < 0)
def = 0;
......
......@@ -2409,20 +2409,6 @@ int32 field::process_battle_command(uint16 step) {
core.attacker = core.attackable_cards[sel];
core.attacker->set_status(STATUS_ATTACK_CANCELED, FALSE);
core.phase_action = TRUE;
//attack cost
effect_set eset;
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
if(eset[i]->cost) {
core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0);
}
}
return FALSE;
} else {
core.units.begin()->step = 29;
......@@ -2497,8 +2483,7 @@ int32 field::process_battle_command(uint16 step) {
}
case 5: {
if(returns.ivalue[0]) {
core.attack_target = 0;
core.units.begin()->step = 6;
returns.ivalue[0] = -2;
return FALSE;
} else {
if(core.select_cards.size())
......@@ -2513,7 +2498,27 @@ int32 field::process_battle_command(uint16 step) {
core.units.begin()->step = -1;
return FALSE;
}
core.attack_target = core.select_cards[returns.bvalue[1]];
if(returns.ivalue[0] == -2)
core.attack_target = 0;
else
core.attack_target = core.select_cards[returns.bvalue[1]];
//core.units.begin()->arg1 ---> is rollbacked
if(!core.units.begin()->arg1) {
//attack cost
effect_set eset;
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!eset[i]->check_value_condition(2))
continue;
if(eset[i]->cost) {
core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0);
}
}
}
return FALSE;
}
case 7: {
......
--キーマウス
function c135598.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(135598,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c135598.condition)
e1:SetTarget(c135598.target)
e1:SetOperation(c135598.operation)
c:RegisterEffect(e1)
end
function c135598.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c135598.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_BEAST) and c:IsAbleToHand()
end
function c135598.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c135598.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c135598.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c135598.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ゲール·ドグラ
function c16229315.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetDescription(aux.Stringid(16229315,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c16229315.cost)
e1:SetTarget(c16229315.target)
e1:SetOperation(c16229315.operation)
c:RegisterEffect(e1)
end
function c16229315.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,3000) end
Duel.PayLPCost(tp,3000)
end
function c16229315.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)~=0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end
function c16229315.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--トライデント·ウォリアー
function c20474741.initial_effect(c)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20474741,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c20474741.sumtg)
e2:SetOperation(c20474741.sumop)
c:RegisterEffect(e2)
end
function c20474741.filter(c,e,tp)
return c:GetLevel()==3 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20474741.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20474741.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c20474741.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20474741.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ガンバラナイト
function c24291651.initial_effect(c)
--to defence
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24291651,0))
e1:SetCategory(CATEGIORY_POSITION)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCondition(c24291651.poscon)
e1:SetOperation(c24291651.posop)
c:RegisterEffect(e1)
end
function c24291651.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttack()
end
function c24291651.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
......@@ -15,7 +15,7 @@ function c34116027.initial_effect(c)
c:RegisterEffect(e1)
end
function c34116027.filter(c)
return c:IsRace(RACE_DRAGON+RACE_WINDBEAST) and c:IsAbleToHand()
return c:IsLevelBelow(4) and c:IsRace(RACE_DRAGON+RACE_WINDBEAST) and c:IsAbleToHand()
end
function c34116027.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -26,13 +26,13 @@ function c50755.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50755.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) end
if tc then Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) end
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,c50755.filter,1-tp,LOCATION_DECK,0,1,1,nil,e,1-tp)
local tc=g:GetFirst()
if tc then Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP) end
if tc then Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK) end
end
Duel.SpecialSummonComplete()
end
--ロックキャット
function c52346240.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52346240,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c52346240.sptg)
e1:SetOperation(c52346240.spop)
c:RegisterEffect(e1)
end
function c52346240.filter(c,e,tp)
return c:GetLevel()==1 and c:IsRace(RACE_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c52346240.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c52346240.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c52346240.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c52346240.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c52346240.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
--幻影王 ハイド·ライド
function c6901008.initial_effect(c)
--nontuner
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e1)
end
--ジャンク·アタック
function c79068663.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c79068663.target)
e1:SetOperation(c79068663.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(1)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(79068663,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c79068663.damcon)
e3:SetTarget(c79068663.damtg)
e3:SetOperation(c79068663.damop)
c:RegisterEffect(e3)
end
function c79068663.target(e,tp,eg,ep,ev,re,r,rp,chk)
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_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c79068663.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c79068663.damcon(e,tp,eg,ep,ev,re,r,rp)
local eqc=e:GetHandler():GetEquipTarget()
local des=eg:GetFirst()
return des:IsLocation(LOCATION_GRAVE) and des:GetReasonCard()==eqc and des:IsType(TYPE_MONSTER)
end
function c79068663.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
eg:GetFirst():CreateEffectRelation(e)
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c79068663.damop(e,tp,eg,ep,ev,re,r,rp)
local des=eg:GetFirst()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if des:IsRelateToEffect(e) then
local dam=des:GetAttack()/2
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
end
--デビル·コメディアン
function c81172176.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COIN+CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c81172176.target)
e1:SetOperation(c81172176.activate)
c:RegisterEffect(e1)
end
function c81172176.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c81172176.activate(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.Remove(Duel.GetFieldGroup(tp,0,LOCATION_GRAVE),POS_FACEUP,REASON_EFFECT)
else Duel.DiscardDeck(tp,Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE),REASON_EFFECT) end
end
--ブラック·ボンバー
function c88671720.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88671720,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c88671720.sumtg)
e1:SetOperation(c88671720.sumop)
c:RegisterEffect(e1)
end
function c88671720.filter(c,e,tp)
return c:GetLevel()==4 and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88671720.sumtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c88671720.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88671720.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c88671720.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c88671720.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
......@@ -52,6 +52,7 @@ function c90011152.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c90011152.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -35,7 +35,7 @@ function c94243005.initial_effect(c)
c:RegisterEffect(e4)
end
function c94243005.ctfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsPreviousLocation(0x80+LOCATION_SZONE)
end
function c94243005.ctop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c94243005.ctfilter,nil)
......@@ -45,7 +45,7 @@ function c94243005.ctop(e,tp,eg,ep,ev,re,r,rp)
end
function c94243005.spfilter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and Duel.IsCanRemoveCounter(tp,1,0,0x13,lv,REASON_COST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return lv>3 and c:IsFaceup() and Duel.IsCanRemoveCounter(tp,1,0,0x13,lv,REASON_COST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c94243005.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c94243005.spfilter(chkc,e,tp) end
......
--大火葬
function c95472621.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetCondition(c95472621.condition)
e1:SetTarget(c95472621.target)
e1:SetOperation(c95472621.activate)
c:RegisterEffect(e1)
end
function c95472621.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER)
end
function c95472621.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c95472621.cfilter,1,nil)
end
function c95472621.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c95472621.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95472621.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function c95472621.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,TYPE_MONSTER)
Duel.Remove(g,POS_FACEUP,EFFECT)
end
......@@ -31,13 +31,13 @@ function c96965364.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.SelectReleaseGroup(tp,c96965364.cfilter,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c96965364.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96965364.spfilter,tp,LOCATION_DECK,0,1,1,nil,lv,e,tp)
local g=Duel.SelectMatchingCard(tp,c96965364.spfilter,tp,LOCATION_DECK,0,1,1,nil,lv+1,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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