Commit f3c38954 authored by VanillaSalt's avatar VanillaSalt

fix

parent a699b7e0
...@@ -398,23 +398,23 @@ void Game::DrawMisc() { ...@@ -398,23 +398,23 @@ void Game::DrawMisc() {
} }
pcard = dField.szone[0][6]; pcard = dField.szone[0][6];
if(pcard) { if(pcard) {
adFont->draw(pcard->lscstring, recti(386, 398, 398, 418), 0xff000000, true, false, 0); adFont->draw(pcard->lscstring, recti(426, 394, 438, 414), 0xff000000, true, false, 0);
adFont->draw(pcard->lscstring, recti(387, 399, 399, 419), 0xffffffff, true, false, 0); adFont->draw(pcard->lscstring, recti(427, 395, 439, 415), 0xffffffff, true, false, 0);
} }
pcard = dField.szone[0][7]; pcard = dField.szone[0][7];
if(pcard) { if(pcard) {
adFont->draw(pcard->rscstring, recti(880, 398, 912, 418), 0xff000000, true, false, 0); adFont->draw(pcard->rscstring, recti(880, 394, 912, 414), 0xff000000, true, false, 0);
adFont->draw(pcard->rscstring, recti(881, 399, 913, 419), 0xffffffff, true, false, 0); adFont->draw(pcard->rscstring, recti(881, 395, 913, 415), 0xffffffff, true, false, 0);
} }
pcard = dField.szone[1][6]; pcard = dField.szone[1][6];
if(pcard) { if(pcard) {
adFont->draw(pcard->lscstring, recti(834, 245, 866, 265), 0xff000000, true, false, 0); adFont->draw(pcard->lscstring, recti(839, 245, 871, 265), 0xff000000, true, false, 0);
adFont->draw(pcard->lscstring, recti(835, 246, 867, 266), 0xffffffff, true, false, 0); adFont->draw(pcard->lscstring, recti(840, 246, 872, 266), 0xffffffff, true, false, 0);
} }
pcard = dField.szone[1][7]; pcard = dField.szone[1][7];
if(pcard) { if(pcard) {
adFont->draw(pcard->rscstring, recti(428, 245, 460, 265), 0xff000000, true, false, 0); adFont->draw(pcard->rscstring, recti(463, 245, 495, 265), 0xff000000, true, false, 0);
adFont->draw(pcard->rscstring, recti(429, 246, 461, 266), 0xffffffff, true, false, 0); adFont->draw(pcard->rscstring, recti(464, 246, 496, 266), 0xffffffff, true, false, 0);
} }
if(dField.extra[0].size()) { if(dField.extra[0].size()) {
numFont->draw(dataManager.GetNumString(dField.extra[0].size()), recti(330, 562, 381, 552), 0xff000000, true, false, 0); numFont->draw(dataManager.GetNumString(dField.extra[0].size()), recti(330, 562, 381, 552), 0xff000000, true, false, 0);
......
...@@ -26,6 +26,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -26,6 +26,7 @@ static const struct luaL_Reg cardlib[] = {
{ "GetSynchroLevel", scriptlib::card_get_synchro_level }, { "GetSynchroLevel", scriptlib::card_get_synchro_level },
{ "GetRitualLevel", scriptlib::card_get_ritual_level }, { "GetRitualLevel", scriptlib::card_get_ritual_level },
{ "GetOriginalLevel", scriptlib::card_get_origin_level }, { "GetOriginalLevel", scriptlib::card_get_origin_level },
{ "GetOriginalRank", scriptlib::card_get_origin_rank },
{ "IsXyzLevel", scriptlib::card_is_xyz_level }, { "IsXyzLevel", scriptlib::card_is_xyz_level },
{ "GetLeftScale", scriptlib::card_get_lscale }, { "GetLeftScale", scriptlib::card_get_lscale },
{ "GetRightScale", scriptlib::card_get_rscale }, { "GetRightScale", scriptlib::card_get_rscale },
......
...@@ -101,6 +101,16 @@ int32 scriptlib::card_get_origin_level(lua_State *L) { ...@@ -101,6 +101,16 @@ int32 scriptlib::card_get_origin_level(lua_State *L) {
lua_pushinteger(L, pcard->data.level); lua_pushinteger(L, pcard->data.level);
return 1; return 1;
} }
int32 scriptlib::card_get_origin_rank(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(!(pcard->data.type & TYPE_XYZ))
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.level);
return 1;
}
int32 scriptlib::card_is_xyz_level(lua_State *L) { int32 scriptlib::card_is_xyz_level(lua_State *L) {
check_param_count(L, 3); check_param_count(L, 3);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -1837,9 +1837,9 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) { ...@@ -1837,9 +1837,9 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
uint8 tp = clit->triggering_player; uint8 tp = clit->triggering_player;
core.select_effects.clear(); core.select_effects.clear();
core.select_options.clear(); core.select_options.clear();
core.select_effects.push_back((effect*)0); uintptr_t index = 0;
core.select_effects.push_back((effect*)index);
core.select_options.push_back(peffect->description); core.select_options.push_back(peffect->description);
int32 index = 0;
while(++clit != core.new_ochain_s.end()) { while(++clit != core.new_ochain_s.end()) {
++index; ++index;
peffect = clit->triggering_effect; peffect = clit->triggering_effect;
...@@ -1971,7 +1971,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) { ...@@ -1971,7 +1971,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return TRUE; return TRUE;
} }
case 20: { case 20: {
int32 index = (int32)core.select_effects[returns.ivalue[0]]; uintptr_t index = (uintptr_t)core.select_effects[returns.ivalue[0]];
auto clit = core.new_ochain_s.begin(); auto clit = core.new_ochain_s.begin();
std::advance(clit, index); std::advance(clit, index);
effect* peffect = clit->triggering_effect; effect* peffect = clit->triggering_effect;
......
...@@ -28,6 +28,7 @@ public: ...@@ -28,6 +28,7 @@ public:
static int32 card_get_synchro_level(lua_State *L); static int32 card_get_synchro_level(lua_State *L);
static int32 card_get_ritual_level(lua_State *L); static int32 card_get_ritual_level(lua_State *L);
static int32 card_get_origin_level(lua_State *L); static int32 card_get_origin_level(lua_State *L);
static int32 card_get_origin_rank(lua_State *L);
static int32 card_is_xyz_level(lua_State *L); static int32 card_is_xyz_level(lua_State *L);
static int32 card_get_lscale(lua_State *L); static int32 card_get_lscale(lua_State *L);
static int32 card_get_rscale(lua_State *L); static int32 card_get_rscale(lua_State *L);
......
...@@ -39,6 +39,7 @@ function c16037007.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,6 +39,7 @@ function c16037007.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
if Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) if Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(16037007,1)) then and Duel.SelectYesNo(tp,aux.Stringid(16037007,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
......
...@@ -46,7 +46,7 @@ function c82962242.cfilter(c,tp) ...@@ -46,7 +46,7 @@ function c82962242.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x8e) and c:IsControler(tp) return c:IsFaceup() and c:IsSetCard(0x8e) and c:IsControler(tp)
end end
function c82962242.eqcon(e,tp,eg,ep,ev,re,r,rp) function c82962242.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) or eg:IsExists(c82962242.cfilter,1,nil,tp) return not eg:IsContains(e:GetHandler()) and eg:IsExists(c82962242.cfilter,1,nil,tp)
end end
function c82962242.eqfilter(c,atk) function c82962242.eqfilter(c,atk)
return c:IsFaceup() and c:GetAttack()>atk and c:IsAbleToChangeControler() return c:IsFaceup() and c:GetAttack()>atk and c:IsAbleToChangeControler()
......
...@@ -13,6 +13,7 @@ function c8522996.initial_effect(c) ...@@ -13,6 +13,7 @@ function c8522996.initial_effect(c)
e2:SetDescription(aux.Stringid(8522996,1)) e2:SetDescription(aux.Stringid(8522996,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c8522996.con) e2:SetCondition(c8522996.con)
e2:SetCost(c8522996.cost) e2:SetCost(c8522996.cost)
e2:SetTarget(c8522996.tg) e2:SetTarget(c8522996.tg)
......
...@@ -13,21 +13,21 @@ function c9287078.initial_effect(c) ...@@ -13,21 +13,21 @@ function c9287078.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c9287078.filter(c) function c9287078.filter1(c,e,tp)
return c:GetSummonPlayer()==1-tp and c:IsCanBeEffectTarget(e)
and Duel.IsExistingTarget(c9287078.filter2,tp,LOCATION_MZONE,0,1,c)
end
function c9287078.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end end
function c9287078.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c9287078.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then if chk==0 then return eg:IsExists(c9287078.filter1,1,nil,e,tp) end
local ec=eg:GetFirst()
return eg:GetCount()==1 and ec:GetSummonPlayer()==1-tp and ec:IsCanBeEffectTarget(e)
and Duel.IsExistingTarget(c9287078.filter,tp,LOCATION_MZONE,0,1,ec)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=eg:Select(tp,1,1,nil) local g1=eg:FilterSelect(tp,c9287078.filter1,1,1,nil,e,tp)
Duel.SetTargetCard(g1) Duel.SetTargetCard(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectTarget(tp,c9287078.filter,tp,LOCATION_MZONE,0,1,1,g1:GetFirst()) local g2=Duel.SelectTarget(tp,c9287078.filter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
g1:Merge(g2) g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0)
end end
...@@ -37,7 +37,7 @@ function c9287078.spfilter(c,e,tp) ...@@ -37,7 +37,7 @@ function c9287078.spfilter(c,e,tp)
end end
function c9287078.activate(e,tp,eg,ep,ev,re,r,rp) function c9287078.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.SendtoGrave(g,REASON_EFFECT)==2 and g:IsExists(Card.IsLocation,2,nil,LOCATION_GRAVE) then if g:GetCount()==2 and Duel.SendtoGrave(g,REASON_EFFECT)==2 and g:IsExists(Card.IsLocation,2,nil,LOCATION_GRAVE) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sg=Duel.GetMatchingGroup(c9287078.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp) local sg=Duel.GetMatchingGroup(c9287078.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9287078,0)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9287078,0)) then
......
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