Initial Commit
This commit is contained in:
commit
ec5c71b3ac
1712 changed files with 1767257 additions and 0 deletions
16
www/js/jsconfig.json
Normal file
16
www/js/jsconfig.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target":"es6"
|
||||
},
|
||||
"files": [
|
||||
"./rmmv.d.ts",
|
||||
"./rmmv-pixi.d.ts"
|
||||
],
|
||||
"include": [
|
||||
"./*",
|
||||
"./plugins_dev/*.js",
|
||||
"./plugins/*.js",
|
||||
"libs/yaml.js",
|
||||
"require.js"
|
||||
]
|
||||
}
|
||||
69
www/js/libs/SteamConfig.ini
Normal file
69
www/js/libs/SteamConfig.ini
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
[Settings]
|
||||
;game appid here
|
||||
|
||||
AppID = 1150690
|
||||
|
||||
;source steam_api.dll version
|
||||
|
||||
API = 4.28.51.7
|
||||
|
||||
;player name
|
||||
|
||||
PlayerName = STEAMRIP
|
||||
|
||||
;game Language
|
||||
;english german french italian koreana
|
||||
;spanish schinese tchinese russian thai
|
||||
;japanese portuguese polish danish dutch
|
||||
;finnish norwegian swedish hungarian czech
|
||||
;romanian turkish
|
||||
|
||||
Language = english
|
||||
|
||||
;save types:
|
||||
;ALI213(game dir) 0
|
||||
;ALI213(my documents) 1
|
||||
;RELOADED 4
|
||||
;SKIDROW 5
|
||||
;FLT 6
|
||||
;CODEX(3.0.4+/my documents) 7
|
||||
;CODEX(1.0.0.0+/APPDATA) 8
|
||||
|
||||
SaveType = 0
|
||||
|
||||
;Achievements Count limit
|
||||
|
||||
;AchievementsCount = 0
|
||||
|
||||
;game exe path
|
||||
|
||||
;GameEXE = game.exe
|
||||
|
||||
;SteamUserID = 12345678
|
||||
;SteamUserIDH = 12345678
|
||||
|
||||
;IsLoggedOn = 0
|
||||
|
||||
;Online = 0
|
||||
|
||||
UnLockListedDLCOnly = 1
|
||||
|
||||
[DLC]
|
||||
;SET DLC USE "APPID=NAME"
|
||||
|
||||
|
||||
[Option]
|
||||
;Block Network.
|
||||
|
||||
;FullBlockNetwork = 0
|
||||
|
||||
;Redirect File Handle to ".valve"
|
||||
|
||||
FileRedirectCheck = 1
|
||||
|
||||
;DECRYPT STEAM STUB
|
||||
;set 1 tells steam_api.dll / steam_api64.dll to decrypt the steam stub as soon as possible
|
||||
;set 2 tells SteamClient.dll / SteamClient64.dll to decrypt the steam stub as soon as possible
|
||||
;set 0 to disable it.
|
||||
|
||||
;DECRYPT_STEAM_STUB = 0
|
||||
9766
www/js/libs/dragonbones/dragonBones.js
Normal file
9766
www/js/libs/dragonbones/dragonBones.js
Normal file
File diff suppressed because it is too large
Load diff
733
www/js/libs/dragonbones/dragonBonesPixi.js
Normal file
733
www/js/libs/dragonbones/dragonBonesPixi.js
Normal file
|
|
@ -0,0 +1,733 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
|
||||
var dragonBones;
|
||||
(function (dragonBones) {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* Pixi 贴图集数据。
|
||||
* @version DragonBones 3.0
|
||||
*/
|
||||
var PixiTextureAtlasData = (function (_super) {
|
||||
__extends(PixiTextureAtlasData, _super);
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function PixiTextureAtlasData() {
|
||||
return _super.call(this) || this;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiTextureAtlasData.toString = function () {
|
||||
return "[class dragonBones.PixiTextureAtlasData]";
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiTextureAtlasData.prototype._onClear = function () {
|
||||
_super.prototype._onClear.call(this);
|
||||
if (this.texture) {
|
||||
//this.texture.dispose();
|
||||
}
|
||||
this.texture = null;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiTextureAtlasData.prototype.generateTexture = function () {
|
||||
return dragonBones.BaseObject.borrowObject(PixiTextureData);
|
||||
};
|
||||
return PixiTextureAtlasData;
|
||||
}(dragonBones.TextureAtlasData));
|
||||
dragonBones.PixiTextureAtlasData = PixiTextureAtlasData;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
var PixiTextureData = (function (_super) {
|
||||
__extends(PixiTextureData, _super);
|
||||
function PixiTextureData() {
|
||||
return _super.call(this) || this;
|
||||
}
|
||||
PixiTextureData.toString = function () {
|
||||
return "[class dragonBones.PixiTextureData]";
|
||||
};
|
||||
PixiTextureData.prototype._onClear = function () {
|
||||
_super.prototype._onClear.call(this);
|
||||
if (this.texture) {
|
||||
this.texture.destroy();
|
||||
}
|
||||
this.texture = null;
|
||||
};
|
||||
return PixiTextureData;
|
||||
}(dragonBones.TextureData));
|
||||
dragonBones.PixiTextureData = PixiTextureData;
|
||||
})(dragonBones || (dragonBones = {}));
|
||||
|
||||
var dragonBones;
|
||||
(function (dragonBones) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
var PixiArmatureDisplay = (function (_super) {
|
||||
__extends(PixiArmatureDisplay, _super);
|
||||
/**
|
||||
* @internal
|
||||
* @private
|
||||
*/
|
||||
function PixiArmatureDisplay() {
|
||||
return _super.call(this) || this;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiArmatureDisplay.prototype._onClear = function () {
|
||||
if (this._debugDrawer) {
|
||||
this._debugDrawer.destroy(true);
|
||||
}
|
||||
this._armature = null;
|
||||
this._debugDrawer = null;
|
||||
this.destroy();
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiArmatureDisplay.prototype._dispatchEvent = function (type, eventObject) {
|
||||
this.emit(type, eventObject);
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiArmatureDisplay.prototype._debugDraw = function (isEnabled) {
|
||||
if (!this._debugDrawer) {
|
||||
this._debugDrawer = new PIXI.Sprite();
|
||||
var boneDrawer = new PIXI.Graphics();
|
||||
this._debugDrawer.addChild(boneDrawer);
|
||||
}
|
||||
if (isEnabled) {
|
||||
this.addChild(this._debugDrawer);
|
||||
var boneDrawer = this._debugDrawer.getChildAt(0);
|
||||
boneDrawer.clear();
|
||||
var bones = this._armature.getBones();
|
||||
for (var i = 0, l = bones.length; i < l; ++i) {
|
||||
var bone = bones[i];
|
||||
var boneLength = bone.boneData.length;
|
||||
var startX = bone.globalTransformMatrix.tx;
|
||||
var startY = bone.globalTransformMatrix.ty;
|
||||
var endX = startX + bone.globalTransformMatrix.a * boneLength;
|
||||
var endY = startY + bone.globalTransformMatrix.b * boneLength;
|
||||
boneDrawer.lineStyle(2, bone.ik ? 0xFF0000 : 0x00FFFF, 0.7);
|
||||
boneDrawer.moveTo(startX, startY);
|
||||
boneDrawer.lineTo(endX, endY);
|
||||
boneDrawer.lineStyle(0, 0, 0);
|
||||
boneDrawer.beginFill(0x00FFFF, 0.7);
|
||||
boneDrawer.drawCircle(startX, startY, 3);
|
||||
boneDrawer.endFill();
|
||||
}
|
||||
var slots = this._armature.getSlots();
|
||||
for (var i = 0, l = slots.length; i < l; ++i) {
|
||||
var slot = slots[i];
|
||||
var boundingBoxData = slot.boundingBoxData;
|
||||
if (boundingBoxData) {
|
||||
var child = this._debugDrawer.getChildByName(slot.name);
|
||||
if (!child) {
|
||||
child = new PIXI.Graphics();
|
||||
child.name = slot.name;
|
||||
this._debugDrawer.addChild(child);
|
||||
}
|
||||
child.clear();
|
||||
child.beginFill(0xFF00FF, 0.3);
|
||||
switch (boundingBoxData.type) {
|
||||
case 0 /* Rectangle */:
|
||||
child.drawRect(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
|
||||
break;
|
||||
case 1 /* Ellipse */:
|
||||
child.drawEllipse(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height);
|
||||
break;
|
||||
case 2 /* Polygon */:
|
||||
var vertices = boundingBoxData.vertices;
|
||||
for (var i_1 = 0, l_1 = boundingBoxData.vertices.length; i_1 < l_1; i_1 += 2) {
|
||||
if (i_1 === 0) {
|
||||
child.moveTo(vertices[i_1], vertices[i_1 + 1]);
|
||||
}
|
||||
else {
|
||||
child.lineTo(vertices[i_1], vertices[i_1 + 1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
child.endFill();
|
||||
slot._updateTransformAndMatrix();
|
||||
slot.updateGlobalTransform();
|
||||
var transform = slot.global;
|
||||
child.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX, slot._pivotX, slot._pivotY);
|
||||
}
|
||||
else {
|
||||
var child = this._debugDrawer.getChildByName(slot.name);
|
||||
if (child) {
|
||||
this._debugDrawer.removeChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this._debugDrawer && this._debugDrawer.parent === this) {
|
||||
this.removeChild(this._debugDrawer);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
PixiArmatureDisplay.prototype.hasEvent = function (type) {
|
||||
return this.listeners(type, true); // .d.ts bug
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
PixiArmatureDisplay.prototype.addEvent = function (type, listener, target) {
|
||||
this.addListener(type, listener, target);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
PixiArmatureDisplay.prototype.removeEvent = function (type, listener, target) {
|
||||
this.removeListener(type, listener, target);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
PixiArmatureDisplay.prototype.dispose = function (disposeProxy) {
|
||||
if (disposeProxy === void 0) { disposeProxy = true; }
|
||||
if (this._armature) {
|
||||
this._armature.dispose();
|
||||
this._armature = null;
|
||||
}
|
||||
};
|
||||
Object.defineProperty(PixiArmatureDisplay.prototype, "armature", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
return this._armature;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(PixiArmatureDisplay.prototype, "animation", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
return this._armature.animation;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* @deprecated
|
||||
* @see dragonBones.Armature#clock
|
||||
* @see dragonBones.PixiFactory#clock
|
||||
* @see dragonBones.Animation#timescale
|
||||
* @see dragonBones.Animation#stop()
|
||||
*/
|
||||
PixiArmatureDisplay.prototype.advanceTimeBySelf = function (on) {
|
||||
if (on) {
|
||||
this._armature.clock = dragonBones.PixiFactory.clock;
|
||||
}
|
||||
else {
|
||||
this._armature.clock = null;
|
||||
}
|
||||
};
|
||||
return PixiArmatureDisplay;
|
||||
}(PIXI.Container));
|
||||
dragonBones.PixiArmatureDisplay = PixiArmatureDisplay;
|
||||
})(dragonBones || (dragonBones = {}));
|
||||
|
||||
var dragonBones;
|
||||
(function (dragonBones) {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* Pixi 插槽。
|
||||
* @version DragonBones 3.0
|
||||
*/
|
||||
var PixiSlot = (function (_super) {
|
||||
__extends(PixiSlot, _super);
|
||||
/**
|
||||
* @internal
|
||||
* @private
|
||||
*/
|
||||
function PixiSlot() {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._updateTransform = PIXI.VERSION[0] === "3" ? _this._updateTransformV3 : _this._updateTransformV4;
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.toString = function () {
|
||||
return "[class dragonBones.PixiSlot]";
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._onClear = function () {
|
||||
_super.prototype._onClear.call(this);
|
||||
this._renderDisplay = null;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._initDisplay = function (value) {
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._disposeDisplay = function (value) {
|
||||
value.destroy();
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._onUpdateDisplay = function () {
|
||||
this._renderDisplay = (this._display ? this._display : this._rawDisplay);
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._addDisplay = function () {
|
||||
var container = this._armature.display;
|
||||
container.addChild(this._renderDisplay);
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._replaceDisplay = function (value) {
|
||||
var container = this._armature.display;
|
||||
var prevDisplay = value;
|
||||
container.addChild(this._renderDisplay);
|
||||
container.swapChildren(this._renderDisplay, prevDisplay);
|
||||
container.removeChild(prevDisplay);
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._removeDisplay = function () {
|
||||
this._renderDisplay.parent.removeChild(this._renderDisplay);
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateZOrder = function () {
|
||||
var container = this._armature.display;
|
||||
var index = container.getChildIndex(this._renderDisplay);
|
||||
if (index === this._zOrder) {
|
||||
return;
|
||||
}
|
||||
container.addChildAt(this._renderDisplay, this._zOrder);
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateVisible = function () {
|
||||
this._renderDisplay.visible = this._parent.visible;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateBlendMode = function () {
|
||||
switch (this._blendMode) {
|
||||
case 0 /* Normal */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.NORMAL;
|
||||
break;
|
||||
case 1 /* Add */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.ADD;
|
||||
break;
|
||||
case 3 /* Darken */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.DARKEN;
|
||||
break;
|
||||
case 4 /* Difference */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.DIFFERENCE;
|
||||
break;
|
||||
case 6 /* HardLight */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.HARD_LIGHT;
|
||||
break;
|
||||
case 9 /* Lighten */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.LIGHTEN;
|
||||
break;
|
||||
case 10 /* Multiply */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.MULTIPLY;
|
||||
break;
|
||||
case 11 /* Overlay */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.OVERLAY;
|
||||
break;
|
||||
case 12 /* Screen */:
|
||||
this._renderDisplay.blendMode = PIXI.BLEND_MODES.SCREEN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateColor = function () {
|
||||
this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateFrame = function () {
|
||||
var isMeshDisplay = this._meshData && this._display === this._meshDisplay;
|
||||
var currentTextureData = this._textureData;
|
||||
if (this._displayIndex >= 0 && this._display && currentTextureData) {
|
||||
var currentTextureAtlasData = currentTextureData.parent;
|
||||
// Update replaced texture atlas.
|
||||
if (this._armature.replacedTexture && this._displayData && currentTextureAtlasData === this._displayData.texture.parent) {
|
||||
currentTextureAtlasData = this._armature._replaceTextureAtlasData;
|
||||
if (!currentTextureAtlasData) {
|
||||
currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData);
|
||||
currentTextureAtlasData.copyFrom(currentTextureData.parent);
|
||||
currentTextureAtlasData.texture = this._armature.replacedTexture;
|
||||
this._armature._replaceTextureAtlasData = currentTextureAtlasData;
|
||||
}
|
||||
currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name);
|
||||
}
|
||||
var currentTextureAtlas = currentTextureAtlasData.texture;
|
||||
if (currentTextureAtlas) {
|
||||
if (!currentTextureData.texture) {
|
||||
currentTextureData.texture = new PIXI.Texture(currentTextureAtlas, currentTextureData.region, // No need to set frame.
|
||||
currentTextureData.region, new PIXI.Rectangle(0, 0, currentTextureData.region.width, currentTextureData.region.height), currentTextureData.rotated // .d.ts bug
|
||||
);
|
||||
}
|
||||
if (isMeshDisplay) {
|
||||
var meshDisplay = this._renderDisplay;
|
||||
var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : currentTextureAtlas.width;
|
||||
var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : currentTextureAtlas.height;
|
||||
meshDisplay.uvs = new Float32Array(this._meshData.uvs);
|
||||
meshDisplay.vertices = new Float32Array(this._meshData.vertices);
|
||||
meshDisplay.indices = new Uint16Array(this._meshData.vertexIndices);
|
||||
for (var i = 0, l = meshDisplay.uvs.length; i < l; i += 2) {
|
||||
var u = meshDisplay.uvs[i];
|
||||
var v = meshDisplay.uvs[i + 1];
|
||||
meshDisplay.uvs[i] = (currentTextureData.region.x + u * currentTextureData.region.width) / textureAtlasWidth;
|
||||
meshDisplay.uvs[i + 1] = (currentTextureData.region.y + v * currentTextureData.region.height) / textureAtlasHeight;
|
||||
}
|
||||
meshDisplay.texture = currentTextureData.texture;
|
||||
//meshDisplay.dirty = true; // Pixi 3.x
|
||||
meshDisplay.dirty++; // Pixi 4.x Can not support change mesh vertice count.
|
||||
}
|
||||
else {
|
||||
var normalDisplay = this._renderDisplay;
|
||||
normalDisplay.texture = currentTextureData.texture;
|
||||
}
|
||||
this._updateVisible();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isMeshDisplay) {
|
||||
var meshDisplay = this._renderDisplay;
|
||||
meshDisplay.texture = null;
|
||||
meshDisplay.x = 0.0;
|
||||
meshDisplay.y = 0.0;
|
||||
meshDisplay.visible = false;
|
||||
}
|
||||
else {
|
||||
var normalDisplay = this._renderDisplay;
|
||||
normalDisplay.texture = null;
|
||||
normalDisplay.x = 0.0;
|
||||
normalDisplay.y = 0.0;
|
||||
normalDisplay.visible = false;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateMesh = function () {
|
||||
var meshDisplay = this._renderDisplay;
|
||||
var hasFFD = this._ffdVertices.length > 0;
|
||||
if (this._meshData.skinned) {
|
||||
for (var i = 0, iF = 0, l = this._meshData.vertices.length; i < l; i += 2) {
|
||||
var iH = i / 2;
|
||||
var boneIndices = this._meshData.boneIndices[iH];
|
||||
var boneVertices = this._meshData.boneVertices[iH];
|
||||
var weights = this._meshData.weights[iH];
|
||||
var xG = 0.0, yG = 0.0;
|
||||
for (var iB = 0, lB = boneIndices.length; iB < lB; ++iB) {
|
||||
var bone = this._meshBones[boneIndices[iB]];
|
||||
var matrix = bone.globalTransformMatrix;
|
||||
var weight = weights[iB];
|
||||
var xL = 0.0, yL = 0.0;
|
||||
if (hasFFD) {
|
||||
xL = boneVertices[iB * 2] + this._ffdVertices[iF];
|
||||
yL = boneVertices[iB * 2 + 1] + this._ffdVertices[iF + 1];
|
||||
}
|
||||
else {
|
||||
xL = boneVertices[iB * 2];
|
||||
yL = boneVertices[iB * 2 + 1];
|
||||
}
|
||||
xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight;
|
||||
yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight;
|
||||
iF += 2;
|
||||
}
|
||||
meshDisplay.vertices[i] = xG;
|
||||
meshDisplay.vertices[i + 1] = yG;
|
||||
}
|
||||
}
|
||||
else if (hasFFD) {
|
||||
var vertices = this._meshData.vertices;
|
||||
for (var i = 0, l = this._meshData.vertices.length; i < l; i += 2) {
|
||||
var xG = vertices[i] + this._ffdVertices[i];
|
||||
var yG = vertices[i + 1] + this._ffdVertices[i + 1];
|
||||
meshDisplay.vertices[i] = xG;
|
||||
meshDisplay.vertices[i + 1] = yG;
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateTransform = function (isSkinnedMesh) {
|
||||
throw new Error();
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateTransformV3 = function (isSkinnedMesh) {
|
||||
if (isSkinnedMesh) {
|
||||
this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
else {
|
||||
this.updateGlobalTransform(); // Update transform.
|
||||
var x = this.globalTransformMatrix.tx - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); // Pixi pivot do not work.
|
||||
var y = this.globalTransformMatrix.ty - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); // Pixi pivot do not work.
|
||||
var transform = this.global;
|
||||
this._renderDisplay.setTransform(x, y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiSlot.prototype._updateTransformV4 = function (isSkinnedMesh) {
|
||||
if (isSkinnedMesh) {
|
||||
this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
else {
|
||||
this.updateGlobalTransform(); // Update transform.
|
||||
var transform = this.global;
|
||||
this._renderDisplay.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.skewX, 0.0, transform.skewY - transform.skewX, this._pivotX, this._pivotY);
|
||||
}
|
||||
};
|
||||
return PixiSlot;
|
||||
}(dragonBones.Slot));
|
||||
dragonBones.PixiSlot = PixiSlot;
|
||||
})(dragonBones || (dragonBones = {}));
|
||||
var dragonBones;
|
||||
(function (dragonBones) {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* Pixi 工厂。
|
||||
* @version DragonBones 3.0
|
||||
*/
|
||||
var PixiFactory = (function (_super) {
|
||||
__extends(PixiFactory, _super);
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 创建一个工厂。 (通常只需要一个全局工厂实例)
|
||||
* @param dataParser 龙骨数据解析器,如果不设置,则使用默认解析器。
|
||||
* @version DragonBones 3.0
|
||||
*/
|
||||
function PixiFactory(dataParser) {
|
||||
if (dataParser === void 0) { dataParser = null; }
|
||||
var _this = _super.call(this, dataParser) || this;
|
||||
if (!PixiFactory._eventManager) {
|
||||
PixiFactory._eventManager = new dragonBones.PixiArmatureDisplay();
|
||||
PixiFactory._clock = new dragonBones.WorldClock();
|
||||
PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
PixiFactory._clockHandler = function (passedTime) {
|
||||
PixiFactory._clock.advanceTime(-1); // passedTime !?
|
||||
//console.log("Dragonbones' clock ticking");
|
||||
};
|
||||
Object.defineProperty(PixiFactory, "factory", {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 一个可以直接使用的全局工厂实例。
|
||||
* @version DragonBones 4.7
|
||||
*/
|
||||
get: function () {
|
||||
if (!PixiFactory._factory) {
|
||||
PixiFactory._factory = new PixiFactory();
|
||||
}
|
||||
return PixiFactory._factory;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(PixiFactory, "clock", {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 一个可以直接使用的全局 WorldClock 实例.
|
||||
* @version DragonBones 5.0
|
||||
*/
|
||||
get: function () {
|
||||
return PixiFactory._clock;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiFactory.prototype._generateTextureAtlasData = function (textureAtlasData, textureAtlas) {
|
||||
if (textureAtlasData) {
|
||||
textureAtlasData.texture = textureAtlas;
|
||||
}
|
||||
else {
|
||||
textureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData);
|
||||
}
|
||||
return textureAtlasData;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiFactory.prototype._generateArmature = function (dataPackage) {
|
||||
var armature = dragonBones.BaseObject.borrowObject(dragonBones.Armature);
|
||||
var armatureDisplay = new dragonBones.PixiArmatureDisplay();
|
||||
armatureDisplay._armature = armature;
|
||||
armature._init(dataPackage.armature, dataPackage.skin, armatureDisplay, armatureDisplay, PixiFactory._eventManager);
|
||||
return armature;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PixiFactory.prototype._generateSlot = function (dataPackage, skinSlotData, armature) {
|
||||
var slotData = skinSlotData.slot;
|
||||
var slot = dragonBones.BaseObject.borrowObject(dragonBones.PixiSlot);
|
||||
var displayList = [];
|
||||
slot._init(skinSlotData, new PIXI.Sprite(), new PIXI.mesh.Mesh(null, null, null, null, PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES));
|
||||
for (var i = 0, l = skinSlotData.displays.length; i < l; ++i) {
|
||||
var displayData = skinSlotData.displays[i];
|
||||
switch (displayData.type) {
|
||||
case 0 /* Image */:
|
||||
if (!displayData.texture) {
|
||||
displayData.texture = this._getTextureData(dataPackage.dataName, displayData.path);
|
||||
}
|
||||
if (dataPackage.textureAtlasName) {
|
||||
slot._textureDatas[i] = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
|
||||
}
|
||||
displayList[i] = slot.rawDisplay;
|
||||
break;
|
||||
case 2 /* Mesh */:
|
||||
if (!displayData.texture) {
|
||||
displayData.texture = this._getTextureData(dataPackage.dataName, displayData.path);
|
||||
}
|
||||
if (dataPackage.textureAtlasName) {
|
||||
slot._textureDatas[i] = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
|
||||
}
|
||||
if (!displayData.mesh && displayData.share) {
|
||||
displayData.mesh = skinSlotData.getMesh(displayData.share);
|
||||
}
|
||||
displayList[i] = slot.meshDisplay;
|
||||
break;
|
||||
case 1 /* Armature */:
|
||||
var childArmature = this.buildArmature(displayData.path, dataPackage.dataName, null, dataPackage.textureAtlasName);
|
||||
if (childArmature) {
|
||||
childArmature.inheritAnimation = displayData.inheritAnimation;
|
||||
if (!childArmature.inheritAnimation) {
|
||||
var actions = slotData.actions.length > 0 ? slotData.actions : childArmature.armatureData.actions;
|
||||
if (actions.length > 0) {
|
||||
for (var i_2 = 0, l_2 = actions.length; i_2 < l_2; ++i_2) {
|
||||
childArmature._bufferAction(actions[i_2]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
childArmature.animation.play();
|
||||
}
|
||||
}
|
||||
displayData.armature = childArmature.armatureData; //
|
||||
}
|
||||
displayList[i] = childArmature;
|
||||
break;
|
||||
default:
|
||||
displayList[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
slot._setDisplayList(displayList);
|
||||
return slot;
|
||||
};
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 创建一个指定名称的骨架,并使用骨架的显示容器来更新骨架动画。
|
||||
* @param armatureName 骨架名称。
|
||||
* @param dragonBonesName 龙骨数据名称,如果未设置,将检索所有的龙骨数据,如果多个数据中包含同名的骨架数据,可能无法创建出准确的骨架。
|
||||
* @param skinName 皮肤名称,如果未设置,则使用默认皮肤。
|
||||
* @param textureAtlasName 贴图集数据名称,如果未设置,则使用龙骨数据。
|
||||
* @returns 骨架的显示容器。
|
||||
* @see dragonBones.PixiArmatureDisplay
|
||||
* @version DragonBones 4.5
|
||||
*/
|
||||
PixiFactory.prototype.buildArmatureDisplay = function (armatureName, dragonBonesName, skinName, textureAtlasName) {
|
||||
if (dragonBonesName === void 0) { dragonBonesName = null; }
|
||||
if (skinName === void 0) { skinName = null; }
|
||||
if (textureAtlasName === void 0) { textureAtlasName = null; }
|
||||
var armature = this.buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName);
|
||||
if (armature) {
|
||||
var armatureDisplay = armature.display;
|
||||
PixiFactory._clock.add(armature);
|
||||
return armatureDisplay;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 获取带有指定贴图的显示对象。
|
||||
* @param textureName 指定的贴图名称。
|
||||
* @param dragonBonesName 指定的龙骨数据名称,如果未设置,将检索所有的龙骨数据。
|
||||
* @version DragonBones 3.0
|
||||
*/
|
||||
PixiFactory.prototype.getTextureDisplay = function (textureName, dragonBonesName) {
|
||||
if (dragonBonesName === void 0) { dragonBonesName = null; }
|
||||
var textureData = this._getTextureData(dragonBonesName, textureName);
|
||||
if (textureData) {
|
||||
if (!textureData.texture) {
|
||||
var textureAtlasTexture = textureData.parent.texture;
|
||||
var originSize = new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height);
|
||||
textureData.texture = new PIXI.Texture(textureAtlasTexture, textureData.region, textureData.region, originSize, textureData.rotated // .d.ts bug
|
||||
);
|
||||
}
|
||||
return new PIXI.Sprite(textureData.texture);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
Object.defineProperty(PixiFactory.prototype, "soundEventManater", {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 获取全局声音事件管理器。
|
||||
* @version DragonBones 4.5
|
||||
*/
|
||||
get: function () {
|
||||
return PixiFactory._eventManager;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return PixiFactory;
|
||||
}(dragonBones.BaseFactory));
|
||||
PixiFactory._factory = null;
|
||||
PixiFactory._eventManager = null;
|
||||
PixiFactory._clock = null;
|
||||
dragonBones.PixiFactory = PixiFactory;
|
||||
})(dragonBones || (dragonBones = {}));
|
||||
15
www/js/libs/fpsmeter.js
Normal file
15
www/js/libs/fpsmeter.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*! FPSMeter 0.3.1 - 9th May 2013 | https://github.com/Darsain/fpsmeter */
|
||||
(function(m,j){function s(a,e){for(var g in e)try{a.style[g]=e[g]}catch(j){}return a}function H(a){return null==a?String(a):"object"===typeof a||"function"===typeof a?Object.prototype.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof a}function R(a,e){if("array"!==H(e))return-1;if(e.indexOf)return e.indexOf(a);for(var g=0,j=e.length;g<j;g++)if(e[g]===a)return g;return-1}function I(){var a=arguments,e;for(e in a[1])if(a[1].hasOwnProperty(e))switch(H(a[1][e])){case "object":a[0][e]=
|
||||
I({},a[0][e],a[1][e]);break;case "array":a[0][e]=a[1][e].slice(0);break;default:a[0][e]=a[1][e]}return 2<a.length?I.apply(null,[a[0]].concat(Array.prototype.slice.call(a,2))):a[0]}function N(a){a=Math.round(255*a).toString(16);return 1===a.length?"0"+a:a}function S(a,e,g,j){if(a.addEventListener)a[j?"removeEventListener":"addEventListener"](e,g,!1);else if(a.attachEvent)a[j?"detachEvent":"attachEvent"]("on"+e,g)}function D(a,e){function g(a,b,d,c){return y[0|a][Math.round(Math.min((b-d)/(c-d)*J,J))]}
|
||||
function r(){f.legend.fps!==q&&(f.legend.fps=q,f.legend[T]=q?"FPS":"ms");K=q?b.fps:b.duration;f.count[T]=999<K?"999+":K.toFixed(99<K?0:d.decimals)}function m(){z=A();L<z-d.threshold&&(b.fps-=b.fps/Math.max(1,60*d.smoothing/d.interval),b.duration=1E3/b.fps);for(c=d.history;c--;)E[c]=0===c?b.fps:E[c-1],F[c]=0===c?b.duration:F[c-1];r();if(d.heat){if(w.length)for(c=w.length;c--;)w[c].el.style[h[w[c].name].heatOn]=q?g(h[w[c].name].heatmap,b.fps,0,d.maxFps):g(h[w[c].name].heatmap,b.duration,d.threshold,
|
||||
0);if(f.graph&&h.column.heatOn)for(c=u.length;c--;)u[c].style[h.column.heatOn]=q?g(h.column.heatmap,E[c],0,d.maxFps):g(h.column.heatmap,F[c],d.threshold,0)}if(f.graph)for(p=0;p<d.history;p++)u[p].style.height=(q?E[p]?Math.round(O/d.maxFps*Math.min(E[p],d.maxFps)):0:F[p]?Math.round(O/d.threshold*Math.min(F[p],d.threshold)):0)+"px"}function k(){20>d.interval?(x=M(k),m()):(x=setTimeout(k,d.interval),P=M(m))}function G(a){a=a||window.event;a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue=
|
||||
!1,a.cancelBubble=!0);b.toggle()}function U(){d.toggleOn&&S(f.container,d.toggleOn,G,1);a.removeChild(f.container)}function V(){f.container&&U();h=D.theme[d.theme];y=h.compiledHeatmaps||[];if(!y.length&&h.heatmaps.length){for(p=0;p<h.heatmaps.length;p++){y[p]=[];for(c=0;c<=J;c++){var b=y[p],e=c,g;g=0.33/J*c;var j=h.heatmaps[p].saturation,m=h.heatmaps[p].lightness,n=void 0,k=void 0,l=void 0,t=l=void 0,v=n=k=void 0,v=void 0,l=0.5>=m?m*(1+j):m+j-m*j;0===l?g="#000":(t=2*m-l,k=(l-t)/l,g*=6,n=Math.floor(g),
|
||||
v=g-n,v*=l*k,0===n||6===n?(n=l,k=t+v,l=t):1===n?(n=l-v,k=l,l=t):2===n?(n=t,k=l,l=t+v):3===n?(n=t,k=l-v):4===n?(n=t+v,k=t):(n=l,k=t,l-=v),g="#"+N(n)+N(k)+N(l));b[e]=g}}h.compiledHeatmaps=y}f.container=s(document.createElement("div"),h.container);f.count=f.container.appendChild(s(document.createElement("div"),h.count));f.legend=f.container.appendChild(s(document.createElement("div"),h.legend));f.graph=d.graph?f.container.appendChild(s(document.createElement("div"),h.graph)):0;w.length=0;for(var q in f)f[q]&&
|
||||
h[q].heatOn&&w.push({name:q,el:f[q]});u.length=0;if(f.graph){f.graph.style.width=d.history*h.column.width+(d.history-1)*h.column.spacing+"px";for(c=0;c<d.history;c++)u[c]=f.graph.appendChild(s(document.createElement("div"),h.column)),u[c].style.position="absolute",u[c].style.bottom=0,u[c].style.right=c*h.column.width+c*h.column.spacing+"px",u[c].style.width=h.column.width+"px",u[c].style.height="0px"}s(f.container,d);r();a.appendChild(f.container);f.graph&&(O=f.graph.clientHeight);d.toggleOn&&("click"===
|
||||
d.toggleOn&&(f.container.style.cursor="pointer"),S(f.container,d.toggleOn,G))}"object"===H(a)&&a.nodeType===j&&(e=a,a=document.body);a||(a=document.body);var b=this,d=I({},D.defaults,e||{}),f={},u=[],h,y,J=100,w=[],W=0,B=d.threshold,Q=0,L=A()-B,z,E=[],F=[],x,P,q="fps"===d.show,O,K,c,p;b.options=d;b.fps=0;b.duration=0;b.isPaused=0;b.tickStart=function(){Q=A()};b.tick=function(){z=A();W=z-L;B+=(W-B)/d.smoothing;b.fps=1E3/B;b.duration=Q<L?B:z-Q;L=z};b.pause=function(){x&&(b.isPaused=1,clearTimeout(x),
|
||||
C(x),C(P),x=P=0);return b};b.resume=function(){x||(b.isPaused=0,k());return b};b.set=function(a,c){d[a]=c;q="fps"===d.show;-1!==R(a,X)&&V();-1!==R(a,Y)&&s(f.container,d);return b};b.showDuration=function(){b.set("show","ms");return b};b.showFps=function(){b.set("show","fps");return b};b.toggle=function(){b.set("show",q?"ms":"fps");return b};b.hide=function(){b.pause();f.container.style.display="none";return b};b.show=function(){b.resume();f.container.style.display="block";return b};b.destroy=function(){b.pause();
|
||||
U();b.tick=b.tickStart=function(){}};V();k()}var A,r=m.performance;A=r&&(r.now||r.webkitNow)?r[r.now?"now":"webkitNow"].bind(r):function(){return+new Date};for(var C=m.cancelAnimationFrame||m.cancelRequestAnimationFrame,M=m.requestAnimationFrame,r=["moz","webkit","o"],G=0,k=0,Z=r.length;k<Z&&!C;++k)M=(C=m[r[k]+"CancelAnimationFrame"]||m[r[k]+"CancelRequestAnimationFrame"])&&m[r[k]+"RequestAnimationFrame"];C||(M=function(a){var e=A(),g=Math.max(0,16-(e-G));G=e+g;return m.setTimeout(function(){a(e+
|
||||
g)},g)},C=function(a){clearTimeout(a)});var T="string"===H(document.createElement("div").textContent)?"textContent":"innerText";D.extend=I;window.FPSMeter=D;D.defaults={interval:100,smoothing:10,show:"fps",toggleOn:"click",decimals:1,maxFps:60,threshold:100,position:"absolute",zIndex:10,left:"5px",top:"5px",right:"auto",bottom:"auto",margin:"0 0 0 0",theme:"dark",heat:0,graph:0,history:20};var X=["toggleOn","theme","heat","graph","history"],Y="position zIndex left top right bottom margin".split(" ")})(window);(function(m,j){j.theme={};var s=j.theme.base={heatmaps:[],container:{heatOn:null,heatmap:null,padding:"5px",minWidth:"95px",height:"30px",lineHeight:"30px",textAlign:"right",textShadow:"none"},count:{heatOn:null,heatmap:null,position:"absolute",top:0,right:0,padding:"5px 10px",height:"30px",fontSize:"24px",fontFamily:"Consolas, Andale Mono, monospace",zIndex:2},legend:{heatOn:null,heatmap:null,position:"absolute",top:0,left:0,padding:"5px 10px",height:"30px",fontSize:"12px",lineHeight:"32px",fontFamily:"sans-serif",
|
||||
textAlign:"left",zIndex:2},graph:{heatOn:null,heatmap:null,position:"relative",boxSizing:"padding-box",MozBoxSizing:"padding-box",height:"100%",zIndex:1},column:{width:4,spacing:1,heatOn:null,heatmap:null}};j.theme.dark=j.extend({},s,{heatmaps:[{saturation:0.8,lightness:0.8}],container:{background:"#222",color:"#fff",border:"1px solid #1a1a1a",textShadow:"1px 1px 0 #222"},count:{heatOn:"color"},column:{background:"#3f3f3f"}});j.theme.light=j.extend({},s,{heatmaps:[{saturation:0.5,lightness:0.5}],
|
||||
container:{color:"#666",background:"#fff",textShadow:"1px 1px 0 rgba(255,255,255,.5), -1px -1px 0 rgba(255,255,255,.5)",boxShadow:"0 0 0 1px rgba(0,0,0,.1)"},count:{heatOn:"color"},column:{background:"#eaeaea"}});j.theme.colorful=j.extend({},s,{heatmaps:[{saturation:0.5,lightness:0.6}],container:{heatOn:"backgroundColor",background:"#888",color:"#fff",textShadow:"1px 1px 0 rgba(0,0,0,.2)",boxShadow:"0 0 0 1px rgba(0,0,0,.1)"},column:{background:"#777",backgroundColor:"rgba(0,0,0,.2)"}});j.theme.transparent=
|
||||
j.extend({},s,{heatmaps:[{saturation:0.8,lightness:0.5}],container:{padding:0,color:"#fff",textShadow:"1px 1px 0 rgba(0,0,0,.5)"},count:{padding:"0 5px",height:"40px",lineHeight:"40px"},legend:{padding:"0 5px",height:"40px",lineHeight:"42px"},graph:{height:"40px"},column:{width:5,background:"#999",heatOn:"backgroundColor",opacity:0.5}})})(window,FPSMeter);
|
||||
BIN
www/js/libs/greenworks-linux32.node
Normal file
BIN
www/js/libs/greenworks-linux32.node
Normal file
Binary file not shown.
BIN
www/js/libs/greenworks-linux64.node
Normal file
BIN
www/js/libs/greenworks-linux64.node
Normal file
Binary file not shown.
BIN
www/js/libs/greenworks-osx64.node
Normal file
BIN
www/js/libs/greenworks-osx64.node
Normal file
Binary file not shown.
BIN
www/js/libs/greenworks-win32.node
Normal file
BIN
www/js/libs/greenworks-win32.node
Normal file
Binary file not shown.
BIN
www/js/libs/greenworks-win64.node
Normal file
BIN
www/js/libs/greenworks-win64.node
Normal file
Binary file not shown.
3
www/js/libs/iphone-inline-video.browser.js
Normal file
3
www/js/libs/iphone-inline-video.browser.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/*! npm.im/iphone-inline-video */
|
||||
var makeVideoPlayableInline=function(){"use strict";/*! npm.im/intervalometer */
|
||||
function e(e,n,r,i){function t(r){d=n(t,i),e(r-(a||r)),a=r}var d,a;return{start:function(){d||t(0)},stop:function(){r(d),d=null,a=0}}}function n(n){return e(n,requestAnimationFrame,cancelAnimationFrame)}function r(e,n,r,i){function t(n){Boolean(e[r])===Boolean(i)&&n.stopImmediatePropagation(),delete e[r]}return e.addEventListener(n,t,!1),t}function i(e,n,r,i){function t(){return r[n]}function d(e){r[n]=e}i&&d(e[n]),Object.defineProperty(e,n,{get:t,set:d})}function t(e,n,r){r.addEventListener(n,function(){return e.dispatchEvent(new Event(n))})}function d(e,n){Promise.resolve().then(function(){e.dispatchEvent(new Event(n))})}function a(e){var n=new Audio;return t(e,"play",n),t(e,"playing",n),t(e,"pause",n),n.crossOrigin=e.crossOrigin,n.src=e.src||e.currentSrc||"data:",n}function o(e,n,r){(m||0)+200<Date.now()&&(e[g]=!0,m=Date.now()),r||(e.currentTime=n),A[++k%3]=100*n|0}function u(e){return e.driver.currentTime>=e.video.duration}function s(e){var n=this;n.video.readyState>=n.video.HAVE_FUTURE_DATA?(n.hasAudio||(n.driver.currentTime=n.video.currentTime+e*n.video.playbackRate/1e3,n.video.loop&&u(n)&&(n.driver.currentTime=0)),o(n.video,n.driver.currentTime)):n.video.networkState!==n.video.NETWORK_IDLE||n.video.buffered.length||n.video.load(),n.video.ended&&(delete n.video[g],n.video.pause(!0))}function c(){var e=this,n=e[b];return e.webkitDisplayingFullscreen?void e[E]():("data:"!==n.driver.src&&n.driver.src!==e.src&&(o(e,0,!0),n.driver.src=e.src),void(e.paused&&(n.paused=!1,e.buffered.length||e.load(),n.driver.play(),n.updater.start(),n.hasAudio||(d(e,"play"),n.video.readyState>=n.video.HAVE_ENOUGH_DATA&&d(e,"playing")))))}function v(e){var n=this,r=n[b];r.driver.pause(),r.updater.stop(),n.webkitDisplayingFullscreen&&n[T](),r.paused&&!e||(r.paused=!0,r.hasAudio||d(n,"pause"),n.ended&&(n[g]=!0,d(n,"ended")))}function p(e,r){var i=e[b]={};i.paused=!0,i.hasAudio=r,i.video=e,i.updater=n(s.bind(i)),r?i.driver=a(e):(e.addEventListener("canplay",function(){e.paused||d(e,"playing")}),i.driver={src:e.src||e.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,u(i)&&o(e,0)},get ended(){return u(i)}}),e.addEventListener("emptied",function(){var n=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==e.src&&(o(e,0,!0),i.driver.src=e.src,n?i.driver.play():i.updater.stop())},!1),e.addEventListener("webkitbeginfullscreen",function(){e.paused?r&&!i.driver.buffered.length&&i.driver.load():(e.pause(),e[E]())}),r&&(e.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=e.currentTime}),e.addEventListener("seeking",function(){A.indexOf(100*e.currentTime|0)<0&&(i.driver.currentTime=e.currentTime)}))}function l(e){var n=e[b];e[E]=e.play,e[T]=e.pause,e.play=c,e.pause=v,i(e,"paused",n.driver),i(e,"muted",n.driver,!0),i(e,"playbackRate",n.driver,!0),i(e,"ended",n.driver),i(e,"loop",n.driver,!0),r(e,"seeking"),r(e,"seeked"),r(e,"timeupdate",g,!1),r(e,"ended",g,!1)}function f(e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0),r&&!h||e[b]||(p(e,n),l(e),e.classList.add("IIV"),!n&&e.autoplay&&e.play(),/iPhone|iPod|iPad/.test(navigator.platform)||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var m,y="undefined"==typeof Symbol?function(e){return"@"+(e||"@")+Math.random()}:Symbol,h="object-fit"in document.head.style&&/iPhone|iPod/i.test(navigator.userAgent)&&!matchMedia("(-webkit-video-playable-inline)").matches,b=y(),g=y(),E=y("nativeplay"),T=y("nativepause"),A=[],k=0;return f.isWhitelisted=h,f}();
|
||||
BIN
www/js/libs/libsdkencryptedappticket.dylib
Normal file
BIN
www/js/libs/libsdkencryptedappticket.dylib
Normal file
Binary file not shown.
BIN
www/js/libs/libsdkencryptedappticket.so
Normal file
BIN
www/js/libs/libsdkencryptedappticket.so
Normal file
Binary file not shown.
BIN
www/js/libs/libsteam_api.dylib
Normal file
BIN
www/js/libs/libsteam_api.dylib
Normal file
Binary file not shown.
BIN
www/js/libs/libsteam_api.so
Normal file
BIN
www/js/libs/libsteam_api.so
Normal file
Binary file not shown.
1
www/js/libs/lz-string.js
Normal file
1
www/js/libs/lz-string.js
Normal file
File diff suppressed because one or more lines are too long
398
www/js/libs/pinyin.json
Normal file
398
www/js/libs/pinyin.json
Normal file
|
|
@ -0,0 +1,398 @@
|
|||
{
|
||||
"a": "啊阿",
|
||||
"ai": "埃挨哎唉哀皑癌蔼矮艾碍爱隘",
|
||||
"an": "鞍氨安俺按暗岸胺案",
|
||||
"ang": "肮昂盎",
|
||||
"ao": "凹敖熬翱袄傲奥懊澳",
|
||||
"ba": "芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸",
|
||||
"bai": "白柏百摆佰败拜稗",
|
||||
"ban": "斑班搬扳般颁板版扮拌伴瓣半办绊",
|
||||
"bang": "邦帮梆榜膀绑棒磅蚌镑傍谤",
|
||||
"bao": "苞胞包褒剥盄盇盉盋盌盓盕盙盚盜盝盞盠盡盢監盤盦盧盨盩盪盫盬盭盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎眏眐眑眒眓眔眕眖眗眘眛眜眝眞眡眣眤眥眧眪眫眬眮眰眱眲眳眴眹眻眽眾眿睂睄睅睆睈睉睊睋睌睍睎睏睒睓睔睕睖睗睘睙睜薄雹保堡饱宝抱报暴豹鲍爆",
|
||||
"bei": "杯碑悲卑北辈背贝钡倍狈备惫焙被",
|
||||
"ben": "奔苯本笨",
|
||||
"beng": "崩绷甭泵蹦迸",
|
||||
"bi": "逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛",
|
||||
"bian": "鞭边编贬扁便变卞辨辩辫遍",
|
||||
"biao": "标彪膘表",
|
||||
"bie": "鳖憋别瘪",
|
||||
"bin": "彬斌濒滨宾摈",
|
||||
"bing": "兵冰柄丙秉饼炳 睝睞睠睤睧睩睪睭睮睯睰睱睲睳睴睵睶睷睸睺睻睼瞁瞂瞃瞆瞇瞈瞉瞊瞋瞏瞐瞓瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶瞷瞸瞹瞺瞼瞾矀矁矂矃矄矅矆矇矈矉矊矋矌矎矏矐矑矒矓矔矕矖矘矙矚矝矞矟矠矡矤病并",
|
||||
"bo": "玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜",
|
||||
"bu": "哺补埠不布步簿部怖",
|
||||
"ca": "擦",
|
||||
"cai": "猜裁材才财睬踩采彩菜蔡",
|
||||
"can": "餐参蚕残惭惨灿",
|
||||
"cang": "苍舱仓沧藏",
|
||||
"cao": "操糙槽曹草",
|
||||
"ce": "厕策侧册测",
|
||||
"ceng": "层蹭",
|
||||
"cha": "插叉茬茶查碴搽察岔差诧",
|
||||
"chai": "拆柴豺",
|
||||
"chan": "搀掺蝉馋谗缠铲产阐颤",
|
||||
"chang": "昌猖 矦矨矪矰矱矲矴矵矷矹矺矻矼砃砄砅砆砇砈砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚硛硜硞硟硠硡硢硣硤硥硦硧硨硩硯硰硱硲硳硴硵硶硸硹硺硻硽硾硿碀碁碂碃场尝常长偿肠厂敞畅唱倡",
|
||||
"chao": "超抄钞朝嘲潮巢吵炒",
|
||||
"che": "车扯撤掣彻澈",
|
||||
"chen": "郴臣辰尘晨忱沉陈趁衬",
|
||||
"cheng": "撑称城橙成呈乘程惩澄诚承逞骋秤",
|
||||
"chi": "吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽",
|
||||
"chong": "充冲虫崇宠",
|
||||
"chou": "抽酬畴踌稠愁筹仇绸瞅丑臭",
|
||||
"chu": "初出橱厨躇锄雏滁除楚碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨碩碪碫碬碭碮碯碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚磛磜磝磞磟磠磡磢磣磤磥磦磧磩磪磫磭磮磯磰磱磳磵磶磸磹磻磼磽磾磿礀礂礃礄礆礇礈礉礊礋礌础储矗搐触处",
|
||||
"chuai": "揣",
|
||||
"chuan": "川穿椽传船喘串",
|
||||
"chuang": "疮窗幢床闯创",
|
||||
"chui": "吹炊捶锤垂",
|
||||
"chun": "春椿醇唇淳纯蠢",
|
||||
"chuo": "戳绰",
|
||||
"ci": "疵茨磁雌辞慈瓷词此刺赐次",
|
||||
"cong": "聪葱囱匆从丛",
|
||||
"cou": "凑",
|
||||
"cu": "粗醋簇促",
|
||||
"cuan": "蹿篡窜",
|
||||
"cui": "摧崔催脆瘁粹淬翠",
|
||||
"cun": "村存寸",
|
||||
"cuo": "磋撮搓措挫错",
|
||||
"da": "搭达答瘩打大",
|
||||
"dai": "呆歹傣戴带殆代贷袋待逮礍礎礏礐礑礒礔礕礖礗礘礙礚礛礜礝礟礠礡礢礣礥礦礧礨礩礪礫礬礭礮礯礰礱礲礳礵礶礷礸礹礽礿祂祃祄祅祇祊祋祌祍祎祏祐祑祒祔祕祘祙祡祣祤祦祩祪祫祬祮祰祱祲祳祴祵祶祹祻祼祽祾祿禂禃禆禇禈禉禋禌禍禎禐禑禒怠",
|
||||
"dan": "耽担丹单郸掸胆旦氮但惮淡诞弹蛋",
|
||||
"dang": "当挡党荡档",
|
||||
"dao": "刀捣蹈倒岛祷导到稻悼道盗",
|
||||
"de": "德得的",
|
||||
"deng": "蹬灯登等瞪凳邓",
|
||||
"di": "堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔",
|
||||
"dian": "颠掂滇碘点典靛垫电佃甸店惦奠淀殿",
|
||||
"diao": "碉叼雕凋刁掉吊钓调",
|
||||
"die": "跌爹碟蝶迭谍叠禓禔禕禖禗禘禙禛禜禝禞禟禠禡禢禣禤禥禦禨禩禪禫禬禭禮禯禰禱禲禴禵禶禷禸禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙秚秛秜秝秞秠秡秢秥秨秪秬秮秱秲秳秴秵秶秷秹秺秼秾秿稁稄稅稇稈稉稊稌稏稐稑稒稓稕稖稘稙稛稜",
|
||||
"ding": "丁盯叮钉顶鼎锭定订",
|
||||
"diu": "丢",
|
||||
"dong": "东冬董懂动栋侗恫冻洞",
|
||||
"dou": "兜抖斗陡豆逗痘",
|
||||
"du": "都督毒犊独读堵睹赌杜镀肚度渡妒",
|
||||
"duan": "端短锻段断缎",
|
||||
"dui": "堆兑队对",
|
||||
"dun": "墩吨蹲敦顿囤钝盾遁",
|
||||
"duo": "掇哆多夺垛躲朵跺舵剁惰堕",
|
||||
"e": "蛾峨鹅俄额讹娥恶厄扼遏鄂饿",
|
||||
"en": "恩",
|
||||
"er": "而儿耳尔饵洱二稝稟稡稢稤稥稦稧稨稩稪稫稬稭種稯稰稱稲稴稵稶稸稺稾穀穁穂穃穄穅穇穈穉穊穋穌積穎穏穐穒穓穔穕穖穘穙穚穛穜穝穞穟穠穡穢穣穤穥穦穧穨穩穪穫穬穭穮穯穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰",
|
||||
"fa": "发罚筏伐乏阀法珐",
|
||||
"fan": "藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛",
|
||||
"fang": "坊芳方肪房防妨仿访纺放",
|
||||
"fei": "菲非啡飞肥匪诽吠肺废沸费",
|
||||
"fen": "芬酚吩氛分纷坟焚汾粉奋份忿愤粪",
|
||||
"feng": "丰封枫蜂峰锋风疯烽逢冯缝讽奉凤",
|
||||
"fo": "佛",
|
||||
"fou": "否",
|
||||
"fu": "夫敷肤孵扶拂辐幅氟符伏俘服窣窤窧窩窪窫窮窯窰窱窲窴窵窶窷窸窹窺窻窼窽窾竀竁竂竃竄竅竆竇竈竉竊竌竍竎竏竐竑竒竓竔竕竗竘竚竛竜竝竡竢竤竧竨竩竪竫竬竮竰竱竲竳竴竵競竷竸竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐",
|
||||
"ga": "噶嘎",
|
||||
"gai": "该改概钙盖溉",
|
||||
"gan": "干甘杆柑竿肝赶感秆敢赣",
|
||||
"gang": "冈刚钢缸肛纲岗港杠",
|
||||
"gao": "篙皋高膏羔糕搞镐稿告",
|
||||
"ge": "哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各",
|
||||
"gei": "给",
|
||||
"gen": "根跟",
|
||||
"geng": "耕更庚羹笯笰笲笴笵笶笷笹笻笽笿筀筁筂筃筄筆筈筊筍筎筓筕筗筙筜筞筟筡筣筤筥筦筧筨筩筪筫筬筭筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆箇箈箉箊箋箌箎箏箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹箺箻箼箽箾箿節篂篃範埂耿梗",
|
||||
"gong": "工攻功恭龚供躬公宫弓巩汞拱贡共",
|
||||
"gou": "钩勾沟苟狗垢构购够",
|
||||
"gu": "辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇",
|
||||
"gua": "刮瓜剐寡挂褂",
|
||||
"guai": "乖拐怪",
|
||||
"guan": "棺关官冠观管馆罐惯灌贯",
|
||||
"guang": "光广逛",
|
||||
"gui": "瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽",
|
||||
"gun": "辊滚棍",
|
||||
"guo": "锅郭国果裹过",
|
||||
"ha": "哈篅篈築篊篋篍篎篏篐篒篔篕篖篗篘篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲篳篴篵篶篸篹篺篻篽篿簀簁簂簃簄簅簆簈簉簊簍簎簐簑簒簓簔簕簗簘簙簚簛簜簝簞簠簡簢簣簤簥簨簩簫簬簭簮簯簰簱簲簳簴簵簶簷簹簺簻簼簽簾籂",
|
||||
"hai": "骸孩海氦亥害骇",
|
||||
"han": "酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉",
|
||||
"hang": "夯杭航",
|
||||
"hao": "壕嚎豪毫郝好耗号浩",
|
||||
"he": "呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺",
|
||||
"hei": "嘿黑",
|
||||
"hen": "痕很狠恨",
|
||||
"heng": "哼亨横衡恒",
|
||||
"hong": "轰哄烘虹鸿洪宏弘红",
|
||||
"hou": "喉侯猴吼厚候后",
|
||||
"hu": "呼乎忽瑚壶葫胡蝴狐糊湖籃籄籅籆籇籈籉籊籋籌籎籏籐籑籒籓籔籕籖籗籘籙籚籛籜籝籞籟籠籡籢籣籤籥籦籧籨籩籪籫籬籭籮籯籰籱籲籵籶籷籸籹籺籾籿粀粁粂粃粄粅粆粇粈粊粋粌粍粎粏粐粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴粵粶粷粸粺粻弧虎唬护互沪户",
|
||||
"hua": "花哗华猾滑画划化话",
|
||||
"huai": "槐徊怀淮坏",
|
||||
"huan": "欢环桓还缓换患唤痪豢焕涣宦幻",
|
||||
"huang": "荒慌黄磺蝗簧皇凰惶煌晃幌恍谎",
|
||||
"hui": "灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘",
|
||||
"hun": "荤昏婚魂浑混",
|
||||
"huo": "豁活伙火获或惑霍货祸",
|
||||
"ji": "击圾基机畸稽积箕粿糀糂糃糄糆糉糋糎糏糐糑糒糓糔糘糚糛糝糞糡糢糣糤糥糦糧糩糪糫糬糭糮糰糱糲糳糴糵糶糷糹糺糼糽糾糿紀紁紂紃約紅紆紇紈紉紋紌納紎紏紐紑紒紓純紕紖紗紘紙級紛紜紝紞紟紡紣紤紥紦紨紩紪紬紭紮細紱紲紳紴紵紶肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪",
|
||||
"jia": "嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁",
|
||||
"jian": "歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件 紷紸紹紺紻紼紾紿絀絁終絃組絅絆絇絈絉絊絋経絍絎絏結絑絒絓絔絕絖絗絘絙絚絛絜絝絞絟絠絡絢絣絤絥給絧絨絩絪絫絬絭絯絰統絲絳絴絵絶絸絹絺絻絼絽絾絿綀綁綂綃綄綅綆綇綈綉綊綋綌綍綎綏綐綑綒經綔綕綖綗綘健舰剑饯渐溅涧建",
|
||||
"jiang": "僵姜将浆江疆蒋桨奖讲匠酱降",
|
||||
"jiao": "蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖",
|
||||
"jie": "揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届",
|
||||
"jin": "巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸継続綛綜綝綞綟綠綡綢綣綤綥綧綨綩綪綫綬維綯綰綱網綳綴綵綶綷綸綹綺綻綼綽綾綿緀緁緂緃緄緅緆緇緈緉緊緋緌緍緎総緐緑緒緓緔緕緖緗緘緙線緛緜緝緞緟締緡緢緣緤緥緦緧編緩緪緫緬緭緮緯緰緱緲緳練緵緶緷緸緹緺尽劲",
|
||||
"jing": "荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净",
|
||||
"jiong": "炯窘",
|
||||
"jiu": "揪究纠玖韭久灸九酒厩救旧臼舅咎就疚",
|
||||
"ju": "鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧",
|
||||
"juan": "捐鹃娟倦眷卷绢",
|
||||
"jue": "撅攫抉掘倔爵觉决诀绝",
|
||||
"jun": "均菌钧军君峻緻緼緽緾緿縀縁縂縃縄縅縆縇縈縉縊縋縌縍縎縏縐縑縒縓縔縕縖縗縘縙縚縛縜縝縞縟縠縡縢縣縤縥縦縧縨縩縪縫縬縭縮縯縰縱縲縳縴縵縶縷縸縹縺縼總績縿繀繂繃繄繅繆繈繉繊繋繌繍繎繏繐繑繒繓織繕繖繗繘繙繚繛繜繝俊竣浚郡骏",
|
||||
"ka": "喀咖卡咯",
|
||||
"kai": "开揩楷凯慨",
|
||||
"kan": "刊堪勘坎砍看",
|
||||
"kang": "康慷糠扛抗亢炕",
|
||||
"kao": "考拷烤靠",
|
||||
"ke": "坷苛柯棵磕颗科壳咳可渴克刻客课",
|
||||
"ken": "肯啃垦恳",
|
||||
"keng": "坑吭",
|
||||
"kong": "空恐孔控",
|
||||
"kou": "抠口扣寇",
|
||||
"ku": "枯哭窟苦酷库裤",
|
||||
"kua": "夸垮挎跨胯",
|
||||
"kuai": "块筷侩快",
|
||||
"kuan": "宽款",
|
||||
"kuang": "匡筐狂框矿眶旷况",
|
||||
"kui": "亏盔岿窥葵奎魁傀繞繟繠繡繢繣繤繥繦繧繨繩繪繫繬繭繮繯繰繱繲繳繴繵繶繷繸繹繺繻繼繽繾繿纀纁纃纄纅纆纇纈纉纊纋續纍纎纏纐纑纒纓纔纕纖纗纘纙纚纜纝纞纮纴纻纼绖绤绬绹缊缐缞缷缹缻缼缽缾缿罀罁罃罆罇罈罉罊罋罌罍罎罏罒罓馈愧溃",
|
||||
"kun": "坤昆捆困",
|
||||
"kuo": "括扩廓阔",
|
||||
"la": "垃拉喇蜡腊辣啦邋",
|
||||
"lai": "莱来赖",
|
||||
"lan": "蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥",
|
||||
"lang": "琅榔狼廊郎朗浪",
|
||||
"lao": "捞劳牢老佬姥酪烙涝",
|
||||
"le": "勒乐了",
|
||||
"lei": "雷镭蕾磊累儡垒擂肋类泪",
|
||||
"leng": "棱楞冷",
|
||||
"li": "厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐罖罙罛罜罝罞罠罣罤罥罦罧罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂羃羄羅羆羇羈羉羋羍羏羐羑羒羓羕羖羗羘羙羛羜羠羢羣羥羦羨義羪羫羬羭羮羱羳羴羵羶羷羺羻羾翀翂翃翄翆翇翈翉翋翍翏翐翑習翓翖翗翙翚翛翜翝翞翢翣痢立粒沥隶力璃哩",
|
||||
"lia": "俩",
|
||||
"lian": "联莲连镰廉怜涟帘敛脸链恋炼练",
|
||||
"liang": "粮凉梁粱良两辆量晾亮谅",
|
||||
"liao": "撩聊僚疗燎寥辽潦撂镣廖料",
|
||||
"lie": "列裂烈劣猎",
|
||||
"lin": "琳林磷霖临邻鳞淋凛赁吝拎",
|
||||
"ling": "玲菱零龄铃伶羚凌灵陵岭领另令",
|
||||
"liu": "溜琉榴硫馏留刘瘤流柳六",
|
||||
"long": "龙聋咙笼窿 翤翧翨翪翫翬翭翲翴翵翶翷翸翹翺翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫耬耭耮耯耰耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗聙聛聜聝聞聟聠聡聢聣聤聥聦聧聨聫聬聭聮聯聰聲聳聴聵聶職聸聹聺聻聼聽隆垄拢陇",
|
||||
"lou": "楼娄搂篓漏陋",
|
||||
"lu": "芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮",
|
||||
"lv": "驴吕铝侣旅履屡缕虑氯律率滤绿",
|
||||
"luan": "峦挛孪滦卵乱",
|
||||
"lue": "掠略",
|
||||
"lun": "抡轮伦仑沦纶论",
|
||||
"luo": "萝螺罗逻锣箩骡裸落洛骆络",
|
||||
"ma": "妈麻玛码蚂马骂嘛吗",
|
||||
"mai": "埋买麦卖迈脉",
|
||||
"man": "瞒馒蛮满蔓曼慢漫聾肁肂肅肈肊肍肎肏肐肑肒肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇胈胉胊胋胏胐胑胒胓胔胕胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋脌脕脗脙脛脜脝脟脠脡脢脣脤脥脦脧脨脩脪脫脭脮脰脳脴脵脷脹脺脻脼脽脿谩",
|
||||
"mang": "芒茫盲氓忙莽",
|
||||
"mao": "猫茅锚毛矛铆卯茂冒帽貌贸",
|
||||
"me": "么",
|
||||
"mei": "玫枚梅酶霉煤没眉媒镁每美昧寐妹媚",
|
||||
"men": "门闷们",
|
||||
"meng": "萌蒙檬盟锰猛梦孟",
|
||||
"mi": "眯醚靡糜迷谜弥米秘觅泌蜜密幂",
|
||||
"mian": "棉眠绵冕免勉娩缅面",
|
||||
"miao": "苗描瞄藐秒渺庙妙",
|
||||
"mie": "蔑灭",
|
||||
"min": "民抿皿敏悯闽",
|
||||
"ming": "明螟鸣铭名命",
|
||||
"miu": "谬",
|
||||
"mo": "摸腀腁腂腃腄腅腇腉腍腎腏腒腖腗腘腛腜腝腞腟腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃膄膅膆膇膉膋膌膍膎膐膒膓膔膕膖膗膙膚膞膟膠膡膢膤膥膧膩膫膬膭膮膯膰膱膲膴膵膶膷膸膹膼膽膾膿臄臅臇臈臉臋臍臎臏臐臑臒臓摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌",
|
||||
"mou": "谋牟某",
|
||||
"mu": "拇牡亩姆母墓暮幕募慕木目睦牧穆",
|
||||
"na": "拿哪呐钠那娜纳",
|
||||
"nai": "氖乃奶耐奈",
|
||||
"nan": "南男难",
|
||||
"nang": "囊",
|
||||
"nao": "挠脑恼闹淖",
|
||||
"ne": "呢",
|
||||
"nei": "馁内",
|
||||
"nen": "嫩",
|
||||
"neng": "能",
|
||||
"ni": "妮霓倪泥尼拟你匿腻逆溺",
|
||||
"nian": "蔫拈年碾撵捻念",
|
||||
"niang": "娘酿",
|
||||
"niao": "鸟尿",
|
||||
"nie": "捏聂孽啮镊镍涅",
|
||||
"nin": "您",
|
||||
"ning": "柠狞凝宁 臔臕臖臗臘臙臛臜臝臞臟臠臡臢臤臥臦臨臩臫臮臯臰臱臲臵臶臷臸臹臺臽臿舃與興舉舊舋舎舏舑舓舕舖舗舘舙舚舝舠舤舥舦舧舩舮舲舺舼舽舿艀艁艂艃艅艆艈艊艌艍艎艐艑艒艓艔艕艖艗艙艛艜艝艞艠艡艢艣艤艥艦艧艩拧泞",
|
||||
"niu": "牛扭钮纽",
|
||||
"nong": "脓浓农弄",
|
||||
"nu": "奴努怒",
|
||||
"nv": "女",
|
||||
"nuan": "暖",
|
||||
"nue": "虐疟",
|
||||
"nuo": "挪懦糯诺",
|
||||
"o": "哦",
|
||||
"ou": "欧鸥殴藕呕偶沤",
|
||||
"pa": "啪趴爬帕怕琶",
|
||||
"pai": "拍排牌徘湃派",
|
||||
"pan": "攀潘盘磐盼畔判叛",
|
||||
"pang": "乓庞旁耪胖",
|
||||
"pao": "抛咆刨炮袍跑泡",
|
||||
"pei": "呸胚培裴赔陪配佩沛",
|
||||
"pen": "喷盆",
|
||||
"peng": "砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰",
|
||||
"pi": "坯砒霹批披劈琵毗艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸苺苼苽苾苿茀茊茋茍茐茒茓茖茘茙茝茞茟茠茡茢茣茤茥茦茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬",
|
||||
"pian": "篇偏片骗",
|
||||
"piao": "飘漂瓢票",
|
||||
"pie": "撇瞥",
|
||||
"pin": "拼频贫品聘",
|
||||
"ping": "乒坪苹萍平凭瓶评屏",
|
||||
"po": "坡泼颇婆破魄迫粕剖",
|
||||
"pu": "扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑",
|
||||
"qi": "期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫",
|
||||
"qia": "掐茾茿荁荂荄荅荈荊荋荌荍荎荓荕荖荗荘荙荝荢荰荱荲荳荴荵荶荹荺荾荿莀莁莂莃莄莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡莢莣莤莥莦莧莬莭莮莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽",
|
||||
"qian": "牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉",
|
||||
"qiang": "枪呛腔羌墙蔷强抢",
|
||||
"qiao": "橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍",
|
||||
"qie": "切茄且怯窃",
|
||||
"qin": "钦侵亲秦琴勤芹擒禽寝沁",
|
||||
"qing": "蜻青轻氢倾卿清擎晴氰情顷请庆",
|
||||
"qiong": "琼穷",
|
||||
"qiu": "秋丘邱球求囚酋泅",
|
||||
"qu": "趋区蛆曲躯屈驱渠菮華菳菴菵菶菷菺菻菼菾菿萀萂萅萇萈萉萊萐萒萓萔萕萖萗萙萚萛萞萟萠萡萢萣萩萪萫萬萭萮萯萰萲萳萴萵萶萷萹萺萻萾萿葀葁葂葃葄葅葇葈葉葊葋葌葍葎葏葐葒葓葔葕葖葘葝葞葟葠葢葤葥葦葧葨葪葮葯葰葲葴葷葹葻葼取娶龋趣去",
|
||||
"quan": "圈颧权醛泉全痊拳犬券劝",
|
||||
"que": "缺炔瘸却鹊榷确雀",
|
||||
"qun": "裙群",
|
||||
"ran": "然燃冉染",
|
||||
"rang": "瓤壤攘嚷让",
|
||||
"rao": "饶扰绕",
|
||||
"re": "惹热",
|
||||
"ren": "壬仁人忍韧任认刃妊纫",
|
||||
"reng": "扔仍",
|
||||
"ri": "日",
|
||||
"rong": "戎茸蓉荣融熔溶容绒冗",
|
||||
"rou": "揉柔肉",
|
||||
"ru": "茹蠕儒孺如辱乳汝入褥",
|
||||
"ruan": "软阮",
|
||||
"rui": "蕊瑞锐",
|
||||
"run": "闰润",
|
||||
"ruo": "若弱",
|
||||
"sa": "撒洒萨",
|
||||
"sai": "腮鳃塞赛",
|
||||
"san": "三叁葽葾葿蒀蒁蒃蒄蒅蒆蒊蒍蒏蒐蒑蒒蒓蒔蒕蒖蒘蒚蒛蒝蒞蒟蒠蒢蒣蒤蒥蒦蒧蒨蒩蒪蒫蒬蒭蒮蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗蓘蓙蓚蓛蓜蓞蓡蓢蓤蓧蓨蓩蓪蓫蓭蓮蓯蓱蓲蓳蓴蓵蓶蓷蓸蓹蓺蓻蓽蓾蔀蔁蔂伞散",
|
||||
"sang": "桑嗓丧",
|
||||
"sao": "搔骚扫嫂",
|
||||
"se": "瑟色涩",
|
||||
"sen": "森",
|
||||
"seng": "僧",
|
||||
"sha": "莎砂杀刹沙纱傻啥煞",
|
||||
"shai": "筛晒",
|
||||
"shan": "珊苫杉山删煽衫闪陕擅赡膳善汕扇缮",
|
||||
"shang": "墒伤商赏晌上尚裳",
|
||||
"shao": "梢捎稍烧芍勺韶少哨邵绍",
|
||||
"she": "奢赊蛇舌舍赦摄射慑涉社设",
|
||||
"shen": "砷申呻伸身深娠绅神沈审婶甚肾慎渗",
|
||||
"sheng": "声生甥牲升绳 蔃蔄蔆蔇蔈蔉蔊蔋蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢蔣蔤蔥蔦蔧蔨蔩蔪蔭蔮蔯蔰蔱蔲蔳蔴蔵蔶蔾蔿蕀蕁蕂蕄蕅蕆蕇蕋蕌蕍蕎蕏蕐蕑蕒蕓蕔蕕蕗蕘蕚蕛蕜蕝蕟蕠蕡蕢蕣蕥蕦蕧蕩蕪蕫蕬蕭蕮蕯蕰蕱蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣",
|
||||
"shi": "师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试",
|
||||
"shou": "收手首守寿授售受瘦兽",
|
||||
"shu": "蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱薂薃薆薈薉薊薋薌薍薎薐薑薒薓薔薕薖薗薘薙薚薝薞薟薠薡薢薣薥薦薧薩薫薬薭薱薲薳薴薵薶薸薺薻薼薽薾薿藀藂藃藄藅藆藇藈藊藋藌藍藎藑藒藔藖藗藘藙藚藛藝藞藟藠藡藢藣藥藦藧藨藪藫藬藭藮藯藰藱藲藳藴藵藶藷藸恕",
|
||||
"shua": "刷耍",
|
||||
"shuai": "摔衰甩帅",
|
||||
"shuan": "栓拴",
|
||||
"shuang": "霜双爽",
|
||||
"shui": "谁水睡税",
|
||||
"shun": "吮瞬顺舜",
|
||||
"shuo": "说硕朔烁",
|
||||
"si": "斯撕嘶思私司丝死肆寺嗣四伺似饲巳",
|
||||
"song": "松耸怂颂送宋讼诵",
|
||||
"sou": "搜艘擞",
|
||||
"su": "嗽苏酥俗素速粟僳塑溯宿诉肃",
|
||||
"suan": "酸蒜算",
|
||||
"sui": "虽隋随绥髓碎岁穗遂隧祟",
|
||||
"sun": "孙损笋",
|
||||
"suo": "蓑梭唆缩琐索锁所",
|
||||
"ta": "遢塌他它她塔藹藺藼藽藾蘀蘁蘂蘃蘄蘆蘇蘈蘉蘊蘋蘌蘍蘎蘏蘐蘒蘓蘔蘕蘗蘘蘙蘚蘛蘜蘝蘞蘟蘠蘡蘢蘣蘤蘥蘦蘨蘪蘫蘬蘭蘮蘯蘰蘱蘲蘳蘴蘵蘶蘷蘹蘺蘻蘽蘾蘿虀虁虂虃虄虅虆虇虈虉虊虋虌虒虓處虖虗虘虙虛虜虝號虠虡虣虤虥虦虧虨虩虪獭挞蹋踏",
|
||||
"tai": "胎苔抬台泰酞太态汰",
|
||||
"tan": "坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭",
|
||||
"tang": "汤塘搪堂棠膛唐糖倘躺淌趟烫",
|
||||
"tao": "掏涛滔绦萄桃逃淘陶讨套",
|
||||
"te": "特",
|
||||
"teng": "藤腾疼誊",
|
||||
"ti": "梯剔踢锑提题蹄啼体替嚏惕涕剃屉",
|
||||
"tian": "天添填田甜恬舔腆",
|
||||
"tiao": "挑条迢眺跳",
|
||||
"tie": "贴铁帖",
|
||||
"ting": "蜓厅听烃虭虯虰虲虳虴虵虷虸蚃蚄蚅蚆蚇蚈蚉蚎蚏蚐蚑蚒蚔蚖蚗蚘蚙蚚蚛蚞蚟蚠蚡蚢蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻蚼蚽蚾蚿蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇",
|
||||
"tong": "通桐酮瞳同铜彤童桶捅筒统痛",
|
||||
"tou": "偷投头透",
|
||||
"tu": "凸秃突图徒途涂屠土吐兔",
|
||||
"tuan": "湍团",
|
||||
"tui": "推颓腿蜕褪退",
|
||||
"tun": "吞屯臀",
|
||||
"tuo": "拖托脱鸵陀驮驼椭妥拓唾",
|
||||
"wa": "挖哇蛙洼娃瓦袜",
|
||||
"wai": "歪外",
|
||||
"wan": "豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕",
|
||||
"wang": "汪王亡枉网往旺望忘妄",
|
||||
"wei": "威蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀蝁蝂蝃蝄蝅蝆蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚蝛蝜蝝蝞蝟蝡蝢蝦蝧蝨蝩蝪蝫蝬蝭蝯蝱蝲蝳蝵蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎螏螐螑螒螔螕螖螘螙螚螛螜螝螞螠螡螢螣螤巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫",
|
||||
"wen": "瘟温蚊文闻纹吻稳紊问",
|
||||
"weng": "嗡翁瓮",
|
||||
"wo": "挝蜗涡窝我斡卧握沃",
|
||||
"wu": "巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误",
|
||||
"xi": "昔熙析西硒矽晰嘻吸锡牺螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁蟂蟃蟄蟅蟇蟈蟉蟌蟍蟎蟏蟐蟔蟕蟖蟗蟘蟙蟚蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯蟰蟱蟲蟳蟴蟵蟶蟷蟸蟺蟻蟼蟽蟿蠀蠁蠂蠄蠅蠆蠇蠈蠉蠋蠌蠍蠎蠏蠐蠑蠒蠔蠗蠘蠙蠚蠜蠝蠞蠟蠠蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细",
|
||||
"xia": "瞎虾匣霞辖暇峡侠狭下厦夏吓",
|
||||
"xian": "掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线",
|
||||
"xiang": "相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象",
|
||||
"xiao": "萧硝霄削哮嚣销消宵淆晓蠤蠥蠧蠨蠩蠪蠫蠬蠭蠮蠯蠰蠱蠳蠴蠵蠶蠷蠸蠺蠻蠽蠾蠿衁衂衃衆衇衈衉衊衋衎衏衐衑衒術衕衖衘衚衛衜衝衞衟衠衦衧衪衭衯衱衳衴衵衶衸衹衺衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗袘袙袚袛袝袞袟袠袡袣袥袦袧袨袩袪小孝校肖啸笑效",
|
||||
"xie": "楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑",
|
||||
"xin": "薪芯锌欣辛新忻心信衅",
|
||||
"xing": "星腥猩惺兴刑型形邢行醒幸杏性姓",
|
||||
"xiong": "兄凶胸匈汹雄熊",
|
||||
"xiu": "休修羞朽嗅锈秀袖绣",
|
||||
"xu": "墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续",
|
||||
"xuan": "轩喧宣悬旋玄 袬袮袯袰袲袴袵袶袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚裛補裝裞裠裡裦裧裩裪裫裬裭裮裯裲裵裶裷裺裻製裿褀褁褃褄褅褆複褈褉褋褌褍褎褏褑褔褕褖褗褘褜褝褞褟褠褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚",
|
||||
"xue": "靴薛学穴雪血",
|
||||
"xun": "勋熏循旬询寻驯巡殉汛训讯逊迅",
|
||||
"ya": "压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶",
|
||||
"yan": "焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验",
|
||||
"yang": "殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾",
|
||||
"yao": "邀腰妖瑶褸褹褺褻褼褽褾褿襀襂襃襅襆襇襈襉襊襋襌襍襎襏襐襑襒襓襔襕襖襗襘襙襚襛襜襝襠襡襢襣襤襥襧襨襩襪襫襬襭襮襯襰襱襲襳襴襵襶襷襸襹襺襼襽襾覀覂覄覅覇覈覉覊見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡摇尧遥窑谣姚咬舀药要耀",
|
||||
"ye": "椰噎耶爷野冶也页掖业叶曳腋夜液",
|
||||
"yi": "一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎",
|
||||
"yin": "茵荫因殷音阴姻吟银淫寅饮尹引隐覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽覾覿觀觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴觵觶觷觸觹觺觻觼觽觾觿訁訂訃訄訅訆計訉訊訋訌訍討訏訐訑訒訓訔訕訖託記訙訚訛訜訝印",
|
||||
"ying": "英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映",
|
||||
"yo": "哟",
|
||||
"yong": "拥佣臃痈庸雍踊蛹咏泳涌永恿勇用",
|
||||
"you": "幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂",
|
||||
"yu": "淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉訞訟訠訡訢訣訤訥訦訧訨訩訪訫訬設訮訯訰許訲訳訴訵訶訷訸訹診註証訽訿詀詁詂詃詄詅詆詇詉詊詋詌詍詎詏詐詑詒詓詔評詖詗詘詙詚詛詜詝詞詟詠詡詢詣詤詥試詧詨詩詪詫詬詭詮詯詰話該詳詴詵詶詷詸詺詻詼詽詾詿誀浴寓裕预豫驭",
|
||||
"yuan": "鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院",
|
||||
"yue": "曰约越跃钥岳粤月悦阅",
|
||||
"yun": "耘云郧匀陨允运蕴酝晕韵孕",
|
||||
"za": "匝砸杂",
|
||||
"zai": "栽哉灾宰载再在",
|
||||
"zan": "咱攒暂赞",
|
||||
"zang": "赃脏葬",
|
||||
"zao": "遭糟凿藻枣早澡蚤躁噪造皂灶燥",
|
||||
"ze": "责择则泽",
|
||||
"zei": "贼",
|
||||
"zen": "怎",
|
||||
"zeng": "增憎曾赠",
|
||||
"zha": "扎喳渣札轧誁誂誃誄誅誆誇誈誋誌認誎誏誐誑誒誔誕誖誗誘誙誚誛誜誝語誟誠誡誢誣誤誥誦誧誨誩說誫説読誮誯誰誱課誳誴誵誶誷誸誹誺誻誼誽誾調諀諁諂諃諄諅諆談諈諉諊請諌諍諎諏諐諑諒諓諔諕論諗諘諙諚諛諜諝諞諟諠諡諢諣铡闸眨栅榨咋乍炸诈",
|
||||
"zhai": "摘斋宅窄债寨",
|
||||
"zhan": "瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽",
|
||||
"zhang": "樟章彰漳张掌涨杖丈帐账仗胀瘴障",
|
||||
"zhao": "招昭找沼赵照罩兆肇召",
|
||||
"zhe": "遮折哲蛰辙者锗蔗这浙",
|
||||
"zhen": "珍斟真甄砧臻贞针侦枕疹诊震振镇阵",
|
||||
"zheng": "蒸挣睁征狰争怔整拯正政諤諥諦諧諨諩諪諫諬諭諮諯諰諱諲諳諴諵諶諷諸諹諺諻諼諽諾諿謀謁謂謃謄謅謆謈謉謊謋謌謍謎謏謐謑謒謓謔謕謖謗謘謙謚講謜謝謞謟謠謡謢謣謤謥謧謨謩謪謫謬謭謮謯謰謱謲謳謴謵謶謷謸謹謺謻謼謽謾謿譀譁譂譃譄譅帧症郑证",
|
||||
"zhi": "芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒",
|
||||
"zhong": "中盅忠钟衷终种肿重仲众",
|
||||
"zhou": "舟周州洲诌粥轴肘帚咒皱宙昼骤",
|
||||
"zhu": "珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑譆譇譈證譊譋譌譍譎譏譐譑譒譓譔譕譖譗識譙譚譛譜譝譞譟譠譡譢譣譤譥譧譨譩譪譫譭譮譯議譱譲譳譴譵譶護譸譹譺譻譼譽譾譿讀讁讂讃讄讅讆讇讈讉變讋讌讍讎讏讐讑讒讓讔讕讖讗讘讙讚讛讜讝讞讟讬讱讻诇诐诪谉谞住注祝驻",
|
||||
"zhua": "抓爪",
|
||||
"zhuai": "拽",
|
||||
"zhuan": "专砖转撰赚篆",
|
||||
"zhuang": "桩庄装妆撞壮状",
|
||||
"zhui": "椎锥追赘坠缀",
|
||||
"zhun": "谆准",
|
||||
"zhuo": "捉拙卓桌琢茁酌啄着灼浊",
|
||||
"zi": "兹咨资姿滋淄孜紫仔籽滓子自渍字",
|
||||
"zong": "鬃棕踪宗综总纵",
|
||||
"zou": "邹走奏揍",
|
||||
"zu": "租足卒族祖诅阻组",
|
||||
"zuan": "钻纂",
|
||||
"zui": "嘴醉最罪",
|
||||
"zun": "尊遵",
|
||||
"zuo": "昨左佐柞做作坐座"
|
||||
}
|
||||
44078
www/js/libs/pixi-legacy.js
Normal file
44078
www/js/libs/pixi-legacy.js
Normal file
File diff suppressed because it is too large
Load diff
1
www/js/libs/pixi-legacy.js.map
Normal file
1
www/js/libs/pixi-legacy.js.map
Normal file
File diff suppressed because one or more lines are too long
9
www/js/libs/pixi-legacy.min.js
vendored
Normal file
9
www/js/libs/pixi-legacy.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
www/js/libs/pixi-legacy.min.js.map
Normal file
1
www/js/libs/pixi-legacy.min.js.map
Normal file
File diff suppressed because one or more lines are too long
404
www/js/libs/pixi-picture.js
Normal file
404
www/js/libs/pixi-picture.js
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
var BackdropFilter = (function (_super) {
|
||||
__extends(BackdropFilter, _super);
|
||||
function BackdropFilter() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.backdropUniformName = null;
|
||||
_this._backdropActive = false;
|
||||
_this.clearColor = null;
|
||||
return _this;
|
||||
}
|
||||
return BackdropFilter;
|
||||
}(PIXI.Filter));
|
||||
pixi_picture.BackdropFilter = BackdropFilter;
|
||||
var filterFrag = "\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D uBackdrop;\n\n%UNIFORM_CODE%\n\nvoid main(void)\n{\n vec4 b_src = texture2D(uSampler, vTextureCoord);\n vec4 b_dest = texture2D(uBackdrop, vTextureCoord);\n vec4 b_res = b_dest;\n \n %BLEND_CODE%\n\n gl_FragColor = b_res;\n}";
|
||||
var BlendFilter = (function (_super) {
|
||||
__extends(BlendFilter, _super);
|
||||
function BlendFilter(shaderParts) {
|
||||
var _this = this;
|
||||
var fragCode = filterFrag;
|
||||
fragCode = fragCode.replace('%UNIFORM_CODE%', shaderParts.uniformCode || "");
|
||||
fragCode = fragCode.replace('%BLEND_CODE%', shaderParts.blendCode || "");
|
||||
_this = _super.call(this, undefined, fragCode, shaderParts.uniforms) || this;
|
||||
_this.backdropUniformName = 'uBackdrop';
|
||||
return _this;
|
||||
}
|
||||
return BlendFilter;
|
||||
}(BackdropFilter));
|
||||
pixi_picture.BlendFilter = BlendFilter;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
function containsRect(rectOut, rectIn) {
|
||||
var r1 = rectIn.x + rectIn.width;
|
||||
var b1 = rectIn.y + rectIn.height;
|
||||
var r2 = rectOut.x + rectOut.width;
|
||||
var b2 = rectOut.y + rectOut.height;
|
||||
return (rectIn.x >= rectOut.x) &&
|
||||
(rectIn.x <= r2) &&
|
||||
(rectIn.y >= rectOut.y) &&
|
||||
(rectIn.y <= b2) &&
|
||||
(r1 >= rectOut.x) &&
|
||||
(r1 <= r2) &&
|
||||
(b1 >= rectOut.y) &&
|
||||
(b1 <= b2);
|
||||
}
|
||||
PIXI.systems.TextureSystem.prototype.bindForceLocation = function (texture, location) {
|
||||
if (location === void 0) { location = 0; }
|
||||
var gl = this.gl;
|
||||
if (this.currentLocation !== location) {
|
||||
this.currentLocation = location;
|
||||
gl.activeTexture(gl.TEXTURE0 + location);
|
||||
}
|
||||
this.bind(texture, location);
|
||||
};
|
||||
function pushWithCheck(target, filters, checkEmptyBounds) {
|
||||
if (checkEmptyBounds === void 0) { checkEmptyBounds = true; }
|
||||
var renderer = this.renderer;
|
||||
var filterStack = this.defaultFilterStack;
|
||||
var state = this.statePool.pop() || new PIXI.FilterState();
|
||||
var resolution = filters[0].resolution;
|
||||
var padding = filters[0].padding;
|
||||
var autoFit = filters[0].autoFit;
|
||||
var legacy = filters[0].legacy;
|
||||
for (var i = 1; i < filters.length; i++) {
|
||||
var filter = filters[i];
|
||||
resolution = Math.min(resolution, filter.resolution);
|
||||
padding = this.useMaxPadding
|
||||
? Math.max(padding, filter.padding)
|
||||
: padding + filter.padding;
|
||||
autoFit = autoFit || filter.autoFit;
|
||||
legacy = legacy || filter.legacy;
|
||||
}
|
||||
if (filterStack.length === 1) {
|
||||
this.defaultFilterStack[0].renderTexture = renderer.renderTexture.current;
|
||||
}
|
||||
filterStack.push(state);
|
||||
state.resolution = resolution;
|
||||
state.legacy = legacy;
|
||||
state.target = target;
|
||||
state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true));
|
||||
var canUseBackdrop = true;
|
||||
state.sourceFrame.pad(padding);
|
||||
if (autoFit) {
|
||||
state.sourceFrame.fit(this.renderer.renderTexture.sourceFrame);
|
||||
}
|
||||
else {
|
||||
canUseBackdrop = containsRect(this.renderer.renderTexture.sourceFrame, state.sourceFrame);
|
||||
}
|
||||
if (checkEmptyBounds && state.sourceFrame.width <= 1 && state.sourceFrame.height <= 1) {
|
||||
filterStack.pop();
|
||||
state.clear();
|
||||
this.statePool.push(state);
|
||||
return false;
|
||||
}
|
||||
state.sourceFrame.ceil(resolution);
|
||||
if (canUseBackdrop) {
|
||||
var backdrop = null;
|
||||
for (var i = 0; i < filters.length; i++) {
|
||||
var bName = filters[i].backdropUniformName;
|
||||
if (bName) {
|
||||
if (backdrop === null) {
|
||||
backdrop = this.prepareBackdrop(state.sourceFrame);
|
||||
}
|
||||
filters[i].uniforms[bName] = backdrop;
|
||||
if (backdrop) {
|
||||
filters[i]._backdropActive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height, resolution);
|
||||
state.filters = filters;
|
||||
state.destinationFrame.width = state.renderTexture.width;
|
||||
state.destinationFrame.height = state.renderTexture.height;
|
||||
var destinationFrame = this.tempRect;
|
||||
destinationFrame.width = state.sourceFrame.width;
|
||||
destinationFrame.height = state.sourceFrame.height;
|
||||
state.renderTexture.filterFrame = state.sourceFrame;
|
||||
renderer.renderTexture.bind(state.renderTexture, state.sourceFrame, destinationFrame);
|
||||
renderer.renderTexture.clear(filters[filters.length - 1].clearColor);
|
||||
return true;
|
||||
}
|
||||
function push(target, filters) {
|
||||
return this.pushWithCheck(target, filters, false);
|
||||
}
|
||||
function pop() {
|
||||
var filterStack = this.defaultFilterStack;
|
||||
var state = filterStack.pop();
|
||||
var filters = state.filters;
|
||||
this.activeState = state;
|
||||
var globalUniforms = this.globalUniforms.uniforms;
|
||||
globalUniforms.outputFrame = state.sourceFrame;
|
||||
globalUniforms.resolution = state.resolution;
|
||||
var inputSize = globalUniforms.inputSize;
|
||||
var inputPixel = globalUniforms.inputPixel;
|
||||
var inputClamp = globalUniforms.inputClamp;
|
||||
inputSize[0] = state.destinationFrame.width;
|
||||
inputSize[1] = state.destinationFrame.height;
|
||||
inputSize[2] = 1.0 / inputSize[0];
|
||||
inputSize[3] = 1.0 / inputSize[1];
|
||||
inputPixel[0] = inputSize[0] * state.resolution;
|
||||
inputPixel[1] = inputSize[1] * state.resolution;
|
||||
inputPixel[2] = 1.0 / inputPixel[0];
|
||||
inputPixel[3] = 1.0 / inputPixel[1];
|
||||
inputClamp[0] = 0.5 * inputPixel[2];
|
||||
inputClamp[1] = 0.5 * inputPixel[3];
|
||||
inputClamp[2] = (state.sourceFrame.width * inputSize[2]) - (0.5 * inputPixel[2]);
|
||||
inputClamp[3] = (state.sourceFrame.height * inputSize[3]) - (0.5 * inputPixel[3]);
|
||||
if (state.legacy) {
|
||||
var filterArea = globalUniforms.filterArea;
|
||||
filterArea[0] = state.destinationFrame.width;
|
||||
filterArea[1] = state.destinationFrame.height;
|
||||
filterArea[2] = state.sourceFrame.x;
|
||||
filterArea[3] = state.sourceFrame.y;
|
||||
globalUniforms.filterClamp = globalUniforms.inputClamp;
|
||||
}
|
||||
this.globalUniforms.update();
|
||||
var lastState = filterStack[filterStack.length - 1];
|
||||
if (state.renderTexture.framebuffer.multisample > 1) {
|
||||
this.renderer.framebuffer.blit();
|
||||
}
|
||||
if (filters.length === 1) {
|
||||
filters[0].apply(this, state.renderTexture, lastState.renderTexture, PIXI.CLEAR_MODES.BLEND, state);
|
||||
this.returnFilterTexture(state.renderTexture);
|
||||
}
|
||||
else {
|
||||
var flip = state.renderTexture;
|
||||
var flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);
|
||||
flop.filterFrame = flip.filterFrame;
|
||||
var i = 0;
|
||||
for (i = 0; i < filters.length - 1; ++i) {
|
||||
filters[i].apply(this, flip, flop, PIXI.CLEAR_MODES.CLEAR, state);
|
||||
var t = flip;
|
||||
flip = flop;
|
||||
flop = t;
|
||||
}
|
||||
filters[i].apply(this, flip, lastState.renderTexture, PIXI.CLEAR_MODES.BLEND, state);
|
||||
this.returnFilterTexture(flip);
|
||||
this.returnFilterTexture(flop);
|
||||
}
|
||||
var backdropFree = false;
|
||||
for (var i = 0; i < filters.length; i++) {
|
||||
if (filters[i]._backdropActive) {
|
||||
var bName = filters[i].backdropUniformName;
|
||||
if (!backdropFree) {
|
||||
this.returnFilterTexture(filters[i].uniforms[bName]);
|
||||
backdropFree = true;
|
||||
}
|
||||
filters[i].uniforms[bName] = null;
|
||||
filters[i]._backdropActive = false;
|
||||
}
|
||||
}
|
||||
state.clear();
|
||||
this.statePool.push(state);
|
||||
}
|
||||
var hadBackbufferError = false;
|
||||
function prepareBackdrop(bounds) {
|
||||
var renderer = this.renderer;
|
||||
var renderTarget = renderer.renderTexture.current;
|
||||
var fr = this.renderer.renderTexture.sourceFrame;
|
||||
if (!renderTarget) {
|
||||
if (!hadBackbufferError) {
|
||||
hadBackbufferError = true;
|
||||
console.warn('pixi-picture: you are trying to use Blend Filter on main framebuffer! That wont work.');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var resolution = renderTarget.baseTexture.resolution;
|
||||
var x = (bounds.x - fr.x) * resolution;
|
||||
var y = (bounds.y - fr.y) * resolution;
|
||||
var w = (bounds.width) * resolution;
|
||||
var h = (bounds.height) * resolution;
|
||||
var gl = renderer.gl;
|
||||
var rt = this.getOptimalFilterTexture(w, h, 1);
|
||||
rt.filterFrame = fr;
|
||||
renderer.texture.bindForceLocation(rt.baseTexture, 0);
|
||||
gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x, y, w, h);
|
||||
return rt;
|
||||
}
|
||||
PIXI.systems.FilterSystem.prototype.push = push;
|
||||
PIXI.systems.FilterSystem.prototype.pushWithCheck = pushWithCheck;
|
||||
PIXI.systems.FilterSystem.prototype.pop = pop;
|
||||
PIXI.systems.FilterSystem.prototype.prepareBackdrop = prepareBackdrop;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
var MASK_CHANNEL;
|
||||
(function (MASK_CHANNEL) {
|
||||
MASK_CHANNEL[MASK_CHANNEL["RED"] = 0] = "RED";
|
||||
MASK_CHANNEL[MASK_CHANNEL["GREEN"] = 1] = "GREEN";
|
||||
MASK_CHANNEL[MASK_CHANNEL["BLUE"] = 2] = "BLUE";
|
||||
MASK_CHANNEL[MASK_CHANNEL["ALPHA"] = 3] = "ALPHA";
|
||||
})(MASK_CHANNEL = pixi_picture.MASK_CHANNEL || (pixi_picture.MASK_CHANNEL = {}));
|
||||
var MaskConfig = (function () {
|
||||
function MaskConfig(maskBefore, channel) {
|
||||
if (maskBefore === void 0) { maskBefore = false; }
|
||||
if (channel === void 0) { channel = MASK_CHANNEL.ALPHA; }
|
||||
this.maskBefore = maskBefore;
|
||||
this.uniformCode = 'uniform vec4 uChannel;';
|
||||
this.uniforms = {
|
||||
uChannel: new Float32Array([0, 0, 0, 0]),
|
||||
};
|
||||
this.blendCode = "b_res = dot(b_src, uChannel) * b_dest;";
|
||||
this.uniforms.uChannel[channel] = 1.0;
|
||||
}
|
||||
return MaskConfig;
|
||||
}());
|
||||
pixi_picture.MaskConfig = MaskConfig;
|
||||
var MaskFilter = (function (_super) {
|
||||
__extends(MaskFilter, _super);
|
||||
function MaskFilter(baseFilter, config) {
|
||||
if (config === void 0) { config = new MaskConfig(); }
|
||||
var _this = _super.call(this, config) || this;
|
||||
_this.baseFilter = baseFilter;
|
||||
_this.config = config;
|
||||
_this.padding = baseFilter.padding;
|
||||
return _this;
|
||||
}
|
||||
MaskFilter.prototype.apply = function (filterManager, input, output, clearMode) {
|
||||
var target = filterManager.getFilterTexture(input);
|
||||
if (this.config.maskBefore) {
|
||||
var blendMode = this.state.blendMode;
|
||||
this.state.blendMode = PIXI.BLEND_MODES.NONE;
|
||||
filterManager.applyFilter(this, input, target, PIXI.CLEAR_MODES.YES);
|
||||
this.baseFilter.blendMode = blendMode;
|
||||
this.baseFilter.apply(filterManager, target, output, clearMode);
|
||||
this.state.blendMode = blendMode;
|
||||
}
|
||||
else {
|
||||
var uBackdrop = this.uniforms.uBackdrop;
|
||||
this.baseFilter.apply(filterManager, uBackdrop, target, PIXI.CLEAR_MODES.YES);
|
||||
this.uniforms.uBackdrop = target;
|
||||
filterManager.applyFilter(this, input, output, clearMode);
|
||||
this.uniforms.uBackdrop = uBackdrop;
|
||||
}
|
||||
filterManager.returnFilterTexture(target);
|
||||
};
|
||||
return MaskFilter;
|
||||
}(pixi_picture.BlendFilter));
|
||||
pixi_picture.MaskFilter = MaskFilter;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
var blends;
|
||||
(function (blends) {
|
||||
blends.NPM_BLEND = "if (b_src.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n}\nvec3 Cb = b_src.rgb / b_src.a, Cs;\nif (b_dest.a > 0.0) {\n Cs = b_dest.rgb / b_dest.a;\n}\n%NPM_BLEND%\nb_res.a = b_src.a + b_dest.a * (1.0-b_src.a);\nb_res.rgb = (1.0 - b_src.a) * Cs + b_src.a * B;\nb_res.rgb *= b_res.a;\n";
|
||||
blends.OVERLAY_PART = "vec3 multiply = Cb * Cs * 2.0;\nvec3 Cb2 = Cb * 2.0 - 1.0;\nvec3 screen = Cb2 + Cs - Cb2 * Cs;\nvec3 B;\nif (Cs.r <= 0.5) {\n B.r = multiply.r;\n} else {\n B.r = screen.r;\n}\nif (Cs.g <= 0.5) {\n B.g = multiply.g;\n} else {\n B.g = screen.g;\n}\nif (Cs.b <= 0.5) {\n B.b = multiply.b;\n} else {\n B.b = screen.b;\n}\n";
|
||||
blends.HARDLIGHT_PART = "vec3 multiply = Cb * Cs * 2.0;\nvec3 Cs2 = Cs * 2.0 - 1.0;\nvec3 screen = Cb + Cs2 - Cb * Cs2;\nvec3 B;\nif (Cb.r <= 0.5) {\n B.r = multiply.r;\n} else {\n B.r = screen.r;\n}\nif (Cb.g <= 0.5) {\n B.g = multiply.g;\n} else {\n B.g = screen.g;\n}\nif (Cb.b <= 0.5) {\n B.b = multiply.b;\n} else {\n B.b = screen.b;\n}\n";
|
||||
blends.SOFTLIGHT_PART = "vec3 first = Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);\nvec3 B;\nvec3 D;\nif (Cs.r <= 0.5)\n{\n B.r = first.r;\n}\nelse\n{\n if (Cb.r <= 0.25)\n {\n D.r = ((16.0 * Cb.r - 12.0) * Cb.r + 4.0) * Cb.r; \n }\n else\n {\n D.r = sqrt(Cb.r);\n }\n B.r = Cb.r + (2.0 * Cs.r - 1.0) * (D.r - Cb.r);\n}\nif (Cs.g <= 0.5)\n{\n B.g = first.g;\n}\nelse\n{\n if (Cb.g <= 0.25)\n {\n D.g = ((16.0 * Cb.g - 12.0) * Cb.g + 4.0) * Cb.g; \n }\n else\n {\n D.g = sqrt(Cb.g);\n }\n B.g = Cb.g + (2.0 * Cs.g - 1.0) * (D.g - Cb.g);\n}\nif (Cs.b <= 0.5)\n{\n B.b = first.b;\n}\nelse\n{\n if (Cb.b <= 0.25)\n {\n D.b = ((16.0 * Cb.b - 12.0) * Cb.b + 4.0) * Cb.b; \n }\n else\n {\n D.b = sqrt(Cb.b);\n }\n B.b = Cb.b + (2.0 * Cs.b - 1.0) * (D.b - Cb.b);\n}\n";
|
||||
blends.MULTIPLY_FULL = "if (b_dest.a > 0.0) {\n vec4 mult;\nmult.a = min(b_src.a + b_dest.a - b_src.a * b_dest.a, 1.0);\n mult.rgb = (b_dest.rgb / b_dest.a) * ((1.0 - b_src.a) + b_src.rgb);\n b_res.rgb = (b_dest.rgb / b_dest.a) * ((1.0 - b_src.a) + b_src.rgb);\n b_res.a = min(b_src.a + b_dest.a - b_src.a * b_dest.a, 1.0);\n b_res.rgb *= mult.a;\n}\n";
|
||||
blends.OVERLAY_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.OVERLAY_PART);
|
||||
blends.HARDLIGHT_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.HARDLIGHT_PART);
|
||||
blends.SOFTLIGHT_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.SOFTLIGHT_PART);
|
||||
blends.blendFullArray = [];
|
||||
blends.blendFullArray[PIXI.BLEND_MODES.MULTIPLY] = blends.MULTIPLY_FULL;
|
||||
blends.blendFullArray[PIXI.BLEND_MODES.OVERLAY] = blends.OVERLAY_FULL;
|
||||
blends.blendFullArray[PIXI.BLEND_MODES.HARD_LIGHT] = blends.HARDLIGHT_FULL;
|
||||
blends.blendFullArray[PIXI.BLEND_MODES.SOFT_LIGHT] = blends.SOFTLIGHT_FULL;
|
||||
})(blends = pixi_picture.blends || (pixi_picture.blends = {}));
|
||||
var filterCache = [];
|
||||
var filterCacheArray = [];
|
||||
function getBlendFilter(blendMode) {
|
||||
if (!blends.blendFullArray[blendMode]) {
|
||||
return null;
|
||||
}
|
||||
if (!filterCache[blendMode]) {
|
||||
filterCache[blendMode] = new pixi_picture.BlendFilter({ blendCode: blends.blendFullArray[blendMode] });
|
||||
}
|
||||
return filterCache[blendMode];
|
||||
}
|
||||
pixi_picture.getBlendFilter = getBlendFilter;
|
||||
function getBlendFilterArray(blendMode) {
|
||||
if (!blends.blendFullArray[blendMode]) {
|
||||
return null;
|
||||
}
|
||||
if (!filterCacheArray[blendMode]) {
|
||||
filterCacheArray[blendMode] = [this.getBlendFilter(blendMode)];
|
||||
}
|
||||
return filterCacheArray[blendMode];
|
||||
}
|
||||
pixi_picture.getBlendFilterArray = getBlendFilterArray;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
var Sprite = (function (_super) {
|
||||
__extends(Sprite, _super);
|
||||
function Sprite() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Sprite.prototype._render = function (renderer) {
|
||||
var texture = this._texture;
|
||||
if (!texture || !texture.valid) {
|
||||
return;
|
||||
}
|
||||
var blendFilterArray = pixi_picture.getBlendFilterArray(this.blendMode);
|
||||
if (blendFilterArray) {
|
||||
renderer.batch.flush();
|
||||
if (!renderer.filter.pushWithCheck(this, blendFilterArray)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.calculateVertices();
|
||||
renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);
|
||||
renderer.plugins[this.pluginName].render(this);
|
||||
if (blendFilterArray) {
|
||||
renderer.batch.flush();
|
||||
renderer.filter.pop();
|
||||
}
|
||||
};
|
||||
return Sprite;
|
||||
}(PIXI.Sprite));
|
||||
pixi_picture.Sprite = Sprite;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
var TilingSprite = (function (_super) {
|
||||
__extends(TilingSprite, _super);
|
||||
function TilingSprite() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
TilingSprite.prototype._render = function (renderer) {
|
||||
var texture = this._texture;
|
||||
if (!texture || !texture.valid) {
|
||||
return;
|
||||
}
|
||||
var blendFilterArray = pixi_picture.getBlendFilterArray(this.blendMode);
|
||||
if (blendFilterArray) {
|
||||
renderer.batch.flush();
|
||||
if (!renderer.filter.pushWithCheck(this, blendFilterArray)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.tileTransform.updateLocalTransform();
|
||||
this.uvMatrix.update();
|
||||
renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);
|
||||
renderer.plugins[this.pluginName].render(this);
|
||||
if (blendFilterArray) {
|
||||
renderer.batch.flush();
|
||||
renderer.filter.pop();
|
||||
}
|
||||
};
|
||||
return TilingSprite;
|
||||
}(PIXI.TilingSprite));
|
||||
pixi_picture.TilingSprite = TilingSprite;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
var pixi_picture;
|
||||
(function (pixi_picture) {
|
||||
PIXI.picture = pixi_picture;
|
||||
})(pixi_picture || (pixi_picture = {}));
|
||||
//# sourceMappingURL=pixi-picture.js.map
|
||||
973
www/js/libs/pixi-tilemap.js
Normal file
973
www/js/libs/pixi-tilemap.js
Normal file
|
|
@ -0,0 +1,973 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/*!
|
||||
* pixi-tilemap - v2.1.3
|
||||
* Compiled Sun, 18 Oct 2020 17:08:58 UTC
|
||||
*
|
||||
* pixi-tilemap is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license
|
||||
*
|
||||
* Copyright 2019-2020, Ivan Popelyshev, All Rights Reserved
|
||||
*/
|
||||
this.PIXI = this.PIXI || {};
|
||||
this.PIXI.tilemap = this.PIXI.tilemap || {};
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@pixi/display'), require('@pixi/core'), require('@pixi/constants'), require('@pixi/math'), require('@pixi/graphics'), require('@pixi/sprite')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', '@pixi/display', '@pixi/core', '@pixi/constants', '@pixi/math', '@pixi/graphics', '@pixi/sprite'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.pixi_tilemap = {}, global.PIXI, global.PIXI, global.PIXI, global.PIXI, global.PIXI, global.PIXI));
|
||||
}(this, (function (exports, display, core, constants, math, graphics, sprite) {
|
||||
'use strict';
|
||||
|
||||
class CanvasTileRenderer {
|
||||
constructor(renderer) {
|
||||
this.tileAnim = [0, 0];
|
||||
this.dontUseTransform = false;
|
||||
this.renderer = renderer;
|
||||
this.tileAnim = [0, 0];
|
||||
}
|
||||
}
|
||||
const cr = PIXI.CanvasRenderer;
|
||||
if (cr) {
|
||||
cr.registerPlugin('tilemap', CanvasTileRenderer);
|
||||
}
|
||||
|
||||
const Constant = {
|
||||
maxTextures: 16,
|
||||
bufferSize: 2048,
|
||||
boundSize: 1024,
|
||||
boundCountPerBuffer: 1,
|
||||
use32bitIndex: false,
|
||||
SCALE_MODE: constants.SCALE_MODES.LINEAR,
|
||||
DO_CLEAR: true
|
||||
};
|
||||
|
||||
const POINT_STRUCT_SIZE = 12;
|
||||
class RectTileLayer extends display.Container {
|
||||
constructor(zIndex, texture) {
|
||||
super();
|
||||
this.zIndex = 0;
|
||||
this.modificationMarker = 0;
|
||||
this._$_localBounds = new display.Bounds();
|
||||
this.shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);
|
||||
this._globalMat = null;
|
||||
this.pointsBuf = [];
|
||||
this.hasAnim = false;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.compositeParent = false;
|
||||
this.tileAnim = null;
|
||||
this.vbId = 0;
|
||||
this.vb = null;
|
||||
this.vbBuffer = null;
|
||||
this.vbArray = null;
|
||||
this.vbInts = null;
|
||||
this.initialize(zIndex, texture);
|
||||
}
|
||||
initialize(zIndex, textures) {
|
||||
if (!textures) {
|
||||
textures = [];
|
||||
}
|
||||
else if (!(textures instanceof Array) && textures.baseTexture) {
|
||||
textures = [textures];
|
||||
}
|
||||
this.textures = textures;
|
||||
this.zIndex = zIndex;
|
||||
}
|
||||
clear() {
|
||||
this.pointsBuf.length = 0;
|
||||
this.modificationMarker = 0;
|
||||
this._$_localBounds.clear();
|
||||
this.hasAnim = false;
|
||||
}
|
||||
addFrame(texture_, x, y, animX, animY) {
|
||||
let texture;
|
||||
let textureIndex = 0;
|
||||
if (typeof texture_ === "number") {
|
||||
textureIndex = texture_;
|
||||
texture = this.textures[textureIndex];
|
||||
}
|
||||
else {
|
||||
if (typeof texture_ === "string") {
|
||||
texture = core.Texture.from(texture_);
|
||||
}
|
||||
else {
|
||||
texture = texture_;
|
||||
}
|
||||
let found = false;
|
||||
let textureList = this.textures;
|
||||
for (let i = 0; i < textureList.length; i++) {
|
||||
if (textureList[i].baseTexture === texture.baseTexture) {
|
||||
textureIndex = i;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate);
|
||||
return true;
|
||||
}
|
||||
addRect(textureIndex, u, v, x, y, tileWidth, tileHeight, animX = 0, animY = 0, rotate = 0, animCountX = 1024, animCountY = 1024) {
|
||||
let pb = this.pointsBuf;
|
||||
this.hasAnim = this.hasAnim || animX > 0 || animY > 0;
|
||||
pb.push(u);
|
||||
pb.push(v);
|
||||
pb.push(x);
|
||||
pb.push(y);
|
||||
pb.push(tileWidth);
|
||||
pb.push(tileHeight);
|
||||
pb.push(rotate);
|
||||
pb.push(animX | 0);
|
||||
pb.push(animY | 0);
|
||||
pb.push(textureIndex);
|
||||
pb.push(animCountX);
|
||||
pb.push(animCountY);
|
||||
this._$_localBounds.addFramePad(x, y, x + tileWidth, y + tileHeight, 0, 0);
|
||||
return this;
|
||||
}
|
||||
tileRotate(rotate) {
|
||||
const pb = this.pointsBuf;
|
||||
pb[pb.length - 3] = rotate;
|
||||
}
|
||||
tileAnimX(offset, count) {
|
||||
const pb = this.pointsBuf;
|
||||
pb[pb.length - 5] = offset;
|
||||
pb[pb.length - 2] = count;
|
||||
}
|
||||
tileAnimY(offset, count) {
|
||||
const pb = this.pointsBuf;
|
||||
pb[pb.length - 4] = offset;
|
||||
pb[pb.length - 1] = count;
|
||||
}
|
||||
renderCanvas(renderer) {
|
||||
let plugin = renderer.plugins.tilemap;
|
||||
if (!plugin.dontUseTransform) {
|
||||
let wt = this.worldTransform;
|
||||
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
|
||||
}
|
||||
this.renderCanvasCore(renderer);
|
||||
}
|
||||
renderCanvasCore(renderer) {
|
||||
if (this.textures.length === 0)
|
||||
return;
|
||||
let points = this.pointsBuf;
|
||||
const tileAnim = this.tileAnim || renderer.plugins.tilemap.tileAnim;
|
||||
renderer.context.fillStyle = '#000000';
|
||||
for (let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE) {
|
||||
let x1 = points[i], y1 = points[i + 1];
|
||||
let x2 = points[i + 2], y2 = points[i + 3];
|
||||
let w = points[i + 4];
|
||||
let h = points[i + 5];
|
||||
var rotate = points[i + 6];
|
||||
x1 += points[i + 7] * tileAnim[0];
|
||||
y1 += points[i + 8] * tileAnim[1];
|
||||
let textureIndex = points[i + 9];
|
||||
if (textureIndex >= 0) {
|
||||
renderer.context.drawImage(this.textures[textureIndex].baseTexture.getDrawableSource(), x1, y1, w, h, x2, y2, w, h);
|
||||
}
|
||||
else {
|
||||
renderer.context.globalAlpha = 0.5;
|
||||
renderer.context.fillRect(x2, y2, w, h);
|
||||
renderer.context.globalAlpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
destroyVb() {
|
||||
if (this.vb) {
|
||||
this.vb.destroy();
|
||||
this.vb = null;
|
||||
}
|
||||
}
|
||||
render(renderer) {
|
||||
let plugin = renderer.plugins['tilemap'];
|
||||
let shader = plugin.getShader();
|
||||
renderer.batch.setObjectRenderer(plugin);
|
||||
this._globalMat = shader.uniforms.projTransMatrix;
|
||||
renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);
|
||||
shader.uniforms.shadowColor = this.shadowColor;
|
||||
shader.uniforms.animationFrame = this.tileAnim || plugin.tileAnim;
|
||||
this.renderWebGLCore(renderer, plugin);
|
||||
}
|
||||
renderWebGLCore(renderer, plugin) {
|
||||
let points = this.pointsBuf;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
let rectsCount = points.length / POINT_STRUCT_SIZE;
|
||||
let shader = plugin.getShader();
|
||||
let textures = this.textures;
|
||||
if (textures.length === 0)
|
||||
return;
|
||||
plugin.bindTextures(renderer, shader, textures);
|
||||
renderer.shader.bind(shader, false);
|
||||
let vb = this.vb;
|
||||
if (!vb) {
|
||||
vb = plugin.createVb();
|
||||
this.vb = vb;
|
||||
this.vbId = vb.id;
|
||||
this.vbBuffer = null;
|
||||
this.modificationMarker = 0;
|
||||
}
|
||||
plugin.checkIndexBuffer(rectsCount, vb);
|
||||
const boundCountPerBuffer = Constant.boundCountPerBuffer;
|
||||
let vertexBuf = vb.getBuffer('aVertexPosition');
|
||||
let vertices = rectsCount * vb.vertPerQuad;
|
||||
if (vertices === 0)
|
||||
return;
|
||||
if (this.modificationMarker !== vertices) {
|
||||
this.modificationMarker = vertices;
|
||||
let vs = vb.stride * vertices;
|
||||
if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {
|
||||
let bk = vb.stride;
|
||||
while (bk < vs) {
|
||||
bk *= 2;
|
||||
}
|
||||
this.vbBuffer = new ArrayBuffer(bk);
|
||||
this.vbArray = new Float32Array(this.vbBuffer);
|
||||
this.vbInts = new Uint32Array(this.vbBuffer);
|
||||
vertexBuf.update(this.vbBuffer);
|
||||
}
|
||||
let arr = this.vbArray, ints = this.vbInts;
|
||||
let sz = 0;
|
||||
let textureId = 0;
|
||||
let shiftU = this.offsetX;
|
||||
let shiftV = this.offsetY;
|
||||
let tint = -1;
|
||||
for (let i = 0; i < points.length; i += POINT_STRUCT_SIZE) {
|
||||
let eps = 0.5;
|
||||
if (this.compositeParent) {
|
||||
if (boundCountPerBuffer > 1) {
|
||||
textureId = (points[i + 9] >> 2);
|
||||
shiftU = this.offsetX * (points[i + 9] & 1);
|
||||
shiftV = this.offsetY * ((points[i + 9] >> 1) & 1);
|
||||
}
|
||||
else {
|
||||
textureId = points[i + 9];
|
||||
shiftU = 0;
|
||||
shiftV = 0;
|
||||
}
|
||||
}
|
||||
let x = points[i + 2], y = points[i + 3];
|
||||
let w = points[i + 4], h = points[i + 5];
|
||||
let u = points[i] + shiftU, v = points[i + 1] + shiftV;
|
||||
let rotate = points[i + 6];
|
||||
const animX = points[i + 7], animY = points[i + 8];
|
||||
const animWidth = points[i + 10] || 1024, animHeight = points[i + 11] || 1024;
|
||||
const animXEncoded = animX + (animWidth * 2048);
|
||||
const animYEncoded = animY + (animHeight * 2048);
|
||||
let u0, v0, u1, v1, u2, v2, u3, v3;
|
||||
if (rotate === 0) {
|
||||
u0 = u;
|
||||
v0 = v;
|
||||
u1 = u + w;
|
||||
v1 = v;
|
||||
u2 = u + w;
|
||||
v2 = v + h;
|
||||
u3 = u;
|
||||
v3 = v + h;
|
||||
}
|
||||
else {
|
||||
let w2 = w / 2;
|
||||
let h2 = h / 2;
|
||||
if (rotate % 4 !== 0) {
|
||||
w2 = h / 2;
|
||||
h2 = w / 2;
|
||||
}
|
||||
const cX = u + w2;
|
||||
const cY = v + h2;
|
||||
rotate = math.groupD8.add(rotate, math.groupD8.NW);
|
||||
u0 = cX + (w2 * math.groupD8.uX(rotate));
|
||||
v0 = cY + (h2 * math.groupD8.uY(rotate));
|
||||
rotate = math.groupD8.add(rotate, 2);
|
||||
u1 = cX + (w2 * math.groupD8.uX(rotate));
|
||||
v1 = cY + (h2 * math.groupD8.uY(rotate));
|
||||
rotate = math.groupD8.add(rotate, 2);
|
||||
u2 = cX + (w2 * math.groupD8.uX(rotate));
|
||||
v2 = cY + (h2 * math.groupD8.uY(rotate));
|
||||
rotate = math.groupD8.add(rotate, 2);
|
||||
u3 = cX + (w2 * math.groupD8.uX(rotate));
|
||||
v3 = cY + (h2 * math.groupD8.uY(rotate));
|
||||
}
|
||||
arr[sz++] = x;
|
||||
arr[sz++] = y;
|
||||
arr[sz++] = u0;
|
||||
arr[sz++] = v0;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animXEncoded;
|
||||
arr[sz++] = animYEncoded;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x + w;
|
||||
arr[sz++] = y;
|
||||
arr[sz++] = u1;
|
||||
arr[sz++] = v1;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animXEncoded;
|
||||
arr[sz++] = animYEncoded;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x + w;
|
||||
arr[sz++] = y + h;
|
||||
arr[sz++] = u2;
|
||||
arr[sz++] = v2;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animXEncoded;
|
||||
arr[sz++] = animYEncoded;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x;
|
||||
arr[sz++] = y + h;
|
||||
arr[sz++] = u3;
|
||||
arr[sz++] = v3;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animXEncoded;
|
||||
arr[sz++] = animYEncoded;
|
||||
arr[sz++] = textureId;
|
||||
}
|
||||
vertexBuf.update(arr);
|
||||
}
|
||||
renderer.geometry.bind(vb, shader);
|
||||
renderer.geometry.draw(constants.DRAW_MODES.TRIANGLES, rectsCount * 6, 0);
|
||||
}
|
||||
isModified(anim) {
|
||||
if (this.modificationMarker !== this.pointsBuf.length ||
|
||||
anim && this.hasAnim) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
clearModify() {
|
||||
this.modificationMarker = this.pointsBuf.length;
|
||||
}
|
||||
_calculateBounds() {
|
||||
const { minX, minY, maxX, maxY } = this._$_localBounds;
|
||||
this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);
|
||||
}
|
||||
getLocalBounds(rect) {
|
||||
if (this.children.length === 0) {
|
||||
return this._$_localBounds.getRectangle(rect);
|
||||
}
|
||||
return super.getLocalBounds.call(this, rect);
|
||||
}
|
||||
destroy(options) {
|
||||
super.destroy(options);
|
||||
this.destroyVb();
|
||||
}
|
||||
}
|
||||
|
||||
class CompositeRectTileLayer extends display.Container {
|
||||
constructor(zIndex, bitmaps, texPerChild) {
|
||||
super();
|
||||
this.modificationMarker = 0;
|
||||
this.shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);
|
||||
this._globalMat = null;
|
||||
this._lastLayer = null;
|
||||
this.tileAnim = null;
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
initialize(zIndex, bitmaps, texPerChild) {
|
||||
if (texPerChild === true) {
|
||||
texPerChild = 0;
|
||||
}
|
||||
this.z = this.zIndex = zIndex;
|
||||
this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures;
|
||||
if (bitmaps) {
|
||||
this.setBitmaps(bitmaps);
|
||||
}
|
||||
}
|
||||
setBitmaps(bitmaps) {
|
||||
for (let i = 0; i < bitmaps.length; i++) {
|
||||
if (bitmaps[i] && !bitmaps[i].baseTexture) {
|
||||
throw new Error(`pixi-tilemap cannot use destroyed textures. ` +
|
||||
`Probably, you passed resources['myAtlas'].texture in pixi > 5.2.1, it does not exist there.`);
|
||||
}
|
||||
}
|
||||
let texPerChild = this.texPerChild;
|
||||
let len1 = this.children.length;
|
||||
let len2 = Math.ceil(bitmaps.length / texPerChild);
|
||||
let i;
|
||||
for (i = 0; i < len1; i++) {
|
||||
this.children[i].textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);
|
||||
}
|
||||
for (i = len1; i < len2; i++) {
|
||||
let layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild));
|
||||
layer.compositeParent = true;
|
||||
layer.offsetX = Constant.boundSize;
|
||||
layer.offsetY = Constant.boundSize;
|
||||
this.addChild(layer);
|
||||
}
|
||||
}
|
||||
clear() {
|
||||
for (let i = 0; i < this.children.length; i++) {
|
||||
this.children[i].clear();
|
||||
}
|
||||
this.modificationMarker = 0;
|
||||
}
|
||||
addRect(textureIndex, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight) {
|
||||
const childIndex = textureIndex / this.texPerChild >> 0;
|
||||
const textureId = textureIndex % this.texPerChild;
|
||||
if (this.children[childIndex] && this.children[childIndex].textures) {
|
||||
this._lastLayer = this.children[childIndex];
|
||||
this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight);
|
||||
}
|
||||
else {
|
||||
this._lastLayer = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
tileRotate(rotate) {
|
||||
if (this._lastLayer) {
|
||||
this._lastLayer.tileRotate(rotate);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
tileAnimX(offset, count) {
|
||||
if (this._lastLayer) {
|
||||
this._lastLayer.tileAnimX(offset, count);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
tileAnimY(offset, count) {
|
||||
if (this._lastLayer) {
|
||||
this._lastLayer.tileAnimY(offset, count);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
addFrame(texture_, x, y, animX, animY, animWidth, animHeight) {
|
||||
let texture;
|
||||
let layer = null;
|
||||
let ind = 0;
|
||||
let children = this.children;
|
||||
this._lastLayer = null;
|
||||
if (typeof texture_ === "number") {
|
||||
let childIndex = texture_ / this.texPerChild >> 0;
|
||||
layer = children[childIndex];
|
||||
if (!layer) {
|
||||
layer = children[0];
|
||||
if (!layer) {
|
||||
return this;
|
||||
}
|
||||
ind = 0;
|
||||
}
|
||||
else {
|
||||
ind = texture_ % this.texPerChild;
|
||||
}
|
||||
texture = layer.textures[ind];
|
||||
}
|
||||
else {
|
||||
if (typeof texture_ === "string") {
|
||||
texture = core.Texture.from(texture_);
|
||||
}
|
||||
else {
|
||||
texture = texture_;
|
||||
}
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
let tex = child.textures;
|
||||
for (let j = 0; j < tex.length; j++) {
|
||||
if (tex[j].baseTexture === texture.baseTexture) {
|
||||
layer = child;
|
||||
ind = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (layer) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
if (child.textures.length < this.texPerChild) {
|
||||
layer = child;
|
||||
ind = child.textures.length;
|
||||
child.textures.push(texture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
layer = new RectTileLayer(this.zIndex, texture);
|
||||
layer.compositeParent = true;
|
||||
layer.offsetX = Constant.boundSize;
|
||||
layer.offsetY = Constant.boundSize;
|
||||
this.addChild(layer);
|
||||
ind = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._lastLayer = layer;
|
||||
layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight);
|
||||
return this;
|
||||
}
|
||||
renderCanvas(renderer) {
|
||||
if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {
|
||||
return;
|
||||
}
|
||||
let plugin = renderer.plugins.tilemap;
|
||||
if (!plugin.dontUseTransform) {
|
||||
let wt = this.worldTransform;
|
||||
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
|
||||
}
|
||||
let layers = this.children;
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
const layer = layers[i];
|
||||
layer.tileAnim = this.tileAnim;
|
||||
layer.renderCanvasCore(renderer);
|
||||
}
|
||||
}
|
||||
render(renderer) {
|
||||
if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {
|
||||
return;
|
||||
}
|
||||
let plugin = renderer.plugins['tilemap'];
|
||||
let shader = plugin.getShader();
|
||||
renderer.batch.setObjectRenderer(plugin);
|
||||
this._globalMat = shader.uniforms.projTransMatrix;
|
||||
renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);
|
||||
shader.uniforms.shadowColor = this.shadowColor;
|
||||
shader.uniforms.animationFrame = this.tileAnim || plugin.tileAnim;
|
||||
renderer.shader.bind(shader, false);
|
||||
let layers = this.children;
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
const layer = layers[i];
|
||||
layer.renderWebGLCore(renderer, plugin);
|
||||
}
|
||||
}
|
||||
isModified(anim) {
|
||||
let layers = this.children;
|
||||
if (this.modificationMarker !== layers.length) {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
if (layers[i].isModified(anim)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
clearModify() {
|
||||
let layers = this.children;
|
||||
this.modificationMarker = layers.length;
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
layers[i].clearModify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GraphicsLayer extends graphics.Graphics {
|
||||
constructor(zIndex) {
|
||||
super();
|
||||
this.zIndex = zIndex;
|
||||
}
|
||||
renderCanvas(renderer) {
|
||||
let wt = null;
|
||||
if (renderer.plugins.tilemap.dontUseTransform) {
|
||||
wt = this.transform.worldTransform;
|
||||
this.transform.worldTransform = math.Matrix.IDENTITY;
|
||||
}
|
||||
renderer.plugins.graphics.render(this);
|
||||
if (renderer.plugins.tilemap.dontUseTransform) {
|
||||
this.transform.worldTransform = wt;
|
||||
}
|
||||
renderer.context.globalAlpha = 1.0;
|
||||
}
|
||||
isModified(anim) {
|
||||
return false;
|
||||
}
|
||||
clearModify() {
|
||||
}
|
||||
}
|
||||
|
||||
class MultiTextureResource extends core.resources.Resource {
|
||||
constructor(options) {
|
||||
super(options.bufferSize, options.bufferSize);
|
||||
this.DO_CLEAR = false;
|
||||
this.boundSize = 0;
|
||||
this._clearBuffer = null;
|
||||
this.baseTex = null;
|
||||
this.boundSprites = [];
|
||||
this.dirties = [];
|
||||
const bounds = this.boundSprites;
|
||||
const dirties = this.dirties;
|
||||
this.boundSize = options.boundSize;
|
||||
for (let j = 0; j < options.boundCountPerBuffer; j++) {
|
||||
const spr = new sprite.Sprite();
|
||||
spr.position.x = options.boundSize * (j & 1);
|
||||
spr.position.y = options.boundSize * (j >> 1);
|
||||
bounds.push(spr);
|
||||
dirties.push(0);
|
||||
}
|
||||
this.DO_CLEAR = !!options.DO_CLEAR;
|
||||
}
|
||||
bind(baseTexture) {
|
||||
if (this.baseTex) {
|
||||
throw new Error('Only one baseTexture is allowed for this resource!');
|
||||
}
|
||||
this.baseTex = baseTexture;
|
||||
super.bind(baseTexture);
|
||||
}
|
||||
setTexture(ind, texture) {
|
||||
const spr = this.boundSprites[ind];
|
||||
if (spr.texture.baseTexture === texture.baseTexture) {
|
||||
return;
|
||||
}
|
||||
spr.texture = texture;
|
||||
this.baseTex.update();
|
||||
this.dirties[ind] = this.baseTex.dirtyId;
|
||||
}
|
||||
upload(renderer, texture, glTexture) {
|
||||
const { gl } = renderer;
|
||||
const { width, height } = this;
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.alphaMode === undefined ||
|
||||
texture.alphaMode === constants.ALPHA_MODES.UNPACK);
|
||||
if (glTexture.dirtyId < 0) {
|
||||
glTexture.width = width;
|
||||
glTexture.height = height;
|
||||
gl.texImage2D(texture.target, 0, texture.format, width, height, 0, texture.format, texture.type, null);
|
||||
}
|
||||
const doClear = this.DO_CLEAR;
|
||||
if (doClear && !this._clearBuffer) {
|
||||
this._clearBuffer = new Uint8Array(Constant.boundSize * Constant.boundSize * 4);
|
||||
}
|
||||
const bounds = this.boundSprites;
|
||||
for (let i = 0; i < bounds.length; i++) {
|
||||
const spr = bounds[i];
|
||||
const tex = spr.texture.baseTexture;
|
||||
if (glTexture.dirtyId >= this.dirties[i]) {
|
||||
continue;
|
||||
}
|
||||
const res = tex.resource;
|
||||
if (!tex.valid || !res || !res.source) {
|
||||
continue;
|
||||
}
|
||||
if (doClear && (tex.width < this.boundSize || tex.height < this.boundSize)) {
|
||||
gl.texSubImage2D(texture.target, 0, spr.position.x, spr.position.y, this.boundSize, this.boundSize, texture.format, texture.type, this._clearBuffer);
|
||||
}
|
||||
gl.texSubImage2D(texture.target, 0, spr.position.x, spr.position.y, texture.format, texture.type, res.source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function fillSamplers(shader, maxTextures) {
|
||||
let sampleValues = [];
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
sampleValues[i] = i;
|
||||
}
|
||||
shader.uniforms.uSamplers = sampleValues;
|
||||
let samplerSize = [];
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
samplerSize.push(1.0 / Constant.bufferSize);
|
||||
samplerSize.push(1.0 / Constant.bufferSize);
|
||||
}
|
||||
shader.uniforms.uSamplerSize = samplerSize;
|
||||
}
|
||||
function generateFragmentSrc(maxTextures, fragmentSrc) {
|
||||
return fragmentSrc.replace(/%count%/gi, maxTextures + "")
|
||||
.replace(/%forloop%/gi, generateSampleSrc(maxTextures));
|
||||
}
|
||||
function generateSampleSrc(maxTextures) {
|
||||
let src = '';
|
||||
src += '\n';
|
||||
src += '\n';
|
||||
src += 'if(vTextureId <= -1.0) {';
|
||||
src += '\n\tcolor = shadowColor;';
|
||||
src += '\n}';
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
src += '\nelse ';
|
||||
if (i < maxTextures - 1) {
|
||||
src += 'if(textureId == ' + i + '.0)';
|
||||
}
|
||||
src += '\n{';
|
||||
src += '\n\tcolor = texture2D(uSamplers[' + i + '], textureCoord * uSamplerSize[' + i + ']);';
|
||||
src += '\n}';
|
||||
}
|
||||
src += '\n';
|
||||
src += '\n';
|
||||
return src;
|
||||
}
|
||||
|
||||
let rectShaderFrag = `
|
||||
varying vec2 vTextureCoord;
|
||||
varying vec4 vFrame;
|
||||
varying float vTextureId;
|
||||
uniform vec4 shadowColor;
|
||||
uniform sampler2D uSamplers[%count%];
|
||||
uniform vec2 uSamplerSize[%count%];
|
||||
|
||||
void main(void){
|
||||
vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);
|
||||
float textureId = floor(vTextureId + 0.5);
|
||||
|
||||
vec4 color;
|
||||
%forloop%
|
||||
gl_FragColor = color;
|
||||
}
|
||||
`;
|
||||
let rectShaderVert = `
|
||||
attribute vec2 aVertexPosition;
|
||||
attribute vec2 aTextureCoord;
|
||||
attribute vec4 aFrame;
|
||||
attribute vec2 aAnim;
|
||||
attribute float aTextureId;
|
||||
|
||||
uniform mat3 projTransMatrix;
|
||||
uniform vec2 animationFrame;
|
||||
|
||||
varying vec2 vTextureCoord;
|
||||
varying float vTextureId;
|
||||
varying vec4 vFrame;
|
||||
|
||||
void main(void){
|
||||
gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||||
vec2 animCount = floor((aAnim + 0.5) / 2048.0);
|
||||
vec2 animFrameOffset = aAnim - animCount * 2048.0;
|
||||
vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount));
|
||||
|
||||
vTextureCoord = aTextureCoord + animOffset;
|
||||
vFrame = aFrame + vec4(animOffset, animOffset);
|
||||
vTextureId = aTextureId;
|
||||
}
|
||||
`;
|
||||
class TilemapShader extends core.Shader {
|
||||
constructor(maxTextures, shaderVert, shaderFrag) {
|
||||
super(new core.Program(shaderVert, shaderFrag), {
|
||||
animationFrame: new Float32Array(2),
|
||||
uSamplers: [],
|
||||
uSamplerSize: [],
|
||||
projTransMatrix: new math.Matrix()
|
||||
});
|
||||
this.maxTextures = 0;
|
||||
this.maxTextures = maxTextures;
|
||||
fillSamplers(this, this.maxTextures);
|
||||
}
|
||||
}
|
||||
class RectTileShader extends TilemapShader {
|
||||
constructor(maxTextures) {
|
||||
super(maxTextures, rectShaderVert, generateFragmentSrc(maxTextures, rectShaderFrag));
|
||||
fillSamplers(this, this.maxTextures);
|
||||
}
|
||||
}
|
||||
class RectTileGeom extends core.Geometry {
|
||||
constructor() {
|
||||
super();
|
||||
this.vertSize = 11;
|
||||
this.vertPerQuad = 4;
|
||||
this.stride = this.vertSize * 4;
|
||||
this.lastTimeAccess = 0;
|
||||
const buf = this.buf = new core.Buffer(new Float32Array(2), true, false);
|
||||
this.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0)
|
||||
.addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4)
|
||||
.addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4)
|
||||
.addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4)
|
||||
.addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4);
|
||||
}
|
||||
}
|
||||
|
||||
class TileRenderer extends core.ObjectRenderer {
|
||||
constructor(renderer) {
|
||||
super(renderer);
|
||||
this.sn = -1;
|
||||
this.indexBuffer = null;
|
||||
this.ibLen = 0;
|
||||
this.tileAnim = [0, 0];
|
||||
this.texLoc = [];
|
||||
this.texResources = [];
|
||||
this.rectShader = new RectTileShader(Constant.maxTextures);
|
||||
this.indexBuffer = new core.Buffer(undefined, true, true);
|
||||
this.checkIndexBuffer(2000);
|
||||
this.initBounds();
|
||||
}
|
||||
initBounds() {
|
||||
if (Constant.boundCountPerBuffer <= 1) {
|
||||
return;
|
||||
}
|
||||
const maxTextures = Constant.maxTextures;
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
const resource = new MultiTextureResource(Constant);
|
||||
const baseTex = new core.BaseTexture(resource);
|
||||
baseTex.scaleMode = Constant.SCALE_MODE;
|
||||
baseTex.wrapMode = constants.WRAP_MODES.CLAMP;
|
||||
this.texResources.push(resource);
|
||||
}
|
||||
}
|
||||
bindTexturesWithoutRT(renderer, shader, textures) {
|
||||
let samplerSize = shader.uniforms.uSamplerSize;
|
||||
this.texLoc.length = 0;
|
||||
for (let i = 0; i < textures.length; i++) {
|
||||
const texture = textures[i];
|
||||
if (!texture || !texture.valid) {
|
||||
return;
|
||||
}
|
||||
renderer.texture.bind(textures[i], i);
|
||||
samplerSize[i * 2] = 1.0 / textures[i].baseTexture.width;
|
||||
samplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height;
|
||||
}
|
||||
shader.uniforms.uSamplerSize = samplerSize;
|
||||
}
|
||||
bindTextures(renderer, shader, textures) {
|
||||
const len = textures.length;
|
||||
const maxTextures = Constant.maxTextures;
|
||||
if (len > Constant.boundCountPerBuffer * maxTextures) {
|
||||
return;
|
||||
}
|
||||
if (Constant.boundCountPerBuffer <= 1) {
|
||||
this.bindTexturesWithoutRT(renderer, shader, textures);
|
||||
return;
|
||||
}
|
||||
let i = 0;
|
||||
for (; i < len; i++) {
|
||||
const texture = textures[i];
|
||||
if (!texture || !texture.valid)
|
||||
continue;
|
||||
const multi = this.texResources[i >> 2];
|
||||
multi.setTexture(i & 3, texture);
|
||||
}
|
||||
let gltsUsed = (i + 3) >> 2;
|
||||
for (i = 0; i < gltsUsed; i++) {
|
||||
renderer.texture.bind(this.texResources[i].baseTex, i);
|
||||
}
|
||||
}
|
||||
start() {
|
||||
}
|
||||
createVb() {
|
||||
const geom = new RectTileGeom();
|
||||
geom.addIndex(this.indexBuffer);
|
||||
geom.lastTimeAccess = Date.now();
|
||||
return geom;
|
||||
}
|
||||
checkIndexBuffer(size, vb = null) {
|
||||
const totalIndices = size * 6;
|
||||
if (totalIndices <= this.ibLen) {
|
||||
return;
|
||||
}
|
||||
let len = totalIndices;
|
||||
while (len < totalIndices) {
|
||||
len <<= 1;
|
||||
}
|
||||
this.ibLen = totalIndices;
|
||||
this.indexBuffer.update(PIXI.utils.createIndicesForQuads(size, Constant.use32bitIndex ? new Uint32Array(size * 6) : undefined));
|
||||
}
|
||||
getShader() {
|
||||
return this.rectShader;
|
||||
}
|
||||
destroy() {
|
||||
super.destroy();
|
||||
this.rectShader = null;
|
||||
}
|
||||
}
|
||||
core.Renderer.registerPlugin('tilemap', TileRenderer);
|
||||
|
||||
class ZLayer extends display.Container {
|
||||
constructor(tilemap, zIndex) {
|
||||
super();
|
||||
this._lastAnimationFrame = -1;
|
||||
this.tilemap = tilemap;
|
||||
this.z = zIndex;
|
||||
}
|
||||
clear() {
|
||||
let layers = this.children;
|
||||
for (let i = 0; i < layers.length; i++)
|
||||
layers[i].clear();
|
||||
this._previousLayers = 0;
|
||||
}
|
||||
cacheIfDirty() {
|
||||
let tilemap = this.tilemap;
|
||||
let layers = this.children;
|
||||
let modified = this._previousLayers !== layers.length;
|
||||
this._previousLayers = layers.length;
|
||||
let buf = this.canvasBuffer;
|
||||
let tempRender = this._tempRender;
|
||||
if (!buf) {
|
||||
buf = this.canvasBuffer = document.createElement('canvas');
|
||||
tempRender = this._tempRender = new PIXI.CanvasRenderer({ width: 100, height: 100, view: buf });
|
||||
tempRender.context = tempRender.rootContext;
|
||||
tempRender.plugins.tilemap.dontUseTransform = true;
|
||||
}
|
||||
if (buf.width !== tilemap._layerWidth ||
|
||||
buf.height !== tilemap._layerHeight) {
|
||||
buf.width = tilemap._layerWidth;
|
||||
buf.height = tilemap._layerHeight;
|
||||
modified = true;
|
||||
}
|
||||
let i;
|
||||
if (!modified) {
|
||||
for (i = 0; i < layers.length; i++) {
|
||||
if (layers[i].isModified(this._lastAnimationFrame !== tilemap.animationFrame)) {
|
||||
modified = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._lastAnimationFrame = tilemap.animationFrame;
|
||||
if (modified) {
|
||||
if (tilemap._hackRenderer) {
|
||||
tilemap._hackRenderer(tempRender);
|
||||
}
|
||||
tempRender.context.clearRect(0, 0, buf.width, buf.height);
|
||||
for (i = 0; i < layers.length; i++) {
|
||||
layers[i].clearModify();
|
||||
layers[i].renderCanvas(tempRender);
|
||||
}
|
||||
}
|
||||
this.layerTransform = this.worldTransform;
|
||||
for (i = 0; i < layers.length; i++) {
|
||||
this.layerTransform = layers[i].worldTransform;
|
||||
break;
|
||||
}
|
||||
}
|
||||
renderCanvas(renderer) {
|
||||
this.cacheIfDirty();
|
||||
let wt = this.layerTransform;
|
||||
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
|
||||
let tilemap = this.tilemap;
|
||||
renderer.context.drawImage(this.canvasBuffer, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
const pixi_tilemap = {
|
||||
CanvasTileRenderer,
|
||||
CompositeRectTileLayer,
|
||||
Constant,
|
||||
GraphicsLayer,
|
||||
MultiTextureResource,
|
||||
RectTileLayer,
|
||||
TilemapShader,
|
||||
RectTileShader,
|
||||
RectTileGeom,
|
||||
TileRenderer,
|
||||
ZLayer,
|
||||
};
|
||||
|
||||
exports.CanvasTileRenderer = CanvasTileRenderer;
|
||||
exports.CompositeRectTileLayer = CompositeRectTileLayer;
|
||||
exports.Constant = Constant;
|
||||
exports.GraphicsLayer = GraphicsLayer;
|
||||
exports.MultiTextureResource = MultiTextureResource;
|
||||
exports.POINT_STRUCT_SIZE = POINT_STRUCT_SIZE;
|
||||
exports.RectTileGeom = RectTileGeom;
|
||||
exports.RectTileLayer = RectTileLayer;
|
||||
exports.RectTileShader = RectTileShader;
|
||||
exports.TileRenderer = TileRenderer;
|
||||
exports.TilemapShader = TilemapShader;
|
||||
exports.ZLayer = ZLayer;
|
||||
exports.fillSamplers = fillSamplers;
|
||||
exports.generateFragmentSrc = generateFragmentSrc;
|
||||
exports.generateSampleSrc = generateSampleSrc;
|
||||
exports.pixi_tilemap = pixi_tilemap;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
if (typeof pixi_tilemap !== 'undefined') { Object.assign(this.PIXI.tilemap, pixi_tilemap); }
|
||||
//# sourceMappingURL=pixi-tilemap.umd.js.map
|
||||
41981
www/js/libs/pixi.js
Normal file
41981
www/js/libs/pixi.js
Normal file
File diff suppressed because it is too large
Load diff
1
www/js/libs/pixi.js.map
Normal file
1
www/js/libs/pixi.js.map
Normal file
File diff suppressed because one or more lines are too long
9
www/js/libs/pixi.min.js
vendored
Normal file
9
www/js/libs/pixi.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
www/js/libs/pixi.min.js.map
Normal file
1
www/js/libs/pixi.min.js.map
Normal file
File diff suppressed because one or more lines are too long
BIN
www/js/libs/sdkencryptedappticket.dll
Normal file
BIN
www/js/libs/sdkencryptedappticket.dll
Normal file
Binary file not shown.
BIN
www/js/libs/sdkencryptedappticket.lib
Normal file
BIN
www/js/libs/sdkencryptedappticket.lib
Normal file
Binary file not shown.
BIN
www/js/libs/sdkencryptedappticket64.dll
Normal file
BIN
www/js/libs/sdkencryptedappticket64.dll
Normal file
Binary file not shown.
BIN
www/js/libs/sdkencryptedappticket64.lib
Normal file
BIN
www/js/libs/sdkencryptedappticket64.lib
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api.dll
Normal file
BIN
www/js/libs/steam_api.dll
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api.dll.valve
Normal file
BIN
www/js/libs/steam_api.dll.valve
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api.lib
Normal file
BIN
www/js/libs/steam_api.lib
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api64.dll
Normal file
BIN
www/js/libs/steam_api64.dll
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api64.dll.valve
Normal file
BIN
www/js/libs/steam_api64.dll.valve
Normal file
Binary file not shown.
BIN
www/js/libs/steam_api64.lib
Normal file
BIN
www/js/libs/steam_api64.lib
Normal file
Binary file not shown.
6
www/js/libs/trmix.min.js
vendored
Normal file
6
www/js/libs/trmix.min.js
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/* Type Rendering Mix JS - (c) 2013-2014 Tim Brown, Bram Stein. License: new BSD */(function(){'use strict';var b=window;function c(a){var f=d,g;a:{g=f.className.split(/\s+/);for(var n=0,H=g.length;n<H;n+=1)if(g[n]===a){g=!0;break a}g=!1}g||(f.className+=(""===f.className?"":" ")+a)};function e(a,f,g){this.b=null!=a?a:null;this.c=null!=f?f:null;this.g=null!=g?g:null}var h=/^([0-9]+)(?:[\._-]([0-9]+))?(?:[\._-]([0-9]+))?(?:[\._+-]?(.*))?$/;e.prototype.compare=function(a){return this.b>a.b||this.b===a.b&&this.c>a.c||this.b===a.b&&this.c===a.c&&this.g>a.g?1:this.b<a.b||this.b===a.b&&this.c<a.c||this.b===a.b&&this.c===a.c&&this.g<a.g?-1:0};function k(a,f){return 0===a.compare(f)||1===a.compare(f)}
|
||||
function l(){var a=h.exec(m[1]),f=null,g=null,n=null;a&&(null!==a[1]&&a[1]&&(f=parseInt(a[1],10)),null!==a[2]&&a[2]&&(g=parseInt(a[2],10)),null!==a[3]&&a[3]&&(n=parseInt(a[3],10)));return new e(f,g,n)};function p(){var a=q;return 3===a.a||7===a.a||6===a.a||9===a.a||8===a.a||5===a.a?"grayscale":1===a.a&&k(a.d,new e(6,2))&&1===a.e?"grayscale":"unknown"};var q,r=b.navigator.userAgent,s=0,t=new e,u=0,v=new e,m=null;if(m=/(?:iPod|iPad|iPhone).*? OS ([\d_]+)/.exec(r))u=3,v=l();else if(m=/(?:BB\d{2}|BlackBerry).*?Version\/([^\s]*)/.exec(r))u=9,v=l();else if(m=/Android ([^;)]+)|Android/.exec(r))u=5,v=l();else if(m=/Windows Phone(?: OS)? ([^;)]+)/.exec(r))u=8,v=l();else if(m=/Linux ([^;)]+)|Linux/.exec(r))u=4,v=l();else if(m=/OS X ([^;)]+)/.exec(r))u=2,v=l();else if(m=/Windows NT ([^;)]+)/.exec(r))u=1,v=l();else if(m=/CrOS ([^;)]+)/.exec(r))u=6,v=l();
|
||||
if(m=/MSIE ([\d\w\.]+)/.exec(r))s=1,t=l();else if(m=/Trident.*rv:([\d\w\.]+)/.exec(r))s=1,t=l();else if(m=/OPR\/([\d.]+)/.exec(r))s=4,t=l();else if(m=/Opera Mini.*Version\/([\d\.]+)/.exec(r))s=4,t=l();else if(m=/Opera(?: |.*Version\/|\/)([\d\.]+)/.exec(r))s=4,t=l();else if(m=/Firefox\/([\d\w\.]+)|Firefox/.exec(r))s=3,t=l();else if(m=/(?:Chrome|CrMo|CriOS)\/([\d\.]+)/.exec(r))s=2,t=l();else if(m=/Silk\/([\d\._]+)/.exec(r))s=7,t=l();else if(5===u||9===u)s=6;else if(m=/Version\/([\d\.\w]+).*Safari/.exec(r))s=
|
||||
5,t=l();q=new function(a,f,g,n){this.e=a;this.f=f;this.a=g;this.d=n}(s,t,u,v);var w,x;
|
||||
if(1===q.a){var y;if(2===q.e)y=k(q.f,new e(37))&&k(q.d,new e(6,1))?"directwrite":"gdi";else{var z;if(4===q.e)z=k(q.f,new e(24))&&k(q.d,new e(6,1))?"directwrite":"gdi";else{var A;if(-1===q.d.compare(new e(6,0)))A="gdi";else{var B;if(k(q.d,new e(6,0))){var C;if(C=1===q.e){var D=q.f,E=new e(8,0);C=0===D.compare(E)||-1===D.compare(E)}B=C?"gdi":"directwrite"}else B="unknown";A=B}z=A}y=z}x=y}else x=8===q.a?"directwrite":2===q.a||3===q.a?"coretext":5===q.a||4===q.a||6===q.a||7===q.a||9===q.a?"freetype":
|
||||
"unknown";w=x;var F=p(),G,I=p();G="unknown"!==I?I:2===q.a||4===q.a?"subpixel":1===q.a?k(q.d,new e(6,0))?"subpixel":1===q.e?k(q.f,new e(7,0))?"subpixel":"grayscale":"subpixel":"unknown";var d=b.document.documentElement;c("tr-"+w);"unknown"===F&&"unknown"!==G&&(F+="-"+G);c("tr-aa-"+F);}());
|
||||
3875
www/js/libs/yaml.js
Normal file
3875
www/js/libs/yaml.js
Normal file
File diff suppressed because it is too large
Load diff
9
www/js/main.js
Normal file
9
www/js/main.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//=============================================================================
|
||||
// main.js
|
||||
//=============================================================================
|
||||
|
||||
PluginManager.setup($plugins);
|
||||
|
||||
window.onload = function() {
|
||||
SceneManager.run(Scene_Boot);
|
||||
};
|
||||
4233
www/js/plugins.js
Normal file
4233
www/js/plugins.js
Normal file
File diff suppressed because one or more lines are too long
6
www/js/plugins/--------------------.js
Normal file
6
www/js/plugins/--------------------.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc ------------------------------------------------------------
|
||||
* @author Yanfly Engine Plugins
|
||||
*/
|
||||
//=============================================================================
|
||||
0
www/js/plugins/---------BATTLE--------- .js
Normal file
0
www/js/plugins/---------BATTLE--------- .js
Normal file
0
www/js/plugins/---------BATTLE_CORE---------.js
Normal file
0
www/js/plugins/---------BATTLE_CORE---------.js
Normal file
0
www/js/plugins/---------CORE---------.js
Normal file
0
www/js/plugins/---------CORE---------.js
Normal file
0
www/js/plugins/---------EVENTER---------.js
Normal file
0
www/js/plugins/---------EVENTER---------.js
Normal file
0
www/js/plugins/---------ITEMS---------.js
Normal file
0
www/js/plugins/---------ITEMS---------.js
Normal file
0
www/js/plugins/---------MAP---------.js
Normal file
0
www/js/plugins/---------MAP---------.js
Normal file
0
www/js/plugins/---------MAP_MOVEMENT---------.js
Normal file
0
www/js/plugins/---------MAP_MOVEMENT---------.js
Normal file
0
www/js/plugins/---------MENU---------.js
Normal file
0
www/js/plugins/---------MENU---------.js
Normal file
0
www/js/plugins/---------MESSAGE---------.js
Normal file
0
www/js/plugins/---------MESSAGE---------.js
Normal file
0
www/js/plugins/---------OMORI----------.js
Normal file
0
www/js/plugins/---------OMORI----------.js
Normal file
0
www/js/plugins/---------SKILLS---------.js
Normal file
0
www/js/plugins/---------SKILLS---------.js
Normal file
0
www/js/plugins/---------UTILITY---------.js
Normal file
0
www/js/plugins/---------UTILITY---------.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
if(!$modLoader.overlayFS){alert("The OneLoader assistant mod will not work with GOMORI. Please uninstall this mod or switch from GOMORI to OneLoader");}
|
||||
|
|
@ -0,0 +1,730 @@
|
|||
/*
|
||||
This file is part of the OneLoader project and is licensed under the same terms (MIT)
|
||||
*/
|
||||
{
|
||||
let spainMode = false;
|
||||
class OneLoaderWindowBase extends Window_Selectable {
|
||||
initialize() {
|
||||
// Make Options List
|
||||
this.makeOptionsList();
|
||||
// Super Call
|
||||
super.initialize(0, 0, this.windowWidth(), this.windowHeight());
|
||||
// Create Option Cursors
|
||||
this.createOptionCursors();
|
||||
this.select(0);
|
||||
this.refresh();
|
||||
}
|
||||
isUsingCustomCursorRectSprite() { return true; }
|
||||
standardPadding() { return 8; }
|
||||
windowWidth() { return Graphics.width - 20; }
|
||||
windowHeight() { return 318; }
|
||||
maxItems() { return this._optionsList.length; }
|
||||
maxCols() { return 1; }
|
||||
itemHeight() { return 75; }
|
||||
spacing() { return 5; }
|
||||
customCursorRectXOffset() { return 15; }
|
||||
customCursorRectYOffset() { return -18; }
|
||||
get height() { return this._height; }
|
||||
set height(value) {
|
||||
this._height = value;
|
||||
this._refreshAllParts();
|
||||
// If Option Cursors Exist
|
||||
if (this._optionCursors) {
|
||||
for (var i = 0; i < this._optionCursors.length; i++) {
|
||||
var sprite = this._optionCursors[i];
|
||||
sprite.visible = value >= (sprite.y + sprite.height)
|
||||
};
|
||||
}
|
||||
}
|
||||
_refreshArrows() {
|
||||
super._refreshArrows();
|
||||
var w = this._width;
|
||||
var h = this._height;
|
||||
var p = 28;
|
||||
var q = p / 2;
|
||||
this._downArrowSprite.move(w - q, h - q);
|
||||
this._upArrowSprite.move(w - q, q);
|
||||
}
|
||||
processOptionCommand() {
|
||||
|
||||
}
|
||||
createOptionCursors() {
|
||||
// Initialize Option Cursors
|
||||
this._optionCursors = [];
|
||||
// Create Cursor Sprites
|
||||
for (var i = 0; i < 4; i++) {
|
||||
// Create Sprite
|
||||
var sprite = new Sprite_WindowCustomCursor(undefined, this.customCursorRectBitmapName());
|
||||
sprite.deactivate();
|
||||
sprite.visible = false;
|
||||
sprite.setColorTone([-80, -80, -80, 255]);
|
||||
this._customCursorRectSpriteContainer.addChild(sprite);
|
||||
// Add Sprite to Option Cursors
|
||||
this._optionCursors[i] = sprite;
|
||||
};
|
||||
};
|
||||
_updateArrows() {
|
||||
super._updateArrows();
|
||||
this._downArrowSprite.visible = this._downArrowSprite.visible && !!this.active;
|
||||
this._upArrowSprite.visible = this._upArrowSprite.visible && !!this.active;
|
||||
}
|
||||
drawItem(index) {
|
||||
// Get Item Rect
|
||||
var rect = this.itemRect(index);
|
||||
// Get Data
|
||||
var data = this._optionsList[index];
|
||||
// If Data Exists
|
||||
if (data) {
|
||||
// Draw Option Segment
|
||||
this.drawOptionSegment(data.header, data.options, data.spacing, rect);
|
||||
};
|
||||
}
|
||||
drawOptionSegment(header, options, spacing, rect) {
|
||||
// Draw Header
|
||||
this.contents.drawText(header, rect.x + 50, rect.y, rect.width, 24);
|
||||
// Go Through Options
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
// Draw Options
|
||||
this.contents.drawText(options[i], rect.x + (100 + (i * spacing)), rect.y + 35, rect.width, 24)
|
||||
};
|
||||
};
|
||||
update(index) {
|
||||
if (!!this._processDelay) {
|
||||
if (this._processDelay > 0) {
|
||||
this._processDelay--;
|
||||
if (this._processDelay === 8) {
|
||||
// this._optionsList[this.index()].index === 0 ? Graphics._requestFullScreen() : Graphics._cancelFullScreen();
|
||||
}
|
||||
if (this._processDelay <= 0) {
|
||||
let gamepad = navigator.getGamepads()[Input._lastGamepad];
|
||||
if (!gamepad) { return; }
|
||||
for (let button of gamepad.buttons) {
|
||||
let descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(button), "pressed");
|
||||
Object.defineProperty(button, "pressed", descriptor);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
callUpdateHelp() {
|
||||
super.callUpdateHelp();
|
||||
if (this._helpWindow) {
|
||||
this._helpWindow.setText(this._optionsList[this.index()].helpText);
|
||||
};
|
||||
}
|
||||
cursorRight(wrap) {
|
||||
super.cursorRight(wrap);
|
||||
var data = this._optionsList[this.index()];
|
||||
// Get Data
|
||||
// if(this.index() === 0 && !Graphics._isFullScreen()) {
|
||||
// SoundManager.playBuzzer();
|
||||
// return;
|
||||
// }
|
||||
if (data) {
|
||||
// Set Data Index
|
||||
data.index = (data.index + 1) % data.options.length;
|
||||
// Process Option Command
|
||||
this.processOptionCommand();
|
||||
// Update Cursor
|
||||
this.updateCursor();
|
||||
}
|
||||
}
|
||||
cursorLeft(wrap) {
|
||||
super.cursorLeft(wrap);
|
||||
var data = this._optionsList[this.index()];
|
||||
// Get Data
|
||||
// if(this.index() === 0 && !Graphics._isFullScreen()) {
|
||||
// SoundManager.playBuzzer();
|
||||
// return;
|
||||
//}
|
||||
if (data) {
|
||||
// Get Max Items
|
||||
var maxItems = data.options.length;
|
||||
// Set Data Index
|
||||
data.index = (data.index - 1 + maxItems) % maxItems;
|
||||
// Process Option Command
|
||||
this.processOptionCommand();
|
||||
// Update Cursor
|
||||
this.updateCursor();
|
||||
};
|
||||
}
|
||||
updateCursor() {
|
||||
super.updateCursor();
|
||||
var topRow = this.topRow();
|
||||
// Get Index
|
||||
var index = this.index();
|
||||
// If Option cursors Exist
|
||||
if (this._optionCursors) {
|
||||
// Go through Option Cursors
|
||||
for (var i = 0; i < this._optionCursors.length; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._optionCursors[i];
|
||||
// Get Real Index
|
||||
var realIndex = topRow + i;
|
||||
// Get Data
|
||||
var data = this._optionsList[realIndex];
|
||||
// Get Selected State
|
||||
var selected = this.active ? realIndex === index : false;
|
||||
// If Data Exists
|
||||
if (data) {
|
||||
// Get Item Rect
|
||||
var rect = this.itemRect(realIndex);
|
||||
// Set Sprite Color
|
||||
sprite.setColorTone(selected ? [0, 0, 0, 0] : [-80, -80, -80, 255])
|
||||
// Activate Selected Sprite
|
||||
selected ? sprite.activate() : sprite.deactivate();
|
||||
// Set Sprite Positions
|
||||
sprite.x = (rect.x + 65) + (data.index * data.spacing);
|
||||
sprite.y = rect.y + 60;
|
||||
// Make Sprite Visible
|
||||
sprite.visible = this.height >= sprite.y + sprite.height;
|
||||
} else {
|
||||
// Deactivate Sprite
|
||||
sprite.deactivate();
|
||||
// Make Sprite Invisible
|
||||
sprite.visible = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class OneLoaderModList extends OneLoaderWindowBase {
|
||||
constructor() { super(...arguments); }
|
||||
|
||||
makeOptionsList() {
|
||||
this._optionsList = [];
|
||||
for (let mod of $modLoader.allMods.values()) {
|
||||
this._optionsList.push({
|
||||
header: mod.name + " | " + mod.version,
|
||||
options: mod._flags && mod._flags.includes("prevent_disable") ? ["CANNOT BE DISABLED"] : ["ENABLE", "DISABLE"],
|
||||
helpText: mod.description || "No description set",
|
||||
spacing: 128,
|
||||
index: mod._flags && mod._flags.includes("prevent_disable") ? 0 : ($modLoader.config[mod.id] ? 0 : 1),
|
||||
_modId: mod.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
windowWidth() { return 620; }
|
||||
windowHeight() { return 274; }
|
||||
processOptionCommand() {
|
||||
$modLoader.config[this._optionsList[this.index()]._modId] = (this._optionsList[this.index()].index === 0);
|
||||
$modLoader.syncConfig();
|
||||
}
|
||||
|
||||
update() {
|
||||
super.update();
|
||||
if (this.children[7]) {
|
||||
this.children[7].y = 16;
|
||||
}
|
||||
if (this.children[2]) {
|
||||
this.children[2].y = 24;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rafResolve = () => new Promise(resolve => requestAnimationFrame(resolve));
|
||||
async function processDecryption(mode, patch, target) {
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
const base = path.dirname(process.mainModule.filename);
|
||||
// we have to ship this lmao
|
||||
let baseGameIndexHTML = require('zlib').inflateSync(Buffer.from("eNqtlMFu1DAQhu9IvIPx3esrqpJeoEgc0KKqHDihiTNNZuvYlj3Z7fL0TDbdqqUgIdwc4snY/+cZjyfNu4/bDzffv16pkSd/+fZN8zAuFkIvlpKnmZBBuRFyQW71t5tP5r1+NhdgwlZDSh7NFDuS4YCdEYdxkKDzqJWLgTGI/ojln9WFgediOshiHp9hOg/uznCGUPzsxPUn6J7wkGLmJ7q5oMAc+CWsNsRHmadwpzL6VpMs1mrMeLvadnltUhi04mMSLE0woF0cL8VrHhxnN5q/g17qTvmVEZHPuzDes3WlnAm3kkKxgyS2WJtl5oxhYo+X2y/b68+NXT+khvahiGJ2sT+q0xZycnJwQ45z6I2LPuYLdTrLR1hxmRI/DWIHe1i9WpXsWr0r1lNXbKJ72uwkjsau8//JMCxVnyC9CiuR4zljLcv/lDuXKQy1IEpjDGgoSLHR7KnHuOlyPMhFrEDnNPxwsSrNBTFBkLucSyUmdjt0XEsp0sdYDUmZuJpyoNBLiSooyc8DhRrCBBR+lzd2aeW1qe3pd/0LUp/t+g==", "base64"));
|
||||
if (mode === 2) patch = 1;
|
||||
let overlay = document.createElement("div");
|
||||
overlay.style = "position: fixed; top: 0px; left: 0; right: 0; height: 128px; background: hsl(200, 85%, 35%); z-index: 999; display: flex; align-items: center; justify-content: center; color: white; font-family: sans-serif;";
|
||||
|
||||
let text = document.createElement("p");
|
||||
text.style = "font-size: 16px; z-index: 1;";
|
||||
text.innerText = "Preparing decryption";
|
||||
|
||||
let progress = document.createElement("div");
|
||||
progress.style = "position: absolute; top: 0; left: 0; height: 128px; width: 0%; background: #0008";
|
||||
|
||||
overlay.appendChild(text);
|
||||
overlay.appendChild(progress);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
let patchMV = (patch === 0);
|
||||
let planOfAction = [];
|
||||
|
||||
async function buildPlanOfAction(driver, offset) {
|
||||
text.innerText = `Planning: ${offset}`;
|
||||
let async_fs = {
|
||||
readdir: util.promisify(driver.readdir),
|
||||
readFile: util.promisify(driver.readFile),
|
||||
stat: util.promisify(driver.stat)
|
||||
};
|
||||
|
||||
let realPath = path.join(base, offset);
|
||||
let data = await async_fs.readdir(realPath);
|
||||
for (let file of data) {
|
||||
let vInnerPath = path.join(offset, file);
|
||||
let rInnerPath = path.join(realPath, file);
|
||||
let bInnerPath = vInnerPath.replace(/\\/g, "/");
|
||||
|
||||
if (bInnerPath.startsWith("/mods") || bInnerPath.startsWith("/adm-zip") || bInnerPath.startsWith("/JSON-Patch") || bInnerPath.startsWith("/gomori") || bInnerPath.startsWith("/modloader")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let stats = await async_fs.stat(rInnerPath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
await buildPlanOfAction(driver, vInnerPath);
|
||||
} else {
|
||||
planOfAction.push(vInnerPath);
|
||||
}
|
||||
}
|
||||
|
||||
await rafResolve();
|
||||
}
|
||||
|
||||
function mutateExt(a) {
|
||||
return a
|
||||
.replace(".KEL", ".json")
|
||||
.replace(".OMORI", ".js")
|
||||
.replace(".HERO", ".yaml")
|
||||
.replace(".AUBREY", ".json")
|
||||
.replace(".PLUTO", ".yaml")
|
||||
.replace(".rpgmvp", ".png")
|
||||
.replace(".rpgmvm", ".m4a")
|
||||
.replace(".rpgmvo", ".ogg");
|
||||
}
|
||||
|
||||
const decryptionMap = {}
|
||||
|
||||
let async_native_mkdir = util.promisify($modLoader.native_fs.mkdir);
|
||||
let ensuranceCache = new Set();
|
||||
async function ensureDirTree(tpath) {
|
||||
let components = _overlay_fs_split_path(tpath);
|
||||
let base = "";
|
||||
for (let a of components) {
|
||||
base = path.join(base, a);
|
||||
if (ensuranceCache.has(base)) continue;
|
||||
try { await async_native_mkdir(base); } catch (e) { }
|
||||
ensuranceCache.add(base);
|
||||
}
|
||||
}
|
||||
|
||||
async function go(driver) {
|
||||
let done = 0;
|
||||
let async_fs = {
|
||||
readdir: util.promisify(driver.readdir),
|
||||
readFile: util.promisify(driver.readFile),
|
||||
stat: util.promisify(driver.stat)
|
||||
};
|
||||
let async_native_write = util.promisify($modLoader.native_fs.writeFile);
|
||||
|
||||
for (let el of planOfAction) {
|
||||
text.innerText = `${el}`;
|
||||
let inputData = await async_fs.readFile(path.join(base, el));
|
||||
|
||||
let ext = el.match(/\.([^\.]+)$/) ? el.match(/\.([^\.]+)$/)[0] : "";
|
||||
if (decryptionMap[ext]) {
|
||||
inputData = decryptionMap[ext].bind(window._modloader_encryption)(inputData);
|
||||
}
|
||||
|
||||
el = mutateExt(el);
|
||||
await ensureDirTree(path.parse(path.join(target, el)).dir);
|
||||
await async_native_write(path.join(target, el), inputData);
|
||||
|
||||
done++;
|
||||
progress.style.width = `${(done / planOfAction.length) * 100}%`;
|
||||
}
|
||||
|
||||
await async_native_write(path.join(target, "index.html"), baseGameIndexHTML);
|
||||
}
|
||||
|
||||
|
||||
if (mode === 0 || mode === 1) { // We can use regular fs drivers for this
|
||||
let fs = (mode === 0) ? require('fs') : $modLoader.native_fs;
|
||||
await buildPlanOfAction(fs, "/");
|
||||
await go(fs);
|
||||
}
|
||||
if (mode === 2) {
|
||||
async function dumpInner(block, offset) {
|
||||
for (let entryName in block) {
|
||||
let entry = block[entryName];
|
||||
if (entry.type === "dir") {
|
||||
await dumpInner(entry.children, path.join(offset, entry.ogName));
|
||||
} else {
|
||||
planOfAction.push(path.join(offset, entry.ogName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await dumpInner($modLoader.overlayFS, "/");
|
||||
await go(require('fs'));
|
||||
}
|
||||
|
||||
if (patch === 0) {
|
||||
let nfs = $modLoader.native_fs;
|
||||
let rpgManagers = nfs.readFileSync(path.join(target, "js/rpg_managers.js"), "utf-8");
|
||||
rpgManagers = rpgManagers.split("(function() {");
|
||||
rpgManagers.pop();
|
||||
rpgManagers = rpgManagers.join("(function() {");
|
||||
nfs.writeFileSync(path.join(target, "js/rpg_managers.js"), rpgManagers);
|
||||
|
||||
let systemJson = nfs.readFileSync(path.join(target, "data/System.json"), "utf-8");
|
||||
systemJson = JSON.parse(systemJson);
|
||||
systemJson.hasEncryptedImages = false;
|
||||
systemJson.hasEncryptedAudio = false;
|
||||
|
||||
nfs.writeFileSync(path.join(target, "data/System.json"), JSON.stringify(systemJson, null, 2));
|
||||
nfs.writeFileSync(path.join(target, "Game.rpgproject"), "RPGMV 1.6.1");
|
||||
|
||||
let plugins = nfs.readFileSync(path.join(target, "js/plugins.js"), "utf-8");
|
||||
eval(plugins.replace("var $plugins", "window.__tmp_plugins"));
|
||||
plugins = window.__tmp_plugins;
|
||||
for (let p of plugins) {
|
||||
if (p.name === "DisableMouse") {
|
||||
p.status = false;
|
||||
}
|
||||
if (p.name === "YEP_Debugger" || p.name === "YEP_TestPlayAssist") {
|
||||
p.status = true;
|
||||
}
|
||||
}
|
||||
nfs.writeFileSync(path.join(target, "js/plugins.js"), `// Generated by RPG Maker.
|
||||
// Do not edit this file directly.
|
||||
var $plugins =
|
||||
${JSON.stringify(plugins, null, 2)}`);
|
||||
}
|
||||
|
||||
overlay.remove();
|
||||
alert("Decrypted to " + target);
|
||||
}
|
||||
|
||||
class OneLoaderDecrypt extends OneLoaderWindowBase {
|
||||
constructor() { super(...arguments); }
|
||||
|
||||
makeOptionsList() {
|
||||
this._optionsList = [];
|
||||
this._optionsList.push({
|
||||
header: "Decryption mode",
|
||||
options: [
|
||||
"EVERYTHING", "BASE GAME", "ONLY MODS"
|
||||
],
|
||||
helpText: "What should be decrypted?",
|
||||
spacing: 180,
|
||||
index: 0
|
||||
});
|
||||
this._optionsList.push({
|
||||
header: "Generate as RpgMaker project?",
|
||||
options: [
|
||||
"YES", "NO"
|
||||
],
|
||||
helpText: "Should changes needed to open in RpgMaker be made?",
|
||||
spacing: 128,
|
||||
index: 0
|
||||
});
|
||||
this._optionsList.push({
|
||||
header: "Start decryption",
|
||||
options: [
|
||||
"CLICK HERE TO START"
|
||||
],
|
||||
helpText: "Confirm your settings before starting. It takes a while!",
|
||||
spacing: 128,
|
||||
index: 0
|
||||
});
|
||||
}
|
||||
|
||||
windowWidth() { return 620; }
|
||||
windowHeight() { return 274; }
|
||||
|
||||
update() {
|
||||
super.update();
|
||||
if (this.children[7]) {
|
||||
this.children[7].y = 16;
|
||||
}
|
||||
if (this.children[2]) {
|
||||
this.children[2].y = 24;
|
||||
}
|
||||
if (this.active) {
|
||||
if (Input.isRepeated("ok")) {
|
||||
if (this.index() === 2) {
|
||||
if ($modLoader.isInTestMode) {
|
||||
return alert("This does not work in Test Mode.");
|
||||
}
|
||||
Input.clear();
|
||||
this.deactivate();
|
||||
processDecryption(this._optionsList[0].index, this._optionsList[1].index, `www_${this._optionsList[1].index === 0 ? "playtest" : "decrypt"}_${randomString(4)}`).then(() => {
|
||||
this.activate();
|
||||
this.select(0);
|
||||
this.refresh();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class OneLoaderSpecial extends OneLoaderWindowBase {
|
||||
constructor() { super(...arguments); }
|
||||
makeOptionsList() {
|
||||
this._optionsList = [];
|
||||
this._optionsList.push({
|
||||
header: "Automatic updating",
|
||||
options: [
|
||||
"ALLOW", "DENY"
|
||||
],
|
||||
helpText: "Should OneLoader automatically update?",
|
||||
spacing: 180,
|
||||
index: $modLoader.config._autoUpdater.check === "allow" ? 0 : 1
|
||||
})
|
||||
this._optionsList.push({
|
||||
header: "Reset priorities",
|
||||
options: [
|
||||
"CLICK HERE TO RESET PRIORITIES"
|
||||
],
|
||||
helpText: "Reset preferences for delta patching and asset priority",
|
||||
spacing: 180,
|
||||
index: 0
|
||||
});
|
||||
this._optionsList.push({
|
||||
header: "Restart game",
|
||||
options: [
|
||||
"CLICK HERE TO RESTART THE GAME"
|
||||
],
|
||||
helpText: "Restart the game (NOTE: May increase memory usage, old assets aren't cleared)",
|
||||
spacing: 180,
|
||||
index: 0
|
||||
});
|
||||
this._optionsList.push({
|
||||
header: "[DEBUG] Kill VFS",
|
||||
options: [
|
||||
"CLICK HERE TO KILL VFS"
|
||||
],
|
||||
helpText: "DO NOT DO THIS UNLESS ASKED TO BY ONELOADER DEVELOPERS!",
|
||||
spacing: 180,
|
||||
index: 0
|
||||
});
|
||||
}
|
||||
processOptionCommand() {
|
||||
if (this.index() === 0) {
|
||||
$modLoader.config._autoUpdater.check = this._optionsList[0].index === 0 ? "allow" : "deny";
|
||||
$modLoader.syncConfig();
|
||||
console.log($modLoader.config._autoUpdater);
|
||||
}
|
||||
}
|
||||
windowWidth() { return 620; }
|
||||
windowHeight() { return 274; }
|
||||
|
||||
update() {
|
||||
super.update();
|
||||
if (this.children[7]) {
|
||||
this.children[7].y = 16;
|
||||
}
|
||||
if (this.children[2]) {
|
||||
this.children[2].y = 24;
|
||||
}
|
||||
if (this.active) {
|
||||
if (Input.isRepeated("ok")) {
|
||||
if (this.index() === 1) {
|
||||
Input.clear();
|
||||
if (confirm("Reset preferences?")) {
|
||||
$modLoader.config._conflictResolutions = {};
|
||||
$modLoader.config._deltaPreference = {};
|
||||
$modLoader.syncConfig();
|
||||
}
|
||||
}
|
||||
if (this.index() === 2) {
|
||||
Input.clear();
|
||||
window.location.reload();
|
||||
}
|
||||
if (this.index() === 3) {
|
||||
if (confirm("This will break mods until restart. Don't do this unless asked to by OneLoader developers or if you know what you are doing!")) {
|
||||
__unload_web_vfs();
|
||||
__unload_node_vfs();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function randomString(l) {
|
||||
let values = "0123456789abcdef";
|
||||
let output = "";
|
||||
for (let idx = 0; idx < l; ++idx) {
|
||||
output += values[Math.floor(Math.random() * values.length)];
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
class OneLoaderOptionsWindow extends Window_OmoMenuOptionsCategory {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
}
|
||||
initialize() {
|
||||
super.initialize();
|
||||
this.setHandler("ok", this.onManageMods.bind(this));
|
||||
this._oneLoaderModList = new OneLoaderModList();
|
||||
this._oneLoaderModList.deactivate();
|
||||
this._oneLoaderModList.y = 44;
|
||||
this._oneLoaderModList.setHandler('cancel', this.onWindowCancel.bind(this));
|
||||
this.addChild(this._oneLoaderModList);
|
||||
|
||||
if (!$modLoader.isInTestMode) {
|
||||
this._oneLoaderDecrypt = new OneLoaderDecrypt();
|
||||
this._oneLoaderDecrypt.deactivate();
|
||||
this._oneLoaderDecrypt.y = 44;
|
||||
this._oneLoaderDecrypt.setHandler('cancel', this.onWindowCancel.bind(this));
|
||||
this.addChild(this._oneLoaderDecrypt);
|
||||
}
|
||||
|
||||
this._oneLoaderSpecial = new OneLoaderSpecial();
|
||||
this._oneLoaderSpecial.deactivate();
|
||||
this._oneLoaderSpecial.y = 44;
|
||||
this._oneLoaderSpecial.setHandler('cancel', this.onWindowCancel.bind(this));
|
||||
this.addChild(this._oneLoaderSpecial);
|
||||
|
||||
if (!$modLoader.isInTestMode) {
|
||||
this._optionWindows = [this._oneLoaderModList, this._oneLoaderDecrypt, this._oneLoaderSpecial];
|
||||
} else {
|
||||
this._optionWindows = [this._oneLoaderModList, this._oneLoaderSpecial];
|
||||
}
|
||||
}
|
||||
|
||||
makeCommandList() {
|
||||
this.addCommand("MANAGE MODS", 'ok', true);
|
||||
if (!$modLoader.isInTestMode) this.addCommand("DECRYPT", 'ok', true);
|
||||
this.addCommand("OPTIONS", 'ok', true);
|
||||
}
|
||||
maxCols() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
passHelpWindow(helpWindow) {
|
||||
this._oneLoaderModList._helpWindow = helpWindow;
|
||||
if (!$modLoader.isInTestMode) this._oneLoaderDecrypt._helpWindow = helpWindow;
|
||||
this._oneLoaderSpecial._helpWindow = helpWindow;
|
||||
this._helpWindow = helpWindow;
|
||||
}
|
||||
onManageMods() {
|
||||
this.deactivate();
|
||||
if (this.index() === 0) {
|
||||
this._oneLoaderModList.activate();
|
||||
this._oneLoaderModList.select(0);
|
||||
} else if (this.index() === 1) {
|
||||
if (!$modLoader.isInTestMode) {
|
||||
this._oneLoaderDecrypt.activate();
|
||||
this._oneLoaderDecrypt.select(0);
|
||||
} else {
|
||||
this._oneLoaderSpecial.activate();
|
||||
this._oneLoaderSpecial.select(0);
|
||||
}
|
||||
} else if (this.index() === 2) {
|
||||
this._oneLoaderSpecial.activate();
|
||||
this._oneLoaderSpecial.select(0);
|
||||
} else {
|
||||
this.activate();
|
||||
}
|
||||
}
|
||||
|
||||
onWindowCancel() {
|
||||
if (this.index() === 0) {
|
||||
this._oneLoaderModList.select(0);
|
||||
this._oneLoaderModList.refresh();
|
||||
}
|
||||
if (this.index() === 1) {
|
||||
if (!$modLoader.isInTestMode) {
|
||||
this._oneLoaderDecrypt.select(0);
|
||||
this._oneLoaderDecrypt.refresh();
|
||||
} else {
|
||||
this._oneLoaderSpecial.select(0);
|
||||
this._oneLoaderSpecial.refresh();
|
||||
}
|
||||
}
|
||||
if (this.index() === 2) {
|
||||
this._oneLoaderSpecial.select(0);
|
||||
this._oneLoaderSpecial.refresh();
|
||||
}
|
||||
|
||||
this._helpWindow.clear();
|
||||
this.activate();
|
||||
}
|
||||
|
||||
callUpdateHelp() {
|
||||
super.callUpdateHelp();
|
||||
if (this.index() === 0) {
|
||||
if (this._helpWindow) {
|
||||
this._helpWindow.setText("Enable and disable your mods");
|
||||
}
|
||||
} else if (this.index() === 1) {
|
||||
if (this._helpWindow) {
|
||||
if (!$modLoader.isInTestMode)
|
||||
this._helpWindow.setText("Decrypt the game here");
|
||||
else
|
||||
this._helpWindow.setText("General OneLoader options");
|
||||
}
|
||||
} else if (this.index() === 2) {
|
||||
if (this._helpWindow) {
|
||||
this._helpWindow.setText("General OneLoader options");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let _injection_point_title_screen = Scene_OmoriTitleScreen;
|
||||
window.Scene_OmoriTitleScreen = class Scene_OmoriTitleScreen extends _injection_point_title_screen {
|
||||
create() {
|
||||
super.create();
|
||||
}
|
||||
createSystemOptionsWindow() {
|
||||
super.createSystemOptionsWindow();
|
||||
this._oneLoaderWindow = new OneLoaderOptionsWindow();
|
||||
this._oneLoaderWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
||||
this._oneLoaderWindow.deactivate();
|
||||
this._oneLoaderWindow.passHelpWindow(this._helpWindow);
|
||||
this._optionsWindowsContainer.addChild(this._oneLoaderWindow);
|
||||
}
|
||||
optionWindows() {
|
||||
let a = super.optionWindows();
|
||||
a.push(this._oneLoaderWindow);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
let _injection_point_scene_menuoptions = Scene_OmoMenuOptions;
|
||||
window.Scene_OmoMenuOptions = class Scene_OmoMenuOptions extends _injection_point_scene_menuoptions {
|
||||
createSystemOptionsWindow() {
|
||||
super.createSystemOptionsWindow();
|
||||
if (!spainMode) {
|
||||
this._oneLoaderWindow = new OneLoaderOptionsWindow();
|
||||
this._oneLoaderWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
||||
this._oneLoaderWindow.deactivate();
|
||||
this._oneLoaderWindow.passHelpWindow(this._helpWindow);
|
||||
this._oneLoaderWindow.visible = false;
|
||||
this._oneLoaderWindow.height = 0;
|
||||
this._oneLoaderWindow.x = 10;
|
||||
this.addChild(this._oneLoaderWindow);
|
||||
}
|
||||
}
|
||||
optionWindows() {
|
||||
let a = super.optionWindows();
|
||||
if (!spainMode) a.push(this._oneLoaderWindow);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
let _injection_point_options_category = Window_OmoMenuOptionsCategory;
|
||||
window.Window_OmoMenuOptionsCategory = class Window_OmoMenuOptionsCategory extends _injection_point_options_category {
|
||||
makeCommandList() {
|
||||
super.makeCommandList();
|
||||
this.addCommand('MODS', 'ok');
|
||||
}
|
||||
maxCols() { return super.maxCols() + 1; }
|
||||
}
|
||||
|
||||
window.Window_OmoMenuOptionsMods = new Proxy(OneLoaderOptionsWindow, {
|
||||
construct(target, args, newTarget) {
|
||||
spainMode = true;
|
||||
return Reflect.construct(target, args, newTarget);
|
||||
}
|
||||
});
|
||||
}
|
||||
100
www/js/plugins/AEL_TilesetPropertyRegions.js
Normal file
100
www/js/plugins/AEL_TilesetPropertyRegions.js
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/*=============================================================================
|
||||
* Tileset Properties as Regions
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc <AEL_TilesetPropertyRegions> Uses regions to add tile properties.
|
||||
* @author Archeia
|
||||
*
|
||||
* @param Ladder Region
|
||||
* @desc Region used for Ladder Tiles.
|
||||
* @default 2
|
||||
*
|
||||
* @param Counter Region
|
||||
* @desc Region used for Counter Tiles.
|
||||
* @default 3
|
||||
*
|
||||
* @param Damage Floor Region
|
||||
* @desc Region used for Damage Tiles.
|
||||
* @default 4
|
||||
*
|
||||
* @param Bush Region
|
||||
* @desc Region used for Bush Tiles.
|
||||
* @default 5
|
||||
*
|
||||
* @param Bush Height
|
||||
* @desc Region used for Bush Tiles.
|
||||
* @default 12
|
||||
*
|
||||
* @help This plugin adds tile properties like Ladder, Bush, Counter and Damage
|
||||
* Floor to regions. This plugin also does not have any plugin commands.
|
||||
*/
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.AEL_TilesetPropertyRegions = true;
|
||||
|
||||
//=============================================================================
|
||||
// ** Parameter Check
|
||||
//=============================================================================
|
||||
var parameters = $plugins.filter(function(p) {
|
||||
return p.description.contains('<AEL_TilesetPropertyRegions>') })[0].parameters;
|
||||
|
||||
//=============================================================================
|
||||
// ** Set Parameters
|
||||
//=============================================================================
|
||||
var AEL = AEL || {};
|
||||
AEL.TilesetPropertyRegions = AEL.TilesetPropertyRegions || {};
|
||||
AEL.TilesetPropertyRegions.ladderRegion = Number(parameters['Ladder Region'] || 2);
|
||||
AEL.TilesetPropertyRegions.counterRegion = Number(parameters['Counter Region'] || 3);
|
||||
AEL.TilesetPropertyRegions.damageFloorRegion = Number(parameters['Damage Floor Region'] || 4);
|
||||
AEL.TilesetPropertyRegions.bushRegion = Number(parameters['Bush Region'] || 5);
|
||||
AEL.TilesetPropertyRegions.bushHeight = Number(parameters['Bush Height'] || 12);
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a map. It contains scrolling and passage
|
||||
// determination functions.
|
||||
//=============================================================================
|
||||
// * Determine if Ladder
|
||||
//=============================================================================
|
||||
Game_Map.prototype.isLadder = function(x, y) {
|
||||
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x20) || this.regionId(x, y) === AEL.TilesetPropertyRegions.ladderRegion);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Counter
|
||||
//=============================================================================
|
||||
Game_Map.prototype.isCounter = function(x, y) {
|
||||
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x80) || this.regionId(x, y) === AEL.TilesetPropertyRegions.counterRegion);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Damage floor
|
||||
//=============================================================================
|
||||
Game_Map.prototype.isDamageFloor = function(x, y) {
|
||||
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x100) || this.regionId(x, y) === AEL.TilesetPropertyRegions.damageFloorRegion);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Bush
|
||||
//=============================================================================
|
||||
Game_Map.prototype.isBush = function(x, y) {
|
||||
if(Imported.YED_Tiled){ // Add Compatibility with Tiled
|
||||
// Check if on Region
|
||||
var onRegion = this._regions !== undefined && this.regionId(x, y) === AEL.TilesetPropertyRegions.bushRegion;
|
||||
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x40) || onRegion)
|
||||
} else {
|
||||
return this.isValid(x, y) && (this.checkLayeredTilesFlags(x, y, 0x40) || this.regionId(x, y) === AEL.TilesetPropertyRegions.bushRegion);
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Change Bush Depth
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.refreshBushDepth = function() {
|
||||
if (this.isNormalPriority() && !this.isObjectCharacter() &&
|
||||
this.isOnBush() && !this.isJumping()) {
|
||||
if (!this.isMoving()) {
|
||||
this._bushDepth = AEL.TilesetPropertyRegions.bushHeight;
|
||||
}
|
||||
} else {
|
||||
this._bushDepth = 0;
|
||||
}
|
||||
};
|
||||
708
www/js/plugins/Active Chain Skills.js
Normal file
708
www/js/plugins/Active Chain Skills.js
Normal file
|
|
@ -0,0 +1,708 @@
|
|||
//=============================================================================
|
||||
// TDS Active Chain Skills
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_ActiveChainSkills = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.ActiveChainSkills = _TDS_.ActiveChainSkills || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @author TDS
|
||||
* @plugindesc
|
||||
* This script allows you to chain skills in a combo.
|
||||
*
|
||||
* @param Minimun Time
|
||||
* @desc How many frames minimum for chain allowance.
|
||||
* @default 120
|
||||
|
||||
* @param Title Text
|
||||
* @desc Text displayed above the active chain skills as a title.
|
||||
* @default Active Chain Skills
|
||||
|
||||
* @param Title Font Size
|
||||
* @desc Font size of the title text of active chain skills.
|
||||
* @default 20
|
||||
|
||||
* @param Active Skill Sound
|
||||
* @desc Sound effect played whenever an active chain skill has been selected.
|
||||
* @default {"name": "Skill2", "pan": 0, "pitch": 100, "volume": 80}
|
||||
*
|
||||
******************************************************************************
|
||||
* @param * Chain Input Text *
|
||||
******************************************************************************
|
||||
* @param (↑) Up Skill ON
|
||||
* @desc
|
||||
* @default \C[17]↑\C[0]Chain:
|
||||
*
|
||||
* @param (↑) Up Skill OFF
|
||||
* @desc
|
||||
* @default \C[7]↑Chain:
|
||||
*
|
||||
* @param (↑) Up Skill ACT
|
||||
* @desc
|
||||
* @default \C[17]↑Chain:
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* @param (↓) Down Skill ON
|
||||
* @desc
|
||||
* @default \C[17]↓\C[0]Chain:
|
||||
*
|
||||
* @param (↓) Down Skill OFF
|
||||
* @desc
|
||||
* @default \C[7]↓Chain:
|
||||
*
|
||||
* @param (↓) Down Skill ACT
|
||||
* @desc
|
||||
* @default \C[17]↓Chain:
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* @param (←) Left Skill ON
|
||||
* @desc
|
||||
* @default \C[17]←\C[0]Attack:
|
||||
*
|
||||
* @param (←) Left Skill OFF
|
||||
* @desc
|
||||
* @default \C[7]←Attack:
|
||||
*
|
||||
* @param (←) Left Skill ACT
|
||||
* @desc
|
||||
* @default \C[17]←Attack:
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* @param (→) Right Skill ON
|
||||
* @desc
|
||||
* @default \C[17]→\C[0]Strike:
|
||||
*
|
||||
* @param (→) Right Skill OFF
|
||||
* @desc
|
||||
* @default \C[7]→Strike:
|
||||
*
|
||||
* @param (→) Right Skill ACT
|
||||
* @desc
|
||||
* @default \C[17]→Strike:
|
||||
*
|
||||
******************************************************************************
|
||||
* @help
|
||||
*-----------------------------------------------------------------------------
|
||||
* * Skill Notetags - These notetags go in the skill notebox in the database.
|
||||
*-----------------------------------------------------------------------------
|
||||
* <ChainSkill: SkillId, Input>
|
||||
* ^ This note tag allows you to set which skills can be chained to the one
|
||||
* that has this note tag. Order in the notes reflects order of choice.
|
||||
* ^ SkillId: Id of the skill that can be chained into.
|
||||
* ^ Input: Name of the Input. (up, down, left, right, ok, cancel, control, tab, etc..)
|
||||
*
|
||||
* Examples:
|
||||
* <ChainSkill: 15, up>
|
||||
* <ChainSkill: 16, down>
|
||||
* <ChainSkill: 17, left>
|
||||
* <ChainSkill: 18, right>
|
||||
*
|
||||
* <ChainOnly> (Case Sensitive.)
|
||||
* ^ This makes the skill only usable only in chains. (Does not affect enemies.)
|
||||
*/
|
||||
//=============================================================================
|
||||
// Get Plugin Parameters
|
||||
var parameters = PluginManager.parameters('Active Chain Skills');
|
||||
// Initialize Parameters
|
||||
_TDS_.ActiveChainSkills.params = {};
|
||||
// Get Chain Title
|
||||
_TDS_.ActiveChainSkills.params.chainTitle = String(parameters['Title Text'] || 'Active Chain Skills');
|
||||
// Get Chain Title Font Size
|
||||
_TDS_.ActiveChainSkills.params.titleFontSize = Number(parameters['Title Font Size'] ||20);
|
||||
// Get Minimun Input time (In Frames)
|
||||
_TDS_.ActiveChainSkills.params.minimunInputTime = Number(parameters['Minimun Time'] || 120);
|
||||
// Get Active Skill Sound
|
||||
_TDS_.ActiveChainSkills.params.activeSkillSound = JsonEx.parse(parameters['Active Skill Sound'] || '{"name": "Skill2", "pan": 0, "pitch": 100, "volume": 80}' );
|
||||
|
||||
// Initialize Input Data
|
||||
_TDS_.ActiveChainSkills.params.inputData = {up: {}, down: {}, left: {}, right: {}};
|
||||
// Up Data
|
||||
_TDS_.ActiveChainSkills.params.inputData.up.on = String(parameters['(↑) Up Skill ON'] || '\\C[17]↑\\C[0]Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.up.off = String(parameters['(↑) Up Skill OFF'] || '\\C[7]↑Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.up.act = String(parameters['(↑) Up Skill ACT'] || '\\C[17]↑Chain: ');
|
||||
// Down Data
|
||||
_TDS_.ActiveChainSkills.params.inputData.down.on = String(parameters['(↓) Down Skill ON'] || '\\C[17]↓\\C[0]Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.down.off = String(parameters['(↓) Down Skill OFF'] || '\\C[7]↓Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.down.act = String(parameters['(↓) Down Skill ACT'] || '\\C[17]↓Chain: ');
|
||||
// Left Data
|
||||
_TDS_.ActiveChainSkills.params.inputData.left.on = String(parameters['(←) Left Skill ON'] || '\\C[17]←\\C[0]Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.left.off = String(parameters['(←) Left Skill OFF'] || '\\C[7]←Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.left.act = String(parameters['(←) Left Skill ACT'] || '\\C[17]←Chain: ');
|
||||
// Right Data
|
||||
_TDS_.ActiveChainSkills.params.inputData.right.on = String(parameters['(→) Right Skill ON'] || '\\C[17]→\\C[0]Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.right.off = String(parameters['(→) Right Skill OFF'] || '\\C[7]→Chain: ');
|
||||
_TDS_.ActiveChainSkills.params.inputData.right.act = String(parameters['(→) Right Skill ACT'] || '\\C[17]→Chain: ');
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages the database and game objects.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.DataManager_onLoad = DataManager.onLoad;
|
||||
//=============================================================================
|
||||
// * On Load Processing
|
||||
//=============================================================================
|
||||
DataManager.onLoad = function(object) {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.DataManager_onLoad.call(this, object);
|
||||
// Set Array & Type
|
||||
var array = object, type = null;
|
||||
// Object Switch
|
||||
switch (object) {
|
||||
case $dataSkills: type = 'SKILL' ;break;
|
||||
}
|
||||
// If Type is not null
|
||||
if (type !== null) {
|
||||
// If Array is an array
|
||||
if (Array.isArray(array)) {
|
||||
// Go Through Array
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
// Get Data
|
||||
var data = array[i];
|
||||
// Extract MetaData
|
||||
if (data) { this.extractActiveChainSkillMetaData(data, type); }
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Extract Active Chain Skill Meta Data
|
||||
//=============================================================================
|
||||
DataManager.extractActiveChainSkillMetaData = function(data, type) {
|
||||
// If Data has no notes return
|
||||
if (data.note.length <= 0) { return; }
|
||||
// If Type is skill
|
||||
if (type === 'SKILL') {
|
||||
// Initialize Chain Skill List
|
||||
data.meta.chainSkillList = {};
|
||||
// Get Regular Expression
|
||||
var regExp = /<ChainSkill:(.+),(.+)>/ig;
|
||||
var str = data.note, arr;
|
||||
while ((arr = regExp.exec(str)) !== null) {
|
||||
// Set Parameter Swap Values
|
||||
data.meta.chainSkillList[arr[2].trim()] = Number(arr[1]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages the database and game objects.
|
||||
//=============================================================================
|
||||
// * Set Active Chain Skill Window
|
||||
//=============================================================================
|
||||
BattleManager.setActiveChainSkillWindow = function(chainWindow) { this._activeChainSkillWindow = chainWindow; };
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_BattlerBase
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Battler. It mainly contains parameters calculation.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.Game_BattlerBase_meetsSkillConditions = Game_BattlerBase.prototype.meetsSkillConditions;
|
||||
//=============================================================================
|
||||
// * Determine if Skill Meets Use Conditions
|
||||
//=============================================================================
|
||||
Game_BattlerBase.prototype.meetsSkillConditions = function(skill) {
|
||||
// Return false if Chain skill is restricted
|
||||
if (this.isChainSkillRestrict(skill)) { return false; }
|
||||
// Return Original Function
|
||||
return _TDS_.ActiveChainSkills.Game_BattlerBase_meetsSkillConditions.call(this, skill);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Chain Skill is restricted
|
||||
//=============================================================================
|
||||
Game_BattlerBase.prototype.isChainSkillRestrict = function(skill) {
|
||||
if (!this.isActor()) { return false;}
|
||||
if (!$gameParty.inBattle()) { return false; }
|
||||
if (!skill.meta.ChainOnly) { return false; }
|
||||
return !this._activeChainEnabled;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Battler
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Actor and Game_Enemy. It contains methods for sprites
|
||||
// and actions.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart;
|
||||
_TDS_.ActiveChainSkills.Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd;
|
||||
//=============================================================================
|
||||
// * On Battle Start Processing
|
||||
//=============================================================================
|
||||
Game_Battler.prototype.onBattleStart = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.Game_Battler_onBattleStart.call(this);
|
||||
// Set Active Chain Enabled Flag to false
|
||||
this._activeChainEnabled = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Battle End Processing
|
||||
//=============================================================================
|
||||
Game_Battler.prototype.onBattleEnd = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.Game_Battler_onBattleEnd.call(this);
|
||||
// Set Active Chain Enabled Flag to false
|
||||
this._activeChainEnabled = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Enable or Disable Active Chain
|
||||
//=============================================================================
|
||||
Game_Battler.prototype.enableActiveChain = function() { if (this.isActor()) { this._activeChainEnabled = true; } };
|
||||
Game_Battler.prototype.disableActiveChain = function() { if (this.isActor()) { this._activeChainEnabled = false; } };
|
||||
//=============================================================================
|
||||
// * Add Active Skill Chain
|
||||
//=============================================================================
|
||||
Game_Battler.prototype.addActiveSkillChain = function(skillId) {
|
||||
// Create Action
|
||||
var action = new Game_Action(this);
|
||||
// Set Action Active Chain Skill
|
||||
action.setActiveChainSkill(skillId);
|
||||
// Add Action to Actions list
|
||||
this._actions.splice(1, 0, action);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Action
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a battle action.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.Game_Action_isValid = Game_Action.prototype.isValid;
|
||||
//=============================================================================
|
||||
// * Set Active Chain Skill
|
||||
//=============================================================================
|
||||
Game_Action.prototype.setActiveChainSkill = function(skillId) {
|
||||
// Set Skill
|
||||
this.setSkill(skillId);
|
||||
// Set Target
|
||||
// this.subject().currentAction._targetIndex
|
||||
this.setTarget(this.subject()._lastTargetIndex);
|
||||
// Set Active Chain Skill
|
||||
this._activeChainSkill = true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if action is valid
|
||||
//=============================================================================
|
||||
Game_Action.prototype.isValid = function() {
|
||||
// Enable Active Chain
|
||||
if (this._activeChainSkill) { this.subject().enableActiveChain(); }
|
||||
// Get Original Result
|
||||
var result = _TDS_.ActiveChainSkills.Game_Action_isValid.call(this);
|
||||
// Disable Active Chain
|
||||
if (this._activeChainSkill) { this.subject().disableActiveChain(); }
|
||||
// Return Result
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Battle
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the battle screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.Scene_Battle_CreateAllWindows = Scene_Battle.prototype.createAllWindows;
|
||||
//=============================================================================
|
||||
// * Create All Windows
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.createAllWindows = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.Scene_Battle_CreateAllWindows.call(this);
|
||||
// Create Chain Skill Window
|
||||
this.createChainSkillWindow();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Chain Skill Window
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.createChainSkillWindow = function() {
|
||||
// Create Active Chain Skill Window
|
||||
this._activeChainSkillWindow = new Window_ChainSkillList();
|
||||
// Add Child
|
||||
this.addChild(this._activeChainSkillWindow);
|
||||
// Set Battle Manager Active Chain Skill Window
|
||||
BattleManager.setActiveChainSkillWindow(this._activeChainSkillWindow);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_BattleLog
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for displaying battle progress. No frame is displayed, but it is
|
||||
// handled as a window for convenience.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_initialize = Window_BattleLog.prototype.initialize;
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_startAction = Window_BattleLog.prototype.startAction;
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_update = Window_BattleLog.prototype.update;
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_updateWaitMode = Window_BattleLog.prototype.updateWaitMode;
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_displayAction = Window_BattleLog.prototype.displayAction;
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.initialize = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_initialize.call(this);
|
||||
// Set Active Chain Skill Input Couner to 0
|
||||
this._activeChainSkillInputCounter = 0;
|
||||
// Set Active Chain Skill to 0
|
||||
this._activeChainSkill = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Custom Code
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.processCustomCode = function(code) { code(); };
|
||||
//=============================================================================
|
||||
// * Start Action
|
||||
//=============================================================================
|
||||
//Window_BattleLog.prototype.startAction = function(subject, action, targets) {
|
||||
// Enable Active Chain
|
||||
// this.push('processCustomCode', function() { subject.enableActiveChain();});
|
||||
// Get Item
|
||||
// var item = action.item();
|
||||
// Show Chain List
|
||||
// this.push('showChainSkillList', subject, item);
|
||||
// Process Custom Code
|
||||
// this.push('processCustomCode', _TDS_.ActiveChainSkills.Window_BattleLog_startAction.bind(this, subject, action, targets));
|
||||
// Start Skill Chain Wait
|
||||
// this.push('startChainSkillInputWait');
|
||||
//};
|
||||
//=============================================================================
|
||||
// * Start Action
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
|
||||
// Enable Active Chain
|
||||
this.push('processCustomCode', function() { subject.enableActiveChain();});
|
||||
// Get Item
|
||||
var item = action.item();
|
||||
// Show Chain List
|
||||
this.push('showChainSkillList', subject, item);
|
||||
// Process Custom Code
|
||||
this.push('processCustomCode', _TDS_.ActiveChainSkills.Window_BattleLog_startAction.bind(this, subject, action, targets));
|
||||
// Clear Text
|
||||
this.push('clear');
|
||||
// Start Skill Chain Wait
|
||||
this.push('startChainSkillInputWait');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Display Action Results
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.displayActionResults = function(subject, target) {
|
||||
// Run Original Function
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_displayActionResults.call(this, subject, target);
|
||||
// If Subject is an actor
|
||||
if (subject.isActor()) {
|
||||
// Get Chain Window
|
||||
var chainWindow = BattleManager._activeChainSkillWindow;
|
||||
// If Chain Window is visible
|
||||
if (chainWindow.visible) {
|
||||
// Set Wait mode to chain skill input
|
||||
this.push('setWaitMode', 'chainSkillInput');
|
||||
// Hide Chain List
|
||||
this.push('hideChainSkillList');
|
||||
}
|
||||
// Enable Active Chain
|
||||
this.push('processCustomCode', function() { subject.disableActiveChain();});
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Chain Skill List
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.showChainSkillList = function(subject, skill) {
|
||||
if (subject === undefined) { return; }
|
||||
if (!subject.isActor()) { return; }
|
||||
if (!DataManager.isSkill(skill)) { return; }
|
||||
// Set Active Chain Skill to 0
|
||||
// Get Chain Window
|
||||
var chainWindow = BattleManager._activeChainSkillWindow;
|
||||
this._activeChainSkill = 0;
|
||||
// Setup Chain Window
|
||||
chainWindow.setup(subject, skill);
|
||||
// If Chain Window is more than 0
|
||||
if (chainWindow._chainSkills.length > 0) { chainWindow.show(); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Chain Skill List
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.hideChainSkillList = function() {
|
||||
// Set Active Chain Skill to 0
|
||||
this._activeChainSkill = 0;
|
||||
// Hide Active Chain Skill Window
|
||||
BattleManager._activeChainSkillWindow.hide();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start Chain Skill Input Wait
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.startChainSkillInputWait = function() {
|
||||
// Set Active chain Skill Input Counter
|
||||
this._activeChainSkillInputCounter = _TDS_.ActiveChainSkills.params.minimunInputTime ;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.update = function() {
|
||||
// Get Chain Window
|
||||
var chainWindow = BattleManager._activeChainSkillWindow;
|
||||
// If Chain Window Exists and its visible
|
||||
if (chainWindow && chainWindow.visible) { this.updateChainkSkillInput(); }
|
||||
// Call Original Function
|
||||
_TDS_.ActiveChainSkills.Window_BattleLog_update.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Chain Skill Input
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.updateChainkSkillInput = function() {
|
||||
// Get Chain Window
|
||||
var chainWindow = BattleManager._activeChainSkillWindow;
|
||||
// Get Chain Window Skill
|
||||
var chainSkills = chainWindow._chainSkills;
|
||||
// If Active Chain Skill is 0
|
||||
if (this._activeChainSkill === 0) {
|
||||
// Go Through Chain Skills
|
||||
for (var i = 0; i < chainSkills.length; i++) {
|
||||
// Get Input
|
||||
var input = chainSkills[i][0];
|
||||
// Get Skill
|
||||
var skill = chainSkills[i][1];
|
||||
// If Input is triggered
|
||||
if (Input.isTriggered(input)) {
|
||||
// Get Subject
|
||||
var subject = chainWindow._battler;
|
||||
if (!subject.canUse(skill)) { continue; }
|
||||
if (!subject.isLearnedSkill(skill.id)) { continue; }
|
||||
// Play Sound Effect
|
||||
AudioManager.playSe(_TDS_.ActiveChainSkills.params.activeSkillSound);
|
||||
// Set Chain Window Input
|
||||
chainWindow.chainInput = input;
|
||||
// Set Active Chain Skill Input Count to 12
|
||||
this._activeChainSkillInputCounter = 12;
|
||||
// Set Active Chain Skill Id
|
||||
this._activeChainSkill = skill.id;
|
||||
// Add Active Skill Chain to subject
|
||||
subject.addActiveSkillChain(skill.id);
|
||||
// Refresh Chain Window
|
||||
// Break Loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If Active Chain Skill Input counter is more than 0
|
||||
if (this._activeChainSkillInputCounter > 0) {
|
||||
// Decrease Active Chain Skill Input counter
|
||||
this._activeChainSkillInputCounter--;
|
||||
// Return True
|
||||
return true;
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Wait Mode
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.updateWaitMode = function() {
|
||||
// If Wait mode is for chain skill input
|
||||
if (this._waitMode === 'chainSkillInput') {
|
||||
// If Active Chain Skill Input counter is more than 0
|
||||
if (this._activeChainSkillInputCounter > 0) { return true; }
|
||||
}
|
||||
// Return Original Function
|
||||
return _TDS_.ActiveChainSkills.Window_BattleLog_updateWaitMode.call(this);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_ChainSkillList
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for displaying battle progress. No frame is displayed, but it is
|
||||
// handled as a window for convenience.
|
||||
//=============================================================================
|
||||
function Window_ChainSkillList() { this.initialize.apply(this, arguments);}
|
||||
Window_ChainSkillList.prototype = Object.create(Window_Base.prototype);
|
||||
Window_ChainSkillList.prototype.constructor = Window_ChainSkillList;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.initialize = function() {
|
||||
// Get Width
|
||||
var dw = Math.max(Math.round(Graphics.boxWidth / 2), 450);
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, -this.standardPadding(), 0, dw, this.fittingHeight(6));
|
||||
// Set Opacity to 0;
|
||||
this.opacity = 0;
|
||||
// Hide
|
||||
this.hide();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.setup = function(battler, skill) {
|
||||
// Set Battler
|
||||
this._battler = battler;
|
||||
// Set Skill
|
||||
this._skill = skill;
|
||||
// Initialize Chain Skills Array
|
||||
this._chainSkills = [];
|
||||
// If Skill has a chain skill list
|
||||
if (skill.meta.chainSkillList) {
|
||||
// Get Inputs
|
||||
var inputs = Object.keys(skill.meta.chainSkillList);
|
||||
// Go Through Inputs
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
// Get Input
|
||||
var input = inputs[i];
|
||||
// Get Chain Skill
|
||||
var chainSkill = skill.meta.chainSkillList[input];
|
||||
// If Battler does not have skill
|
||||
if (!battler.isLearnedSkill(chainSkill)) { continue; }
|
||||
// Add Skill to Chain Skills array
|
||||
this._chainSkills.push([input, $dataSkills[chainSkill]]);
|
||||
}
|
||||
}
|
||||
// Set Y Coordinates
|
||||
this.y = Graphics.boxHeight - this.fittingHeight(4);
|
||||
this.y -= this.fittingHeight(this._chainSkills.length + 1);
|
||||
// Set Enabled Flag to true;
|
||||
this._enabled = true;
|
||||
// Refresh Contents
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Window
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.show = function() {
|
||||
// Activate Window
|
||||
this.activate();
|
||||
// Super Call
|
||||
Window_Base.prototype.show.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Chain Input
|
||||
//=============================================================================
|
||||
Object.defineProperty(Window_ChainSkillList.prototype, 'chainInput', {
|
||||
get: function() { return this._chainInput; },
|
||||
set: function(value) {
|
||||
// Set Chain Input
|
||||
this._chainInput = value;
|
||||
// Set Enabled Flag
|
||||
this._enabled = false;
|
||||
// Refresh if value is not null
|
||||
if (value !== null) { this.refresh(); }
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.refresh = function() {
|
||||
// Set Chain Input to null if enabled
|
||||
if (this._enabled) { this._chainInput = null; }
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Draw Background Color
|
||||
this.drawBackgroundColor();
|
||||
// Draw Chain Skill Title
|
||||
this.drawChainSkillTitle();
|
||||
// If Skill Exists
|
||||
if (this._skill) {
|
||||
// Draw Chain Skills
|
||||
this.drawChainSkills();
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Background Color
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.drawBackgroundColor = function() {
|
||||
// Get Height
|
||||
var dh = this.lineHeight() * (this._chainSkills.length + 1);
|
||||
this.contents.gradientFillRect(0, 0, this.contents.width, dh, 'rgba(0, 0, 0, 192)', 'rgba(0, 0, 0, 0)');
|
||||
this.contents.paintOpacity = 78;
|
||||
this.contents.fillRect(0, this.lineHeight() - 4, this.contents.width, 2, this.normalColor());
|
||||
this.contents.paintOpacity = 255;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Chain Skills
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.drawChainSkillTitle = function() {
|
||||
// Reset Font Settings
|
||||
this.resetFontSettings();
|
||||
this.contents.fontSize = _TDS_.ActiveChainSkills.params.titleFontSize;
|
||||
this.contents.fontItalic = true;
|
||||
// Draw Title
|
||||
this.drawText(_TDS_.ActiveChainSkills.params.chainTitle, 12, 0, this.contents.width - 24);
|
||||
// Reset Font Settings
|
||||
this.resetFontSettings();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Chain Skills
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.drawChainSkills = function() {
|
||||
// Set Starting X & Y
|
||||
var sx = 24, sy = this.lineHeight();
|
||||
// If Skill has a chain skill list
|
||||
if (this._skill.meta.chainSkillList) {
|
||||
// Get Inputs
|
||||
var inputs = Object.keys(this._skill.meta.chainSkillList);
|
||||
// Go Through Inputs
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var input = inputs[i];
|
||||
var skill = $dataSkills[this._skill.meta.chainSkillList[input]];
|
||||
// If Skill has not been learned
|
||||
if (!this._battler.isLearnedSkill(skill.id)) { continue; }
|
||||
// Set Text
|
||||
var text = '';
|
||||
// Add Input Text Settings
|
||||
text = text + this.inputTextSettings(input, skill);
|
||||
// Add Format to Text
|
||||
text = text + '\\i[%1]%2'.format(skill.iconIndex, skill.name);
|
||||
// Draw Text
|
||||
this.drawTextEx(text, sx, sy);
|
||||
// Increase Starting Y
|
||||
sy += this.lineHeight();
|
||||
}
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Input Text Settings
|
||||
//=============================================================================
|
||||
Window_ChainSkillList.prototype.inputTextSettings = function(input, skill) {
|
||||
// Set Active Flag
|
||||
var active = (input === this._chainInput);
|
||||
// Initialize Text
|
||||
var text = '';
|
||||
// Get Input Data
|
||||
var inputData = _TDS_.ActiveChainSkills.params.inputData;
|
||||
// Get Input DAta
|
||||
if (inputData[input]) {
|
||||
// If Enabled and Battler can use skill
|
||||
if (this._enabled && this._battler.canUse(skill)) {
|
||||
// Set Text
|
||||
text = inputData[input].on;
|
||||
} else if (!this._enabled && active) {
|
||||
// Set Text
|
||||
text = inputData[input].act;
|
||||
} else {
|
||||
// Set Text
|
||||
text = inputData[input].off;
|
||||
}
|
||||
}
|
||||
// Return Text
|
||||
return text;
|
||||
};
|
||||
772
www/js/plugins/Aetherflow_PreloadEverything.js
Normal file
772
www/js/plugins/Aetherflow_PreloadEverything.js
Normal file
|
|
@ -0,0 +1,772 @@
|
|||
//=============================================================================
|
||||
// Aetherflow Plugins - Preload Everything
|
||||
// Aetherflow_PreloadEverything.js
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0.2 Preload All The Things. (IF YOU HAVE v1.6.1)
|
||||
* @author Kaliya
|
||||
*
|
||||
* @param ReleaseMapChange
|
||||
* @text Release On Map Change
|
||||
* @type boolean
|
||||
* @default true
|
||||
* @desc Release non-system/global preloaded assets from memory on map change?
|
||||
*
|
||||
* @param PreloadSystem
|
||||
* @text Preload System Resources
|
||||
* @type boolean
|
||||
* @default true
|
||||
* @desc Preload all system based assets on start?
|
||||
*
|
||||
* @param ImageCacheSize
|
||||
* @text Image Cache Size
|
||||
* @desc Size of the image cache in bytes.
|
||||
* @type text
|
||||
* @default 10 * 1000 * 1000
|
||||
*
|
||||
* @param AudioCacheSize
|
||||
* @text Audio Cache Size
|
||||
* @desc Size of the audio cache in bytes.
|
||||
* @type text
|
||||
* @default 20 * 1000 * 1000
|
||||
*
|
||||
* @param PreloadGlobal
|
||||
* @text Global Assets
|
||||
* @type struct<PreloadContainer>
|
||||
* @desc Preloaded assets that are kept in memory on game start.
|
||||
*
|
||||
* @param PreloadMaps
|
||||
* @text Map Assets
|
||||
* @desc A list of Preload Containers used for map assets.
|
||||
* @type struct<PreloadMapContainer>[]
|
||||
*
|
||||
* @help
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Introduction
|
||||
* ---------------------------------------------------------------------------------
|
||||
* This plugin is designed to allieviate your "preloading" problems. Tired of not
|
||||
* having your sound play right away when you need it? Tired of some images not
|
||||
* appearing? Well look no further because those days are a thing of the past. Not
|
||||
* only does this plugin preload your thingys, but it also acts as a basic caching
|
||||
* system to help with the problem of memory being overused (if done right). It is
|
||||
* not a perfect solution, but it should help all games.
|
||||
*
|
||||
* NOTE: THIS PLUGIN REQUIRES RPG MAKER MV V1.6.1 IF YOU ARE NOT USING V1.6.1
|
||||
* THIS PLUGIN WILL NOT WORK AND WILL ERROR OUT. YOU HAVE BEEN WARNED.
|
||||
*
|
||||
* ---------------------------------------------------------------------------------
|
||||
* How-to
|
||||
* ---------------------------------------------------------------------------------
|
||||
* The system is fairly straightforward, it uses "containers" to preload and store
|
||||
* resources. These containers come in two flavors:
|
||||
*
|
||||
* GLOBAL: This is a singular container, it is used to store Global, or game wide assets
|
||||
* these assets are usually things you always want to be loaded. They are all loaded on
|
||||
* game start.
|
||||
*
|
||||
* MAP: These containers are what you use to preload map resources. These containers
|
||||
* are loaded when the map associated with them is entered. Depending on your plugin
|
||||
* parameters they will also be released from the cache when you enter a new map.
|
||||
*
|
||||
* In order to use the containers you simply modify and add to them via plugin parameters.
|
||||
*
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Caching & How It Works
|
||||
* ---------------------------------------------------------------------------------
|
||||
*
|
||||
* The caching system stores assets in memory until they are no longer needed and
|
||||
* are manually purged via the available functions, or by being deleted by the system
|
||||
* itself when a new resource is loaded and the cache is full.
|
||||
*
|
||||
* The cache size is determined by two plugin parameters:
|
||||
*
|
||||
* Image Cache Size: The size of the image cache in bytes.
|
||||
*
|
||||
* Audio Cache Size: The size of the audio cache in bytes.
|
||||
*
|
||||
* These two plugin parameters are evaluated and thus you can use math to determine
|
||||
* what the size rather than having to write out a large number. (e.g: 10 * 1000 * 1000 is a 10MB cache).
|
||||
*
|
||||
* You can use various functions in the cache classes to "Reserve" a resource. These
|
||||
* "reserved" resources will not be automatically purged, so be careful!
|
||||
*
|
||||
* When a resource is added to the cache, the cache is sorted by the time the resources were all
|
||||
* last touched and then if a resource is not reserved it is purged and will need to be reacquired
|
||||
* again when next used.
|
||||
*
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Containers
|
||||
* ---------------------------------------------------------------------------------
|
||||
* For those users who are more hands on, the caching system has a type of object
|
||||
* known as a "Container". Think of this as a group of objects, that can all be cached
|
||||
* together and then can all be purged together at the same time, for easy cleanup and
|
||||
* management. These are not the same as containers you setup in the plugin parameters.
|
||||
* These containers are only accessed and used via code.
|
||||
*
|
||||
* Various function exists to help with the ease and usage of containers. They are
|
||||
* all well documented throughout the plugin but a brief overview of them is as follows:
|
||||
*
|
||||
* ImageManager/AudioManager.addContainer("containerName"): Adds a container to the
|
||||
* specified resource cache for that type.
|
||||
*
|
||||
* ImageManager/AudioManager.addContainerItem("containerName", "itemKey"): Adds an item
|
||||
* to the container. NOTE: It only adds a key to look up the item in the cache for purging,
|
||||
* it does not preload or load an item for you, you will need to do that prior to adding it
|
||||
* to a container.
|
||||
*
|
||||
* ImageManager/AudioManager.releaseContainer("containerName"): Releases all objects
|
||||
* within the specified container from the cache.
|
||||
*
|
||||
* ImageManager/AudioManager.releaseContainerItem("containerName", "itemKey"): Releases
|
||||
* the specified item from the specified container if it exists, freeing it from the
|
||||
* cache.
|
||||
*
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Credits
|
||||
* ---------------------------------------------------------------------------------
|
||||
* This plugin is developed and maintained by Liquidize/Kaliya.
|
||||
* Some code was ninja'ed with permission from Pivoo (http://pivoo.me)
|
||||
*
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Changelog
|
||||
* ---------------------------------------------------------------------------------
|
||||
*
|
||||
* 1.0.2:
|
||||
* - Fixed a bug wherein due to slight changes in handling paths, Map based container for images were not being loaded.
|
||||
*
|
||||
* 1.0.1:
|
||||
* - Fixed a bug wherein due to a slight change before release, the path for audio files
|
||||
* would be incorrect.
|
||||
*
|
||||
* 1.0.0:
|
||||
* - Released!
|
||||
*
|
||||
*/
|
||||
/*~struct~PreloadContainer:
|
||||
@param Images
|
||||
@type file[]
|
||||
@dir images/
|
||||
@desc A list of images you want to preload for this container.
|
||||
|
||||
@param Audio
|
||||
@type file[]
|
||||
@dir audio/
|
||||
@desc A list of audio files you want to preload for this container.
|
||||
*/
|
||||
/*~struct~PreloadMapContainer:
|
||||
@param MapId
|
||||
@text Map ID
|
||||
@type number
|
||||
@desc The id the of map for this container.
|
||||
@min 0
|
||||
@max 999
|
||||
@default 0
|
||||
|
||||
@param Images
|
||||
@type file[]
|
||||
@dir images/
|
||||
@desc A list of images you want to preload for this container.
|
||||
|
||||
@param Audio
|
||||
@type file[]
|
||||
@dir audio/
|
||||
@desc A list of audio files you want to preload for this container.
|
||||
*/
|
||||
|
||||
//=============================================================================
|
||||
// PluginManager
|
||||
//
|
||||
// NOTE: The parameter parsing functions were originally written by Pivoo (http://pivoo.me)
|
||||
// he has kindly given me permission to include and modify them but all credit should
|
||||
// go to him.
|
||||
//=============================================================================
|
||||
|
||||
PluginManager.parseObject = function (obj) {
|
||||
var output = new Object();
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var param = obj[key];
|
||||
output[key] = this.parse(param, key);
|
||||
}, this);
|
||||
return output;
|
||||
};
|
||||
|
||||
PluginManager.parseArray = function (arr, key) {
|
||||
return arr.map(function (param, index) {
|
||||
return this.parse(param, key + '[' + index + ']');
|
||||
}, this);
|
||||
};
|
||||
|
||||
PluginManager.parse = function (param, key) {
|
||||
if (!isNaN(param) && param.contains('.')) {
|
||||
return parseFloat(param);
|
||||
} else {
|
||||
try {
|
||||
param = JSON.parse(param);
|
||||
switch (param.constructor.name) {
|
||||
case 'Object': return this.parseObject(param);
|
||||
case 'Array': return this.parseArray(param, key);
|
||||
default: return param;
|
||||
}
|
||||
} catch (err) {
|
||||
return param;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Configuration
|
||||
//=============================================================================
|
||||
|
||||
var Aetherflow = Aetherflow || {};
|
||||
Aetherflow.Preload = Aetherflow.Preload || {};
|
||||
|
||||
Aetherflow.Parameters = PluginManager.parameters('Aetherflow_PreloadEverything');
|
||||
Aetherflow.Param = Aetherflow.Param || {};
|
||||
|
||||
Aetherflow.Param["ReleaseMapChange"] = Boolean(Aetherflow.Parameters["ReleaseMapChange"]);
|
||||
Aetherflow.Param["PreloadSystem"] = eval(Aetherflow.Parameters["PreloadSystem"]);
|
||||
Aetherflow.Param["PreloadConnections"] = Boolean(Aetherflow.Parameters["PreloadConnections"]);
|
||||
Aetherflow.Param["GlobalContainer"] = Aetherflow.Parameters["PreloadGlobal"].length > 0 ? JSON.parse(Aetherflow.Parameters["PreloadGlobal"]) : {};
|
||||
Aetherflow.Param["MapContainers"] = Aetherflow.Parameters["PreloadMaps"].length > 0 ? JSON.parse(Aetherflow.Parameters["PreloadMaps"]) : {};
|
||||
Aetherflow.Param["ImageCacheSize"] = Number(eval(Aetherflow.Parameters["ImageCacheSize"])) || 10 * 1000 * 1000;
|
||||
Aetherflow.Param["AudioCacheSize"] = Number(eval(Aetherflow.Parameters["AudioCacheSize"])) || 20 * 1000 * 1000;
|
||||
|
||||
// Parse the actual data into the Preload Object for referencing easier.
|
||||
Aetherflow.Preload.GlobalContainer = PluginManager.parseObject(Aetherflow.Param.GlobalContainer);
|
||||
Aetherflow.Preload.MapContainers = Object.values(PluginManager.parseObject(Aetherflow.Param.MapContainers));
|
||||
|
||||
//=============================================================================
|
||||
// End Configuration
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Game_System
|
||||
//=============================================================================
|
||||
|
||||
Game_System.prototype.releaseGlobalContainer = function () {
|
||||
ImageManager.releaseGlobalContainer();
|
||||
AudioManager.releaseGlobalContainer();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// WebAudio
|
||||
//=============================================================================
|
||||
|
||||
WebAudio.prototype.bufferSize = function () {
|
||||
return this._buffer ? this._buffer.length : null;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ImageCache
|
||||
//=============================================================================
|
||||
|
||||
Aetherflow.Preload.ImageCache_initialize = ImageCache.prototype.initialize;
|
||||
ImageCache.prototype.initialize = function () {
|
||||
this._containers = {};
|
||||
Aetherflow.Preload.ImageCache_initialize.call(this);
|
||||
};
|
||||
|
||||
ImageCache.prototype.releaseItem = function (key) {
|
||||
if (this._items[key]) {
|
||||
delete this._items[key];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
ImageCache.prototype.addContainer = function (container) {
|
||||
this._containers = this._containers || {};
|
||||
if (!this._containers[container]) {
|
||||
this._containers[container] = [];
|
||||
}
|
||||
};
|
||||
|
||||
ImageCache.prototype.addContainerItem = function (container, itemKey) {
|
||||
if (this._containers[container]) {
|
||||
this._containers[container].push(itemKey);
|
||||
}
|
||||
};
|
||||
|
||||
ImageCache.prototype.releaseContainer = function (container) {
|
||||
if (!this._containers) this._containers = {};
|
||||
if (!this._containers[container]) return false;
|
||||
for (let key of this._containers[container]) {
|
||||
this.releaseItem(key);
|
||||
}
|
||||
delete this._containers[container];
|
||||
return true;
|
||||
};
|
||||
|
||||
ImageCache.prototype.releaseContainerItem = function (container, itemKey) {
|
||||
if (!this._container) this._containers = {};
|
||||
if (!this._containers[container]) return false;
|
||||
let index = this._containers[container].indexOf(itemKey);
|
||||
if (index >= 0) {
|
||||
this._containers[container].splice(index, 1);
|
||||
return this.releaseItem(itemKey);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ImageManager
|
||||
//=============================================================================
|
||||
|
||||
ImageManager.addContainer = function (container) {
|
||||
return this._imageCache.addContainer(container);
|
||||
};
|
||||
|
||||
ImageManager.addContainerItem = function (container, key) {
|
||||
return this._imageCache.addContainerItem(container, key);
|
||||
};
|
||||
|
||||
ImageManager.releaseItem = function (img, hue) {
|
||||
let key = this._generateCacheKey(img, hue);
|
||||
return this._imageCache.releaseItem(key);
|
||||
};
|
||||
|
||||
ImageManager.releaseContainer = function (container) {
|
||||
return this._imageCache.releaseContainer(container);
|
||||
};
|
||||
|
||||
ImageManager.releaseContainerItem = function (container, img, hue) {
|
||||
let key = this._generateCacheKey(img, hue);
|
||||
return this._imageCache.releaseContainerItem(container, key);
|
||||
};
|
||||
|
||||
ImageManager.releaseGlobalContainer = function () {
|
||||
return this.releaseContainer("global");
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// AudioCache
|
||||
//=============================================================================
|
||||
|
||||
function AudioCache() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
AudioCache.maxSize = Aetherflow.Param["AudioCacheSize"];
|
||||
|
||||
AudioCache.prototype.initialize = function () {
|
||||
this._items = {};
|
||||
this._containers = {};
|
||||
};
|
||||
|
||||
AudioCache.prototype.add = function (key, value) {
|
||||
this._items[key] = {
|
||||
buffer: value,
|
||||
touch: Date.now(),
|
||||
key: key
|
||||
};
|
||||
this.truncateCache();
|
||||
};
|
||||
|
||||
AudioCache.prototype.get = function (key) {
|
||||
if (this._items[key]) {
|
||||
let item = this._items[key];
|
||||
item.touch = Date.now();
|
||||
return item.buffer;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
AudioCache.prototype.releaseItem = function (key) {
|
||||
if (this._items[key]) {
|
||||
delete this._items[key];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
AudioCache.prototype.addContainer = function (container) {
|
||||
this._containers = this._containers || {};
|
||||
if (!this._containers[container]) {
|
||||
this._containers[container] = [];
|
||||
}
|
||||
};
|
||||
|
||||
AudioCache.prototype.addContainerItem = function (container, itemKey) {
|
||||
if (this._containers[container]) {
|
||||
this._containers[container].push(itemKey);
|
||||
}
|
||||
};
|
||||
|
||||
AudioCache.prototype.releaseContainer = function (container) {
|
||||
if (!this._containers) this._containers = {};
|
||||
if (!this._container[container]) return false;
|
||||
for (let key of this._containers[container]) {
|
||||
this.releaseItem(key);
|
||||
}
|
||||
delete this._containers[container];
|
||||
return true;
|
||||
};
|
||||
|
||||
AudioCache.prototype.releaseContainerItem = function (container, itemKey) {
|
||||
if (!this._containers) this._containers = {};
|
||||
if (!this._containers[container]) return false;
|
||||
let index = this._containers[container].indexOf(itemKey);
|
||||
if (index >= 0) {
|
||||
this._containers[container].splice(index, 1);
|
||||
return this.releaseItem(itemKey);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
AudioCache.prototype.reserve = function (key, value, reservationId) {
|
||||
if (!this._items[key]) {
|
||||
this._items[key] = {
|
||||
buffer: value,
|
||||
touch: Date.now(),
|
||||
key: key
|
||||
};
|
||||
}
|
||||
this._items[key].reservationId = reservationId;
|
||||
};
|
||||
|
||||
AudioCache.prototype.releaseReservation = function (reservationId) {
|
||||
let items = this._items;
|
||||
let release = false;
|
||||
Object.keys(items).map(function (key) {
|
||||
return items[key];
|
||||
}).forEach(function (item) {
|
||||
if (item.reservationId === reservationId)
|
||||
release = true;
|
||||
delete item.reservationId;
|
||||
});
|
||||
return release;
|
||||
};
|
||||
|
||||
AudioCache.prototype.truncateCache = function () {
|
||||
let items = this._items;
|
||||
let sizeLeft = AudioCache.maxSize;
|
||||
Object.keys(items).map(function (key) {
|
||||
return items[key];
|
||||
}).sort(function (a, b) {
|
||||
return b.touch - a.touch;
|
||||
}).forEach(function (item) {
|
||||
if (sizeLeft > 0 || this.mustBeHeld(item)) {
|
||||
sizeLeft -= item.buffer.bufferSize() ? item.buffer.bufferSize() : 0; // If buffer isn't available than it isn't loaded.
|
||||
} else {
|
||||
delete items[item.key];
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
AudioCache.prototype.mustBeHeld = function (item) {
|
||||
if (item.reservationId) return true;
|
||||
if (!item.buffer.isReady()) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
AudioCache.prototype.isReady = function () {
|
||||
let items = this._items;
|
||||
return !Object.keys(items).some(function (key) {
|
||||
return !items[key].buffer.isReady();
|
||||
});
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// AudioManager
|
||||
//=============================================================================
|
||||
|
||||
AudioManager._cache = new AudioCache();
|
||||
AudioManager._systemReservationId = Utils.generateRuntimeId();
|
||||
AudioManager._defaultReservationId = "default";
|
||||
window._aufs = require("fs");
|
||||
|
||||
AudioManager._generateCacheKey = function (path) {
|
||||
return path;
|
||||
};
|
||||
|
||||
AudioManager.clear = function () {
|
||||
this._cache = new AudioCache();
|
||||
};
|
||||
|
||||
AudioManager.isReady = function () {
|
||||
return this._cache.isReady();
|
||||
};
|
||||
|
||||
AudioManager.setDefaultReservationid = function (reservationId) {
|
||||
this._defaultReservationId = reservationId;
|
||||
};
|
||||
|
||||
AudioManager.addContainer = function (container) {
|
||||
return this._cache.addContainer(container);
|
||||
};
|
||||
|
||||
AudioManager.addContainerItem = function (container, itemKey) {
|
||||
return this._cache.addContainerItem(container, itemKey);
|
||||
};
|
||||
|
||||
AudioManager.loadBgm = function (filename) {
|
||||
let path = this._path + "bgm/" + encodeURIComponent(filename) + this.audioFileExt();
|
||||
return this.loadAudio(path);
|
||||
};
|
||||
|
||||
AudioManager.loadBgs = function (filename) {
|
||||
let path = this._path + "bgs/" + encodeURIComponent(filename) + this.audioFileExt();
|
||||
return this.loadAudio(path);
|
||||
};
|
||||
|
||||
AudioManager.loadSe = function (filename) {
|
||||
let path = this._path + "se/" + encodeURIComponent(filename) + this.audioFileExt();
|
||||
return this.loadAudio(path);
|
||||
};
|
||||
|
||||
AudioManager.loadMe = function (filename) {
|
||||
let path = this._path + "me/" + encodeURIComponent(filename) + this.audioFileExt();
|
||||
return this.loadAudio(path);
|
||||
};
|
||||
|
||||
AudioManager.loadAudio = function (path) {
|
||||
path = _aufs.cachedAlternativeName(path);
|
||||
let key = this._generateCacheKey(path);
|
||||
let buffer = this._cache.get(key);
|
||||
if (!buffer) {
|
||||
buffer = new WebAudio(path);
|
||||
this._cache.add(key, buffer);
|
||||
}
|
||||
return buffer;
|
||||
};
|
||||
|
||||
AudioManager.reserveBgm = function (filename, reservationId) {
|
||||
return this.reserveAudio("bgm/", filename, reservationId);
|
||||
};
|
||||
|
||||
AudioManager.reserveBgs = function (filename, reservationId) {
|
||||
return this.reserveAudio("bgs/", filename, reservationId);
|
||||
};
|
||||
|
||||
AudioManager.reserveSe = function (filename, reservationId) {
|
||||
return this.reserveAudio("se/", filename, reservationId);
|
||||
};
|
||||
|
||||
AudioManager.reserveMe = function (filename, reservationId) {
|
||||
return this.reserveAudio("me/", filename, reservationId);
|
||||
};
|
||||
|
||||
AudioManager.reserveAudio = function (folder, filename, reservationId) {
|
||||
if (filename) {
|
||||
let path = _aufs.cachedAlternativeName(this._path + folder + encodeURIComponent(filename) + this.audioFileExt());
|
||||
let buffer = new WebAudio(path);
|
||||
this._cache.reserve(this._generateCacheKey(path), buffer, reservationId || this._defaultReservationId);
|
||||
return buffer;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
AudioManager.releaseItem = function (key) {
|
||||
return this._cache.releaseItem(key);
|
||||
};
|
||||
|
||||
AudioManager.releaseContainer = function (container) {
|
||||
return this._cache.releaseContainer(container);
|
||||
};
|
||||
|
||||
AudioManager.releaseContainerItem = function (container, key) {
|
||||
return this._cache.releaseContainerItem(container, key);
|
||||
};
|
||||
|
||||
AudioManager.releaseReservation = function (reservationId) {
|
||||
return this._cache.releaseReservation(reservationId);
|
||||
};
|
||||
|
||||
AudioManager.releaseGlobalContainer = function () {
|
||||
return this.releaseContainer("global");
|
||||
};
|
||||
|
||||
AudioManager.playBgm = function (bgm, pos) {
|
||||
if (this.isCurrentBgm(bgm)) {
|
||||
this.updateBgmParameters(bgm);
|
||||
} else {
|
||||
this.stopBgm();
|
||||
if (bgm.name) {
|
||||
if (Decrypter.hasEncryptedAudio && this.shouldUseHtml5Audio()) {
|
||||
this.playEncryptedBgm(bgm, pos);
|
||||
}
|
||||
else {
|
||||
this._bgmBuffer = this.loadBgm(bgm.name);
|
||||
this.updateBgmParameters(bgm);
|
||||
if (!this._meBuffer) {
|
||||
this._bgmBuffer.play(true, pos || 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateCurrentBgm(bgm, pos);
|
||||
};
|
||||
|
||||
AudioManager.playBgs = function (bgs, pos) {
|
||||
if (this.isCurrentBgs(bgs)) {
|
||||
this.updateBgsParameters(bgs);
|
||||
} else {
|
||||
this.stopBgs();
|
||||
if (bgs.name) {
|
||||
this._bgsBuffer = this.loadBgs(bgs.name);
|
||||
this.updateBgsParameters(bgs);
|
||||
this._bgsBuffer.play(true, pos || 0);
|
||||
}
|
||||
}
|
||||
this.updateCurrentBgs(bgs, pos);
|
||||
};
|
||||
|
||||
AudioManager.playSe = function (se) {
|
||||
if (se.name) {
|
||||
this._seBuffers = this._seBuffers.filter(function (audio) {
|
||||
return audio.isPlaying();
|
||||
});
|
||||
let buffer = this.loadSe(se.name);
|
||||
this.updateSeParameters(buffer, se);
|
||||
buffer.play(false);
|
||||
this._seBuffers.push(buffer);
|
||||
}
|
||||
};
|
||||
|
||||
AudioManager.playMe = function (me) {
|
||||
this.stopMe();
|
||||
if (me.name) {
|
||||
if (this._bgmBuffer && this._currentBgm) {
|
||||
this._currentBgm.pos = this._bgmBuffer.seek();
|
||||
this._bgmBuffer.stop();
|
||||
}
|
||||
this._meBuffer = this.loadMe(me.name);
|
||||
this.updateMeParameters(me);
|
||||
this._meBuffer.play(false);
|
||||
this._meBuffer.addStopListener(this.stopMe.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// DataManager
|
||||
//=============================================================================
|
||||
|
||||
Aetherflow.Preload.DataManager_onLoad = DataManager.onLoad;
|
||||
DataManager.onLoad = function (object) {
|
||||
Aetherflow.Preload.DataManager_onLoad.call(this, object);
|
||||
if (object === $dataSystem) {
|
||||
Scene_Boot.loadSystemAudio();
|
||||
Scene_Boot.loadGlobalContainer();
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Scene_Base
|
||||
//=============================================================================
|
||||
|
||||
Aetherflow.Preload.Scene_Base_isReady = Scene_Base.prototype.isReady;
|
||||
Scene_Base.prototype.isReady = function () {
|
||||
return Aetherflow.Preload.Scene_Base_isReady.call(this) && AudioManager.isReady();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Scene_Boot
|
||||
//=============================================================================
|
||||
|
||||
Scene_Boot.loadSystemAudio = function () {
|
||||
if (Aetherflow.Param.PreloadSystem === true) {
|
||||
AudioManager.reserveBgm($dataSystem.airship.bgm.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveBgm($dataSystem.battleBgm.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveBgm($dataSystem.boat.bgm.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveBgm($dataSystem.ship.bgm.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveBgm($dataSystem.titleBgm.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveMe($dataSystem.gameoverMe.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveMe($dataSystem.defeatMe.name, AudioManager._systemReservationId);
|
||||
AudioManager.reserveMe($dataSystem.victoryMe.name, AudioManager._systemReservationId);
|
||||
|
||||
$dataSystem.sounds.forEach(function (sound) {
|
||||
AudioManager.reserveSe(sound.name, AudioManager._systemReservationId);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Boot.loadGlobalContainer = function () {
|
||||
if (Aetherflow.Preload.GlobalContainer) {
|
||||
ImageManager.addContainer("global");
|
||||
AudioManager.addContainer("global");
|
||||
let images = Aetherflow.Preload.GlobalContainer.Images;
|
||||
if (images) {
|
||||
for (let image of images) {
|
||||
let folder = image.split('/')[0] + "/";
|
||||
let file = image.split('/')[1];
|
||||
let path = "img/" + folder;
|
||||
ImageManager.reserveBitmap(path, file, 0, true);
|
||||
ImageManager.addContainerItem("global", ImageManager._generateCacheKey(path, 0));
|
||||
}
|
||||
}
|
||||
let sounds = Aetherflow.Preload.GlobalContainer.Audio;
|
||||
if (sounds) {
|
||||
for (let sound of sounds) {
|
||||
let folder = sound.split('/')[0] + "/";
|
||||
let file = sound.split('/')[1];
|
||||
let path = require("fs").cachedAlternativeName("audio/" + folder + encodeURIComponent(file) + AudioManager.audioFileExt());
|
||||
AudioManager.reserveAudio(folder, file);
|
||||
AudioManager.addContainerItem("global", AudioManager._generateCacheKey(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Scene_Map
|
||||
//=============================================================================
|
||||
|
||||
Scene_Map.prototype.releaseAssets = function () {
|
||||
let container = Aetherflow.Preload.MapContainers.find(function (element) {
|
||||
return element.MapId === $gameMap.mapId();
|
||||
});
|
||||
if (container) {
|
||||
if (container.Images && container.Images.length > 0) {
|
||||
let images = container.Images;
|
||||
for (let image of images) {
|
||||
let folder = image.split('/')[0];
|
||||
let file = image.split('/')[1];
|
||||
let path = "img/" + folder + "/" + encodeURIComponent(file) + ".png";
|
||||
ImageManager.releaseItem(path, 0);
|
||||
}
|
||||
}
|
||||
if (container.Audio && container.Audio.length > 0) {
|
||||
let sounds = container.Audio;
|
||||
for (let sound of sounds) {
|
||||
let folder = sound.split('/')[0];
|
||||
let file = sound.split('/')[1];
|
||||
AudioManager.releaseItem(require("fs").cachedAlternativeName("audio/" + folder + "/" + encodeURIComponent(file) + AudioManager.audioFileExt()));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Map.prototype.preloadAssets = function () {
|
||||
let container = Aetherflow.Preload.MapContainers.find(function (element) {
|
||||
return element.MapId === $gameMap.mapId();
|
||||
});
|
||||
if (container) {
|
||||
let images = container.Images;
|
||||
if (images) {
|
||||
for (let image of images) {
|
||||
let folder = image.split('/')[0] + "/";
|
||||
let file = image.split('/')[1];
|
||||
let path = "img/" + folder + encodeURIComponent(file) + ".png";
|
||||
ImageManager.reserveNormalBitmap(path, 0, ImageManager._defaultReservationId);
|
||||
}
|
||||
}
|
||||
let sounds = container.Audio;
|
||||
if (sounds) {
|
||||
for (let sound of sounds) {
|
||||
let folder = sound.split('/')[0] + "/";
|
||||
let file = sound.split('/')[1];
|
||||
AudioManager.reserveAudio(folder, file, AudioManager._defaultReservationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Aetherflow.Preload.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
|
||||
Scene_Map.prototype.onMapLoaded = function () {
|
||||
this.releaseAssets();
|
||||
Aetherflow.Preload.Scene_Map_onMapLoaded.call(this);
|
||||
this.preloadAssets();
|
||||
};
|
||||
35
www/js/plugins/Anti Fail Actions.js
Normal file
35
www/js/plugins/Anti Fail Actions.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
//=============================================================================
|
||||
// TDS Anti Fail Actions
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Prevents failure messages from appearing in certain actions.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Action Note Tags:
|
||||
*
|
||||
* <AntiFail>
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
//==============================================================================================
|
||||
// ** Game_Action
|
||||
//==============================================================================================
|
||||
// Alias Listing
|
||||
var tds_AntiFailActions_Game_Action_applyItemUserEffect = Game_Action.prototype.applyItemUserEffect;
|
||||
//==============================================================================================
|
||||
// * Apply Item User Effect
|
||||
//==============================================================================================
|
||||
Game_Action.prototype.applyItemUserEffect = function(target) {
|
||||
// Run Original Method
|
||||
tds_AntiFailActions_Game_Action_applyItemUserEffect.call(this, target);
|
||||
// If Anti Fail make success
|
||||
if (this.item().meta.AntiFail) { this.makeSuccess(target) }
|
||||
};
|
||||
|
||||
})();
|
||||
250
www/js/plugins/Archeia_CoreChanges.js
Normal file
250
www/js/plugins/Archeia_CoreChanges.js
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
//=============================================================================
|
||||
// Archeia Core Changes
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc <Archeia_CoreChanges>
|
||||
* This plugin modifies the core script and adds new things.
|
||||
*
|
||||
* @author AEL
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Nothing needs to be done.
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Archeia_CoreChanges = true;
|
||||
|
||||
//=============================================================================
|
||||
// ** Parameter Check
|
||||
//=============================================================================
|
||||
var parameters = $plugins.filter(function(p) {
|
||||
return p.description.contains('<Archeia_CoreChanges>') })[0].parameters;
|
||||
|
||||
//=============================================================================
|
||||
// ** Set Parameters
|
||||
//=============================================================================
|
||||
var AEL = AEL || {};
|
||||
AEL.Archeia_CoreChanges = AEL.Archeia_CoreChanges || {};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Fix Pixi FPS
|
||||
//-----------------------------------------------------------------------------
|
||||
/*(function(){
|
||||
const oldFPSMeter = FPSMeter;
|
||||
FPSMeter = function(){
|
||||
oldFPSMeter.apply(this);
|
||||
const FPSMeter_pause = this.pause;
|
||||
this.pause = function(){
|
||||
FPSMeter_pause.apply(this);
|
||||
//sadly, we can't get frameId because of the fpsmeter.js is minified
|
||||
//so, restart ticker in all case.
|
||||
PIXI.ticker.shared._requestId = null;
|
||||
PIXI.ticker.shared._requestIfNeeded();
|
||||
}
|
||||
}
|
||||
})();*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Pixi Texture Fix
|
||||
//-----------------------------------------------------------------------------
|
||||
PIXI.GLTexture.prototype.upload = function(source)
|
||||
{
|
||||
this.bind();
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
|
||||
|
||||
var isVideo = !!source.videoWidth;
|
||||
var newWidth = isVideo ? source.videoWidth : source.width;
|
||||
var newHeight = isVideo ? source.videoHeight : source.height;
|
||||
|
||||
if(newHeight !== this.height || newWidth !== this.width || isVideo)
|
||||
{
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);
|
||||
}
|
||||
|
||||
this.width = newWidth;
|
||||
this.height = newHeight;
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Remove smoothing from graphics
|
||||
//-----------------------------------------------------------------------------
|
||||
Graphics._centerElement = function(element) {
|
||||
var width = element.width * this._realScale;
|
||||
var height = element.height * this._realScale;
|
||||
element.style.position = 'absolute';
|
||||
element.style.margin = 'auto';
|
||||
element.style.top = 0;
|
||||
element.style.left = 0;
|
||||
element.style.right = 0;
|
||||
element.style.bottom = 0;
|
||||
element.style.width = width + 'px';
|
||||
element.style.height = height + 'px';
|
||||
element.style["image-rendering"] = "pixelated";
|
||||
element.style["font-smooth"] = "none";
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Change Balloon Image based on Variable
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Sprite_Balloon.prototype.loadBitmap = function() {
|
||||
this.bitmap = ImageManager.loadSystem($gameVariables.value(25));
|
||||
this.setFrame(0, 0, 0, 0);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Change Size for Balloon Icons to follow RMVXA Standards
|
||||
//-----------------------------------------------------------------------------
|
||||
Sprite_Balloon.prototype.updateFrame = function() {
|
||||
var w = 32;
|
||||
var h = 24;
|
||||
var sx = this.frameIndex() * w;
|
||||
var sy = (this._balloonId - 1) * h;
|
||||
this.setFrame(sx, sy, w, h);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Disable Window Frame Stretching
|
||||
//-----------------------------------------------------------------------------
|
||||
(function() {
|
||||
|
||||
Window.prototype._refreshFrame = function() {
|
||||
var w = this._width;
|
||||
var h = this._height;
|
||||
var m = 24;
|
||||
var bitmap = new Bitmap(w, h);
|
||||
|
||||
this._windowFrameSprite.bitmap = bitmap;
|
||||
this._windowFrameSprite.setFrame(0, 0, w, h);
|
||||
|
||||
if (w > 0 && h > 0 && this._windowskin) {
|
||||
var skin = this._windowskin;
|
||||
var p = 96;
|
||||
var q = 96;
|
||||
|
||||
//Creates easy references for original/new width and height
|
||||
var oWid = p-m*2;
|
||||
var nWid = w-m*2;
|
||||
var oHei = p-m*2;
|
||||
var nHei = h-m*2;
|
||||
|
||||
//Divides to find how many complete repeats for horizontal and vertical
|
||||
var hRep = Math.floor(nWid / oWid);
|
||||
var vRep = Math.floor(nHei / oHei);
|
||||
|
||||
//Finds remainders for the "fraction" remaining
|
||||
var hRem = nWid % oWid;
|
||||
var vRem = nHei % oHei;
|
||||
|
||||
|
||||
//Top Side
|
||||
for(var i = 0; i < hRep; i++) {
|
||||
bitmap.blt(skin, p+m, 0, oWid, m, m + (i*oWid), 0, oWid, m);
|
||||
}
|
||||
bitmap.blt(skin, p+m, 0, hRem, m, m + (oWid*hRep), 0, hRem, m);
|
||||
//Bottom Side
|
||||
for(var i = 0; i < hRep; i++) {
|
||||
bitmap.blt(skin, p+m, q-m, oWid, m, m + (i*oWid), h-m, oWid, m);
|
||||
}
|
||||
bitmap.blt(skin, p+m, q-m, hRem, m, m + (oWid*hRep), h-m, hRem, m);
|
||||
//Left Side
|
||||
for(var i = 0; i < vRep; i++) {
|
||||
bitmap.blt(skin, p, m, m, oHei, 0, m + (i*oHei), m, oHei);
|
||||
}
|
||||
bitmap.blt(skin, p, m, m, vRem, 0, m + (vRep*oHei), m, vRem);
|
||||
//Right Side
|
||||
for(var i = 0; i < vRep; i++) {
|
||||
bitmap.blt(skin, p+q-m, m, m, oHei, w-m, m + (i*oHei), m, oHei);
|
||||
}
|
||||
bitmap.blt(skin, p+q-m, m, m, vRem, w-m, m + (vRep*oHei), m, vRem);
|
||||
|
||||
//Top-Left Corner
|
||||
bitmap.blt(skin, p+0, 0+0, m, m, 0, 0, m, m);
|
||||
//Top-Right Corner
|
||||
bitmap.blt(skin, p+q-m, 0+0, m, m, w-m, 0, m, m);
|
||||
//Bottom-Left Corner
|
||||
bitmap.blt(skin, p+0, 0+q-m, m, m, 0, h-m, m, m);
|
||||
//Bottom-Right Corner
|
||||
bitmap.blt(skin, p+q-m, 0+q-m, m, m, w-m, h-m, m, m);
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
// //-----------------------------------------------------------------------------
|
||||
// // * Adjust Player Walk Speed
|
||||
// //-----------------------------------------------------------------------------
|
||||
// Game_CharacterBase.prototype.realMoveSpeed = function() {
|
||||
// if (this.isDashing()) {
|
||||
// return Math.min(4, this._moveSpeed + 1);
|
||||
// } else {
|
||||
// return Math.max(3, this._moveSpeed - 1);
|
||||
// }
|
||||
// };
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Region Randomize
|
||||
//-----------------------------------------------------------------------------
|
||||
// Script Call:
|
||||
// $gameMap.randomPos(eventId, regionId);
|
||||
//-----------------------------------------------------------------------------
|
||||
Game_Map.prototype.randomPos = function(eventId, regionId) {
|
||||
var coords = [];
|
||||
|
||||
for (var x = 0; x < $dataMap.width; x++) {
|
||||
for (var y = 0; y < $dataMap.height; y++) {
|
||||
var region = this.regionId(x, y);
|
||||
if (region == regionId) {
|
||||
coords.push([x, y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (coords.length === 0) return;
|
||||
var idx = Math.randomInt(coords.length);
|
||||
var randomCoord = coords[idx];
|
||||
|
||||
var event = this._events[eventId];
|
||||
event.setPosition(randomCoord[0], randomCoord[1]);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Disable Galv Camera
|
||||
//-----------------------------------------------------------------------------
|
||||
var temp_DataManager_createGameObjects = DataManager.createGameObjects;
|
||||
DataManager.createGameObjects = function() {
|
||||
temp_DataManager_createGameObjects.call(this);
|
||||
$gameSwitches.setValue(5008, true);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Remove Weather Dimming
|
||||
//-----------------------------------------------------------------------------
|
||||
var archeia_createDimmer = Weather.prototype._createDimmer;
|
||||
Weather.prototype._createDimmer = function() {
|
||||
archeia_createDimmer.call(this);
|
||||
this._dimmerSprite.setColor(255, 255, 255);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// * Change Follower Graphic to either Idle/Walk/Run
|
||||
//-----------------------------------------------------------------------------
|
||||
// var archeia_Game_Player_isDashing = Game_Player.prototype.isDashing;
|
||||
// Game_Player.prototype.isDashing = function() {
|
||||
// archeia_Game_Player_isDashing.call(this);
|
||||
// if $gameSwitches(18) === true {
|
||||
|
||||
// }
|
||||
// };
|
||||
250
www/js/plugins/Archeia_MessageCodes.js
Normal file
250
www/js/plugins/Archeia_MessageCodes.js
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
/*=============================================================================
|
||||
* Archeia - Message Codes
|
||||
* By Liquidize - htp://anima.mintkit.lol
|
||||
* Archeia_MessageCodes.js
|
||||
* Version: 1.02
|
||||
*
|
||||
* This plugin was created by Liquidize for use by Archeia and their team(s),
|
||||
* I do not request credit in any form, You are licensed to use this plugin in
|
||||
* anyway you see fit, for any number of projects,games,websites,etc,etc.
|
||||
*
|
||||
*
|
||||
*=============================================================================*/
|
||||
/*:
|
||||
* @plugindesc Plugin Description <Archeia_MessageCodes>
|
||||
* @author Liquidize
|
||||
*
|
||||
* @param Variable Set Code
|
||||
* @desc The escape code used to set a variable.
|
||||
* @default Var
|
||||
*
|
||||
* @param Variable Add Code
|
||||
* @desc The escape code used to do the addition operation on a variable.
|
||||
* @default VarA
|
||||
*
|
||||
* @param Variable Sub Code
|
||||
* @desc The escape code used to do the subtraction operation on a variable.
|
||||
* @default VarS
|
||||
*
|
||||
* @param Variable Mul Code
|
||||
* @desc The escape code used to do the multiplication operation on a variable.
|
||||
* @default VarX
|
||||
*
|
||||
* @param Variable Div Code
|
||||
* @desc The escape code used to do the division operation on a variable.
|
||||
* @default VarD
|
||||
*
|
||||
* @param Variable Mod Code
|
||||
* @desc The escape code used do modulo on a variable.
|
||||
* @default VarM
|
||||
*
|
||||
* @param Common Event Code
|
||||
* @desc The escape code used to call a common event.
|
||||
* @default Com
|
||||
*
|
||||
*
|
||||
* @help
|
||||
* This plugin provides two additional escape codes for use in messages. The
|
||||
* first being an escape code to set the value of a variable, the second being
|
||||
* an escape code to call a common event.
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* To use the escape code to set a variable follow the below format:
|
||||
*
|
||||
* \ESCAPECODEHERE[VARIABLEID,VALUE]
|
||||
*
|
||||
* E.G: \V[10,10]
|
||||
*
|
||||
* The above example will set the variable with ID 10, to be the value of 10.
|
||||
* The V is used as the escape code, as thats what the default value is. You can
|
||||
* change this value by editing the Variable Code parameter.
|
||||
*
|
||||
*
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* To use the escape code to call a common event, use the following:
|
||||
*
|
||||
* \ESCAPECODEHERE[COMMONEVENTID]
|
||||
*
|
||||
* E.G: \C[1]
|
||||
*
|
||||
* The above example will call the common event with ID of 1. The escape code
|
||||
* used is C because that is the value of the default escape code, you can
|
||||
* change it in the parameters.
|
||||
*
|
||||
* ============================================================================
|
||||
* Change Log
|
||||
* ============================================================================
|
||||
*
|
||||
* Version 1.02:
|
||||
* - Refactored Code
|
||||
* - Added the ability to call events while in battle.
|
||||
* - Added the other operations when setting variables (albeit buggy).
|
||||
*
|
||||
* Version 1.01a:
|
||||
* - Another potential fix for things.
|
||||
*
|
||||
* Version 1.01:
|
||||
* - Fixed an issue causing incompatibility with YEP_MessageCore.
|
||||
* - Potential fix for instant common event execution.
|
||||
*
|
||||
* Version 1.0:
|
||||
* - Finished Script!
|
||||
*
|
||||
*=============================================================================*/
|
||||
|
||||
|
||||
var Imported = Imported || {};
|
||||
var Archeia = Archeia || {};
|
||||
Archeia.MessageCodes = Archeia.MessageCodes || {};
|
||||
Archeia.Utils = Archeia.Utils || {};
|
||||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
var parameters = $plugins.filter(function (plugin) {
|
||||
return plugin.description.contains('<Archeia_MessageCodes>');
|
||||
});
|
||||
if (parameters.length === 0) {
|
||||
throw new Error("Couldn't find the parameters of Archeia_MessageCodes.");
|
||||
}
|
||||
|
||||
$.Parameters = parameters[0].parameters;
|
||||
$.Param = {};
|
||||
$.Param.variableSetCode = String($.Parameters['Variable Set Code']);
|
||||
$.Param.variableAddCode = String($.Parameters['Variable Add Code']);
|
||||
$.Param.variableSubCode = String($.Parameters['Variable Sub Code']);
|
||||
$.Param.variableMulCode = String($.Parameters['Variable Mul Code']);
|
||||
$.Param.variableDivCode = String($.Parameters['Variable Div Code']);
|
||||
$.Param.variableModCode = String($.Parameters['Variable Mod Code']);
|
||||
$.Param.commonEventCode = String($.Parameters['Common Event Code']);
|
||||
|
||||
//================================================================================
|
||||
// Window_Base
|
||||
//================================================================================
|
||||
|
||||
Window_Base.prototype.obtainEscapeParamsArray = function (textState) {
|
||||
var arr = /^\[(\d+,\d+)]/.exec(textState.text.slice(textState.index));
|
||||
if (arr) {
|
||||
textState.index += arr[0].length;
|
||||
return arr[1].split(',');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
var Window_Message_processEscapeCharacter = Window_Message.prototype.processEscapeCharacter;
|
||||
Window_Message.prototype.processEscapeCharacter = function (code, textState) {
|
||||
if (code === $.Param.commonEventCode.toUpperCase()) {
|
||||
if ($gameParty && $gameParty.inBattle()) {
|
||||
$gameTroop.setupCommonEvent(parseInt(this.obtainEscapeParam(textState)));
|
||||
} else {
|
||||
$gameMap.setupCommonEvent(parseInt(this.obtainEscapeParam(textState)));
|
||||
}
|
||||
} else if (code === $.Param.variableSetCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),0);
|
||||
} else if (code === $.Param.variableAddCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),1);
|
||||
} else if (code === $.Param.variableSubCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),2);
|
||||
} else if (code === $.Param.variableMulCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),3);
|
||||
} else if (code === $.Param.variableDivCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),4);
|
||||
} else if (code === $.Param.variableModCode.toUpperCase()) {
|
||||
this.changeVariable(this.obtainEscapeParamsArray(textState),5);
|
||||
} else {
|
||||
Window_Message_processEscapeCharacter.call(this, code, textState);
|
||||
}
|
||||
};
|
||||
|
||||
Window_Message.prototype.changeVariable = function (data,operation) {
|
||||
if (data) {
|
||||
var varId = parseInt(data[0]);
|
||||
try {
|
||||
var oldVal = $gameVariables.value(varId);
|
||||
var val = parseInt(data[1]);
|
||||
|
||||
switch (operation) {
|
||||
case 0:
|
||||
$gameVariables.setValue(varId,oldVal = val);
|
||||
break;
|
||||
case 1:
|
||||
$gameVariables.setValue(varId,oldVal + val);
|
||||
break;
|
||||
case 2:
|
||||
$gameVariables.setValue(varId,oldVal - val);
|
||||
break;
|
||||
case 3:
|
||||
$gameVariables.setValue(varId,oldVal * val);
|
||||
break;
|
||||
case 4:
|
||||
$gameVariables.setValue(varId,oldVal / val);
|
||||
break;
|
||||
case 5:
|
||||
$gameVariables.setValue(varId,oldVal % val);
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
$gameVariables.setValue(varId,0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Game_Map
|
||||
//================================================================================
|
||||
|
||||
Game_Map.prototype.setupCommonEvent = function (commonId) {
|
||||
var commonEvent = $dataCommonEvents[commonId];
|
||||
if (commonEvent) {
|
||||
var eventId = this._interpreter.isOnCurrentMap() ? this._interpreter._eventId : 0;
|
||||
this._interpreter.setupChild(commonEvent.list, eventId);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Map.prototype.stopCurrentEvent = function () {
|
||||
if (this.isEventRunning()) {
|
||||
this._interpreter.terminate();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Game_Troop
|
||||
//================================================================================
|
||||
|
||||
|
||||
Game_Troop.prototype.setupCommonEvent = function(commonId) {
|
||||
var commonEvent = $dataCommonEvents[commonId];
|
||||
if (commonEvent) {
|
||||
var eventId = this._interpreter.isOnCurrentMap() ? this._interpreter._eventId : 0;
|
||||
this._interpreter.setupChild(commonEvent.list, eventId);
|
||||
}
|
||||
};
|
||||
|
||||
//================================================================================
|
||||
// UTILS
|
||||
//================================================================================
|
||||
|
||||
// The below is a string formatting function that gives me/js/people/anyone/stuff
|
||||
// the ability to use C#/C styled string formatting using {0},{1} for parameters.
|
||||
|
||||
Archeia.Utils.sformat = function () {
|
||||
var theString = arguments[0];
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var regEx = new RegExp("\\{" + (i - 1) + "\\}", "gm");
|
||||
theString = theString.replace(regEx, arguments[i]);
|
||||
}
|
||||
return theString;
|
||||
};
|
||||
|
||||
|
||||
})(Archeia.MessageCodes);
|
||||
|
||||
ArcheiaMessageCodes = Archeia.MessageCodes;
|
||||
Imported["Archeia_MessageCodes"] = 1.02;
|
||||
489
www/js/plugins/Aries001_AnimationScreenEffects.js
Normal file
489
www/js/plugins/Aries001_AnimationScreenEffects.js
Normal file
File diff suppressed because one or more lines are too long
697
www/js/plugins/Aries003_WeatherControl.js
Normal file
697
www/js/plugins/Aries003_WeatherControl.js
Normal file
|
|
@ -0,0 +1,697 @@
|
|||
//=============================================================================
|
||||
// ★ Aries003_WeatherControl ★ 1.0.0
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc Fine-tune in-game weather with various customizable features.
|
||||
* @author Aries
|
||||
*
|
||||
* @help
|
||||
* ★ Aries003_WeatherControl ★ 1.0.0
|
||||
* ----------------------------------------------------------------------------
|
||||
* The Weather Control plugin allows you to control the existing
|
||||
* weather effects with much more fine-grained authority,
|
||||
* and adds 3 new weather effects that does not come with RPG Maker MV.
|
||||
*
|
||||
* Control the look and feel of in-game weather by adjusting speed, angle,
|
||||
* size, and assign an image for the 3 built-in weather effects.
|
||||
*
|
||||
* Thunder strikes can occur periodically, flashing the screen and playing
|
||||
* a thunder sound effect. You can adjust the period and
|
||||
* randomness via parameters.
|
||||
*
|
||||
* Plugin commands are also supplied that allow you to change images in-game.
|
||||
* This change is not saved between files.
|
||||
* ----------------------------------------------------------------------------
|
||||
* Listed below are plugin and script commands to adjust weather in-game.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* Plugin: AriesToggleStormThunder [Flag]
|
||||
* Script: Aries.P003_WCT.toggleStormThunder [Flag]
|
||||
*
|
||||
* Enables or disables thunderflashes during a Storm.
|
||||
* [Flag] - 'true' or 'false' without quotation marks.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* Plugin: AriesWeather [Weather] [Power] [Duration]
|
||||
* Script: $gameScreen.changeWeather([Weather], [Power], [Duration])
|
||||
*
|
||||
* Sets the current weather.
|
||||
* [Weather] - 'none', 'rain', 'storm', 'snow', 'leaves', 'embers', 'shine'
|
||||
* [Power] - A number between 1 to 9
|
||||
* [Duration] - The duration in frames of how long the transition occurs for.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* Plugin: AriesSetWeatherImage [Weather] [Filename]
|
||||
* Script: Aries.P003_WCT.setWeatherImage([Weather], [Filename])
|
||||
*
|
||||
* Sets the current weather.
|
||||
* [Weather] - 'none', 'rain', 'storm', 'snow', 'leaves', 'embers', 'shine'
|
||||
* [Filename] - New image file for the weather effect.
|
||||
* ----------------------------------------------------------------------------
|
||||
* ★ Changelog
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* @param Rain
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Rain)
|
||||
* @parent Rain
|
||||
* @default
|
||||
*
|
||||
* @param Storm
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Storm)
|
||||
* @parent Storm
|
||||
* @default
|
||||
*
|
||||
* @param Snow
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Snow)
|
||||
* @parent Snow
|
||||
* @default
|
||||
*
|
||||
* @param Leaves
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Leaves)
|
||||
* @parent Leaves
|
||||
* @default
|
||||
*
|
||||
* @param Embers
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Embers)
|
||||
* @parent Embers
|
||||
* @default
|
||||
*
|
||||
* @param Shine
|
||||
* @default
|
||||
*
|
||||
* @param Detailed Settings (Shine)
|
||||
* @parent Shine
|
||||
* @default
|
||||
*
|
||||
* @param Rain Image
|
||||
* @parent Rain
|
||||
* @desc Define a Picture file for raindrops. (Place image in the Pictures folder.)
|
||||
* Valid: Any file name. Leave empty for default.
|
||||
* @default
|
||||
*
|
||||
* @param Raindrop Count Minimum
|
||||
* @parent Rain
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during Rain with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 12
|
||||
*
|
||||
* @param Raindrop Count Maximum
|
||||
* @parent Rain
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during Rain with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 300
|
||||
*
|
||||
* @param Raindrop Lifetime
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 30
|
||||
* @desc Controls how long a raindrop should last during Rain.
|
||||
* Valid: A number between 1 to 30
|
||||
* @default 5
|
||||
*
|
||||
* @param Raindrop Speed
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 100
|
||||
* @desc Controls the speed of a raindrop during Rain.
|
||||
* Valid: A number between 1 to 100
|
||||
* @default 35
|
||||
*
|
||||
* @param Raindrop Angle Base
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min -60
|
||||
* @max 60
|
||||
* @desc Controls the base angle at which raindrops fall during Rain.
|
||||
* Valid: A number between -60 to 60
|
||||
* @default 9
|
||||
*
|
||||
* @param Raindrop Angle Variation
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 180
|
||||
* @desc Deviate raindrop angle up to X degrees during Rain. (4 is +-4°)
|
||||
* Valid: A number between 0 to 180
|
||||
* @default 4
|
||||
*
|
||||
* @param Raindrop Opacity Base
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Controls the opacity of raindrops during Rain.
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 180
|
||||
*
|
||||
* @param Raindrop Opacity Variation
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 128
|
||||
* @desc Deviate raindrop opacity up to X value during Rain. (60 is +-60 opacity)
|
||||
* Valid: A number between 0 to 128
|
||||
* @default 60
|
||||
*
|
||||
* @param Raindrop Size Variation
|
||||
* @parent Detailed Settings (Rain)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate raindrop sizes up to X% during Rain. (No effect when not using an image.)
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 20
|
||||
*
|
||||
* @param Storm Raindrop Lifetime
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 30
|
||||
* @desc Controls how long a raindrop should last during Storm.
|
||||
* Valid: A number between 1 to 30
|
||||
* @default 2
|
||||
*
|
||||
* @param Storm Raindrop Speed
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 100
|
||||
* @desc Controls the speed of a raindrop during Storm.
|
||||
* Valid: A number between 1 to 100
|
||||
* @default 75
|
||||
*
|
||||
* @param Storm Raindrop Angle Base
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min -60
|
||||
* @max 60
|
||||
* @desc Controls the base angle at which raindrops fall during Storm.
|
||||
* Valid: A number between -60 to 60
|
||||
* @default 18
|
||||
*
|
||||
* @param Storm Raindrop Angle Variation
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 180
|
||||
* @desc Deviate raindrop angle up to X degrees during Storm. (12 is +-12°)
|
||||
* Valid: A number between 0 to 180
|
||||
* @default 12
|
||||
*
|
||||
* @param Storm Raindrop Opacity Base
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Controls the opacity of raindrops during Storm.
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 210
|
||||
*
|
||||
* @param Storm Raindrop Opacity Variation
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 128
|
||||
* @desc Deviate raindrop opacity up to X value during Rain. (125 is +-125 opacity)
|
||||
* Valid: A number between 0 to 128
|
||||
* @default 125
|
||||
*
|
||||
* @param Storm Raindrop Size Variation
|
||||
* @parent Detailed Settings (Storm)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate raindrop sizes up to X% during Storm. (No effect when not using an image.)
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 33
|
||||
*
|
||||
* @param Storm Thunder
|
||||
* @parent Storm
|
||||
* @type boolean
|
||||
* @on On
|
||||
* @off Off
|
||||
* @desc Flash the screen and play a sound effect occasionally during Storm.
|
||||
* Valid: True/False
|
||||
* @default true
|
||||
*
|
||||
* @param Storm Thunder in Battle
|
||||
* @parent Storm Thunder
|
||||
* @type boolean
|
||||
* @on On
|
||||
* @off Off
|
||||
* @desc Allow thunderflashes to occur in battle.
|
||||
* Valid: True/False
|
||||
* @default false
|
||||
*
|
||||
* @param Thunder Sound
|
||||
* @parent Storm Thunder
|
||||
* @desc Sound effect to play when a thunderflash occurs.
|
||||
* Valid: Any file name.
|
||||
* @default Thunder9
|
||||
*
|
||||
* @param Thunder Sound Volume
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 100
|
||||
* @desc Volume of the sound effect played when a thunderflash occurs.
|
||||
* Valid: A number between 0 to 100.
|
||||
* @default 75
|
||||
*
|
||||
* @param Thunder Sound Pitch
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @min 50
|
||||
* @max 150
|
||||
* @desc Pitch of the sound effect played when a thunderflash occurs.
|
||||
* Valid: A number between 50 to 150.
|
||||
* @default 100
|
||||
*
|
||||
* @param Thunder Sound Pitch Variation
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate sound pitch up to X value when a thunderflash occurs.
|
||||
* Valid: A number between 0 to 50.
|
||||
* @default 15
|
||||
*
|
||||
* @param Thunder Flash Power
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Strength of the screen flash played when a thunderflash occurs.
|
||||
* Valid: A number between 0-255.
|
||||
* @default 180
|
||||
*
|
||||
* @param Thunder Flash Variation
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 128
|
||||
* @desc Deviate flash power up to X value when a thunderflash occurs.
|
||||
* Valid: A number between 0-128.
|
||||
* @default 50
|
||||
*
|
||||
* @param Thunder Wait Time
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @desc Duration until the next thunderflash. (Adjusted based on Power)
|
||||
* Valid: Any number
|
||||
* @default 300
|
||||
*
|
||||
* @param Thunder Wait Time Variation
|
||||
* @parent Storm Thunder
|
||||
* @type number
|
||||
* @desc Deviate wait time up to X value until the next thunderflash.
|
||||
* Valid: Any number
|
||||
* @default 45
|
||||
*
|
||||
* @param Storm Image
|
||||
* @parent Storm
|
||||
* @desc Define a Picture file for raindrops (Storm). (Place image in the Pictures folder.)
|
||||
* Valid: Any file name. Leave empty for default.
|
||||
* @default
|
||||
*
|
||||
* @param Storm Raindrop Count Minimum
|
||||
* @parent Storm
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during a Storm with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 75
|
||||
*
|
||||
* @param Storm Raindrop Count Maximum
|
||||
* @parent Storm
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during a Storm with the magnitude of 9.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 350
|
||||
*
|
||||
* @param Snow Image
|
||||
* @parent Snow
|
||||
* @desc Image used for snow.
|
||||
* Valid: Any file name. Leave empty for default.
|
||||
* @default
|
||||
*
|
||||
* @param Snow Count Minimum
|
||||
* @parent Snow
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during Snow with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 12
|
||||
*
|
||||
* @param Snow Count Maximum
|
||||
* @parent Snow
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of raindrops to create during Snow with the magnitude of 9.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 320
|
||||
*
|
||||
* @param Snowflake Lifetime
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 80
|
||||
* @desc Controls how long a snowflake should last during Snow.
|
||||
* Valid: A number between 1 to 200
|
||||
* @default 16
|
||||
*
|
||||
* @param Snowflake Speed Base
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 200
|
||||
* @desc Controls the speed of a snowflake during Snow.
|
||||
* Valid: A number between 1 to 200
|
||||
* @default 25
|
||||
*
|
||||
* @param Snowflake Speed Variation
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate snowflake speed up to X value during Snow. (10 is +-10% speed)
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 10
|
||||
*
|
||||
* @param Snowflake Opacity Base
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Controls the opacity of snowflakes during Snow.
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 220
|
||||
*
|
||||
* @param Snowflake Opacity Variation
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Deviate snowflake opacity up to X value during Snow. (20 is +-20 opacity)
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 20
|
||||
*
|
||||
* @param Snowflake Size Variation
|
||||
* @parent Detailed Settings (Snow)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate snowflake sizes up to X% during Snow. (No effect when not using an image.)
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 40
|
||||
*
|
||||
* @param Leaf Image
|
||||
* @parent Leaves
|
||||
* @desc Image used for leaves. * Leaf weather effects do not appear when left empty.
|
||||
* Valid: Any file name.
|
||||
* @default Leaf
|
||||
*
|
||||
* @param Leaf Count Minimum
|
||||
* @parent Leaves
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of leaves to create during Leaves with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 10
|
||||
*
|
||||
* @param Leaf Count Maximum
|
||||
* @parent Leaves
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of leaves to create during Leaves with the magnitude of 9.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 100
|
||||
*
|
||||
* @param Leaf Lifetime
|
||||
* @parent Detailed Settings (Leaves)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 80
|
||||
* @desc Controls how long a leaf should last during Leaves.
|
||||
* Valid: A number between 1 to 200
|
||||
* @default 80
|
||||
*
|
||||
* @param Leaf Speed Base
|
||||
* @parent Detailed Settings (Leaves)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 15
|
||||
* @desc Controls the speed of a leaf during Leaves.
|
||||
* Valid: A number between 1 to 15
|
||||
* @default 3
|
||||
*
|
||||
* @param Leaf Speed Variation
|
||||
* @parent Detailed Settings (Leaves)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 5
|
||||
* @desc Deviate leaf speed up to X value during Leaves.
|
||||
* Valid: A number between 0 to 5
|
||||
* @default 2
|
||||
*
|
||||
* @param Leaf Size Variation
|
||||
* @parent Detailed Settings (Leaves)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate leaf sizes up to X% during Leaves.
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 32
|
||||
*
|
||||
* @param Embers Image
|
||||
* @parent Embers
|
||||
* @desc Image used for embers. * Embers weather do not appear when left empty.
|
||||
* Valid: Any file name.
|
||||
* @default Embers
|
||||
*
|
||||
* @param Embers Count Minimum
|
||||
* @parent Embers
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of embers to create during Embers with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 20
|
||||
*
|
||||
* @param Embers Count Maximum
|
||||
* @parent Embers
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of embers to create during Embers with the magnitude of 9.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 160
|
||||
*
|
||||
* @param Embers Lifetime
|
||||
* @parent Detailed Settings (Embers)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 80
|
||||
* @desc Controls how long embers should last during Embers.
|
||||
* Valid: A number between 1 to 200
|
||||
* @default 33
|
||||
*
|
||||
* @param Embers Speed Base
|
||||
* @parent Detailed Settings (Embers)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 60
|
||||
* @desc Controls the speed of embers during Embers.
|
||||
* Valid: A number between 1 to 60
|
||||
* @default 30
|
||||
*
|
||||
* @param Embers Speed Variation
|
||||
* @parent Detailed Settings (Embers)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 25
|
||||
* @desc Deviate embers speed up to X value during Embers.
|
||||
* Valid: A number between 0 to 25
|
||||
* @default 25
|
||||
*
|
||||
* @param Embers Size Variation
|
||||
* @parent Detailed Settings (Embers)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 50
|
||||
* @desc Deviate leaf sizes up to X% during Leaves.
|
||||
* Valid: A number between 0 to 50
|
||||
* @default 40
|
||||
*
|
||||
* @param Shine Image
|
||||
* @parent Shine
|
||||
* @desc Image used for shining effects.
|
||||
* Valid: Any file name.
|
||||
* @default Shine
|
||||
*
|
||||
* @param Shine Count Minimum
|
||||
* @parent Shine
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of sparkles to create during Shine with the magnitude of 1.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 20
|
||||
*
|
||||
* @param Shine Count Maximum
|
||||
* @parent Shine
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 999
|
||||
* @desc Amount of sparkles to create during Shine with the magnitude of 9.
|
||||
* Valid: A number between 0 to 999
|
||||
* @default 360
|
||||
*
|
||||
* @param Shine Lifetime
|
||||
* @parent Detailed Settings (Shine)
|
||||
* @type number
|
||||
* @min 1
|
||||
* @max 25
|
||||
* @desc Controls how long sparkles should last during Shine.
|
||||
* Valid: A number between 1 to 25
|
||||
* @default 25
|
||||
*
|
||||
* @param Shine Opacity Base
|
||||
* @parent Detailed Settings (Shine)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Controls the opacity of sparkles during Shine.
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 220
|
||||
*
|
||||
* @param Shine Opacity Variation
|
||||
* @parent Detailed Settings (Shine)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 255
|
||||
* @desc Deviate sparkle opacity up to X value during Shine.
|
||||
* Valid: A number between 0 to 255
|
||||
* @default 20
|
||||
*
|
||||
* @param Shine Size Variation
|
||||
* @parent Detailed Settings (Shine)
|
||||
* @type number
|
||||
* @min 0
|
||||
* @max 90
|
||||
* @desc Deviate sparkle sizes up to X% during Shine.
|
||||
* Valid: A number between 0 to 90
|
||||
* @default 80
|
||||
*/
|
||||
|
||||
var Aries = Aries || {};
|
||||
var Imported = Imported || {};
|
||||
Aries.P003_WCT = {};
|
||||
Aries.P003_WCT.Param = PluginManager.parameters('Aries003_WeatherControl');
|
||||
|
||||
Aries.P003_WCT.RainImage = String(Aries.P003_WCT.Param["Rain Image"]);
|
||||
Aries.P003_WCT.RainMin = Number(Aries.P003_WCT.Param["Raindrop Count Minimum"]);
|
||||
Aries.P003_WCT.RainMax = Number(Aries.P003_WCT.Param["Raindrop Count Maximum"]);
|
||||
Aries.P003_WCT.RainLife = Number(Aries.P003_WCT.Param["Raindrop Lifetime"]);
|
||||
Aries.P003_WCT.RainSpeed = Number(Aries.P003_WCT.Param["Raindrop Speed"]);
|
||||
Aries.P003_WCT.RainAngleC = Number(Aries.P003_WCT.Param["Raindrop Angle Base"]);
|
||||
Aries.P003_WCT.RainAlphaC = Number(Aries.P003_WCT.Param["Raindrop Opacity Base"]);
|
||||
Aries.P003_WCT.RainAngleV = Number(Aries.P003_WCT.Param["Raindrop Angle Variation"]);
|
||||
Aries.P003_WCT.RainAlphaV = Number(Aries.P003_WCT.Param["Raindrop Opacity Variation"]);
|
||||
Aries.P003_WCT.RainSizeV = Number(Aries.P003_WCT.Param["Raindrop Size Variation"]);
|
||||
|
||||
Aries.P003_WCT.StormImage = String(Aries.P003_WCT.Param["Storm Image"]);
|
||||
Aries.P003_WCT.StormMin = Number(Aries.P003_WCT.Param["Storm Raindrop Count Minimum"]);
|
||||
Aries.P003_WCT.StormMax = Number(Aries.P003_WCT.Param["Storm Raindrop Count Maximum"]);
|
||||
Aries.P003_WCT.StormLife = Number(Aries.P003_WCT.Param["Storm Raindrop Lifetime"]);
|
||||
Aries.P003_WCT.StormSpeed = Number(Aries.P003_WCT.Param["Storm Raindrop Speed"]);
|
||||
Aries.P003_WCT.StormAngleC = Number(Aries.P003_WCT.Param["Storm Raindrop Angle Base"]);
|
||||
Aries.P003_WCT.StormAlphaC = Number(Aries.P003_WCT.Param["Storm Raindrop Opacity Base"]);
|
||||
Aries.P003_WCT.StormAngleV = Number(Aries.P003_WCT.Param["Storm Raindrop Angle Variation"]);
|
||||
Aries.P003_WCT.StormAlphaV = Number(Aries.P003_WCT.Param["Storm Raindrop Opacity Variation"]);
|
||||
Aries.P003_WCT.StormSizeV = Number(Aries.P003_WCT.Param["Storm Raindrop Size Variation"]);
|
||||
|
||||
Aries.P003_WCT.StormThunder = eval(Aries.P003_WCT.Param["Storm Thunder"]);
|
||||
Aries.P003_WCT.StormThunderB = eval(Aries.P003_WCT.Param["Storm Thunder in Battle"]);
|
||||
Aries.P003_WCT.ThunderSound = String(Aries.P003_WCT.Param["Thunder Sound"]);
|
||||
Aries.P003_WCT.ThunderSEVol = Number(Aries.P003_WCT.Param["Thunder Sound Volume"]);
|
||||
Aries.P003_WCT.ThunderSEPitch = Number(Aries.P003_WCT.Param["Thunder Sound Pitch"]);
|
||||
Aries.P003_WCT.ThunderSEPitchV = Number(Aries.P003_WCT.Param["Thunder Sound Pitch Variation"]);
|
||||
Aries.P003_WCT.ThunderWait = Number(Aries.P003_WCT.Param["Thunder Wait Time"]);
|
||||
Aries.P003_WCT.ThunderWaitV = Number(Aries.P003_WCT.Param["Thunder Wait Time Variation"]);
|
||||
Aries.P003_WCT.ThunderFlash = Number(Aries.P003_WCT.Param["Thunder Flash Power"]);
|
||||
Aries.P003_WCT.ThunderFlashV = Number(Aries.P003_WCT.Param["Thunder Flash Variation"]);
|
||||
|
||||
Aries.P003_WCT.SnowImage = String(Aries.P003_WCT.Param["Snow Image"]);
|
||||
Aries.P003_WCT.SnowMin = Number(Aries.P003_WCT.Param["Snow Count Minimum"]);
|
||||
Aries.P003_WCT.SnowMax = Number(Aries.P003_WCT.Param["Snow Count Maximum"]);
|
||||
Aries.P003_WCT.SnowLife = Number(Aries.P003_WCT.Param["Snowflake Lifetime"]);
|
||||
Aries.P003_WCT.SnowSpeedC = Number(Aries.P003_WCT.Param["Snowflake Speed Base"]);
|
||||
Aries.P003_WCT.SnowAlphaC = Number(Aries.P003_WCT.Param["Snowflake Opacity Base"]);
|
||||
Aries.P003_WCT.SnowSpeedV = Number(Aries.P003_WCT.Param["Snowflake Speed Variation"]);
|
||||
Aries.P003_WCT.SnowAlphaV = Number(Aries.P003_WCT.Param["Snowflake Opacity Variation"]);
|
||||
Aries.P003_WCT.SnowSizeV = Number(Aries.P003_WCT.Param["Snowflake Size Variation"]);
|
||||
|
||||
Aries.P003_WCT.LeafImage = String(Aries.P003_WCT.Param["Leaf Image"]);
|
||||
Aries.P003_WCT.LeafMin = Number(Aries.P003_WCT.Param["Leaf Count Minimum"]);
|
||||
Aries.P003_WCT.LeafMax = Number(Aries.P003_WCT.Param["Leaf Count Maximum"]);
|
||||
Aries.P003_WCT.LeafLife = Number(Aries.P003_WCT.Param["Leaf Lifetime"]);
|
||||
Aries.P003_WCT.LeafSpeedC = Number(Aries.P003_WCT.Param["Leaf Speed Base"]);
|
||||
Aries.P003_WCT.LeafSpeedV = Number(Aries.P003_WCT.Param["Leaf Speed Variation"]);
|
||||
Aries.P003_WCT.LeafSizeV = Number(Aries.P003_WCT.Param["Leaf Size Variation"]);
|
||||
|
||||
Aries.P003_WCT.HeatImage = String(Aries.P003_WCT.Param["Embers Image"]);
|
||||
Aries.P003_WCT.HeatMin = Number(Aries.P003_WCT.Param["Embers Count Minimum"]);
|
||||
Aries.P003_WCT.HeatMax = Number(Aries.P003_WCT.Param["Embers Count Maximum"]);
|
||||
Aries.P003_WCT.HeatLife = Number(Aries.P003_WCT.Param["Embers Lifetime"]);
|
||||
Aries.P003_WCT.HeatSpeedC = Number(Aries.P003_WCT.Param["Embers Speed Base"]);
|
||||
Aries.P003_WCT.HeatSpeedV = Number(Aries.P003_WCT.Param["Embers Speed Variation"]);
|
||||
Aries.P003_WCT.HeatSizeV = Number(Aries.P003_WCT.Param["Embers Size Variation"]);
|
||||
|
||||
Aries.P003_WCT.MysticImage = String(Aries.P003_WCT.Param["Shine Image"]);
|
||||
Aries.P003_WCT.MysticMin = Number(Aries.P003_WCT.Param["Shine Count Minimum"]);
|
||||
Aries.P003_WCT.MysticMax = Number(Aries.P003_WCT.Param["Shine Count Maximum"]);
|
||||
Aries.P003_WCT.MysticLife = Number(Aries.P003_WCT.Param["Shine Lifetime"]);
|
||||
Aries.P003_WCT.MysticAlphaC = Number(Aries.P003_WCT.Param["Shine Opacity Base"]);
|
||||
Aries.P003_WCT.MysticAlphaV = Number(Aries.P003_WCT.Param["Shine Opacity Variation"]);
|
||||
Aries.P003_WCT.MysticSizeV = Number(Aries.P003_WCT.Param["Shine Size Variation"]);
|
||||
|
||||
var _aries_p003_pluginCommand=Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand=function(command,args){_aries_p003_pluginCommand.call(this,command,args);if(command==='AriesToggleStormThunder'){Aries.P003_WCT.toggleStormThunder(eval(args[0]))}else if(command==='AriesWeather'){$gameScreen.changeWeather(String(args[0]).toLowerCase(),args[1],args[2])}else if(command==='AriesSetWeatherImage'){Aries.P003_WCT.setWeatherImage(String(args[0]).toLowerCase(),String(args[1]).toLowerCase())}};Aries.P003_WCT.toggleStormThunder=function(flag){Aries.P003_WCT.StormThunder=flag};Aries.P003_WCT.setWeatherImage=function(weathertype,image){switch(weathertype){case 'rain':Aries.P003_WCT.RainImage=image;break;case 'storm':Aries.P003_WCT.StormImage=image;break;case 'snow':Aries.P003_WCT.SnowImage=image;break;case 'leaves':Aries.P003_WCT.LeafImage=image;break;case 'embers':Aries.P003_WCT.HeatImage=image;break;case 'shine':Aries.P003_WCT.MysticImage=image;break}
|
||||
if(SceneManager._scene instanceof Scene_Map){SceneManager._scene._spriteset.refreshWeatherBitmaps()}};var _aries_p003_gameScreen_clearWeather=Game_Screen.prototype.clearWeather;Game_Screen.prototype.clearWeather=function(){_aries_p003_gameScreen_clearWeather.call(this);this._weatherWind=[0,0];this._stormThunderSound=''
|
||||
this._stormThunderFlash=0;this._stormThunderCount=4*(Aries.P003_WCT.ThunderWait+Aries.P003_WCT.ThunderWaitV);this._stormThunderFrequency=0;this._snowBloom=0};var _aries_p003_gameScreen_updateWeather=Game_Screen.prototype.updateWeather;Game_Screen.prototype.updateWeather=function(){_aries_p003_gameScreen_updateWeather.call(this);if(this._weatherType==='storm'){if(Aries.P003_WCT.StormThunder===!0&&!$gameParty.inBattle()){this.updateStorm()}else if(Aries.P003_WCT.StormThunderB===!0&&$gameParty.inBattle()){this.updateStorm()}}};Game_Screen.prototype.updateStorm=function(){this._stormThunderCount-=(1+(0.5*Number(this._weatherPower)));if(this._stormThunderCount<=0){var alpha=Math.min((Aries.P003_WCT.ThunderFlash-Aries.P003_WCT.ThunderFlashV)+Math.randomInt(1+Aries.P003_WCT.ThunderFlashV*2),255);this.startFlash([255,255,255,alpha],4);if(Aries.P001_ASE!==undefined){Aries.P001_ASE.glow(18,2,3,0.75)}
|
||||
this._stormThunderCount=4*((Aries.P003_WCT.ThunderWait-Aries.P003_WCT.ThunderWaitV)+Math.randomInt(1+Aries.P003_WCT.ThunderWaitV*2));thunderSound={name:Aries.P003_WCT.ThunderSound,pan:0,pitch:(Aries.P003_WCT.ThunderSEPitch-Aries.P003_WCT.ThunderSEPitchV)+Math.randomInt(1+Aries.P003_WCT.ThunderSEPitchV*2),volume:Aries.P003_WCT.ThunderSEVol};AudioManager.playStaticSe(thunderSound)}};Spriteset_Map.prototype.refreshWeatherBitmaps=function(){this._weather._createBitmaps()};Weather.prototype._createBitmaps=function(){this._createRainBitmap();this._createStormBitmap();this._createSnowBitmap();this._createLeafBitmap();this._createHeatBitmap();this._createMysticBitmap()};Weather.prototype._createRainBitmap=function(){if(Aries.P003_WCT.RainImage.length>0){this._rainBitmap=ImageManager.loadPicture(Aries.P003_WCT.RainImage)}else{this._rainBitmap=new Bitmap(1,60);this._rainBitmap.fillAll('white')}};Weather.prototype._createStormBitmap=function(){if(Aries.P003_WCT.StormImage.length>0){this._stormBitmap=ImageManager.loadPicture(Aries.P003_WCT.StormImage)}else{this._stormBitmap=new Bitmap(2,100);this._stormBitmap.fillAll('white')}};Weather.prototype._createSnowBitmap=function(){if(Aries.P003_WCT.SnowImage.length>0){this._snowBitmap=ImageManager.loadPicture(Aries.P003_WCT.SnowImage)}else{this._snowBitmap=new Bitmap(9,9);this._snowBitmap.drawCircle(4,4,4,'white')}};Weather.prototype._createLeafBitmap=function(){if(Aries.P003_WCT.LeafImage.length>0){this._leafBitmap=ImageManager.loadPicture(Aries.P003_WCT.LeafImage)}else{this._leafBitmap=new Bitmap(9,9);this._leafBitmap.drawCircle(4,4,4,'green')}};Weather.prototype._createHeatBitmap=function(){if(Aries.P003_WCT.HeatImage.length>0){this._heatBitmap=ImageManager.loadPicture(Aries.P003_WCT.HeatImage)}else{this._heatBitmap=new Bitmap(7,7);this._heatBitmap.drawCircle(3,3,3,'black')}};Weather.prototype._createMysticBitmap=function(){if(Aries.P003_WCT.MysticImage.length>0){this._mysticBitmap=ImageManager.loadPicture(Aries.P003_WCT.MysticImage)}else{this._mysticBitmap=new Bitmap(9,9);this._mysticBitmap.drawCircle(4,4,4,'white');this._mysticBitmap.rotateHue(Math.randomInt(359))}};Weather.prototype._addSprite=function(){var sprite=new Sprite_Weather(this.viewport);switch(this.type){case 'rain':var life=Aries.P003_WCT.RainLife;var size=0.01*((100-Aries.P003_WCT.RainSizeV)+Math.randomInt(1+Aries.P003_WCT.RainSizeV*2));var getangle=((Aries.P003_WCT.RainAngleC-Aries.P003_WCT.RainAngleV)+Math.randomInt(1+Aries.P003_WCT.RainAngleV*2));var alpha=((Aries.P003_WCT.RainAlphaC-Aries.P003_WCT.RainAlphaV)+Math.randomInt(1+Aries.P003_WCT.RainAlphaV*2));sprite.setUp('rain',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'storm':var life=Aries.P003_WCT.StormLife;var size=0.01*((100-Aries.P003_WCT.StormSizeV)+Math.randomInt(1+Aries.P003_WCT.StormSizeV*2));var getangle=((Aries.P003_WCT.StormAngleC-Aries.P003_WCT.StormAngleV)+Math.randomInt(1+Aries.P003_WCT.StormAngleV*2));var alpha=((Aries.P003_WCT.StormAlphaC-Aries.P003_WCT.StormAlphaV)+Math.randomInt(1+Aries.P003_WCT.StormAlphaV*2));sprite.setUp('storm',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'snow':var life=Aries.P003_WCT.SnowLife;var size=0.01*((100-Aries.P003_WCT.SnowSizeV)+Math.randomInt(1+Aries.P003_WCT.SnowSizeV*2));var getangle=(-1+Math.randomInt(3))*0.267;var alpha=((Aries.P003_WCT.SnowAlphaC-Aries.P003_WCT.SnowAlphaV)+Math.randomInt(1+Aries.P003_WCT.SnowAlphaV*2));var snowspeed=1.33+Math.randomInt(2);sprite.setUp('snow',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'leaves':var life=Aries.P003_WCT.LeafLife;var size=0.007*((100-Aries.P003_WCT.LeafSizeV)+Math.randomInt(1+Aries.P003_WCT.LeafSizeV*2));var getangle=Aries.P003_WCT.LeafSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
|
||||
sprite.setUp('leaves',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'embers':var life=Aries.P003_WCT.HeatLife;var size=0.007*((100-Aries.P003_WCT.HeatSizeV)+Math.randomInt(1+Aries.P003_WCT.HeatSizeV*2));var getangle=Aries.P003_WCT.HeatSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
|
||||
sprite.setUp('embers',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'shine':var life=Aries.P003_WCT.MysticLife;var size=0.007*((100-Aries.P003_WCT.MysticSizeV)+Math.randomInt(1+Aries.P003_WCT.MysticSizeV*2));var getangle=12;var alpha=((Aries.P003_WCT.MysticAlphaC-Aries.P003_WCT.MysticAlphaV)+Math.randomInt(1+Aries.P003_WCT.MysticAlphaV*2));var snowspeed=0.25*(2+Math.randomInt(3));sprite.setUp('shine',life,size,getangle,alpha,snowspeed);sprite.rotation=Math.random();sprite.opacity=0;break}
|
||||
sprite.opacity=0;this._sprites.push(sprite);this.addChild(sprite)};Weather.prototype._getMaxSpriteCount=function(){var maxCount=0;switch(this.type){case 'rain':maxCount=Aries.P003_WCT.RainMin+(Aries.P003_WCT.RainMax*this.power*0.1);break;case 'storm':maxCount=Aries.P003_WCT.StormMin+(Aries.P003_WCT.StormMax*this.power*0.1);break;case 'snow':maxCount=Aries.P003_WCT.SnowMin+(Aries.P003_WCT.SnowMax*this.power*0.1);break;case 'leaves':maxCount=Aries.P003_WCT.LeafMin+(Aries.P003_WCT.LeafMax*this.power*0.1);break;case 'embers':maxCount=Aries.P003_WCT.HeatMin+(Aries.P003_WCT.HeatMax*this.power*0.1);break;case 'shine':maxCount=Aries.P003_WCT.MysticMin+(Aries.P003_WCT.MysticMax*this.power*0.1);break}
|
||||
return maxCount};Weather.prototype._updateAllSprites=function(){var maxSprites=this._getMaxSpriteCount();if(this._sprites.length<maxSprites){this._addSprite()}
|
||||
if(this._sprites.length>maxSprites){this._removeSprite()}
|
||||
this._sprites.forEach(function(sprite){this._updateSprite(sprite);sprite.x=sprite.ax-this.origin.x;sprite.y=sprite.ay-this.origin.y},this)};Weather.prototype._updateSprite=function(sprite){sprite.update();switch(this.type){case 'rain':this._updateRainSprite(sprite);break;case 'storm':this._updateStormSprite(sprite);break;case 'snow':this._updateSnowSprite(sprite);break;case 'leaves':this._updateLeafSprite(sprite);break;case 'embers':this._updateHeatSprite(sprite);break;case 'shine':this._updateMysticSprite(sprite);break}
|
||||
if(sprite._lifetime<=0&&sprite.opacity<=6){this._rebornSprite(sprite)}};Weather.prototype._updateRainSprite=function(sprite){sprite.bitmap=this._rainBitmap;sprite.rotation=sprite._anglev*(Math.PI/180);var velocity=sprite.getVelocity(Aries.P003_WCT.RainSpeed);sprite.ax+=velocity[0];sprite.ay+=velocity[1]};Weather.prototype._updateStormSprite=function(sprite){sprite.bitmap=this._stormBitmap;sprite.rotation=sprite._anglev*(Math.PI/180);var velocity=sprite.getVelocity(Aries.P003_WCT.StormSpeed);sprite.ax+=velocity[0];sprite.ay+=velocity[1]};Weather.prototype._updateSnowSprite=function(sprite){sprite.bitmap=this._snowBitmap;sprite.ax+=sprite._anglev;sprite.ay+=sprite._snowSpeed};Weather.prototype._updateLeafSprite=function(sprite){sprite.bitmap=this._leafBitmap;sprite.rotation+=0.025*sprite._anglev;sprite.ax+=2*Math.sin(0.0078*sprite._randomSeed);sprite.ay+=sprite._snowSpeed};Weather.prototype._updateHeatSprite=function(sprite){sprite.bitmap=this._heatBitmap;sprite.ax+=2*Math.sin(0.0139*sprite._randomSeed);sprite.ay-=sprite._snowSpeed};Weather.prototype._updateMysticSprite=function(sprite){sprite.bitmap=this._mysticBitmap};Weather.prototype._rebornSprite=function(sprite){sprite.ax=Math.randomInt(Graphics.width+500)-200+this.origin.x;sprite.ay=Math.randomInt(Graphics.height+600)-400+this.origin.y;switch(this.type){case 'rain':var life=Aries.P003_WCT.RainLife;var size=0.01*((100-Aries.P003_WCT.RainSizeV)+Math.randomInt(1+Aries.P003_WCT.RainSizeV*2));var getangle=((Aries.P003_WCT.RainAngleC-Aries.P003_WCT.RainAngleV)+Math.randomInt(1+Aries.P003_WCT.RainAngleV*2));var alpha=((Aries.P003_WCT.RainAlphaC-Aries.P003_WCT.RainAlphaV)+Math.randomInt(1+Aries.P003_WCT.RainAlphaV*2));sprite.setUp('rain',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'storm':var life=Aries.P003_WCT.StormLife;var size=0.01*((100-Aries.P003_WCT.StormSizeV)+Math.randomInt(1+Aries.P003_WCT.StormSizeV*2));var getangle=((Aries.P003_WCT.StormAngleC-Aries.P003_WCT.StormAngleV)+Math.randomInt(1+Aries.P003_WCT.StormAngleV*2));var alpha=((Aries.P003_WCT.StormAlphaC-Aries.P003_WCT.StormAlphaV)+Math.randomInt(1+Aries.P003_WCT.StormAlphaV*2));sprite.setUp('storm',life,size,getangle,alpha);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'snow':var life=Aries.P003_WCT.SnowLife;var size=0.01*((100-Aries.P003_WCT.SnowSizeV)+Math.randomInt(1+Aries.P003_WCT.SnowSizeV*2));var getangle=(-1+Math.randomInt(3))*0.267;var alpha=((Aries.P003_WCT.SnowAlphaC-Aries.P003_WCT.SnowAlphaV)+Math.randomInt(1+Aries.P003_WCT.SnowAlphaV*2));var snowspeed=1.33+Math.randomInt(2);sprite.setUp('snow',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'leaves':var life=Aries.P003_WCT.LeafLife;var size=0.007*((100-Aries.P003_WCT.LeafSizeV)+Math.randomInt(1+Aries.P003_WCT.LeafSizeV*2));var getangle=Aries.P003_WCT.LeafSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
|
||||
sprite.setUp('leaves',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'embers':var life=Aries.P003_WCT.HeatLife;var size=0.007*((100-Aries.P003_WCT.HeatSizeV)+Math.randomInt(1+Aries.P003_WCT.HeatSizeV*2));var getangle=Aries.P003_WCT.HeatSpeedV;var alpha=255;var snowspeed=0.83+Math.randomInt(2)
|
||||
sprite.setUp('embers',life,size,getangle,alpha,snowspeed);sprite.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 'shine':var life=Aries.P003_WCT.MysticLife;var size=0.007*((100-Aries.P003_WCT.MysticSizeV)+Math.randomInt(1+Aries.P003_WCT.MysticSizeV*2));var getangle=12;var alpha=((Aries.P003_WCT.MysticAlphaC-Aries.P003_WCT.MysticAlphaV)+Math.randomInt(1+Aries.P003_WCT.MysticAlphaV*2));var snowspeed=0.25*(2+Math.randomInt(3));sprite.setUp('shine',life,size,getangle,alpha,snowspeed);sprite.rotation=Math.random();sprite.opacity=0;break}};function Sprite_Weather(){this.initialize.apply(this,arguments)}
|
||||
Sprite_Weather.prototype=Object.create(Sprite.prototype);Sprite_Weather.prototype.constructor=Sprite_Weather;Sprite_Weather.prototype.initialize=function(){Sprite.prototype.initialize.call(this);this._type='none'
|
||||
this._lifetime=0;this._size=0;this._anglev=0;this._alpha=0;this._snowSpeed=0;this.setUpDone=!1};Sprite_Weather.prototype.update=function(){if(this.setUpDone===!0){if(this._lifetime>0){if(this._type==='snow'){this.opacity=Math.min(this.opacity+24,this._alpha);this.scale.x=this._size;this.scale.y=this._size}else if(this._type==='shine'){this.opacity=Math.min(this.opacity+48,this._alpha);this.scale.x+=0.09;this.scale.y+=0.09}else if(this._type==='embers'){this.opacity=Math.min(this.opacity+32,this._alpha);var newTone=this.getColorTone();newTone[0]*=0.98;newTone[1]*=0.95;this.setColorTone(newTone);this.scale.x=this._size;this.scale.y=this._size}else{this.opacity=Math.min(this.opacity+72,this._alpha);this.scale.x=this._size;this.scale.y=this._size}
|
||||
this._lifetime-=1;this._randomSeed-=1}else{if(this._type==='snow'){this.opacity-=16}else if(this._type==='shine'){this.opacity-=15;this.scale.x-=0.09;this.scale.y-=0.09}else if(this._type==='leaves'||this._type==='embers'){this.scale.x-=0.01;this.scale.y-=0.01;this.opacity-=8}else{this.opacity-=48}}}};Sprite_Weather.prototype.setUp=function(type,life,size,getangle,alpha,snowSpeed=0){this._type=type;this._lifetime=life+Math.randomInt(life*0.25);this._size=size;this._anglev=getangle;this._alpha=alpha;this._snowSpeed=snowSpeed;this._randomSeed=Math.randomInt(16777216);if(this._type==='shine'){this.scale.x=0;this.scale.y=0;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.ADD;this.setColorTone([Math.randomInt(2)*-255,Math.randomInt(2)*-255,Math.randomInt(2)*-255,0])}else if(this._type==='leaves'){this.scale.x=1;this.scale.y=1;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([0,0,0,0])}else if(this._type==='embers'){this.scale.x=1;this.scale.y=1;this.anchor=new Point(0.5,0.5);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([255,200,0,0])}else{this.scale.x=1;this.scale.y=1;this.anchor=new Point(0,0);this.blendMode=PIXI.BLEND_MODES.NORMAL;this.setColorTone([0,0,0,0])}
|
||||
this.setUpDone=!0};Sprite_Weather.prototype.getVelocity=function(speed){var speedX=speed*Math.cos(this._anglev*(Math.PI/180));var speedY=-1*speed*Math.sin(this._anglev*(Math.PI/180));return[speedY,speedX]};if(Aries.P001_ASE!==undefined){var _aries_p003_spritesetBase_createScreenEffectFilters=Spriteset_Base.prototype.createScreenEffectFilters;Spriteset_Base.prototype.createScreenEffectFilters=function(){_aries_p003_spritesetBase_createScreenEffectFilters.call(this);this._wct_glow_filter=new PIXI.filters.AdvancedBloomFilter();this._wct_glow_filter.enabled=!1;this._wct_glow_filter.brightness=0.5;this._wct_glow_filter.bloomScale=0.667;this._wct_glow_filter.blur=0;this._wct_glow_filter.threshold=0.05;this._filters.push(this._wct_glow_filter)};var _aries_p003_spritesetBase_updateScreenEffects=Spriteset_Base.prototype.updateScreenEffects;Spriteset_Base.prototype.updateScreenEffects=function(){_aries_p003_spritesetBase_updateScreenEffects.call(this);if(this._wct_glow_filter){switch($gameScreen.weatherType()){case 'rain':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.035*$gameScreen.weatherPower();this._wct_glow_filter.brightness=1-(0.025*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.1*$gameScreen.weatherPower();this._wct_glow_filter.threshold=0.075;this._wct_heat_filter.enabled=!1;break;case 'storm':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.05*$gameScreen.weatherPower();this._wct_glow_filter.brightness=1-(0.06*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.2*$gameScreen.weatherPower();this._wct_glow_filter.threshold=0.075;this._wct_heat_filter.enabled=!1;break;case 'snow':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.1+(0.005*$gameScreen.weatherPower());this._wct_glow_filter.brightness=1+(0.001*$gameScreen.weatherPower());this._wct_glow_filter.blur=0.5+(0.1*$gameScreen.weatherPower());this._wct_glow_filter.threshold=0.667;this._wct_heat_filter.enabled=!1;break;case 'embers':this._wct_glow_filter.enabled=!0;this._wct_glow_filter.bloomScale=0.2+(0.015*$gameScreen.weatherPower());+0.2*(1+Math.sin(0.03*Graphics.frameCount));this._wct_glow_filter.brightness=1;this._wct_glow_filter.blur=6+(0.1*$gameScreen.weatherPower());this._wct_glow_filter.threshold=0.75;break;default:this._wct_glow_filter.enabled=!1;this._wct_glow_filter.bloomScale=1;this._wct_glow_filter.brightness=1;this._wct_glow_filter.blur=0;this._wct_glow_filter.threshold=1;break}}}}
|
||||
496
www/js/plugins/Atlas Loader.js
Normal file
496
www/js/plugins/Atlas Loader.js
Normal file
|
|
@ -0,0 +1,496 @@
|
|||
//=============================================================================
|
||||
// TDS Atlas Loader
|
||||
// Version: 1.3
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {}; Imported.TDS_AtlasLoader = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {}; _TDS_.AtlasLoader = _TDS_.AtlasLoader || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Atlas loading BETA.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** SceneManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages scene transitions.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.AtlasLoader.SceneManager_isCurrentSceneBusy = SceneManager.isCurrentSceneBusy;
|
||||
//=============================================================================
|
||||
// * Determine if Current scene is busy
|
||||
//=============================================================================
|
||||
SceneManager.isCurrentSceneBusy = function () {
|
||||
// Return true if
|
||||
if (this._scene && this._nextScene) {
|
||||
// If Not all atlases are loaded return true
|
||||
if (!this._nextScene.areAllRequiredAtlasLoaded()) { return true; }
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.AtlasLoader.SceneManager_isCurrentSceneBusy.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** AtlasManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// This static class is used to handle bitmap fonts
|
||||
//=============================================================================
|
||||
function AtlasManager() { throw new Error('This is a static class'); }
|
||||
//=============================================================================
|
||||
// * Determine if Atlas has Data for key
|
||||
//=============================================================================
|
||||
AtlasManager.hasAltasData = function (key) {
|
||||
if ($atlasData) { return $atlasData.source[key] !== undefined; }
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Image Atlas Name
|
||||
//=============================================================================
|
||||
AtlasManager.getImageAtlasName = function (key) {
|
||||
// If Atlas key Exists
|
||||
if (this.hasAltasData(key)) {
|
||||
// Return Atlas name
|
||||
return $atlasData.source[key].atlasName;
|
||||
};
|
||||
// Return false
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Data
|
||||
//=============================================================================
|
||||
AtlasManager.initAtlasData = function () {
|
||||
// If Atlas is undefined
|
||||
if (window['$atlasData'] === undefined) {
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
// Get Folder
|
||||
var folder = '/img/atlases/';
|
||||
// Get FilePath
|
||||
var filePath = base + folder;
|
||||
// Get Directory List
|
||||
var dirList = fs.readdirSync(filePath);
|
||||
// Get Atlas File
|
||||
var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
|
||||
// Set Atlas Data
|
||||
window['$atlasData'] = data;
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Bitmap
|
||||
//=============================================================================
|
||||
AtlasManager.makeBitmap = function (key) {
|
||||
// Get Data
|
||||
var data = $atlasData.source[key];
|
||||
// Get Data
|
||||
if (data) {
|
||||
// Get Function
|
||||
var func = data.makeFunction;
|
||||
// If Creation Function Exists
|
||||
if (data.makeFunction) {
|
||||
// Return Atlas Creation Function
|
||||
return AtlasManager[func.name](func.arguments);
|
||||
} else {
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(data.rect.width, data.rect.height);
|
||||
// Get Atlas Bitmap
|
||||
var atlasBitmap = ImageManager.loadAtlas(data.atlasName);
|
||||
atlasBitmap.addLoadListener(() => {
|
||||
let sr = data.sourceRect;
|
||||
if (!atlasBitmap.isReady()) { bitmap.fillAll('rgba(0, 255, 0, 1)') }
|
||||
else { bitmap.blt(atlasBitmap, sr.x, sr.y, sr.width, sr.height, data.rect.x, data.rect.y); }
|
||||
})
|
||||
// Check if Atlas bitmap is ready
|
||||
/*if (atlasBitmap.isReady()) {
|
||||
// Get Source Rect
|
||||
var sr = data.sourceRect;
|
||||
// Block Transfer
|
||||
bitmap.blt(atlasBitmap, sr.x, sr.y, sr.width, sr.height, data.rect.x, data.rect.y);
|
||||
} else {
|
||||
// Make Bitmap green if atlas is not loaded
|
||||
if ($gameTemp.isPlaytest()) {
|
||||
// Make Bitmap green if atlas is not loaded
|
||||
bitmap.fillAll('rgba(0, 255, 0, 1)');
|
||||
}
|
||||
};*/
|
||||
// Return bitmap
|
||||
return bitmap;
|
||||
};
|
||||
};
|
||||
// Return Empty Bitmap
|
||||
return ImageManager.loadEmptyBitmap();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make WindowSkin
|
||||
//=============================================================================
|
||||
AtlasManager.makeWindowSkin = function () {
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(192, 192);
|
||||
// Get Atlas Bitmap
|
||||
var atlasBitmap = ImageManager.loadAtlas('Atlas1');
|
||||
|
||||
// Fill Background Color
|
||||
bitmap.fillRect(0, 0, 96, 96, 'rgba(0, 255, 0, 1)')
|
||||
|
||||
// Transfer Border
|
||||
var cw = 10, ch = 10
|
||||
bitmap.blt(atlasBitmap, 0, 0, cw, ch, 96, 0);
|
||||
bitmap.blt(atlasBitmap, 10, 0, cw, ch, 96 + 96 - cw, 0);
|
||||
bitmap.blt(atlasBitmap, 0, 10, cw, ch, 96, 96 - ch);
|
||||
bitmap.blt(atlasBitmap, 10, 10, cw, ch, 96 + 96 - cw, 96 - ch);
|
||||
|
||||
bitmap.blt(atlasBitmap, 11, 0, 1, ch, 96 + cw, 0, 96 - (cw * 2))
|
||||
bitmap.blt(atlasBitmap, 11, 10, 1, ch, 96 + cw, 96 - ch, 96 - (cw * 2))
|
||||
bitmap.blt(atlasBitmap, 0, 11, cw, 1, 96, ch, cw, 96 - (ch * 2))
|
||||
bitmap.blt(atlasBitmap, 0, 11, cw, 1, 96 + 96 - 5, ch, cw, 96 - (ch * 2))
|
||||
|
||||
// Transfer Colors
|
||||
for (var i = 0; i < 32; i++) {
|
||||
var px = (i % 20);
|
||||
var py = 20 + Math.floor(i / 20);
|
||||
var color = atlasBitmap.getPixel(px, py);
|
||||
var dx = 96 + (i % 8) * 12;
|
||||
var dy = 144 + Math.floor(i / 8) * 12;
|
||||
bitmap.fillRect(dx, dy, 12, 12, color);
|
||||
}
|
||||
// Return Bitmap
|
||||
return bitmap;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Purge All Atlas Images
|
||||
//=============================================================================
|
||||
AtlasManager.purgeAllAtlasImages = function (name) {
|
||||
// Get Atlas Images
|
||||
const altasImages = Object.entries($atlasData.source).filter(arr => arr[1].atlasName === name);
|
||||
// Go through atlas images
|
||||
for (var i = 0; i < altasImages.length; i++) {
|
||||
// Get Key
|
||||
const key = altasImages[i][0];
|
||||
// Delete Cache Item
|
||||
delete ImageManager._imageCache._items[key];
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load System Atlas Images
|
||||
//=============================================================================
|
||||
AtlasManager.loadSystemAtlasImages = function () {
|
||||
// // If Atlas is undefined
|
||||
// if (window['$atlasData'] === undefined) {
|
||||
|
||||
// // Get Atlas File
|
||||
// var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
|
||||
// // Set Atlas Data
|
||||
// window['$atlasData'] = data;
|
||||
// };
|
||||
// // Load All Atlas Images
|
||||
// this.loadAllAtlasImages();
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load All Atlas Images
|
||||
//=============================================================================
|
||||
AtlasManager.loadAllAtlasImages = function () {
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var yaml = require('./js/libs/js-yaml-master')
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
// Get Folder
|
||||
var folder = '/img/atlases/';
|
||||
// Get FilePath
|
||||
var filePath = base + folder;
|
||||
// Get Directory List
|
||||
var dirList = fs.readdirSync(filePath);
|
||||
// // If Atlas is undefined
|
||||
// if (window['$atlasData'] === undefined) {
|
||||
// // Get Atlas File
|
||||
// var data = jsyaml.load(fs.readFileSync(base + '/data/Atlas.yaml', 'utf8'));
|
||||
// // Set Atlas Data
|
||||
// window['$atlasData'] = data;
|
||||
// };
|
||||
// Go Through Directory
|
||||
for (var i = 0; i < dirList.length; i++) {
|
||||
// Get Directory
|
||||
var directory = dirList[i];
|
||||
// Get Format
|
||||
var format = path.extname(dirList[i]);
|
||||
// Get Filename
|
||||
var filename = path.basename(directory, format);
|
||||
// If an image
|
||||
if (format === '.png') {
|
||||
// Load Atlas
|
||||
ImageManager.loadAtlas(filename)
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Initialize Atlas Data
|
||||
//AtlasManager.initAtlasData()
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** ImageManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that loads images, creates bitmap objects and retains them.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.AtlasLoader.ImageManager_loadNormalBitmap = ImageManager.loadNormalBitmap;
|
||||
_TDS_.AtlasLoader.ImageManager_requestNormalBitmap = ImageManager.requestNormalBitmap
|
||||
_TDS_.AtlasLoader.ImageManager_loadBitmap = ImageManager.loadBitmap;
|
||||
_TDS_.AtlasLoader.ImageManager_reserveBitmap = ImageManager.reserveBitmap;
|
||||
//=============================================================================
|
||||
// * Load Atlas Image
|
||||
//=============================================================================
|
||||
ImageManager.loadAtlas = function (filename, hue) { return this.reserveBitmap('img/atlases/', filename, hue, false, 'atlas'); };
|
||||
//=============================================================================
|
||||
// * Load Atlas Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.loadAtlasBitmap = function (filename) {
|
||||
return this.reserveNormalBitmap(filename, 0, 'atlas');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Atlas Key Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.loadAtlasKeyBitmap = function (key) {
|
||||
// Get Decoded Key
|
||||
var dkey = decodeURIComponent(key);
|
||||
// If Atlas manager has key
|
||||
if (AtlasManager.hasAltasData(dkey)) {
|
||||
// Get Bitmap
|
||||
var bitmap = this._imageCache.get(key);
|
||||
// If There's no bitmap and there's atlas data for it
|
||||
if (!bitmap) {
|
||||
// Make Bitmap
|
||||
bitmap = AtlasManager.makeBitmap(dkey);
|
||||
bitmap.smooth = false;
|
||||
// Add to Image Cache
|
||||
this._imageCache.add(key, bitmap);
|
||||
// Return Bitmap
|
||||
return bitmap;
|
||||
};
|
||||
// Return Bitmap
|
||||
return bitmap;
|
||||
};
|
||||
// Return null
|
||||
return null;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Load Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.loadBitmap = function (folder, filename, hue, smooth) {
|
||||
// If Filename is valid
|
||||
if (filename) {
|
||||
// Get Path
|
||||
const loadFileName = replaceSpecialSymbols(filename);
|
||||
var path = (folder + encodeURIComponent(loadFileName) + '.png').trim();
|
||||
|
||||
// Get Atlas Key Bitmap
|
||||
var bitmap = this.loadAtlasKeyBitmap(encodeURI(path));
|
||||
// Return bitmap if not null
|
||||
if (bitmap !== null) { return bitmap; };
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.AtlasLoader.ImageManager_loadBitmap.call(this, folder, filename, hue, smooth);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Reserve Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.reserveBitmap = function (folder, filename, hue, smooth, reservationId) {
|
||||
// If Filename is valid
|
||||
if (filename) {
|
||||
// Get Path
|
||||
var path = folder + filename + '.png';
|
||||
path = replaceSpecialSymbols(path);
|
||||
// Get Atlas Key Bitmap
|
||||
var bitmap = this.loadAtlasKeyBitmap(path);
|
||||
// Return bitmap if not null
|
||||
if (bitmap !== null) { return bitmap; };
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.AtlasLoader.ImageManager_reserveBitmap.call(this, folder, filename, hue, smooth, reservationId);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Normal Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.loadNormalBitmap = function (path, hue) {
|
||||
// Get Atlas Key Bitmap
|
||||
var bitmap = this.loadAtlasKeyBitmap(replaceSpecialSymbols(path));
|
||||
// Return bitmap if not null
|
||||
if (bitmap !== null) { return bitmap; };
|
||||
// Return Original Function
|
||||
return _TDS_.AtlasLoader.ImageManager_loadNormalBitmap.call(this, path, hue);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Request Normal Bitmap
|
||||
//=============================================================================
|
||||
ImageManager.requestNormalBitmap = function (path, hue) {
|
||||
// Get Atlas Key Bitmap
|
||||
var bitmap = this.loadAtlasKeyBitmap(path);
|
||||
// Return bitmap if not null
|
||||
if (bitmap !== null) { return bitmap; };
|
||||
// Return Original Function
|
||||
return _TDS_.AtlasLoader.ImageManager_requestNormalBitmap.call(this, path, hue);
|
||||
};
|
||||
|
||||
|
||||
// Load All Atlas Images (Yes for some reason it needs to be just here to work)
|
||||
// AtlasManager.loadAllAtlasImages();
|
||||
AtlasManager.loadSystemAtlasImages()
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Boot
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class for initializing the entire game.
|
||||
//=============================================================================
|
||||
// * Determine if Scene is Busy
|
||||
//=============================================================================
|
||||
Scene_Boot.prototype.isBusy = function () {
|
||||
// If Image Manager is not ready return true
|
||||
if (!ImageManager.isReady()) { return true; }
|
||||
// Super Call
|
||||
return Scene_Base.prototype.isBusy.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Base
|
||||
//-----------------------------------------------------------------------------
|
||||
// The Superclass of all scene within the game.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.AtlasLoader.Scene_Base_initialize = Scene_Base.prototype.initialize;
|
||||
_TDS_.AtlasLoader.Scene_Base_terminate = Scene_Base.prototype.terminate
|
||||
//=============================================================================
|
||||
// * Determine if Scene is Busy
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.initialize = function () {
|
||||
// Load Reserved Bitmaps
|
||||
this.loadReservedBitmaps();
|
||||
// Run Original Function
|
||||
_TDS_.AtlasLoader.Scene_Base_initialize.call(this);
|
||||
// Initialize Atlas List
|
||||
this.initAtlastLists();
|
||||
// Load Required Atlas Images
|
||||
this.loadRequiredAtlasImages();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Terminate the scene before switching to a another scene.
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.terminate = function () {
|
||||
// Run Original Function
|
||||
_TDS_.AtlasLoader.Scene_Base_terminate.call(this);
|
||||
// Dump Required Atlases
|
||||
this.dumpRequiredAtlas();
|
||||
}
|
||||
//=============================================================================
|
||||
// * Load Reserved Bitmaps
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.loadReservedBitmaps = function () { };
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Lists
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.initAtlastLists = function () {
|
||||
// List of Atlases require for the scene to start
|
||||
this._requiredAtlasList = [];
|
||||
// List of Atlases to dump when scene is done
|
||||
this._dumpAtlasList = []
|
||||
// All Atlas Loaded Flag
|
||||
this._allAtlasLoaded = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Required Atlas
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.addRequiredAtlas = function (name, dump = true) {
|
||||
// If Required Atlast list does not contain name
|
||||
if (!this._requiredAtlasList.contains(name)) {
|
||||
// Add it to required atlas list
|
||||
this._requiredAtlasList.push(name);
|
||||
};
|
||||
// If Dump and Dump atlas list does not contain name
|
||||
if (dump && !this._dumpAtlasList.contains(name)) {
|
||||
// Add it to dump atlas list
|
||||
this._dumpAtlasList.push(name);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Required Atlas Images
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.loadRequiredAtlasImages = function () {
|
||||
// Go Through Required Atlas List
|
||||
for (var i = 0; i < this._requiredAtlasList.length; i++) {
|
||||
ImageManager.loadAtlas(this._requiredAtlasList[i]);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Dump Required Atlas Images
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.dumpRequiredAtlas = function () {
|
||||
// Initialize Dump List
|
||||
var dumpList = this._dumpAtlasList.clone();
|
||||
// Get Next Scene
|
||||
var nextScene = SceneManager._nextScene;
|
||||
// If Next Scene Exists
|
||||
if (nextScene) {
|
||||
// Get Required Atlas List from Next Scene
|
||||
var nextRequiredAtlasList = nextScene._requiredAtlasList;
|
||||
// Go through required Atlas list
|
||||
for (var i = 0; i < nextRequiredAtlasList.length; i++) {
|
||||
// Get Index in dump list
|
||||
var index = dumpList.indexOf(nextRequiredAtlasList[i]);
|
||||
// Remove fro Dump list if it exists
|
||||
if (index >= 0) { dumpList.splice(index, 1); };
|
||||
};
|
||||
};
|
||||
// Go Through Dump List
|
||||
for (var i = 0; i < dumpList.length; i++) {
|
||||
// Get Atlas Name
|
||||
var atlasName = dumpList[i];
|
||||
// Get Atlas Key
|
||||
var key = 'img/atlases/' + atlasName + '.png:0'
|
||||
// Delete Cache Item
|
||||
delete ImageManager._imageCache._items[key];
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Check if all required atlases are loaded
|
||||
//=============================================================================
|
||||
Scene_Base.prototype.areAllRequiredAtlasLoaded = function () {
|
||||
// If Atlas loading has not started return false
|
||||
if (this._allAtlasLoaded) { return true; }
|
||||
// Set Loaded Flag
|
||||
var loaded = true;
|
||||
// Go Through Required Atlas List
|
||||
for (var i = 0; i < this._requiredAtlasList.length; i++) {
|
||||
// Get Bitmap
|
||||
var bitmap = ImageManager.loadAtlas(this._requiredAtlasList[i]);
|
||||
// If Bitmap Loading state is not loaded
|
||||
if (bitmap._loadingState !== 'loaded') {
|
||||
// Set loaded flag to false
|
||||
loaded = false;
|
||||
break
|
||||
};
|
||||
};
|
||||
// Set Loaded flag to false
|
||||
if (!ImageManager.isReady()) { loaded = false; }
|
||||
// If Loaded set All Atlas loaded flag to true
|
||||
if (loaded) { this._allAtlasLoaded = true; };
|
||||
// Return loaded flag
|
||||
return loaded;
|
||||
};
|
||||
1207
www/js/plugins/AudioStreaming.js
Normal file
1207
www/js/plugins/AudioStreaming.js
Normal file
File diff suppressed because it is too large
Load diff
402
www/js/plugins/Battle Commands List.js
Normal file
402
www/js/plugins/Battle Commands List.js
Normal file
|
|
@ -0,0 +1,402 @@
|
|||
//=============================================================================
|
||||
// TDS Battle Commands List
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_BattleCommandsList = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.BattleCommandsList = _TDS_.BattleCommandsList || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin allows you to set custom battle commands for actors and classes.
|
||||
*
|
||||
* @author TDS
|
||||
* @param Skill Type Names
|
||||
* @desc Names of skill types. (Used for skill list commands) (Use a , to separate and leave empty for default name.)
|
||||
* @default
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* * Actor & Class Notetags
|
||||
* ============================================================================
|
||||
* Use the following note tags within the actor or class note boxes to
|
||||
* set the command list for the actor or class. (Actor note tags will
|
||||
* override class tags.)
|
||||
*
|
||||
* <BattleCommandsList>
|
||||
* Command
|
||||
* </BattleCommandsList>
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <BattleCommandsList>
|
||||
* attack
|
||||
* defend
|
||||
* skillList
|
||||
* skillTypeList: 1
|
||||
* skill: 10
|
||||
* items
|
||||
* item: 2
|
||||
* </BattleCommandsList>
|
||||
*
|
||||
* Command List:
|
||||
*
|
||||
* attack
|
||||
* ^ Adds default attack command to the commmand list.
|
||||
*
|
||||
* defend
|
||||
* ^ Adds default defense command to the command list.
|
||||
*
|
||||
* skillList
|
||||
* ^ Adds default skill command to the command list. (Shows all skills)
|
||||
*
|
||||
* skillTypeList: SkillTypeId
|
||||
* ^ Adds a skill list command which only shows a type of skill.
|
||||
* ^ SkillTypeId: Id of the type of skill to show.
|
||||
*
|
||||
* skill: ID
|
||||
* ^ Adds a skill as a command.
|
||||
* ^ ID: Id of the skill to set as a command.
|
||||
*
|
||||
* items
|
||||
* ^ Adds default item command to the command list. (Shows all items)
|
||||
*
|
||||
* item: ID
|
||||
* ^ Adds an item as a command.
|
||||
* ^ ID: ID of the item to set as a command.
|
||||
*
|
||||
* ============================================================================
|
||||
* * Skill & Item Notetags
|
||||
* ============================================================================
|
||||
* These note tags will modify how items and skills are displayed or used
|
||||
* in the command window.
|
||||
*
|
||||
* <CommandName: NAME>
|
||||
* ^ This note tag allows you to set a display name for a skill or item
|
||||
* when it is being displayed as a command.
|
||||
* ^ NAME: Name to use as a command.
|
||||
*
|
||||
* Example:
|
||||
* <CommandName: Limit break>
|
||||
*
|
||||
*
|
||||
* <CommandHideUntilSwitch: ID>
|
||||
* ^ This note tag makes it so if a switch is not on the item or skill
|
||||
* will not be displayed in the command list.
|
||||
* ^ ID: ID of the switch to use.
|
||||
*
|
||||
* Example:
|
||||
* <CommandHideUntilSwitch: 5>
|
||||
*
|
||||
*
|
||||
* <CommandHideUntilUsable>
|
||||
* ^ This note tag makes it so if an item or skill cannot be used by
|
||||
* the actor it will not be displayed in the command list.
|
||||
*
|
||||
*
|
||||
* <CommandHideUntilLearned>
|
||||
* ^ This note tag makes it so if a skill has not been learned by the
|
||||
* actor it will not be displayed in the command list.
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Battle Commands List");
|
||||
// Initialize After Battle Commmon Event Parameters
|
||||
_TDS_.BattleCommandsList.params = {};
|
||||
// Skill Type Custom Names
|
||||
_TDS_.BattleCommandsList.params.sTypeNames = [''];
|
||||
// Get Text
|
||||
var text = parameters['Skill Type Names'];
|
||||
// If Text is not empty
|
||||
if (text !== '') {
|
||||
// Create List
|
||||
var list = text.split(/,/);
|
||||
// Go through List
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
// Add Skill Type Name
|
||||
_TDS_.BattleCommandsList.params.sTypeNames.push(list[i].trim());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages the database and game objects.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.BattleCommandsList.DataManager_onLoad = DataManager.onLoad;
|
||||
//=============================================================================
|
||||
// * On Load Processing
|
||||
//=============================================================================
|
||||
DataManager.onLoad = function(object) {
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.DataManager_onLoad.call(this, object);
|
||||
// Set Array & Type
|
||||
var array = object, type = null;
|
||||
// Object Switch
|
||||
switch (object) {
|
||||
case $dataActors: type = 'ACTOR' ;break;
|
||||
// case $dataClasses: type = 'CLASS' ;break;
|
||||
// case $dataItems: type = 'ITEM' ;break;
|
||||
// case $dataSkills: type = 'SKILL' ;break;
|
||||
}
|
||||
// If Type is not null
|
||||
if (type !== null) {
|
||||
// If Array is an array
|
||||
if (Array.isArray(array)) {
|
||||
// Go Through Array
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
// Get Data
|
||||
var data = array[i];
|
||||
// Extract MetaData
|
||||
if (data) { this.extractActorBattleListMetaData(data, type); }
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Extract Meta Data
|
||||
//=============================================================================
|
||||
DataManager.extractActorBattleListMetaData = function(data, type) {
|
||||
// If Data has no notes return
|
||||
if (data.note.length <= 0) { return; }
|
||||
// If Type is Actor
|
||||
if (type === 'ACTOR' || type === 'CLASS') {
|
||||
// If Data Meta has Info Text
|
||||
// Get Regexp
|
||||
var noteData = data.note.split(/[\r\n]+/);
|
||||
var regS = /<BattleCommandsList>/i, regE = /<\/BattleCommandsList>/;
|
||||
// Set Addline Flag to false
|
||||
var addLine = false;
|
||||
// Convert Battle Command List
|
||||
data.meta.BattleCommandsList = [];
|
||||
// Go Through Note Data
|
||||
for (var i = 0; i < noteData.length; i++) {
|
||||
var line = noteData[i];
|
||||
if (line.match(regS)) { addLine = true ; continue ;}
|
||||
if (line.match(regE)) { addLine = false ; continue ;}
|
||||
// If add line flag is true
|
||||
if (addLine) {
|
||||
var commandData = line.split(/:/i);
|
||||
data.meta.BattleCommandsList.push({ type: commandData[0].toLowerCase(), id: Number(commandData[1]) })
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Actor
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for an actor.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.BattleCommandsList.Game_Actor_setup = Game_Actor.prototype.setup;
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.setup = function(actorId) {
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.Game_Actor_setup.call(this, actorId);
|
||||
// Initialize Battle Command List
|
||||
this.initBattleCommandsList();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Initialize Actor Battle Commands List
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.initBattleCommandsList = function() {
|
||||
// Get Actor & Current Class
|
||||
var actor = this.actor(), currentClass = this.currentClass();
|
||||
// Find Corrent Battle Command List
|
||||
if (actor.meta.BattleCommandsList) {
|
||||
// Set Battle Command List
|
||||
this._battleCommandsList = actor.meta.BattleCommandsList.clone();
|
||||
} else if (currentClass.meta.BattleCommandsList) {
|
||||
// Set Battle Command List
|
||||
this._battleCommandsList = currentClass.meta.BattleCommandsList.clone();
|
||||
} else {
|
||||
// Set Battle Command List
|
||||
this._battleCommandsList = []
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Battler has custom battle commands
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.hasCustomBattleCommands = function() { return this._battleCommandsList.length > 0; };
|
||||
//=============================================================================
|
||||
// * Get Actor Battle Commands List
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.battleCommandsList = function() { return this._battleCommandsList; };
|
||||
//=============================================================================
|
||||
// * Determine if Actor can show item battle command
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.canShowItemBattleCommand = function(item) {
|
||||
if (item.meta.CommandHideUntilUsable && !this.canUse(item)) { return false; };
|
||||
if (item.meta.CommandHideUntilLearned && !this.isLearnedSkill(item.id)) { return false; };
|
||||
if (item.meta.CommandHideUntilSwitch && !$gameSwitches.value(Number(item.meta.CommandHideUntilSwitch))) { return false; };
|
||||
// Return true by default
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_ActorCommand
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selecting an actor's action on the battle screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.BattleCommandsList.Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList;
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_ActorCommand.prototype.makeCommandList = function() {
|
||||
// If Actor has Custom Battle Commands
|
||||
if (this._actor && this._actor.hasCustomBattleCommands()) {
|
||||
// Make Custom Actor Command List
|
||||
this.makeCustomActorCommandList();
|
||||
return;
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.Window_ActorCommand_makeCommandList.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Custom Actor Command List
|
||||
//=============================================================================
|
||||
Window_ActorCommand.prototype.makeCustomActorCommandList = function() {
|
||||
// Get Actor
|
||||
var actor = this._actor;
|
||||
// Get Actor Battle Commands List
|
||||
var list = actor.battleCommandsList();
|
||||
// Go Through List
|
||||
for (var i = 0; i < list.length; i++) { this.addActorCustomCommand(list[i]); };
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Actor Custom Command
|
||||
//=============================================================================
|
||||
Window_ActorCommand.prototype.addActorCustomCommand = function(obj) {
|
||||
// Get Actor
|
||||
var actor = this._actor;
|
||||
// Object type case
|
||||
switch (obj.type.toLowerCase()) {
|
||||
case 'attack': this.addAttackCommand() ;break;
|
||||
case 'skilllist': this.addSkillCommands() ;break;
|
||||
case 'defend': this.addGuardCommand() ;break;
|
||||
case 'items': this.addItemCommand() ;break;
|
||||
case 'skilltypelist':
|
||||
var stypeId = obj.id;
|
||||
var presetName = _TDS_.BattleCommandsList.params.sTypeNames[stypeId];
|
||||
// If Stype Names is not ''
|
||||
if (presetName && presetName !== '') {
|
||||
var name = presetName;
|
||||
} else {
|
||||
var name = $dataSystem.skillTypes[stypeId];
|
||||
}
|
||||
this.addCommand(name, 'skill', true, stypeId);
|
||||
break;
|
||||
case 'skill':
|
||||
// Get Skill
|
||||
var skill = $dataSkills[obj.id];
|
||||
// If Skill command can be shown
|
||||
if (actor.canShowItemBattleCommand(skill)) {
|
||||
// Get Skill Name
|
||||
var name = (skill.meta.CommandName || skill.name).trim();
|
||||
// Add Command
|
||||
this.addCommand(name, 'actionSkill', actor.canUse(skill), skill.id);
|
||||
}
|
||||
break;
|
||||
case 'item':
|
||||
// Get Skill
|
||||
var item = $dataItems[obj.id];
|
||||
// If Item command can be shown
|
||||
if (actor.canShowItemBattleCommand(item)) {
|
||||
// Get Item Name
|
||||
var name = (item.meta.CommandName || item.name).trim();
|
||||
// Add Command
|
||||
this.addCommand(name, 'actionItem', actor.canUse(item), item.id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.addCommand('ERROR', 'ERROR', false);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Battle
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the battle screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.BattleCommandsList.Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
|
||||
_TDS_.BattleCommandsList.Scene_Battle_onEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
|
||||
_TDS_.BattleCommandsList.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel;
|
||||
//=============================================================================
|
||||
// * Create Actor Command Window
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.createActorCommandWindow = function() {
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.Scene_Battle_createActorCommandWindow.call(this);
|
||||
// Set Actor Command Window Handlers
|
||||
this._actorCommandWindow.setHandler('actionSkill', this.commandActorCommandAction.bind(this));
|
||||
this._actorCommandWindow.setHandler('actionItem', this.commandActorCommandAction.bind(this));
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Enemy Cancel
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.onEnemyCancel = function() {
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.Scene_Battle_onEnemyCancel.call(this);
|
||||
switch (this._actorCommandWindow.currentSymbol()) {
|
||||
case 'actionSkill':
|
||||
this._actorCommandWindow.activate();
|
||||
break;
|
||||
case 'actionItem':
|
||||
this._actorCommandWindow.activate();
|
||||
break;
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Actor Cancel
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.onActorCancel = function() {
|
||||
// Run Original Function
|
||||
_TDS_.BattleCommandsList.Scene_Battle_onActorCancel.call(this);
|
||||
switch (this._actorCommandWindow.currentSymbol()) {
|
||||
case 'actionSkill':
|
||||
this._actorCommandWindow.activate();
|
||||
break;
|
||||
case 'actionItem':
|
||||
this._actorCommandWindow.activate();
|
||||
break;
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Actor Command Window
|
||||
//=============================================================================
|
||||
Scene_Battle.prototype.commandActorCommandAction = function() {
|
||||
var symbol = this._actorCommandWindow.currentSymbol();
|
||||
var id = this._actorCommandWindow.currentExt();
|
||||
var action = BattleManager.inputtingAction();
|
||||
if (symbol === 'actionSkill') { action.setSkill(id); }
|
||||
if (symbol === 'actionItem') { action.setItem(id); }
|
||||
this.onSelectAction();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
447
www/js/plugins/Character_Movement_Graphics.js
Normal file
447
www/js/plugins/Character_Movement_Graphics.js
Normal file
|
|
@ -0,0 +1,447 @@
|
|||
//=============================================================================
|
||||
// TDS Character Movement Graphics
|
||||
// Version: 1.5
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_CharacterMovementGraphics = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.CharacterMovementGraphics = _TDS_.CharacterMovementGraphics || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugins let's you set special graphics for character movements such as:
|
||||
* idle, walking, and running.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Use the following in a script call to set the movement graphics for an
|
||||
* actor:
|
||||
*
|
||||
* $gameActors.actor(actorId).setMovementGraphics(idle, walking, running);
|
||||
* ^ actorId: Actor database ID.
|
||||
* ^ idle: Graphics name for idle. (Not moving)
|
||||
* ^ walking: Graphics name for walking. (Normal walking)
|
||||
* ^ running: Graphics name for running. (Moving and Dashing at the same time)
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* $gameActors.actor(1).setMovementGraphics('$NormalMale', '$NormalMale', '$Teen_Male%(8)');
|
||||
*
|
||||
*
|
||||
* Use the following in a script call to clear he movement graphics for an
|
||||
* actor:
|
||||
*
|
||||
* $gameActors.actor(actorId).clearMovementGraphics();
|
||||
* ^ actorId: Actor database ID.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* $gameActors.actor(1).clearMovementGraphics();
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Actor
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for an actor.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CharacterMovementGraphics.Game_Actor_initMembers = Game_Actor.prototype.initMembers;
|
||||
//=============================================================================
|
||||
// * Initialize Members
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.initMembers = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CharacterMovementGraphics.Game_Actor_initMembers.call(this);
|
||||
// Initialize Character Movement Graphics
|
||||
this._characterMovementGraphics = {};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Movement Graphics
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.setMovementGraphics = function(idle, walking, running) {
|
||||
// Set Character Movement Graphics
|
||||
this.setMovementGraphicData('idle', idle);
|
||||
this.setMovementGraphicData('walking', walking);
|
||||
this.setMovementGraphicData('running', running);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Movement Graphic Data
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.setMovementGraphicData = function(name, data) {
|
||||
// Set Default Data
|
||||
if (typeof data === 'string') { data = { name: data, index: 1 }; };
|
||||
// Set Character Movement Graphics Data
|
||||
this._characterMovementGraphics[name.toLowerCase()] = data;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Movement Graphics
|
||||
//=============================================================================
|
||||
Game_Actor.prototype.clearMovementGraphics = function() {
|
||||
// Delete Character Movement Graphics
|
||||
delete this._characterMovementGraphics;
|
||||
// Initialize Character Movement Graphics
|
||||
this._characterMovementGraphics = {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_CharacterBase
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Character. It handles basic information, such as
|
||||
// coordinates and images, shared by all characters.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CharacterMovementGraphics.Game_CharacterBase_update = Game_CharacterBase.prototype.update;
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.update = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CharacterMovementGraphics.Game_CharacterBase_update.call(this);
|
||||
// Update Movement Graphics
|
||||
this.updateMovementGraphics();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Movement Graphic should be updated
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.canUpdateMovementGraphics = function() { return false; };
|
||||
//=============================================================================
|
||||
// * Determine if running graphic should be used
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.shouldUseRunningGraphics = function() { return false; }
|
||||
//=============================================================================
|
||||
// * Determine if Character is climbing
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.isClimbing = function() { return this.regionId() === 90; };
|
||||
//=============================================================================
|
||||
// * Get Movement Graphics Source
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.movementGraphicsSource = function() { return null };
|
||||
//=============================================================================
|
||||
// * Update Movement Graphics
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.updateMovementGraphics = function() {
|
||||
// If Normal
|
||||
if (this.canUpdateMovementGraphics()) {
|
||||
// Get Actor
|
||||
var actor = this.movementGraphicsSource();
|
||||
// If Actor Exists
|
||||
if (actor) {
|
||||
// Get Graphics
|
||||
var graphics = actor._characterMovementGraphics;
|
||||
// Get Character Graphic Name
|
||||
var characterName = this.characterName();
|
||||
// Get character index
|
||||
var characterIndex = this.characterIndex();
|
||||
// If Moving
|
||||
if (this.isMoving()) {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (this.shouldUseRunningGraphics()) {
|
||||
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.running.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.running.name, graphics.running.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.walking.name, graphics.walking.index);
|
||||
}
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.idle.name, graphics.idle.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// Update Toast
|
||||
this.updateToast();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Toast
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.updateToast = function() {
|
||||
// Get Actor
|
||||
var actor = this.movementGraphicsSource();
|
||||
// If Actor exists
|
||||
if (actor) {
|
||||
// If Switch 12 is on
|
||||
if ($gameSwitches.value(12) === true) {
|
||||
// If Actor is dead
|
||||
if (actor.isDead()) {
|
||||
// Get Character Graphic Name
|
||||
var characterName = this.characterName();
|
||||
// If not on Toasted
|
||||
if (characterName !== '$Toasted') { this.setImage("$Toasted", 0); }
|
||||
this.setStepAnime(true);
|
||||
} else {
|
||||
this.setStepAnime(false);
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Player
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the player. It contains event starting
|
||||
// determinants and map scrolling functions.
|
||||
//=============================================================================
|
||||
// * Determine if Movement Graphic should be updated
|
||||
//=============================================================================
|
||||
Game_Player.prototype.canUpdateMovementGraphics = function() { return this.isNormal() && this.movementGraphicsSource().isAlive(); };
|
||||
//=============================================================================
|
||||
// * Get Movement Graphics Source
|
||||
//=============================================================================
|
||||
Game_Player.prototype.movementGraphicsSource = function() { return $gameParty.leader(); };
|
||||
//=============================================================================
|
||||
// * Determine if running graphic should be used
|
||||
//=============================================================================
|
||||
Game_Player.prototype.shouldUseRunningGraphics = function() { return this.isDashing(); }
|
||||
|
||||
Game_Player.prototype.getFollowers = function() {
|
||||
return this._followers;
|
||||
};
|
||||
|
||||
Game_Followers.prototype.getFollowerById = function(id) {
|
||||
// Go Through Data
|
||||
for (var i = 0; i < this._data.length; i++) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// If Follower Graphics Data matches the ID
|
||||
if (follower._graphicsData && follower._graphicsData.id === id) {
|
||||
return follower;
|
||||
};
|
||||
};
|
||||
return null;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Follower
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a follower. A follower is an allied character,
|
||||
// other than the front character, displayed in the party.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CharacterMovementGraphics.Game_Follower_initialize = Game_Follower.prototype.initialize;
|
||||
Game_Follower.prototype.initialize = function(memberIndex) {
|
||||
_TDS_.CharacterMovementGraphics.Game_Follower_initialize.call(this, memberIndex);
|
||||
this._characterMovementGraphics = null;
|
||||
this._hasCharacterMovementGraphics = false;
|
||||
};
|
||||
|
||||
_TDS_.CharacterMovementGraphics.Game_Follower_update = Game_Follower.prototype.update;
|
||||
//=============================================================================
|
||||
// * Determine if Movement Graphic should be updated
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.canUpdateMovementGraphics = function() {
|
||||
// Get Source
|
||||
var source = this.movementGraphicsSource();
|
||||
// Return if source exists and is alive
|
||||
if (source) {
|
||||
return $gamePlayer.isNormal() && this.isVisible() && source && source.isAlive();
|
||||
} else {
|
||||
return this._graphicsData && this._graphicsData.id && this._hasCharacterMovementGraphics;
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Movement Graphics Source
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.movementGraphicsSource = function() { return this.actor() };
|
||||
//=============================================================================
|
||||
// * Determine if running graphic should be used
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.shouldUseRunningGraphics = function() { return $gamePlayer.isDashing(); }
|
||||
|
||||
//=============================================================================
|
||||
// * Determine if running graphic should be used
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.update = function() {
|
||||
// Run Original Version
|
||||
_TDS_.CharacterMovementGraphics.Game_Follower_update.call(this);
|
||||
// Update Toast
|
||||
this.updateToast();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Set Movement Graphics
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.setMovementGraphics = function(idle, walking, running) {
|
||||
// Set Character Movement Graphics
|
||||
if (!this._characterMovementGraphics) this._characterMovementGraphics = {};
|
||||
this._hasCharacterMovementGraphics= true;
|
||||
this.setMovementGraphicData('idle', idle);
|
||||
this.setMovementGraphicData('walking', walking);
|
||||
this.setMovementGraphicData('running', running);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Movement Graphic Data
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.setMovementGraphicData = function(name, data) {
|
||||
if (!this._characterMovementGraphics) this._characterMovementGraphics = {};
|
||||
// Set Default Data
|
||||
if (typeof data === 'string') { data = { name: data, index: 1 }; };
|
||||
// Set Character Movement Graphics Data
|
||||
this._characterMovementGraphics[name.toLowerCase()] = data;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Movement Graphics
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.clearMovementGraphics = function() {
|
||||
// Delete Character Movement Graphics
|
||||
delete this._characterMovementGraphics;
|
||||
// Initialize Character Movement Graphics
|
||||
this._characterMovementGraphics = null;
|
||||
this._hasCharacterMovementGraphics = false;
|
||||
};
|
||||
|
||||
Game_Follower.prototype.updateMovementGraphics = function() {
|
||||
// If Normal
|
||||
if (this.canUpdateMovementGraphics()) {
|
||||
// Get Actor
|
||||
var actor = this.movementGraphicsSource();
|
||||
// If Actor Exists
|
||||
if (actor) {
|
||||
// Get Graphics
|
||||
var graphics = actor._characterMovementGraphics;
|
||||
// Get Character Graphic Name
|
||||
var characterName = this.characterName();
|
||||
// Get character index
|
||||
var characterIndex = this.characterIndex();
|
||||
// If Moving
|
||||
if (this.isMoving()) {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
|
||||
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
|
||||
}
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (this.shouldUseRunningGraphics()) {
|
||||
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.running.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.running.name, graphics.running.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.walking.name, graphics.walking.index);
|
||||
}
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
|
||||
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
|
||||
}
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.idle.name, graphics.idle.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this._characterMovementGraphics) {
|
||||
// Get Graphics
|
||||
var graphics = this._characterMovementGraphics;
|
||||
// Get Character Graphic Name
|
||||
var characterName = this.characterName();
|
||||
// Get character index
|
||||
var characterIndex = this.characterIndex();
|
||||
// If Moving
|
||||
if (this.isMoving()) {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
|
||||
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
|
||||
}
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (this.shouldUseRunningGraphics()) {
|
||||
if (graphics.running && (characterName !== graphics.running.name || characterIndex !== graphics.running.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.running.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.running.name, graphics.running.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.walking && (characterName !== graphics.walking.name || characterIndex !== graphics.walking.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.walking.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.walking.name, graphics.walking.index);
|
||||
}
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// If Climbing
|
||||
if (this.isClimbing()) {
|
||||
if (characterName === "DW_BASIL" || characterName === "$DW_BASIL_RUN%(8)") {
|
||||
this._characterMovementGraphics.climbing = { name: "DW_Climb", index: 0 };
|
||||
}
|
||||
if (graphics.climbing && (characterName !== graphics.climbing.name || characterIndex !== graphics.climbing.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.climbing.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.climbing.name, graphics.climbing.index);
|
||||
}
|
||||
} else {
|
||||
if (graphics.idle && this._stopCount > 0 && (characterName !== graphics.idle.name || characterIndex !== graphics.idle.index)) {
|
||||
let bitmap = ImageManager.loadCharacter(graphics.idle.name);
|
||||
if(!bitmap.isReady()) {return;}
|
||||
this.setImage(graphics.idle.name, graphics.idle.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// Update Toast
|
||||
this.updateToast();
|
||||
};
|
||||
266
www/js/plugins/Community_Basic.js
Normal file
266
www/js/plugins/Community_Basic.js
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
/*:
|
||||
* @plugindesc Basic plugin for manipulating important parameters.
|
||||
* @author RM CoreScript team
|
||||
*
|
||||
* @help
|
||||
* Basic plugin for manipulating important parameters.
|
||||
* There is no plugin command.
|
||||
*
|
||||
* Caching images improves performance but increases memory allocation.
|
||||
* On mobile devices, a lot of memory allocation causes the browser to crash.
|
||||
* Therefore, the upper limit of memory allocation is set with cacheLimit.
|
||||
*
|
||||
* If you want to regain high performance, just increase cacheLimit.
|
||||
* There is no need to revert to 1.4.
|
||||
*
|
||||
* @param cacheLimit
|
||||
* @type number
|
||||
* @desc The upper limit of images' cached size (MPixel)
|
||||
* @default 10
|
||||
*
|
||||
* @param screenWidth
|
||||
* @type number
|
||||
* @desc The resolution of screen width
|
||||
* @default 816
|
||||
*
|
||||
* @param screenHeight
|
||||
* @type number
|
||||
* @desc The resolution of screen height
|
||||
* @default 624
|
||||
*
|
||||
* @param changeWindowWidthTo
|
||||
* @type number
|
||||
* @desc If set, change window width to this value
|
||||
*
|
||||
* @param changeWindowHeightTo
|
||||
* @type number
|
||||
* @desc If set, change window height to this value
|
||||
*
|
||||
* @param renderingMode
|
||||
* @type select
|
||||
* @option canvas
|
||||
* @option webgl
|
||||
* @option auto
|
||||
* @desc The rendering mode (canvas/webgl/auto)
|
||||
* @default auto
|
||||
*
|
||||
* @param alwaysDash
|
||||
* @type boolean
|
||||
* @desc The initial value whether the player always dashes (on/off)
|
||||
* @on ON
|
||||
* @off OFF
|
||||
* @default false
|
||||
*
|
||||
* @param textSpeed
|
||||
* @type number
|
||||
* @desc The text speed on "Show Text". The larger this parameter is, the slower text speed. (0: show all texts at once)
|
||||
* @default 1
|
||||
*
|
||||
* @param enableProgressBar
|
||||
* @type boolean
|
||||
* @desc Show progress bar when it takes a long time to load resources
|
||||
* @default true
|
||||
*
|
||||
* @param maxRenderingFps
|
||||
* @type number
|
||||
* @desc The maximum value of rendering frame per seconds (0: unlimited)
|
||||
* @default 0
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc 基本的なパラメーターを設定するプラグインです。
|
||||
* @author RM CoreScript team
|
||||
*
|
||||
* @help
|
||||
* 基本的なパラメーターを設定するプラグインです。
|
||||
* このプラグインにはプラグインコマンドはありません。
|
||||
*
|
||||
* 画像をキャッシュするとパフォーマンスは向上しますが、その分メモリ確保も増大します。
|
||||
* モバイルデバイスでは、たくさんのメモリ確保はブラウザをクラッシュさせます。
|
||||
* そこで、メモリ確保の上限を「画像キャッシュ上限値」で設定しています。
|
||||
*
|
||||
* もし高いパフォーマンスを取り戻したければ、ただ画像キャッシュ上限値を増加させればよいです。
|
||||
* 1.4に戻す必要はありません。
|
||||
*
|
||||
* @param cacheLimit
|
||||
* @type number
|
||||
* @text 画像キャッシュ上限値
|
||||
* @desc 画像のメモリへのキャッシュの上限値 (MPix)
|
||||
* @default 10
|
||||
*
|
||||
* @param screenWidth
|
||||
* @type number
|
||||
* @text ゲーム画面の幅
|
||||
* @default 816
|
||||
*
|
||||
* @param screenHeight
|
||||
* @type number
|
||||
* @text ゲーム画面の高さ
|
||||
* @default 624
|
||||
*
|
||||
* @param changeWindowWidthTo
|
||||
* @type number
|
||||
* @text ウィンドウの幅
|
||||
* @desc 値が設定されなかった場合、ゲーム画面の幅と同じ
|
||||
*
|
||||
* @param changeWindowHeightTo
|
||||
* @type number
|
||||
* @text ウィンドウの高さ
|
||||
* @desc 値が設定されなかった場合、ゲーム画面の高さと同じ
|
||||
*
|
||||
* @param renderingMode
|
||||
* @type select
|
||||
* @option canvas
|
||||
* @option webgl
|
||||
* @option auto
|
||||
* @text レンダリングモード
|
||||
* @default auto
|
||||
*
|
||||
* @param alwaysDash
|
||||
* @type boolean
|
||||
* @text 「常時ダッシュ」の初期値
|
||||
* @on ON
|
||||
* @off OFF
|
||||
* @default false
|
||||
*
|
||||
* @param textSpeed
|
||||
* @type number
|
||||
* @text 「文章の表示」のスピード
|
||||
* @desc 数字が大きいほど文章の表示スピードが遅くなります (0を指定した場合は一度に全文を表示します)
|
||||
* @default 1
|
||||
*
|
||||
* @param autoSaveFileId
|
||||
* @type number
|
||||
* @text オートセーブ番号
|
||||
* @desc 「場所移動」の際に指定したファイル番号にオートセーブします(0を指定した場合はオートセーブしません)
|
||||
* @default 0
|
||||
*
|
||||
* @param errorMessage
|
||||
* @type string
|
||||
* @text エラーメッセージ
|
||||
* @desc エラー時にプレイヤーに向けて表示するメッセージです
|
||||
* @default エラーが発生しました。ゲームの作者にご連絡ください。
|
||||
*
|
||||
* @param showErrorDetail
|
||||
* @type boolean
|
||||
* @text エラー詳細表示
|
||||
* @desc ONにすると、エラー時にエラーを発生させたイベントの情報とスタックトレースを表示します
|
||||
* @default true
|
||||
*
|
||||
* @param enableProgressBar
|
||||
* @type boolean
|
||||
* @text ロード進捗バー有効化
|
||||
* @desc ONにすると、読み込みに時間がかかっている時にロード進捗バーを表示します
|
||||
* @default true
|
||||
*
|
||||
* @param maxRenderingFps
|
||||
* @type number
|
||||
* @text 描画FPS上限値
|
||||
* @desc 描画FPSの上限値を設定します (0を指定した場合は制限なし)
|
||||
* @default 0
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
function isNumber(str) {
|
||||
return !!str && !isNaN(str);
|
||||
}
|
||||
|
||||
function toNumber(str, def) {
|
||||
return isNumber(str) ? +str : def;
|
||||
}
|
||||
|
||||
var parameters = PluginManager.parameters('Community_Basic');
|
||||
var cacheLimit = toNumber(parameters['cacheLimit'], 10);
|
||||
var screenWidth = toNumber(parameters['screenWidth'], 816);
|
||||
var screenHeight = toNumber(parameters['screenHeight'], 624);
|
||||
var renderingMode = parameters['renderingMode'].toLowerCase();
|
||||
var alwaysDash = (parameters['alwaysDash'] === 'true') ||(parameters['alwaysDash'] === 'on');
|
||||
var textSpeed = toNumber(parameters['textSpeed'], 1);
|
||||
var windowWidthTo = toNumber(parameters['changeWindowWidthTo'], 0);
|
||||
var windowHeightTo = toNumber(parameters['changeWindowHeightTo'], 0);
|
||||
var maxRenderingFps = toNumber(parameters['maxRenderingFps'], 0);
|
||||
var errorMessage = parameters['errorMessage'];
|
||||
var showErrorDetail = parameters['showErrorDetail'] === 'true';
|
||||
var enableProgressBar = parameters['enableProgressBar'] === 'true';
|
||||
|
||||
var windowWidth;
|
||||
var windowHeight;
|
||||
|
||||
if(windowWidthTo){
|
||||
windowWidth = windowWidthTo;
|
||||
}else if(screenWidth !== SceneManager._screenWidth){
|
||||
windowWidth = screenWidth;
|
||||
}
|
||||
|
||||
if(windowHeightTo){
|
||||
windowHeight = windowHeightTo;
|
||||
}else if(screenHeight !== SceneManager._screenHeight){
|
||||
windowHeight = screenHeight;
|
||||
}
|
||||
|
||||
|
||||
ImageCache.limit = cacheLimit * 1000 * 1000;
|
||||
SceneManager._screenWidth = screenWidth;
|
||||
SceneManager._screenHeight = screenHeight;
|
||||
SceneManager._boxWidth = screenWidth;
|
||||
SceneManager._boxHeight = screenHeight;
|
||||
|
||||
SceneManager.preferableRendererType = function() {
|
||||
if (Utils.isOptionValid('canvas')) {
|
||||
return 'canvas';
|
||||
} else if (Utils.isOptionValid('webgl')) {
|
||||
return 'webgl';
|
||||
} else if (renderingMode === 'canvas') {
|
||||
return 'canvas';
|
||||
} else if (renderingMode === 'webgl') {
|
||||
return 'webgl';
|
||||
} else {
|
||||
return 'auto';
|
||||
}
|
||||
};
|
||||
|
||||
var _ConfigManager_applyData = ConfigManager.applyData;
|
||||
ConfigManager.applyData = function(config) {
|
||||
_ConfigManager_applyData.apply(this, arguments);
|
||||
if (config['alwaysDash'] === undefined) {
|
||||
this.alwaysDash = alwaysDash;
|
||||
}
|
||||
};
|
||||
|
||||
var _Window_Message_clearFlags = Window_Message.prototype.clearFlags;
|
||||
Window_Message.prototype.clearFlags = function(textState) {
|
||||
_Window_Message_clearFlags.apply(this, arguments);
|
||||
this._textSpeed = textSpeed - 1;
|
||||
};
|
||||
|
||||
var _SceneManager_initNwjs = SceneManager.initNwjs;
|
||||
SceneManager.initNwjs = function() {
|
||||
_SceneManager_initNwjs.apply(this, arguments);
|
||||
|
||||
if (Utils.isNwjs() && windowWidth && windowHeight) {
|
||||
var dw = windowWidth - window.innerWidth;
|
||||
var dh = windowHeight - window.innerHeight;
|
||||
window.moveBy(-dw / 2, -dh / 2);
|
||||
window.resizeBy(dw, dh);
|
||||
}
|
||||
};
|
||||
|
||||
if (maxRenderingFps) {
|
||||
var currentTime = Date.now();
|
||||
var deltaTime = 1000 / maxRenderingFps;
|
||||
var accumulator = 0;
|
||||
var _SceneManager_renderScene = SceneManager.renderScene;
|
||||
SceneManager.renderScene = function() {
|
||||
var newTime = Date.now();
|
||||
accumulator += newTime - currentTime;
|
||||
currentTime = newTime;
|
||||
if (accumulator >= deltaTime) {
|
||||
accumulator -= deltaTime;
|
||||
_SceneManager_renderScene.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Graphics.setProgressEnabled(enableProgressBar);
|
||||
})();
|
||||
316
www/js/plugins/CordovaFixes.js
Normal file
316
www/js/plugins/CordovaFixes.js
Normal file
|
|
@ -0,0 +1,316 @@
|
|||
// by VienDesu! Poring Team 2023
|
||||
|
||||
// ============================================================
|
||||
// Add Cordova pause/resume events support for AudioManager
|
||||
// ============================================================
|
||||
|
||||
var currentBgm = null;
|
||||
var currentBgs = null;
|
||||
|
||||
document.addEventListener("deviceready", onCordovaDeviceReady, false);
|
||||
|
||||
function onCordovaDeviceReady() {
|
||||
console.log("AudioManager - SETUP!!!"); //Remove in release
|
||||
document.addEventListener("pause", onCordovaPause, false);
|
||||
document.addEventListener("resume", onCordovaResume, false);
|
||||
};
|
||||
|
||||
function onCordovaPause() {
|
||||
console.log("AudioManager - HIDE!!!"); //Remove in release
|
||||
currentBgm = AudioManager.saveBgm();
|
||||
currentBgs = AudioManager.saveBgs();
|
||||
AudioManager.stopAll();
|
||||
};
|
||||
|
||||
function onCordovaResume() {
|
||||
console.log("AudioManager - SHOW!!!"); //Remove in release
|
||||
AudioManager.replayBgm(currentBgm);
|
||||
AudioManager.replayBgs(currentBgs);
|
||||
};
|
||||
|
||||
// =========================================================
|
||||
// Add Cordova pause/resume events support for RPG Maker
|
||||
// =========================================================
|
||||
|
||||
WebAudio.prototype._setupEventHandlers = function () {
|
||||
var resumeHandler = function () {
|
||||
var context = WebAudio._context;
|
||||
if (context && context.state === "suspended" && typeof context.resume === "function") {
|
||||
context.resume().then(function () {
|
||||
WebAudio._onTouchStart();
|
||||
});
|
||||
} else {
|
||||
WebAudio._onTouchStart();
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", resumeHandler);
|
||||
document.addEventListener("mousedown", resumeHandler);
|
||||
document.addEventListener("touchend", resumeHandler);
|
||||
document.addEventListener('touchstart', this._onTouchStart.bind(this));
|
||||
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
|
||||
document.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
|
||||
};
|
||||
|
||||
WebAudio.prototype._onCordovaDeviceReady = function () {
|
||||
console.log("WebAudio - SETUP!!!"); //Remove in release
|
||||
document.addEventListener("pause", this._onCordovaPause.bind(this), false);
|
||||
document.addEventListener("resume", this._onCordovaResume.bind(this), false);
|
||||
};
|
||||
|
||||
WebAudio.prototype._onCordovaPause = function () {
|
||||
console.log("WebAudio - HIDE!!!"); //Remove in release
|
||||
this._onHide();
|
||||
};
|
||||
|
||||
WebAudio.prototype._onCordovaResume = function () {
|
||||
console.log("WebAudio - SHOW!!!"); //Remove in release
|
||||
this._onShow();
|
||||
};
|
||||
|
||||
Html5Audio.prototype._setupEventHandlers = function () {
|
||||
document.addEventListener('touchstart', this._onTouchStart.bind(this));
|
||||
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
|
||||
this._audioElement.addEventListener("loadeddata", this._onLoadedData.bind(this));
|
||||
this._audioElement.addEventListener("error", this._onError.bind(this));
|
||||
this._audioElement.addEventListener("ended", this._onEnded.bind(this));
|
||||
this._audioElement.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
|
||||
};
|
||||
|
||||
Html5Audio.prototype._onCordovaDeviceReady = function () {
|
||||
console.log("Html5Audio - SETUP!!!"); //Remove in release
|
||||
this._audioElement.addEventListener("pause", this._onCordovaPause.bind(this), false);
|
||||
this._audioElement.addEventListener("resume", this._onCordovaResume.bind(this), false);
|
||||
};
|
||||
|
||||
Html5Audio.prototype._onCordovaPause = function () {
|
||||
console.log("Html5Audio - HIDE!!!"); //Remove in release
|
||||
this._onHide();
|
||||
};
|
||||
|
||||
Html5Audio.prototype._onCordovaResume = function () {
|
||||
console.log("Html5Audio - SHOW!!!"); //Remove in release
|
||||
this._onShow();
|
||||
};
|
||||
|
||||
// =====================================================================
|
||||
// Add Cordova pause/resume events support for AudioStreaming plugin
|
||||
// =====================================================================
|
||||
|
||||
StreamWebAudio.prototype._setupEventHandlers = function() {
|
||||
var resumeHandler = function() {
|
||||
var context = StreamWebAudio._context;
|
||||
if (context && context.state === "suspended" && typeof context.resume === "function") {
|
||||
context.resume().then(function() {
|
||||
StreamWebAudio._onTouchStart();
|
||||
})
|
||||
} else {
|
||||
StreamWebAudio._onTouchStart();
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", resumeHandler);
|
||||
document.addEventListener("mousedown", resumeHandler);
|
||||
document.addEventListener("touchend", resumeHandler);
|
||||
document.addEventListener('touchstart', this._onTouchStart.bind(this));
|
||||
document.addEventListener('visibilitychange', this._onVisibilityChange.bind(this));
|
||||
document.addEventListener("deviceready", this._onCordovaDeviceReady.bind(this), false);
|
||||
};
|
||||
|
||||
StreamWebAudio.prototype._onCordovaDeviceReady = function () {
|
||||
console.log("StreamWebAudio - SETUP!!!"); //Remove in release
|
||||
document.addEventListener("pause", this._onCordovaPause.bind(this), false);
|
||||
document.addEventListener("resume", this._onCordovaResume.bind(this), false);
|
||||
};
|
||||
|
||||
StreamWebAudio.prototype._onCordovaPause = function () {
|
||||
console.log("StreamWebAudio - HIDE!!!"); //Remove in release
|
||||
this._onHide();
|
||||
};
|
||||
|
||||
StreamWebAudio.prototype._onCordovaResume = function () {
|
||||
console.log("StreamWebAudio - SHOW!!!"); //Remove in release
|
||||
this._onShow();
|
||||
};
|
||||
|
||||
// ============================
|
||||
// Clear back button action
|
||||
// ============================
|
||||
|
||||
document.addEventListener("backbutton", function(event){
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// =====================
|
||||
// Scale game canvas
|
||||
// =====================
|
||||
|
||||
document.addEventListener("deviceready", () => {
|
||||
Graphics._centerElement = function (element) {
|
||||
console.log("Element centered!!!");
|
||||
var width = 640 * (window.screen.height / 480);
|
||||
var height = window.screen.height;
|
||||
element.style.position = 'absolute';
|
||||
element.style.margin = 'auto';
|
||||
element.style.top = 0;
|
||||
element.style.left = 0;
|
||||
element.style.right = 0;
|
||||
element.style.bottom = 0;
|
||||
element.style.width = width + 'px';
|
||||
element.style.height = height + 'px';
|
||||
};
|
||||
})
|
||||
|
||||
// ===========================
|
||||
// Gamepad tips on default
|
||||
// ===========================
|
||||
|
||||
ConfigManager.gamepadTips = true;
|
||||
|
||||
ConfigManager.applyData = function (config) {
|
||||
_TDS_.OmoriBASE.ConfigManager_applyData.call(this, config);
|
||||
var initCheckList = ['characterStrafe', 'battleAnimations',
|
||||
'battleAnimationSpeed', 'battleLogSpeed', 'screenResolution',
|
||||
'fullScreen', 'menuAnimations']
|
||||
for (var i = 0; i < initCheckList.length; i++) {
|
||||
var name = initCheckList[i];
|
||||
if (config[name] === undefined) { config[name] = this[name]; };
|
||||
};
|
||||
Yanfly.Param.ScreenWidth = 640 * (config.screenResolution + 1);
|
||||
Yanfly.Param.ScreenHeight = 480 * (config.screenResolution + 1);
|
||||
SceneManager._screenWidth = Yanfly.Param.ScreenWidth;
|
||||
SceneManager._screenHeight = Yanfly.Param.ScreenHeight;
|
||||
this.characterTurning = config.characterTurning;
|
||||
this.characterStrafe = config.characterStrafe;
|
||||
this.battleAnimations = config.battleAnimations;
|
||||
this.battleAnimationSpeed = config.battleAnimationSpeed;
|
||||
this.battleLogSpeed = config.battleLogSpeed === undefined ? 1 : config.battleLogSpeed;
|
||||
this.screenResolution = config.screenResolution;
|
||||
this.fullScreen = config.fullScreen;
|
||||
this.menuAnimations = config.menuAnimations;
|
||||
this.gamepadTips = config.gamepadTips || true;
|
||||
this.textSkip = config.textSkip || false;
|
||||
Input.keyMapper = config.keyboardInputMap;
|
||||
Input.gamepadMapper = config.gamepadInputMap;
|
||||
if (Input.keyMapper === undefined) { this.setDefaultKeyboardKeyMap(); };
|
||||
if (Input.gamepadMapper === undefined) { this.setDefaultGamepadKeyMap(); };
|
||||
Yanfly.updateResolution();
|
||||
Yanfly.moveToCenter();
|
||||
|
||||
if ($gameSwitches) {
|
||||
if (_TDS_.CharacterPressTurn_Strafing) {
|
||||
$gameSwitches.setValue(_TDS_.CharacterPressTurn_Strafing.params.strafingDisableSwitchID, this.characterStrafe);
|
||||
$gameSwitches.setValue(_TDS_.CharacterPressTurn_Strafing.params.pressDisableSwitchID, this.characterTurning)
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ConfigManager.restoreDefaultConfig = function () {
|
||||
const fs = require("fs");
|
||||
const path = require('path');
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
base = path.join(base, 'save/');
|
||||
if (fs.existsSync(base + "config.rpgsave")) { fs.unlinkSync(base + "config.rpgsave"); }
|
||||
ConfigManager.characterStrafe = true;
|
||||
ConfigManager.characterTurning = true;
|
||||
ConfigManager.battleAnimations = true;
|
||||
ConfigManager.battleAnimationSpeed = 0;
|
||||
ConfigManager.battleLogSpeed = 1;
|
||||
ConfigManager.screenResolution = 0;
|
||||
ConfigManager.fullScreen = false;
|
||||
ConfigManager.menuAnimations = true;
|
||||
ConfigManager.gamepadTips = true;
|
||||
ConfigManager.alwaysDash = false;
|
||||
ConfigManager.textSkip = false;
|
||||
this.setDefaultKeyboardKeyMap();
|
||||
this.setDefaultGamepadKeyMap();
|
||||
AudioManager._bgmVolume = 70;
|
||||
AudioManager._bgsVolume = 90;
|
||||
AudioManager._meVolume = 90;
|
||||
AudioManager._seVolume = 90;
|
||||
ConfigManager.bgmVolume = 70
|
||||
ConfigManager.bgsVolume = 90
|
||||
ConfigManager.meVolume = 90
|
||||
ConfigManager.seVolume = 90
|
||||
ConfigManager.applyData(ConfigManager);
|
||||
let needsRestore = confirm(LanguageManager.languageData().text.System.plugins.optionsMenu.alertMessages["restoreGeneral"]);
|
||||
if (!!needsRestore) { DataManager._restoreGlobalInfo(); }
|
||||
}
|
||||
|
||||
// =============================
|
||||
// Saves in external storage
|
||||
// =============================
|
||||
|
||||
var save_exists;
|
||||
var save_data;
|
||||
|
||||
document.addEventListener("deviceready", () => {
|
||||
StorageManager.isLocalMode = function () {
|
||||
return true;
|
||||
};
|
||||
|
||||
NativeFunctions.saveFileExists = function(path) {
|
||||
var split_path = require.libs.path._solve_dots(path).split("/");
|
||||
save_exists = null;
|
||||
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function (dirEntry) {
|
||||
console.log(`Using externalStorage while checking save file ${path} existence`);
|
||||
dirEntry.getDirectory(split_path[0], { create: true }, function (subDirEntry) {
|
||||
subDirEntry.getFile(split_path[1], {create: false, exclusive: false}, function(fileEntry) {
|
||||
save_exists = true;
|
||||
console.log(`After "save_exists = true" - ${save_exists}`);
|
||||
}, () => {
|
||||
save_exists = false;
|
||||
console.log(`After "save_exists = false" - ${save_exists}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
console.log(`Before return - ${save_exists}`);
|
||||
return save_exists;
|
||||
}
|
||||
|
||||
NativeFunctions.readSaveFileUTF8 = function(path, fnCallback) {
|
||||
var split_path = require.libs.path._solve_dots(path).split("/");
|
||||
save_data = null;
|
||||
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function (dirEntry) {
|
||||
console.log(`Using externalStorage to read save at ${path}`);
|
||||
dirEntry.getDirectory(split_path[0], { create: true }, function (subDirEntry) {
|
||||
subDirEntry.getFile(split_path[1], {create: false, exclusive: false}, function(fileEntry) {
|
||||
fileEntry.file(function (file) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onloadend = function() {
|
||||
save_data = this.result;
|
||||
};
|
||||
|
||||
reader.readAsText(file);
|
||||
}, () => {
|
||||
console.log("Error to read external save file: " + e.toString());
|
||||
});
|
||||
}, (e) => {
|
||||
console.log("Error to find external save file: " + e.toString());
|
||||
});
|
||||
});
|
||||
});
|
||||
return save_data;
|
||||
}
|
||||
|
||||
NativeFunctions.writeSaveFileUTF8 = function(path, data) {
|
||||
var split_path = require.libs.path._solve_dots(path).split("/");
|
||||
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function (dirEntry) {
|
||||
console.log(`Writing ${path} save file to the externalStorage`);
|
||||
dirEntry.getDirectory(split_path[0], { create: true }, function (subDirEntry) {
|
||||
subDirEntry.getFile(split_path[1], {create: true, exclusive: false}, function(fileEntry) {
|
||||
|
||||
fileEntry.createWriter(function (fileWriter) {
|
||||
|
||||
fileWriter.onerror = function (e) {
|
||||
console.log("Failed file write: " + e.toString());
|
||||
};
|
||||
|
||||
fileWriter.write(data);
|
||||
});
|
||||
}, (e) => {
|
||||
console.log("Error to create external save file: " + e.toString());
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
3480
www/js/plugins/Custom Battle Action Text.js
Normal file
3480
www/js/plugins/Custom Battle Action Text.js
Normal file
File diff suppressed because it is too large
Load diff
358
www/js/plugins/Custom Picture Controls.js
Normal file
358
www/js/plugins/Custom Picture Controls.js
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
//=============================================================================
|
||||
// TDS Custom Picture Controls
|
||||
// Version: 1.2
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_CustomPictureControls = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.CustomPictureControls = _TDS_.CustomPictureControls || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin add custom controls as well as pictures for effects.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
|
||||
//=============================================================================
|
||||
// * Update Wait mode
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.updateWaitMode = function() {
|
||||
// If Wait for picture animation
|
||||
if (this._waitMode === 'pictureAnimation') {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(this._lastAnimatingPicture);
|
||||
// If Picture exists and has a finite animation
|
||||
if (picture && picture.hasAnimation(true)) { return true; }
|
||||
// Set Last animating Picture to null
|
||||
this._lastAnimatingPicture = null;
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Picture Sprite
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.getPictureSprite = function(pictureId) {
|
||||
return SceneManager._scene._spriteset._pictureContainer.children[pictureId]
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Picture Custom Frames
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.removePictureCustomFrames = function(pictureId) {
|
||||
// Get Picture
|
||||
try {
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
// If Picture Exists
|
||||
if (picture) {
|
||||
// Clear Picture Custom Frame
|
||||
picture.clearCustomFrame();
|
||||
// Reset Picture Frame
|
||||
this.getPictureSprite.resetFrame()
|
||||
};
|
||||
} catch(e) {}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup Picture Custom Frames
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setupPictureCustomFrames = function(pictureId, width, height, hFrames, vFrames) {
|
||||
// Get Vertical & Horizontal Sizes
|
||||
var fWidth = width / hFrames;
|
||||
var fHeight = height / vFrames;
|
||||
// Get Total Frames
|
||||
var totalFrames = hFrames * vFrames;
|
||||
// Initialize Rects Array
|
||||
var rects = []
|
||||
// Go Through Total frames
|
||||
for (var i = 0; i < totalFrames; i++) { rects.push(new Rectangle((i % hFrames) * fWidth, Math.floor(i / hFrames) * fHeight, fWidth, fHeight)); };
|
||||
// Setup Picture Frames
|
||||
$gameScreen.picture(pictureId).setupCustomFrame(rects);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture Frame Index
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setPictureFrameIndex = function(pictureId, index) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId)
|
||||
// Set frame Index
|
||||
picture.setCustomFrameIndex(index)
|
||||
// Update Custom Frame
|
||||
this.getPictureSprite(pictureId).updateCustomFrame();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture Animation
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setPictureAnimation = function(pictureId, frames, delay, loops = Infinity, wait = true) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
// If Picture exists
|
||||
if (picture) {
|
||||
// Create animation
|
||||
var animation = {frames: [], loops: loops, index: 0}
|
||||
// Go Through Frames
|
||||
for (var i = 0; i < frames.length; i++) {
|
||||
// Get Frame
|
||||
var frame = frames[i];
|
||||
// If frame is an array
|
||||
if (Array.isArray(frame)) {
|
||||
// Add Frame to Animation
|
||||
animation.frames.push({frame: frame[0], delay: frame[1], maxDelay: frame[1]})
|
||||
} else {
|
||||
// Add Frame to Animation
|
||||
animation.frames.push({frame: frame, delay: delay, maxDelay: delay})
|
||||
};
|
||||
};
|
||||
// Set Custom Frame animation
|
||||
picture.setCustomFrameAnimation(animation);
|
||||
// Update Custom Frame
|
||||
this.getPictureSprite(pictureId).updateCustomFrame();
|
||||
// If Wait and Loops is not infinite
|
||||
if (wait && loops !== Infinity) {
|
||||
// Set Wait mode
|
||||
this.setWaitMode('pictureAnimation')
|
||||
// Set Last Animating Picture
|
||||
this._lastAnimatingPicture = pictureId;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Game_Picture_initBasic = Game_Picture.prototype.initBasic;
|
||||
_TDS_.CustomPictureControls.Game_Picture_update = Game_Picture.prototype.update;
|
||||
//=============================================================================
|
||||
// * Initialize Basic
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.initBasic = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Game_Picture_initBasic.call(this);
|
||||
// Initialize Frame Data
|
||||
this.clearCustomFrame()
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Picture has animation
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.hasAnimation = function(finite = false) {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Frame data exists
|
||||
if (data && data.animation !== null) {
|
||||
// Return false if the animation is infinite
|
||||
if (finite && !data.animation.loops !== Infinity) { return true; };
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
// Return false by default
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.clearCustomFrame = function() { this._frameData = null; };
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setupCustomFrame = function(frames) {
|
||||
// Initialize Frame Data
|
||||
this._frameData = {frames: frames, frameIndex: 0, animation: null, refreshFrame: true}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setCustomFrameAnimation = function(animation) {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Frame data exists
|
||||
if (data) {
|
||||
// Set Frame Data Animation
|
||||
data.animation = animation;
|
||||
// Set Custom Frame Index
|
||||
this.setCustomFrameIndex(animation.frames[animation.index].frame);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.removeCustomFrameAnimation = function() {
|
||||
// If Frame data exists
|
||||
if (this._frameData) { this._frameData.animation = null; };
|
||||
}
|
||||
//=============================================================================
|
||||
// * Set Custom Frame Index
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setCustomFrameIndex = function(index) {
|
||||
// If Frame data exists
|
||||
if (this._frameData) {
|
||||
// Set Frame index
|
||||
this._frameData.frameIndex = index;
|
||||
// Set Refresh frame flag
|
||||
this._frameData.refreshFrame = true;
|
||||
};
|
||||
}
|
||||
//=============================================================================
|
||||
// * Determine if Frame needs refreshing
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.needsFrameRefresh = function() {
|
||||
if (this._frameData) { return this._frameData.refreshFrame }
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.customFrame = function() {
|
||||
return this._frameData.frames[this._frameData.frameIndex]
|
||||
}
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.update = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Game_Picture_update.call(this);
|
||||
// Update Frame Animation
|
||||
this.updateFrameAnimation();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Frame Animation
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.updateFrameAnimation = function() {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Data and Animation Data exists
|
||||
if (data && data.animation) {
|
||||
// Get Animation
|
||||
var anim = data.animation;
|
||||
// Get Animation Frame
|
||||
var frameAnim = anim.frames[anim.index];
|
||||
// If Frame Animation Delay is 0 or less
|
||||
if (frameAnim.delay <= 0) {
|
||||
// Reset Frame Animation Max Delay
|
||||
frameAnim.delay = frameAnim.maxDelay;
|
||||
// Get MAx Frames
|
||||
var maxFrames = anim.frames.length;
|
||||
// If Animation has reached the end
|
||||
if (anim.index >= maxFrames-1) {
|
||||
// If Animation loops is more than 0
|
||||
if (anim.loops > 0) {
|
||||
// Decrease Animation loop count
|
||||
anim.loops--
|
||||
// Increase Index
|
||||
anim.index = (anim.index + 1) % maxFrames;
|
||||
} else {
|
||||
// Remove Custom Frame Animation
|
||||
this.removeCustomFrameAnimation()
|
||||
};
|
||||
} else {
|
||||
// Increase Index
|
||||
anim.index = (anim.index + 1) % maxFrames;
|
||||
};
|
||||
// Set Custom Frame Index
|
||||
this.setCustomFrameIndex(anim.frames[anim.index].frame)
|
||||
} else {
|
||||
// Decrease Frame Animation Delay
|
||||
frameAnim.delay--;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The sprite for displaying a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap = Sprite_Picture.prototype.updateBitmap
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.initialize = function(pictureId) {
|
||||
// Get Picture Object
|
||||
let picture = $gameScreen.picture(pictureId);
|
||||
// If picture exists and it has frame data
|
||||
if (picture && picture._frameData) {
|
||||
// Set Refresh frame flag to true
|
||||
picture._frameData.refreshFrame = true;
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_initialize.call(this, pictureId);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Bitmap
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateBitmap = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap.call(this);
|
||||
// Get Picture Object
|
||||
var picture = this.picture();
|
||||
// If Picture Exists
|
||||
if (picture) {
|
||||
// If Picture has frame data
|
||||
if (picture._frameData) {
|
||||
// Update Custom Frame
|
||||
this.updateCustomFrame();
|
||||
} else {
|
||||
// Reset Frame
|
||||
this.resetFrame()
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Object Initialize
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateOther = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateOther.call(this);
|
||||
// Update Custom Frame
|
||||
this.updateCustomFrame();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Custom Frame
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateCustomFrame = function() {
|
||||
// Get Picture Data
|
||||
var picture = this.picture();
|
||||
// If Picture Frame needs Refresh
|
||||
if (picture && picture.needsFrameRefresh()) {
|
||||
// Get Custom Frame
|
||||
var rect = picture.customFrame();
|
||||
// Set Frame
|
||||
this.setFrame(rect.x, rect.y, rect.width, rect.height);
|
||||
// Set Refresh Flag to false
|
||||
picture._frameData.refreshFrame = false;
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Reset Frame
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.resetFrame = function() {
|
||||
// If Bitmap Exist
|
||||
if (this.bitmap) {
|
||||
// Set Frame
|
||||
this.setFrame(0, 0, this.bitmap.width, this.bitmap.height);
|
||||
} else {
|
||||
// Clear Frame
|
||||
this.setFrame(0, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
154
www/js/plugins/Custom_Character_Rectangles.js
Normal file
154
www/js/plugins/Custom_Character_Rectangles.js
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
//=============================================================================
|
||||
// TDS Custom Character Rectangles
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {};
|
||||
Imported.TDS_CustomCharacterRectangles = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {};
|
||||
_TDS_.CustomCharacterRectangles = _TDS_.CustomCharacterRectangles || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Description
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* ◆Set Movement Route:Player (Wait)
|
||||
*: :◇Script:this.setCustomFrameXY(6, 1)
|
||||
*: :◇Wait:5 frames
|
||||
*: :◇Script:this.setCustomFrameXY(7, 1)
|
||||
*: :◇Wait:5 frames
|
||||
*: :◇Script:this.setCustomFrameXY(8, 1)
|
||||
*: :◇Wait:5 frames
|
||||
*
|
||||
* Example Script Calls:
|
||||
* $gameMap.event(36).setCustomFrameXY(0, 2);
|
||||
* $gamePlayer.setCustomFrameXY(7, 5);
|
||||
*
|
||||
* To reset:
|
||||
* $gameMap.event(idA).setCustomFrameXY(null, null);
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_CharacterBase
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Character. It handles basic information, such as
|
||||
// coordinates and images, shared by all characters.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomCharacterRectangles.Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
|
||||
//=============================================================================
|
||||
// * Initialize Members
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.initMembers = function() {
|
||||
// Set Custom Frame Properties to null
|
||||
this.setCustomFrameXYWH(null, null, null, null);
|
||||
// Run Original Function
|
||||
_TDS_.CustomCharacterRectangles.Game_CharacterBase_initMembers.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Custom frame X & Y
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.setCustomFrameXY = function(x, y) {
|
||||
// Set custom frame X & Y
|
||||
this._customFrameX = x;
|
||||
this._customFrameY = y;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Custom Frame Width & Height
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.setCustomFrameWH = function(width, height) {
|
||||
// Set custom frame Width & Height
|
||||
this._customFrameWidth = width;
|
||||
this._customFrameHeight = height;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Custom Frame X, Y, Width and Height
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.setCustomFrameXYWH = function(x, y, width, height) {
|
||||
// Set Custom Frame Properties
|
||||
this._customFrameX = x;
|
||||
this._customFrameY = y;
|
||||
this._customFrameWidth = width;
|
||||
this._customFrameHeight = height;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Character
|
||||
//-----------------------------------------------------------------------------
|
||||
// The sprite for displaying a character.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_characterBlockX = Sprite_Character.prototype.characterBlockX;
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_characterBlockY = Sprite_Character.prototype.characterBlockY;
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_characterPatternX = Sprite_Character.prototype.characterPatternX;
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_characterPatternY = Sprite_Character.prototype.characterPatternY;
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_patternWidth = Sprite_Character.prototype.patternWidth;
|
||||
_TDS_.CustomCharacterRectangles.Sprite_Character_patternHeight = Sprite_Character.prototype.patternHeight;
|
||||
//=============================================================================
|
||||
// * Get Character Block X
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.characterBlockX = function() {
|
||||
// Get Custom Frame X
|
||||
var frameX = this._character._customFrameX;
|
||||
// Return Custom Frame X
|
||||
if (frameX !== null) { return frameX; };
|
||||
// Return Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_characterBlockX.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character Block Y
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.characterBlockY = function() {
|
||||
// Get Custom Frame Y
|
||||
var frameY = this._character._customFrameY;
|
||||
// Return Custom Frame Y
|
||||
if (frameY !== null) { return frameY; };
|
||||
// Return Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_characterBlockY.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character Pattern X
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.characterPatternX = function() {
|
||||
// Return 0 if using a custom frame
|
||||
if (this._character._customFrameX !== null) { return 0; };
|
||||
// Return Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_characterPatternX.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character Pattern Y
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.characterPatternY = function() {
|
||||
// Return 0 if using a custom frame
|
||||
if (this._character._customFrameY !== null) { return 0; };
|
||||
// Return Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_characterPatternY.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character Pattern Width
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.patternWidth = function() {
|
||||
// Get Custom Frame Width
|
||||
var frameWidth = this._character._customFrameWidth;
|
||||
// Return Custom Frame Width
|
||||
if (frameWidth !== null) { return frameWidth; };
|
||||
// Run Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_patternWidth.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character Pattern Height
|
||||
//=============================================================================
|
||||
Sprite_Character.prototype.patternHeight = function() {
|
||||
// Get Custom Frame Width
|
||||
var frameHeight = this._character._customFrameHeight;
|
||||
// Return Custom Frame Width
|
||||
if (frameHeight !== null) { return frameHeight; };
|
||||
// Run Original Function
|
||||
return _TDS_.CustomCharacterRectangles.Sprite_Character_patternHeight.call(this);
|
||||
};
|
||||
366
www/js/plugins/Custom_Picture_Controls.js
Normal file
366
www/js/plugins/Custom_Picture_Controls.js
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
//=============================================================================
|
||||
// TDS Custom Picture Controls
|
||||
// Version: 1.2
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_CustomPictureControls = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.CustomPictureControls = _TDS_.CustomPictureControls || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin add custom controls as well as pictures for effects.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
|
||||
//=============================================================================
|
||||
// * Update Wait mode
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.updateWaitMode = function() {
|
||||
// If Wait for picture animation
|
||||
if (this._waitMode === 'pictureAnimation') {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(this._lastAnimatingPicture);
|
||||
// If Picture exists and has a finite animation
|
||||
if (picture && picture.hasAnimation(true)) { return true; }
|
||||
// Set Last animating Picture to null
|
||||
this._lastAnimatingPicture = null;
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.CustomPictureControls.Game_Interpreter_updateWaitMode.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Picture Sprite
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.getPictureSprite = function(pictureId) {
|
||||
return SceneManager._scene._spriteset._pictureContainer.children[pictureId]
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Picture Custom Frames
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.removePictureCustomFrames = function(pictureId) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
// If Picture Exists
|
||||
if (picture) {
|
||||
// Clear Picture Custom Frame
|
||||
picture.clearCustomFrame();
|
||||
// Reset Picture Frame
|
||||
this.getPictureSprite.resetFrame()
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup Picture Custom Frames
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setupPictureCustomFrames = function(pictureId, width, height, hFrames, vFrames) {
|
||||
// Get Vertical & Horizontal Sizes
|
||||
var fWidth = width / hFrames;
|
||||
var fHeight = height / vFrames;
|
||||
// Get Total Frames
|
||||
var totalFrames = hFrames * vFrames;
|
||||
// Initialize Rects Array
|
||||
var rects = []
|
||||
// Go Through Total frames
|
||||
for (var i = 0; i < totalFrames; i++) { rects.push(new Rectangle((i % hFrames) * fWidth, Math.floor(i / hFrames) * fHeight, fWidth, fHeight)); };
|
||||
// Setup Picture Frames
|
||||
$gameScreen.picture(pictureId).setupCustomFrame(rects);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture Frame Index
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setPictureFrameIndex = function(pictureId, index) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId)
|
||||
// Set frame Index
|
||||
picture.setCustomFrameIndex(index)
|
||||
// Update Custom Frame
|
||||
this.getPictureSprite(pictureId).updateCustomFrame();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture Animation
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setPictureAnimation = function(pictureId, frames, delay, loops = Infinity, wait = true) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
// If Picture exists
|
||||
if (picture) {
|
||||
// Create animation
|
||||
var animation = {frames: [], loops: loops, index: 0}
|
||||
// Go Through Frames
|
||||
for (var i = 0; i < frames.length; i++) {
|
||||
// Get Frame
|
||||
var frame = frames[i];
|
||||
// If frame is an array
|
||||
if (Array.isArray(frame)) {
|
||||
// Add Frame to Animation
|
||||
animation.frames.push({frame: frame[0], delay: frame[1], maxDelay: frame[1]})
|
||||
} else {
|
||||
// Add Frame to Animation
|
||||
animation.frames.push({frame: frame, delay: delay, maxDelay: delay})
|
||||
};
|
||||
};
|
||||
// Set Custom Frame animation
|
||||
picture.setCustomFrameAnimation(animation);
|
||||
// Update Custom Frame
|
||||
this.getPictureSprite(pictureId).updateCustomFrame();
|
||||
// If Wait and Loops is not infinite
|
||||
if (wait && loops !== Infinity) {
|
||||
// Set Wait mode
|
||||
this.setWaitMode('pictureAnimation')
|
||||
// Set Last Animating Picture
|
||||
this._lastAnimatingPicture = pictureId;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Game_Picture_initBasic = Game_Picture.prototype.initBasic;
|
||||
_TDS_.CustomPictureControls.Game_Picture_update = Game_Picture.prototype.update;
|
||||
//=============================================================================
|
||||
// * Initialize Basic
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.initBasic = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Game_Picture_initBasic.call(this);
|
||||
// Initialize Frame Data
|
||||
this.clearCustomFrame()
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Picture has animation
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.hasAnimation = function(finite = false) {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Frame data exists
|
||||
if (data && data.animation !== null) {
|
||||
// Return false if the animation is infinite
|
||||
if (finite && !data.animation.loops !== Infinity) { return true; };
|
||||
// Return true
|
||||
return true;
|
||||
};
|
||||
// Return false by default
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.clearCustomFrame = function() { this._frameData = null; };
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setupCustomFrame = function(frames) {
|
||||
// Initialize Frame Data
|
||||
this._frameData = {frames: frames, frameIndex: 0, animation: null, refreshFrame: true}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setCustomFrameAnimation = function(animation) {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Frame data exists
|
||||
if (data) {
|
||||
// Set Frame Data Animation
|
||||
data.animation = animation;
|
||||
// Set Custom Frame Index
|
||||
this.setCustomFrameIndex(animation.frames[animation.index].frame);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.removeCustomFrameAnimation = function() {
|
||||
// If Frame data exists
|
||||
if (this._frameData) { this._frameData.animation = null; };
|
||||
}
|
||||
//=============================================================================
|
||||
// * Set Custom Frame Index
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setCustomFrameIndex = function(index) {
|
||||
// If Frame data exists
|
||||
if (this._frameData) {
|
||||
// Set Frame index
|
||||
this._frameData.frameIndex = index;
|
||||
// Set Refresh frame flag
|
||||
this._frameData.refreshFrame = true;
|
||||
};
|
||||
}
|
||||
//=============================================================================
|
||||
// * Determine if Frame needs refreshing
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.needsFrameRefresh = function() {
|
||||
if (this._frameData) { return this._frameData.refreshFrame }
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Custom Frame
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.customFrame = function() {
|
||||
return this._frameData.frames[this._frameData.frameIndex]
|
||||
}
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.update = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Game_Picture_update.call(this);
|
||||
// Update Frame Animation
|
||||
this.updateFrameAnimation();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Frame Animation
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.updateFrameAnimation = function() {
|
||||
// Get Data
|
||||
var data = this._frameData;
|
||||
// If Data and Animation Data exists
|
||||
if (data && data.animation) {
|
||||
// Get Animation
|
||||
var anim = data.animation;
|
||||
// Get Animation Frame
|
||||
var frameAnim = anim.frames[anim.index];
|
||||
// If Frame Animation Delay is 0 or less
|
||||
if (frameAnim.delay <= 0) {
|
||||
// Reset Frame Animation Max Delay
|
||||
frameAnim.delay = frameAnim.maxDelay;
|
||||
// Get MAx Frames
|
||||
var maxFrames = anim.frames.length;
|
||||
// If Animation has reached the end
|
||||
if (anim.index >= maxFrames-1) {
|
||||
// If Animation loops is more than 0
|
||||
if (anim.loops > 0) {
|
||||
// Decrease Animation loop count
|
||||
anim.loops--
|
||||
// Increase Index
|
||||
anim.index = (anim.index + 1) % maxFrames;
|
||||
} else {
|
||||
// Remove Custom Frame Animation
|
||||
this.removeCustomFrameAnimation()
|
||||
};
|
||||
} else {
|
||||
// Increase Index
|
||||
anim.index = (anim.index + 1) % maxFrames;
|
||||
};
|
||||
// Set Custom Frame Index
|
||||
this.setCustomFrameIndex(anim.frames[anim.index].frame)
|
||||
} else {
|
||||
// Decrease Frame Animation Delay
|
||||
frameAnim.delay--;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The sprite for displaying a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap = Sprite_Picture.prototype.updateBitmap
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.initialize = function(pictureId) {
|
||||
// Get Picture Object
|
||||
let picture = $gameScreen.picture(pictureId);
|
||||
// If picture exists and it has frame data
|
||||
if (picture && picture._frameData) {
|
||||
// Set Refresh frame flag to true
|
||||
picture._frameData.refreshFrame = true;
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_initialize.call(this, pictureId);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Bitmap
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateBitmap = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateBitmap.call(this);
|
||||
// Get Picture Object
|
||||
var picture = this.picture();
|
||||
// If Picture Exists
|
||||
if (picture) {
|
||||
// If Picture has frame data
|
||||
if (picture._frameData) {
|
||||
// Update Custom Frame
|
||||
this.updateCustomFrame();
|
||||
} else {
|
||||
// Reset Frame
|
||||
this.resetFrame()
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Object Initialize
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateOther = function() {
|
||||
// Run Original Function
|
||||
_TDS_.CustomPictureControls.Sprite_Picture_updateOther.call(this);
|
||||
// Update Custom Frame
|
||||
this.updateCustomFrame();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Custom Frame
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateCustomFrame = function() {
|
||||
// Get Picture Data
|
||||
var picture = this.picture();
|
||||
// If Picture Frame needs Refresh
|
||||
if (picture && picture.needsFrameRefresh()) {
|
||||
// Get Custom Frame
|
||||
var rect = picture.customFrame();
|
||||
// Set Frame
|
||||
this.setFrame(rect.x, rect.y, rect.width, rect.height);
|
||||
// Set Refresh Flag to false
|
||||
picture._frameData.refreshFrame = false;
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Reset Frame
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.resetFrame = function() {
|
||||
// If Bitmap Exist
|
||||
if (this.bitmap) {
|
||||
// Set Frame
|
||||
this.setFrame(0, 0, this.bitmap.width, this.bitmap.height);
|
||||
} else {
|
||||
// Clear Frame
|
||||
this.setFrame(0, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Object Initialize
|
||||
//=============================================================================
|
||||
// Sprite_Picture.prototype.setFrame = function(x, y, width, height) {
|
||||
// Sprite.prototype.setFrame.call(this, x, y, width, height)
|
||||
|
||||
// console.log(arguments.callee.caller.toString())
|
||||
// console.log(x, y, width, height)
|
||||
|
||||
// }
|
||||
30
www/js/plugins/DisableMouse.js
Normal file
30
www/js/plugins/DisableMouse.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Galv's Disable Mouse
|
||||
//-----------------------------------------------------------------------------
|
||||
// For: RPGMAKER MV
|
||||
// DisableMouse.js
|
||||
//-----------------------------------------------------------------------------
|
||||
// Version 1.0
|
||||
// 2015-11-03 - Version 1.0 - release
|
||||
//-----------------------------------------------------------------------------
|
||||
// Terms can be found at:
|
||||
// galvs-scripts.com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Galv_NoMouse = true;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*:
|
||||
* @plugindesc Disables mouse clicks.
|
||||
*
|
||||
* @author Galv - galvs-scripts.com
|
||||
*
|
||||
* @help
|
||||
* This space intentionally left blank.
|
||||
*
|
||||
*/
|
||||
|
||||
TouchInput._onMouseDown = function(event) {
|
||||
// Overwrite to do nothing
|
||||
};
|
||||
665
www/js/plugins/Exhydra_FollowerControl.js
Normal file
665
www/js/plugins/Exhydra_FollowerControl.js
Normal file
|
|
@ -0,0 +1,665 @@
|
|||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// █▐▐ Follower Control
|
||||
// ╞══════════════════════════════════════════════════════════════════════════════════╡
|
||||
/*:
|
||||
* @plugindesc Options to control and enhance interaction with followers.
|
||||
* @author Exhydra
|
||||
*
|
||||
* @param Interpreter Commands
|
||||
* @desc (Advanced Option) Comma delimited list of allowed
|
||||
interpreter commands followers can use.
|
||||
* @default 205,212,213
|
||||
*
|
||||
* @help
|
||||
* ▄ Plugin ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄
|
||||
*
|
||||
* ┌─ Version : 1.2
|
||||
* ├─ Release : 14th July 2016
|
||||
* ├─ Updated : 24rd July 2016
|
||||
* └─ License : Free for Commercial and Non-Commercial Usage
|
||||
*
|
||||
* ▄ Plugin Commands ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄
|
||||
*
|
||||
* ▪ exaFC.linkEvent boolean followerId eventId
|
||||
* │
|
||||
* │ Link or unlink a follower to an event on the current map. The
|
||||
* │ condition to start the follower event will match whatever is selected
|
||||
* │ on the 'Trigger' drop-down menu within the linked event.
|
||||
* │
|
||||
* ├─boolean
|
||||
* ├ Value(s) ► true, false
|
||||
* │
|
||||
* ├─followerId
|
||||
* ├ Value(s) ► 0, 1, 2, (...)
|
||||
* ├ Note ► The 0th position is the 1st follower, and so on.
|
||||
* │
|
||||
* ├─eventId
|
||||
* └ Value(s) ► Map Event ID
|
||||
*
|
||||
* ▪ exaFC.followerInstruct boolean followerId
|
||||
* │
|
||||
* │ Enable or disable re-directing interpreter commands to a follower.
|
||||
* │ Once enabled, you can set the Movement Route target to 'Player' and
|
||||
* │ pass each command listed within to the selected follower. Should be
|
||||
* │ used in conjunction with the 'exaFC.followerStop' plugin command.
|
||||
* │
|
||||
* ├─boolean
|
||||
* ├ Value(s) ► true, false
|
||||
* │
|
||||
* ├─followerId
|
||||
* ├ Value(s) ► 0, 1, 2, (...)
|
||||
* ├ Note ► The 0th position is the 1st follower, and so on. Value
|
||||
* │ is only required to be included when enabling the
|
||||
* └ command.
|
||||
*
|
||||
* ▪ exaFC.moveType type followerId moveSpeed moveFrequency
|
||||
* │
|
||||
* │ Selects and/or changes the move type of a follower. Should be
|
||||
* │ used in conjunction with the 'followerStop' and 'lockProperties'
|
||||
* │ plugin command.
|
||||
* │
|
||||
* ├─type
|
||||
* ├ Value(s) ► fixed, random, approach, custom, clear
|
||||
* ├ Note ► When selecting the 'custom' type, place the Movement
|
||||
* │ Route you wish the follower to copy directly beneath
|
||||
* │ the plugin command. The 'clear' option will erase
|
||||
* │ the current memorized move route.
|
||||
* │
|
||||
* ├─followerId
|
||||
* ├ Value(s) ► 0, 1, 2, (...)
|
||||
* ├ Note ► The 0th position is the 1st follower, and so on.
|
||||
* │
|
||||
* ├─moveSpeed
|
||||
* ├ Value(s) ► Integer
|
||||
* ├ Note ► Value is optional.
|
||||
* │
|
||||
* ├─moveFrequency
|
||||
* ├ Value(s) ► Integer
|
||||
* └ Note ► Value is optional.
|
||||
*
|
||||
* ▪ exaFC.lockProperties boolean followerId
|
||||
* │
|
||||
* │ Lock or unlock the properties of a follower. By default,
|
||||
* │ followers will mirror the movement speed as well as various
|
||||
* │ other properties of the party leader. This command will stop
|
||||
* │ the selected follower from doing so.
|
||||
* │
|
||||
* ├─boolean
|
||||
* ├ Value(s) ► true, false
|
||||
* │
|
||||
* ├─followerId
|
||||
* ├ Value(s) ► 0, 1, 2, (...)
|
||||
* └ Note ► The 0th position is the 1st follower, and so on.
|
||||
*
|
||||
* ▪ exaFC.followerStop boolean
|
||||
* │
|
||||
* │ Enable or disable followers chasing the player.
|
||||
* │
|
||||
* ├─boolean
|
||||
* └ Value(s) ► true, false
|
||||
*
|
||||
* ▪ exaFC.followerCollision boolean
|
||||
* │
|
||||
* │ Enable or disable player collision with followers.
|
||||
* │
|
||||
* ├─boolean
|
||||
* └ Value(s) ► true, false
|
||||
*
|
||||
* ▪ exaFC.clearAll
|
||||
* │
|
||||
* │ Clears control properties from all followers.
|
||||
* │
|
||||
* └
|
||||
*
|
||||
* ▄ Examples ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄
|
||||
*
|
||||
* exaFC.linkEvent true 1 15
|
||||
* └─Link the 2nd follower to the event with an ID of 15.
|
||||
*
|
||||
* exaFC.linkEvent false 1
|
||||
* └─Unlink the 2nd follower from the linked event.
|
||||
*
|
||||
* exaFC.followerInstruct true 2
|
||||
* └─Re-direct interpreter commands to the 3rd follower.
|
||||
*
|
||||
* exaFC.followerInstruct false
|
||||
* └─Disable interpreter command re-direct for all followers.
|
||||
*
|
||||
* exaFC.followerStop true
|
||||
* └─Disable followers chasing the player.
|
||||
*
|
||||
* exaFC.followerCollision true
|
||||
* └─Enables player collision with followers.
|
||||
*
|
||||
*/
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Plugin
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.EXA_SimpleFollowerControl = true;
|
||||
|
||||
var EXA = EXA || {};
|
||||
EXA.FC = EXA.FC || {};
|
||||
|
||||
EXA.FC.pluginParams = PluginManager.parameters('Exhydra_FollowerControl');
|
||||
EXA.FC.pluginParams.allowedList = EXA.FC.pluginParams['Interpreter Commands'] || '205,212,213';
|
||||
EXA.FC.pluginParams.allowedList.split(',').map(Number);
|
||||
|
||||
EXA.FC.followerControl = false;
|
||||
EXA.FC.followerControlId = -1;
|
||||
EXA.FC.followerStop = false;
|
||||
EXA.FC.followerCollision = false;
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Game_Interpreter
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] pluginCommand
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
|
||||
EXA.FC.Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
|
||||
if (command === 'exaFC.linkEvent') {
|
||||
var follower = $gamePlayer._followers.follower(args[1]);
|
||||
|
||||
if (follower) {
|
||||
if (args[0] === 'true') {
|
||||
follower._fcEventId = Number(args[2]);
|
||||
} else {
|
||||
follower._fcEventId = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (command === 'exaFC.followerInstruct') {
|
||||
if (args[0] === 'true') {
|
||||
EXA.FC.followerControlId = Number(args[1]);
|
||||
EXA.FC.followerControl = true;
|
||||
} else {
|
||||
EXA.FC.followerControlId = -1;
|
||||
EXA.FC.followerControl = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (command === 'exaFC.moveType') {
|
||||
var follower = $gamePlayer._followers.follower(args[1]) || null;
|
||||
|
||||
if (follower) {
|
||||
if (args[0] === 'fixed') {
|
||||
follower._moveType = 0;
|
||||
} else if (args[0] === 'random') {
|
||||
follower._moveType = 1;
|
||||
} else if (args[0] === 'approach') {
|
||||
follower._moveType = 2;
|
||||
} else if (args[0] === 'custom') {
|
||||
if (this.nextEventCode() === 205) {
|
||||
var moveRoute = this._list[this._index + 1].parameters[1];
|
||||
|
||||
follower.setMoveRoute(moveRoute);
|
||||
follower._moveType = 3;
|
||||
|
||||
this._index = this._index + 2;
|
||||
} else {
|
||||
follower._moveType = 0;
|
||||
}
|
||||
} else if (args[0] === 'clear') {
|
||||
follower._moveType = 0;
|
||||
follower.setMoveRoute(null);
|
||||
}
|
||||
|
||||
if (args[2]) {
|
||||
follower._moveSpeed = Number(args[2]);
|
||||
}
|
||||
|
||||
if (args[3]) {
|
||||
follower._moveFrequency = Number(args[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (command === 'exaFC.lockProperties') {
|
||||
var followerId = Number(args[1]);
|
||||
var follower = $gamePlayer._followers.follower(followerId) || null;
|
||||
|
||||
if (follower) {
|
||||
if (args[0] === 'true') {
|
||||
follower._fcRetainAttrib = true;
|
||||
} else {
|
||||
follower._fcRetainAttrib = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (command === 'exaFC.followerStop') {
|
||||
EXA.FC.followerStop = (args[0] == 'true');
|
||||
}
|
||||
|
||||
if (command === 'exaFC.followerCollision') {
|
||||
var toggle = (args[0] == 'true')
|
||||
EXA.FC.followerCollision = toggle;
|
||||
|
||||
$gamePlayer._followers.forEach(function (follower) {
|
||||
follower.setThrough(!toggle);
|
||||
});
|
||||
}
|
||||
|
||||
if (command === 'exaFC.clearAll') {
|
||||
EXA.FC.followerControlId = -1;
|
||||
EXA.FC.followerControl = false;
|
||||
EXA.FC.followerStop = false;
|
||||
EXA.FC.followerCollision = false;
|
||||
|
||||
$gamePlayer._followers.forEach(function (follower) {
|
||||
follower._fcEventId = -1;
|
||||
follower._moveType = 0;
|
||||
follower._fcEventLock = false;
|
||||
follower._fcPrelockDirection = 0;
|
||||
follower._fcRetainAttrib = false;
|
||||
follower.setMoveRoute(null);
|
||||
follower.setThrough(true);
|
||||
follower.update();
|
||||
});
|
||||
}
|
||||
|
||||
}; // Game_Interpreter ‹‹ pluginCommand
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] character
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Interpreter_character = Game_Interpreter.prototype.character;
|
||||
|
||||
Game_Interpreter.prototype.character = function(param) {
|
||||
|
||||
if (isNaN(param)) {
|
||||
var followerMatch = param.match(/fcF:(\d+)/);
|
||||
|
||||
if (followerMatch) {
|
||||
var followerId = followerMatch[1];
|
||||
|
||||
return $gamePlayer._followers.follower(followerId);
|
||||
}
|
||||
}
|
||||
|
||||
return EXA.FC.Game_Interpreter_character.call(this, param);
|
||||
|
||||
}; // Game_Interpreter ‹‹ character
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] executeCommand
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Interpreter_executeCommand = Game_Interpreter.prototype.executeCommand;
|
||||
|
||||
Game_Interpreter.prototype.executeCommand = function() {
|
||||
|
||||
if (EXA.FC.followerControl) {
|
||||
var command = this.currentCommand();
|
||||
|
||||
if (command) {
|
||||
if (EXA.FC.pluginParams.allowedList.indexOf(command.code) != -1) {
|
||||
if (command.parameters[0] < 0) {
|
||||
command.parameters[0] = 'fcF:' + EXA.FC.followerControlId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EXA.FC.Game_Interpreter_executeCommand.call(this);
|
||||
|
||||
}; // Game_Interpreter ‹‹ executeCommand
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Game_Player
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// NEW ───────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] isCollidedWithCharacters
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Player.prototype.isCollidedWithCharacters = function(x, y) {
|
||||
|
||||
return this.isCollidedWithFollowers(x, y) ||
|
||||
Game_CharacterBase.prototype.isCollidedWithCharacters.call(this, x, y);
|
||||
|
||||
}; // Game_Player ‹‹ isCollidedWithCharacters
|
||||
|
||||
// NEW ───────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] isCollidedWithFollowers
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Player.prototype.isCollidedWithFollowers = function(x, y) {
|
||||
|
||||
if (EXA.FC.followerCollision) {
|
||||
return this._followers.isSomeoneCollided(x, y);
|
||||
}
|
||||
return false;
|
||||
|
||||
}; // Game_Player ‹‹ isCollidedWithFollowers
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] startMapEvent
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Player_startMapEvent = Game_Player.prototype.startMapEvent;
|
||||
|
||||
Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
|
||||
|
||||
if (!$gameMap.isEventRunning()) {
|
||||
this._followers.forEach(function(follower, index) {
|
||||
if (follower._fcEventId > -1) {
|
||||
if (follower.pos(x, y)) {
|
||||
event = $gameMap.event(follower._fcEventId);
|
||||
if (event.isTriggerIn(triggers)) {
|
||||
event._fcFollowerId = index;
|
||||
event.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
EXA.FC.Game_Player_startMapEvent.call(this, x, y, triggers, normal);
|
||||
|
||||
}; // Game_Player ‹‹ startMapEvent
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Game_Event
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] initMembers
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Event_initMembers = Game_Event.prototype.initMembers;
|
||||
|
||||
Game_Event.prototype.initMembers = function() {
|
||||
|
||||
EXA.FC.Game_Event_initMembers.call(this);
|
||||
|
||||
this._fcFollowerId = -1;
|
||||
|
||||
}; // Game_Event ‹‹ initMembers
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] lock
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Event_lock = Game_Event.prototype.lock;
|
||||
|
||||
Game_Event.prototype.lock = function() {
|
||||
|
||||
EXA.FC.Game_Event_lock.call(this);
|
||||
|
||||
if (this._fcFollowerId > -1) {
|
||||
$gamePlayer._followers.follower(this._fcFollowerId).lock();
|
||||
}
|
||||
|
||||
}; // Game_Event ‹‹ lock
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] unlock
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Event_unlock = Game_Event.prototype.unlock;
|
||||
|
||||
Game_Event.prototype.unlock = function() {
|
||||
|
||||
EXA.FC.Game_Event_unlock.call(this);
|
||||
|
||||
if (this._fcFollowerId > -1) {
|
||||
$gamePlayer._followers.follower(this._fcFollowerId).unlock();
|
||||
this._fcFollowerId = -1;
|
||||
}
|
||||
|
||||
}; // Game_Event ‹‹ unlock
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Game_Follower
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] initialize
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Follower_initialize = Game_Follower.prototype.initialize;
|
||||
|
||||
Game_Follower.prototype.initialize = function(memberIndex) {
|
||||
|
||||
EXA.FC.Game_Follower_initialize.call(this, memberIndex);
|
||||
|
||||
this._fcEventId = -1;
|
||||
this._fcEventLock = false;
|
||||
this._fcPrelockDirection = 0;
|
||||
this._fcRetainAttrib = false;
|
||||
|
||||
}; // Game_Follower ‹‹ initialize
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] update
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Follower_update = Game_Follower.prototype.update;
|
||||
|
||||
Game_Follower.prototype.update = function() {
|
||||
|
||||
if (this._fcRetainAttrib || EXA.FC.followerControl) {
|
||||
Game_Character.prototype.update.call(this);
|
||||
} else {
|
||||
EXA.FC.Game_Follower_update.call(this);
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ update
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] updateStop
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.updateStop = function() {
|
||||
|
||||
if (this._fcEventLock) {
|
||||
this.resetStopCount();
|
||||
}
|
||||
|
||||
Game_Character.prototype.updateStop.call(this);
|
||||
|
||||
if (!this.isMoveRouteForcing()) {
|
||||
this.updateSelfMovement();
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ updateStop
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] lock
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.lock = function() {
|
||||
|
||||
if (!this._fcEventLock) {
|
||||
this._fcPrelockDirection = this.direction();
|
||||
this.turnTowardPlayer();
|
||||
this._fcEventLock = true;
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ lock
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] unlock
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.unlock = function() {
|
||||
|
||||
if (this._fcEventLock) {
|
||||
this._fcEventLock = false;
|
||||
this.setDirection(this._fcPrelockDirection);
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ unlock
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] updateSelfMovement
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.updateSelfMovement = function() {
|
||||
|
||||
if (this._moveType > 0) {
|
||||
if (!this._fcEventLock && this.isNearTheScreen() &&
|
||||
this.checkStop(this.stopCountThreshold())) {
|
||||
switch (this._moveType) {
|
||||
case 1:
|
||||
this.moveTypeRandom();
|
||||
break;
|
||||
case 2:
|
||||
this.moveTypeTowardPlayer();
|
||||
break;
|
||||
case 3:
|
||||
this.moveTypeCustom();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ updateSelfMovement
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] stopCountThreshold
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.stopCountThreshold = function() {
|
||||
|
||||
return 30 * (5 - this.moveFrequency());
|
||||
|
||||
}; // Game_Follower ‹‹ stopCountThreshold
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] moveTypeRandom
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.moveTypeRandom = function() {
|
||||
|
||||
switch (Math.randomInt(6)) {
|
||||
case 0: case 1:
|
||||
this.moveRandom();
|
||||
break;
|
||||
case 2: case 3: case 4:
|
||||
this.moveForward();
|
||||
break;
|
||||
case 5:
|
||||
this.resetStopCount();
|
||||
break;
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ moveTypeRandom
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] moveTypeTowardPlayer
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.moveTypeTowardPlayer = function() {
|
||||
|
||||
if (this.isNearThePlayer()) {
|
||||
switch (Math.randomInt(6)) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
this.moveTowardPlayer();
|
||||
break;
|
||||
case 4:
|
||||
this.moveRandom();
|
||||
break;
|
||||
case 5:
|
||||
this.moveForward();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.moveRandom();
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ moveTypeTowardPlayer
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] moveTypeCustom
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.moveTypeCustom = function() {
|
||||
|
||||
this.updateRoutineMove();
|
||||
|
||||
}; // Game_Follower ‹‹ moveTypeCustom
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] isNearThePlayer
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.isNearThePlayer = function() {
|
||||
|
||||
var sx = Math.abs(this.deltaXFrom($gamePlayer.x));
|
||||
var sy = Math.abs(this.deltaYFrom($gamePlayer.y));
|
||||
return sx + sy < 20;
|
||||
|
||||
}; // Game_Follower ‹‹ isNearThePlayer
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] isCollidedWithCharacters
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.isCollidedWithCharacters = function(x, y) {
|
||||
|
||||
if (EXA.FC.followerCollision) {
|
||||
return (Game_Character.prototype.isCollidedWithCharacters.call(this, x, y) ||
|
||||
this.isCollidedWithPlayerCharacters(x, y));
|
||||
} else {
|
||||
return Game_Character.prototype.isCollidedWithCharacters.call(this, x, y);
|
||||
}
|
||||
|
||||
}; // Game_Follower ‹‹ isCollidedWithCharacters
|
||||
|
||||
// NEW ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] isCollidedWithPlayerCharacters
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Game_Follower.prototype.isCollidedWithPlayerCharacters = function(x, y) {
|
||||
|
||||
return this.isNormalPriority() && $gamePlayer.isCollided(x, y);
|
||||
|
||||
}; // Game_Follower ‹‹ isCollidedWithPlayerCharacters
|
||||
|
||||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// ■ [Object] Game_Followers
|
||||
// ╘══════════════════════════════════════════════════════════════════════════════════╛
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] updateMove
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Followers_updateMove = Game_Followers.prototype.updateMove;
|
||||
|
||||
Game_Followers.prototype.updateMove = function() {
|
||||
|
||||
if (EXA.FC.followerStop) return;
|
||||
|
||||
EXA.FC.Game_Followers_updateMove.call(this);
|
||||
|
||||
}; // Game_Followers ‹‹ updateMove
|
||||
|
||||
// ALIAS ─────────────────────────────────────────────────────────────────────────────┐
|
||||
// □ [Function] jumpAll
|
||||
// └──────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
EXA.FC.Game_Followers_jumpAll = Game_Followers.prototype.jumpAll;
|
||||
|
||||
Game_Followers.prototype.jumpAll = function() {
|
||||
|
||||
if (EXA.FC.followerStop) return;
|
||||
|
||||
EXA.FC.Game_Followers_jumpAll.call(this);
|
||||
|
||||
}; // Game_Followers ‹‹ jumpAll
|
||||
|
||||
// ▌▌██████████████████████████████████████ EOF █████████████████████████████████████▐▐
|
||||
96
www/js/plugins/External Notes.js
Normal file
96
www/js/plugins/External Notes.js
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
"use strict";
|
||||
//=============================================================================
|
||||
// TDS External Notes
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {}; Imported.TDS_ExternalNotes = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {}; _TDS_.ExternalNotes = _TDS_.ExternalNotes || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This script allows you to set notes for objects with an external file.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* * Notes
|
||||
* ============================================================================
|
||||
*
|
||||
* <LoadNotes: KEY, VALUE>
|
||||
*
|
||||
* KEY
|
||||
* ^ Key name. (Used to divide different types of notes)
|
||||
*
|
||||
*
|
||||
* VALUE
|
||||
* ^ Value name. (Contains the contents of the notes)
|
||||
*
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <LoadNotes: Actors, test1>
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the party. Information such as gold and items is
|
||||
// included.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ExternalNotes.DataManager_loadDatabase = DataManager.loadDatabase;
|
||||
_TDS_.ExternalNotes.DataManager_extractMetadata = DataManager.extractMetadata;
|
||||
//=============================================================================
|
||||
// * Load Database
|
||||
//=============================================================================
|
||||
DataManager.loadDatabase = function () {
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var yaml = require('./js/libs/js-yaml-master')
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
// If External Notes Data is undefined
|
||||
if (window['$externalNotesData'] === undefined) {
|
||||
// Get Atlas File
|
||||
window['$externalNotesData'] = jsyaml.load(fs.readFileSync(base + '/data/Notes.yaml', 'utf8'));
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.ExternalNotes.DataManager_loadDatabase.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Extract Metadata
|
||||
//=============================================================================
|
||||
DataManager.extractMetadata = function (data) {
|
||||
// If Data note is not empty
|
||||
if (data.note.length > 0) {
|
||||
// Get Regular Expression
|
||||
var re = /<LoadNotes:(.+)>/gmi;
|
||||
// Notes
|
||||
var notes = '';
|
||||
// Iterate
|
||||
for (; ;) {
|
||||
// Get Match
|
||||
var match = re.exec(data.note);
|
||||
// If Match
|
||||
if (match) {
|
||||
// Get Arguments
|
||||
var args = RegExp.$1.split(',');
|
||||
// Add Custom notes to notes
|
||||
notes += $externalNotesData.NOTES[args[0].trim()][args[1].trim()] + '\n'
|
||||
} else {
|
||||
break;
|
||||
};
|
||||
};
|
||||
// Add Custom notes to data notes
|
||||
data.note += notes;
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.ExternalNotes.DataManager_extractMetadata.call(this, data);
|
||||
};
|
||||
348
www/js/plugins/ExtraMovementFrames.js
Normal file
348
www/js/plugins/ExtraMovementFrames.js
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
//=============================================================================
|
||||
// ExtraMovementFrames.js
|
||||
//=============================================================================
|
||||
// Version: 1.0.3
|
||||
// Date: 10 November 2015
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
/*:
|
||||
* @author Modern Algebra (rmrk.net)
|
||||
* @plugindesc Set sprites with more than 3 frames of animation
|
||||
*
|
||||
* @param Cycle Time
|
||||
* @desc The normal number of frames to complete animation cycle for custom sprites
|
||||
* @default 60
|
||||
*
|
||||
* @param Default Idle Frame
|
||||
* @desc The idle frame for custom sprites unless changed in the filename
|
||||
* @default 0
|
||||
*
|
||||
* @param Default Pattern
|
||||
* @desc Set patterns for custom sprites unless changed in the filename.
|
||||
* @default []
|
||||
*
|
||||
* @help INSTRUCTIONS:
|
||||
*
|
||||
* To create sprites that have more than 3 frames of animation, you need
|
||||
* to rename the character graphic to something of the form:
|
||||
*
|
||||
* RegularName%(x)
|
||||
* x : the number of frames in each character sprite
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* EXAMPLES:
|
||||
*
|
||||
* $001-Fighter01%(4)
|
||||
* // This graphic is a single character with four frames of animation.
|
||||
*
|
||||
* 022-Actors12%(6)
|
||||
* // This graphic would be interpreted as a character sheet of 8
|
||||
* // characters each having six frames of animation.
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* Additionally, this script also allows you to specify the "idle" frame (the
|
||||
* frame where the sprite is not moving), and also the pattern if you wish to so
|
||||
* specify. In essence, all you need to do is add those integers after the
|
||||
* number of frames:
|
||||
*
|
||||
* Regular_Name%(x y z1 z2 ... zn)
|
||||
* x : the number of frames in each character sprite
|
||||
* y : the idle frame (the frame shown when sprite is not moving)
|
||||
* z1 ... zn : the pattern.
|
||||
*
|
||||
* If you choose to specify a pattern, then the idle frame is not automatically
|
||||
* included in the pattern and should be repeated if you want it to appear
|
||||
*
|
||||
* When naming your files, be aware that the first frame in a sprite is index 0,
|
||||
* the second frame is index 1, etc.
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* EXAMPLES:
|
||||
*
|
||||
* $003-Fighter03%(4 2)
|
||||
* // This graphic is a single character with four frames of animation.
|
||||
* // The idle frame is 2 (the third one over). The pattern when moving
|
||||
* // would be 2 3 0 1, 2 3 0 1, etc. (unless default patterns set -
|
||||
* // see below)
|
||||
*
|
||||
* 032-People05%(4 0 1 0 3 2)
|
||||
* // This graphic would be interpreted as a character sheet of 8
|
||||
* // characters, each having four frames of animation. The idle frame is
|
||||
* // 0 (the first in the sheet), and the pattern is 1 0 3 2,
|
||||
* // 1 0 3 2, etc.
|
||||
*
|
||||
* $003-Fighter03%(6 0 1 2 3 4 5)
|
||||
* // This graphic is a single character with six frames of animation.
|
||||
* // The idle frame is 0 (the first frame). The pattern when moving
|
||||
* // is 1 2 3 4 5, 1 2 3 4 5, etc.
|
||||
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* PLUGIN SETTINGS:
|
||||
*
|
||||
* Cycle Time = 60
|
||||
*
|
||||
* Cycle Time is the number of frames it will take to complete a full
|
||||
* animation cycle for custom sprites at normal speed. It must be set to an
|
||||
* integer.
|
||||
*
|
||||
*
|
||||
* Default Idle Frame = 0
|
||||
*
|
||||
* If you do not specify an idle frame for custom sprites in the file name, then it
|
||||
* will be this frame. You must set this to an integer.
|
||||
*
|
||||
* Default Pattern = []
|
||||
*
|
||||
* If you do not specify a pattern, then what happens depends on what you write
|
||||
* in the plugin setting for "Default Pattern". For this setting, you have the
|
||||
* option of writing in arrays of numbers in the following format:
|
||||
*
|
||||
* [x y z1 z2 ... zn]
|
||||
* x : number of frames in the sprites for which this pattern is default
|
||||
* y : idle frame
|
||||
* z1 z2 ... zn : the pattern
|
||||
*
|
||||
* If you have setup one of those arrays for the number of frames which this
|
||||
* custom sprite has, then it will use that pattern and idle frame.
|
||||
*
|
||||
* If you have not set up a default pattern for this number of frames, then the
|
||||
* animation will simply cycle through the number of frames, starting with the
|
||||
* idle frame and moving right. The idle frame will be included in the animation.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* EXAMPLES
|
||||
*
|
||||
* Default Pattern = [5 1 2 3 4 3 2]
|
||||
* // Whenever you set up a custom sprite that has 5 frames of animation
|
||||
* // but do not specify a pattern, the idle frame will be 1 and the
|
||||
* // pattern will be 2 3 4 3 2, 2 3 4 3 2, etc.
|
||||
*
|
||||
* Default Pattern = [5 1 2 3 4 3 2], [6 0 1 2 5 4 3 0]
|
||||
* // Whenever you set up a custom sprite that has 5 frames of animation
|
||||
* // but do not specify a pattern, the idle frame will be 1 and the
|
||||
* // pattern will be 2 3 4 3 2, 2 3 4 3 2, etc.
|
||||
* // Whenever you set up a custom sprite that has 6 frames of animation
|
||||
* // but do not specify a pattern, the idle frame will be 0 and the
|
||||
* // pattern will be 1 2 5 4 3 0, 1 2 5 4 3 0, etc.
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.MA_ExtraMovementFrames = true;
|
||||
|
||||
var ModernAlgebra = ModernAlgebra || {};
|
||||
ModernAlgebra.EMF = {};
|
||||
|
||||
(function() {
|
||||
|
||||
// Get Script Name, in case user unexpectedly altered it
|
||||
//var path = document.currentScript.src;
|
||||
//var scriptName = path.substring(path.lastIndexOf('/')+1).match(/^(.+?)(\.[^.]*$|$)/)[1];
|
||||
|
||||
// Set Parameters
|
||||
ModernAlgebra.EMF.parameters = PluginManager.parameters("ExtraMovementFrames");
|
||||
ModernAlgebra.EMF.cycleTime = (+ModernAlgebra.EMF.parameters['Cycle Time']) || 60; // Default = 60
|
||||
ModernAlgebra.EMF.idleFrame = (+ModernAlgebra.EMF.parameters['Default Idle Frame']) || 0; // Default = 0
|
||||
ModernAlgebra.EMF.defaultPattern = [];
|
||||
|
||||
var emfPattMatch = ModernAlgebra.EMF.parameters['Default Pattern'].match(/\[.+?\]/g); // Default []
|
||||
if (emfPattMatch) {
|
||||
// Get all arrays of numbers
|
||||
for (var i = 0; i < emfPattMatch.length; i++) {
|
||||
digitMatch = emfPattMatch[i].match(/\d+/g);
|
||||
if (digitMatch) { ModernAlgebra.EMF.defaultPattern.push(digitMatch.map(Number)); }
|
||||
}
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// ImageManager
|
||||
//=========================================================================
|
||||
// isEmfCharacter - Checks if filename is a customly animated sprite
|
||||
ImageManager.isEmfCharacter = function(filename) {
|
||||
return !!filename.match(/\%[\(\[][\d\s]+[\)\]]/); // check filename for %() or %[]
|
||||
};
|
||||
|
||||
//=========================================================================
|
||||
// Game_CharacterBase
|
||||
//=========================================================================
|
||||
// initMembers
|
||||
ModernAlgebra.EMF.GameCharacterBase_initMembers =
|
||||
Game_CharacterBase.prototype.initMembers;
|
||||
Game_CharacterBase.prototype.initMembers = function() {
|
||||
this.maClearEmfCharacterState();
|
||||
ModernAlgebra.EMF.GameCharacterBase_initMembers.apply(this, arguments); // original method
|
||||
};
|
||||
|
||||
// maClearEmfCharacterState
|
||||
Game_CharacterBase.prototype.maClearEmfCharacterState = function() {
|
||||
this._isEmfCharacter = false;
|
||||
this._emfCharacterState = { frameNum: 3, idleFrame: ModernAlgebra.EMF.idleFrame, pattern: [2, 1, 0, 1] };
|
||||
};
|
||||
|
||||
// isEmfCharacter - Check whether a customly animated sprites
|
||||
Game_CharacterBase.prototype.isEmfCharacter = function() {
|
||||
return this._isEmfCharacter;
|
||||
};
|
||||
|
||||
// emfCharacterState - makes this._emfCharacterState public
|
||||
Game_CharacterBase.prototype.emfCharacterState = function() {
|
||||
return this._emfCharacterState;
|
||||
};
|
||||
|
||||
// setImage - adjusts to call EMF setup method
|
||||
ModernAlgebra.EMF.GameCharacterBase_setImage =
|
||||
Game_CharacterBase.prototype.setImage;
|
||||
Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
|
||||
const [oldCharName, oldCharIndex] = [this.characterName(), this.characterIndex()]
|
||||
ModernAlgebra.EMF.GameCharacterBase_setImage.apply(this, arguments); // original method
|
||||
this.maemfSetupEmfCharacter();
|
||||
if(oldCharName !== characterName) {this.resetPattern();}
|
||||
if(oldCharName === characterName && oldCharIndex !== characterIndex) {this.resetPattern();}
|
||||
};
|
||||
|
||||
// maSetupEmfCharacter - setup custom animation sprite
|
||||
Game_CharacterBase.prototype.maemfSetupEmfCharacter = function() {
|
||||
this.maClearEmfCharacterState();
|
||||
var charName = this.characterName();
|
||||
if (ImageManager.isEmfCharacter(charName)) {
|
||||
var sign = charName.match(/(?:\%[\(\[])[\d\s]+(?:[\)\]])/);
|
||||
var signArgs = sign[0].match(/\d+/g); // array of digit strings
|
||||
if (signArgs) {
|
||||
this._isEmfCharacter = true;
|
||||
// Map arguments in file name to an array of numbers
|
||||
signArgs = signArgs.map(Number);
|
||||
signArgsLength = signArgs.length;
|
||||
this.emfCharacterState().frameNum = signArgs.shift();
|
||||
this.emfCharacterState().idleFrame = (signArgsLength > 1) ? signArgs.shift() : ModernAlgebra.EMF.idleFrame;
|
||||
if (signArgsLength > 2) {
|
||||
this.emfCharacterState().pattern = signArgs;
|
||||
} else {
|
||||
var success = false;
|
||||
// Check for a default match for this number of frames
|
||||
for (var i = 0; i < ModernAlgebra.EMF.defaultPattern.length; i++) {
|
||||
if (ModernAlgebra.EMF.defaultPattern[i][0] === this.emfCharacterState().frameNum) {
|
||||
this.emfCharacterState().idleFrame = ModernAlgebra.EMF.defaultPattern[i][1];
|
||||
this.emfCharacterState().pattern = ModernAlgebra.EMF.defaultPattern[i].slice(2, (ModernAlgebra.EMF.defaultPattern[i].length));
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If still no pattern specified
|
||||
if (!success) {
|
||||
// Populate pattern with a simple cycle starting after idle
|
||||
this.emfCharacterState().pattern = [];
|
||||
var idleFramePlus = this.emfCharacterState().idleFrame + 1;
|
||||
for (var i = 0; i < this.emfCharacterState().frameNum; i++) {
|
||||
this.emfCharacterState().pattern.push((i + idleFramePlus) % this.emfCharacterState().frameNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// animationWait
|
||||
ModernAlgebra.EMF.GameCharacterBase_animationWait =
|
||||
Game_CharacterBase.prototype.animationWait;
|
||||
Game_CharacterBase.prototype.animationWait = function() {
|
||||
// If EMF Character
|
||||
if (this.isEmfCharacter()) {
|
||||
var realSpeed = this.realMoveSpeed();
|
||||
var frameNum = this.maxPattern();
|
||||
return Math.floor((8 - realSpeed)*(ModernAlgebra.EMF.cycleTime / (4*frameNum))); // CycleTime divided by number of frames in animation
|
||||
} else {
|
||||
// Run Default Method - approx. 60 frames at normal speed
|
||||
return ModernAlgebra.EMF.GameCharacterBase_animationWait.apply(this, arguments) // original method
|
||||
}
|
||||
};
|
||||
|
||||
// maxPattern
|
||||
ModernAlgebra.EMF.GameCharacterBase_maxPattern =
|
||||
Game_CharacterBase.prototype.maxPattern;
|
||||
Game_CharacterBase.prototype.maxPattern = function() {
|
||||
if (this.isEmfCharacter()) {
|
||||
return this.emfCharacterState().pattern.length; // Length of pattern array
|
||||
} else {
|
||||
return ModernAlgebra.EMF.GameCharacterBase_maxPattern.apply(this, arguments); // original method
|
||||
}
|
||||
};
|
||||
|
||||
// pattern
|
||||
ModernAlgebra.EMF.GameCharacterBase_pattern =
|
||||
Game_CharacterBase.prototype.pattern;
|
||||
Game_CharacterBase.prototype.pattern = function() {
|
||||
if (this.isEmfCharacter()) {
|
||||
if (this._pattern < 0) {
|
||||
return this.emfCharacterState().idleFrame; // Idle Frame if _pattern < 0
|
||||
} else {
|
||||
var patternIndex = (this._pattern % this.emfCharacterState().pattern.length);
|
||||
return this.emfCharacterState().pattern[patternIndex]; // index of pattern array
|
||||
}
|
||||
} else {
|
||||
return ModernAlgebra.EMF.GameCharacterBase_pattern.apply(this, arguments); // original method
|
||||
}
|
||||
};
|
||||
|
||||
// isOriginalPattern - Original pattern is -1 for custom sprites
|
||||
ModernAlgebra.EMF.GameCharacterBase_isOriginalpattern =
|
||||
Game_CharacterBase.prototype.isOriginalPattern;
|
||||
Game_CharacterBase.prototype.isOriginalPattern = function() {
|
||||
if (this.isEmfCharacter()) {
|
||||
return this.pattern() === -1;
|
||||
} else {
|
||||
return ModernAlgebra.EMF.GameCharacterBase_isOriginalpattern.apply(this, arguments); // original method
|
||||
}
|
||||
};
|
||||
|
||||
// straighten - Straighten to original pattern
|
||||
ModernAlgebra.EMF.GameCharacterBase_straighten =
|
||||
Game_CharacterBase.prototype.straighten;
|
||||
Game_CharacterBase.prototype.straighten = function() {
|
||||
if (this.isEmfCharacter()) {
|
||||
if (this.hasWalkAnime() || this.hasStepAnime()) {
|
||||
this._pattern = -1;
|
||||
}
|
||||
this._animationCount = 0;
|
||||
} else {
|
||||
ModernAlgebra.EMF.GameCharacterBase_straighten.apply(this, arguments)
|
||||
}
|
||||
};
|
||||
|
||||
// resetPattern - Idle is -1 for custom sprites
|
||||
ModernAlgebra.EMF.GameCharacterBase_resetPattern =
|
||||
Game_CharacterBase.prototype.resetPattern;
|
||||
Game_CharacterBase.prototype.resetPattern = function() {
|
||||
if (this.isEmfCharacter()) {
|
||||
this.setPattern(-1);
|
||||
} else {
|
||||
ModernAlgebra.EMF.GameCharacterBase_resetPattern.apply(this, arguments); // original method
|
||||
}
|
||||
};
|
||||
|
||||
//=========================================================================
|
||||
// Game_Event
|
||||
//=========================================================================
|
||||
// setupPageSettings - adjust original pattern
|
||||
ModernAlgebra.EMF.GameEvent_setupPageSettings =
|
||||
Game_Event.prototype.setupPageSettings;
|
||||
Game_Event.prototype.setupPageSettings = function() {
|
||||
ModernAlgebra.EMF.GameEvent_setupPageSettings.apply(this, arguments);
|
||||
// Original pattern is always idle for custom sprites
|
||||
if (this.isEmfCharacter()) { this._originalPattern = -1; }
|
||||
this.resetPattern();
|
||||
};
|
||||
|
||||
//=========================================================================
|
||||
// Sprite_Character
|
||||
//=========================================================================
|
||||
// patternWidth - afjust based on number of frames
|
||||
ModernAlgebra.EMF.SpriteCharacter_patternWidth =
|
||||
Sprite_Character.prototype.patternWidth;
|
||||
Sprite_Character.prototype.patternWidth = function() {
|
||||
var pw = ModernAlgebra.EMF.SpriteCharacter_patternWidth.apply(this, arguments)
|
||||
if (this._character.isEmfCharacter()) {
|
||||
var frameNum = this._character.emfCharacterState().frameNum;
|
||||
return ((pw*3) / frameNum);
|
||||
} else {
|
||||
return pw;
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
318
www/js/plugins/Extra_Followers.js
Normal file
318
www/js/plugins/Extra_Followers.js
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
//=============================================================================
|
||||
// TDS Extra Followers
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_ExtraFollowers = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.ExtraFollowers = _TDS_.ExtraFollowers || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin allows you to add extra followers to your party.
|
||||
*
|
||||
* @param Max Extra Followers
|
||||
* @desc Max amount of Extra Followers to add.
|
||||
* @default 4
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* * Script Calls
|
||||
* ============================================================================
|
||||
*
|
||||
* To clear all extra followers use the following script
|
||||
* call:
|
||||
*
|
||||
* this.clearExtraFollowers();
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* To add an extra follower use the following script call:
|
||||
*
|
||||
*
|
||||
* this.addExtraFollower(ID, NAME, INDEX, POSITION);
|
||||
*
|
||||
* ID
|
||||
* ^ Id used for tracking the follower.
|
||||
*
|
||||
* NAME:
|
||||
* ^ Graphics name.
|
||||
*
|
||||
* INDEX:
|
||||
* ^ Graphics Index.
|
||||
*
|
||||
* POSITION
|
||||
* ^ Position of the extra follower. (1~8)
|
||||
* (Optional: Defaults to the last available position.)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* this.addExtraFollower('OldMan', 'FA_CHURCH_MARKET', 1);
|
||||
*
|
||||
*
|
||||
* this.addExtraFollower('girl', 'FA_CHURCH_MARKET', 3, 6);
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* To remove an extra follower use the following script call:
|
||||
*
|
||||
* this.removeExtraFollower(POSITION);
|
||||
*
|
||||
* POSITION:
|
||||
* ^ Position of the extra follower. (1~8);
|
||||
* (Optional: Defaults to the last position.)
|
||||
*
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* this.removeExtraFollower();
|
||||
*
|
||||
* this.removeExtraFollower(5);
|
||||
*
|
||||
*
|
||||
*
|
||||
* To remove an extra follower by it's ID use the following
|
||||
* script call:
|
||||
*
|
||||
* $gamePlayer._followers.removeExtraFollower(ID);
|
||||
*
|
||||
* ID
|
||||
* ^ Follower Id.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* this.removeFollowerById('OldMan')
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Extra_Followers");
|
||||
// Initialize Parameters
|
||||
_TDS_.ExtraFollowers.params = {};
|
||||
_TDS_.ExtraFollowers.params.maxExtraFollowers = Number(parameters['Max Extra Followers'] || 4);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Followers
|
||||
//-----------------------------------------------------------------------------
|
||||
// The wrapper class for a follower array.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ExtraFollowers.Game_Followers_initialize = Game_Followers.prototype.initialize;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.initialize = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ExtraFollowers.Game_Followers_initialize.call(this);
|
||||
// Extra Start
|
||||
var extraStart = this._data.length;
|
||||
for (var i = 0; i < _TDS_.ExtraFollowers.params.maxExtraFollowers; i++) {
|
||||
this._data.push(new Game_Follower(extraStart + i + 1))
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Extra Follower Last
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.nextExtraFollowerSlot = function() {
|
||||
// Get Starting Index
|
||||
var index = $gameParty.maxBattleMembers()-1;
|
||||
// Go Through Data
|
||||
for (var i = index; i < this._data.length; i++) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// Set Index
|
||||
index = i;
|
||||
// If Follower Graphics data is undefined
|
||||
if (follower._graphicsData === undefined) { break; }
|
||||
};
|
||||
// Return Index
|
||||
return index;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Last Extra Follower Slot
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.lastExtraFollowerSlot = function() {
|
||||
// Start
|
||||
var start = $gameParty.maxBattleMembers()-1;
|
||||
// Get Starting Index
|
||||
var index = this._data.length-1
|
||||
// Go Through Data in reverse
|
||||
for (var i = this._data.length-1; i >= start; i--) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// Set Index
|
||||
index = i;
|
||||
if (follower._graphicsData !== undefined) { break; }
|
||||
};
|
||||
// Return Index
|
||||
return index;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Extra Followers
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.clearExtraFollowers = function() {
|
||||
// Go Through Data
|
||||
for (var i = 0; i < this._data.length; i++) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// Delete Follower Graphics Data
|
||||
delete follower._graphicsData;
|
||||
};
|
||||
// Refresh
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Extra Follower
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.addExtraFollower = function(id, name, index, cIndex) {
|
||||
// Set default character index
|
||||
if (cIndex === undefined) { cIndex = this.nextExtraFollowerSlot(); };
|
||||
// Follower Object
|
||||
var follower = this._data[cIndex];
|
||||
// Set Graphics Data
|
||||
follower._graphicsData = {id: id, name: name, index: index};
|
||||
// Refresh
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Extra Follower
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.removeExtraFollower = function(index) {
|
||||
// Set Default Index
|
||||
if (index === undefined) { index = this.lastExtraFollowerSlot(); };
|
||||
// Follower Object
|
||||
var follower = this._data[index];
|
||||
// Delete Graphics Data
|
||||
delete follower._graphicsData;
|
||||
// Realign Extra Followers
|
||||
this.realignExtraFollowers();
|
||||
// Refresh
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Follower By ID
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.removeFollowerById = function(id) {
|
||||
// Go Through Data
|
||||
for (var i = 0; i < this._data.length; i++) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// If Follower Graphics Data matches the ID
|
||||
if (follower._graphicsData && follower._graphicsData.id === id) {
|
||||
delete follower._graphicsData;
|
||||
};
|
||||
};
|
||||
// Realign Extra Followers
|
||||
this.realignExtraFollowers();
|
||||
// Refresh
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Realign Extar Followers
|
||||
//=============================================================================
|
||||
Game_Followers.prototype.realignExtraFollowers = function(index) {
|
||||
var graphics = this._data.filter(function(follower) {
|
||||
return follower._graphicsData !== undefined;
|
||||
});
|
||||
// Get Starting Index
|
||||
var index = $gameParty.maxBattleMembers()-1;
|
||||
// Go Through Data
|
||||
for (var i = index; i < this._data.length; i++) {
|
||||
// Get Follower
|
||||
var follower = this._data[i];
|
||||
// Get Data
|
||||
var data = graphics[i - index];
|
||||
// Get Graphics Data
|
||||
var graphicsData = data ? Object.assign({}, data._graphicsData) : null;
|
||||
// Delete Follower Data
|
||||
delete follower._graphicsData
|
||||
// If Graphics DAta
|
||||
if (graphicsData) {
|
||||
// Set Graphics Data
|
||||
follower._graphicsData = graphicsData;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Follower
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a follower. A follower is an allied character,
|
||||
// other than the front character, displayed in the party.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ExtraFollowers.Game_Follower_isVisible = Game_Follower.prototype.isVisible;
|
||||
_TDS_.ExtraFollowers.Game_Follower_refresh = Game_Follower.prototype.refresh;
|
||||
//=============================================================================
|
||||
// * Determine if visible
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.isVisible = function() {
|
||||
// Return true if follower has graphics data
|
||||
if ($gamePlayer.followers().isVisible() && this._graphicsData) { return true; };
|
||||
// Return default
|
||||
return _TDS_.ExtraFollowers.Game_Follower_isVisible.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Extra Follower
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.refresh = function() {
|
||||
// If Graphics Data Exists
|
||||
if (this._graphicsData) {
|
||||
this.setImage(this._graphicsData.name, this._graphicsData.index);
|
||||
} else {
|
||||
// Run Original Function
|
||||
_TDS_.ExtraFollowers.Game_Follower_refresh.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Clear Extra Followers
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.clearExtraFollowers = function() {
|
||||
// Clear Extra Followers
|
||||
$gamePlayer._followers.clearExtraFollowers();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Extra Follower
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.addExtraFollower = function(id, name, index, cIndex) {
|
||||
// Add Extra Follower
|
||||
$gamePlayer._followers.addExtraFollower(id, name, index, cIndex);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Extra Follower
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.removeExtraFollower = function(index) {
|
||||
// Remove Extra Follower
|
||||
$gamePlayer._followers.removeExtraFollower(index);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Extra Follower by ID
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.removeFollowerById = function(id) {
|
||||
// Remove Extra Follower
|
||||
$gamePlayer._followers.removeFollowerById(id);
|
||||
};
|
||||
|
||||
|
||||
|
||||
1577
www/js/plugins/FilterController.js
Normal file
1577
www/js/plugins/FilterController.js
Normal file
File diff suppressed because one or more lines are too long
28
www/js/plugins/FilterControllerBlurPatch.js
Normal file
28
www/js/plugins/FilterControllerBlurPatch.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*:
|
||||
* @plugindesc Filter Controller Blur Quality Patch
|
||||
* v 1.01 - replaced Kawase Blur with regular Guassin
|
||||
* @author Anisoft (aka Dairnon)
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* This adds a new quality param after the blur ammount param.
|
||||
* To use simply just add the amount u want after amount param
|
||||
*
|
||||
*
|
||||
* Ex:
|
||||
*
|
||||
* setFilter id amount quality
|
||||
*
|
||||
* setFilter 0 32 8
|
||||
*
|
||||
*
|
||||
*/
|
||||
Filter_Controller.defaultFilterParam["blur"] = [8, 4];
|
||||
Filter_Controller.filterNameMap["blur"] = PIXI.filters.BlurFilter; // -> No KawaseBlur: slow
|
||||
|
||||
(function($) {
|
||||
$.blur = function(filter, cp) {
|
||||
filter.blur = cp[0];
|
||||
cp[1] ? filter.quality = cp[1] : null;
|
||||
}
|
||||
})(Filter_Controller.updateFilterHandler);
|
||||
182
www/js/plugins/Follower_Control.js
Normal file
182
www/js/plugins/Follower_Control.js
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
//=============================================================================
|
||||
// TDS Follower Control
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_FollowerControl = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.FollowerControl = _TDS_.FollowerControl || {};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Follower
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a follower. A follower is an allied character,
|
||||
// other than the front character, displayed in the party.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.FollowerControl.Game_Follower_initialize = Game_Follower.prototype.initialize;
|
||||
_TDS_.FollowerControl.Game_Follower_update = Game_Follower.prototype.update;
|
||||
_TDS_.FollowerControl.Game_Follower_chaseCharacter = Game_Follower.prototype.chaseCharacter;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.initialize = function(memberIndex) {
|
||||
// Set Released Flag
|
||||
this._released = false;
|
||||
// Run Original Function
|
||||
_TDS_.FollowerControl.Game_Follower_initialize.call(this, memberIndex);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Release/Enslave
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.release = function() { this._released = true; };
|
||||
Game_Follower.prototype.enslave = function() { this._released = false; };
|
||||
//=============================================================================
|
||||
// * Determine if Follower is Free
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.isFree = function() { return this._released; };
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.update = function() {
|
||||
// If Free
|
||||
if (this.isFree()) {
|
||||
// Update Character
|
||||
Game_Character.prototype.update.call(this);
|
||||
return;
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.FollowerControl.Game_Follower_update.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Chase Character
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.chaseCharacter = function(character) {
|
||||
// If Free
|
||||
if (this.isFree()) { return; };
|
||||
// Run Original Function
|
||||
_TDS_.FollowerControl.Game_Follower_chaseCharacter.call(this, character);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.refresh = function() {
|
||||
var characterName = this.characterName();
|
||||
var characterIndex = this.characterIndex()
|
||||
this.setImage(characterName, characterIndex);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Character Name
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.characterName = function() {
|
||||
// If Visible
|
||||
if (this.isVisible()) {
|
||||
if (this.actor().isDead()) { return '$Toast'; }
|
||||
return this.actor().characterName();
|
||||
};
|
||||
// Return Empty String
|
||||
return '';
|
||||
};
|
||||
//=============================================================================
|
||||
// * Character Index
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.characterIndex = function() {
|
||||
// If Visible
|
||||
if (this.isVisible()) {
|
||||
if (this.actor().isDead()) { return 5; }
|
||||
return this.actor().characterIndex();
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_Base
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.FollowerControl.Game_Interpreter_clear = Game_Interpreter.prototype.clear;
|
||||
_TDS_.FollowerControl.Game_Interpreter_character = Game_Interpreter.prototype.character;
|
||||
//=============================================================================
|
||||
// * Clear
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.clear = function() {
|
||||
// Run Original Function
|
||||
_TDS_.FollowerControl.Game_Interpreter_clear.call(this);
|
||||
// Clear Follower Character
|
||||
this.clearFollower();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Follower
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.getFollower = function(index) { return $gamePlayer.followers().follower(index); };
|
||||
//=============================================================================
|
||||
// * Release Follower
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.releaseFollower = function(index) {
|
||||
// Get Follower
|
||||
var follower = this.getFollower(index);
|
||||
// Release Follower
|
||||
if (follower) { follower.release(); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Enslave Follower
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.enslaveFollower = function(index) {
|
||||
// Get Follower
|
||||
var follower = this.getFollower(index);
|
||||
// Release Follower
|
||||
if (follower) { follower.enslave(); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Follower Character
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.controlFollower = function(index, release) {
|
||||
// If Release is undefined
|
||||
if (release === undefined) { release = true; }
|
||||
// Set Follower Character
|
||||
this._followerCharacter = this.getFollower(index);
|
||||
// Release Follower Character
|
||||
if (release) { this._followerCharacter.release(); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Follower Character
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.clearFollower = function(index, enslave) {
|
||||
// If Enslaved is undefined
|
||||
if (enslave === undefined) { enslave = true; }
|
||||
// Enslave Character
|
||||
if (enslave && this._followerCharacter) { this._followerCharacter.enslave(); }
|
||||
// Set Follower Character to null
|
||||
this._followerCharacter = null;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Character
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.character = function(param) {
|
||||
// If Follower Character
|
||||
if (this._followerCharacter) {
|
||||
// Get Character
|
||||
var character = this._followerCharacter;
|
||||
// Return Character
|
||||
return character;
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.FollowerControl.Game_Interpreter_character.call(this, param);
|
||||
};
|
||||
|
||||
|
||||
// this.isVisible() ? this.actor().characterIndex() : 0;
|
||||
|
||||
|
||||
// characterName = //'!Flame';
|
||||
// characterIndex = 5;
|
||||
|
||||
// if (this._memberIndex === 1) {
|
||||
// characterName = '!Flame';
|
||||
// characterIndex = 4;
|
||||
// };
|
||||
38
www/js/plugins/Fullscreen.js
Normal file
38
www/js/plugins/Fullscreen.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//=============================================================================
|
||||
// Fullscreen.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Starts the game in fullscreen
|
||||
* @author Christian Schicho
|
||||
*
|
||||
* @help
|
||||
*/
|
||||
|
||||
; (function () {
|
||||
function extend(obj, name, func) {
|
||||
var orig = obj.prototype[name]
|
||||
obj.prototype[name] = function () {
|
||||
orig.call(this)
|
||||
func.call(this)
|
||||
}
|
||||
}
|
||||
|
||||
extend(Scene_Boot, 'start', function () {
|
||||
Graphics._switchFullScreen();
|
||||
})
|
||||
|
||||
|
||||
var _Scene_Base_create = Scene_Base.prototype.create;
|
||||
|
||||
Scene_Base.prototype.create = function () {
|
||||
const w = 640;
|
||||
const h = 480;
|
||||
_Scene_Base_create.call(this);
|
||||
Graphics.width = w;
|
||||
Graphics.height = h;
|
||||
Graphics.boxHeight = h;
|
||||
Graphics.boxWidth = w;
|
||||
};
|
||||
|
||||
})()
|
||||
277
www/js/plugins/GALV_AnimatedSplashScreens.js
Normal file
277
www/js/plugins/GALV_AnimatedSplashScreens.js
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Galv's Animated Splash Screens
|
||||
//-----------------------------------------------------------------------------
|
||||
// For: RPGMAKER MV
|
||||
// GALV_AnimatedSplashScreens.js
|
||||
//-----------------------------------------------------------------------------
|
||||
// 2016-10-22 - Version 1.1 - fixed database battle tst
|
||||
// 2016-04-25 - Version 1.0 - release
|
||||
//-----------------------------------------------------------------------------
|
||||
// Terms can be found at:
|
||||
// galvs-scripts.com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Galv_AnimatedSplashScreens = true;
|
||||
|
||||
var Galv = Galv || {}; // Galv's main object
|
||||
Galv.ASPLASH = Galv.ASPLASH || {}; // Galv's stuff
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*:
|
||||
* @plugindesc (v.1.1) Set up animated splash screens that show before the title screen.
|
||||
*
|
||||
* @author Galv - galvs-scripts.com
|
||||
*
|
||||
* @param ----- SPLASH SCREENS -----
|
||||
* @desc
|
||||
* @default
|
||||
*
|
||||
* @param Splash Images
|
||||
* @desc image,timer,fade,animId - See help file for more info.
|
||||
* @default image,150,8,0|image,150,8,0
|
||||
*
|
||||
* @param Splash Background
|
||||
* @desc The color (eg. #000000) or image (from /img/system/) of background during splash images
|
||||
* @default #333
|
||||
*
|
||||
* @param Splash Skip
|
||||
* @desc Skip option can be: ALL (to skip all images), ONE (to skip just one), NONE (disable skipping)
|
||||
* @default ONE
|
||||
*
|
||||
* @help
|
||||
* Galv's Animated Splash Screens
|
||||
* ----------------------------------------------------------------------------
|
||||
* This plugin allows you to make animated splash screens that display before
|
||||
* the title screen. All splash images used in this plugin are taken from:
|
||||
* /img/system/
|
||||
*
|
||||
* The "Splash Images" plugin setting is where you set up all your splash
|
||||
* images and you can have as many as you like.
|
||||
* Each splash image has the following required values:
|
||||
*
|
||||
* image,timer,fade,animId
|
||||
*
|
||||
* image - the image name from /img/system/ folder
|
||||
* timer - how many frames the image will remain on the screen
|
||||
* fade - the speed the image fades in/out (lower is slower)
|
||||
* animId - the animation played (from database) when image is faded in
|
||||
*
|
||||
* You can have multiple splash images separated by "|" symbol.
|
||||
* EXAMPLE:
|
||||
* image1,150,8,3|image2,150,8,2|image3,150,8,0
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CODE STUFFS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
(function() {
|
||||
|
||||
Galv.ASPLASH.splashed = false;
|
||||
|
||||
// Splash Screens
|
||||
Galv.ASPLASH.splashImgs = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Images"].split("|");
|
||||
for (i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
|
||||
var array = new Object(Galv.ASPLASH.splashImgs[i].split(","));
|
||||
Galv.ASPLASH.splashImgs[i] = {};
|
||||
Galv.ASPLASH.splashImgs[i].image = array[0];
|
||||
Galv.ASPLASH.splashImgs[i].timer = Number(array[1]);
|
||||
Galv.ASPLASH.splashImgs[i].fade = Number(array[2]);
|
||||
Galv.ASPLASH.splashImgs[i].anim = Number(array[3]);
|
||||
};
|
||||
|
||||
Galv.ASPLASH.splashBg = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Background"];
|
||||
Galv.ASPLASH.splashSkip = PluginManager.parameters('Galv_AnimatedSplashScreens')["Splash Skip"].toLowerCase();
|
||||
|
||||
|
||||
|
||||
Galv.ASPLASH.Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages;
|
||||
Scene_Boot.loadSystemImages = function() {
|
||||
Galv.ASPLASH.Scene_Boot_loadSystemImages.call(this);
|
||||
|
||||
for (var i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
|
||||
ImageManager.loadSystem(Galv.ASPLASH.splashImgs[i].image);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// SCENE SPLASHSCREENS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Galv.ASPLASH.SceneManager_goto = SceneManager.goto;
|
||||
SceneManager.goto = function(sceneClass) {
|
||||
if (!Galv.ASPLASH.splashed && $dataActors && !DataManager.isBattleTest()) {
|
||||
if(!!StorageManager.exists(44)) {
|
||||
Galv.ASPLASH.splashed = true;
|
||||
return Galv.ASPLASH.SceneManager_goto.call(this,sceneClass);
|
||||
}
|
||||
sceneClass = Scene_SplashScreens
|
||||
}; // if no splash has played this boot, steal scene
|
||||
Galv.ASPLASH.SceneManager_goto.call(this,sceneClass);
|
||||
};
|
||||
|
||||
|
||||
// SCENE SPLASHSCREENS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function Scene_SplashScreens() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Scene_SplashScreens.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_SplashScreens.prototype.constructor = Scene_SplashScreens;
|
||||
|
||||
Scene_SplashScreens.prototype.initialize = function() {
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.create = function() {
|
||||
Scene_Base.prototype.create.call(this);
|
||||
this.setVars();
|
||||
this.createBackground();
|
||||
this.createSplashes();
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.setVars = function() {
|
||||
this._splashIndex = 0; // the splash being displayed
|
||||
this._ticker = 0; // length timer
|
||||
this._fadeIn = true; // fadein start
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.createBackground = function() {
|
||||
if (Galv.ASPLASH.splashBg[0] == "#") {
|
||||
var w = Graphics.boxWidth;
|
||||
var h = Graphics.boxHeight;
|
||||
this._backSprite = new Sprite();
|
||||
this._backSprite.bitmap = new Bitmap(w,h);
|
||||
this._backSprite.bitmap.fillRect(0, 0, w, h, Galv.ASPLASH.splashBg);
|
||||
} else {
|
||||
this._backSprite = new Sprite(ImageManager.loadSystem(Galv.ASPLASH.splashBg));
|
||||
this.centerSprite(this._backSprite);
|
||||
};
|
||||
this.addChild(this._backSprite);
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.createSplashes = function() {
|
||||
this._sprites = [];
|
||||
for (i = 0; i < Galv.ASPLASH.splashImgs.length; i++) {
|
||||
this._sprites[i] = new Sprite_SplashImage(i);
|
||||
this.centerSprite(this._sprites[i]);
|
||||
this.addChild(this._sprites[i]);
|
||||
};
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.centerSprite = function(sprite) {
|
||||
sprite.x = Graphics.width / 2;
|
||||
sprite.y = Graphics.height / 2;
|
||||
sprite.anchor.x = 0.5;
|
||||
sprite.anchor.y = 0.5;
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.sprite = function() {
|
||||
return this._sprites[this._splashIndex];
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.splash = function() {
|
||||
return Galv.ASPLASH.splashImgs[this._splashIndex];
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.start = function() {
|
||||
Scene_Base.prototype.start.call(this);
|
||||
SceneManager.clearStack();
|
||||
this.centerSprite(this._backSprite);
|
||||
this.startFadeIn(this.fadeSpeed(), false);
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.update = function() {
|
||||
Scene_Base.prototype.update.call(this);
|
||||
this.updateSplash();
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.updateSplash = function() {
|
||||
if (this._fadeIn) {
|
||||
this.sprite().opacity += this.splash().fade;
|
||||
if (this.sprite().opacity >= 255) {
|
||||
this._fadeIn = false;
|
||||
this.sprite().doAnim();
|
||||
};
|
||||
} else {
|
||||
if (this._ticker < this.splash().timer) {
|
||||
this._ticker++;
|
||||
} else {
|
||||
this.sprite().opacity -= this.splash().fade;
|
||||
if (this.sprite().opacity <= 0) {
|
||||
if (!this._sprites[this._splashIndex + 1]) return this.endSplashes();
|
||||
this._splashIndex++;
|
||||
this._fadeIn = true;
|
||||
this._ticker = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (Input.isTriggered('ok')) {
|
||||
if (Galv.ASPLASH.splashSkip == 'one') {
|
||||
this._ticker = this.splash().timer;
|
||||
this._fadeIn = false;
|
||||
} else if (Galv.ASPLASH.splashSkip == 'all') {
|
||||
this._ticker = this.splash().timer;
|
||||
this._fadeIn = false;
|
||||
this._sprites[this._splashIndex + 1] = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Scene_SplashScreens.prototype.endSplashes = function() {
|
||||
Galv.ASPLASH.splashed = true;
|
||||
// SceneManager.goto(Scene_Title);
|
||||
SceneManager.goto(Scene_OmoriTitleScreen);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// SPRITE SPLASH
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function Sprite_SplashImage() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_SplashImage.prototype = Object.create(Sprite_Base.prototype);
|
||||
Sprite_SplashImage.prototype.constructor = Sprite_SplashImage;
|
||||
|
||||
Sprite_SplashImage.prototype.initialize = function(index) {
|
||||
Sprite_Base.prototype.initialize.call(this);
|
||||
this.bitmap = ImageManager.loadSystem(Galv.ASPLASH.splashImgs[index].image)
|
||||
this.opacity = 0;
|
||||
this._index = index;
|
||||
};
|
||||
|
||||
Sprite_SplashImage.prototype.doAnim = function() {
|
||||
this._animId = Galv.ASPLASH.splashImgs[this._index].anim;
|
||||
};
|
||||
|
||||
Sprite_SplashImage.prototype.update = function() {
|
||||
Sprite_Base.prototype.update.call(this);
|
||||
this.updateAnimation();
|
||||
};
|
||||
|
||||
Sprite_SplashImage.prototype.updateAnimation = function() {
|
||||
this.setupAnimation();
|
||||
if (!this.isAnimationPlaying()) {
|
||||
this._animationPlaying = false;
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_SplashImage.prototype.setupAnimation = function() {
|
||||
if (this._animId > 0) {
|
||||
var animation = $dataAnimations[this._animId];
|
||||
this.startAnimation(animation, false, 0);
|
||||
this._animId = 0;
|
||||
this._animationPlaying = true;
|
||||
}
|
||||
};
|
||||
})();
|
||||
264
www/js/plugins/GALV_CamControl.js
Normal file
264
www/js/plugins/GALV_CamControl.js
Normal file
|
|
@ -0,0 +1,264 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Galv's Cam Control
|
||||
//-----------------------------------------------------------------------------
|
||||
// For: RPGMAKER MV
|
||||
// GALV_CamControl.js
|
||||
// With some fixes by Anisoft
|
||||
//-----------------------------------------------------------------------------
|
||||
// 2016-05-02 - Version 2.0 - compatibilty with zooming and offset fixes
|
||||
// - by Anisoft
|
||||
// 2016-04-18 - Version 1.9 - fixed a bug with saving while cam disabled
|
||||
// 2016-03-16 - Version 1.8 - transferring player to same map no longer moves
|
||||
// - the camera if it has a different target.
|
||||
// 2015-12-30 - Version 1.7 - another fix for shuttering issue
|
||||
// 2015-12-17 - Version 1.6 - put in code to fix potential shuttering issue
|
||||
// 2015-12-17 - Version 1.5 - fixed an issue that enabled the disabled cam
|
||||
// 2015-12-01 - Version 1.4 - minor code changes
|
||||
// 2015-12-01 - Version 1.3 - missed part of the last bug. Fixed now.
|
||||
// 2015-11-30 - Version 1.2 - fixed bug with loading game and target breaking
|
||||
// 2015-11-27 - Version 1.1 - added tile size option
|
||||
// 2015-11-27 - Version 1.0 - release
|
||||
//-----------------------------------------------------------------------------
|
||||
// Terms can be found at:
|
||||
// galvs-scripts.com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Galv_CamControl = true;
|
||||
|
||||
var Galv = Galv || {}; // Galv's main object
|
||||
Galv.pCmd = Galv.pCmd || {}; // Plugin Command manager
|
||||
Galv.CC = Galv.CC || {}; // Galv's stuff
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*:
|
||||
* @plugindesc Allows greater control over where the game camera is focused. View HELP for plugin commands.
|
||||
*
|
||||
* @author Galv - galvs-scripts.com
|
||||
*
|
||||
* @param Tile Size
|
||||
* @desc Default 48. Only change if you change tile size in your game
|
||||
* @default 48
|
||||
*
|
||||
* @help
|
||||
* Galv's Cam Control
|
||||
* ----------------------------------------------------------------------------
|
||||
* This plugin creates a sliding movement for the camera as well as allows you
|
||||
* to set the target position of it to wherever required. (Player, event, xy)
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* PLUGIN COMMANDS
|
||||
* ----------------------------------------------------------------------------
|
||||
* CAM PLAYER SPD // Set camera focus to player.
|
||||
* // CAM - the plugin command word
|
||||
* // PLAYER - command word to choose player
|
||||
* // SPD - speed camera scrolls to target
|
||||
* // v# to use a variable
|
||||
* // default scroll speed is 800
|
||||
* // leave speed blank for default
|
||||
*
|
||||
* CAM EVENT ID SPD // Set camera focus to an event.
|
||||
* // CAM - the plugin command word
|
||||
* // EVENT - command word to choose event
|
||||
* // ID - the event's id
|
||||
* // v# to use a variable
|
||||
* // SPD - speed camera scrolls to target
|
||||
* // v# to use a variable
|
||||
* // default scroll speed is 800
|
||||
* // leave speed blank for default
|
||||
*
|
||||
* CAM X Y SPD // Set camera focus to an x,y position.
|
||||
* // CAM - the plugin command word
|
||||
* // X - the position on the map
|
||||
* // Y - the position on the map
|
||||
* // v# to use variables
|
||||
* // SPD - speed camera scrolls to target
|
||||
* // v# to use a variable
|
||||
* // default scroll speed is 800
|
||||
* // leave speed blank for default
|
||||
*
|
||||
* CAM DISABLE // Sets the focus on player and disables the
|
||||
* // sliding motion. (RPGMaker default);
|
||||
* // Using any command above will enable again
|
||||
*
|
||||
* NOTE: The higher the SPD value for these commands, the slower the movement.
|
||||
* Not recommended to use speeds that are too fast.
|
||||
*
|
||||
* EXAMPLES
|
||||
* CAM PLAYER // Camera focuses on player at speed 800
|
||||
* CAM PLAYER 1600 // Camera focuses on player at speed 1600 (slower)
|
||||
* CAM EVENT 3 // Camera focuses on event 3 at speed 800
|
||||
* CAM EVENT 12 400 // Camera focuses on event 12 at speed 400 (faster)
|
||||
* CAM 23 18 // Camera focuses on x23, y18 position on the map
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CODE STUFFS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
(function() {
|
||||
|
||||
Galv.CC.size = Number(PluginManager.parameters('Galv_CamControl')["Tile Size"]);
|
||||
|
||||
// OVERWRITE - BECAUSE OF JITTER
|
||||
Game_Map.prototype.displayX = function() {return Math.round(this._displayX * Galv.CC.size) / Galv.CC.size};
|
||||
Game_Map.prototype.displayY = function() {return Math.round(this._displayY * Galv.CC.size) / Galv.CC.size};
|
||||
|
||||
|
||||
// GALV'S PLUGIN MANAGEMENT. INCLUDED IN ALL GALV PLUGINS THAT HAVE PLUGIN COMMAND CALLS, BUT ONLY RUN ONCE.
|
||||
if (!Galv.aliased) {
|
||||
var Galv_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
if (Galv.pCmd[command]) {
|
||||
Galv.pCmd[command](args);
|
||||
return;
|
||||
};
|
||||
Galv_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
};
|
||||
Galv.aliased = true; // Don't keep aliasing for other Galv scripts.
|
||||
};
|
||||
|
||||
// Direct to Plugin Object
|
||||
Galv.pCmd.CAM = function(arguments) {
|
||||
Galv.CC.camControl(arguments);
|
||||
};
|
||||
// END GALV'S PLUGIN MANAGEMENT
|
||||
|
||||
|
||||
Galv.CC.camControl = function(args) {
|
||||
|
||||
var key = args[0].toLowerCase();
|
||||
var speed = 100;
|
||||
switch (key) {
|
||||
case "player":
|
||||
var target = $gamePlayer;
|
||||
if (args[1]) speed = Galv.CC.getValue(args[1]);
|
||||
break;
|
||||
case "event":
|
||||
var eId = Galv.CC.getValue(args[1]);
|
||||
var target = $gameMap.event(eId);
|
||||
if (args[2]) speed = Galv.CC.getValue(args[2]);
|
||||
break;
|
||||
case "disable":
|
||||
$gameMap.camTarget = $gamePlayer;
|
||||
$gameMap.camNorm = true;
|
||||
$gameMap.savedCamTarget = null;
|
||||
return;
|
||||
default:
|
||||
var px = Galv.CC.getValue(args[0]);
|
||||
var py = Galv.CC.getValue(args[1]);
|
||||
if (args[2]) speed = Galv.CC.getValue(args[2]);
|
||||
var target = {
|
||||
x: px,
|
||||
y: py,
|
||||
_realX: px,
|
||||
_realY: py,
|
||||
screenX: Game_CharacterBase.prototype.screenX,
|
||||
screenY: function() {
|
||||
var th = $gameMap.tileHeight();
|
||||
return Math.round(this.scrolledY() * th + th);
|
||||
},
|
||||
scrolledX: Game_CharacterBase.prototype.scrolledX,
|
||||
scrolledY: Game_CharacterBase.prototype.scrolledY
|
||||
};
|
||||
};
|
||||
$gameMap.camTargetSet(target,speed);
|
||||
$gameMap.savedCamTarget = args;
|
||||
};
|
||||
|
||||
Galv.CC.getValue = function(string) {
|
||||
if (string[0].toLowerCase() === "v") {
|
||||
// Use variable
|
||||
var varId = Number(string.replace("v",""));
|
||||
return $gameVariables.value(varId);
|
||||
} else {
|
||||
return Number(string);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// GAME PLAYER
|
||||
|
||||
Galv.CC.Game_Player_updateScroll = Game_Player.prototype.updateScroll;
|
||||
Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
|
||||
if ($gameMap.camNorm) return Galv.CC.Game_Player_updateScroll.call(this,lastScrolledX, lastScrolledY);
|
||||
};
|
||||
|
||||
|
||||
// GAME MAP
|
||||
|
||||
Galv.CC.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
|
||||
Scene_Map.prototype.onMapLoaded = function() {
|
||||
Galv.CC.Scene_Map_onMapLoaded.call(this);
|
||||
if (!$gameMap.camNorm) {
|
||||
$gameMap.savedCamTarget = $gameMap.savedCamTarget || ["PLAYER"];
|
||||
Galv.CC.camControl($gameMap.savedCamTarget);
|
||||
};
|
||||
};
|
||||
|
||||
Galv.CC.Game_Map_setup = Game_Map.prototype.setup;
|
||||
Game_Map.prototype.setup = function(mapId) {
|
||||
this.zoom = this.zoom || new PIXI.Point(1,1);
|
||||
if (!this.camNorm) {
|
||||
this.camTargetSet($gamePlayer,800);
|
||||
this.savedCamTarget = ["PLAYER"];
|
||||
};
|
||||
Galv.CC.Game_Map_setup.call(this,mapId);
|
||||
};
|
||||
|
||||
Game_Map.prototype.camTargetSet = function(target,speed) {
|
||||
this.camTarget = target;
|
||||
this.camNorm = false;
|
||||
this.camSpeed = speed || 800;
|
||||
};
|
||||
|
||||
Galv.CC.Game_Map_updateScroll = Game_Map.prototype.updateScroll;
|
||||
Game_Map.prototype.updateScroll = function() {
|
||||
if (this.camNorm) return Galv.CC.Game_Map_updateScroll.call(this);
|
||||
|
||||
this._scrollRest = 0;
|
||||
|
||||
var cw = (Graphics.boxWidth / 2);
|
||||
var ch = (Graphics.boxHeight / 2);
|
||||
|
||||
var screenX = this.camTarget.screenX()*this.zoom.x;
|
||||
var screenY = this.camTarget.screenY()*this.zoom.y;
|
||||
|
||||
var sx = Math.abs(screenX - cw) / this.camSpeed;
|
||||
var sy = Math.abs(screenY - ch) / this.camSpeed;
|
||||
if (sx < 0.005) (sx = 0);
|
||||
if (sy < 0.005) (sy = 0);
|
||||
|
||||
var x_pos = screenX;
|
||||
var y_pos = screenY;
|
||||
|
||||
if (y_pos < ch) {
|
||||
this.scrollUp(sy);
|
||||
} else if (y_pos > ch) {
|
||||
this.scrollDown(sy);
|
||||
};
|
||||
|
||||
if (x_pos < cw) {
|
||||
this.scrollLeft(sx);
|
||||
} else if (x_pos > cw) {
|
||||
this.scrollRight(sx);
|
||||
};
|
||||
};
|
||||
|
||||
Galv.CC.Game_Player_center = Game_Player.prototype.center;
|
||||
Game_Player.prototype.center = function(x, y) {
|
||||
if ($gameMap.camTarget == $gamePlayer || $gameMap.camNorm) {
|
||||
return Galv.CC.Game_Player_center.call(this,x,y);
|
||||
};
|
||||
};
|
||||
|
||||
Game_Player.prototype.centerX = function() {
|
||||
return ((Graphics.width / $gameMap.tileWidth() - (1*$gameMap.zoom.x)) / 2.0)/$gameMap.zoom.x;
|
||||
};
|
||||
|
||||
Game_Player.prototype.centerY = function() {
|
||||
return ((Graphics.height / $gameMap.tileHeight() - 1.75*$gameMap.zoom.y) / 2.0)/$gameMap.zoom.y;
|
||||
};
|
||||
})();
|
||||
568
www/js/plugins/GALV_EventDetectors.js
Normal file
568
www/js/plugins/GALV_EventDetectors.js
Normal file
|
|
@ -0,0 +1,568 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Galv's Event Detectors
|
||||
//-----------------------------------------------------------------------------
|
||||
// For: RPGMAKER MV
|
||||
// GALV_EventDetectors.js
|
||||
//-----------------------------------------------------------------------------
|
||||
// 2016-08-21 - Version 1.2 - fixes to 'non detected' frequency
|
||||
// 2016-08-20 - Version 1.1 - fixed bug when no terrain or regions specified
|
||||
// 2016-08-01 - Version 1.0 - release
|
||||
//-----------------------------------------------------------------------------
|
||||
// Terms can be found at:
|
||||
// galvs-scripts.com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Galv_EventDetectors = true;
|
||||
|
||||
var Galv = Galv || {}; // Galv's main object
|
||||
Galv.DETECT = Galv.DETECT || {}; // Galv's stuff
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*:
|
||||
* @plugindesc Have events activate when player gets in range and line of sight.
|
||||
*
|
||||
* @author Galv - galvs-scripts.com
|
||||
*
|
||||
* @param LOS Blocking Terrain
|
||||
* @desc Terrain tag ID's for tiles that block line of sight, separated by commas
|
||||
* @default 5,6
|
||||
*
|
||||
* @param LOS Blocking Regions
|
||||
* @desc Region ID's for tiles that block line of sight, separated by commas
|
||||
* @default 1,2
|
||||
*
|
||||
* @param Tile Size
|
||||
* @desc The pixel size of the tiles you are using.
|
||||
* Default: 48
|
||||
* @default 48
|
||||
*
|
||||
* @param Search Limit
|
||||
* @desc Amount of checks for default pathfinding. Larger might cause lag, smaller might make returning home fail
|
||||
* Default: 12
|
||||
* @default 24
|
||||
*
|
||||
* @param --- Behaviors ---
|
||||
* @desc
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 0
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 1
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 2
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 3
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 4
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 5
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 6
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 7
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 8
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 9
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 10
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 11
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 12
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 13
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 14
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 15
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 16
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 17
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 18
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 19
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @param Behavior 20
|
||||
* @desc Behavior of event if detecting. (see help file)
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
* @default
|
||||
*
|
||||
* @help
|
||||
* Galv's Event Detectors
|
||||
* ----------------------------------------------------------------------------
|
||||
* This is a basic event detection plugin. It can allow events to detect the
|
||||
* player within a certain range and within line of sight.
|
||||
* Line of sight is 180 degrees in the event's front arc. Regions, terrain tags
|
||||
* or events can be set to block line of sight to the player.
|
||||
* Region Id's and terrain tag Id's are set using the plugin settings. To make
|
||||
* an event block line of sight, you need to use a COMMENT inside an event
|
||||
* page that has a text tag as follows:
|
||||
*
|
||||
* <block_los>
|
||||
*
|
||||
* An event that has an active page with this tag will block line of sight. If
|
||||
* the page is changed to one without the tag, it will not block LOS.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* Conditional Branch SCRIPT
|
||||
* ----------------------------------------------------------------------------
|
||||
* You can use the below script call to check if an event can detect the player
|
||||
* at the time the conditional branch is called. (Yes this can be used in a
|
||||
* parallel process event if required)
|
||||
*
|
||||
* Galv.DETECT.event(id,dist,los) // id = event ID that is a detector
|
||||
* // dist = tile distance from player
|
||||
* // los = true or false for line of sight
|
||||
*
|
||||
* This will return true if the player is in distance range of the event and
|
||||
* if los is true, it will also check if player is in line of sight to it.
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* Event command SCRIPT
|
||||
* ----------------------------------------------------------------------------
|
||||
* $gameSystem._undetectable = x; // x can be true or false. When true
|
||||
* // player cannot be detected
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* Behaviors
|
||||
* ----------------------------------------------------------------------------
|
||||
* Behaviors can be used to set up an event's reaction from within the custom
|
||||
* 'Autonomous Movement' settings of the event. The plugin settings has many
|
||||
* behaviors you can set up with the following settings:
|
||||
*
|
||||
* moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
|
||||
*
|
||||
* moveTypes can be one of the following:
|
||||
* approach, flee, search, freeze, rand, return
|
||||
* approach - event moves toward player, no pathfinding
|
||||
* flee - event moves away from player
|
||||
* search - event moves toward player's last detected position with
|
||||
* - default rpgmaker pathfinding. The 'search limit' sets
|
||||
* - how far an event will find its way to player or return
|
||||
* freeze - event doesn't move
|
||||
* rand - event moves randomly
|
||||
* return - event saves it's original position and returns to this
|
||||
* position when not detecting the player.
|
||||
* dist = distance in number of tiles from the event that it can detect
|
||||
* los = 0 or 1... 1 to use line of sight or 0 to not for detecting
|
||||
* speed = the change of move speed while detecting (1-6)
|
||||
* freq = the change of move frequency while detecting (1-5)
|
||||
* balloon = the balloon id to show when event detects player
|
||||
*
|
||||
* HOW TO USE
|
||||
* To set an event to follow a behavior, you need to use a 'SCRIPT' command
|
||||
* inside of a custom Autonomous Move Route as follows:
|
||||
*
|
||||
* this.detector(id);
|
||||
*
|
||||
* This will use the chosen Behavior id (from the numbers in the plugin setup).
|
||||
* The 'moveTypeBefore' selection above and the event page's speed and freq
|
||||
* control the event's default movement when not detecting.
|
||||
*
|
||||
* See demo for examples
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CODE STUFFS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
(function() {
|
||||
|
||||
// Blocking terrain tag array
|
||||
var tmp = PluginManager.parameters('Galv_EventDetectors')["LOS Blocking Terrain"].split(",");
|
||||
Galv.DETECT.bTerrain = [];
|
||||
|
||||
if (tmp && tmp[0]) {
|
||||
for (var i = 0; i < tmp.length; i++) {
|
||||
Galv.DETECT.bTerrain.push(Number(tmp[i]));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Blocking regions array
|
||||
tmp = PluginManager.parameters('Galv_EventDetectors')["LOS Blocking Regions"].split(",");
|
||||
Galv.DETECT.bRegions = [];
|
||||
if (tmp || tmp[0]) {
|
||||
for (var i = 0; i < tmp.length; i++) {
|
||||
Galv.DETECT.bRegions.push(Number(tmp[i]));
|
||||
};
|
||||
};
|
||||
|
||||
// tile size
|
||||
Galv.DETECT.tile = Number(PluginManager.parameters('Galv_EventDetectors')["Tile Size"]);
|
||||
Galv.DETECT.searches = Number(PluginManager.parameters('Galv_EventDetectors')["Search Limit"]);
|
||||
|
||||
// Behaviors
|
||||
Galv.DETECT.behaviors = {};
|
||||
var i = 0;
|
||||
do {
|
||||
tmp = PluginManager.parameters('Galv_EventDetectors')["Behavior " + i];
|
||||
if (tmp) {
|
||||
Galv.DETECT.behaviors[i] = tmp.split(",");
|
||||
for (var i2 = 2; i2 < Galv.DETECT.behaviors[i].length; i2++) {
|
||||
Galv.DETECT.behaviors[i][i2] = Number(Galv.DETECT.behaviors[i][i2]);
|
||||
};
|
||||
};
|
||||
i++;
|
||||
}
|
||||
while (tmp);
|
||||
|
||||
Galv.DETECT.event = function(id,dist,los) {
|
||||
if ($gameSystem._undetectable) return false;
|
||||
return $gameMap.event(id).distDetect(dist,los);
|
||||
};
|
||||
|
||||
Galv.DETECT.dist = function(x1,y1,x2,y2) {
|
||||
return Math.sqrt(Math.pow(x1 - x2,2) + Math.pow(y1 - y2,2));
|
||||
};
|
||||
|
||||
Galv.DETECT.isBlock = function(x,y) {
|
||||
var x = Math.round(x);
|
||||
var y = Math.round(y);
|
||||
if (Galv.DETECT.bRegions.contains($gameMap.regionId(x,y))) return true;
|
||||
if (Galv.DETECT.bTerrain.contains($gameMap.terrainTag(x,y))) return true;
|
||||
// Blocking event
|
||||
var blockEvent = false;
|
||||
$gameMap.eventsXy(x, y).forEach(function(event) {
|
||||
if (event._blockLos) return blockEvent = true;
|
||||
});
|
||||
return blockEvent;
|
||||
};
|
||||
|
||||
Galv.DETECT.los = function(char1,char2) {
|
||||
var a = {x:char1.x, y:char1.y};
|
||||
var b = {x:char2.x, y:char2.y};
|
||||
|
||||
// If in front
|
||||
switch (char2._direction) {
|
||||
case 2:
|
||||
if (b.y > a.y) return false;
|
||||
break;
|
||||
case 4:
|
||||
if (b.x < a.x) return false;
|
||||
break;
|
||||
case 6:
|
||||
if (b.x > a.x) return false;
|
||||
break;
|
||||
case 8:
|
||||
if (b.y < a.y) return false;
|
||||
break;
|
||||
default:
|
||||
|
||||
};
|
||||
|
||||
// Direct Line
|
||||
if (Math.abs(a.x - b.x) >= Math.abs(a.y - b.y)) {
|
||||
// h slope
|
||||
if (a.x == b.x) {
|
||||
var slope = null;
|
||||
var int = a.x;
|
||||
} else {
|
||||
var slope = (a.y - b.y) / (a.x - b.x);
|
||||
var int = a.y - slope * a.x;
|
||||
};
|
||||
|
||||
for (var x = a.x; x <= b.x; x++) {
|
||||
var y = slope * x + int;
|
||||
if (Galv.DETECT.isBlock(x,y)) return false;
|
||||
}
|
||||
|
||||
for (var x = a.x; x >= b.x; x--) {
|
||||
var y = slope * x + int;
|
||||
if (Galv.DETECT.isBlock(x,y)) return false;
|
||||
}
|
||||
} else if (Math.abs(a.y - b.y) >= Math.abs(a.x - b.x)) {
|
||||
// v slope
|
||||
if (a.y == b.y) {
|
||||
var slope = null;
|
||||
var int = a.y;
|
||||
} else {
|
||||
var slope = (a.x - b.x) / (a.y - b.y);
|
||||
var int = a.x - slope * a.y;
|
||||
};
|
||||
|
||||
for (var y = a.y; y <= b.y; y++) {
|
||||
var x = slope * y + int;
|
||||
if (Galv.DETECT.isBlock(x,y)) return false;
|
||||
}
|
||||
|
||||
for (var y = a.y; y >= b.y; y--) {
|
||||
var x = slope * y + int;
|
||||
if (Galv.DETECT.isBlock(x,y)) return false;
|
||||
}
|
||||
};
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Game_Character.prototype.searchLimit = function() {
|
||||
return Galv.DETECT.searches;
|
||||
};
|
||||
|
||||
|
||||
// GAME CHARACTER
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Galv.DETECT.Game_Character_initMembers = Game_Character.prototype.initMembers;
|
||||
Game_Character.prototype.initMembers = function() {
|
||||
this.setDetectVars();
|
||||
Galv.DETECT.Game_Character_initMembers.call(this);
|
||||
};
|
||||
|
||||
Game_Character.prototype.distDetect = function(range,los,id,balloon) {
|
||||
var balloon = balloon || 0;
|
||||
var id = id || 0;
|
||||
var range = range * Galv.DETECT.tile;
|
||||
var target = id > 0 ? $gameMap.event(id) : $gamePlayer;
|
||||
var x1 = this.screenX();
|
||||
var y1 = this.screenY();
|
||||
var x2 = target.screenX();
|
||||
var y2 = target.screenY();
|
||||
|
||||
var dist = Galv.DETECT.dist(x1,y1,x2,y2);
|
||||
|
||||
if (dist <= range) { // If in radius range of target
|
||||
if ((los && Galv.DETECT.los(target,this)) || !los) { // If LOS to target is not blocked
|
||||
this._dTarget = {x:target.x,y:target.y}; // Set target x,y each step when detected so if los is broken, event still moves to last seen x,y
|
||||
this.doDetected(id);
|
||||
return true;
|
||||
};
|
||||
};
|
||||
this.doUndetected(id);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Game_Character.prototype.isDetecting = function(id) {
|
||||
return id ? this._detecting.contains(id) : this._detecting.length > 0;
|
||||
};
|
||||
|
||||
Game_Character.prototype.doDetected = function(id) {
|
||||
if (!this._detecting.contains(id)) {
|
||||
this._detecting.push(id);
|
||||
if (!this._searchXY[0]) this._balloonId = this._detectBalloon;
|
||||
};
|
||||
};
|
||||
|
||||
Game_Character.prototype.doUndetected = function(id) {
|
||||
var index = this._detecting.indexOf(id);
|
||||
if (index > -1) this._detecting.splice(index,1);
|
||||
};
|
||||
|
||||
Game_Character.prototype.detector = function(id) {
|
||||
if ($gameSystem._undetectable) return;
|
||||
this._detectBalloon = Galv.DETECT.behaviors[id][6];
|
||||
var detected = this.distDetect(Galv.DETECT.behaviors[id][2],Galv.DETECT.behaviors[id][3]);
|
||||
|
||||
if (detected) {
|
||||
this.doDetectMove(id,1); // do detected movement
|
||||
} else {
|
||||
if (this._searchXY[0]) {
|
||||
// do move toward last x,y position detected at
|
||||
this.moveTowardLastDetect();
|
||||
} else {
|
||||
this.doDetectMove(id,0); // do original movement
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Game_Character.prototype.doDetectMove = function(id,type) {
|
||||
//type 1 = detect move
|
||||
//type 0 = after detect move
|
||||
if (type == 0) {
|
||||
this._moveSpeed = this._origMovement._moveSpeed;
|
||||
this._moveFrequency = this._origMovement._moveFrequency;
|
||||
|
||||
} else {
|
||||
this._moveSpeed = Galv.DETECT.behaviors[id][4];
|
||||
this._moveFrequency = Galv.DETECT.behaviors[id][5];
|
||||
};
|
||||
|
||||
|
||||
switch (Galv.DETECT.behaviors[id][type]) {
|
||||
case 'approach':
|
||||
this.moveTowardPlayer();
|
||||
break;
|
||||
case 'flee':
|
||||
this.moveAwayFromPlayer();
|
||||
break;
|
||||
case 'search':
|
||||
if (this._detectPause <= 0) {
|
||||
this._moveFrequency = 5;
|
||||
this._searchXY = [$gamePlayer.x,$gamePlayer.y]; // get last detected x,y coords
|
||||
this.moveTowardLastDetect();
|
||||
this._detectPause = 30 * (5 - this._origMovement._moveFrequency) + 3;
|
||||
};
|
||||
this._detectPause -= 1;
|
||||
break;
|
||||
case 'rand':
|
||||
|
||||
if (this._detectPause <= 0) {
|
||||
this._moveFrequency = 5;
|
||||
this.moveRandom();
|
||||
this._detectPause = 30 * (5 - this._origMovement._moveFrequency) + 1;
|
||||
};
|
||||
this._detectPause -= 1;
|
||||
break;
|
||||
case 'return':
|
||||
this._moveFrequency = 5;
|
||||
this.returnToSavedXY(); // move to original position
|
||||
case 'freeze':
|
||||
default:
|
||||
this.resetStopCount();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.returnToSavedXY = function() {
|
||||
if (this.x != this._origMovement.x || this.y != this._origMovement.y) {
|
||||
direction = this.findDirectionTo(this._origMovement.x,this._origMovement.y);
|
||||
if (direction > 0) {
|
||||
this.moveStraight(direction);
|
||||
}
|
||||
} else {
|
||||
this._direction = this._origMovement._direction;
|
||||
this.resetStopCount();
|
||||
};
|
||||
};
|
||||
|
||||
Game_Character.prototype.setDetectVars = function() {
|
||||
this._detecting = [];
|
||||
this._searchXY = [];
|
||||
this._detectPause = 0;
|
||||
this._detectPauseTime = 40;
|
||||
this._origMovement = {'_moveFrequency':this._moveFrequency,'_moveSpeed':this._moveSpeed,'x':0,'y':0};
|
||||
this.searchActions = [
|
||||
'turnRight90',
|
||||
'turnLeft90',
|
||||
'turnLeft90',
|
||||
'turnRight90',
|
||||
];
|
||||
this.searchActions.reverse();
|
||||
};
|
||||
|
||||
Game_Character.prototype.moveTowardLastDetect = function() {
|
||||
if (!this._searchXY[0]) {
|
||||
this._searchXY = [];
|
||||
this.resetStopCount();
|
||||
} else if (this._searchXY[0] == this.x && this._searchXY[1] == this.y) {
|
||||
if (this._searchTurnIndex > -1) {
|
||||
this[this.searchActions[this._searchTurnIndex]](); // run corresponding action
|
||||
// set searchXY to destination in case search actions move it
|
||||
this._searchXY[0] = this.x;
|
||||
this._searchXY[1] = this.y;
|
||||
this._searchTurnIndex -= 1;
|
||||
this._waitCount = 20;
|
||||
} else {
|
||||
this._searchXY = [];
|
||||
this.resetStopCount();
|
||||
}
|
||||
} else {
|
||||
this._searchTurnIndex = this.searchActions.length - 1;
|
||||
var direction = this.findDirectionTo(this._searchXY[0],this._searchXY[1]);
|
||||
if (direction > 0) {
|
||||
this.moveStraight(direction);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// GAME EVENT
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Galv.DETECT.Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
|
||||
Game_Event.prototype.setupPageSettings = function() {
|
||||
Galv.DETECT.Game_Event_setupPageSettings.call(this);
|
||||
this.setDetectStuff();
|
||||
};
|
||||
|
||||
Game_Event.prototype.setDetectStuff = function() {
|
||||
this._detectBalloon = 0;
|
||||
var page = this.page();
|
||||
this._blockLos = false;
|
||||
if (page) {
|
||||
for (var i = 0; i < page.list.length; i++) {
|
||||
if (page.list[i].code == 108 && page.list[i].parameters[0].contains("<block_los>")) {
|
||||
this._blockLos = true;
|
||||
break;
|
||||
};
|
||||
};
|
||||
this._origMovement._moveSpeed = page.moveSpeed;
|
||||
this._origMovement._moveFrequency = page.moveFrequency;
|
||||
this._origMovement._direction = this._direction;
|
||||
this._origMovement.x = this.x;
|
||||
this._origMovement.y = this.y;
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
||||
271
www/js/plugins/GALV_MoveRouteExtras.js
Normal file
271
www/js/plugins/GALV_MoveRouteExtras.js
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Galv's Move Route Extras
|
||||
//-----------------------------------------------------------------------------
|
||||
// For: RPGMAKER MV
|
||||
// GALV_MoveRouteExtras.js
|
||||
//-----------------------------------------------------------------------------
|
||||
// 2015-11-05 - Version 1.1 - added ability to change graphic to a frame
|
||||
// 2015-10-23 - Version 1.0 - release
|
||||
//-----------------------------------------------------------------------------
|
||||
// Terms can be found at:
|
||||
// galvs-scripts.com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Galv_MoveRouteExtras = true;
|
||||
|
||||
var Galv = Galv || {}; // Galv's main object
|
||||
Galv.MRE = Galv.MRE || {}; // Galv's Move Route Extra's stuff
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*:
|
||||
* @plugindesc Additional SCRIPT commands to use within MOVE ROUTES
|
||||
* View the plugin "Help" to view available commands.
|
||||
* @author Galv - galvs-scripts.com
|
||||
|
||||
* @help
|
||||
* Galv's Move Route Extras
|
||||
* ----------------------------------------------------------------------------
|
||||
* This script enables users to use commands in the 'script' function of
|
||||
* MOVE ROUTES. The available commands are listed below.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* SCRIPT calls for MOVE ROUTES
|
||||
* ----------------------------------------------------------------------------
|
||||
* this.jump_forward(x); // Jump forward x tiles
|
||||
* this.jump_to(x,y); // Jump to x,y co-ordinates on the map
|
||||
* this.jump_to(i); // Jump to character's x,y location
|
||||
* // i = event id. Make it 0 for player
|
||||
* this.step_toward(x,y); // Step toward x,y co-ordinates on the map
|
||||
* this.step_toward(i); // Step toward a character's x,y location
|
||||
* // i = event id. 0 works for player, too
|
||||
* this.step_away(x,y); // Step away from x,y co-ordinates on the map
|
||||
* this.step_away(i); // Step away from a character's x,y location
|
||||
* // i = event id. 0 works for player, too
|
||||
* this.turn_toward(x,y); // Face toward x,y co-ordinates on the map
|
||||
* this.turn_toward(i); // Face toward a character's x,y location
|
||||
* // i = event id. 0 works for player, too
|
||||
* this.turn_away(x,y); // Turn away from x,y map co-ordinates
|
||||
* this.turn_away(i); // Turn away from a character's x,y location
|
||||
* // i = event id. 0 works for player, too
|
||||
* this.sswitch("n",status); // Change self switch "n" to status true/false
|
||||
* this.rwait(low,high); // wait a random time between low and high
|
||||
*
|
||||
* this.fade(s); // s is the fade speed.
|
||||
* // Positive fades in, Negative fades out.
|
||||
* this.step_rand(id,id,id); // Move randomly only on specified region id's
|
||||
* // Multiple id's can be used, comma separated
|
||||
* this.repeat_begin(n); // Repeat the next move commands between this..
|
||||
* this.repeat_end(); // and repeat_end n number of times
|
||||
*
|
||||
* this.set_frame("name",index,pattern,direction) // set graphic to a frame
|
||||
*
|
||||
* // "name" - is the characterset file name
|
||||
* // index - the number of the character in the characterset (1-8)
|
||||
* // pattern - the stepping frame (1-3)
|
||||
* // direction - the direction the event is facing (2,4,6,8)
|
||||
* // Once a character has been set to a frame, it wont change when moving
|
||||
* // until you restore the character using the below move route script:
|
||||
*
|
||||
* this.restore_frame() // unlocks the frame chosen in set_frame
|
||||
*
|
||||
*
|
||||
* // Below are a couple of useful codes that work without this script
|
||||
* this.requestBalloon(n); // Displays the balloon that has id of n
|
||||
* this.requestAnimation(n); // Displays animation that has id of n
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* EXAMPLES OF USE
|
||||
* ----------------------------------------------------------------------------
|
||||
* this.jump_forward(3); // Jumps 3 tiles the direction character faces
|
||||
* this.jump_to(5); // Jump to event 5's position
|
||||
* this.jump_to(10,16); // Jump to x10, y15
|
||||
* this.step_toward(3); // Takes a step toward event 3's position
|
||||
* this.step_away(12,8); // Takes a step away from x12, y8 co-ordinates
|
||||
* this.sswitch("A",true); // Turns self switch "A" ON for event
|
||||
* this.sswitch("B",false); // Turns self switch "B" OFF for event
|
||||
* this.rwait(60,120); // Waits randomly between 60 and 120 frames
|
||||
* this.fade(-10); // Fades out character
|
||||
* this.step_rand(1,4,7); // Take a step randomly, only on regions 1,4,7
|
||||
* this.requestAnimation(2); // Shows animation 2 on character
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CODE STUFFS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
(function() {
|
||||
Game_Character.prototype.repeat_times = 0;
|
||||
Game_Character.prototype.repeat_start_index = 0;
|
||||
|
||||
|
||||
// REPEATING COMMANDS
|
||||
Game_Character.prototype.repeat_begin = function(times) {
|
||||
this.repeats = times - 1;
|
||||
this.repeat_start_index = this._moveRouteIndex;
|
||||
};
|
||||
|
||||
Game_Character.prototype.repeat_end = function() {
|
||||
if (this.repeats > 0) {
|
||||
this._moveRouteIndex = this.repeat_start_index;
|
||||
this.repeats -= 1;
|
||||
};
|
||||
};
|
||||
|
||||
// FADING
|
||||
Game_Character.prototype.fade = function(speed) {
|
||||
// Change opacity
|
||||
this.setOpacity(this.opacity() + speed);
|
||||
// Repeat until finished
|
||||
if (speed > 0 && this.opacity() < 255) {
|
||||
this._moveRouteIndex -= 1;
|
||||
} else if (speed < 0 && this.opacity() > 0) {
|
||||
this._moveRouteIndex -= 1;
|
||||
};
|
||||
};
|
||||
|
||||
// JUMP FORWARD
|
||||
Game_Character.prototype.jump_forward = function(count) {
|
||||
var sx = 0, sy = 0;
|
||||
|
||||
switch (this.direction()) {
|
||||
case 2:
|
||||
sy = count;
|
||||
break;
|
||||
case 4:
|
||||
sx = -count;
|
||||
break;
|
||||
case 6:
|
||||
sx = count;
|
||||
break;
|
||||
case 8:
|
||||
sy = -count;
|
||||
break;
|
||||
};
|
||||
this.jump(sx,sy);
|
||||
};
|
||||
|
||||
// JUMP TO
|
||||
Game_Character.prototype.jump_to = function() {
|
||||
var sx = 0, sy = 0;
|
||||
|
||||
if (arguments.length > 1) {
|
||||
// x,y coords
|
||||
sx = this.x - arguments[0];
|
||||
sy = this.y - arguments[1];
|
||||
} else if (arguments.length === 1) {
|
||||
// Character ID
|
||||
if (arguments[0] === 0) {
|
||||
// Is player
|
||||
sx = this.x - $gamePlayer.x;
|
||||
sy = this.y - $gamePlayer.y;
|
||||
} else {
|
||||
// Is event
|
||||
sx = this.x - $gameMap._events[arguments[0]].x;
|
||||
sy = this.y - $gameMap._events[arguments[0]].y;
|
||||
};
|
||||
};
|
||||
this.jump(-sx,-sy);
|
||||
};
|
||||
|
||||
// STEP TOWARD
|
||||
Game_Character.prototype.step_toward = function() {
|
||||
var char = Galv.MRE.getMrChar(arguments);
|
||||
if (char) this.moveTowardCharacter(char);
|
||||
};
|
||||
|
||||
// STEP AWAY
|
||||
Game_Character.prototype.step_away = function() {
|
||||
var char = Galv.MRE.getMrChar(arguments);
|
||||
if (char) this.moveAwayFromCharacter(char);
|
||||
};
|
||||
|
||||
// TURN TOWARD
|
||||
Game_Character.prototype.turn_toward = function() {
|
||||
var char = Galv.MRE.getMrChar(arguments);
|
||||
if (char) this.turnTowardCharacter(char);
|
||||
};
|
||||
|
||||
Game_Character.prototype.turn_away = function() {
|
||||
var char = Galv.MRE.getMrChar(arguments);
|
||||
if (char) this.turnAwayFromCharacter(char);
|
||||
};
|
||||
|
||||
|
||||
// GET MR CHARACTER
|
||||
Galv.MRE.getMrChar = function(arguments) {
|
||||
var char = null;
|
||||
if (arguments.length > 1) {
|
||||
// Move toward x,y
|
||||
char = { x : arguments[0], y : arguments[1] };
|
||||
} else if (arguments.length === 1) {
|
||||
if (arguments[0] === 0) {
|
||||
// Is player
|
||||
char = $gamePlayer;
|
||||
} else {
|
||||
// Is event
|
||||
char = $gameMap._events[arguments[0]];
|
||||
};
|
||||
};
|
||||
return char;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// SELF SWITCHES
|
||||
Game_Character.prototype.sswitch = function(letter,status,eid,mapid) {
|
||||
var key = [mapid || $gameMap.mapId(), eid || this.eventId(), letter];
|
||||
$gameSelfSwitches.setValue(key, status);
|
||||
};
|
||||
|
||||
// RANDOM WAIT
|
||||
Game_Character.prototype.rwait = function(low,high) {
|
||||
this._waitCount = Math.randomInt(high - low) + low;
|
||||
};
|
||||
|
||||
// MOVE RANDOM ON REGION
|
||||
Game_Character.prototype.step_rand = function() {
|
||||
var d = 2 + Math.randomInt(4) * 2;
|
||||
|
||||
// If region is not there, return false.
|
||||
var x2 = $gameMap.roundXWithDirection(this.x, d);
|
||||
var y2 = $gameMap.roundYWithDirection(this.y, d);
|
||||
var region_test = false;
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if (arguments[i] === $gameMap.regionId(x2, y2)) {
|
||||
region_test = true;
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
if (!region_test) return false;
|
||||
if (!$gameMap.isValid(x2, y2)) return false;
|
||||
if (this.canPass(this.x, this.y, d)) {
|
||||
this.moveStraight(d);
|
||||
};
|
||||
};
|
||||
|
||||
// SET TO CHARACTER FRAME
|
||||
Game_Character.prototype.set_frame = function(name,index,pattern,direction) {
|
||||
this.gstop = true;
|
||||
this._direction = direction;
|
||||
this._pattern = pattern - 1;
|
||||
this._characterName = name !== "" ? name : this._characterName;
|
||||
this._characterIndex = index - 1;
|
||||
};
|
||||
|
||||
// RESTORE CHAR ANIMATION
|
||||
Game_Character.prototype.restore_frame = function() {
|
||||
this.gstop = false;
|
||||
};
|
||||
|
||||
// MOD
|
||||
var Galv_Game_CharacterBase_updatePattern = Game_CharacterBase.prototype.updatePattern;
|
||||
Game_CharacterBase.prototype.updatePattern = function() {
|
||||
if (this.gstop) return;
|
||||
Galv_Game_CharacterBase_updatePattern.call(this);
|
||||
};
|
||||
|
||||
})();
|
||||
193
www/js/plugins/GTP_CoreUpdates.js
Normal file
193
www/js/plugins/GTP_CoreUpdates.js
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
//=============================================================================
|
||||
// Gamefall Team Plugins - Optimization for Omori taking in account
|
||||
// YEP_Core Updates;
|
||||
// GTP_CoreUpdates.js VERSION 1.0.1
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.GTP_CoreUpdates = true;
|
||||
|
||||
var Gamefall = Gamefall || {};
|
||||
Gamefall.CoreUpdates = Gamefall.CoreUpdates || {};
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0.1 Optimization for Omori taking in account YEP Core Updates
|
||||
* @author Gamefall Team || Luca Mastroianni
|
||||
* @help
|
||||
* CHANGELOG:
|
||||
* VERSION 1.0.0: Plugin Released!
|
||||
* VERSION 1.0.1: Reduced lag filtering events;
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
(function ($) {
|
||||
|
||||
// Replaced ForEach
|
||||
Sprite.prototype.update = function () {
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (!child) { continue; }
|
||||
if (child && child.update) child.update();
|
||||
};
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
Tilemap.prototype.update = function () {
|
||||
this.animationCount++;
|
||||
this.animationFrame = Math.floor(this.animationCount / 30);
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (!child) { continue; }
|
||||
if (child && child.update) child.update();
|
||||
}
|
||||
var length = this.bitmaps.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
if (this.bitmaps[i]) this.bitmaps[i].touch();
|
||||
}
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
TilingSprite.prototype.update = function () {
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (child && child.update) child.update();
|
||||
}
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
Window.prototype.update = function () {
|
||||
if (this.active) this._animationCount++;
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (child && child.update) child.update();
|
||||
}
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
WindowLayer.prototype.update = function () {
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (child && child.update) child.update();
|
||||
}
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
Weather.prototype._updateAllSprites = function () {
|
||||
var maxSprites = Math.floor(this.power * 10);
|
||||
while (this._sprites.length < maxSprites) {
|
||||
this._addSprite();
|
||||
}
|
||||
while (this._sprites.length > maxSprites) {
|
||||
this._removeSprite();
|
||||
}
|
||||
var length = this._sprites.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var sprite = this._sprites[i];
|
||||
this._updateSprite(sprite);
|
||||
sprite.x = sprite.ax - this.origin.x;
|
||||
sprite.y = sprite.ay - this.origin.y;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.setup = function (list, eventId) {
|
||||
this.clear();
|
||||
this._mapId = $gameMap.mapId();
|
||||
this._eventId = eventId || 0;
|
||||
this._list = list;
|
||||
};
|
||||
|
||||
// Change Tileset Event: load instead of reserve
|
||||
Game_Interpreter.prototype.command282 = function () {
|
||||
var tileset = $dataTilesets[this._params[0]];
|
||||
for (var i = 0; i < tileset.tilesetNames.length; i++) {
|
||||
ImageManager.loadTileset(tileset.tilesetNames[i]);
|
||||
}
|
||||
if (ImageManager.isReady()) {
|
||||
$gameMap.changeTileset(this._params[0]);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Ready preparation now refers to fully loaded instead of reservation
|
||||
Sprite_Animation.prototype.isReady = function () {
|
||||
return ImageManager.isReady();
|
||||
};
|
||||
|
||||
// Replaced ForEach
|
||||
Sprite_Animation.prototype.updateFrame = function () {
|
||||
if (this._duration > 0) {
|
||||
var frameIndex = this.currentFrameIndex();
|
||||
this.updateAllCellSprites(this._animation.frames[frameIndex]);
|
||||
var length = this._animation.timings.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var timing = this._animation.timings[i];
|
||||
if (timing.frame === frameIndex) this.processTimingData(timing);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Cleaning algorithm up
|
||||
Sprite_Animation.prototype.updateCellSprite = function (sprite, cell) {
|
||||
var pattern = cell[0];
|
||||
if (pattern >= 0) {
|
||||
var sx = pattern % 5 * 192;
|
||||
var sy = Math.floor(pattern % 100 / 5) * 192;
|
||||
var mirror = this._mirror;
|
||||
sprite.bitmap = pattern < 100 ? this._bitmap1 : this._bitmap2;
|
||||
sprite.setFrame(sx, sy, 192, 192);
|
||||
sprite.x = cell[1];
|
||||
sprite.y = cell[2];
|
||||
if (this._mirror) {
|
||||
sprite.x *= -1;
|
||||
}
|
||||
sprite.rotation = cell[4] * Math.PI / 180;
|
||||
sprite.scale.x = cell[3] / 100;
|
||||
if ((cell[5] && !mirror) || (!cell[5] && mirror)) {
|
||||
sprite.scale.x *= -1;
|
||||
}
|
||||
sprite.scale.y = cell[3] / 100;
|
||||
sprite.opacity = cell[6];
|
||||
sprite.blendMode = cell[7];
|
||||
sprite.visible = true;
|
||||
} else {
|
||||
sprite.visible = false;
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Base.prototype.updateChildren = function () {
|
||||
var length = this.children.length;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
var child = this.children[i];
|
||||
if (!child) { continue; }
|
||||
if (child.update) child.update();
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Boot.prototype.isGameFontLoaded = function () {
|
||||
if (Graphics.isFontLoaded('GameFont')) {
|
||||
return true;
|
||||
} else {
|
||||
var elapsed = Date.now() - this._startDate;
|
||||
if (elapsed >= 60000) {
|
||||
throw new Error('Failed to load GameFont');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Game_Map.prototype.eventsXy = function (x, y) {
|
||||
return this._events.filter(event => { return !!event && event.pos(x, y) })
|
||||
}
|
||||
|
||||
Game_Map.prototype.eventsXyNt = function (x, y) {
|
||||
return this._events.filter(event => { return !!event && event.posNt(x, y) })
|
||||
}
|
||||
})(Gamefall.CoreUpdates);
|
||||
3412
www/js/plugins/GTP_OmoriFixes.js
Normal file
3412
www/js/plugins/GTP_OmoriFixes.js
Normal file
File diff suppressed because it is too large
Load diff
578
www/js/plugins/Gacha.js
Normal file
578
www/js/plugins/Gacha.js
Normal file
|
|
@ -0,0 +1,578 @@
|
|||
//=============================================================================
|
||||
// Gacha.js
|
||||
//
|
||||
// (c)2016 KADOKAWA CORPORATION./YOJI OJIMA
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Get the item at random
|
||||
* @author Takeya Kimura
|
||||
*
|
||||
* @param Help Message Text
|
||||
* @desc The help message for gacha window. "Required Amount" is replaced with the Required Amount.
|
||||
* @default 1回Required Amount\Gでガチャを引きます
|
||||
*
|
||||
* @param Button Text
|
||||
* @desc The button text for gacha commands.
|
||||
* @default ガチャを引く
|
||||
*
|
||||
* @param Get Message Text
|
||||
* @desc The message of After receiving. "Item Name" is replaced with the received item name.
|
||||
* @default GET Item Name
|
||||
*
|
||||
* @param Show Item Description
|
||||
* @desc The switch of item description display
|
||||
* @default 0
|
||||
*
|
||||
* @param Effect
|
||||
* @desc The animation number for get effect.
|
||||
* @default 119
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank1 Effect
|
||||
* @desc The animation number for rank 1 effect. If you specify -1, does not display the animation.
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank2 Effect
|
||||
* @desc The animation number for rank 2 effect. If you specify -1, does not display the animation.
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank3 Effect
|
||||
* @desc The animation number for rank 3 effect. If you specify -1, does not display the animation.
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank4 Effect
|
||||
* @desc The animation number for rank 4 effect. If you specify -1, does not display the animation.
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank5 Effect
|
||||
* @desc The animation number for rank 5 effect. If you specify -1, does not display the animation.
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param ME
|
||||
* @desc The ME name for get music effect.
|
||||
* @default Organ
|
||||
* @require 1
|
||||
* @dir audio/me/
|
||||
* @type file
|
||||
*
|
||||
* @param Required Amount
|
||||
* @desc The Gold for gacha.
|
||||
* @default 100
|
||||
*
|
||||
* @noteParam gachaImage
|
||||
* @noteRequire 1
|
||||
* @noteDir img/gacha/
|
||||
* @noteType file
|
||||
* @noteData items
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Plugin Command:
|
||||
* Gacha open # Open the Gacha screen
|
||||
* Gacha add item 1 # Add item #1 to the Gacha
|
||||
* Gacha remove item 1 # Remove item #1 from the Gacha
|
||||
* Gacha clear # Clear the Gacha
|
||||
*
|
||||
*
|
||||
* Item Note:
|
||||
* <gachaImage:image> # Gacha image file name. Please image put in "img/gacha/" folder.
|
||||
* <gachaNumLot:10> # The number of the lottery.
|
||||
* <gachaRank:5> # The rank of the item(1-5).
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc ランダムにアイテムを取得します。
|
||||
* @author Takeya Kimura
|
||||
*
|
||||
* @param Help Message Text
|
||||
* @desc ガチャ画面のヘルプメッセージです。「Required Amount」は消費Gと置換されます。
|
||||
* @default 1回Required Amount\Gでガチャを引きます
|
||||
*
|
||||
* @param Button Text
|
||||
* @desc ガチャボタンに表示するテキストです。
|
||||
* @default ガチャを引く
|
||||
*
|
||||
* @param Get Message Text
|
||||
* @desc ガチャを引いた後のメッセージです。「Item Name」は取得アイテム名と置換されます。
|
||||
* @default GET Item Name
|
||||
*
|
||||
* @param Show Item Description
|
||||
* @desc 1でアイテム取得時に説明を表示します。[0: 説明非表示 1: 説明表示]
|
||||
* @default 0
|
||||
*
|
||||
* @param Effect
|
||||
* @desc アイテム取得時のアニメーションIDを指定します。
|
||||
* @default 119
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank1 Effect
|
||||
* @desc ランク1の時のアニメーションIDを指定します。-1を指定するとアニメーションを表示しません。
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank2 Effect
|
||||
* @desc ランク2の時のアニメーションIDを指定します。-1を指定するとアニメーションを表示しません。
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank3 Effect
|
||||
* @desc ランク3の時のアニメーションIDを指定します。-1を指定するとアニメーションを表示しません。
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank4 Effect
|
||||
* @desc ランク4の時のアニメーションIDを指定します。-1を指定するとアニメーションを表示しません。
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param Rank5 Effect
|
||||
* @desc ランク5の時のアニメーションIDを指定します。-1を指定するとアニメーションを表示しません。
|
||||
* @default -1
|
||||
* @require 1
|
||||
* @type animation
|
||||
*
|
||||
* @param ME
|
||||
* @desc アイテム取得時のMEを指定します。
|
||||
* @default Organ
|
||||
* @require 1
|
||||
* @dir audio/me/
|
||||
* @type file
|
||||
*
|
||||
* @param Required Amount
|
||||
* @desc ガチャを引くのに必要なGです。
|
||||
* @default 100
|
||||
*
|
||||
* @noteParam gachaImage
|
||||
* @noteRequire 1
|
||||
* @noteDir img/gacha/
|
||||
* @noteType file
|
||||
* @noteData items
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Plugin Command:
|
||||
* Gacha open # ガチャ画面を開きます。
|
||||
* Gacha add item 1 # アイテム番号1をガチャ対象に追加します。
|
||||
* Gacha remove item 1 # アイテム番号1をガチャ対象から外します。
|
||||
* Gacha clear # 全てのガチャ対象をクリアします。
|
||||
*
|
||||
*
|
||||
* Item Note:
|
||||
* <gachaImage:image> # ガチャアイテムの画像を指定します。画像はimg/gacha/フォルダ内に入れてください。
|
||||
* <gachaNumLot:10> # ガチャアイテムのくじ数を指定します。
|
||||
* <gachaRank:5> # ガチャアイテムのランクを1から5の間で指定します。
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
var parameters = PluginManager.parameters('Gacha');
|
||||
var message;
|
||||
var itemDescEnable = !!Number(parameters['Show Item Description'] || 0);
|
||||
var rankEffect = [];
|
||||
rankEffect.push(Number(parameters['Rank1 Effect'] || '-1'));
|
||||
rankEffect.push(Number(parameters['Rank2 Effect'] || '-1'));
|
||||
rankEffect.push(Number(parameters['Rank3 Effect'] || '-1'));
|
||||
rankEffect.push(Number(parameters['Rank4 Effect'] || '-1'));
|
||||
rankEffect.push(Number(parameters['Rank5 Effect'] || '-1'));
|
||||
var me = String(parameters['ME'] || 'Organ');
|
||||
var amount = Number(parameters['Required Amount'] || '100');
|
||||
var reg = /Required Amount/gi;
|
||||
|
||||
|
||||
Scene_Boot = class extends Scene_Boot {
|
||||
|
||||
start() {
|
||||
super.start();
|
||||
message = LanguageManager.getMessageData("gacha_minigame.message_0").text;
|
||||
message = message.replace(reg, String(amount));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
if (command === "Gacha") {
|
||||
switch (args[0]) {
|
||||
case "open":
|
||||
SceneManager.push(Scene_Gacha);
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$gameSystem.addToGacha(args[1], Number(args[2]));
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$gameSystem.removeFromGacha(args[1], Number(args[2]));
|
||||
break;
|
||||
|
||||
case 'clear':
|
||||
$gameSystem.clearGacha();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
// YIN
|
||||
Game_Interpreter.prototype.initGacha = function() {
|
||||
ImageManager.loadAtlas("gacha_prizes");
|
||||
// INIT GACHA
|
||||
this._gachaItem = null;
|
||||
this._gachaLot = [];
|
||||
|
||||
this._rankSprite = new Sprite_GachaEffect();
|
||||
this._rankSprite.keepDisplay(true);
|
||||
SceneManager._scene.addChild(this._rankSprite);
|
||||
|
||||
var wy = 120;
|
||||
var wh = 320;
|
||||
this._getWindow = new Window_GachaGet(0, wy, 280, wh);
|
||||
this._getWindow.itemDescEnable(itemDescEnable);
|
||||
this._getWindow.hide();
|
||||
SceneManager._scene.addWindow(this._getWindow);
|
||||
|
||||
var numLot;
|
||||
var item, i, j;
|
||||
for (i = 1; i < $dataItems.length; i++) {
|
||||
item = $dataItems[i];
|
||||
if ($gameSystem.isInGacha(item)) {
|
||||
numLot = Number(item.meta.gachaNumLot || '0');
|
||||
for (j = 0; j < numLot; j++) {
|
||||
this._gachaLot.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 1; i < $dataWeapons.length; i++) {
|
||||
item = $dataWeapons[i];
|
||||
if ($gameSystem.isInGacha(item)) {
|
||||
numLot = Number(item.meta.gachaNumLot || '0');
|
||||
for (j = 0; j < numLot; j++) {
|
||||
this._gachaLot.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 1; i < $dataArmors.length; i++) {
|
||||
item = $dataArmors[i];
|
||||
if ($gameSystem.isInGacha(item)) {
|
||||
numLot = Number(item.meta.gachaNumLot || '0');
|
||||
for (j = 0; j < numLot; j++) {
|
||||
this._gachaLot.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._gachaItem = this._gachaLot[(Math.random() * this._gachaLot.length) >> 0];
|
||||
this._getWindow.setItem(this._gachaItem);
|
||||
$gameParty.gainItem(this._gachaItem, 1);
|
||||
}
|
||||
|
||||
// YIN
|
||||
Game_Interpreter.prototype.displayGachaItem = function(item) {
|
||||
this._getWindow._gachaSprite.opacity = 0;
|
||||
this._moveGet = true;
|
||||
this._getWindow.x = (Graphics.boxWidth - this._getWindow.width) / 2;
|
||||
this._getWindow.y = 120;
|
||||
this._getWindow.show();
|
||||
}
|
||||
|
||||
// YIN
|
||||
Game_Interpreter.prototype.removeGachaWindow = function() {
|
||||
this._gachaClosing = true;
|
||||
}
|
||||
|
||||
var yin_Interpreter_Update = Game_Interpreter.prototype.update;
|
||||
Game_Interpreter.prototype.update = function () {
|
||||
yin_Interpreter_Update.call(this);
|
||||
if (this._gachaClosing) {
|
||||
this._getWindow._gachaSprite.opacity -= 20;
|
||||
this._rankSprite.opacity -= 28;
|
||||
if (this._getWindow._gachaSprite.opacity <= 0) {
|
||||
this._getWindow.close();
|
||||
this._gachaItem = null;
|
||||
this._gachaLot = [];
|
||||
this._rankSprite.allRemove();
|
||||
SceneManager._scene.removeChild(this._rankSprite);
|
||||
SceneManager._scene.removeChild(this._getWindow);
|
||||
|
||||
this._getWindow = null;
|
||||
this._rankSprite = null;
|
||||
this._moveGet = null;
|
||||
this._gachaClosing = null;
|
||||
}
|
||||
}
|
||||
if (this._getWindow && this._getWindow._gachaSprite.opacity < 255 && this._moveGet) {
|
||||
this._getWindow._gachaSprite.opacity += 4;
|
||||
this._getWindow.y -= 5;
|
||||
if (this._getWindow.y <= 32) {
|
||||
this._getWindow.y = 32;
|
||||
}
|
||||
if (this._getWindow._gachaSprite.opacity >= 255) {
|
||||
this._getWindow._gachaSprite.opacity = 255;
|
||||
}
|
||||
if (this._getWindow._gachaSprite.opacity === 255 && this._getWindow.y === 32) {
|
||||
this._moveGet = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Game_System.prototype.addToGacha = function(type, dataId) {
|
||||
if (!this._GachaFlags) {
|
||||
this.clearGacha();
|
||||
}
|
||||
var typeIndex = this.gachaTypeToIndex(type);
|
||||
if (typeIndex >= 0) {
|
||||
this._GachaFlags[typeIndex][dataId] = true;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.removeFromGacha = function(type, dataId) {
|
||||
if (this._GachaFlags) {
|
||||
var typeIndex = this.gachaTypeToIndex(type);
|
||||
if (typeIndex >= 0) {
|
||||
this._GachaFlags[typeIndex][dataId] = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.gachaTypeToIndex = function(type) {
|
||||
switch (type) {
|
||||
case 'item':
|
||||
return 0;
|
||||
case 'weapon':
|
||||
return 1;
|
||||
case 'armor':
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.clearGacha = function() {
|
||||
this._GachaFlags = [[], [], []];
|
||||
};
|
||||
|
||||
Game_System.prototype.isInGacha = function(item) {
|
||||
if (this._GachaFlags && item) {
|
||||
var typeIndex = -1;
|
||||
if (DataManager.isItem(item)) {
|
||||
typeIndex = 0;
|
||||
} else if (DataManager.isWeapon(item)) {
|
||||
typeIndex = 1;
|
||||
} else if (DataManager.isArmor(item)) {
|
||||
typeIndex = 2;
|
||||
}
|
||||
if (typeIndex >= 0) {
|
||||
return !!this._GachaFlags[typeIndex][item.id];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function Window_GachaGet() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_GachaGet.prototype = Object.create(Window_Base.prototype);
|
||||
Window_GachaGet.prototype.constructor = Window_GachaGet;
|
||||
|
||||
Window_GachaGet.prototype.initialize = function(x, y, width, height) {
|
||||
Window_Base.prototype.initialize.call(this, x, y, width, height);
|
||||
this.opacity = 0;
|
||||
this._item = null;
|
||||
this._itemDescEnable = true;
|
||||
this._gachaSprite = new Sprite();
|
||||
this._gachaSprite.anchor.x = 0.5;
|
||||
this._gachaSprite.anchor.y = 0.5; // bottom
|
||||
this._gachaSprite.x = width / 2;
|
||||
this._gachaSprite.y = Graphics.boxHeight - height - this._gachaSprite.height - this.standardPadding();
|
||||
this._gachaSprite.opacity = 0;
|
||||
this.addChildToBack(this._gachaSprite);
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.isUsingCustomCursorRectSprite = function () { return true; };
|
||||
|
||||
Window_GachaGet.prototype.itemDescEnable = function(value) {
|
||||
if (this._itemDescEnable !== value) {
|
||||
this._itemDescEnable = value;
|
||||
this.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.setItem = function(item) {
|
||||
if (this._item !== item) {
|
||||
this._item = item;
|
||||
this.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.update = function() {
|
||||
Window_Base.prototype.update.call(this);
|
||||
if (this._gachaSprite.bitmap) {
|
||||
var bitmapHeight = this._gachaSprite.bitmap.height;
|
||||
var contentsHeight = this.contents.height;
|
||||
if (this._itemDescEnable) {
|
||||
contentsHeight -= this.lineHeight() * 3
|
||||
}
|
||||
var scale = 1;
|
||||
if (bitmapHeight > contentsHeight) {
|
||||
scale = contentsHeight / bitmapHeight;
|
||||
}
|
||||
this._gachaSprite.scale.x = scale;
|
||||
this._gachaSprite.scale.y = scale;
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.refresh = function() {
|
||||
var item = this._item;
|
||||
this.contents.clear();
|
||||
|
||||
if (this._itemDescEnable) {
|
||||
var y = this.contentsHeight() - this.lineHeight() * 3;
|
||||
this.drawHorzLine(y);
|
||||
this.drawDescription(0, y + this.lineHeight());
|
||||
}
|
||||
|
||||
if (!item || !item.meta.gachaImage) {
|
||||
this._gachaSprite.bitmap = null;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
var bitmap;
|
||||
bitmap = ImageManager.loadPicture(this._item.meta.gachaImage);
|
||||
this._gachaSprite.bitmap = bitmap;
|
||||
bitmap.smooth = true;
|
||||
if ([83,90,91,92,93].contains(this._item.id)) {
|
||||
this._gachaSprite.y = this._gachaSprite.y - 32;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.drawDescription = function(x, y) {
|
||||
if (this._item) this.drawTextEx(this._item.description, x, y);
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.drawHorzLine = function(y) {
|
||||
var lineY = y + this.lineHeight() / 2 - 1;
|
||||
this.contents.paintOpacity = 48;
|
||||
this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.lineColor());
|
||||
this.contents.paintOpacity = 255;
|
||||
};
|
||||
|
||||
Window_GachaGet.prototype.lineColor = function() {
|
||||
return this.normalColor();
|
||||
};
|
||||
|
||||
|
||||
|
||||
function Sprite_GachaEffect() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_GachaEffect.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_GachaEffect.prototype.constructor = Sprite_GachaEffect;
|
||||
|
||||
Sprite_GachaEffect.prototype.initialize = function() {
|
||||
Sprite.prototype.initialize.call(this);
|
||||
this._animationSprites = [];
|
||||
this._endSprites = [];
|
||||
this._effectTarget = this;
|
||||
this._hiding = false;
|
||||
this._keepDisplay = false;
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.keepDisplay = function(value) {
|
||||
this._keepDisplay = value;
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.update = function() {
|
||||
Sprite.prototype.update.call(this);
|
||||
this.updateVisibility();
|
||||
this.updateAnimationSprites();
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.hide = function() {
|
||||
this._hiding = true;
|
||||
this.updateVisibility();
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.show = function() {
|
||||
this._hiding = false;
|
||||
this.updateVisibility();
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.updateVisibility = function() {
|
||||
this.visible = !this._hiding;
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.updateAnimationSprites = function() {
|
||||
if (this._animationSprites.length > 0) {
|
||||
var sprites = this._animationSprites.clone();
|
||||
this._animationSprites = [];
|
||||
for (var i = 0; i < sprites.length; i++) {
|
||||
var sprite = sprites[i];
|
||||
if (sprite.isPlaying()) {
|
||||
this._animationSprites.push(sprite);
|
||||
} else {
|
||||
if (!this._keepDisplay) {
|
||||
sprite.remove();
|
||||
}
|
||||
else {
|
||||
this._endSprites.push(sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.startAnimation = function(animation, mirror, delay) {
|
||||
var sprite = new Sprite_Animation();
|
||||
sprite.setup(this._effectTarget, animation, mirror, delay);
|
||||
this.parent.addChild(sprite);
|
||||
this._animationSprites.push(sprite);
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.isAnimationPlaying = function() {
|
||||
return this._animationSprites.length > 0;
|
||||
};
|
||||
|
||||
Sprite_GachaEffect.prototype.allRemove = function() {
|
||||
var sprites, sprite, i;
|
||||
if (this._animationSprites.length > 0) {
|
||||
sprites = this._animationSprites.clone();
|
||||
this._animationSprites = [];
|
||||
for (i = 0; i < sprites.length; i++) {
|
||||
sprite = sprites[i];
|
||||
sprite.remove();
|
||||
}
|
||||
}
|
||||
if (this._endSprites.length > 0) {
|
||||
sprites = this._endSprites.clone();
|
||||
this._endSprites = [];
|
||||
for (i = 0; i < sprites.length; i++) {
|
||||
sprite = sprites[i];
|
||||
sprite.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
468
www/js/plugins/GachaBook.js
Normal file
468
www/js/plugins/GachaBook.js
Normal file
|
|
@ -0,0 +1,468 @@
|
|||
//=============================================================================
|
||||
// GachaBook.js
|
||||
//
|
||||
// (c)2016 KADOKAWA CORPORATION./YOJI OJIMA
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Displays detailed statuses of "gacha" items.
|
||||
* @author Takeya Kimura
|
||||
*
|
||||
* @param Unknown Data
|
||||
* @desc The index name for an unknown item.
|
||||
* @default ??????
|
||||
*
|
||||
* @param Price Text
|
||||
* @desc The text for "Price".
|
||||
* @default Price
|
||||
*
|
||||
* @param Equip Text
|
||||
* @desc The text for "Equip".
|
||||
* @default Equip
|
||||
*
|
||||
* @param Type Text
|
||||
* @desc The text for "Type".
|
||||
* @default Type
|
||||
*
|
||||
* @param Rank Text
|
||||
* @desc The text for "Rank".
|
||||
* @default Rank
|
||||
*
|
||||
* @param Simple Display
|
||||
* @desc The switch to display the name and description only.
|
||||
* @default 0
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Plugin Command:
|
||||
* GachaBook open # Open the gacha book screen
|
||||
* GachaBook add weapon 3 # Add weapon #3 to the gacha book
|
||||
* GachaBook add armor 4 # Add armor #4 to the gacha book
|
||||
* GachaBook remove armor 5 # Remove armor #5 from the gacha book
|
||||
* GachaBook remove item 6 # Remove item #6 from the gacha book
|
||||
* GachaBook clear # Clear the item book
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc ガチャアイテム一覧を表示します。
|
||||
* @author Takeya Kimura
|
||||
*
|
||||
* @param Unknown Data
|
||||
* @desc 未確認のガチャアイテムの名前です。
|
||||
* @default ??????
|
||||
*
|
||||
* @param Price Text
|
||||
* @desc 「価格」の文字列です。
|
||||
* @default Price
|
||||
*
|
||||
* @param Equip Text
|
||||
* @desc 「装備」の文字列です。
|
||||
* @default Equip
|
||||
*
|
||||
* @param Type Text
|
||||
* @desc 「タイプ」の文字列です。
|
||||
* @default Type
|
||||
*
|
||||
* @param Rank Text
|
||||
* @desc 「ランク」の文字列です。
|
||||
* @default Rank
|
||||
*
|
||||
* @param Simple Display
|
||||
* @desc 1と入力すると詳細表示が名前と説明だけになります。[0: 通常表示 1: シンプル表示]
|
||||
* @default 0
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Plugin Command:
|
||||
* GachaBook open # ガチャブックを開きます
|
||||
* GachaBook add weapon 3 # 武器3番をガチャブックに追加
|
||||
* GachaBook add armor 4 # 防具4番をガチャブックに追加
|
||||
* GachaBook remove armor 5 # 防具5番をガチャブックから削除
|
||||
* GachaBook remove item 6 # アイテム6番をガチャブックから削除
|
||||
* GachaBook clear # ガチャブックをクリアする
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
var parameters = PluginManager.parameters('GachaBook');
|
||||
var unknownData;
|
||||
var priceText;
|
||||
var equipText;
|
||||
var typeText;
|
||||
var rankText;
|
||||
|
||||
Scene_Boot = class extends Scene_Boot {
|
||||
|
||||
start() {
|
||||
super.start();
|
||||
unknownData = LanguageManager.getMessageData("gacha_minigame.message_8").text;
|
||||
priceText = LanguageManager.getMessageData("gacha_minigame.message_4").text;
|
||||
equipText = LanguageManager.getMessageData("gacha_minigame.message_5").text;
|
||||
typeText = LanguageManager.getMessageData("gacha_minigame.message_6").text;
|
||||
rankText = LanguageManager.getMessageData("gacha_minigame.message_7").text;
|
||||
}
|
||||
}
|
||||
|
||||
var simpleDisplay = !!Number(parameters['Simple Display'] || 0);
|
||||
|
||||
var _Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
if (command === 'GachaBook') {
|
||||
switch (args[0]) {
|
||||
case 'open':
|
||||
SceneManager.push(Scene_GachaBook);
|
||||
break;
|
||||
case 'add':
|
||||
$gameSystem.addToGachaBook(args[1], Number(args[2]));
|
||||
break;
|
||||
case 'remove':
|
||||
$gameSystem.removeFromGachaBook(args[1], Number(args[2]));
|
||||
break;
|
||||
case 'complete':
|
||||
$gameSystem.completeGachaBook();
|
||||
break;
|
||||
case 'clear':
|
||||
$gameSystem.clearGachaBook();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.addToGachaBook = function(type, dataId) {
|
||||
if (!this._GachaBookFlags) {
|
||||
this.clearGachaBook();
|
||||
}
|
||||
var typeIndex = this.gachaBookTypeToIndex(type);
|
||||
if (typeIndex >= 0) {
|
||||
this._GachaBookFlags[typeIndex][dataId] = true;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.removeFromGachaBook = function(type, dataId) {
|
||||
if (this._GachaBookFlags) {
|
||||
var typeIndex = this.gachaBookTypeToIndex(type);
|
||||
if (typeIndex >= 0) {
|
||||
this._GachaBookFlags[typeIndex][dataId] = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.gachaBookTypeToIndex = function(type) {
|
||||
switch (type) {
|
||||
case 'item':
|
||||
return 0;
|
||||
case 'weapon':
|
||||
return 1;
|
||||
case 'armor':
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.completeGachaBook = function() {
|
||||
var i;
|
||||
this.clearGachaBook();
|
||||
for (i = 1; i < $dataItems.length; i++) {
|
||||
this._GachaBookFlags[0][i] = true;
|
||||
}
|
||||
for (i = 1; i < $dataWeapons.length; i++) {
|
||||
this._GachaBookFlags[1][i] = true;
|
||||
}
|
||||
for (i = 1; i < $dataArmors.length; i++) {
|
||||
this._GachaBookFlags[2][i] = true;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.clearGachaBook = function() {
|
||||
this._GachaBookFlags = [[], [], []];
|
||||
};
|
||||
|
||||
Game_System.prototype.isInGachaBook = function(item) {
|
||||
if (this._GachaBookFlags && item) {
|
||||
var typeIndex = -1;
|
||||
if (DataManager.isItem(item)) {
|
||||
typeIndex = 0;
|
||||
} else if (DataManager.isWeapon(item)) {
|
||||
typeIndex = 1;
|
||||
} else if (DataManager.isArmor(item)) {
|
||||
typeIndex = 2;
|
||||
}
|
||||
if (typeIndex >= 0) {
|
||||
return !!this._GachaBookFlags[typeIndex][item.id];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
var _Game_Party_gainItem = Game_Party.prototype.gainItem;
|
||||
Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
|
||||
_Game_Party_gainItem.call(this, item, amount, includeEquip);
|
||||
if (item && amount > 0) {
|
||||
var type;
|
||||
if (DataManager.isItem(item)) {
|
||||
type = 'item';
|
||||
} else if (DataManager.isWeapon(item)) {
|
||||
type = 'weapon';
|
||||
} else if (DataManager.isArmor(item)) {
|
||||
type = 'armor';
|
||||
}
|
||||
$gameSystem.addToGachaBook(type, item.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function Scene_GachaBook() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Scene_GachaBook.prototype = Object.create(Scene_MenuBase.prototype);
|
||||
Scene_GachaBook.prototype.constructor = Scene_GachaBook;
|
||||
|
||||
Scene_GachaBook.prototype.initialize = function() {
|
||||
Scene_MenuBase.prototype.initialize.call(this);
|
||||
ImageManager.loadAtlas("gacha_prizes");
|
||||
};
|
||||
|
||||
Scene_GachaBook.prototype.create = function() {
|
||||
Scene_MenuBase.prototype.create.call(this);
|
||||
this._indexWindow = new Window_GachaBookIndex(0, 0);
|
||||
this._indexWindow.setHandler('cancel', this.popScene.bind(this));
|
||||
var wy = this._indexWindow.height;
|
||||
var ww = Graphics.boxWidth;
|
||||
var wh = Graphics.boxHeight - wy;
|
||||
this._statusWindow = new Window_GachaBookStatus(0, wy, ww, wh);
|
||||
this.addWindow(this._indexWindow);
|
||||
this.addWindow(this._statusWindow);
|
||||
this._indexWindow.setStatusWindow(this._statusWindow);
|
||||
};
|
||||
|
||||
function Window_GachaBookIndex() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_GachaBookIndex.prototype = Object.create(Window_Selectable.prototype);
|
||||
Window_GachaBookIndex.prototype.constructor = Window_GachaBookIndex;
|
||||
|
||||
Window_GachaBookIndex.lastTopRow = 0;
|
||||
Window_GachaBookIndex.lastIndex = 0;
|
||||
|
||||
Window_GachaBookIndex.prototype.initialize = function(x, y) {
|
||||
var width = Graphics.boxWidth;
|
||||
var height = this.fittingHeight(6);
|
||||
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
|
||||
this.refresh();
|
||||
this.setTopRow(Window_GachaBookIndex.lastTopRow);
|
||||
this.select(Window_GachaBookIndex.lastIndex);
|
||||
this.activate();
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.isUsingCustomCursorRectSprite = function () { return true; };
|
||||
|
||||
Window_GachaBookIndex.prototype.maxCols = function() {
|
||||
return 3;
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.maxItems = function() {
|
||||
return this._list ? this._list.length : 0;
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.setStatusWindow = function(statusWindow) {
|
||||
this._statusWindow = statusWindow;
|
||||
this.updateStatus();
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.update = function() {
|
||||
Window_Selectable.prototype.update.call(this);
|
||||
this.updateStatus();
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.updateStatus = function() {
|
||||
if (this._statusWindow) {
|
||||
var item = this._list[this.index()];
|
||||
this._statusWindow.setItem(item);
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.refresh = function() {
|
||||
var i, item;
|
||||
this._list = [];
|
||||
for (i = 1; i < $dataItems.length; i++) {
|
||||
item = $dataItems[i];
|
||||
//if (item.name && item.itypeId === 1 && $gameSystem.isInGacha(item)) { //itypeIdはみない
|
||||
if (item.name && $gameSystem.isInGacha(item)) { //itypeIdはみない
|
||||
this._list.push(item);
|
||||
}
|
||||
}
|
||||
for (i = 1; i < $dataWeapons.length; i++) {
|
||||
item = $dataWeapons[i];
|
||||
if (item.name && $gameSystem.isInGacha(item)) {
|
||||
this._list.push(item);
|
||||
}
|
||||
}
|
||||
for (i = 1; i < $dataArmors.length; i++) {
|
||||
item = $dataArmors[i];
|
||||
if (item.name && $gameSystem.isInGacha(item)) {
|
||||
this._list.push(item);
|
||||
}
|
||||
}
|
||||
this.createContents();
|
||||
this.drawAllItems();
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.drawItem = function(index) {
|
||||
var item = this._list[index];
|
||||
var rect = this.itemRect(index);
|
||||
var width = rect.width - this.textPadding();
|
||||
if ($gameSystem.isInGachaBook(item)) {
|
||||
this.drawItemName(item, rect.x, rect.y, width);
|
||||
} else {
|
||||
var iw = Window_Base._iconWidth + 4;
|
||||
this.drawText(unknownData, rect.x + iw, rect.y, width - iw);
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.processCancel = function() {
|
||||
Window_Selectable.prototype.processCancel.call(this);
|
||||
Window_GachaBookIndex.lastTopRow = this.topRow();
|
||||
Window_GachaBookIndex.lastIndex = this.index();
|
||||
};
|
||||
|
||||
function Window_GachaBookStatus() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_GachaBookStatus.prototype = Object.create(Window_Base.prototype);
|
||||
Window_GachaBookStatus.prototype.constructor = Window_GachaBookStatus;
|
||||
|
||||
Window_GachaBookStatus.prototype.initialize = function(x, y, width, height) {
|
||||
Window_Base.prototype.initialize.call(this, x, y, width, height);
|
||||
this._itemSprite = new Sprite();
|
||||
this._itemSprite.anchor.x = 0.5;
|
||||
this._itemSprite.anchor.y = 0.5;
|
||||
this._itemSprite.x = width / 2 - 20;
|
||||
this._itemSprite.y = height / 2;
|
||||
this.addChildToBack(this._itemSprite);
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
Window_GachaBookIndex.prototype.isUsingCustomCursorRectSprite = function () { return true; };
|
||||
|
||||
Window_GachaBookStatus.prototype.setItem = function(item) {
|
||||
if (this._item !== item) {
|
||||
this._item = item;
|
||||
this.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaBookStatus.prototype.update = function() {
|
||||
Window_Base.prototype.update.call(this);
|
||||
if (this._itemSprite.bitmap) {
|
||||
var bitmapHeight = this._itemSprite.bitmap.height;
|
||||
var contentsHeight = this.contents.height;
|
||||
var scale = 1;
|
||||
if (bitmapHeight > contentsHeight) {
|
||||
scale = contentsHeight / bitmapHeight;
|
||||
}
|
||||
this._itemSprite.scale.x = scale;
|
||||
this._itemSprite.scale.y = scale;
|
||||
}
|
||||
};
|
||||
|
||||
Window_GachaBookStatus.prototype.refresh = function() {
|
||||
var item = this._item;
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var lineHeight = this.lineHeight();
|
||||
|
||||
this.contents.clear();
|
||||
|
||||
if (!item || !$gameSystem.isInGachaBook(item)) {
|
||||
this._itemSprite.bitmap = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var bitmap;
|
||||
if (!!item.meta.gachaImage) {
|
||||
bitmap = ImageManager.loadPicture(item.meta.gachaImage);
|
||||
bitmap.smooth = true;
|
||||
}
|
||||
this._itemSprite.bitmap = bitmap;
|
||||
|
||||
var iconBoxWidth = Window_Base._iconWidth + 4;
|
||||
this.drawItemName(item, x, y);
|
||||
this.drawItemNumber(item, x + this.textWidth(item.name) + iconBoxWidth, y);
|
||||
|
||||
x = this.textPadding();
|
||||
y = lineHeight + this.textPadding();
|
||||
|
||||
if (!simpleDisplay) {
|
||||
var rank = "-";
|
||||
if (item.meta.gachaRank) rank = item.meta.gachaRank;
|
||||
this.changeTextColor(this.systemColor());
|
||||
this.drawText(rankText, x, y, 120);
|
||||
this.resetTextColor();
|
||||
this.drawText(rank, x + 120, y, 120, 'right');
|
||||
y += lineHeight;
|
||||
|
||||
var price = item.price > 0 ? item.price : '-';
|
||||
this.changeTextColor(this.systemColor());
|
||||
this.drawText(priceText, x, y, 120);
|
||||
this.resetTextColor();
|
||||
this.drawText(price, x + 120, y, 120, 'right');
|
||||
y += lineHeight;
|
||||
|
||||
if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {
|
||||
var etype = $dataSystem.equipTypes[item.etypeId];
|
||||
this.changeTextColor(this.systemColor());
|
||||
this.drawText(equipText, x, y, 120);
|
||||
this.resetTextColor();
|
||||
this.drawText(etype, x + 120, y, 120, 'right');
|
||||
y += lineHeight;
|
||||
|
||||
var type;
|
||||
if (DataManager.isWeapon(item)) {
|
||||
type = $dataSystem.weaponTypes[item.wtypeId];
|
||||
} else {
|
||||
type = $dataSystem.armorTypes[item.atypeId];
|
||||
}
|
||||
this.changeTextColor(this.systemColor());
|
||||
this.drawText(typeText, x, y, 120);
|
||||
this.resetTextColor();
|
||||
this.drawText(type, x + 120, y, 120, 'right');
|
||||
|
||||
//x = this.textPadding() + 300;
|
||||
//y = lineHeight + this.textPadding();
|
||||
var rewardsWidth = 220;
|
||||
x = this.contents.width - rewardsWidth;
|
||||
y = lineHeight + this.textPadding();
|
||||
for (var i = 2; i < 8; i++) {
|
||||
this.changeTextColor(this.systemColor());
|
||||
this.drawText(TextManager.param(i), x, y, 160);
|
||||
this.resetTextColor();
|
||||
this.drawText(item.params[i], x + 160, y, 60, 'right');
|
||||
y += lineHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x = 0;
|
||||
y = this.textPadding() * 2 + lineHeight * 7;
|
||||
this.drawTextEx(item.description, x, y);
|
||||
};
|
||||
|
||||
Window_GachaBookStatus.prototype.numberWidth = function() {
|
||||
return this.textWidth('000');
|
||||
};
|
||||
|
||||
Window_GachaBookStatus.prototype.drawItemNumber = function(item, x, y) {
|
||||
this.drawText(':', x, y);
|
||||
this.drawText($gameParty.numItems(item), x + this.textWidth('00'), y);
|
||||
};
|
||||
|
||||
})();
|
||||
374
www/js/plugins/HIME_EnemyReinforcements.js
Normal file
374
www/js/plugins/HIME_EnemyReinforcements.js
Normal file
|
|
@ -0,0 +1,374 @@
|
|||
/*:
|
||||
-------------------------------------------------------------------------
|
||||
@title Enemy Reinforcements
|
||||
@author Hime --> HimeWorks (http://himeworks.com)
|
||||
@date Aug 15, 2016
|
||||
@version 1.3
|
||||
@filename HIME_EnemyReinforcements.js
|
||||
@url http://himeworks.com/2015/11/enemy-reinforcements-mv/
|
||||
|
||||
If you enjoy my work, consider supporting me on Patreon!
|
||||
|
||||
* https://www.patreon.com/himeworks
|
||||
|
||||
If you have any questions or concerns, you can contact me at any of
|
||||
the following sites:
|
||||
|
||||
* Main Website: http://himeworks.com
|
||||
* Facebook: https://www.facebook.com/himeworkscom/
|
||||
* Twitter: https://twitter.com/HimeWorks
|
||||
* Youtube: https://www.youtube.com/c/HimeWorks
|
||||
* Tumblr: http://himeworks.tumblr.com/
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
@plugindesc Allows you to summon more enemies into the current battle
|
||||
using event commands.
|
||||
@help
|
||||
-------------------------------------------------------------------------
|
||||
== Description ==
|
||||
|
||||
Video: https://youtu.be/ROy4nEoao-I
|
||||
|
||||
Do you want to add new enemies to battle, during the battle? This plugin
|
||||
provides you with a variety of commands that allow you to create
|
||||
more dynamic battles through enemy reinforcements.
|
||||
|
||||
You can create enemy skills that will essentially summon new enemies
|
||||
to battle. Enemies can be added as a single enemy, or entire troops
|
||||
of enemies.
|
||||
|
||||
Do you want to make sure a particular reinforcement does not already
|
||||
exist? With this plugin, methods are provided to allow you to check
|
||||
whether a certain enemy from a certain troop exists at a certain position.
|
||||
|
||||
If you want reinforcements to automatically disappear after a certain
|
||||
amount of time has passed, you can easily do so by making a single
|
||||
command to remove all enemy reinforcements from another troop!
|
||||
|
||||
== Terms of Use ==
|
||||
|
||||
- Free for use in non-commercial projects with credits
|
||||
- Contact me for commercial use
|
||||
|
||||
== Change Log ==
|
||||
|
||||
1.3 - Aug 15, 2016
|
||||
* Fix checking whether a certain member existed
|
||||
1.2 - Nov 21, 2015
|
||||
* member ID's weren't normalized to 1-based
|
||||
1.1 - Nov 17, 2015
|
||||
* fixed "needs alive" condition for checking if added
|
||||
1.0 - Nov 16, 2015
|
||||
* initial release
|
||||
|
||||
== Usage ==
|
||||
|
||||
When enemies are added to the battle, there are two questions that
|
||||
need to be answered: which enemy is added, and where are they placed?
|
||||
|
||||
This plugin uses troops in the database to set up the enemy positions.
|
||||
The enemy that will be added depends on the enemy that you choose in a
|
||||
troop, and their position will be based on where they are in the troop.
|
||||
|
||||
Keep this numbering system in mind as you read on.
|
||||
|
||||
-- Adding Enemy Troops --
|
||||
|
||||
You can add entire troops to the current battle. When a troop is added,
|
||||
all enemies in the other troop will be added, whether they should appear
|
||||
half-way or not. To add a troop into battle, use the plugin command:
|
||||
|
||||
add_enemy_troop TROOP_ID
|
||||
|
||||
Where the TROOP_ID is the ID of the troop that you want to add.
|
||||
For example, if the three slimes is troop 4, you would write
|
||||
|
||||
add_enemy_troop 4
|
||||
|
||||
-- Adding Certain Enemies from Troops --
|
||||
|
||||
Instead of adding an entire troop, you may want to add a specific enemy
|
||||
from a specific troop. To add a specific enemy, use the plugin command:
|
||||
|
||||
add_enemy TROOP_MEMBER_ID from troop TROOP_ID
|
||||
|
||||
The TROOP_MEMBER_ID uses the numbering system that I described earlier.
|
||||
So for example, if you wanted to add the second slime from the three\
|
||||
slimes troop to battle, you would write
|
||||
|
||||
add_enemy 2 from troop 4
|
||||
|
||||
-- Removing Enemy Troops --
|
||||
|
||||
If you wish to remove a troop that was added to the battle (for example,
|
||||
they are all retreating or their summon time has expired), you can use
|
||||
the plugin command
|
||||
|
||||
remove_enemy_troop TROOP_ID
|
||||
|
||||
So for example if you want to remove the three slimes troop which is
|
||||
troop 4, you can write
|
||||
|
||||
remove_enemy_troop 4
|
||||
|
||||
-- Removing Certain Enemies from Troops --
|
||||
|
||||
You can also remove certain enemies from certain troops. Use the plugin
|
||||
command:
|
||||
|
||||
remove_enemy TROOP_MEMBER_ID from troop TROOP_ID
|
||||
|
||||
So for example, if you added the three slimes into the battle, but want
|
||||
to remove the second one, you can say
|
||||
|
||||
remove_enemy 2 from troop 4
|
||||
|
||||
And only that specific enemy will be removed.
|
||||
|
||||
-- Checking whether a troop exists --
|
||||
|
||||
To check whether an entire troop exists, you can use the script call
|
||||
|
||||
$gameTroop.isTroopReinforcementAdded(troopId, checkIsAlive)
|
||||
|
||||
Which will return true if the specific troop exists. If you pass in
|
||||
`true` for checking whether it's alive or not, it will return true if
|
||||
any of the members from that troop are alive. If you don't pass in
|
||||
anything, then it will return true if ANY members of the troop exists.
|
||||
|
||||
This is useful if you wanted the summons to only appear once (unless
|
||||
you explicitly remove them).
|
||||
|
||||
-- Checking whether an enemy from a certain troop exists --
|
||||
|
||||
There are methods available for checking whether a certain troop member
|
||||
exists. You can use this in a script call (such as a conditional branch):
|
||||
|
||||
$gameTroop.isEnemyReinforcementAdded(troopID, memberId, checkIsAlive)
|
||||
|
||||
Which will return true if the specific member from the specified troop
|
||||
exists, and whether it's alive or not. If you pass in `true` for whether
|
||||
it's alive or not, you can force it to check whether the enemy exists and
|
||||
is alive.
|
||||
|
||||
For example, if you want to check if the second slime from troop 4 is
|
||||
alive, you would write
|
||||
|
||||
$gameTroop.isEnemyReinforcementAdded(4, 2, true)
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
*/
|
||||
var Imported = Imported || {} ;
|
||||
var TH = TH || {};
|
||||
Imported.EnemyReinforcements = 1;
|
||||
TH.EnemyReinforcements = TH.EnemyReinforcements || {};
|
||||
|
||||
(function ($) {
|
||||
|
||||
/* New. Refresh the spriteset to draw new enemies */
|
||||
BattleManager.refreshEnemyReinforcements = function() {
|
||||
if (this._spriteset) {
|
||||
this._spriteset.refreshEnemyReinforcements();
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
Spriteset_Battle.prototype.removeEnemies = function() {
|
||||
var sprites = this._enemySprites;
|
||||
for (var i = 0; i < sprites.length; i++) {
|
||||
this._battleField.removeChild(sprites[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete all enemy sprites and re-draw them */
|
||||
Spriteset_Battle.prototype.refreshEnemyReinforcements = function() {
|
||||
this.removeEnemies();
|
||||
this.createEnemies();
|
||||
// this.createEnemyReinforcements();
|
||||
}
|
||||
|
||||
Spriteset_Battle.prototype.createEnemyReinforcements = function() {
|
||||
var enemies = $gameTroop.newReinforcements();
|
||||
var sprites = [];
|
||||
for (var i = 0; i < enemies.length; i++) {
|
||||
sprites[i] = new Sprite_Enemy(enemies[i]);
|
||||
}
|
||||
sprites.sort(this.compareEnemySprite.bind(this));
|
||||
for (var j = 0; j < sprites.length; j++) {
|
||||
this._enemySprites.push(sprites[j]);
|
||||
this._battleField.addChild(sprites[j]);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
var TH_EnemyReinforcements_Game_Enemy_setup = Game_Enemy.prototype.setup;
|
||||
Game_Enemy.prototype.setup = function(enemyId, x, y) {
|
||||
TH_EnemyReinforcements_Game_Enemy_setup.call(this, enemyId, x, y);
|
||||
this._troopId = $gameTroop.troop.id;
|
||||
}
|
||||
|
||||
Game_Enemy.prototype.troopId = function() {
|
||||
return this._troopId;
|
||||
}
|
||||
|
||||
Game_Enemy.prototype.troopMemberId = function() {
|
||||
return this._troopMemberId;
|
||||
}
|
||||
|
||||
Game_Enemy.prototype.setTroopId = function(troopId) {
|
||||
this._troopId = troopId;
|
||||
};
|
||||
|
||||
Game_Enemy.prototype.setTroopMemberId = function(memberId) {
|
||||
this._troopMemberId = memberId;
|
||||
};
|
||||
|
||||
Game_Enemy.prototype.setupReinforcements = function(troopId, enemyId, x, y) {
|
||||
this.setup(enemyId, x, y);
|
||||
this._troopId = troopId;
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
var TH_EnemyReinforcements_GameTroop_Setup = Game_Troop.prototype.setup;
|
||||
Game_Troop.prototype.setup = function(troopId) {
|
||||
TH_EnemyReinforcements_GameTroop_Setup.call(this, troopId);
|
||||
this.clearReinforcements();
|
||||
}
|
||||
|
||||
Game_Troop.prototype.newReinforcements = function() {
|
||||
return this._newEnemies;
|
||||
};
|
||||
|
||||
Game_Troop.prototype.clearReinforcements = function() {
|
||||
this._newEnemies = [];
|
||||
};
|
||||
|
||||
Game_Troop.prototype.addReinforcementMember = function(troopId, memberId, member) {
|
||||
if ($dataEnemies[member.enemyId]) {
|
||||
var enemyId = member.enemyId;
|
||||
var x = member.x;
|
||||
var y = member.y;
|
||||
var enemy = new Game_Enemy(enemyId, x, y);
|
||||
enemy.setTroopId(troopId);
|
||||
enemy.setTroopMemberId(memberId);
|
||||
if (member.hidden) {
|
||||
enemy.hide();
|
||||
}
|
||||
this._enemies.push(enemy);
|
||||
this._newEnemies.push(enemy);
|
||||
}
|
||||
}
|
||||
|
||||
Game_Troop.prototype.addEnemyReinforcement = function(troopId, memberId) {
|
||||
var member = $dataTroops[troopId].members[memberId - 1];
|
||||
this.addReinforcementMember(troopId, memberId, member);
|
||||
this.makeUniqueNames();
|
||||
BattleManager.refreshEnemyReinforcements();
|
||||
};
|
||||
|
||||
Game_Troop.prototype.addTroopReinforcements = function(troopId) {
|
||||
var troop = $dataTroops[troopId];
|
||||
var enemyId;
|
||||
for (var i = 0; i < troop.members.length; i++) {
|
||||
var member = troop.members[i];
|
||||
this.addReinforcementMember(troopId, i, member);
|
||||
}
|
||||
this.makeUniqueNames();
|
||||
BattleManager.refreshEnemyReinforcements();
|
||||
};
|
||||
|
||||
Game_Troop.prototype.removeEnemyReinforcement = function(troopId, memberId) {
|
||||
var member = $dataTroops[troopId].members[memberId - 1];
|
||||
var enemies = this._enemies;
|
||||
/* Start from the end of the array to avoid indexing issues */
|
||||
for (var i = enemies.length - 1; i > -1; i--) {
|
||||
if (enemies[i].troopId() === troopId && enemies[i].troopMemberId() === memberId) {
|
||||
this._enemies.splice(i, 1);
|
||||
}
|
||||
}
|
||||
BattleManager.refreshEnemyReinforcements();
|
||||
}
|
||||
|
||||
Game_Troop.prototype.removeTroopReinforcements = function(troopId) {
|
||||
var enemies = this._enemies;
|
||||
/* Start from the end of the array to avoid indexing issues */
|
||||
for (var i = enemies.length - 1; i > -1; i--) {
|
||||
if (enemies[i].troopId() === troopId) {
|
||||
this._enemies.splice(i, 1);
|
||||
}
|
||||
}
|
||||
BattleManager.refreshEnemyReinforcements();
|
||||
};
|
||||
|
||||
Game_Troop.prototype.isEnemyReinforcementAdded = function(troopId, memberId, needsAlive) {
|
||||
var enemies = this._enemies;
|
||||
for (var i = 0; i < enemies.length; i++) {
|
||||
if (enemies[i].troopId() === troopId && enemies[i].troopMemberId() === memberId) {
|
||||
/* Needs to be alive */
|
||||
if (needsAlive) {
|
||||
if (enemies[i].isAlive()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* Doesn't need to be alive */
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Game_Troop.prototype.isTroopReinforcementAdded = function(troopId, needsAlive) {
|
||||
var enemies = this._enemies;
|
||||
for (var i = 0; i < enemies.length; i++) {
|
||||
if (enemies[i].troopId() === troopId) {
|
||||
/* Needs to be alive */
|
||||
if (needsAlive) {
|
||||
if (enemies[i].isAlive()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* Doesn't need to be alive */
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
var TH_EnemyReinforcements_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
|
||||
// specify enemy from a certain troop
|
||||
if (command.toLowerCase() === "add_enemy") {
|
||||
var troopId = Math.floor(args[3]);
|
||||
var memberId = Math.floor(args[0]);
|
||||
$gameTroop.addEnemyReinforcement(troopId, memberId)
|
||||
}
|
||||
// add entire troop
|
||||
else if (command.toLowerCase() === "add_enemy_troop") {
|
||||
var troopId = Math.floor(args[0]);
|
||||
$gameTroop.addTroopReinforcements(troopId);
|
||||
}
|
||||
else if (command.toLowerCase() === "remove_enemy") {
|
||||
var troopId = Math.floor(args[3]);
|
||||
var memberId = Math.floor(args[0]);
|
||||
$gameTroop.removeEnemyReinforcement(troopId, memberId);
|
||||
}
|
||||
else if (command.toLowerCase() === "remove_enemy_troop") {
|
||||
var troopId = Math.floor(args[0]);
|
||||
$gameTroop.removeTroopReinforcements(troopId);
|
||||
}
|
||||
else {
|
||||
TH_EnemyReinforcements_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
}
|
||||
};
|
||||
})(TH.EnemyReinforcements);
|
||||
32
www/js/plugins/KEN_PictureBelowChars.js
Normal file
32
www/js/plugins/KEN_PictureBelowChars.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*:
|
||||
* @plugindesc v1.00 Plugin to display a picture with a specific ID below characters
|
||||
* but above tilemap. (Even if used with YED_Tiled plugin).
|
||||
* @author Kentou
|
||||
*
|
||||
* @param Picture ID
|
||||
* @desc The ID of the picture which should be displayed below characters.
|
||||
* Default: 99
|
||||
* @default 99
|
||||
*
|
||||
* @param Picture Z
|
||||
* @desc The Z-Index of the picture which should be displayed below characters.
|
||||
* Default: 2
|
||||
* @default 2
|
||||
*
|
||||
* @help
|
||||
* If you display a picture with Show Picture command, use the configured Picture ID to
|
||||
* display the picture below the characters. All other picture commands behave
|
||||
* normally.
|
||||
*/
|
||||
var _createPictures = Spriteset_Base.prototype.createPictures;
|
||||
Spriteset_Base.prototype.createPictures = function() {
|
||||
_createPictures.call(this);
|
||||
|
||||
if (this._tilemap) {
|
||||
var params = PluginManager.parameters("KEN_PictureBelowChars");
|
||||
var picID = parseInt(params["Picture ID"]);
|
||||
var sprite = this._pictureContainer.removeChildAt(picID - 1);
|
||||
sprite.z = sprite.zIndex = parseInt(params["Picture Z"]);
|
||||
this._tilemap.addChild(sprite);
|
||||
}
|
||||
};
|
||||
178
www/js/plugins/Liquid_EventData.js
Normal file
178
www/js/plugins/Liquid_EventData.js
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
//=============================================================================
|
||||
// Liquid's Lovely Plugin - Game_Event Data
|
||||
// Liquid_EventData.js
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Liquid_EventData = true;
|
||||
|
||||
var Liquid = Liquid || {};
|
||||
Liquid.EventData = Liquid.EventData || {};
|
||||
Liquid.EventData.version = 1.00;
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.0 Easibly add saveable data to events
|
||||
* @author Liquidize
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* Introduction and Instructions
|
||||
* ============================================================================
|
||||
*
|
||||
* This plugin adds a new data object that allows end users to store variables
|
||||
* and values for any event on any map and access said value in any script or
|
||||
* event through easy to use functions.
|
||||
*
|
||||
* Functions are called via the $eventData global. It is similar in structure to
|
||||
* $gameVariables, $gameSwitches, and $gameSelfSwitches.
|
||||
*
|
||||
* To make it easier for non-coders to use these functions in script calls to get
|
||||
* or set values, some of the functions that you are used to for $gameVariables
|
||||
* and the like have been "extended". These are as follows:
|
||||
*
|
||||
* $eventData.valueExt(CATEGORY,MAP_ID,EVENT_ID) - This function works similar to
|
||||
* $gameVariables.value but for non programmers you need to specifiy every argument
|
||||
* and then the function will build the "special key" in order to access the value.
|
||||
*
|
||||
* $eventData.setValueExt(CATEGORY,MAP_ID,EVENT_ID,VALUE) - This function like the
|
||||
* above "valueExt" function works similar to $gameVariable.setValue except, just like
|
||||
* the "valueExt" function you need to specify the Map and Event ID's as the function
|
||||
* will build the key for you.
|
||||
*
|
||||
* ============================================================================
|
||||
* Changelog
|
||||
* ============================================================================
|
||||
*
|
||||
* Version 1.00:
|
||||
* - Finished plugin!
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Parameter Variables
|
||||
//=============================================================================
|
||||
|
||||
Liquid.Parameters = PluginManager.parameters('Liquid_EventData');
|
||||
Liquid.Param = Liquid.Param || {};
|
||||
|
||||
// Define Global
|
||||
var $eventData = null;
|
||||
|
||||
//=============================================================================
|
||||
// DataManager
|
||||
//=============================================================================
|
||||
|
||||
Liquid.EventData.DataManager_createGameObjects = DataManager.createGameObjects;
|
||||
DataManager.createGameObjects = function() {
|
||||
$eventData = new Game_EventData();
|
||||
Liquid.EventData.DataManager_createGameObjects.call(this);
|
||||
};
|
||||
|
||||
Liquid.EventData.DataManager_makeSaveContents = DataManager.makeSaveContents;
|
||||
DataManager.makeSaveContents = function() {
|
||||
var contents = Liquid.EventData.DataManager_makeSaveContents.call(this);
|
||||
contents.eventData = $eventData;
|
||||
return contents;
|
||||
};
|
||||
|
||||
Liquid.EventData.DataManager_extractSaveContents = DataManager.extractSaveContents;
|
||||
DataManager.extractSaveContents = function(contents) {
|
||||
Liquid.EventData.DataManager_extractSaveContents.call(this,contents);
|
||||
$eventData = contents.eventData;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_EventData
|
||||
//=============================================================================
|
||||
|
||||
// Constructor
|
||||
function Game_EventData() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
// Initializer, clears/builds the data object
|
||||
Game_EventData.prototype.initialize = function () {
|
||||
this.clearAll();
|
||||
};
|
||||
|
||||
// Adds a category to the data, specified by the argument "category"
|
||||
// If no such category exists already
|
||||
Game_EventData.prototype.addCategory = function (category) {
|
||||
if (category && !this._data[category]) {
|
||||
this._data[category] = {};
|
||||
}
|
||||
};
|
||||
|
||||
// Removes a category from the data, specified by the "category"
|
||||
// argument if said category exists. This deletes ALL the values and
|
||||
// information for said category.
|
||||
Game_EventData.prototype.removeCategory = function(category) {
|
||||
if (category && this._data[category]) {
|
||||
delete this._data[category];
|
||||
}
|
||||
};
|
||||
|
||||
// This is basically a reset function, it clears
|
||||
// the data and resets the object to default state
|
||||
// removing all categories and information
|
||||
Game_EventData.prototype.clearAll = function () {
|
||||
this._data = {};
|
||||
};
|
||||
|
||||
// This clears the specific category specified by
|
||||
// "category".
|
||||
Game_EventData.prototype.clear = function (category) {
|
||||
if (category) {
|
||||
this._data[category] = {};
|
||||
}
|
||||
};
|
||||
|
||||
// Checks if the data contains the specified category
|
||||
// Returns true if it does, false if not
|
||||
Game_EventData.prototype.hasCategory = function(category) {
|
||||
if (category && this._data[category]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Gets the value of the specified key in the specified category.
|
||||
// Key is formatted as an array of MAP ID and EVENT ID.
|
||||
// e.g: [1,1] - Map 1 Event Id 1
|
||||
Game_EventData.prototype.value = function(category, key) {
|
||||
return this._data[category][key];
|
||||
};
|
||||
|
||||
// Extension of the value property to make calling the function easier for non-coders.
|
||||
Game_EventData.prototype.valueExt = function(category, map, event, key) {
|
||||
if (category && map && event) {
|
||||
var key = [map, event];
|
||||
return this.value(category,key);
|
||||
}
|
||||
};
|
||||
|
||||
// Sets the value of the specified key in the specified category with the specified value.
|
||||
// The key is formated as an array of MAP ID and EVENT ID.
|
||||
// e.g: [1,5] - For Map 1, Event 5
|
||||
Game_EventData.prototype.setValue = function(category, key, value) {
|
||||
if (value) {
|
||||
this._data[category][key] = value;
|
||||
} else {
|
||||
delete this._data[category][key];
|
||||
}
|
||||
this.onChange();
|
||||
};
|
||||
|
||||
// Extension of the setvalue function to make calling the function easier for non-coders.
|
||||
Game_EventData.prototype.setValueExt = function(category,map,event,value) {
|
||||
if (category && map && event) {
|
||||
var key = [map, event];
|
||||
this.setValue(category,key,value);
|
||||
}
|
||||
};
|
||||
|
||||
// This function is called when a value is changed to refresh the map.
|
||||
Game_EventData.prototype.onChange = function () {
|
||||
$gameMap.requestRefresh();
|
||||
};
|
||||
355
www/js/plugins/Liquid_EventIcons.js
Normal file
355
www/js/plugins/Liquid_EventIcons.js
Normal file
|
|
@ -0,0 +1,355 @@
|
|||
//=============================================================================
|
||||
// Liquid's Lovely Plugin for Jasmin - Event Icons
|
||||
// Liquid_EventIcons.js
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Liquid_EventIcons = true;
|
||||
|
||||
var Liquid = Liquid || {};
|
||||
Liquid.Eventcons = Liquid.Eventcons || {};
|
||||
Liquid.Eventcons.version = 2.01;
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v2 adds persistent balloon icons.
|
||||
* @author Liquidize
|
||||
*
|
||||
* @param ---General---
|
||||
* @default
|
||||
*
|
||||
* @param Icon Width
|
||||
* @parent ---General---
|
||||
* @type number
|
||||
* @min 0
|
||||
* @desc Determines the width of each icon frame.
|
||||
* Default: 32
|
||||
* @default 32
|
||||
*
|
||||
* @param Icon Height
|
||||
* @parent ---General---
|
||||
* @type number
|
||||
* @min 0
|
||||
* @desc Determines the height of each icon frame.
|
||||
* Default: 24
|
||||
* @default 24
|
||||
*
|
||||
* @param Default Sprite Sheet
|
||||
* @parent ---General---
|
||||
* @type string
|
||||
* @desc Determines the default sprite sheet to use for eventcons.
|
||||
* Default: quest
|
||||
* @default quest
|
||||
*
|
||||
* @param Speed
|
||||
* @parent ---General---
|
||||
* @type number
|
||||
* @min 0
|
||||
* @desc Determines the speed at which the frame is updated.
|
||||
* Default: 16
|
||||
* @default 16
|
||||
*
|
||||
* @param Wait Time
|
||||
* @parent ---General---
|
||||
* @type number
|
||||
* @min 0
|
||||
* @desc Helps determine the wait between each icon frame.
|
||||
* Default: 64
|
||||
* @default 64
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* Introduction and Instructions
|
||||
* ============================================================================
|
||||
*
|
||||
* To add an indicator add a note to the event with the following:
|
||||
* Indicator: IMAGE_NAME,INDEX
|
||||
*
|
||||
* Example:
|
||||
* Indicator: quest,1
|
||||
*
|
||||
*
|
||||
* ============================================================================
|
||||
* Changelog
|
||||
* ============================================================================
|
||||
*
|
||||
* Version 2.01:
|
||||
* - Fixed an issue where icons wouldn't change on the same map.
|
||||
*
|
||||
* Version 2.00:
|
||||
* - Plugin redo!
|
||||
*
|
||||
* Version 1.02:
|
||||
* - Added Plugin Command to change event icon
|
||||
*
|
||||
* Version 1.01:
|
||||
* - Changed it so icons can be added via notes.
|
||||
* - Made icons persist through saves properly.
|
||||
*
|
||||
* Version 1.00:
|
||||
* - Finished plugin!
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
// Parameter Variables
|
||||
//=============================================================================
|
||||
|
||||
Liquid.Parameters = PluginManager.parameters('Liquid_EventIcons');
|
||||
Liquid.Param = Liquid.Param || {};
|
||||
Liquid.Param.EventconWidth = Number(Liquid.Parameters['Icon Width'] || 32);
|
||||
Liquid.Param.EventconHeight = Number(Liquid.Parameters['Icon Height'] || 24);
|
||||
Liquid.Param.EventconSheet = String(Liquid.Parameters['Default Sprite Sheet'] || 'quest');
|
||||
Liquid.Param.EventconSpeed = Number(Liquid.Parameters['Speed'] || 16);
|
||||
Liquid.Param.EventconWaitTime = Number(Liquid.Parameters['Wait Time'] || 64);
|
||||
|
||||
Liquid.Eventcons.Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
// Plugin Commands
|
||||
if (command === "ChangeEventcon") {
|
||||
if (args.length !== 4) {
|
||||
return;
|
||||
}
|
||||
var map = parseInt(args[0]);
|
||||
var event = parseInt(args[1]);
|
||||
var img = args[2];
|
||||
var index = parseInt(args[3]);
|
||||
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
|
||||
$eventData.setValueExt("eventcon", map, event, [img, index]);
|
||||
if (map === $gameMap.mapId()) {
|
||||
if ($gameMap._events[event]) {
|
||||
$gameMap._events[event].removeEventcon();
|
||||
$gameMap._events[event].setupEventcon(img,index);
|
||||
}
|
||||
}
|
||||
} else if (command === "RemoveEventcon") {
|
||||
if (args.length !== 2) {
|
||||
return;
|
||||
}
|
||||
var map = parseInt(args[0]);
|
||||
var event = parseInt(args[1]);
|
||||
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
|
||||
$eventData.setValueExt("eventcon", map, event);
|
||||
if (map === $gameMap.mapId()) {
|
||||
if ($gameMap._events[event]) {
|
||||
$gameMap._events[event].removeEventcon();
|
||||
}
|
||||
}
|
||||
}
|
||||
Liquid.Eventcons.Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// TDS PATCH : USE SCRIPT CALL
|
||||
// this.setEventIcon(42, 'quest', 1);
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setEventIcon = function(eventId, img, index) {
|
||||
var map = $gameMap.mapId();
|
||||
var event = $gameMap.event(eventId);
|
||||
if (!$eventData.hasCategory("eventcon")) $eventData.addCategory("eventcon");
|
||||
$eventData.setValueExt("eventcon", map, eventId, [img, index]);
|
||||
event.removeEventcon();
|
||||
event.setupEventcon(img, index);
|
||||
event.refresh();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_CharacterBase
|
||||
//=============================================================================
|
||||
|
||||
Game_CharacterBase.prototype.setupEventcon = function (img, index) {
|
||||
if (this.isEventconPlaying()) {
|
||||
this.removeEventcon();
|
||||
}
|
||||
this._eventImg = img;
|
||||
this._eventIndex = index;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.startEventcon = function () {
|
||||
this._eventconPlaying = true;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.isEventconPlaying = function () {
|
||||
return this._eventIndex > 0 || this._eventconPlaying;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.removeEventcon = function () {
|
||||
this._eventImg = null;
|
||||
this._eventIndex = -1;
|
||||
this._eventconPlaying = false;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.eventconId = function () {
|
||||
return this._eventIndex;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.eventconImg = function () {
|
||||
return this._eventImg;
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.endEventcon = function () {
|
||||
this._eventconPlaying = false;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_Event
|
||||
//=============================================================================
|
||||
Liquid.Eventcons.Game_Event_refresh = Game_Event.prototype.refresh;
|
||||
Game_Event.prototype.refresh = function () {
|
||||
if (!this._eventIndex) {
|
||||
if ($eventData.hasCategory("eventcon")) {
|
||||
var eventIconInfo = $eventData.value("eventcon", [this._mapId, this._eventId]);
|
||||
if (eventIconInfo) {
|
||||
this.setupEventcon(eventIconInfo[0], eventIconInfo[1]);
|
||||
}
|
||||
} else if (this.event().note.match(/(?:INDICATOR):[ ](.+)[,](\d+)/i)) {
|
||||
var img = String(RegExp.$1);
|
||||
var index = Number(RegExp.$2);
|
||||
this.setupEventcon(img, index);
|
||||
|
||||
if (!$eventData.hasCategory("eventcon")) {
|
||||
$eventData.addCategory("eventcon");
|
||||
}
|
||||
$eventData.setValueExt("eventcon", this._mapId, this._eventId, [img, index]);
|
||||
}
|
||||
}
|
||||
Liquid.Eventcons.Game_Event_refresh.call(this);
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_Character
|
||||
//=============================================================================
|
||||
|
||||
Liquid.Eventcons.Sprite_Character_update = Sprite_Character.prototype.update;
|
||||
Sprite_Character.prototype.update = function () {
|
||||
Liquid.Eventcons.Sprite_Character_update.call(this);
|
||||
this.updateEventcon();
|
||||
};
|
||||
|
||||
Sprite_Character.prototype.setupEventcon = function () {
|
||||
if (this._character.eventconId() > 0) {
|
||||
this.startEventcon();
|
||||
this._character.startEventcon();
|
||||
if (!this.currentEventcondId) {
|
||||
this.currentEventcondId = this._character.eventconId();
|
||||
}
|
||||
if (!this.currentEventcondImg) {
|
||||
this.currentEventcondImg = this._character.eventconImg();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Character.prototype.startEventcon = function () {
|
||||
if (!this._eventconSprite || (this.currentEventcondId != this._character.eventconId()) || (this.currentEventcondImg != this._character.eventconImg())) {
|
||||
this.endEventcon();
|
||||
this._eventconSprite = new Sprite_EventCon();
|
||||
this._eventconSprite.setup(this._character.eventconImg(), this._character.eventconId());
|
||||
this.parent.addChild(this._eventconSprite);
|
||||
this.currentEventcondId = this._character.eventconId();
|
||||
this.currentEventcondImg = this._character.eventconImg();
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Character.prototype.updateEventcon = function () {
|
||||
this.setupEventcon();
|
||||
if (this._eventconSprite) {
|
||||
this._eventconSprite.x = this.x;
|
||||
this._eventconSprite.y = this.y - this.height;
|
||||
if (!this._character.isEventconPlaying()) {
|
||||
this.endEventcon();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Character.prototype.endEventcon = function () {
|
||||
if (this._eventconSprite) {
|
||||
this.parent.removeChild(this._eventconSprite);
|
||||
this._eventconSprite = null;
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Character.prototype.isEventconPlaying = function () {
|
||||
return !!this._eventconSprite;
|
||||
};
|
||||
Liquid.Eventcons.Sprite_Character_updateAnimation = Sprite_Character.prototype.updateAnimation;
|
||||
Sprite_Character.prototype.updateAnimation = function () {
|
||||
Liquid.Eventcons.Sprite_Character_updateAnimation.call(this);
|
||||
if (!this.isEventconPlaying()) {
|
||||
this._character.endEventcon();
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_EventCon
|
||||
//=============================================================================
|
||||
|
||||
function Sprite_EventCon() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_EventCon.prototype = Object.create(Sprite_Base.prototype);
|
||||
Sprite_EventCon.prototype.constructor = Sprite_EventCon;
|
||||
|
||||
Sprite_EventCon.prototype.initialize = function () {
|
||||
Sprite_Base.prototype.initialize.call(this);
|
||||
this.initMembers();
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.initMembers = function () {
|
||||
this._eventconId = 0;
|
||||
this._eventconImg = Liquid.Param.EventconSheet
|
||||
this._duration = 0;
|
||||
this.anchor.x = 0.5;
|
||||
this.anchor.y = 1;
|
||||
this.z = 7;
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.loadBitmap = function () {
|
||||
this.bitmap = ImageManager.loadSystem(this._eventconImg);
|
||||
this.setFrame(0, 0, 0, 0);
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.setup = function (img, index) {
|
||||
this._eventconImg = img;
|
||||
this._eventconId = index;
|
||||
this._duration = 4 * this.speed() + this.waitTime();
|
||||
this.loadBitmap();
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.update = function () {
|
||||
Sprite_Base.prototype.update.call(this);
|
||||
if (this._duration > 0) {
|
||||
this._duration--;
|
||||
if (this._duration > 0) {
|
||||
this.updateFrame();
|
||||
} else {
|
||||
this._duration = 4 * this.speed() + this.waitTime();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.updateFrame = function () {
|
||||
var w = Liquid.Param.EventconWidth;
|
||||
var h = Liquid.Param.EventconHeight;
|
||||
var sx = this.frameIndex() * w;
|
||||
var sy = (this._eventconId - 1) * h;
|
||||
this.setFrame(sx, sy, w, h);
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.speed = function () {
|
||||
return Liquid.Param.EventconSpeed;
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.waitTime = function () {
|
||||
return Liquid.Param.EventconWaitTime;
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.frameIndex = function () {
|
||||
var index = (this._duration - this.waitTime()) / this.speed();
|
||||
return 3 - Math.max(Math.floor(index), 0);
|
||||
};
|
||||
|
||||
Sprite_EventCon.prototype.isPlaying = function () {
|
||||
return this._duration > 0;
|
||||
};
|
||||
638
www/js/plugins/Map_Character_Tag.js
Normal file
638
www/js/plugins/Map_Character_Tag.js
Normal file
|
|
@ -0,0 +1,638 @@
|
|||
//=============================================================================
|
||||
// TDS Map Character Tag
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_MapCharacterTag = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.MapCharacterTag = _TDS_.MapCharacterTag || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Shortcut for tag system
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*
|
||||
* @param Common Event ID
|
||||
* @desc ID of the common event to run after tagging.
|
||||
* @default 1
|
||||
*
|
||||
* @param Selected Variable ID
|
||||
* @desc ID of the variable to set selected tagged actor ID.
|
||||
* @default 1
|
||||
*
|
||||
*
|
||||
* @param Disable Switch ID
|
||||
* @desc ID of the switch used to disable the tagging system.
|
||||
* @default 1
|
||||
*
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Map_Character_Tag");
|
||||
// Initialize Parameters
|
||||
_TDS_.MapCharacterTag.params = {};
|
||||
_TDS_.MapCharacterTag.params.commonEventID = Number(parameters['Common Event ID'] || 1);
|
||||
_TDS_.MapCharacterTag.params.selectedVariableID = Number(parameters['Selected Variable ID'] || 1);
|
||||
_TDS_.MapCharacterTag.params.disableSwitchID = Number(parameters['Disable Switch ID'] || 1);
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Input
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that handles input data from the keyboard and gamepads.
|
||||
//=============================================================================
|
||||
// Set Key Mapper A Key
|
||||
Input.keyMapper[65] = 'tag';
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.MapCharacterTag.Game_Player_canMove = Game_Player.prototype.canMove;
|
||||
_TDS_.MapCharacterTag.Game_Player_canStartLocalEvents = Game_Player.prototype.canStartLocalEvents;
|
||||
//=============================================================================
|
||||
// * Can Use Map Character Tag
|
||||
//=============================================================================
|
||||
Game_Player.prototype.canUseCharacterTag = function() {
|
||||
// Get Scene
|
||||
const scene = SceneManager._scene;
|
||||
// If scene exists and has can use character tag function return it
|
||||
if (scene && scene.canUseCharacterTag) { return scene.canUseCharacterTag(); };
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if player can start local events
|
||||
//=============================================================================
|
||||
Game_Player.prototype.canStartLocalEvents = function() {
|
||||
// If Map Character tag is visible
|
||||
if (SceneManager._scene._mapCharacterTag.opacity > 0) { return false; };
|
||||
// Return Original Function
|
||||
return _TDS_.MapCharacterTag.Game_Player_canStartLocalEvents.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Can Move
|
||||
//=============================================================================
|
||||
Game_Player.prototype.canMove = function() {
|
||||
// Input A is being pressed
|
||||
let scene = SceneManager._scene;
|
||||
let isTagging = scene._mapCharacterTag ? scene._mapCharacterTag.opacity > 0 : false;
|
||||
if (!!isTagging) { return false; };
|
||||
// return Original Function
|
||||
return _TDS_.MapCharacterTag.Game_Player_canMove.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
|
||||
_TDS_.MapCharacterTag.Scene_Map_update = Scene_Map.prototype.update;
|
||||
_TDS_.MapCharacterTag.Scene_Map_terminate = Scene_Map.prototype.terminate;
|
||||
//=============================================================================
|
||||
// * Create Display Objects
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.createDisplayObjects = function() {
|
||||
// Run Original Function
|
||||
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects.call(this);
|
||||
// Create Map Character Tag
|
||||
this.createMapCharacterTag();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Terminate
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.terminate = function() {
|
||||
// Hide Map Character Tag
|
||||
this._mapCharacterTag.visible = false;
|
||||
// Run Original Function
|
||||
_TDS_.MapCharacterTag.Scene_Map_terminate.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.update = function() {
|
||||
// Run Original Function
|
||||
_TDS_.MapCharacterTag.Scene_Map_update.call(this);
|
||||
// Update Character Tag
|
||||
this.updateCharacterTagInput();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Map Character Tag
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.createMapCharacterTag = function() {
|
||||
// Create Map Character Tag Sprite
|
||||
this._mapCharacterTag = new Sprite_MapCharacterTag();
|
||||
this.addChild(this._mapCharacterTag);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Character Tag can be used
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.canUseCharacterTag = function() {
|
||||
// If Event is running return false
|
||||
if ($gameMap.isEventRunning()) { return false; };
|
||||
// If Party size is 1 or less
|
||||
if ($gameParty.size() <= 1) { return false;};
|
||||
// If Disable Switch is on return false
|
||||
if ($gameSwitches.value(_TDS_.MapCharacterTag.params.disableSwitchID)) { return false; }
|
||||
let scene = SceneManager._scene;
|
||||
let isProcessingAnyMovement = !!$gamePlayer.isMoving() || !!$gamePlayer.followers().areMoving() || Input.isPressed("left") || Input.isPressed("right") || Input.isPressed("up") || Input.isPressed("down");
|
||||
if (!!isProcessingAnyMovement) {return false;}
|
||||
// Return true by default
|
||||
return true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Character Tag
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.updateCharacterTagInput = function() {
|
||||
// If Input Trigger A
|
||||
if (Input.isTriggered('tag')) {
|
||||
// If Can use Character Tag
|
||||
if (this.canUseCharacterTag()) {
|
||||
// Get Tag
|
||||
var tag = this._mapCharacterTag;
|
||||
// If Tag is Finished
|
||||
if (tag._finished) {
|
||||
// Show Tag
|
||||
tag.show();
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_MapCharacterTag
|
||||
//-----------------------------------------------------------------------------
|
||||
// Ring Menu for Omori's tag system on the map.
|
||||
//=============================================================================
|
||||
function Sprite_MapCharacterTag() { this.initialize.apply(this, arguments);}
|
||||
Sprite_MapCharacterTag.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_MapCharacterTag.prototype.constructor = Sprite_MapCharacterTag;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this);
|
||||
// Initialize Settings
|
||||
this.initSettings();
|
||||
// Create Background
|
||||
this.createBackground();
|
||||
// Create Party Sprites
|
||||
this.createPartySprites();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.createBackground = function() {
|
||||
// Create Background
|
||||
this._backgroundSprite = new Sprite();
|
||||
this.addChild(this._backgroundSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Settings
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.initSettings = function() {
|
||||
// Amount of Frames for Startup Animation
|
||||
this._startUpFrames = 13;
|
||||
// Animation Frames for Movement Animation
|
||||
this._movingFrames = 10;
|
||||
// Radius of the ring
|
||||
this._ringRadius = 160;
|
||||
// Animation Steps
|
||||
this._steps = -1;
|
||||
// Set Center X & Y Valeus
|
||||
this._centerX = Graphics.width / 2;
|
||||
this._centerY = (Graphics.height / 2) - 10;
|
||||
// Animation Type (Start, Wait, Move Right, Move Left)
|
||||
this._anim = '';
|
||||
// Set Index to
|
||||
this._index = 0;
|
||||
// Set Opacity to 0
|
||||
this.opacity = 0;
|
||||
// Set Released To false
|
||||
this._released = false;
|
||||
// Finished Flag
|
||||
this._finished = true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Party Sprites
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.createPartySprites = function() {
|
||||
// Initialize Party Sprites
|
||||
this._partySprites = [];
|
||||
// Create Party Sprites Container
|
||||
this._partySpritesContainer = new Sprite()
|
||||
this._partySpritesContainer.opacity = 0;
|
||||
this.addChild(this._partySpritesContainer);
|
||||
// Iterate
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var sprite = new Sprite_MapCharacterTagFace();
|
||||
let text = LanguageManager.getMessageData("XX_BLUE.Map_Character_Tag").leader
|
||||
sprite.setText(text);
|
||||
sprite.x = this._centerX;
|
||||
sprite.y = this._centerY;
|
||||
this._partySprites[i] = sprite;
|
||||
this._partySpritesContainer.addChild(sprite)
|
||||
};
|
||||
// Create Leader Sprite
|
||||
this._leaderSprite = new Sprite_MapCharacterTagFace();
|
||||
this._leaderSprite.x = this._centerX;
|
||||
this._leaderSprite.y = this._centerY;
|
||||
this._leaderSprite.showText();
|
||||
let tagtext = LanguageManager.getMessageData("XX_BLUE.Map_Character_Tag").tag_who
|
||||
this._leaderSprite.setText(tagtext)
|
||||
this.addChild(this._leaderSprite);
|
||||
// Refresh Party Sprites
|
||||
this.refreshPartySprites();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh Party Sprites
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.refreshPartySprites = function() {
|
||||
for (var i = 0; i < this._partySprites.length; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._partySprites[i];
|
||||
// Get Actor
|
||||
var actor = $gameParty.members()[i];
|
||||
sprite._faceSprite.actor = actor;
|
||||
// Set Visibility
|
||||
sprite.visible = actor !== undefined;
|
||||
};
|
||||
// Set Leader Sprite Face Sprite
|
||||
this._leaderSprite._faceSprite.actor = $gameParty.leader();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Reset Party Sprites
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.resetPartySprites = function() {
|
||||
for (var i = 0; i < this._partySprites.length; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._partySprites[i];
|
||||
sprite.x = this._centerX;
|
||||
sprite.y = this._centerY;
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Activate & Deactivate
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.activate = function() { this._active = true; };
|
||||
Sprite_MapCharacterTag.prototype.deactivate = function() { this._active = false; };
|
||||
//=============================================================================
|
||||
// * Determine if Animating
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.isAnimating = function() { return this._steps > -1; };
|
||||
//=============================================================================
|
||||
// * Determine if Inputs can be made
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.isInputable = function() {
|
||||
if (this.isAnimating()) { return false; };
|
||||
if (this._released) { return false; };
|
||||
return true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Max Items
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.maxItems = function() { return $gameParty.size(); };
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.update = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.update.call(this);
|
||||
// Update Animations
|
||||
this.updateAnimations();
|
||||
// Update Input
|
||||
this.updateInput()
|
||||
};
|
||||
//=============================================================================
|
||||
// * Move Left
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.moveLeft = function() {
|
||||
// Set Steps
|
||||
this._steps = this._movingFrames;
|
||||
// Set Max
|
||||
var max = this.maxItems();
|
||||
// Set Index
|
||||
this._index = (this._index - 1 + max) % max;
|
||||
// Set Animation
|
||||
this._anim = 'moveLeft';
|
||||
};
|
||||
//=============================================================================
|
||||
// * Move Right
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.moveRight = function() {
|
||||
// Set Steps
|
||||
this._steps = this._movingFrames;
|
||||
// Set Index
|
||||
this._index = (this._index + 1) % this.maxItems();
|
||||
// Set Animation
|
||||
this._anim = 'moveRight'
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.show = function() {
|
||||
// Set Index to
|
||||
this._index = 0;
|
||||
// Refresh Party Sprites
|
||||
this.refreshPartySprites();
|
||||
// Reset Party Sprites
|
||||
this.resetPartySprites();
|
||||
// Snap Background Bitmap
|
||||
SceneManager.snapForBackground(false);
|
||||
// Set Background Bitmap
|
||||
this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
|
||||
this._backgroundSprite.opacity = 0;
|
||||
this._backgroundSprite.blur = new PIXI.filters.BlurFilter();
|
||||
this._backgroundSprite.filters = [this._backgroundSprite.blur];
|
||||
this._backgroundSprite.blur.blur = 1;
|
||||
this._backgroundSprite.blur.padding = 0;
|
||||
// Set Party Sprites container Opacity
|
||||
this._partySpritesContainer.opacity = 0;
|
||||
// Start Startup Animation
|
||||
this.startStartupAnim();
|
||||
// Set Released To false
|
||||
this._released = false;
|
||||
// Finished Flag
|
||||
this._finished = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Animations
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.onFinish = function() {
|
||||
this._anim = null;
|
||||
this._steps = -1;
|
||||
this._backgroundSprite.bitmap = null;
|
||||
this._released = false;
|
||||
// Finished Flag
|
||||
this._finished = true;
|
||||
// If Index is more than 0
|
||||
if (this._index > 0) {
|
||||
// Get Actor ID
|
||||
var actorId = $gameParty.members()[this._index].actorId();
|
||||
// Set Actor ID Variable
|
||||
$gameVariables.setValue(_TDS_.MapCharacterTag.params.selectedVariableID, actorId);
|
||||
// Reserve Common Event
|
||||
$gameTemp.reserveCommonEvent(_TDS_.MapCharacterTag.params.commonEventID);
|
||||
};
|
||||
// Reset Index
|
||||
this._index = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Animations
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.updateAnimations = function() {
|
||||
// Set Release Flag
|
||||
if (!this._released) {
|
||||
// Set Active Flag
|
||||
this._active = Input.isPressed('tag');
|
||||
if (!this._active) {
|
||||
this._released = true;
|
||||
return;
|
||||
};
|
||||
} else if (!this._finished && this._released) {
|
||||
// If Not Active
|
||||
this.opacity -= 30;
|
||||
// If Opacity is 0 or less set showing to false
|
||||
if (this.opacity <= 0) {
|
||||
// On Finish
|
||||
this.onFinish();
|
||||
};
|
||||
return;
|
||||
};
|
||||
// If Steps is more than -1
|
||||
if (!this._released && this._steps > -1) {
|
||||
// Animation Switch Case
|
||||
switch (this._anim) {
|
||||
case 'start':
|
||||
this.updateStartupAnim();
|
||||
break;
|
||||
case 'moveLeft':
|
||||
this.updateMoveAnim(1);
|
||||
break;
|
||||
case 'moveRight':
|
||||
this.updateMoveAnim(0)
|
||||
break;
|
||||
default:
|
||||
// statements_def
|
||||
break;
|
||||
};
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Input
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.updateInput = function() {
|
||||
// If Inputable
|
||||
if (this.isInputable()) {
|
||||
// Left Input
|
||||
if (Input.isRepeated('left')) { this.moveLeft(); };
|
||||
// Right Input
|
||||
if (Input.isRepeated('right')) { this.moveRight(); };
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start Startup Animation
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.startStartupAnim = function() {
|
||||
// Animation Steps
|
||||
this._steps = this._startUpFrames;
|
||||
// Set Animation Type
|
||||
this._anim = 'start';
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Startup Animation
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.updateStartupAnim = function() {
|
||||
// If Opacity is not at max
|
||||
if (this.opacity < 255) {
|
||||
// Increase Opacity
|
||||
this.opacity += 60;
|
||||
this._backgroundSprite.opacity += 60;
|
||||
return;
|
||||
}
|
||||
|
||||
var max = this.maxItems();
|
||||
var d1 = 2.0 * Math.PI / max;
|
||||
var d2 = 1.0 * Math.PI / this._startUpFrames;
|
||||
var r = this._ringRadius - 1.0 * this._ringRadius * this._steps / this._startUpFrames;
|
||||
for (var i = 0; i < max; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._partySprites[i];
|
||||
var d = d1 * i + d2 * this._steps;
|
||||
sprite.x = this._centerX + (r * Math.sin(d));
|
||||
sprite.y = this._centerY - (r * Math.cos(d));
|
||||
sprite.hideText();
|
||||
sprite._faceSprite.deactivate();
|
||||
};
|
||||
|
||||
// If Steps are more than 0
|
||||
if (this._steps > 0) {
|
||||
// Set party container opacity
|
||||
this._partySpritesContainer.opacity = (this._partySpritesContainer.opacity * (this._steps - 1) + 255) / this._steps;
|
||||
};
|
||||
|
||||
// Decrease Steps
|
||||
this._steps--;
|
||||
// If Animation is over
|
||||
if (this._steps < 0) { this.updateWaitAnim(); };
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Wait Animation
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.updateWaitAnim = function() {
|
||||
var max = this.maxItems();
|
||||
var d = 2.0 * Math.PI / max;
|
||||
// Go Through Sprites
|
||||
for (var i = 0; i < max; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._partySprites[i];
|
||||
var j = i - this._index;
|
||||
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d * j)));
|
||||
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d * j)))
|
||||
|
||||
if (i === this._index) {
|
||||
sprite.showText();
|
||||
sprite._faceSprite.activate();
|
||||
} else {
|
||||
sprite._faceSprite.deactivate();
|
||||
sprite.hideText();
|
||||
}
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Move Animation
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTag.prototype.updateMoveAnim = function(mode) {
|
||||
var max = this.maxItems();
|
||||
var d1 = 2.0 * Math.PI / max;
|
||||
var d2 = d1 / this._movingFrames;
|
||||
if (mode !== 0) { d2 *= -1; };
|
||||
for (var i = 0; i < max; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._partySprites[i];
|
||||
var j = i - this._index;
|
||||
var d = d1 * j + d2 * this._steps;
|
||||
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d)));
|
||||
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d)))
|
||||
sprite.hideText();
|
||||
};
|
||||
// Decrease Steps
|
||||
this._steps--;
|
||||
// If Animation is over
|
||||
if (this._steps < 0) { this.updateWaitAnim(); };
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_MapCharacterTagFace
|
||||
//-----------------------------------------------------------------------------
|
||||
// Animated Face Sprite for menus.
|
||||
//=============================================================================
|
||||
function Sprite_MapCharacterTagFace() { this.initialize.apply(this, arguments);}
|
||||
Sprite_MapCharacterTagFace.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_MapCharacterTagFace.prototype.constructor = Sprite_MapCharacterTagFace;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this);
|
||||
// Set Center Position
|
||||
this.anchor.set(0.5, 0.5);
|
||||
// Create Sprites
|
||||
this.createBackgroundSprite();
|
||||
this.createTextSprite();
|
||||
this.createFaceSprite();
|
||||
// Hide Text
|
||||
this.hideText();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background Sprite
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.createBackgroundSprite = function() {
|
||||
var bitmap = new Bitmap(110, 110 + 34)
|
||||
bitmap.fillAll('rgba(0, 0, 0, 1)')
|
||||
bitmap.fillRect(1, 1, bitmap.width - 2, bitmap.height - 2, 'rgba(255, 255, 255, 1)')
|
||||
bitmap.fillRect(4, 4, bitmap.width - 8, 105, 'rgba(0, 0, 0, 1)')
|
||||
bitmap.fillRect(0, 113, bitmap.width, 1, 'rgba(0, 0, 0, 1)')
|
||||
bitmap.fillRect(4, 117, bitmap.width - 8, 22, 'rgba(0, 0, 0, 1)')
|
||||
this._backgroundSprite = new Sprite(bitmap);
|
||||
this._backgroundSprite.x = -(bitmap.width / 2);
|
||||
this._backgroundSprite.y = -(110 / 2);
|
||||
this.addChild(this._backgroundSprite);
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Create Text Sprite
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.createTextSprite = function() {
|
||||
var bitmap = new Bitmap(110, 32);
|
||||
this._textSprite = new Sprite(bitmap);
|
||||
this._textSprite.anchor.set(0.5, 0);
|
||||
this._textSprite.y = (144 / 2) - 18;
|
||||
this.addChild(this._textSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Face Sprite
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.createFaceSprite = function() {
|
||||
// Create Face Sprite
|
||||
this._faceSprite = new Sprite_OmoMenuStatusFace();
|
||||
this._faceSprite.anchor.set(0.5, 0.5)
|
||||
this._faceSprite.actor = $gameParty.members()[0];
|
||||
this._faceSprite.deactivate();
|
||||
this.addChild(this._faceSprite);
|
||||
|
||||
this._faceMask = new Sprite(new Bitmap(110,110))
|
||||
this._faceMask.x = -(110 / 2) + 2;
|
||||
this._faceMask.y = -(110 / 2) + 2;
|
||||
let white = 'rgba(255, 255, 255, 1)';
|
||||
this._faceMask.bitmap.fillRect(0,0,106,2, white)
|
||||
this._faceMask.bitmap.fillRect(104,0,2,106, white)
|
||||
this.addChild(this._faceMask);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Activate & Deactivate
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.activate = function() { this._active = true; };
|
||||
Sprite_MapCharacterTagFace.prototype.deactivate = function() { this._active = false; };
|
||||
//=============================================================================
|
||||
// * Show Text
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.setText = function(text) {
|
||||
var bitmap = this._textSprite.bitmap;
|
||||
bitmap.fontSize = LanguageManager.getMessageData("XX_BLUE.Sprite_MapCharacterTagFace").setText_fontsize;
|
||||
bitmap.drawText(text, 0, 0, bitmap.width, bitmap.height, 'center');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Text
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.showText = function() {
|
||||
this._backgroundSprite.setFrame(0, 0, 110, this._backgroundSprite.bitmap.height);
|
||||
this._textSprite.visible = true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Hide Text
|
||||
//=============================================================================
|
||||
Sprite_MapCharacterTagFace.prototype.hideText = function() {
|
||||
this._backgroundSprite.setFrame(0, 0, 110, 114);
|
||||
this._textSprite.visible = false;
|
||||
};
|
||||
13
www/js/plugins/OMORI_BattleFormulas.js
Normal file
13
www/js/plugins/OMORI_BattleFormulas.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*=============================================================================
|
||||
* OMORI -- Battle Formulas
|
||||
* By Archeia - http://www.archeia.moe
|
||||
*=============================================================================
|
||||
|
||||
//* -----------------------------------------------------------------------*/
|
||||
//* Release Stress/Energy
|
||||
//* this.omoriStressReleaseFormula(a, b)
|
||||
//* -----------------------------------------------------------------------*/
|
||||
Game_Action.prototype.omoriStressReleaseFormula = function(a, b) {
|
||||
var value = a.level >= 30 ? 1000 : a.level >= 15 ? 600 : 300
|
||||
return value;
|
||||
};
|
||||
125
www/js/plugins/OggOnly.js
Normal file
125
www/js/plugins/OggOnly.js
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
//=============================================================================
|
||||
// OggOnly.js
|
||||
// PUBLIC DOMAIN
|
||||
// ----------------------------------------------------------------------------
|
||||
// 2018/07/23 国際化と微修正
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Use only ogg files to play the audio.
|
||||
* @author krmbn0576
|
||||
*
|
||||
* @param deleteM4a
|
||||
* @type boolean
|
||||
* @text Delete all m4a files
|
||||
* @desc Delete all m4a files the next time you playtest. Backup your files before execute.
|
||||
* @default false
|
||||
*
|
||||
* @help
|
||||
* Use only ogg files to play the audio such as BGM and SE.
|
||||
* You need no longer to prepare m4a files.
|
||||
*
|
||||
* Usage:
|
||||
* Locate stbvorbis.js, stbvorbis_asm.js, and this plugin in plugins directory.
|
||||
* Turn ON Only this plugin, but DO NOT register the others to plugin manager.
|
||||
*
|
||||
*
|
||||
* License:
|
||||
* PUBLIC DOMAIN
|
||||
*
|
||||
* Thanks:
|
||||
* This plugin uses stbvorbis.js(https://github.com/hajimehoshi/stbvorbis.js)
|
||||
* as a ogg decoder. Thanks!
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc 音声ファイルの再生にoggファイルのみを使用します。
|
||||
* @author くらむぼん
|
||||
*
|
||||
* @param deleteM4a
|
||||
* @type boolean
|
||||
* @text m4aファイルを消去
|
||||
* @desc 次にテストプレイを開始した時、すべてのm4aファイルを削除します。念の為バックアップを取った上でご活用ください。
|
||||
* @default false
|
||||
*
|
||||
* @help
|
||||
* BGMや効果音などの音声ファイルにoggファイルのみを使用します。
|
||||
* 本プラグインを入れている場合、m4aファイルを用意しなくても音声を再生できます。
|
||||
*
|
||||
* 使い方:
|
||||
* pluginsフォルダに本プラグインとstbvorbis.jsとstbvorbis_asm.jsを配置してください。
|
||||
* 3つのうち本プラグイン「だけ」をプラグイン管理でONに設定してください。
|
||||
* 他の2つはOFFでも構いませんし、プラグイン管理に登録しなくても構いません。
|
||||
*
|
||||
*
|
||||
* ライセンス:
|
||||
* このプラグインの利用法に制限はありません。お好きなようにどうぞ。
|
||||
*
|
||||
* 謝辞:
|
||||
* このプラグインはoggデコーダーとしてstbvorbis.jsを使用しています。
|
||||
* (https://github.com/hajimehoshi/stbvorbis.js)
|
||||
* ありがとうございます!みんなどんどん使ってね!!
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
var parameters = PluginManager.parameters('OggOnly');
|
||||
var deleteM4a = parameters['deleteM4a'] === 'true';
|
||||
|
||||
// ただただ互換性回復のため再定義。 / Recover compatiblity.
|
||||
Utils.isOptionValid = function(name) {
|
||||
if (location.search.slice(1).split('&').contains(name)) return true;
|
||||
return typeof window.nw !== "undefined" && nw.App.argv.length > 0 && nw.App.argv[0].split('&').contains(name);
|
||||
};
|
||||
|
||||
if (deleteM4a && Utils.isOptionValid('test') && Utils.isNwjs()) {
|
||||
var exec = require('child_process').exec;
|
||||
var messages, success, failure;
|
||||
if (navigator.language.contains('ja')) {
|
||||
messages = [
|
||||
'すべてのm4aファイルを削除しますか?',
|
||||
'本当に削除しますか?念のため、先にプロジェクトフォルダのバックアップをとっておくことをおすすめします。',
|
||||
'こうかいしませんね?'
|
||||
];
|
||||
success = 'すべてのm4aファイルを削除しました。';
|
||||
failure = 'm4aファイルの削除中にエラーが発生しました。 ';
|
||||
} else {
|
||||
messages = [
|
||||
'Delete all m4a files?',
|
||||
'Are you sure?',
|
||||
'This cannot be undone. Are you really, REALLY sure?'
|
||||
];
|
||||
success = 'All m4a files have been deleted.';
|
||||
failure = 'Error occured while deleting m4a files.';
|
||||
}
|
||||
if (messages.every(function(message) { return confirm(message); })) {
|
||||
var command = process.platform === 'win32' ? 'del /s *.m4a' : 'find . -name "*.m4a" -delete';
|
||||
exec(command, function(error) {
|
||||
alert(error ? failure : success);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
PluginManager.loadScript('stbvorbis.js');
|
||||
|
||||
AudioManager.audioFileExt = function() {
|
||||
return '.ogg';
|
||||
};
|
||||
|
||||
if (!WebAudio.canPlayOgg()) {
|
||||
WebAudio._context.decodeAudioData = function(arrayBuffer, callback, errorback) {
|
||||
return stbvorbis.decode(arrayBuffer).then(function(result) {
|
||||
var channels = result.data.length;
|
||||
var buffer = this.createBuffer(result.data.length, result.data[0].length, result.sampleRate);
|
||||
for (var i = 0; i < channels; i++) {
|
||||
if (buffer.copyToChannel) {
|
||||
buffer.copyToChannel(result.data[i], i);
|
||||
} else {
|
||||
buffer.getChannelData(i).set(result.data[i]);
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}.bind(this)).then(callback, errorback);
|
||||
};
|
||||
}
|
||||
})();
|
||||
1594
www/js/plugins/Olivia_HorrorEffects.js
Normal file
1594
www/js/plugins/Olivia_HorrorEffects.js
Normal file
File diff suppressed because one or more lines are too long
438
www/js/plugins/Olivia_MapDisplayNameCore.js
Normal file
438
www/js/plugins/Olivia_MapDisplayNameCore.js
Normal file
|
|
@ -0,0 +1,438 @@
|
|||
//=============================================================================
|
||||
// Olivia Engine - Map Display Name Core - for RPG Maker MV version 1.6.1
|
||||
// Olivia_MapDisplayNameCore.js
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc <MapDisplayNameCore> for RPG Maker MV version 1.6.1.
|
||||
* @author Fallen Angel Olivia
|
||||
*
|
||||
* @help
|
||||
* This is a RPG Maker MV plugin that lets you control Map Display Names.
|
||||
* They can now use text codes, have unique gradient colors, and can have
|
||||
* custom defined fade times and duration.
|
||||
*
|
||||
* -----------------
|
||||
* Plugin Parameters
|
||||
* -----------------
|
||||
*
|
||||
* Change the plugin parameters to adjust the way your map name windows look.
|
||||
*
|
||||
* - Text Distance: The amount of distance between the edge of the gradient to
|
||||
* the text in pixels.
|
||||
*
|
||||
* - Window Height: This is the height of the window.
|
||||
*
|
||||
* - Y Position:
|
||||
* Starting Y: This is the Y coordinate for the map display window when it
|
||||
* starts fades in.
|
||||
* Middle Y: This is the Y coordinate for the map display window when it
|
||||
* finishes fading in.
|
||||
* Ending Y: This is the Y coordinate for the map display window when it
|
||||
* finishes fading out.
|
||||
*
|
||||
* - Fade:
|
||||
* Fade In Time: The number of frames to fade in the map display name.
|
||||
* MIddle Time: The number of frames to wait before fading out.
|
||||
* Fade Out Time: The number of frames to fade out the map display name.
|
||||
*
|
||||
* - Dim Color
|
||||
* Dim Color 1: This is the default dim color 1 used. Use values in order of
|
||||
* Red, Green, Blue, Alpha.
|
||||
* Dim Color 2: This is the default dim color 2 used. Use values in order of
|
||||
* Red, Green, Blue, Alpha.
|
||||
*
|
||||
* -----------------
|
||||
* Custom Dim Colors
|
||||
* -----------------
|
||||
*
|
||||
* You can use custom Dim Colors for special maps. Put these notetags into
|
||||
* the map's note box.
|
||||
*
|
||||
* <Dim Color 1: r, g, b, a>
|
||||
* <Dim Color 2: r, g, b, a>
|
||||
*
|
||||
* r = red (0-255)
|
||||
* g = green (0-255)
|
||||
* b = blue (0-255)
|
||||
* a = alpha (0-100)
|
||||
*
|
||||
* For example, a yellow Dim Color 1 notetag would look like this:
|
||||
*
|
||||
* <Dim Color 1: 255, 255, 0, 60>
|
||||
*
|
||||
* -----------------
|
||||
* Text Code Support
|
||||
* -----------------
|
||||
*
|
||||
* Text codes like \n[1] and \v[2] are supported for map names. You can now
|
||||
* put them inside of the map name to have them display the data shown with
|
||||
* the text codes used.
|
||||
*
|
||||
* For example, "\n[1] Town" will be displayed as Harold Town.
|
||||
*
|
||||
* -----------------
|
||||
* Override Map Name
|
||||
* -----------------
|
||||
*
|
||||
* If you want to override the next map name that will be displayed, then use
|
||||
* this Script Call event:
|
||||
*
|
||||
* var text = "Next Name Displayed";
|
||||
* $gameMap.overrideMapName(text);
|
||||
*
|
||||
* The next map you enter will have the map name displaying the string in the
|
||||
* text variable you put inside the Script Call Event. Then, it will clear
|
||||
* itself and the next map you enter will have its usual name again and will no
|
||||
* longer have an override map name.
|
||||
*
|
||||
* If you want to clear the override map name, then make a Script Call Event
|
||||
* with this code:
|
||||
*
|
||||
* $gameMap.clearOverrideMapName();
|
||||
*
|
||||
* This will clear the override map name that is currently stored and the next
|
||||
* map you enter will have the regular name instead.
|
||||
*
|
||||
* -------------------
|
||||
* W A R N I N G ! ! !
|
||||
* -------------------
|
||||
*
|
||||
* This plugin is made for RPG Maker MV versions 1.6.1 and below. If you update
|
||||
* RPG Maker MV past that and this plugin breaks, I am NOT responsible for it.
|
||||
*
|
||||
* ------------
|
||||
* Terms of Use
|
||||
* ------------
|
||||
*
|
||||
* 1. These plugins may be used in free or commercial games.
|
||||
* 2. 'Fallen Angel Olivia' must be given credit in your games.
|
||||
* 3. You are allowed to edit the code.
|
||||
* 4. Do NOT change the filename, parameters, and information of the plugin.
|
||||
* 5. You are NOT allowed to redistribute these Plugins.
|
||||
* 6. You may NOT take code for your own released Plugins without credit.
|
||||
*
|
||||
* -------
|
||||
* Credits
|
||||
* -------
|
||||
*
|
||||
* If you are using this plugin, credit the following people:
|
||||
*
|
||||
* - Fallen Angel Olivia
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @param ATTENTION!!!
|
||||
* @default READ THE HELP FILE
|
||||
* @param
|
||||
* @param
|
||||
*
|
||||
* @param Text Distance
|
||||
* @type number
|
||||
* @desc The amount of distance between the edge of the gradient to the text in pixels.
|
||||
* @default 80
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Window Height
|
||||
* @type number
|
||||
* @desc This is the height of the window.
|
||||
* @default 36
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Y Position
|
||||
*
|
||||
* @param Starting Y
|
||||
* @parent Y Position
|
||||
* @type number
|
||||
* @desc This is the Y coordinate for the map display window when it starts fades in.
|
||||
* @default 18
|
||||
*
|
||||
* @param Middle Y
|
||||
* @parent Y Position
|
||||
* @type number
|
||||
* @desc This is the Y coordinate for the map display window when it finishes fading in.
|
||||
* @default 48
|
||||
*
|
||||
* @param Ending Y
|
||||
* @parent Y Position
|
||||
* @type number
|
||||
* @desc This is the Y coordinate for the map display window when it finishes fading out.
|
||||
* @default 78
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Fade
|
||||
*
|
||||
* @param Fade In Time
|
||||
* @parent Fade
|
||||
* @type number
|
||||
* @desc The number of frames to fade in the map display name.
|
||||
* @default 60
|
||||
*
|
||||
* @param Middle Time
|
||||
* @parent Fade
|
||||
* @type number
|
||||
* @desc The number of frames to wait before fading out.
|
||||
* @default 60
|
||||
*
|
||||
* @param Fade Out Time
|
||||
* @parent Fade
|
||||
* @type number
|
||||
* @desc The number of frames to fade out the map display name.
|
||||
* @default 60
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Dim Color
|
||||
*
|
||||
* @param Dim Color 1
|
||||
* @parent Dim Color
|
||||
* @desc This is the default dim color 1 used. Use values in order of Red, Green, Blue, Alpha.
|
||||
* @default rgba(0, 0, 0, 0.6)
|
||||
*
|
||||
* @param Dim Color 2
|
||||
* @parent Dim Color
|
||||
* @desc This is the default dim color 2 used. Use values in order of Red, Green, Blue, Alpha.
|
||||
* @default rgba(0, 0, 0, 0)
|
||||
*
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Olivia_MapDisplayNameCore = true;
|
||||
|
||||
var Olivia = Olivia || {};
|
||||
Olivia.MapDisplayNameCore = Olivia.MapDisplayNameCore || {};
|
||||
|
||||
var parameters = $plugins.filter(function(p) { return p.description.contains('<MapDisplayNameCore>') })[0].parameters;
|
||||
|
||||
Olivia.MapDisplayNameCore.TextDistance = Number(parameters['Text Distance'] || 80);
|
||||
|
||||
Olivia.MapDisplayNameCore.WindowHeight = Number(parameters['Window Height'] || 36);
|
||||
|
||||
Olivia.MapDisplayNameCore.YPosition = {
|
||||
Starting: Number(parameters['Starting Y'] || 0),
|
||||
Middle: Number(parameters['Middle Y'] || 0),
|
||||
Ending: Number(parameters['Ending Y'] || 0)
|
||||
}
|
||||
|
||||
Olivia.MapDisplayNameCore.Fade = {
|
||||
In: Number(parameters['Fade In Time'] || 1),
|
||||
Middle: Number(parameters['Middle Time'] || 1),
|
||||
Out: Number(parameters['Fade Out Time'] || 1)
|
||||
}
|
||||
|
||||
Olivia.MapDisplayNameCore.DimColor = {
|
||||
Color1: String(parameters['Dim Color 1'] || 'rgba(0, 0, 0, 0.6)'),
|
||||
Color2: String(parameters['Dim Color 2'] || 'rgba(0, 0, 0, 0)')
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Game_Map
|
||||
//
|
||||
// The game object class for a map. It contains scrolling and passage
|
||||
// determination functions.
|
||||
|
||||
Game_Map.prototype.overrideMapName = function(text) {
|
||||
this.overrideDisplayName(text);
|
||||
};
|
||||
|
||||
Game_Map.prototype.overrideDisplayName = function(text) {
|
||||
this._overrideDisplayName = text;
|
||||
};
|
||||
|
||||
Game_Map.prototype.clearOverrideMapName = function() {
|
||||
this.clearOverrideDisplayName();
|
||||
};
|
||||
|
||||
Game_Map.prototype.clearOverrideDisplayName = function() {
|
||||
this._overrideDisplayName = undefined;
|
||||
};
|
||||
|
||||
Game_Map.prototype.displayName = function() {
|
||||
if (this._overrideDisplayName) {
|
||||
return this._overrideDisplayName;
|
||||
} else {
|
||||
return $dataMap.displayName;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Map.prototype.displayNameDimColor1 = function() {
|
||||
if ($dataMap.note.match(/<DIM COLOR 1:[ ]*(\d+(?:\s*,\s*\d+)*)>/i)) {
|
||||
var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
|
||||
var color = 'rgba(';
|
||||
color += parseInt(array[0]).clamp(0, 255) + ',';
|
||||
color += parseInt(array[1]).clamp(0, 255) + ',';
|
||||
color += parseInt(array[2]).clamp(0, 255) + ',';
|
||||
color += parseFloat(array[3] * 0.01).clamp(0, 1);
|
||||
return color + ')';
|
||||
} else {
|
||||
return Olivia.MapDisplayNameCore.DimColor.Color1;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Map.prototype.displayNameDimColor2 = function() {
|
||||
if ($dataMap.note.match(/<DIM COLOR 2:[ ]*(\d+(?:\s*,\s*\d+)*)>/i)) {
|
||||
var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
|
||||
var color = 'rgba(';
|
||||
color += parseInt(array[0]).clamp(0, 255) + ',';
|
||||
color += parseInt(array[1]).clamp(0, 255) + ',';
|
||||
color += parseInt(array[2]).clamp(0, 255) + ',';
|
||||
color += parseFloat(array[3] * 0.01).clamp(0, 1);
|
||||
return color + ')';
|
||||
} else {
|
||||
return Olivia.MapDisplayNameCore.DimColor.Color2;
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_MapName
|
||||
//
|
||||
// The window for displaying the map name on the map screen.
|
||||
|
||||
Window_MapName.prototype.initialize = function() {
|
||||
var x = 0;
|
||||
var y = Olivia.MapDisplayNameCore.YPosition.Starting;
|
||||
var width = this.windowWidth();
|
||||
var height = this.windowHeight();
|
||||
this.setupFadeRate();
|
||||
this.setupDisplayName();
|
||||
Window_Base.prototype.initialize.call(this, x, y, width, height);
|
||||
this._step = 'Fade In';
|
||||
this.opacity = 0;
|
||||
this.contentsOpacity = 0;
|
||||
this._showCount = 0;
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
Window_MapName.prototype.windowWidth = function() {
|
||||
return Graphics.boxWidth;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.windowHeight = function() {
|
||||
return Olivia.MapDisplayNameCore.WindowHeight;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.standardPadding = function() {
|
||||
return 0;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.setupFadeRate = function() {
|
||||
this._fadeInRate = Math.ceil(255 / Olivia.MapDisplayNameCore.Fade.In);
|
||||
this._fadeOutRate = Math.ceil(255 / Olivia.MapDisplayNameCore.Fade.Out);
|
||||
};
|
||||
|
||||
Window_MapName.prototype.setupDisplayName = function() {
|
||||
this._text = $gameMap.displayName();
|
||||
$gameMap.clearOverrideDisplayName();
|
||||
};
|
||||
|
||||
Window_MapName.prototype.update = function() {
|
||||
Window_Base.prototype.update.call(this);
|
||||
if (this.isOpen() && this._showCount > 0 && $gameMap.isNameDisplayEnabled()) {
|
||||
this.updateStep();
|
||||
} else {
|
||||
this.updateFadeOut();
|
||||
}
|
||||
};
|
||||
|
||||
Window_MapName.prototype.updateStep = function() {
|
||||
this._showCount--;
|
||||
var d = this._showCount;
|
||||
if (this._step === 'Fade In') {
|
||||
this.updateFadeIn();
|
||||
var targetY = Olivia.MapDisplayNameCore.YPosition.Middle;
|
||||
if (this._showCount <= 0) {
|
||||
this._showCount = Olivia.MapDisplayNameCore.Fade.Middle;
|
||||
this._step = 'Fade Middle';
|
||||
}
|
||||
} else if (this._step === 'Fade Middle') {
|
||||
this.contentsOpacity = 255;
|
||||
var targetY = Olivia.MapDisplayNameCore.YPosition.Middle;
|
||||
if (this._showCount <= 0) {
|
||||
this._showCount = Olivia.MapDisplayNameCore.Fade.Out;
|
||||
this._step = 'Fade Out';
|
||||
}
|
||||
} else {
|
||||
this.updateFadeOut();
|
||||
var targetY = Olivia.MapDisplayNameCore.YPosition.Ending;
|
||||
if (this._showCount <= 0) {
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
if (d > 0) {
|
||||
this.y = (this.y * (d - 1) + targetY) / d;
|
||||
}
|
||||
};
|
||||
|
||||
Window_MapName.prototype.updateFadeIn = function() {
|
||||
this.contentsOpacity += this._fadeInRate;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.updateFadeOut = function() {
|
||||
this.contentsOpacity -= this._fadeOutRate;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.open = function() {
|
||||
this._step = 'Fade In';
|
||||
this.refresh();
|
||||
this._showCount = Olivia.MapDisplayNameCore.Fade.In;
|
||||
};
|
||||
|
||||
Window_MapName.prototype.refresh = function() {
|
||||
this.contents.clear();
|
||||
var text = this._text;
|
||||
if (text) {
|
||||
var width = this.textWidthEx(text);
|
||||
var distance = Olivia.MapDisplayNameCore.TextDistance;
|
||||
width += distance * 2;
|
||||
this.drawBackground(0, 0, width, this.windowHeight());
|
||||
this.drawTextEx(text, distance, 0);
|
||||
}
|
||||
};
|
||||
|
||||
Window_MapName.prototype.dimColor1 = function() {
|
||||
return $gameMap.displayNameDimColor1();
|
||||
};
|
||||
|
||||
Window_MapName.prototype.dimColor2 = function() {
|
||||
return $gameMap.displayNameDimColor2();
|
||||
};
|
||||
|
||||
Window_MapName.prototype.textWidthEx = function(text) {
|
||||
return this.drawTextEx(text, 0, this.contents.height);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue