Commit 460d8dfe authored by VanillaSalt's avatar VanillaSalt

fix

parent 930f0b2f
......@@ -649,6 +649,18 @@ void ClientField::GetChainLocation(int controler, int location, int sequence, ir
}
break;
}
case LOCATION_EXTRA: {
if (controler == 0) {
t->X = (matManager.vFields[8].Pos.X + matManager.vFields[9].Pos.X) / 2;
t->Y = (matManager.vFields[8].Pos.Y + matManager.vFields[10].Pos.Y) / 2;
t->Z = extra[controler].size() * 0.01f + 0.03f;
} else {
t->X = (matManager.vFields[76].Pos.X + matManager.vFields[77].Pos.X) / 2;
t->Y = (matManager.vFields[76].Pos.Y + matManager.vFields[78].Pos.Y) / 2;
t->Z = extra[controler].size() * 0.01f + 0.03f;
}
break;
}
}
}
void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, irr::core::vector3df* r, bool setTrans) {
......
......@@ -23,7 +23,7 @@ public:
static bool SinglePlayAnalyze(char* msg, unsigned int len);
static void SinglePlayRefresh(int flag = 0x781fff);
static void SinglePlayRefreshHand(int player, int flag = 0x181fff);
static void SinglePlayRefreshHand(int player, int flag = 0x781fff);
static void SinglePlayRefreshGrave(int player, int flag = 0x181fff);
static void SinglePlayRefreshDeck(int player, int flag = 0x181fff);
static void SinglePlayRefreshExtra(int player, int flag = 0x181fff);
......
......@@ -26,12 +26,10 @@ function c27279764.initial_effect(c)
c:RegisterEffect(e4)
--immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
e5:SetCondition(c27279764.immcon)
e5:SetValue(c27279764.efilter)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetOperation(c27279764.immop)
c:RegisterEffect(e5)
--atk/def down
local e6=Effect.CreateEffect(c)
......@@ -67,8 +65,16 @@ function c27279764.ttop(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c27279764.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
function c27279764.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c27279764.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c27279764.efilter(e,te)
if te:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return true end
......
......@@ -4,6 +4,11 @@ function c30398342.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DESTROY)
e1:SetCondition(c30398342.spcon1)
e1:SetTarget(c30398342.sptg1)
e1:SetOperation(c30398342.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -14,9 +19,10 @@ function c30398342.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c30398342.condition)
e2:SetTarget(c30398342.target)
e2:SetOperation(c30398342.operation)
e2:SetCondition(c30398342.spcon2)
e2:SetCost(c30398342.spcost)
e2:SetTarget(c30398342.sptg2)
e2:SetOperation(c30398342.spop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
......@@ -28,23 +34,49 @@ function c30398342.initial_effect(c)
e3:SetTarget(c30398342.sumlimit)
c:RegisterEffect(e3)
end
function c30398342.spcon1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_DESTROYED,true)
return res and teg:IsExists(c30398342.cfilter,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
function c30398342.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_DESTROYED,true)
if Duel.GetCurrentPhase()==PHASE_DAMAGE
or (teg:IsExists(c30398342.cfilter,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(30398342,1))) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(30398342,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetCategory(0)
end
end
function c30398342.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c30398342.condition(e,tp,eg,ep,ev,re,r,rp)
function c30398342.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c30398342.cfilter,1,nil,tp)
end
function c30398342.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(30398342)==0 end
e:GetHandler():RegisterFlagEffect(30398342,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c30398342.filter(c,e,tp)
return c:IsSetCard(0x9e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c30398342.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c30398342.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c30398342.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
function c30398342.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(30398342)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c30398342.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
......
......@@ -45,12 +45,10 @@ function c37991342.initial_effect(c)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c37991342.immcon)
e7:SetValue(c37991342.efilter)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EVENT_SUMMON_SUCCESS)
e7:SetOperation(c37991342.immop)
c:RegisterEffect(e7)
--destroy
local e8=Effect.CreateEffect(c)
......@@ -113,8 +111,16 @@ function c37991342.lvop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c37991342.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
function c37991342.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c37991342.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c37991342.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false end
......
......@@ -34,7 +34,7 @@ end
function c47126872.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then
e:SetLabelObject(tc)
tc:RegisterFlagEffect(47126872,RESET_EVENT+0x1fe0000,0,1)
end
......@@ -47,6 +47,7 @@ end
function c47126872.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject():GetLabelObject()
Duel.SetTargetCard(tc)
if tc:IsType(TYPE_MONSTER) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
......@@ -55,9 +56,8 @@ function c47126872.settg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c47126872.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetLabelObject()
if tc:GetFlagEffect(47126872)==0 then return end
tc:ResetFlagEffect(47126872)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if tc:IsType(TYPE_MONSTER) then
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENCE)
else
......
......@@ -46,12 +46,10 @@ function c64496451.initial_effect(c)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c64496451.immcon)
e7:SetValue(c64496451.efilter)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EVENT_SUMMON_SUCCESS)
e7:SetOperation(c64496451.immop)
c:RegisterEffect(e7)
--summon success
local e8=Effect.CreateEffect(c)
......@@ -121,8 +119,16 @@ function c64496451.lvop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c64496451.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
function c64496451.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c64496451.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c64496451.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false end
......
......@@ -80,6 +80,7 @@ function c87602890.operation(e,tp,eg,ep,ev,re,r,rp)
g1:Merge(g2)
end
if g1:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g1,REASON_EFFECT)
end
end
......
......@@ -45,12 +45,10 @@ function c90885155.initial_effect(c)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c90885155.immcon)
e7:SetValue(c90885155.efilter)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EVENT_SUMMON_SUCCESS)
e7:SetOperation(c90885155.immop)
c:RegisterEffect(e7)
--effect
local e8=Effect.CreateEffect(c)
......@@ -117,8 +115,16 @@ function c90885155.lvop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c90885155.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
function c90885155.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c90885155.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c90885155.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false end
......
......@@ -46,12 +46,10 @@ function c91907707.initial_effect(c)
c:RegisterEffect(e6)
--immune
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c91907707.immcon)
e7:SetValue(c91907707.efilter)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EVENT_SUMMON_SUCCESS)
e7:SetOperation(c91907707.immop)
c:RegisterEffect(e7)
--tohand
local e8=Effect.CreateEffect(c)
......@@ -114,8 +112,16 @@ function c91907707.lvop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
end
function c91907707.immcon(e)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_NORMAL)==SUMMON_TYPE_NORMAL
function c91907707.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c91907707.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function c91907707.efilter(e,te)
if not te:IsActiveType(TYPE_MONSTER) or not te:IsHasType(0x7e0) then return false 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