Commit 85c603c7 authored by argon.sun's avatar argon.sun

fix

parent 31fabed7
......@@ -14,7 +14,7 @@
#include <dirent.h>
#endif
const unsigned short PRO_VERSION = 0x12c0;
const unsigned short PRO_VERSION = 0x12d0;
namespace ygo {
......
......@@ -184,7 +184,7 @@ bool Replay::CheckReplay(const wchar_t* name) {
ReplayHeader rheader;
fread(&rheader, sizeof(ReplayHeader), 1, rfp);
fclose(rfp);
return rheader.id == 0x31707279 && rheader.version >= 0x1024;
return rheader.id == 0x31707279 && rheader.version >= 0x12d0;
}
bool Replay::ReadNextResponse(unsigned char resp[64]) {
if(pdata - replay_data >= replay_size)
......
......@@ -237,6 +237,7 @@ struct processor {
uint8 to_bp;
uint8 to_m2;
uint8 to_ep;
uint8 skip_m2;
uint8 chain_attack;
card* chain_attack_target;
uint8 selfdes_disabled;
......
......@@ -2272,6 +2272,11 @@ int32 field::process_idle_command(uint16 step) {
}
return FALSE;
}
if((infos.phase == PHASE_MAIN2) && core.skip_m2) {
core.skip_m2 = FALSE;
returns.ivalue[0] = 7;
return FALSE;
}
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second;
......@@ -3798,9 +3803,9 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
return FALSE;
}
core.skip_m2 = FALSE;
if(returns.ivalue[0] == 3) { // End Phase
core.units.begin()->step = 14;
return FALSE;
core.skip_m2 = TRUE;
}
//Main2
infos.phase = PHASE_MAIN2;
......
......@@ -25,13 +25,15 @@ function c19024706.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=sg:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
if tc:IsSetCard(0x3008) then
if tc:IsSetCard(0x3008) and tc:IsType(TYPE_MONSTER) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then
Duel.ShuffleHand(tp)
end
else
Duel.ShuffleHand(tp)
end
end
end
......@@ -38,18 +38,16 @@ end
function c33981008.filter(c)
return c:IsSetCard(0x106e) and c:GetCode()~=33981008 and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c33981008.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c33981008.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c33981008.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c33981008.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
function c33981008.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(c33981008.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33981008.drop(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) and Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c33981008.filter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,1,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......
......@@ -24,7 +24,7 @@ function c7183277.initial_effect(c)
c:RegisterEffect(e2)
end
function c7183277.etarget(e,c)
return c:IsSetCard(0x38)
return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER)
end
function c7183277.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
......
--血の代償
--血の代償(JP)
function c80604091.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......
--血の代償(EU)
function c80604092.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c80604092.cost1)
e1:SetTarget(c80604092.target1)
e1:SetOperation(c80604092.activate1)
c:RegisterEffect(e1)
--instant
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80604092,0))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(c80604092.condition2)
e3:SetCost(c80604092.cost2)
e3:SetTarget(c80604092.target2)
e3:SetOperation(c80604092.activate2)
c:RegisterEffect(e3)
end
function c80604092.filter(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function c80604092.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
if (tn==tp and ph~=PHASE_MAIN1 and ph~=PHASE_MAIN2) or (tn~=tp and ph~=PHASE_BATTLE) then return false end
if Duel.GetLP(tp)<=500 then return end
if Duel.IsExistingMatchingCard(c80604092.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(80604092,1)) then
Duel.PayLPCost(tp,500)
e:SetLabel(1)
end
end
function c80604092.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()~=1 then return end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c80604092.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c80604092.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil)
or Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENCE)==POS_FACEUP_ATTACK) then
Duel.Summon(tp,tc,true,nil)
else Duel.MSet(tp,tc,true,nil) end
end
end
function c80604092.condition2(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return (tn==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)) or (tn~=tp and ph==PHASE_BATTLE)
end
function c80604092.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500)
else Duel.PayLPCost(tp,500) end
end
function c80604092.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not e:GetHandler():IsStatus(STATUS_CHAINING) then
local ct=Duel.GetMatchingGroupCount(c80604092.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
e:SetLabel(ct)
return ct>0
else return e:GetLabel()>0 end
end
e:SetLabel(e:GetLabel()-1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c80604092.activate2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c80604092.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil)
local s2=tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENCE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end
......@@ -5,7 +5,7 @@ antialias = 2
errorlog = 1
nickname = Player
gamename = Game
lastdeck = test
lastdeck = sample
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
......
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