Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro
Commits
a24a58cb
Commit
a24a58cb
authored
Sep 05, 2015
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Effect.IsActivated()
parent
5a5923e6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
6 deletions
+20
-6
ocgcore/card.cpp
ocgcore/card.cpp
+3
-0
ocgcore/effect.h
ocgcore/effect.h
+1
-0
ocgcore/field.cpp
ocgcore/field.cpp
+3
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+1
-0
ocgcore/libeffect.cpp
ocgcore/libeffect.cpp
+7
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+1
-0
script/c15939229.lua
script/c15939229.lua
+1
-2
script/constant.lua
script/constant.lua
+1
-1
script/utility.lua
script/utility.lua
+2
-3
No files found.
ocgcore/card.cpp
View file @
a24a58cb
...
...
@@ -1068,6 +1068,9 @@ int32 card::add_effect(effect* peffect) {
}
indexer
.
insert
(
make_pair
(
peffect
,
it
));
peffect
->
handler
=
this
;
if
((
peffect
->
type
&
0x7e0
)
||
(
pduel
->
game_field
->
core
.
reason_effect
&&
(
pduel
->
game_field
->
core
.
reason_effect
->
status
&
EFFECT_STATUS_ACTIVATED
)))
peffect
->
status
|=
EFFECT_STATUS_ACTIVATED
;
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
)
&&
(
peffect
->
type
&
EFFECT_TYPE_FIELD
))
pduel
->
game_field
->
add_effect
(
peffect
);
if
(
current
.
controler
!=
PLAYER_NONE
&&
check_target
)
{
...
...
ocgcore/effect.h
View file @
a24a58cb
...
...
@@ -90,6 +90,7 @@ public:
//status
#define EFFECT_STATUS_AVAILABLE 0x0001
#define EFFECT_STATUS_ACTIVATED 0x0002
#define EFFECT_COUNT_CODE_OATH 0x10000000
#define EFFECT_COUNT_CODE_DUEL 0x20000000
...
...
ocgcore/field.cpp
View file @
a24a58cb
...
...
@@ -709,6 +709,9 @@ void field::add_effect(effect* peffect, uint8 owner_player) {
peffect
->
effect_owner
=
owner_player
;
peffect
->
id
=
infos
.
field_id
++
;
}
if
((
peffect
->
type
&
0x7e0
)
||
(
core
.
reason_effect
&&
(
core
.
reason_effect
->
status
&
EFFECT_STATUS_ACTIVATED
)))
peffect
->
status
|=
EFFECT_STATUS_ACTIVATED
;
peffect
->
card_type
=
peffect
->
owner
->
data
.
type
;
effect_container
::
iterator
it
;
if
(
!
(
peffect
->
type
&
EFFECT_TYPE_ACTIONS
))
{
...
...
ocgcore/interpreter.cpp
View file @
a24a58cb
...
...
@@ -265,6 +265,7 @@ static const struct luaL_Reg effectlib[] = {
{
"IsHasCategory"
,
scriptlib
::
effect_is_has_category
},
{
"IsHasType"
,
scriptlib
::
effect_is_has_type
},
{
"IsActivatable"
,
scriptlib
::
effect_is_activatable
},
{
"IsActivated"
,
scriptlib
::
effect_is_activated
},
{
"GetActivateLocation"
,
scriptlib
::
effect_get_activate_location
},
{
NULL
,
NULL
}
};
...
...
ocgcore/libeffect.cpp
View file @
a24a58cb
...
...
@@ -526,6 +526,13 @@ int32 scriptlib::effect_is_activatable(lua_State *L) {
lua_pushboolean
(
L
,
peffect
->
is_activateable
(
playerid
,
peffect
->
pduel
->
game_field
->
nil_event
));
return
1
;
}
int32
scriptlib
::
effect_is_activated
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
lua_pushboolean
(
L
,
(
peffect
->
status
&
EFFECT_STATUS_ACTIVATED
));
return
1
;
}
int32
scriptlib
::
effect_get_activate_location
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
ocgcore/scriptlib.h
View file @
a24a58cb
...
...
@@ -265,6 +265,7 @@ public:
static
int32
effect_is_has_category
(
lua_State
*
L
);
static
int32
effect_is_has_type
(
lua_State
*
L
);
static
int32
effect_is_activatable
(
lua_State
*
L
);
static
int32
effect_is_activated
(
lua_State
*
L
);
static
int32
effect_get_activate_location
(
lua_State
*
L
);
//Group functions
...
...
script/c15939229.lua
View file @
a24a58cb
...
...
@@ -38,7 +38,7 @@ function c15939229.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetValue
(
c15939229
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
...
...
@@ -46,7 +46,6 @@ function c15939229.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DISABLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CONTINUOUS
)
e2
:
SetTargetRange
(
LOCATION_ONFIELD
,
LOCATION_ONFIELD
)
e2
:
SetTarget
(
c15939229
.
disable
)
e2
:
SetReset
(
RESET_PHASE
+
RESET_END
)
...
...
script/constant.lua
View file @
a24a58cb
...
...
@@ -246,7 +246,7 @@ EFFECT_FLAG_IGNORE_RANGE =0x0020 --影响所有区域的卡(禁止令 大宇
EFFECT_FLAG_ABSOLUTE_TARGET
=
0x0040
--Target Range不会因为控制权的改变而改变
EFFECT_FLAG_IGNORE_IMMUNE
=
0x0080
--无视效果免疫
EFFECT_FLAG_SET_AVAILABLE
=
0x0100
--影响场上里侧的卡/裡側狀態可發動
EFFECT_FLAG_CONTINUOUS
=
0x0200
--
由不入連鎖的效果產生的全局效果
EFFECT_FLAG_CONTINUOUS
=
0x0200
--
N/A
EFFECT_FLAG_CANNOT_DISABLE
=
0x0400
--不会被无效
EFFECT_FLAG_PLAYER_TARGET
=
0x0800
--以玩家为对象
EFFECT_FLAG_BOTH_SIDE
=
0x1000
--双方都能使用(部分场地,弹压)
...
...
script/utility.lua
View file @
a24a58cb
...
...
@@ -1252,9 +1252,8 @@ function Auxiliary.damcon1(e,tp,eg,ep,ev,re,r,rp)
end
--filter for the immune effetc of qli monsters
function
Auxiliary
.
qlifilter
(
e
,
te
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
and
(
te
:
IsHasType
(
0x7e0
)
or
(
te
:
IsHasProperty
(
EFFECT_FLAG_FIELD_ONLY
)
and
not
te
:
IsHasProperty
(
EFFECT_FLAG_CONTINUOUS
))
or
te
:
IsHasProperty
(
EFFECT_FLAG_OWNER_RELATE
))
then
if
te
:
IsActiveType
(
TYPE_MONSTER
)
and
(
te
:
IsActivated
()
or
te
:
IsHasProperty
(
EFFECT_FLAG_OWNER_RELATE
))
then
local
lv
=
e
:
GetHandler
():
GetLevel
()
local
ec
=
te
:
GetOwner
()
if
ec
:
IsType
(
TYPE_XYZ
)
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment