mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-05 11:34:31 +08:00
Deploying to gh-pages from @ c4e0b706f9 🚀
This commit is contained in:
1 parent
b08531ce72
commit
350603e640
4 files changed
+4
-69
No files matched your search
@@ -286,7 +286,6 @@ core.prototype.init = function (coreData, callback) {
|
||||
this._init_flags();
|
||||
this._init_platform();
|
||||
this._init_others();
|
||||
this._init_plugins();
|
||||
var b = main.mode == 'editor';
|
||||
// 初始化画布
|
||||
for (var name in core.canvas) {
|
||||
@@ -589,51 +588,6 @@ core.prototype._afterLoadResources = function (callback) {
|
||||
if (callback) callback();
|
||||
};
|
||||
|
||||
core.prototype._init_plugins = function () {
|
||||
core.plugin = new (function () {})();
|
||||
|
||||
for (var name in plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1) {
|
||||
if (
|
||||
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1[name] instanceof
|
||||
Function
|
||||
) {
|
||||
try {
|
||||
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1[name].apply(
|
||||
core.plugin
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.error('无法初始化插件' + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!main.pluginUseCompress) {
|
||||
(async function () {
|
||||
const pluginList = main.plugin;
|
||||
for await (const one of pluginList) {
|
||||
const script = document.createElement('script');
|
||||
script.src = `project/plugin/${one}.js`;
|
||||
document.body.appendChild(script);
|
||||
await new Promise(res => {
|
||||
script.addEventListener('load', res);
|
||||
});
|
||||
}
|
||||
})();
|
||||
} else {
|
||||
const script = document.createElement('script');
|
||||
script.src = `project/plugin.min.js`;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
core._forwardFunc('plugin');
|
||||
if (!main.replayChecking && main.mode === 'play') {
|
||||
main.forward();
|
||||
core.resetSettings();
|
||||
core.plugin.showMarkedEnemy.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
core.prototype._forwardFuncs = function () {
|
||||
for (var i = 0; i < main.loadList.length; ++i) {
|
||||
var name = main.loadList[i];
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
///<reference path="../src/types/core.d.ts" />
|
||||
function main() {
|
||||
//------------------------ 用户修改内容 ------------------------//
|
||||
|
||||
this.version = '2.10.0'; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
|
||||
this.version = '1.0.0'; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
|
||||
|
||||
this.useCompress = false; // 是否使用压缩文件
|
||||
this.pluginUseCompress = true; // 仅限于gh-pages使用
|
||||
@@ -216,4 +217,4 @@ function main() {
|
||||
this.__VERSION__ = '2.10.0';
|
||||
this.__VERSION_CODE__ = 510;
|
||||
}
|
||||
main.prototype.init=function(mode,callback){try{var a={};var b={};new Proxy(a,b);new Promise(function(res){return res()});var aa="".concat(123);aa}catch(e){alert("\u6D4F\u89C8\u5668\u7248\u672C\u8FC7\u4F4E\uFF0C\u65E0\u6CD5\u6E38\u73A9\u672C\u5854\uFF01");return}for(var i=0;i<main.dom.gameCanvas.length;i++){main.canvas[main.dom.gameCanvas[i].id]=main.dom.gameCanvas[i].getContext("2d")}main.mode=mode;Promise.all();main.loadJs("project",main.pureData,function(){var mainData=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main;for(var ii in mainData)main[ii]=mainData[ii];main.importFonts(main.fonts);main.loadJs("libs",main.loadList,function(){main.core=core;for(i=0;i<main.loadList.length;i++){var name=main.loadList[i];if(name==="core")continue;main.core[name]=new window[name]}main.loadFloors(function(){var coreData={};["dom","statusBar","canvas","images","tilesets","materials","animates","bgms","sounds","floorIds","floors","floorPartitions"].forEach(function(t){coreData[t]=main[t]});core.init(coreData,callback);core.resize();if(core.getLocalStorage("autoScale")==null){core.setLocalStorage("autoScale",true)}if(core.getLocalStorage("autoScale")&&!core.domStyle.isVertical){try{if(core){core.plugin.maxGameScale();if(!core.getLocalStorage("fullscreen",false)){requestAnimationFrame(function(){var style=getComputedStyle(main.dom.gameGroup);var height=parseFloat(style.height);if(height>window.innerHeight*0.95){core.control.setDisplayScale(-1);if(!core.isPlaying()&&core.flags.enableHDCanvas){core.domStyle.ratio=Math.max(window.devicePixelRatio||1,core.domStyle.scale);core.resize()}}})}}}catch(e){console.error(e)}}})})})};main.prototype.loadJs=function(dir,loadList,callback){main.setMainTipsText("\u6B63\u5728\u52A0\u8F7D\u6838\u5FC3js\u6587\u4EF6...");if(this.useCompress){main.loadMod(dir,dir,function(){callback()})}else{var instanceNum=0;for(var i=0;i<loadList.length;i++){main.loadMod(dir,loadList[i],function(modName){main.setMainTipsText(modName+".js \u52A0\u8F7D\u5B8C\u6BD5");instanceNum++;if(instanceNum===loadList.length){callback()}})}}};main.prototype.loadMod=function(dir,modName,callback,onerror){var script=document.createElement("script");var name=modName;script.src=dir+"/"+modName+(this.useCompress?".min":"")+".js?v="+this.version;script.onload=function(){callback(name)};main.dom.body.appendChild(script)};main.prototype.loadFloors=function(callback){main.setMainTipsText("\u6B63\u5728\u52A0\u8F7D\u697C\u5C42\u6587\u4EF6...");if(this.useCompress){var script=document.createElement("script");script.src="project/floors.min.js?v="+this.version;main.dom.body.appendChild(script);script.onload=function(){main.dom.mainTips.style.display="none";callback()};return}var script=document.createElement("script");script.src="/all/__all_floors__.js?v="+this.version+"&id="+main.floorIds.join(",");script.onload=function(){main.dom.mainTips.style.display="none";main.supportBunch=true;callback()};script.onerror=script.onabort=script.ontimeout=function(e){for(var i=0;i<main.floorIds.length;i++){main.loadFloor(main.floorIds[i],function(modName){main.setMainTipsText("\u697C\u5C42 "+modName+".js \u52A0\u8F7D\u5B8C\u6BD5");if(Object.keys(main.floors).length===main.floorIds.length){main.dom.mainTips.style.display="none";callback()}})}};main.dom.body.appendChild(script)};main.prototype.loadFloor=function(floorId,callback){var script=document.createElement("script");script.src="project/floors/"+floorId+".js?v="+this.version;main.dom.body.appendChild(script);script.onload=function(){callback(floorId)}};main.prototype.setMainTipsText=function(text){main.dom.mainTips.innerHTML=text};main.prototype.log=function(e,error){if(e){if(error)return console.error(e);if(main.core&&main.core.platform&&!main.core.platform.isPC){console.log(e.stack||e.toString())}else{console.log(e)}}};main.prototype.createOnChoiceAnimation=function(){var borderColor=main.dom.startButtonGroup.style.caretColor||"rgb(255, 215, 0)";var rgb=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+\s*)?\)$/.exec(borderColor);if(rgb!=null){var value=rgb[1]+", "+rgb[2]+", "+rgb[3];var style=document.createElement("style");style.type="text/css";var keyFrames="onChoice { "+"0% { border-color: rgba("+value+", 0.9); } "+"50% { border-color: rgba("+value+", 0.3); } "+"100% { border-color: rgba("+value+", 0.9); } "+"}";style.innerHTML="@-webkit-keyframes "+keyFrames+" @keyframes "+keyFrames;document.body.appendChild(style)}};main.prototype.importFonts=function(fonts){if(!(fonts instanceof Array)||fonts.length==0)return;var style=document.createElement("style");style.type="text/css";var html="";fonts.forEach(function(font){html+="@font-face { font-family: \""+font+"\"; src: url(\"project/fonts/"+font+".ttf\") format(\"truetype\"); }"});style.innerHTML=html;document.body.appendChild(style)};main.prototype.listen=function(){window.onresize=function(){try{main.core.resize()}catch(ee){console.error(ee)}};main.dom.body.onkeydown=function(e){if(main.editorOpened)return;try{if(e.keyCode===27)e.preventDefLine truncated
|
||||
function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _regeneratorRuntime(){"use strict";_regeneratorRuntime=function _regeneratorRuntime(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}try{define({},"")}catch(err){define=function define(obj,key,value){return obj[key]=value}}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.seLine truncated
|
||||
@@ -1958,7 +1958,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
try {
|
||||
eval(core.floors[core.status.floorId].parallelDo);
|
||||
} catch (e) {
|
||||
main.log(e);
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,8 @@
|
||||
///<reference path="../../src/types/core.d.ts" />
|
||||
|
||||
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
init: function () {
|
||||
// 这看不到插件,插件全放到plugin文件夹里面了,要看的话去 关于游戏 的开源地址里面看
|
||||
// 直接把仓库clone下来,或者下载zip都行
|
||||
// 脚本编辑同理
|
||||
this._afterLoadResources = function () {};
|
||||
},
|
||||
pluginUtils: function () {
|
||||
// 保留这个函数,以保证main.js能够使用
|
||||
this.maxGameScale = function (n = 0) {
|
||||
const index = core.domStyle.availableScale.indexOf(
|
||||
core.domStyle.scale
|
||||
);
|
||||
core.control.setDisplayScale(
|
||||
core.domStyle.availableScale.length - 1 - index - n
|
||||
);
|
||||
if (!core.isPlaying() && core.flags.enableHDCanvas) {
|
||||
core.domStyle.ratio = Math.max(
|
||||
window.devicePixelRatio || 1,
|
||||
core.domStyle.scale
|
||||
);
|
||||
core.resize();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user