Merge branch 'status-itcfangye' into map

This commit is contained in:
草莓 2025-03-30 18:03:33 +08:00
commit 2652b6e071
6 changed files with 1725 additions and 340 deletions

View File

@ -1270,6 +1270,7 @@ ui.prototype._drawTextContent_drawChar = function (tempCtx, content, config, ch)
// 输出
var left = config.offsetX, top = config.offsetY + config.topMargin;
core.fillText(tempCtx, ch, left, top);
tempCtx.strokeText(ch, left, top);
config.blocks.push({
left: config.offsetX, top: config.offsetY,
width: charwidth, height: config.currfont + config.lineMargin,

View File

@ -1946,10 +1946,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{
"type": "insert",
"name": "强制横屏"
},
{
"type": "insert",
"name": "chapter0"
}
],
"shops": [

View File

@ -1,7 +1,7 @@
main.floors.chushi=
{
"floorId": "chushi",
"title": "抉择",
"title": "开场剧情",
"name": "1",
"width": 13,
"height": 13,
@ -12,6 +12,10 @@ main.floors.chushi=
"ratio": 1,
"defaultGround": "T400",
"firstArrive": [
{
"type": "insert",
"name": "chapter0"
},
{
"type": "confirm",
"text": "要进行教程内容吗",
@ -63,7 +67,7 @@ main.floors.chushi=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
"areas": "抉择",
"areas": "开场剧情",
"bgmap": [
],

View File

@ -22,6 +22,10 @@ main.floors.jiaocheng03=
"法杖魔攻比例10%魔防比例0%"
],
"6,0": [
{
"type": "setHeroOpacity",
"opacity": 0
},
{
"type": "changeFloor",
"floorId": "guangchang",

View File

@ -1557,90 +1557,116 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
},
"control": {
"saveData": function () {
// 存档操作,此函数应该返回“具体要存档的内容”
// 存档操作,此函数应该返回“具体要存档的内容”
// 差异化存储values
var values = {};
for (var key in core.values) {
if (!core.same(core.values[key], core.data.values[key]))
values[key] = core.clone(core.values[key]);
}
// 要存档的内容
var data = {
floorId: core.status.floorId,
hero: core.clone(core.status.hero),
hard: core.status.hard,
maps: core.clone(core.maps.saveMap()),
route: core.encodeRoute(core.status.route),
values: values,
version: core.firstData.version,
guid: core.getGuid(),
time: new Date().getTime(),
'material': core.clone(core.material.enemys)
};
return data;
},
// 差异化存储values
var values = {};
for (var key in core.values) {
if (!core.same(core.values[key], core.data.values[key]))
values[key] = core.clone(core.values[key]);
}
let cg = {}
if (core.getFlag("_cgText")) {
cg.index = core.ui.cgText.index
cg.head = core.ui.cgText.head
cg.name = core.ui.cgText.name
cg.text = core.ui.cgText.text
cg.bodyList = core.clone(core.ui.cgText.bodyList)
cg.nobg = core.ui.cgText.nobg
cg.image = core.ui.cgText.image
cg.time = core.ui.cgText.time
cg.WindowSkin = core.ui.cgText.WindowSkin
cg.sound = core.ui.cgText.sound
cg.beforeSound = core.ui.cgText.beforeSound
cg.wait = core.ui.cgText.wait
cg.memory = core.ui.cgText.memory
cg.textList = core.ui.cgText.textList
cg.page = core.ui.cgText.page
cg.overpage = core.ui.cgText.overpage
cg.log = core.ui.cgText.log
cg.index = core.ui.cgText.index
}
// 要存档的内容
var data = {
floorId: core.status.floorId,
hero: core.clone(core.status.hero),
hard: core.status.hard,
maps: core.clone(core.maps.saveMap()),
route: core.encodeRoute(core.status.route),
values: values,
version: core.firstData.version,
guid: core.getGuid(),
time: new Date().getTime(),
cg: cg
};
return data;
},
"loadData": function (data, callback) {
// 读档操作;从存储中读取了内容后的行为
const play = core.status.played;
// 重置游戏和路线
core.resetGame(
data.hero,
data.hard,
data.floorId,
core.maps.loadMap(data.maps, null, data.hero.flags),
data.values
);
//如果作者造塔想随时修改怪物属性平衡数值,请注释下面这行。该行作用为保存怪物当前属性,用以储存临时修改的怪物属性。
core.material.enemys = data.material ?? core.material.enemys;
core.status.route = core.decodeRoute(data.route);
core.control._bindRoutePush();
// 文字属性,全局属性
core.status.textAttribute = core.getFlag(
"textAttribute",
core.status.textAttribute
);
var toAttribute = core.getFlag(
"globalAttribute",
core.status.globalAttribute
);
if (!core.same(toAttribute, core.status.globalAttribute)) {
core.status.globalAttribute = toAttribute;
core.resize();
}
// 重置音量
core.events.setVolume(core.getFlag("__volume__", 1), 0);
// 加载勇士图标
var icon = core.status.hero.image;
icon = core.getMappedName(icon);
if (core.material.images.images[icon]) {
core.material.images.hero = core.material.images.images[icon];
core.material.icons.hero.width =
core.material.images.images[icon].width / 4;
core.material.icons.hero.height =
core.material.images.images[icon].height / 4;
}
core.setFlag("__fromLoad__", true);
// 读档操作;从存储中读取了内容后的行为
const play = core.status.played;
// 重置游戏和路线
core.resetGame(
data.hero,
data.hard,
data.floorId,
core.maps.loadMap(data.maps, null, data.hero.flags),
data.values
);
core.status.route = core.decodeRoute(data.route);
core.control._bindRoutePush();
// 文字属性,全局属性
core.status.textAttribute = core.getFlag(
"textAttribute",
core.status.textAttribute
);
var toAttribute = core.getFlag(
"globalAttribute",
core.status.globalAttribute
);
if (!core.same(toAttribute, core.status.globalAttribute)) {
core.status.globalAttribute = toAttribute;
core.resize();
}
// 重置音量
core.events.setVolume(core.getFlag("__volume__", 1), 0);
// 加载勇士图标
var icon = core.status.hero.image;
icon = core.getMappedName(icon);
if (core.material.images.images[icon]) {
core.material.images.hero = core.material.images.images[icon];
core.material.icons.hero.width =
core.material.images.images[icon].width / 4;
core.material.icons.hero.height =
core.material.images.images[icon].height / 4;
}
core.setFlag("__fromLoad__", true);
// TODO增加自己的一些读档处理
core.ui.statusBar.clearItemInfo();
core.ui.statusBar.update();
core.plugin.playing.clear();
// 切换到对应的楼层
core.changeFloor(data.floorId, null, data.hero.loc, 0, function () {
// TODO可以在这里设置读档后播放BGM
if (core.hasFlag("__bgm__")) {
// 持续播放
core.playBgm(core.getFlag("__bgm__"));
}
// TODO增加自己的一些读档处理
core.ui.statusBar.clearItemInfo();
core.ui.statusBar.update();
if (core.getFlag("_cgText")) {
core.setFlag("_cgText", false)
for (let v in data.cg) {
core.removeFlag("__fromLoad__");
if (!play) core.insertCommonEvent("强制横屏");
if (callback) callback();
});
if (play) core.doAction();
},
core.ui.cgText[v] = data.cg[v]
}
core.drawbackground(core.ui.cgText.image, core.ui.cgText.memory)
}
core.plugin.playing.clear();
// 切换到对应的楼层
core.changeFloor(data.floorId, null, data.hero.loc, 0, function () {
// TODO可以在这里设置读档后播放BGM
if (core.hasFlag("__bgm__")) {
// 持续播放
core.playBgm(core.getFlag("__bgm__"));
}
core.removeFlag("__fromLoad__");
if (!play) core.insertCommonEvent("强制横屏");
if (callback) callback();
});
if (play) core.doAction();
},
"getStatusLabel": function (name) {
// 返回某个状态英文名的对应中文标签如atk -> 攻击def -> 防御等。
// 请注意此项仅影响 libs/ 下的内容(如绘制怪物手册、数据统计等)

File diff suppressed because it is too large Load Diff