Commit 252ba99c authored by argon.sun's avatar argon.sun

fix

parent ce20dc0f
......@@ -464,6 +464,7 @@ static const struct luaL_Reg debuglib[] = {
{ "SetPlayerInfo", scriptlib::debug_set_player_info },
{ "PreEquip", scriptlib::debug_pre_equip },
{ "PreSetTarget", scriptlib::debug_pre_set_target },
{ "PreAddCounter", scriptlib::debug_pre_add_counter },
{ "ReloadFieldBegin", scriptlib::debug_reload_field_begin },
{ "ReloadFieldEnd", scriptlib::debug_reload_field_end },
{ "SetAIName", scriptlib::debug_set_ai_name },
......
......@@ -103,6 +103,15 @@ int32 scriptlib::debug_pre_set_target(lua_State *L) {
t_card->add_card_target(target);
return 0;
}
int32 scriptlib::debug_pre_add_counter(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 ctype = lua_tointeger(L, 2);
uint32 ccount = lua_tointeger(L, 3);
pcard->counters[ctype] += ccount;
return 0;
}
int32 scriptlib::debug_reload_field_begin(lua_State *L) {
check_param_count(L, 1);
duel* pduel = interpreter::get_duel_info(L);
......
......@@ -463,6 +463,7 @@ public:
static int32 debug_set_player_info(lua_State *L);
static int32 debug_pre_equip(lua_State *L);
static int32 debug_pre_set_target(lua_State *L);
static int32 debug_pre_add_counter(lua_State *L);
static int32 debug_reload_field_begin(lua_State *L);
static int32 debug_reload_field_end(lua_State *L);
static int32 debug_set_ai_name(lua_State *L);
......
--サイバー·プリマ
function c2158562.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2158562,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c2158562.descon)
e1:SetTarget(c2158562.destg)
e1:SetOperation(c2158562.desop)
c:RegisterEffect(e1)
end
function c2158562.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE
end
function c2158562.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c2158562.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c2158562.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0,nil)
end
function c2158562.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c2158562.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -17,10 +17,11 @@ function c21672573.initial_effect(c)
c:RegisterEffect(e2)
end
function c21672573.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()~=e:GetHandler() and bit.band(eg:GetFirst():GetSummonType(),SUMMON_TYPE_ADVANCE)~=0
return eg:GetFirst()~=e:GetHandler() and ep==tp
and bit.band(eg:GetFirst():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c21672573.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():GetMaterialCount()~=0
return eg:GetFirst():GetMaterialCount()~=0 and ep==tp
end
function c21672573.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......
......@@ -27,7 +27,7 @@ function c31571902.ntop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCondition(c31571902.tgcon)
e1:SetTarget(c31571902.tgtg)
e1:SetOperation(c31571902.tgop)
e1:SetReset(RESET_EVENT+0xee0000)
e1:SetReset(RESET_EVENT+0xc6e0000)
c:RegisterEffect(e1)
end
function c31571902.filter(c)
......
--光神機-閃空
function c32918479.initial_effect(c)
--handes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32918479,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c32918479.condition)
e1:SetTarget(c32918479.target)
e1:SetOperation(c32918479.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(c32918479.regop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c32918479.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c32918479.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,0,0,tp,1)
end
function c32918479.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c32918479.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32918479,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_REPEAT)
e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetTarget(c32918479.tgtg)
e1:SetOperation(c32918479.tgop)
e1:SetReset(RESET_EVENT+0xc6c0000)
c:RegisterEffect(e1)
end
function c32918479.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c32918479.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c32918479.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c32918479.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
--Щ`
function c49375719.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c49375719.dacon)
c:RegisterEffect(e1)
end
function c49375719.filter(c,atk)
return c:IsFacedown() or c:GetAttack()<=atk
end
function c49375719.dacon(e)
return not Duel.IsExistingMatchingCard(c49375719.filter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil,e:GetHandler():GetAttack())
end
--封魔の呪印
function c58851034.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c58851034.condition)
e1:SetCost(c58851034.cost)
e1:SetTarget(c58851034.target)
e1:SetOperation(c58851034.activate)
c:RegisterEffect(e1)
end
function c58851034.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c58851034.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function c58851034.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58851034.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c58851034.cfilter,1,1,REASON_COST,nil)
end
function c58851034.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c58851034.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c58851034.aclimit)
e1:SetLabel(re:GetHandler():GetCode())
Duel.RegisterEffect(e1,tp)
end
function c58851034.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(e:GetLabel())
end
......@@ -32,7 +32,7 @@ function c61370518.disop(e,tp,eg,ep,ev,re,r,rp)
if not tg or not tg:IsContains(e:GetHandler()) or not Duel.IsChainDisablable(ev) then return false end
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 and dc==3 and dc==6 then
if dc==1 or dc==3 or dc==6 then
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
......
......@@ -22,7 +22,8 @@ function c64382839.initial_effect(c)
c:RegisterEffect(e2)
end
function c64382839.cfilter(c,tp)
return c:GetPreviousControler()==1-tp and (c:IsType(TYPE_MONSTER) or c:IsPreviousLocation(LOCATION_MZONE))
return c:GetPreviousControler()==1-tp and (c:IsPreviousLocation(LOCATION_MZONE) or
(c:IsPreviousLocation(LOCATION_SZONE) and c:IsType(TYPE_MONSTER)))
end
function c64382839.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c64382839.cfilter,1,nil,tp)
......
--サーチライトメン
function c67646312.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67646312,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetOperation(c67646312.operation)
c:RegisterEffect(e1)
end
function c67646312.operation(e,tp,eg,ep,ev,re,r,rp)
--cannot set
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_MSET)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SSET)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_TURN_SET)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTarget(c67646312.sumlimit)
Duel.RegisterEffect(e4,tp)
end
function c67646312.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
......@@ -26,7 +26,7 @@ function c69303178.ntop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetTarget(c69303178.tgtg)
e1:SetOperation(c69303178.tgop)
e1:SetReset(RESET_EVENT+0xee0000)
e1:SetReset(RESET_EVENT+0xc6e0000)
c:RegisterEffect(e1)
end
function c69303178.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
--サイバー·ジムナティクス
function c76763417.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76763417,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c76763417.descost)
e1:SetTarget(c76763417.destg)
e1:SetOperation(c76763417.desop)
c:RegisterEffect(e1)
end
function c76763417.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c76763417.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsDestructable()
end
function c76763417.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c76763417.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c76763417.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c76763417.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c76763417.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsPosition(POS_FACEUP_ATTACK) and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--真空イタチ
function c93730409.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93730409,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetOperation(c93730409.operation)
c:RegisterEffect(e1)
end
function c93730409.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c93730409.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c93730409.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
......@@ -35,7 +35,7 @@ function c95701283.otop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetTarget(c95701283.tgtg)
e1:SetOperation(c95701283.tgop)
e1:SetReset(RESET_EVENT+0xee0000)
e1:SetReset(RESET_EVENT+0xc6e0000)
c:RegisterEffect(e1)
end
function c95701283.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
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