Commit 834e2938 authored by salix5's avatar salix5

EFFECT_UNSUMMONABLE_CARD, EFFECT_REVIVE_LIMIT

revised
parent 2cf47492
......@@ -1796,7 +1796,7 @@ int32 card::is_equipable(card* pcard) {
int32 card::is_summonable() {
if(!(data.type & TYPE_MONSTER))
return FALSE;
return !(status & (STATUS_REVIVE_LIMIT | STATUS_UNSUMMONABLE_CARD));
return !is_affected_by_effect(EFFECT_UNSUMMONABLE_CARD);
}
int32 card::is_summonable(effect* peffect) {
effect* oreason = pduel->game_field->core.reason_effect;
......@@ -1874,7 +1874,7 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
return FALSE;
}
} else if(current.location == LOCATION_HAND) {
if(is_status(STATUS_REVIVE_LIMIT) || is_affected_by_effect(EFFECT_CANNOT_SUMMON)) {
if(is_affected_by_effect(EFFECT_CANNOT_SUMMON)) {
pduel->game_field->restore_lp_cost();
return FALSE;
}
......@@ -2014,7 +2014,7 @@ int32 card::is_can_be_special_summoned(effect * reason_effect, uint32 sumtype, u
return FALSE;
if(current.location == LOCATION_REMOVED && (current.position & POS_FACEDOWN))
return FALSE;
if(is_status(STATUS_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE)) {
if(is_affected_by_effect(EFFECT_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE)) {
if((!nolimit && (current.location & 0x38)) || (!nocheck && !nolimit && (current.location & 0x3)))
return FALSE;
if(!nolimit && (data.type & TYPE_PENDULUM) && current.location == LOCATION_EXTRA && (current.position & POS_FACEUP))
......@@ -2070,7 +2070,7 @@ int32 card::is_can_be_special_summoned(effect * reason_effect, uint32 sumtype, u
int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect, uint8 min_tribute) {
if(!(data.type & TYPE_MONSTER))
return FALSE;
if(status & (STATUS_REVIVE_LIMIT | STATUS_UNSUMMONABLE_CARD))
if(is_affected_by_effect(EFFECT_UNSUMMONABLE_CARD))
return FALSE;
if(current.location != LOCATION_HAND)
return FALSE;
......
......@@ -378,6 +378,8 @@ public:
#define EFFECT_CANNOT_SELECT_BATTLE_TARGET 332
#define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333
#define EFFECT_ADD_SETCODE 334
#define EFFECT_NO_EFFECT_DAMAGE 335
#define EFFECT_UNSUMMONABLE_CARD 336
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
......
......@@ -135,6 +135,7 @@ static const struct luaL_Reg cardlib[] = {
{ "IsRelateToCard", scriptlib::card_is_relate_to_card },
{ "IsRelateToBattle", scriptlib::card_is_relate_to_battle },
{ "CopyEffect", scriptlib::card_copy_effect },
{ "EnableUnsummonable", scriptlib::card_enable_unsummonable },
{ "EnableReviveLimit", scriptlib::card_enable_revive_limit },
{ "CompleteProcedure", scriptlib::card_complete_procedure },
{ "IsDisabled", scriptlib::card_is_disabled },
......
......@@ -1133,12 +1133,40 @@ int32 scriptlib::card_copy_effect(lua_State *L) {
lua_pushinteger(L, pcard->copy_effect(code, reset, count));
return 1;
}
int32 scriptlib::card_enable_unsummonable(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel;
if(!pcard->is_status(STATUS_COPYING_EFFECT)) {
effect* peffect = pduel->new_effect();
peffect->owner = pcard;
peffect->code = EFFECT_UNSUMMONABLE_CARD;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->flag = EFFECT_FLAG_CANNOT_DISABLE | EFFECT_FLAG_UNCOPYABLE;
pcard->add_effect(peffect);
}
return 0;
}
int32 scriptlib::card_enable_revive_limit(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(!pcard->is_status(STATUS_COPYING_EFFECT))
pcard->set_status(STATUS_REVIVE_LIMIT, TRUE);
duel* pduel = pcard->pduel;
if(!pcard->is_status(STATUS_COPYING_EFFECT)) {
effect* peffect1 = pduel->new_effect();
peffect1->owner = pcard;
peffect1->code = EFFECT_UNSUMMONABLE_CARD;
peffect1->type = EFFECT_TYPE_SINGLE;
peffect1->flag = EFFECT_FLAG_CANNOT_DISABLE | EFFECT_FLAG_UNCOPYABLE;
pcard->add_effect(peffect1);
effect* peffect2 = pduel->new_effect();
peffect2->owner = pcard;
peffect2->code = EFFECT_REVIVE_LIMIT;
peffect2->type = EFFECT_TYPE_SINGLE;
peffect2->flag = EFFECT_FLAG_CANNOT_DISABLE | EFFECT_FLAG_UNCOPYABLE;
pcard->add_effect(peffect2);
}
return 0;
}
int32 scriptlib::card_complete_procedure(lua_State *L) {
......
......@@ -1666,7 +1666,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, uint8 ignore_count, uint8 min_tribute) {
switch(step) {
case 0: {
if(target->is_status(STATUS_REVIVE_LIMIT))
if(target->is_affected_by_effect(EFFECT_UNSUMMONABLE_CARD))
return TRUE;
if(target->current.location != LOCATION_HAND)
return TRUE;
......@@ -2412,7 +2412,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
returns.ivalue[0] = FALSE;
uint32 result = TRUE;
effect_set eset;
if(target->is_status(STATUS_REVIVE_LIMIT) && !target->is_status(STATUS_PROC_COMPLETE)) {
if(target->is_affected_by_effect(EFFECT_REVIVE_LIMIT) && !target->is_status(STATUS_PROC_COMPLETE)) {
if((!nolimit && (target->current.location & 0x38)) || (!nocheck && !nolimit && (target->current.location & 0x3)))
result = FALSE;
}
......
......@@ -137,6 +137,7 @@ public:
static int32 card_is_relate_to_card(lua_State *L);
static int32 card_is_relate_to_battle(lua_State *L);
static int32 card_copy_effect(lua_State *L);
static int32 card_enable_unsummonable(lua_State *L);
static int32 card_enable_revive_limit(lua_State *L);
static int32 card_complete_procedure(lua_State *L);
static int32 card_is_disabled(lua_State *L);
......
--PSYフレームギア・ε
function c1697104.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--レアメタル・ドラゴン
function c25236056.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
end
--PSYフレームギア・β
function c2810642.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--PSYフレームギア・γ
function c38814750.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -30,7 +30,7 @@ end
function c40607210.condition(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc and rc:IsRace(RACE_ZOMBIE) and eg:IsExists(c40607210.cfilter,1,nil,tp)
and (re:GetCode()~=EFFECT_SPSUMMON_PROC or not rc:IsStatus(STATUS_REVIVE_LIMIT))
and (re:GetCode()~=EFFECT_SPSUMMON_PROC or not rc:IsHasEffect(EFFECT_REVIVE_LIMIT))
end
function c40607210.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
......
--魂食神龍ドレイン・ドラゴン
function c55735315.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--ライトロード・ビースト ウォルフ
function c58996430.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
......
--ライトロード・アーチャー フェリス
function c73176465.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73176465,0))
......
--PSYフレームギア・δ
function c74203495.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--PSYフレームギア・α
function c75425043.initial_effect(c)
c:SetStatus(STATUS_UNSUMMONABLE_CARD,true)
c:EnableUnsummonable()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -130,7 +130,7 @@ STATUS_TO_DISABLE =0x0004 --将变成无效
STATUS_PROC_COMPLETE =0x0008 --完成正规召唤(解除苏生限制)
STATUS_SET_TURN =0x0010 --覆盖
STATUS_NO_LEVEL =0x0020 --无等级
STATUS_REVIVE_LIMIT =0x0040 --未解除苏生限制
STATUS_REVIVE_LIMIT =0x0040 --(N/A)
STATUS_SPSUMMON_STEP =0x0080 --效果特召處理中
STATUS_FORM_CHANGED =0x0100 --改变过表示形式
STATUS_SUMMONING =0x0200 --召唤中
......@@ -143,7 +143,7 @@ STATUS_COPYING_EFFECT =0x8000 --复制效果
STATUS_CHAINING =0x10000 --正在連鎖串中
STATUS_SUMMON_DISABLED =0x20000 --召唤无效後尚未移動
STATUS_ACTIVATE_DISABLED =0x40000 --发动无效
STATUS_UNSUMMONABLE_CARD =0x80000 --不能通常召唤
STATUS_UNSUMMONABLE_CARD =0x80000 --(N/A)
STATUS_UNION =0x100000 --同盟
STATUS_ATTACK_CANCELED =0x200000 --攻击取消(卷回?)
STATUS_INITIALIZING =0x400000 --初始化..
......@@ -298,8 +298,8 @@ EFFECT_CANNOT_DISABLE_SPSUMMON =27 --特殊召唤不会无效
EFFECT_SET_SUMMON_COUNT_LIMIT =28 --限制每回合放置怪兽次数
EFFECT_EXTRA_SUMMON_COUNT =29 --增加召唤(通常召唤)次数
EFFECT_SPSUMMON_CONDITION =30 --特殊召唤条件
EFFECT_REVIVE_LIMIT =31 --苏生限制
EFFECT_SUMMON_PROC =32 --召唤规则
EFFECT_REVIVE_LIMIT =31 --有苏生限制的怪獸
EFFECT_SUMMON_PROC =32 --召唤规则效果
EFFECT_LIMIT_SUMMON_PROC =33 --召唤规则限制
EFFECT_SPSUMMON_PROC =34 --特殊召唤规则
EFFECT_EXTRA_SET_COUNT =35 --增加盖放(通常召唤)次数
......@@ -476,6 +476,7 @@ EFFECT_CANNOT_SELECT_BATTLE_TARGET =332 --對手不能選擇為攻擊對象
EFFECT_CANNOT_SELECT_EFFECT_TARGET =333 --對手不能選擇為效果對象
EFFECT_ADD_SETCODE =334 --规则上视为「XX」字段
EFFECT_NO_EFFECT_DAMAGE =335 --玩家已受到"效果傷害變成0"的效果影響
EFFECT_UNSUMMONABLE_CARD =336 --不能通常召唤的怪獸
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --游戏开始时
......
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