Skip to content

Commit

Permalink
请君试问东流水,别意与之谁短长
Browse files Browse the repository at this point in the history
对话指令改一下
  • Loading branch information
scarsty committed Aug 30, 2024
1 parent 1020603 commit 7685bf6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
20 changes: 10 additions & 10 deletions abc/abc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void trans_bin_list(std::string in, std::string out)
//导出战斗帧数为文本
void trans_fight_frame(std::string path0)
{
for (int i = 0; i <= 300; i++)
for (int i = 0; i <= 900; i++)
{
std::string path = fmt1::format("{}/fight{:03}", path0, i);
std::vector<int16_t> frame;
Expand Down Expand Up @@ -663,7 +663,7 @@ void combine_ka(std::string in, std::string out)
//验证战斗帧数的正确性
void check_fight_frame(std::string path, int repair = 0)
{
for (int i = 0; i < 500; i++)
for (int i = 0; i < 900; i++)
{
auto path1 = fmt1::format("{}/fight{:03}", path, i);
if (filefunc::pathExist(path1))
Expand Down Expand Up @@ -791,18 +791,18 @@ int main()
#endif
std::string path = "./";
//check_script(path +"script/oldevent");
//check_fight_frame(path +"resource/fight", 1);
//trans_fight_frame();
check_fight_frame(path +"resource/fight", 0);
//trans_fight_frame(path + "resource/fight");

//trans_bin_list(path + "list/levelup.bin", path + "list/levelup.txt");
//trans_bin_list(path + "list/leave.bin", path + "list/leave.txt");
initDBFieldInfo();
//initDBFieldInfo();
//expandR(path + "save/ranger.idx", path + "save/ranger.grp", 0);
expandR(path + "save/ranger.idx", path + "save/r1.grp", 1);
expandR(path + "save/ranger.idx", path + "save/r2.grp", 2);
expandR(path + "save/ranger.idx", path + "save/r3.grp", 3);
expandR(path + "save/ranger.idx", path + "save/r4.grp", 4);
expandR(path + "save/ranger.idx", path + "save/r5.grp", 5);
//expandR(path + "save/ranger.idx", path + "save/r1.grp", 1);
//expandR(path + "save/ranger.idx", path + "save/r2.grp", 2);
//expandR(path + "save/ranger.idx", path + "save/r3.grp", 3);
//expandR(path + "save/ranger.idx", path + "save/r4.grp", 4);
//expandR(path + "save/ranger.idx", path + "save/r5.grp", 5);

//expandR(path + "save/ranger.idx", path + "save/ranger.grp", 0, false, true);

Expand Down
2 changes: 1 addition & 1 deletion abc/abc.vcxproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerWorkingDirectory>..\work\gamea1</LocalDebuggerWorkingDirectory>
<LocalDebuggerWorkingDirectory>..\work\game13</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
27 changes: 23 additions & 4 deletions src/Script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,31 @@ int Script::registerEventFunctions()

auto newTalk = [](lua_State* L) -> int
{
std::vector<int> args(3);
for (int i = 1; i < 3; i++)
std::vector<int> args(7);
int i1 = 1;
std::string str, name;
for (int i = 0; i < 3; i++)
{
if (lua_isnumber(L, i + 1))
{
args[i1++] = lua_tonumber(L, i + 1);
}
else if (lua_isstring(L, i + 1))
{
if (str.empty())
{
str = lua_tostring(L, i + 1);
}
else
{
name = lua_tostring(L, i + 1);
}
}
}
if (str.empty())
{
args[i] = lua_tonumber(L, i + 1);
str = (lua_tostring(L, 1));
}
std::string str(lua_tostring(L, 1));
Event::getInstance()->newTalk(str, args[1], args[2]);
return 0;
};
Expand Down

0 comments on commit 7685bf6

Please sign in to comment.