Commit 5f68c7aa authored by VanillaSalt's avatar VanillaSalt

update

parent f8d30af4
......@@ -18,8 +18,12 @@ int32 scriptlib::card_get_code(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->get_code());
lua_pushinteger(L, pcard->get_another_code());
return 2;
uint32 otcode = pcard->get_another_code();
if(otcode) {
lua_pushinteger(L, otcode);
return 2;
}
return 1;
}
int32 scriptlib::card_get_origin_code(lua_State *L) {
check_param_count(L, 1);
......@@ -444,12 +448,20 @@ int32 scriptlib::card_is_code(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 tcode = lua_tointeger(L, 2);
uint32 code1 = pcard->get_code();
uint32 code2 = pcard->get_another_code();
if(pcard->get_code() == tcode || (code2 && code2 == tcode))
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 tcode = lua_tointeger(L, i + 2);
if(code1 == tcode || (code2 && code2 == tcode)) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_type(lua_State *L) {
......
......@@ -11,12 +11,11 @@ function c12247206.initial_effect(c)
end
function c12247206.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) and tc:IsAttackBelow(1500)
return eg:GetCount()==1 and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) and tc:IsAttackBelow(1500)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
end
function c12247206.nfilter(c,tc)
local code1,code2=tc:GetCode()
return c:IsCode(code1) or c:IsCode(code2)
return c:IsCode(tc:GetCode())
end
function c12247206.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
......
......@@ -13,8 +13,7 @@ function c75141056.tgfilter(c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c75141056.cfilter,c:GetControler(),LOCATION_DECK,0,1,nil,c)
end
function c75141056.cfilter(c,tc)
local code1,code2=tc:GetCode()
return c:IsSetCard(0x3008) and not c:IsCode(code1) and not c:IsCode(code2) and c:IsAbleToGrave()
return c:IsSetCard(0x3008) and not c:IsCode(tc:GetCode()) and c:IsAbleToGrave()
end
function c75141056.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c75141056.tgfilter(chkc) end
......@@ -36,7 +35,7 @@ function c75141056.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(gc:GetCode())
tc:RegisterEffect(e1)
end
elseif IsPlayerCanDiscardDeck(tp,1) then
elseif Duel.IsPlayerCanDiscardDeck(tp,1) then
local cg=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,cg)
Duel.ConfirmCards(tp,cg)
......
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