mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-10-31 20:32:58 +08:00 
			
		
		
		
	修复图片加载bug
This commit is contained in:
		
							parent
							
								
									3bdb668c5f
								
							
						
					
					
						commit
						c25f0d7c15
					
				
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -37,3 +37,7 @@ _bundle | |||||||
| out | out | ||||||
| dist-resource | dist-resource | ||||||
| _temp | _temp | ||||||
|  | dam1.png | ||||||
|  | dam2.png | ||||||
|  | dam3.png | ||||||
|  | dam4.png | ||||||
							
								
								
									
										7
									
								
								idea.md
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								idea.md
									
									
									
									
									
								
							| @ -58,3 +58,10 @@ | |||||||
| -   满腹经纶:把所有能学的怪物技能都学一遍 | -   满腹经纶:把所有能学的怪物技能都学一遍 | ||||||
| -   冰与火之舞:通过第二章特殊战的困难难度 | -   冰与火之舞:通过第二章特殊战的困难难度 | ||||||
| -   你是怎么做到的?!:山路地图与勇气之路地图中与若干个神秘的木牌对话 | -   你是怎么做到的?!:山路地图与勇气之路地图中与若干个神秘的木牌对话 | ||||||
|  | 
 | ||||||
|  | ### 伤害对应 | ||||||
|  | 
 | ||||||
|  | dam1.png ---- 存档 404 | ||||||
|  | dam2.png ---- 存档 285 | ||||||
|  | dam3.png ---- 存档 243 | ||||||
|  | dam4.png ---- 存档 59 | ||||||
|  | |||||||
| @ -1450,7 +1450,8 @@ control.prototype._moveDirectyFollowers = function (x, y) { | |||||||
| 
 | 
 | ||||||
| ////// 更新领域、夹击、阻击的伤害地图 //////
 | ////// 更新领域、夹击、阻击的伤害地图 //////
 | ||||||
| control.prototype.updateCheckBlock = function (floorId) { | control.prototype.updateCheckBlock = function (floorId) { | ||||||
|     throw new Error(`This function has been deprecated.`); |     // throw new Error(`This function has been deprecated.`);
 | ||||||
|  |     return this.controldata.updateCheckBlock(floorId); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| ////// 检查并执行领域、夹击、阻击事件 //////
 | ////// 检查并执行领域、夹击、阻击事件 //////
 | ||||||
|  | |||||||
| @ -414,12 +414,19 @@ enemys.prototype.getDefDamage = function (enemy, k, x, y, floorId, hero) { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| enemys.prototype.getEnemyInfo = function (enemy, hero, x, y, floorId) { | enemys.prototype.getEnemyInfo = function (enemy, hero, x, y, floorId) { | ||||||
|     throw new Error(`This function has been deprecated.`); |     // throw new Error(`This function has been deprecated.`);
 | ||||||
|  |     if (enemy == null) return null; | ||||||
|  |     if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; | ||||||
|  |     return this.enemydata.getEnemyInfo(enemy, hero, x, y, floorId); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| ////// 获得战斗伤害信息(实际伤害计算函数) //////
 | ////// 获得战斗伤害信息(实际伤害计算函数) //////
 | ||||||
| enemys.prototype.getDamageInfo = function (enemy, hero, x, y, floorId) { | enemys.prototype.getDamageInfo = function (enemy, hero, x, y, floorId) { | ||||||
|     throw new Error(`This function has been deprecated.`); |     // throw new Error(`This function has been deprecated.`);
 | ||||||
|  |     if (enemy == null) return null; | ||||||
|  |     // 移动到了脚本编辑 - getDamageInfo中
 | ||||||
|  |     if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; | ||||||
|  |     return this.enemydata.getDamageInfo(enemy, hero, x, y, floorId); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| ////// 获得在某个勇士属性下怪物伤害 //////
 | ////// 获得在某个勇士属性下怪物伤害 //////
 | ||||||
|  | |||||||
| @ -115,6 +115,10 @@ export class Resource< | |||||||
|                     ); |                     ); | ||||||
|                 }); |                 }); | ||||||
|             }); |             }); | ||||||
|  |         } else if (this.format === 'image') { | ||||||
|  |             const img = v as HTMLImageElement; | ||||||
|  |             img.setAttribute('_width', img.width.toString()); | ||||||
|  |             img.setAttribute('_height', img.height.toString()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (this.name === '__all_animates__') { |         if (this.name === '__all_animates__') { | ||||||
|  | |||||||
| @ -672,11 +672,17 @@ export function calDamageWith( | |||||||
|     return damage; |     return damage; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | export function initFloorDamage(floorId: FloorIds) { | ||||||
|  |     const floor = core.status.maps[floorId]; | ||||||
|  |     floor.enemy = new EnemyCollection(floorId); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| declare global { | declare global { | ||||||
|     interface PluginDeclaration { |     interface PluginDeclaration { | ||||||
|         damage: { |         damage: { | ||||||
|             Enemy: typeof DamageEnemy; |             Enemy: typeof DamageEnemy; | ||||||
|             Collection: typeof EnemyCollection; |             Collection: typeof EnemyCollection; | ||||||
|  |             initFloorDamage: typeof initFloorDamage; | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -687,5 +693,6 @@ declare global { | |||||||
| 
 | 
 | ||||||
| core.plugin.damage = { | core.plugin.damage = { | ||||||
|     Enemy: DamageEnemy, |     Enemy: DamageEnemy, | ||||||
|     Collection: EnemyCollection |     Collection: EnemyCollection, | ||||||
|  |     initFloorDamage | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -101,7 +101,7 @@ if (main.mode == 'editor') { | |||||||
|         parent.appendChild(input2); |         parent.appendChild(input2); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| core.maps._loadFloor_doNotCopy = function () { | maps.prototype._loadFloor_doNotCopy = function () { | ||||||
|     return [ |     return [ | ||||||
|         'firstArrive', |         'firstArrive', | ||||||
|         'eachArrive', |         'eachArrive', | ||||||
| @ -121,7 +121,7 @@ core.maps._loadFloor_doNotCopy = function () { | |||||||
|     ]; |     ]; | ||||||
| }; | }; | ||||||
| ////// 绘制背景和前景层 //////
 | ////// 绘制背景和前景层 //////
 | ||||||
| core.maps._drawBg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | maps.prototype._drawBg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | ||||||
|     config.ctx = cacheCtx; |     config.ctx = cacheCtx; | ||||||
|     core.maps._drawBg_drawBackground(floorId, config); |     core.maps._drawBg_drawBackground(floorId, config); | ||||||
|     // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制背景图块;后绘制的覆盖先绘制的。
 |     // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制背景图块;后绘制的覆盖先绘制的。
 | ||||||
| @ -154,7 +154,7 @@ core.maps._drawBg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | |||||||
|         ); |         ); | ||||||
|     config.ctx = toDrawCtx; |     config.ctx = toDrawCtx; | ||||||
| }; | }; | ||||||
| core.maps._drawFg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | maps.prototype._drawFg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | ||||||
|     config.ctx = cacheCtx; |     config.ctx = cacheCtx; | ||||||
|     // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制前景图块;后绘制的覆盖先绘制的。
 |     // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制前景图块;后绘制的覆盖先绘制的。
 | ||||||
|     core.maps._drawFloorImages( |     core.maps._drawFloorImages( | ||||||
| @ -187,7 +187,7 @@ core.maps._drawFg_draw = function (floorId, toDrawCtx, cacheCtx, config) { | |||||||
|     config.ctx = toDrawCtx; |     config.ctx = toDrawCtx; | ||||||
| }; | }; | ||||||
| ////// 移动判定 //////
 | ////// 移动判定 //////
 | ||||||
| core.maps._generateMovableArray_arrays = function (floorId) { | maps.prototype._generateMovableArray_arrays = function (floorId) { | ||||||
|     return { |     return { | ||||||
|         bgArray: this.getBgMapArray(floorId), |         bgArray: this.getBgMapArray(floorId), | ||||||
|         fgArray: this.getFgMapArray(floorId), |         fgArray: this.getFgMapArray(floorId), | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user