Compare commits
	
		
			No commits in common. "f3f9c9cb3af45a7884d5e6e9d3b7618c858bebb2" and "de8a173a5b3a813607c897e77df0871e0d06d5a8" have entirely different histories.
		
	
	
		
			f3f9c9cb3a
			...
			de8a173a5b
		
	
		
| @ -2192,7 +2192,6 @@ maps.prototype.showBgFgMap = function (name, loc, floorId, callback) { | |||||||
| 
 | 
 | ||||||
| ////// 隐藏前景/背景地图 //////
 | ////// 隐藏前景/背景地图 //////
 | ||||||
| maps.prototype.hideBgFgMap = function (name, loc, floorId, callback) { | maps.prototype.hideBgFgMap = function (name, loc, floorId, callback) { | ||||||
|     this.removeGlobalAnimate(loc.x, loc.y, name) |  | ||||||
|     this._triggerBgFgMap('hide', name, loc, floorId, callback); |     this._triggerBgFgMap('hide', name, loc, floorId, callback); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -2456,7 +2455,7 @@ maps.prototype.setBgFgBlock = function (name, number, x, y, floorId) { | |||||||
|         if (/^\d+$/.test(number)) number = parseInt(number); |         if (/^\d+$/.test(number)) number = parseInt(number); | ||||||
|         else number = core.getNumberById(number); |         else number = core.getNumberById(number); | ||||||
|     } |     } | ||||||
|     this.removeGlobalAnimate(x, y, name) | 
 | ||||||
|     var values = core.getFlag('__' + name + 'v__', {}); |     var values = core.getFlag('__' + name + 'v__', {}); | ||||||
|     values[floorId] = (values[floorId] || []).filter(function (one) { return one[0] != x || one[1] != y }); |     values[floorId] = (values[floorId] || []).filter(function (one) { return one[0] != x || one[1] != y }); | ||||||
|     values[floorId].push([x, y, number]); |     values[floorId].push([x, y, number]); | ||||||
|  | |||||||
| @ -2,96 +2,90 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = | |||||||
| { | { | ||||||
|     "events": { |     "events": { | ||||||
|         "resetGame": function (hero, hard, floorId, maps, values) { |         "resetGame": function (hero, hard, floorId, maps, values) { | ||||||
| 	// 重置整个游戏;此函数将在游戏开始时,或者每次读档时最先被调用
 |       // 重置整个游戏;此函数将在游戏开始时,或者每次读档时最先被调用
 | ||||||
| 	// hero:勇士信息;hard:难度;floorId:当前楼层ID;maps:地图信息;values:全局数值信息
 |       // hero:勇士信息;hard:难度;floorId:当前楼层ID;maps:地图信息;values:全局数值信息
 | ||||||
| 
 | 
 | ||||||
| 	// 清除游戏数据
 |       // 清除游戏数据
 | ||||||
| 	// 这一步会清空状态栏和全部画布内容,并删除所有动态创建的画布
 |       // 这一步会清空状态栏和全部画布内容,并删除所有动态创建的画布
 | ||||||
| 	core.clearStatus(); |       core.clearStatus(); | ||||||
| 	core.status.animateObjs = [] |       // 初始化status
 | ||||||
| 	core.plugin.playing.clear() |       core.status = core.clone(core.initStatus, function (name) { | ||||||
| 	// 初始化status
 |         return name != "hero" && name != "maps"; | ||||||
| 	core.status = core.clone(core.initStatus, function (name) { |       }); | ||||||
| 		return name != "hero" && name != "maps"; |       core.control._bindRoutePush(); | ||||||
| 	}); |       core.status.played = true; | ||||||
| 	core.control._bindRoutePush(); |       // 初始化人物,图标,统计信息
 | ||||||
| 	core.status.played = true; |       core.status.hero = core.clone(hero); | ||||||
| 	// 初始化人物,图标,统计信息
 |       window.hero = core.status.hero; | ||||||
| 	core.status.hero = core.clone(hero); |       window.flags = core.status.hero.flags; | ||||||
| 	window.hero = core.status.hero; |       core.events.setHeroIcon(core.status.hero.image, true); | ||||||
| 	window.flags = core.status.hero.flags; |       core.control._initStatistics(core.animateFrame.totalTime); | ||||||
| 	core.events.setHeroIcon(core.status.hero.image, true); |       core.status.hero.statistics.totalTime = core.animateFrame.totalTime = | ||||||
| 	core.control._initStatistics(core.animateFrame.totalTime); |         Math.max( | ||||||
| 	core.status.hero.statistics.totalTime = core.animateFrame.totalTime = |           core.status.hero.statistics.totalTime, | ||||||
| 		Math.max( |           core.animateFrame.totalTime | ||||||
| 			core.status.hero.statistics.totalTime, |         ); | ||||||
| 			core.animateFrame.totalTime |       core.status.hero.statistics.start = null; | ||||||
| 		); |       // 初始难度
 | ||||||
| 	core.status.hero.statistics.start = null; |       core.status.hard = hard || ""; | ||||||
| 	// 初始难度
 |       // 初始化地图
 | ||||||
| 	core.status.hard = hard || ""; |       core.status.floorId = floorId; | ||||||
| 	// 初始化地图
 |       core.status.maps = maps; | ||||||
| 	core.status.floorId = floorId; |       core.maps._resetFloorImages(); | ||||||
| 	core.status.maps = maps; |       // 初始化怪物和道具
 | ||||||
| 	core.maps._resetFloorImages(); |       core.material.enemys = core.enemys.getEnemys(); | ||||||
| 	// 初始化怪物和道具
 |       core.material.items = core.items.getItems(); | ||||||
| 	core.material.enemys = core.enemys.getEnemys(); |       // 初始化全局数值和全局开关
 | ||||||
| 	core.material.items = core.items.getItems(); |       core.values = core.clone(core.data.values); | ||||||
| 	// 初始化全局数值和全局开关
 |       for (var key in values || {}) core.values[key] = values[key]; | ||||||
| 	core.values = core.clone(core.data.values); |       core.flags = core.clone(core.data.flags); | ||||||
| 	for (var key in values || {}) core.values[key] = values[key]; |       var globalFlags = core.getFlag("globalFlags", {}); | ||||||
| 	core.flags = core.clone(core.data.flags); |       for (var key in globalFlags) core.flags[key] = globalFlags[key]; | ||||||
| 	var globalFlags = core.getFlag("globalFlags", {}); |       core._init_sys_flags(); | ||||||
| 	for (var key in globalFlags) core.flags[key] = globalFlags[key]; |       // 初始化界面,状态栏等
 | ||||||
| 	core._init_sys_flags(); |       core.resize(); | ||||||
| 	// 初始化界面,状态栏等
 |       // 状态栏是否显示
 | ||||||
| 	core.resize(); |       if (core.hasFlag("hideStatusBar")) | ||||||
| 	// 状态栏是否显示
 |         core.hideStatusBar(core.hasFlag("showToolbox")); | ||||||
| 	if (core.hasFlag("hideStatusBar")) |       else core.showStatusBar(); | ||||||
| 		core.hideStatusBar(core.hasFlag("showToolbox")); |       // 隐藏右下角的音乐按钮
 | ||||||
| 	else core.showStatusBar(); |       core.dom.musicBtn.style.display = "none"; | ||||||
| 	// 隐藏右下角的音乐按钮
 |     }, | ||||||
| 	core.dom.musicBtn.style.display = "none"; |  | ||||||
| }, |  | ||||||
|         "win": function (reason, norank, noexit) { |         "win": function (reason, norank, noexit) { | ||||||
| 	// 游戏获胜事件
 |       // 游戏获胜事件
 | ||||||
| 	// 请注意,成绩统计时是按照hp进行上传并排名
 |       // 请注意,成绩统计时是按照hp进行上传并排名
 | ||||||
| 	// 可以先在这里对最终分数进行计算,比如将2倍攻击和5倍黄钥匙数量加到分数上
 |       // 可以先在这里对最终分数进行计算,比如将2倍攻击和5倍黄钥匙数量加到分数上
 | ||||||
| 	// core.status.hero.hp += 2 * core.getRealStatus('atk') + 5 * core.itemCount('yellowKey');
 |       // core.status.hero.hp += 2 * core.getRealStatus('atk') + 5 * core.itemCount('yellowKey');
 | ||||||
| 
 | 
 | ||||||
| 	// 如果不退出,则临时存储数据
 |       // 如果不退出,则临时存储数据
 | ||||||
| 	if (noexit) { |       if (noexit) { | ||||||
| 		core.status.extraEvent = core.clone(core.status.event); |         core.status.extraEvent = core.clone(core.status.event); | ||||||
| 	} |       } | ||||||
| 
 | 
 | ||||||
| 	// 游戏获胜事件
 |       // 游戏获胜事件
 | ||||||
| 	core.ui.closePanel(); |       core.ui.closePanel(); | ||||||
| 	var replaying = core.isReplaying(); |       var replaying = core.isReplaying(); | ||||||
| 	if (replaying) core.stopReplay(); |       if (replaying) core.stopReplay(); | ||||||
| 	core.waitHeroToStop(function () { |       core.waitHeroToStop(function () { | ||||||
| 		if (!noexit) { |         if (!noexit) { | ||||||
| 			core.status.animateObjs = [] |           core.clearMap("all"); // 清空全地图
 | ||||||
| 			core.plugin.playing.clear() |           core.deleteAllCanvas(); // 删除所有创建的画布
 | ||||||
| 			core.clearMap("all"); // 清空全地图
 |           core.dom.gif2.innerHTML = ""; | ||||||
| 			core.deleteAllCanvas(); // 删除所有创建的画布
 |         } | ||||||
| 			core.dom.gif2.innerHTML = ""; |         reason = core.replaceText(reason); | ||||||
| 		} |         core.drawText( | ||||||
| 		reason = core.replaceText(reason); |           ["\t[" + (reason || "恭喜通关") + "]你的分数是${status:hp}。"], | ||||||
| 		core.drawText( |           function () { | ||||||
| 			["\t[" + (reason || "恭喜通关") + "]你的分数是${status:hp}。"], |             core.events.gameOver(reason || "", replaying, norank); | ||||||
| 			function () { |           } | ||||||
| 				core.events.gameOver(reason || "", replaying, norank); |         ); | ||||||
| 			} |       }); | ||||||
| 		); |     }, | ||||||
| 	}); |  | ||||||
| }, |  | ||||||
|         "lose": function (reason) { |         "lose": function (reason) { | ||||||
| 	// 游戏失败事件
 | 	// 游戏失败事件
 | ||||||
| 	core.ui.closePanel(); | 	core.ui.closePanel(); | ||||||
| 	var replaying = core.isReplaying(); | 	var replaying = core.isReplaying(); | ||||||
| 	core.stopReplay(); | 	core.stopReplay(); | ||||||
| 	core.status.animateObjs = [] |  | ||||||
| 	core.plugin.playing.clear() |  | ||||||
| 	core.waitHeroToStop(function () { | 	core.waitHeroToStop(function () { | ||||||
| 		core.drawText( | 		core.drawText( | ||||||
| 			["\t[" + (reason || "结局1") + "]你死了。\n如题。"], | 			["\t[" + (reason || "结局1") + "]你死了。\n如题。"], | ||||||
| @ -1604,9 +1598,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = | |||||||
| 		version: core.firstData.version, | 		version: core.firstData.version, | ||||||
| 		guid: core.getGuid(), | 		guid: core.getGuid(), | ||||||
| 		time: new Date().getTime(), | 		time: new Date().getTime(), | ||||||
| 		cg: cg, | 		cg: cg | ||||||
| 		animateObjs: core.status.animateObjs.filter(v => v.loop), |  | ||||||
| 		playing: [...core.plugin.playing].filter(v => v.loop) |  | ||||||
| 	}; | 	}; | ||||||
| 	return data; | 	return data; | ||||||
| }, | }, | ||||||
| @ -1653,8 +1645,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = | |||||||
| 	// TODO:增加自己的一些读档处理
 | 	// TODO:增加自己的一些读档处理
 | ||||||
| 	core.ui.statusBar.clearItemInfo(); | 	core.ui.statusBar.clearItemInfo(); | ||||||
| 	core.ui.statusBar.update(); | 	core.ui.statusBar.update(); | ||||||
| 	core.status.animateObjs = data.animateObjs |  | ||||||
| 	core.plugin.playing = new Set(data.playing) |  | ||||||
| 	if (core.getFlag("_cgText")) { | 	if (core.getFlag("_cgText")) { | ||||||
| 		core.setFlag("_cgText", false) | 		core.setFlag("_cgText", false) | ||||||
| 		for (let v in data.cg) { | 		for (let v in data.cg) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user