Commit 39cd4000 authored by VanillaSalt's avatar VanillaSalt

fix

parent 83bfe169
...@@ -1383,9 +1383,12 @@ int32 card::get_counter(uint16 countertype) { ...@@ -1383,9 +1383,12 @@ int32 card::get_counter(uint16 countertype) {
return cmit->second; return cmit->second;
} }
void card::set_material(card_set* materials) { void card::set_material(card_set* materials) {
if(!materials) {
material_cards.clear();
return;
}
material_cards = *materials; material_cards = *materials;
card_set::iterator cit; for(auto cit = material_cards.begin(); cit != material_cards.end(); ++cit)
for(cit = material_cards.begin(); cit != material_cards.end(); ++cit)
(*cit)->current.reason_card = this; (*cit)->current.reason_card = this;
effect_set eset; effect_set eset;
filter_effect(EFFECT_MATERIAL_CHECK, &eset); filter_effect(EFFECT_MATERIAL_CHECK, &eset);
......
...@@ -571,10 +571,13 @@ int32 scriptlib::card_get_turn_counter(lua_State *L) { ...@@ -571,10 +571,13 @@ int32 scriptlib::card_get_turn_counter(lua_State *L) {
int32 scriptlib::card_set_material(lua_State *L) { int32 scriptlib::card_set_material(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_GROUP, 2);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
group* pgroup = *(group**) lua_touserdata(L, 2); if(!lua_isnil(L, 2)) {
pcard->set_material(&pgroup->container); check_param(L, PARAM_TYPE_GROUP, 2);
group* pgroup = *(group**) lua_touserdata(L, 2);
pcard->set_material(&pgroup->container);
} else
pcard->set_material(0);
return 0; return 0;
} }
int32 scriptlib::card_get_material(lua_State *L) { int32 scriptlib::card_get_material(lua_State *L) {
......
...@@ -30,7 +30,7 @@ function c1845204.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,7 +30,7 @@ function c1845204.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c1845204.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c1845204.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
tc:SetMaterial(Group.CreateGroup()) tc:SetMaterial(nil)
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -30,7 +30,7 @@ function c9236985.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,7 +30,7 @@ function c9236985.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
Duel.PayLPCost(tp,tc:GetLevel()*500) Duel.PayLPCost(tp,tc:GetLevel()*500)
tc:SetMaterial(Group.CreateGroup()) tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
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