Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
xiaoye
ygopro-core
Commits
7c9d72a7
Commit
7c9d72a7
authored
Dec 31, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into patch-rule
parents
3b4239fc
b6819fe0
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
186 additions
and
106 deletions
+186
-106
effect.h
effect.h
+2
-0
interpreter.cpp
interpreter.cpp
+7
-3
libeffect.cpp
libeffect.cpp
+2
-0
operations.cpp
operations.cpp
+19
-4
processor.cpp
processor.cpp
+156
-99
No files found.
effect.h
View file @
7c9d72a7
...
...
@@ -363,6 +363,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_PIERCE 203
#define EFFECT_BATTLE_DESTROY_REDIRECT 204
#define EFFECT_BATTLE_DAMAGE_TO_EFFECT 205
#define EFFECT_BOTH_BATTLE_DAMAGE 206
#define EFFECT_ALSO_BATTLE_DAMAGE 207
#define EFFECT_TOSS_COIN_REPLACE 220
#define EFFECT_TOSS_DICE_REPLACE 221
#define EFFECT_FUSION_MATERIAL 230
...
...
interpreter.cpp
View file @
7c9d72a7
...
...
@@ -1031,7 +1031,7 @@ int32 interpreter::get_operation_value(card* pcard, int32 findex, int32 extraarg
}
return
OPERATION_FAIL
;
}
int32
result
=
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
int32
result
=
lua_isinteger
(
current_state
,
-
1
)
?
lua_tointeger
(
current_state
,
-
1
)
:
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
lua_pop
(
current_state
,
1
);
no_action
--
;
call_depth
--
;
...
...
@@ -1050,8 +1050,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count) {
call_depth
++
;
if
(
call_function
(
f
,
param_count
,
1
))
{
int32
result
=
0
;
if
(
lua_isboolean
(
current_state
,
-
1
))
if
(
lua_isboolean
(
current_state
,
-
1
))
result
=
lua_toboolean
(
current_state
,
-
1
);
else
if
(
lua_isinteger
(
current_state
,
-
1
))
result
=
lua_tointeger
(
current_state
,
-
1
);
else
result
=
std
::
round
(
lua_tonumber
(
current_state
,
-
1
));
lua_pop
(
current_state
,
1
);
...
...
@@ -1084,8 +1086,10 @@ int32 interpreter::get_function_value(int32 f, uint32 param_count, std::vector<i
int32
stack_newtop
=
lua_gettop
(
current_state
);
for
(
int32
index
=
stack_top
+
1
;
index
<=
stack_newtop
;
++
index
)
{
int32
return_value
=
0
;
if
(
lua_isboolean
(
current_state
,
index
))
if
(
lua_isboolean
(
current_state
,
index
))
return_value
=
lua_toboolean
(
current_state
,
index
);
else
if
(
lua_isinteger
(
current_state
,
index
))
return_value
=
lua_tointeger
(
current_state
,
index
);
else
return_value
=
std
::
round
(
lua_tonumber
(
current_state
,
index
));
result
->
push_back
(
return_value
);
...
...
libeffect.cpp
View file @
7c9d72a7
...
...
@@ -266,6 +266,8 @@ int32 scriptlib::effect_set_value(lua_State *L) {
peffect
->
flag
[
0
]
&=
~
EFFECT_FLAG_FUNC_VALUE
;
if
(
lua_isboolean
(
L
,
2
))
peffect
->
value
=
lua_toboolean
(
L
,
2
);
else
if
(
lua_isinteger
(
L
,
2
))
peffect
->
value
=
lua_tointeger
(
L
,
2
);
else
peffect
->
value
=
std
::
round
(
lua_tonumber
(
L
,
2
));
}
...
...
operations.cpp
View file @
7c9d72a7
...
...
@@ -1400,8 +1400,22 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
returns
.
ivalue
[
0
]
=
FALSE
;
if
(
!
equip_card
->
is_affect_by_effect
(
core
.
reason_effect
))
return
TRUE
;
if
(
equip_card
==
target
||
target
->
current
.
location
!=
LOCATION_MZONE
)
if
(
equip_card
==
target
)
return
TRUE
;
bool
to_grave
=
false
;
if
(
target
->
current
.
location
!=
LOCATION_MZONE
||
(
target
->
current
.
position
&
POS_FACEDOWN
))
to_grave
=
true
;
if
(
equip_card
->
current
.
location
!=
LOCATION_SZONE
)
{
refresh_location_info_instant
();
if
(
get_useable_count
(
equip_card
,
equip_player
,
LOCATION_SZONE
,
equip_player
,
LOCATION_REASON_TOFIELD
)
<=
0
)
to_grave
=
true
;
}
if
(
to_grave
)
{
if
(
equip_card
->
current
.
location
!=
LOCATION_GRAVE
)
send_to
(
equip_card
,
0
,
REASON_RULE
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
}
if
(
equip_card
->
equiping_target
)
{
equip_card
->
cancel_card_target
(
equip_card
->
equiping_target
);
equip_card
->
unequip
();
...
...
@@ -1413,9 +1427,6 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
change_position
(
equip_card
,
0
,
equip_player
,
POS_FACEUP
,
0
);
return
FALSE
;
}
refresh_location_info_instant
();
if
(
get_useable_count
(
equip_card
,
equip_player
,
LOCATION_SZONE
,
equip_player
,
LOCATION_REASON_TOFIELD
)
<=
0
)
return
TRUE
;
equip_card
->
enable_field_effect
(
false
);
move_to_field
(
equip_card
,
equip_player
,
equip_player
,
LOCATION_SZONE
,
(
up
||
equip_card
->
is_position
(
POS_FACEUP
))
?
POS_FACEUP
:
POS_FACEDOWN
,
FALSE
,
0
,
TRUE
);
return
FALSE
;
...
...
@@ -1465,6 +1476,10 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
returns
.
ivalue
[
0
]
=
TRUE
;
return
TRUE
;
}
case
3
:
{
returns
.
ivalue
[
0
]
=
FALSE
;
return
TRUE
;
}
}
return
TRUE
;
}
...
...
processor.cpp
View file @
7c9d72a7
This diff is collapsed.
Click to expand it.
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