Commit 1308d53b authored by argon.sun's avatar argon.sun

prohibition

parent 2d0d9709
...@@ -1408,6 +1408,8 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe ...@@ -1408,6 +1408,8 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
if(!ignore_count && (pduel->game_field->core.extra_summon[playerid] || !is_affected_by_effect(EFFECT_EXTRA_SUMMON_COUNT)) if(!ignore_count && (pduel->game_field->core.extra_summon[playerid] || !is_affected_by_effect(EFFECT_EXTRA_SUMMON_COUNT))
&& pduel->game_field->core.summon_count[playerid] >= pduel->game_field->get_summon_count_limit(playerid)) && pduel->game_field->core.summon_count[playerid] >= pduel->game_field->get_summon_count_limit(playerid))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
pduel->game_field->save_lp_cost(); pduel->game_field->save_lp_cost();
effect_set eset; effect_set eset;
filter_effect(EFFECT_SUMMON_COST, &eset); filter_effect(EFFECT_SUMMON_COST, &eset);
...@@ -1499,6 +1501,8 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) { ...@@ -1499,6 +1501,8 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) {
return FALSE; return FALSE;
if(!pduel->game_field->is_player_can_flipsummon(playerid, this)) if(!pduel->game_field->is_player_can_flipsummon(playerid, this))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_FLIP_SUMMON)) if(is_affected_by_effect(EFFECT_CANNOT_FLIP_SUMMON))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_POSITION)) if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_POSITION))
...@@ -1527,6 +1531,8 @@ int32 card::is_special_summonable(uint8 playerid) { ...@@ -1527,6 +1531,8 @@ int32 card::is_special_summonable(uint8 playerid) {
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON)) if(is_affected_by_effect(EFFECT_CANNOT_SPECIAL_SUMMON))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(current.location & (LOCATION_GRAVE + LOCATION_REMOVED) && is_status(STATUS_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE)) if(current.location & (LOCATION_GRAVE + LOCATION_REMOVED) && is_status(STATUS_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE))
return FALSE; return FALSE;
pduel->game_field->save_lp_cost(); pduel->game_field->save_lp_cost();
...@@ -1610,6 +1616,8 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect ...@@ -1610,6 +1616,8 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
return FALSE; return FALSE;
if(current.location != LOCATION_HAND) if(current.location != LOCATION_HAND)
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_MSET)) if(is_affected_by_effect(EFFECT_CANNOT_MSET))
return FALSE; return FALSE;
if(!ignore_count && (pduel->game_field->core.extra_summon[playerid] || !is_affected_by_effect(EFFECT_EXTRA_SET_COUNT)) if(!ignore_count && (pduel->game_field->core.extra_summon[playerid] || !is_affected_by_effect(EFFECT_EXTRA_SET_COUNT))
...@@ -1645,6 +1653,8 @@ int32 card::is_setable_szone(uint8 playerid) { ...@@ -1645,6 +1653,8 @@ int32 card::is_setable_szone(uint8 playerid) {
return FALSE; return FALSE;
if(data.type & TYPE_MONSTER && !is_affected_by_effect(EFFECT_MONSTER_SSET)) if(data.type & TYPE_MONSTER && !is_affected_by_effect(EFFECT_MONSTER_SSET))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_SSET)) if(is_affected_by_effect(EFFECT_CANNOT_SSET))
return FALSE; return FALSE;
if(!pduel->game_field->is_player_can_sset(playerid, this)) if(!pduel->game_field->is_player_can_sset(playerid, this))
...@@ -1868,6 +1878,8 @@ int32 card::is_capable_cost_to_extra(uint8 playerid) { ...@@ -1868,6 +1878,8 @@ int32 card::is_capable_cost_to_extra(uint8 playerid) {
int32 card::is_capable_attack() { int32 card::is_capable_attack() {
if(!is_position(POS_FACEUP_ATTACK) && !(is_position(POS_FACEUP_DEFENCE) && is_affected_by_effect(EFFECT_DEFENCE_ATTACK))) if(!is_position(POS_FACEUP_ATTACK) && !(is_position(POS_FACEUP_DEFENCE) && is_affected_by_effect(EFFECT_DEFENCE_ATTACK)))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_ATTACK)) if(is_affected_by_effect(EFFECT_CANNOT_ATTACK))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_ATTACK_DISABLED)) if(is_affected_by_effect(EFFECT_ATTACK_DISABLED))
...@@ -1904,6 +1916,8 @@ int32 card::is_capable_change_position(uint8 playerid) { ...@@ -1904,6 +1916,8 @@ int32 card::is_capable_change_position(uint8 playerid) {
return FALSE; return FALSE;
if(announce_count > 0) if(announce_count > 0)
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_POSITION)) if(is_affected_by_effect(EFFECT_CANNOT_CHANGE_POSITION))
return FALSE; return FALSE;
if(pduel->game_field->is_player_affected_by_effect(playerid, EFFECT_CANNOT_CHANGE_POSITION)) if(pduel->game_field->is_player_affected_by_effect(playerid, EFFECT_CANNOT_CHANGE_POSITION))
...@@ -1961,6 +1975,8 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) { ...@@ -1961,6 +1975,8 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
int32 card::is_can_be_fusion_material() { int32 card::is_can_be_fusion_material() {
if(!(get_type()&TYPE_MONSTER)) if(!(get_type()&TYPE_MONSTER))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_BE_FUSION_MATERIAL)) if(is_affected_by_effect(EFFECT_CANNOT_BE_FUSION_MATERIAL))
return FALSE; return FALSE;
return TRUE; return TRUE;
...@@ -1972,6 +1988,8 @@ int32 card::is_can_be_synchro_material(card* scard) { ...@@ -1972,6 +1988,8 @@ int32 card::is_can_be_synchro_material(card* scard) {
return FALSE; return FALSE;
if(scard && current.controler != scard->current.controler && !is_affected_by_effect(EFFECT_SYNCHRO_MATERIAL)) if(scard && current.controler != scard->current.controler && !is_affected_by_effect(EFFECT_SYNCHRO_MATERIAL))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
effect_set eset; effect_set eset;
filter_effect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL, &eset); filter_effect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL, &eset);
for(int32 i = 0; i < eset.count; ++i) for(int32 i = 0; i < eset.count; ++i)
...@@ -1984,6 +2002,8 @@ int32 card::is_can_be_xyz_material(card* scard) { ...@@ -1984,6 +2002,8 @@ int32 card::is_can_be_xyz_material(card* scard) {
return FALSE; return FALSE;
if(!(get_type()&TYPE_MONSTER)) if(!(get_type()&TYPE_MONSTER))
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
effect_set eset; effect_set eset;
filter_effect(EFFECT_CANNOT_BE_XYZ_MATERIAL, &eset); filter_effect(EFFECT_CANNOT_BE_XYZ_MATERIAL, &eset);
for(int32 i = 0; i < eset.count; ++i) for(int32 i = 0; i < eset.count; ++i)
......
...@@ -94,6 +94,7 @@ public: ...@@ -94,6 +94,7 @@ public:
uint8 attacked_count; uint8 attacked_count;
uint16 cardid; uint16 cardid;
uint16 fieldid; uint16 fieldid;
uint16 fieldid_r;
uint16 turnid; uint16 turnid;
uint16 turn_counter; uint16 turn_counter;
card* equiping_target; card* equiping_target;
......
...@@ -142,6 +142,8 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int ...@@ -142,6 +142,8 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int
return FALSE; return FALSE;
} }
} }
if(handler->is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER)) if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER))
return FALSE; return FALSE;
} else if(!(type & EFFECT_TYPE_CONTINUOUS)) { } else if(!(type & EFFECT_TYPE_CONTINUOUS)) {
...@@ -158,6 +160,8 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int ...@@ -158,6 +160,8 @@ int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int
if(!((type & EFFECT_TYPE_IGNITION) || (type & EFFECT_TYPE_QUICK_O)) || !(flag & EFFECT_FLAG_BOTH_SIDE)) if(!((type & EFFECT_TYPE_IGNITION) || (type & EFFECT_TYPE_QUICK_O)) || !(flag & EFFECT_FLAG_BOTH_SIDE))
return FALSE; return FALSE;
} }
if(handler->is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER)) if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER))
return FALSE; return FALSE;
} else { } else {
......
...@@ -132,6 +132,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence ...@@ -132,6 +132,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
} }
pcard->apply_field_effect(); pcard->apply_field_effect();
pcard->fieldid = infos.field_id++; pcard->fieldid = infos.field_id++;
pcard->fieldid_r = pcard->fieldid;
pcard->turnid = infos.turn_id; pcard->turnid = infos.turn_id;
if (location == LOCATION_MZONE) if (location == LOCATION_MZONE)
player[playerid].used_location |= 1 << sequence; player[playerid].used_location |= 1 << sequence;
......
...@@ -56,6 +56,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -56,6 +56,7 @@ static const struct luaL_Reg cardlib[] = {
{ "GetLeaveFieldDest", scriptlib::card_get_leave_field_dest }, { "GetLeaveFieldDest", scriptlib::card_get_leave_field_dest },
{ "GetTurnID", scriptlib::card_get_turnid }, { "GetTurnID", scriptlib::card_get_turnid },
{ "GetFieldID", scriptlib::card_get_fieldid }, { "GetFieldID", scriptlib::card_get_fieldid },
{ "GetRealFieldID", scriptlib::card_get_fieldidr },
{ "IsCode", scriptlib::card_is_code }, { "IsCode", scriptlib::card_is_code },
{ "IsType", scriptlib::card_is_type }, { "IsType", scriptlib::card_is_type },
{ "IsRace", scriptlib::card_is_race }, { "IsRace", scriptlib::card_is_race },
......
...@@ -302,6 +302,13 @@ int32 scriptlib::card_get_fieldid(lua_State *L) { ...@@ -302,6 +302,13 @@ int32 scriptlib::card_get_fieldid(lua_State *L) {
lua_pushinteger(L, pcard->fieldid); lua_pushinteger(L, pcard->fieldid);
return 1; return 1;
} }
int32 scriptlib::card_get_fieldidr(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->fieldid_r);
return 1;
}
int32 scriptlib::card_is_code(lua_State *L) { int32 scriptlib::card_is_code(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -58,6 +58,7 @@ public: ...@@ -58,6 +58,7 @@ public:
static int32 card_get_leave_field_dest(lua_State *L); static int32 card_get_leave_field_dest(lua_State *L);
static int32 card_get_turnid(lua_State *L); static int32 card_get_turnid(lua_State *L);
static int32 card_get_fieldid(lua_State *L); static int32 card_get_fieldid(lua_State *L);
static int32 card_get_fieldidr(lua_State *L);
static int32 card_is_code(lua_State *L); static int32 card_is_code(lua_State *L);
static int32 card_is_type(lua_State *L); static int32 card_is_type(lua_State *L);
static int32 card_is_race(lua_State *L); static int32 card_is_race(lua_State *L);
......
...@@ -13,7 +13,7 @@ end ...@@ -13,7 +13,7 @@ end
function c15800838.target(e,tp,eg,ep,ev,re,r,rp,chk) function c15800838.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,564)
local ac=Duel.AnnounceCard(tp) local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac) e:SetLabel(ac)
e:GetHandler():SetHint(CHINT_CARD,ac) e:GetHandler():SetHint(CHINT_CARD,ac)
......
--サイキック·ブロッカー
function c29417188.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29417188,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c29417188.target)
e1:SetOperation(c29417188.operation)
c:RegisterEffect(e1)
end
function c29417188.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,564)
local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac)
e:GetHandler():SetHint(CHINT_CARD,ac)
end
function c29417188.operation(e,tp,eg,ep,ev,re,r,rp)
--forbidden
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e1:SetCode(EFFECT_FORBIDDEN)
e1:SetTarget(c29417188.bantg)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(c29417188.bantg)
e2:SetLabel(e:GetLabel())
e2:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e2,tp)
end
function c29417188.bantg(e,c)
return c:IsCode(e:GetLabel())
end
--禁止令
function c43711255.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c43711255.target)
c:RegisterEffect(e1)
--forbidden
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e2:SetCode(EFFECT_FORBIDDEN)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c43711255.bantg)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e3:SetTarget(c43711255.bantg)
e3:SetLabelObject(e1)
c:RegisterEffect(e3)
end
function c43711255.bantg(e,c)
return c:IsCode(e:GetLabelObject():GetLabel()) and (not c:IsOnField() or c:GetRealFieldID()>e:GetHandler():GetRealFieldID())
end
function c43711255.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,564)
local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac)
e:GetHandler():SetHint(CHINT_CARD,ac)
end
...@@ -8,10 +8,9 @@ function c81674782.initial_effect(c) ...@@ -8,10 +8,9 @@ function c81674782.initial_effect(c)
--remove --remove
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT) e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetTarget(c81674782.rmtarget) e2:SetTarget(c81674782.rmtarget)
e2:SetValue(LOCATION_REMOVED) e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2) c:RegisterEffect(e2)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
antialias = 2 antialias = 2
nickname = Player nickname = Player
gamename = Game gamename = Game
lastdeck = test lastdeck = Burn1
textfont = c:/windows/fonts/simsun.ttc textfont = c:/windows/fonts/simsun.ttc
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911 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