封面异画
This commit is contained in:
		
							parent
							
								
									572cd40493
								
							
						
					
					
						commit
						4fbfe72989
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -262,6 +262,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = | ||||
| 			"ulr.webp", | ||||
| 			"unknow.webp", | ||||
| 			"ur.webp", | ||||
| 			"winbackground.webp", | ||||
| 			"winbackgroundVertical.webp", | ||||
| 			"winskin.webp", | ||||
| 			"winskin1.webp" | ||||
| 		], | ||||
|  | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 262 KiB | 
							
								
								
									
										
											BIN
										
									
								
								project/images/winbackground.webp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								project/images/winbackground.webp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 172 KiB | 
							
								
								
									
										
											BIN
										
									
								
								project/images/winbackgroundVertical.webp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								project/images/winbackgroundVertical.webp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 137 KiB | 
| @ -2593,8 +2593,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = | ||||
| 		core.dom.musicBtn.style.bottom = | ||||
| 			(obj.clientHeight - obj.totalHeight) / 2 - 27 + "px"; | ||||
| 		let startBackground = core.domStyle.isVertical ? | ||||
| 			main.styles.startVerticalBackground || main.styles.startBackground : | ||||
| 			main.styles.startBackground; | ||||
| 			core.getLocalStorage('end') ? 'project/images/winbackgroundVertical.webp' : main.styles.startVerticalBackground || main.styles.startBackground : | ||||
| 			core.getLocalStorage('end') ? 'project/images/winbackground.webp' : main.styles.startBackground; | ||||
| 		if (main.dom.startBackground.getAttribute("__src__") != startBackground) { | ||||
| 			main.dom.startBackground.setAttribute("__src__", startBackground); | ||||
| 			main.dom.startBackground.src = startBackground; | ||||
| @ -4181,279 +4181,279 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = | ||||
|     } | ||||
|   }, | ||||
|     "编辑器显伤": function () { | ||||
|     // 在此增加新插件
 | ||||
|     /////// 用户设置 ///////
 | ||||
|     // 将__enable置为false将关闭插件
 | ||||
|     var __enable = true; | ||||
|     // 魔防攻速之类的属性可以在这里加 ['atk', 'def', 'mdef']
 | ||||
|     var heroStatus = ["atk", "def", "mdef", "hp"]; | ||||
|     // saveHero为true 将会把每次造塔测试时的角色数据存下来 否则会读取初始属性
 | ||||
|     // 用不着可以关了 节约缓存空间 (虽然根本没多少 还没一个存档大
 | ||||
|     // 也可以手动清理 控制台输入core.removeLocalStorage('editorHero')即可
 | ||||
|     var saveHero = true; | ||||
| 	// 在此增加新插件
 | ||||
| 	/////// 用户设置 ///////
 | ||||
| 	// 将__enable置为false将关闭插件
 | ||||
| 	var __enable = true; | ||||
| 	// 魔防攻速之类的属性可以在这里加 ['atk', 'def', 'mdef']
 | ||||
| 	var heroStatus = ["atk", "def", "mdef", "hp"]; | ||||
| 	// saveHero为true 将会把每次造塔测试时的角色数据存下来 否则会读取初始属性
 | ||||
| 	// 用不着可以关了 节约缓存空间 (虽然根本没多少 还没一个存档大
 | ||||
| 	// 也可以手动清理 控制台输入core.removeLocalStorage('editorHero')即可
 | ||||
| 	var saveHero = true; | ||||
| 
 | ||||
|     // 下为具体实现 懒得写注释了 大概就是写HTML然后注册交互
 | ||||
|     if (!__enable || main.mode != "editor") return; | ||||
|     core.plugin.initEditorDamage = false; | ||||
|     if (heroStatus.length >= 4 && !editor.isMobile) | ||||
|       editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + "px"; | ||||
|     editor.statusRatio = core.getLocalStorage("statusRatio", 1); | ||||
|     editor.saveHero = saveHero; | ||||
|     editor._heroStatus = heroStatus; | ||||
|     editor.dom.mapEdit.appendChild(core.canvas.damage.canvas); | ||||
|     var HTML = | ||||
|       "<input type='button' value='←'/><input type='button' value='↑'/><input type='button' value='↓'/><input type='button' value='→'/><input type='button' id='bigmapBtn' value='大地图'' style='margin-left: '5px'/>"; | ||||
| 	// 下为具体实现 懒得写注释了 大概就是写HTML然后注册交互
 | ||||
| 	if (!__enable || main.mode != "editor") return; | ||||
| 	core.plugin.initEditorDamage = false; | ||||
| 	if (heroStatus.length >= 4 && !editor.isMobile) | ||||
| 		editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + "px"; | ||||
| 	editor.statusRatio = core.getLocalStorage("statusRatio", 1); | ||||
| 	editor.saveHero = saveHero; | ||||
| 	editor._heroStatus = heroStatus; | ||||
| 	editor.dom.mapEdit.appendChild(core.canvas.damage.canvas); | ||||
| 	var HTML = | ||||
| 		"<input type='button' value='←'/><input type='button' value='↑'/><input type='button' value='↓'/><input type='button' value='→'/><input type='button' id='bigmapBtn' value='大地图'' style='margin-left: '5px'/>"; | ||||
| 
 | ||||
|     //if (heroStatus.length >= 4 && !editor.isMobile) editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + 'px';
 | ||||
|     heroStatus.forEach(function (status) { | ||||
|       var id = status + "set", | ||||
|         id2 = status + "add", | ||||
|         id3 = status + "rec", | ||||
|         id4 = status + "help"; | ||||
|       HTML += | ||||
|         "<br/><input type='text' size='15' id='" + | ||||
|         id + | ||||
|         "'><input type='button' id='" + | ||||
|         id2 + | ||||
|         "' value = '+'><input type='button' id='" + | ||||
|         id3 + | ||||
|         "' value = '-'><input type='button' value='?' id = '" + | ||||
|         id4 + | ||||
|         "'>"; | ||||
|     }); | ||||
|     document.getElementById("viewportButtons").innerHTML = HTML; | ||||
|     ["set", "add", "rec", "help"].forEach(function (e) { | ||||
|       heroStatus.forEach(function (status) { | ||||
|         editor.dom[status + e] = document.getElementById(status + e); | ||||
|       }); | ||||
|     }); | ||||
|     var _hasItem = core.items.hasItem; | ||||
|     core.items.hasItem = function (itemId) { | ||||
|       if (itemId == "book" && main.mode == "editor") return true; | ||||
|       return _hasItem.call(core.items, itemId); | ||||
|     }; | ||||
|     if (main.mode == "editor") { | ||||
|       var applyList = [ | ||||
|         "getDamageString", | ||||
|         "nextCriticals", | ||||
|         "getEnemyInfo", | ||||
|         "getEnemyValue", | ||||
|       ]; | ||||
|       applyList.forEach(function (name) { | ||||
|         var func = core.enemys[name]; | ||||
|         core.enemys[name] = function () { | ||||
|           var args = | ||||
|             arguments.length === 1 | ||||
|               ? [arguments[0]] | ||||
|               : Array.apply(null, arguments); | ||||
|           if (typeof args[0] == "string") args[0] = core.enemys.enemys[args[0]]; | ||||
|           return func.apply(core.enemys, args); | ||||
|         }; | ||||
|       }); | ||||
|     } | ||||
| 	//if (heroStatus.length >= 4 && !editor.isMobile) editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + 'px';
 | ||||
| 	heroStatus.forEach(function (status) { | ||||
| 		var id = status + "set", | ||||
| 			id2 = status + "add", | ||||
| 			id3 = status + "rec", | ||||
| 			id4 = status + "help"; | ||||
| 		HTML += | ||||
| 			"<br/><input type='text' size='15' id='" + | ||||
| 			id + | ||||
| 			"'><input type='button' id='" + | ||||
| 			id2 + | ||||
| 			"' value = '+'><input type='button' id='" + | ||||
| 			id3 + | ||||
| 			"' value = '-'><input type='button' value='?' id = '" + | ||||
| 			id4 + | ||||
| 			"'>"; | ||||
| 	}); | ||||
| 	document.getElementById("viewportButtons").innerHTML = HTML; | ||||
| 	["set", "add", "rec", "help"].forEach(function (e) { | ||||
| 		heroStatus.forEach(function (status) { | ||||
| 			editor.dom[status + e] = document.getElementById(status + e); | ||||
| 		}); | ||||
| 	}); | ||||
| 	var _hasItem = core.items.hasItem; | ||||
| 	core.items.hasItem = function (itemId) { | ||||
| 		if (itemId == "book" && main.mode == "editor") return true; | ||||
| 		return _hasItem.call(core.items, itemId); | ||||
| 	}; | ||||
| 	if (main.mode == "editor") { | ||||
| 		var applyList = [ | ||||
| 			"getDamageString", | ||||
| 			"nextCriticals", | ||||
| 			"getEnemyInfo", | ||||
| 			"getEnemyValue", | ||||
| 		]; | ||||
| 		applyList.forEach(function (name) { | ||||
| 			var func = core.enemys[name]; | ||||
| 			core.enemys[name] = function () { | ||||
| 				var args = | ||||
| 					arguments.length === 1 ? | ||||
| 					[arguments[0]] : | ||||
| 					Array.apply(null, arguments); | ||||
| 				if (typeof args[0] == "string") args[0] = core.enemys.enemys[args[0]]; | ||||
| 				return func.apply(core.enemys, args); | ||||
| 			}; | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
|     ////// 获得勇士属性 //////
 | ||||
|     core.control.getStatus = function (name) { | ||||
|       if (!core.status.hero) return null; | ||||
|       if (name == "x" || name == "y" || name == "direction") | ||||
|         return this.getHeroLoc(name); | ||||
|       /*if ( main.mode == 'editor' && !core.hasFlag('__statistics__')) { | ||||
| 	////// 获得勇士属性 //////
 | ||||
| 	core.control.getStatus = function (name) { | ||||
| 		if (!core.status.hero) return null; | ||||
| 		if (name == "x" || name == "y" || name == "direction") | ||||
| 			return this.getHeroLoc(name); | ||||
| 		/*if ( main.mode == 'editor' && !core.hasFlag('__statistics__')) { | ||||
| 			return data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.hero[name]; | ||||
| 		}*/ | ||||
|       return core.status.hero[name]; | ||||
|     }; | ||||
| 		return core.status.hero[name]; | ||||
| 	}; | ||||
| 
 | ||||
|     core.control.updateDamage = function (floorId, ctx) { | ||||
|       floorId = floorId || core.status.floorId; | ||||
|       if (!floorId || core.status.gameOver) return; | ||||
|       var onMap = ctx == null; | ||||
|       if (main.mode == "editor") { | ||||
|         ctx = core.canvas.damage; | ||||
|         core.updateCheckBlock(); | ||||
|         core.clearMap(ctx); | ||||
|         if (editor.uivalues.bigmap) return; | ||||
|       } | ||||
| 	core.control.updateDamage = function (floorId, ctx) { | ||||
| 		floorId = floorId || core.status.floorId; | ||||
| 		if (!floorId || core.status.gameOver) return; | ||||
| 		var onMap = ctx == null; | ||||
| 		if (main.mode == "editor") { | ||||
| 			ctx = core.canvas.damage; | ||||
| 			core.updateCheckBlock(); | ||||
| 			core.clearMap(ctx); | ||||
| 			if (editor.uivalues.bigmap) return; | ||||
| 		} | ||||
| 
 | ||||
|       // 没有怪物手册
 | ||||
|       if (!core.hasItem("book")) return; | ||||
|       core.status.damage.posX = core.bigmap.posX; | ||||
|       core.status.damage.posY = core.bigmap.posY; | ||||
|       if (!onMap) { | ||||
|         var width = core.floors[floorId].width, | ||||
|           height = core.floors[floorId].height; | ||||
|         // 地图过大的缩略图不绘制显伤
 | ||||
|         if (width * height > core.bigmap.threshold) return; | ||||
|       } | ||||
|       this._updateDamage_damage(floorId, onMap); | ||||
|       this._updateDamage_extraDamage(floorId, onMap); | ||||
|       this.drawDamage(ctx); | ||||
|     }; | ||||
| 		// 没有怪物手册
 | ||||
| 		if (!core.hasItem("book")) return; | ||||
| 		core.status.damage.posX = core.bigmap.posX; | ||||
| 		core.status.damage.posY = core.bigmap.posY; | ||||
| 		if (!onMap) { | ||||
| 			var width = core.floors[floorId].width, | ||||
| 				height = core.floors[floorId].height; | ||||
| 			// 地图过大的缩略图不绘制显伤
 | ||||
| 			if (width * height > core.bigmap.threshold) return; | ||||
| 		} | ||||
| 		this._updateDamage_damage(floorId, onMap); | ||||
| 		this._updateDamage_extraDamage(floorId, onMap); | ||||
| 		this.drawDamage(ctx); | ||||
| 	}; | ||||
| 
 | ||||
|     core.control.drawDamage = function (ctx) { | ||||
|       if ( | ||||
|         core.status.gameOver || | ||||
|         !core.status.damage /* || main.mode != 'play'*/ | ||||
|       ) | ||||
|         return; | ||||
|       var onMap = false; | ||||
|       if (ctx == null) { | ||||
|         ctx = core.canvas.damage; | ||||
|         core.clearMap("damage"); | ||||
|         onMap = true; | ||||
|       } | ||||
| 	core.control.drawDamage = function (ctx) { | ||||
| 		if ( | ||||
| 			core.status.gameOver || | ||||
| 			!core.status.damage /* || main.mode != 'play'*/ | ||||
| 		) | ||||
| 			return; | ||||
| 		var onMap = false; | ||||
| 		if (ctx == null) { | ||||
| 			ctx = core.canvas.damage; | ||||
| 			core.clearMap("damage"); | ||||
| 			onMap = true; | ||||
| 		} | ||||
| 
 | ||||
|       if (onMap && core.bigmap.v2) { | ||||
|         // 检查是否需要重算...
 | ||||
|         if ( | ||||
|           Math.abs(core.bigmap.posX - core.status.damage.posX) >= | ||||
|             core.bigmap.extend - 1 || | ||||
|           Math.abs(core.bigmap.posY - core.status.damage.posY) >= | ||||
|             core.bigmap.extend - 1 | ||||
|         ) { | ||||
|           return this.updateDamage(); | ||||
|         } | ||||
|       } | ||||
|       return this._drawDamage_draw(ctx, onMap); | ||||
|     }; | ||||
| 		if (onMap && core.bigmap.v2) { | ||||
| 			// 检查是否需要重算...
 | ||||
| 			if ( | ||||
| 				Math.abs(core.bigmap.posX - core.status.damage.posX) >= | ||||
| 				core.bigmap.extend - 1 || | ||||
| 				Math.abs(core.bigmap.posY - core.status.damage.posY) >= | ||||
| 				core.bigmap.extend - 1 | ||||
| 			) { | ||||
| 				return this.updateDamage(); | ||||
| 			} | ||||
| 		} | ||||
| 		return this._drawDamage_draw(ctx, onMap); | ||||
| 	}; | ||||
| 
 | ||||
|     ////// 以x,y的形式返回每个点的事件 //////
 | ||||
|     core.maps.getMapBlocksObj = function (floorId, noCache) { | ||||
|       floorId = floorId || core.status.floorId; | ||||
|       if ( | ||||
|         core.status.mapBlockObjs[floorId] && | ||||
|         !noCache && | ||||
|         main.mode != "editor" | ||||
|       ) | ||||
|         return core.status.mapBlockObjs[floorId]; | ||||
| 	////// 以x,y的形式返回每个点的事件 //////
 | ||||
| 	core.maps.getMapBlocksObj = function (floorId, noCache) { | ||||
| 		floorId = floorId || core.status.floorId; | ||||
| 		if ( | ||||
| 			core.status.mapBlockObjs[floorId] && | ||||
| 			!noCache && | ||||
| 			main.mode != "editor" | ||||
| 		) | ||||
| 			return core.status.mapBlockObjs[floorId]; | ||||
| 
 | ||||
|       var obj = {}; | ||||
|       core.extractBlocks(floorId); | ||||
|       core.status.maps[floorId].blocks.forEach(function (block) { | ||||
|         obj[block.x + "," + block.y] = block; | ||||
|       }); | ||||
|       core.status.mapBlockObjs[floorId] = obj; | ||||
|       return obj; | ||||
|     }; | ||||
| 		var obj = {}; | ||||
| 		core.extractBlocks(floorId); | ||||
| 		core.status.maps[floorId].blocks.forEach(function (block) { | ||||
| 			obj[block.x + "," + block.y] = block; | ||||
| 		}); | ||||
| 		core.status.mapBlockObjs[floorId] = obj; | ||||
| 		return obj; | ||||
| 	}; | ||||
| 
 | ||||
|     this.bignum = function (num, defaultValue) { | ||||
|       if (num == null || num == "") return defaultValue; | ||||
|       num = num + ""; | ||||
|       var list = { | ||||
|         w: 1e4, | ||||
|         e: 1e8, | ||||
|         z: 1e12, | ||||
|         j: 1e16, | ||||
|         g: 1e20, | ||||
|       }; | ||||
|       // 浮点数问题
 | ||||
|       function checkFloat(num) { | ||||
|         if (!core.isset(num)) return 0; | ||||
|         num = num + ""; | ||||
|         var index = num.indexOf("."); | ||||
|         if (index < 0) return 0; | ||||
|         else return num.slice(index + 1).length; | ||||
|       } | ||||
|       var index = num.search(/w|e|z|j|g/); | ||||
|       if (index <= 0) { | ||||
|         num = parseInt(num); | ||||
|         if (core.isset(num)) return num; | ||||
|         else { | ||||
|           alert("不正确的输入"); | ||||
|           return defaultValue; | ||||
|         } | ||||
|       } | ||||
|       for (; index > 0; index = num.search(/w|e|z|j|g/)) { | ||||
|         var p = num[index], | ||||
|           q = list[p], | ||||
|           n = num.slice(0, index), | ||||
|           m = Math.pow(10, checkFloat(n)); | ||||
|         num = (n * m * q) / m + num.slice(index + 1); | ||||
|       } | ||||
|       return parseInt(num); | ||||
|     }; | ||||
| 	this.bignum = function (num, defaultValue) { | ||||
| 		if (num == null || num == "") return defaultValue; | ||||
| 		num = num + ""; | ||||
| 		var list = { | ||||
| 			w: 1e4, | ||||
| 			e: 1e8, | ||||
| 			z: 1e12, | ||||
| 			j: 1e16, | ||||
| 			g: 1e20, | ||||
| 		}; | ||||
| 		// 浮点数问题
 | ||||
| 		function checkFloat(num) { | ||||
| 			if (!core.isset(num)) return 0; | ||||
| 			num = num + ""; | ||||
| 			var index = num.indexOf("."); | ||||
| 			if (index < 0) return 0; | ||||
| 			else return num.slice(index + 1).length; | ||||
| 		} | ||||
| 		var index = num.search(/w|e|z|j|g/); | ||||
| 		if (index <= 0) { | ||||
| 			num = parseInt(num); | ||||
| 			if (core.isset(num)) return num; | ||||
| 			else { | ||||
| 				alert("不正确的输入"); | ||||
| 				return defaultValue; | ||||
| 			} | ||||
| 		} | ||||
| 		for (; index > 0; index = num.search(/w|e|z|j|g/)) { | ||||
| 			var p = num[index], | ||||
| 				q = list[p], | ||||
| 				n = num.slice(0, index), | ||||
| 				m = Math.pow(10, checkFloat(n)); | ||||
| 			num = (n * m * q) / m + num.slice(index + 1); | ||||
| 		} | ||||
| 		return parseInt(num); | ||||
| 	}; | ||||
| 
 | ||||
|     this.updateEditorDamage = function (noSave) { | ||||
|       core.updateDamage(); | ||||
|       heroStatus.forEach(function (status) { | ||||
|         editor.dom[status + "set"].value = core.status.hero[status]; | ||||
|       }); | ||||
|       if (!noSave && editor.saveHero) | ||||
|         core.setLocalStorage("editorHero", core.status.hero); | ||||
|     }; | ||||
| 	this.updateEditorDamage = function (noSave) { | ||||
| 		core.updateDamage(); | ||||
| 		heroStatus.forEach(function (status) { | ||||
| 			editor.dom[status + "set"].value = core.status.hero[status]; | ||||
| 		}); | ||||
| 		if (!noSave && editor.saveHero) | ||||
| 			core.setLocalStorage("editorHero", core.status.hero); | ||||
| 	}; | ||||
| 
 | ||||
|     var _resizeMap = core.maps.resizeMap; | ||||
|     core.maps.resizeMap = function (floorId) { | ||||
|       _resizeMap.call(core.maps, floorId); | ||||
|       if (!core.plugin.initEditorDamage && main.mode == "editor") { | ||||
|         core.plugin.initEditorDamage = true; | ||||
|         var editorHero = core.getLocalStorage("editorHero"); | ||||
|         if (editorHero && saveHero) core.status.hero = editorHero; | ||||
|         else core.removeLocalStorage("editorHero"); | ||||
|         editor._heroStatus.forEach(function (e) { | ||||
|           editor.dom[e + "set"].onchange = function () { | ||||
|             var status = this.id.slice(0, -3); | ||||
|             core.status.hero[status] = core.bignum( | ||||
|               this.value, | ||||
|               core.status.hero[status] | ||||
|             ); | ||||
|             core.updateEditorDamage(); | ||||
|           }; | ||||
|           editor.dom[e + "add"].onclick = function () { | ||||
|             var status = this.id.slice(0, -3); | ||||
|             core.status.hero[status] += editor.statusRatio; | ||||
|             core.updateEditorDamage(); | ||||
|           }; | ||||
|           editor.dom[e + "rec"].onclick = function () { | ||||
|             var status = this.id.slice(0, -3); | ||||
|             core.status.hero[status] -= editor.statusRatio; | ||||
|             core.updateEditorDamage(); | ||||
|           }; | ||||
|           editor.dom[e + "help"].onclick = function () { | ||||
|             var status = this.id.slice(0, -4), | ||||
|               name = core.getStatusLabel(status); | ||||
|             var ratio = parseInt( | ||||
|               prompt( | ||||
|                 "当前属性:" + | ||||
|                   name + | ||||
|                   "\n现在的点击按钮变化值:" + | ||||
|                   editor.statusRatio + | ||||
|                   ",请输入按下一次+/-按钮的属性变化量,可以写4w 10.2e这种字母缩写" | ||||
|               ) | ||||
|             ); | ||||
|             if (!core.isset(ratio)) { | ||||
|               printe("不合法的输入"); | ||||
|               return; | ||||
|             } | ||||
|             editor.statusRatio = ratio; | ||||
|             core.setLocalStorage("statusRatio", ratio); | ||||
|           }; | ||||
|         }); | ||||
|         var _updateMap = editor.updateMap; | ||||
|         editor.updateMap = function () { | ||||
|           _updateMap.call(editor); | ||||
|           core.updateEditorDamage(true); | ||||
|         }; | ||||
|         editor.mode.onmode = function (mode, callback) { | ||||
|           if (editor_mode.mode != mode) { | ||||
|             if (mode === "save") { | ||||
|               editor_mode.doActionList( | ||||
|                 editor_mode.mode, | ||||
|                 editor_mode.actionList, | ||||
|                 function () { | ||||
|                   if (callback) callback(); | ||||
|                   core.updateEditorDamage(); | ||||
|                 } | ||||
|               ); | ||||
|             } | ||||
|             if (editor_mode.mode === "nextChange" && mode) | ||||
|               editor_mode.showMode(mode); | ||||
|             if (mode !== "save") editor_mode.mode = mode; | ||||
|             editor_mode.actionList = []; | ||||
|           } | ||||
|         }; | ||||
|       } | ||||
|     }; | ||||
|   }, | ||||
| 	var _resizeMap = core.maps.resizeMap; | ||||
| 	core.maps.resizeMap = function (floorId) { | ||||
| 		_resizeMap.call(core.maps, floorId); | ||||
| 		if (!core.plugin.initEditorDamage && main.mode == "editor") { | ||||
| 			core.plugin.initEditorDamage = true; | ||||
| 			var editorHero = core.getLocalStorage("editorHero"); | ||||
| 			if (editorHero && saveHero) core.status.hero = editorHero; | ||||
| 			else core.removeLocalStorage("editorHero"); | ||||
| 			editor._heroStatus.forEach(function (e) { | ||||
| 				editor.dom[e + "set"].onchange = function () { | ||||
| 					var status = this.id.slice(0, -3); | ||||
| 					core.status.hero[status] = core.bignum( | ||||
| 						this.value, | ||||
| 						core.status.hero[status] | ||||
| 					); | ||||
| 					core.updateEditorDamage(); | ||||
| 				}; | ||||
| 				editor.dom[e + "add"].onclick = function () { | ||||
| 					var status = this.id.slice(0, -3); | ||||
| 					core.status.hero[status] += editor.statusRatio; | ||||
| 					core.updateEditorDamage(); | ||||
| 				}; | ||||
| 				editor.dom[e + "rec"].onclick = function () { | ||||
| 					var status = this.id.slice(0, -3); | ||||
| 					core.status.hero[status] -= editor.statusRatio; | ||||
| 					core.updateEditorDamage(); | ||||
| 				}; | ||||
| 				editor.dom[e + "help"].onclick = function () { | ||||
| 					var status = this.id.slice(0, -4), | ||||
| 						name = core.getStatusLabel(status); | ||||
| 					var ratio = parseInt( | ||||
| 						prompt( | ||||
| 							"当前属性:" + | ||||
| 							name + | ||||
| 							"\n现在的点击按钮变化值:" + | ||||
| 							editor.statusRatio + | ||||
| 							",请输入按下一次+/-按钮的属性变化量,可以写4w 10.2e这种字母缩写" | ||||
| 						) | ||||
| 					); | ||||
| 					if (!core.isset(ratio)) { | ||||
| 						printe("不合法的输入"); | ||||
| 						return; | ||||
| 					} | ||||
| 					editor.statusRatio = ratio; | ||||
| 					core.setLocalStorage("statusRatio", ratio); | ||||
| 				}; | ||||
| 			}); | ||||
| 			var _updateMap = editor.updateMap; | ||||
| 			editor.updateMap = function () { | ||||
| 				_updateMap.call(editor); | ||||
| 				core.updateEditorDamage(true); | ||||
| 			}; | ||||
| 			editor.mode.onmode = function (mode, callback) { | ||||
| 				if (editor_mode.mode != mode) { | ||||
| 					if (mode === "save") { | ||||
| 						editor_mode.doActionList( | ||||
| 							editor_mode.mode, | ||||
| 							editor_mode.actionList, | ||||
| 							function () { | ||||
| 								if (callback) callback(); | ||||
| 								core.updateEditorDamage(); | ||||
| 							} | ||||
| 						); | ||||
| 					} | ||||
| 					if (editor_mode.mode === "nextChange" && mode) | ||||
| 						editor_mode.showMode(mode); | ||||
| 					if (mode !== "save") editor_mode.mode = mode; | ||||
| 					editor_mode.actionList = []; | ||||
| 				} | ||||
| 			}; | ||||
| 		} | ||||
| 	}; | ||||
| }, | ||||
|     "手册区分特殊属性": function () { | ||||
|     // 在此增加新插件
 | ||||
|     this.arrsame = function (Arraya, Arrayb) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user