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
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
MyCard
ygopro-core
Commits
d2795a34
Commit
d2795a34
authored
Mar 19, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
465f5b07
bb7e8615
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
libduel.cpp
libduel.cpp
+19
-0
scriptlib.h
scriptlib.h
+2
-1
No files found.
libduel.cpp
View file @
d2795a34
...
...
@@ -2189,6 +2189,24 @@ int32 scriptlib::duel_get_attack_target(lua_State *L) {
interpreter::card2value(L, pcard);
return 1;
}
int32 scriptlib::duel_get_battle_monster(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_INT, 1);
duel* pduel = interpreter::get_duel_info(L);
uint32 playerid = (uint32)lua_tointeger(L, 1);
card* attacker = pduel->game_field->core.attacker;
card* defender = pduel->game_field->core.attack_target;
for(int32 i = 0; i < 2; i++) {
if(attacker && attacker->current.controler == playerid)
interpreter::card2value(L, attacker);
else if(defender && defender->current.controler == playerid)
interpreter::card2value(L, defender);
else
lua_pushnil(L);
playerid = 1 - playerid;
}
return 2;
}
int32 scriptlib::duel_disable_attack(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->add_process(PROCESSOR_ATTACK_DISABLE, 0, 0, 0, 0, 0);
...
...
@@ -4451,6 +4469,7 @@ static const struct luaL_Reg duellib[] = {
{ "IsDamageCalculated", scriptlib::duel_is_damage_calculated },
{ "GetAttacker", scriptlib::duel_get_attacker },
{ "GetAttackTarget", scriptlib::duel_get_attack_target },
{ "GetBattleMonster", scriptlib::duel_get_battle_monster },
{ "NegateAttack", scriptlib::duel_disable_attack },
{ "ChainAttack", scriptlib::duel_chain_attack },
{ "Readjust", scriptlib::duel_readjust },
...
...
scriptlib.h
View file @
d2795a34
...
...
@@ -469,7 +469,8 @@ public:
static
int32
duel_skip_phase
(
lua_State
*
L
);
static
int32
duel_is_damage_calculated
(
lua_State
*
L
);
static
int32
duel_get_attacker
(
lua_State
*
L
);
static
int32
duel_get_attack_target
(
lua_State
*
L
);
static
int32
duel_get_attack_target
(
lua_State
*
L
);
static
int32
duel_get_battle_monster
(
lua_State
*
L
);
static
int32
duel_disable_attack
(
lua_State
*
L
);
static
int32
duel_chain_attack
(
lua_State
*
L
);
static
int32
duel_readjust
(
lua_State
*
L
);
...
...
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