Remove unneeded files
This commit is contained in:
parent
05652eee34
commit
8e421a2ad5
1443 changed files with 0 additions and 1013432 deletions
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target":"es6"
|
||||
},
|
||||
"files": [
|
||||
"./rmmv.d.ts",
|
||||
"./rmmv-pixi.d.ts"
|
||||
],
|
||||
"include": [
|
||||
"./*",
|
||||
"./plugins_dev/*.js",
|
||||
"./plugins/*.js",
|
||||
"libs/yaml.js",
|
||||
"porting/require.js"
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,733 +0,0 @@
|
|||
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 = {}));
|
|
@ -1,15 +0,0 @@
|
|||
/*! 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);
|
|
@ -1,3 +0,0 @@
|
|||
/*! 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}();
|
File diff suppressed because one or more lines are too long
|
@ -1,428 +0,0 @@
|
|||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var shaderLib = [
|
||||
{
|
||||
vertUniforms: "",
|
||||
vertCode: "vTextureCoord = aTextureCoord;",
|
||||
fragUniforms: "uniform vec4 uTextureClamp;",
|
||||
fragCode: "vec2 textureCoord = clamp(vTextureCoord, uTextureClamp.xy, uTextureClamp.zw);"
|
||||
},
|
||||
{
|
||||
vertUniforms: "uniform mat3 uTransform;",
|
||||
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||
fragUniforms: "",
|
||||
fragCode: "vec2 textureCoord = vTextureCoord;"
|
||||
},
|
||||
{
|
||||
vertUniforms: "uniform mat3 uTransform;",
|
||||
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||
fragUniforms: "uniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;",
|
||||
fragCode: "vec2 textureCoord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;" +
|
||||
"\ntextureCoord = (uMapCoord * vec3(textureCoord, 1.0)).xy;" +
|
||||
"\ntextureCoord = clamp(textureCoord, uClampFrame.xy, uClampFrame.zw);"
|
||||
}
|
||||
];
|
||||
var PictureShader = (function (_super) {
|
||||
__extends(PictureShader, _super);
|
||||
function PictureShader(gl, vert, frag, tilingMode) {
|
||||
var lib = shaderLib[tilingMode];
|
||||
_super.call(this, gl, vert.replace(/%SPRITE_UNIFORMS%/gi, lib.vertUniforms)
|
||||
.replace(/%SPRITE_CODE%/gi, lib.vertCode), frag.replace(/%SPRITE_UNIFORMS%/gi, lib.fragUniforms)
|
||||
.replace(/%SPRITE_CODE%/gi, lib.fragCode));
|
||||
this.bind();
|
||||
this.tilingMode = tilingMode;
|
||||
this.tempQuad = new PIXI.Quad(gl);
|
||||
this.tempQuad.initVao(this);
|
||||
this.uniforms.uColor = new Float32Array([1, 1, 1, 1]);
|
||||
this.uniforms.uSampler = [0, 1];
|
||||
}
|
||||
PictureShader.blendVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 mapMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n vMapCoord = (mapMatrix * vec3(aVertexPosition, 1.0)).xy;\n}\n";
|
||||
return PictureShader;
|
||||
}(PIXI.Shader));
|
||||
extras.PictureShader = PictureShader;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var overlayFrag = "\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cs2 = Cs * 2.0 - 1.0;\n vec3 screen = Cb + Cs2 - Cb * Cs2;\n vec3 B;\n if (Cb.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cb.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cb.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||
var HardLightShader = (function (_super) {
|
||||
__extends(HardLightShader, _super);
|
||||
function HardLightShader(gl, tilingMode) {
|
||||
_super.call(this, gl, extras.PictureShader.blendVert, overlayFrag, tilingMode);
|
||||
}
|
||||
return HardLightShader;
|
||||
}(extras.PictureShader));
|
||||
extras.HardLightShader = HardLightShader;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
function mapFilterBlendModesToPixi(gl, array) {
|
||||
if (array === void 0) { array = []; }
|
||||
array[PIXI.BLEND_MODES.OVERLAY] = [new extras.OverlayShader(gl, 0), new extras.OverlayShader(gl, 1), new extras.OverlayShader(gl, 2)];
|
||||
array[PIXI.BLEND_MODES.HARD_LIGHT] = [new extras.HardLightShader(gl, 0), new extras.HardLightShader(gl, 1), new extras.HardLightShader(gl, 2)];
|
||||
return array;
|
||||
}
|
||||
extras.mapFilterBlendModesToPixi = mapFilterBlendModesToPixi;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var normalFrag = "\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n\n vec4 sample = texture2D(uSampler[0], textureCoord);\n gl_FragColor = sample * uColor;\n}\n";
|
||||
var normalVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n}\n";
|
||||
var NormalShader = (function (_super) {
|
||||
__extends(NormalShader, _super);
|
||||
function NormalShader(gl, tilingMode) {
|
||||
_super.call(this, gl, normalVert, normalFrag, tilingMode);
|
||||
}
|
||||
return NormalShader;
|
||||
}(extras.PictureShader));
|
||||
extras.NormalShader = NormalShader;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var overlayFrag = "\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cb2 = Cb * 2.0 - 1.0;\n vec3 screen = Cb2 + Cs - Cb2 * Cs;\n vec3 B;\n if (Cs.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cs.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cs.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||
var OverlayShader = (function (_super) {
|
||||
__extends(OverlayShader, _super);
|
||||
function OverlayShader(gl, tilingMode) {
|
||||
_super.call(this, gl, extras.PictureShader.blendVert, overlayFrag, tilingMode);
|
||||
}
|
||||
return OverlayShader;
|
||||
}(extras.PictureShader));
|
||||
extras.OverlayShader = OverlayShader;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
function nextPow2(v) {
|
||||
v += (v === 0) ? 1 : 0;
|
||||
--v;
|
||||
v |= v >>> 1;
|
||||
v |= v >>> 2;
|
||||
v |= v >>> 4;
|
||||
v |= v >>> 8;
|
||||
v |= v >>> 16;
|
||||
return v + 1;
|
||||
}
|
||||
var PictureRenderer = (function (_super) {
|
||||
__extends(PictureRenderer, _super);
|
||||
function PictureRenderer(renderer) {
|
||||
_super.call(this, renderer);
|
||||
}
|
||||
PictureRenderer.prototype.onContextChange = function () {
|
||||
var gl = this.renderer.gl;
|
||||
this.drawModes = extras.mapFilterBlendModesToPixi(gl);
|
||||
this.normalShader = [new extras.NormalShader(gl, 0), new extras.NormalShader(gl, 1), new extras.NormalShader(gl, 2)];
|
||||
this._tempClamp = new Float32Array(4);
|
||||
this._tempColor = new Float32Array(4);
|
||||
this._tempRect = new PIXI.Rectangle();
|
||||
this._tempRect2 = new PIXI.Rectangle();
|
||||
this._tempRect3 = new PIXI.Rectangle();
|
||||
this._tempMatrix = new PIXI.Matrix();
|
||||
this._tempMatrix2 = new PIXI.Matrix();
|
||||
this._bigBuf = new Uint8Array(1 << 20);
|
||||
this._renderTexture = new PIXI.BaseRenderTexture(1024, 1024);
|
||||
};
|
||||
PictureRenderer.prototype.start = function () {
|
||||
};
|
||||
PictureRenderer.prototype.flush = function () {
|
||||
};
|
||||
PictureRenderer.prototype._getRenderTexture = function (minWidth, minHeight) {
|
||||
if (this._renderTexture.width < minWidth ||
|
||||
this._renderTexture.height < minHeight) {
|
||||
minHeight = nextPow2(minWidth);
|
||||
minHeight = nextPow2(minHeight);
|
||||
this._renderTexture.resize(minWidth, minHeight);
|
||||
}
|
||||
return this._renderTexture;
|
||||
};
|
||||
PictureRenderer.prototype._getBuf = function (size) {
|
||||
var buf = this._bigBuf;
|
||||
if (buf.length < size) {
|
||||
size = nextPow2(size);
|
||||
buf = new Uint8Array(size);
|
||||
this._bigBuf = buf;
|
||||
}
|
||||
return buf;
|
||||
};
|
||||
PictureRenderer.prototype.render = function (sprite) {
|
||||
if (!sprite.texture.valid) {
|
||||
return;
|
||||
}
|
||||
var tilingMode = 0;
|
||||
if (sprite.tileTransform) {
|
||||
tilingMode = this._isSimpleSprite(sprite) ? 1 : 2;
|
||||
}
|
||||
var blendShader = this.drawModes[sprite.blendMode];
|
||||
if (blendShader) {
|
||||
this._renderBlend(sprite, blendShader[tilingMode]);
|
||||
}
|
||||
else {
|
||||
this._renderNormal(sprite, this.normalShader[tilingMode]);
|
||||
}
|
||||
};
|
||||
PictureRenderer.prototype._renderNormal = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
renderer.bindShader(shader);
|
||||
renderer.state.setBlendMode(sprite.blendMode);
|
||||
this._renderInner(sprite, shader);
|
||||
};
|
||||
PictureRenderer.prototype._renderBlend = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
var spriteBounds = sprite.getBounds();
|
||||
var renderTarget = renderer._activeRenderTarget;
|
||||
var matrix = renderTarget.projectionMatrix;
|
||||
var flipX = matrix.a < 0;
|
||||
var flipY = matrix.d < 0;
|
||||
var resolution = renderTarget.resolution;
|
||||
var screen = this._tempRect;
|
||||
var fr = renderTarget.sourceFrame || renderTarget.destinationFrame;
|
||||
screen.x = 0;
|
||||
screen.y = 0;
|
||||
screen.width = fr.width;
|
||||
screen.height = fr.height;
|
||||
var bounds = this._tempRect2;
|
||||
var fbw = fr.width * resolution, fbh = fr.height * resolution;
|
||||
bounds.x = (spriteBounds.x + matrix.tx / matrix.a) * resolution + fbw / 2;
|
||||
bounds.y = (spriteBounds.y + matrix.ty / matrix.d) * resolution + fbh / 2;
|
||||
bounds.width = spriteBounds.width * resolution;
|
||||
bounds.height = spriteBounds.height * resolution;
|
||||
if (flipX) {
|
||||
bounds.y = fbw - bounds.width - bounds.x;
|
||||
}
|
||||
if (flipY) {
|
||||
bounds.y = fbh - bounds.height - bounds.y;
|
||||
}
|
||||
var screenBounds = this._tempRect3;
|
||||
var x_1 = Math.floor(Math.max(screen.x, bounds.x));
|
||||
var x_2 = Math.ceil(Math.min(screen.x + screen.width, bounds.x + bounds.width));
|
||||
var y_1 = Math.floor(Math.max(screen.y, bounds.y));
|
||||
var y_2 = Math.ceil(Math.min(screen.y + screen.height, bounds.y + bounds.height));
|
||||
var pixelsWidth = x_2 - x_1;
|
||||
var pixelsHeight = y_2 - y_1;
|
||||
if (pixelsWidth <= 0 || pixelsHeight <= 0) {
|
||||
return;
|
||||
}
|
||||
var rt = this._getRenderTexture(pixelsWidth, pixelsHeight);
|
||||
renderer.bindTexture(rt, 1, true);
|
||||
var gl = renderer.gl;
|
||||
if (renderer.renderingToScreen && renderTarget.root) {
|
||||
var buf = this._getBuf(pixelsWidth * pixelsHeight * 4);
|
||||
gl.readPixels(x_1, y_1, pixelsWidth, pixelsHeight, gl.RGBA, gl.UNSIGNED_BYTE, this._bigBuf);
|
||||
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, pixelsWidth, pixelsHeight, gl.RGBA, gl.UNSIGNED_BYTE, this._bigBuf);
|
||||
}
|
||||
else {
|
||||
gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x_1, y_1, pixelsWidth, pixelsHeight);
|
||||
}
|
||||
renderer.bindShader(shader);
|
||||
renderer.state.setBlendMode(PIXI.BLEND_MODES.NORMAL);
|
||||
if (shader.uniforms.mapMatrix) {
|
||||
var mapMatrix = this._tempMatrix;
|
||||
mapMatrix.a = bounds.width / rt.width / spriteBounds.width;
|
||||
if (flipX) {
|
||||
mapMatrix.a = -mapMatrix.a;
|
||||
mapMatrix.tx = (bounds.x - x_1) / rt.width - (spriteBounds.x + spriteBounds.width) * mapMatrix.a;
|
||||
}
|
||||
else {
|
||||
mapMatrix.tx = (bounds.x - x_1) / rt.width - spriteBounds.x * mapMatrix.a;
|
||||
}
|
||||
mapMatrix.d = bounds.height / rt.height / spriteBounds.height;
|
||||
if (flipY) {
|
||||
mapMatrix.d = -mapMatrix.d;
|
||||
mapMatrix.ty = (bounds.y - y_1) / rt.height - (spriteBounds.y + spriteBounds.height) * mapMatrix.d;
|
||||
}
|
||||
else {
|
||||
mapMatrix.ty = (bounds.y - y_1) / rt.height - spriteBounds.y * mapMatrix.d;
|
||||
}
|
||||
shader.uniforms.mapMatrix = mapMatrix.toArray(true);
|
||||
}
|
||||
this._renderInner(sprite, shader);
|
||||
};
|
||||
PictureRenderer.prototype._renderInner = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
if (shader.tilingMode > 0) {
|
||||
this._renderWithShader(sprite, shader.tilingMode === 1, shader);
|
||||
}
|
||||
else {
|
||||
this._renderSprite(sprite, shader);
|
||||
}
|
||||
};
|
||||
PictureRenderer.prototype._renderWithShader = function (ts, isSimple, shader) {
|
||||
var quad = shader.tempQuad;
|
||||
var renderer = this.renderer;
|
||||
renderer.bindVao(quad.vao);
|
||||
var vertices = quad.vertices;
|
||||
var _width = ts._width;
|
||||
var _height = ts._height;
|
||||
var _anchorX = ts._anchor._x;
|
||||
var _anchorY = ts._anchor._y;
|
||||
var w0 = _width * (1 - _anchorX);
|
||||
var w1 = _width * -_anchorX;
|
||||
var h0 = _height * (1 - _anchorY);
|
||||
var h1 = _height * -_anchorY;
|
||||
var wt = ts.transform.worldTransform;
|
||||
var a = wt.a;
|
||||
var b = wt.b;
|
||||
var c = wt.c;
|
||||
var d = wt.d;
|
||||
var tx = wt.tx;
|
||||
var ty = wt.ty;
|
||||
vertices[0] = (a * w1) + (c * h1) + tx;
|
||||
vertices[1] = (d * h1) + (b * w1) + ty;
|
||||
vertices[2] = (a * w0) + (c * h1) + tx;
|
||||
vertices[3] = (d * h1) + (b * w0) + ty;
|
||||
vertices[4] = (a * w0) + (c * h0) + tx;
|
||||
vertices[5] = (d * h0) + (b * w0) + ty;
|
||||
vertices[6] = (a * w1) + (c * h0) + tx;
|
||||
vertices[7] = (d * h0) + (b * w1) + ty;
|
||||
vertices = quad.uvs;
|
||||
vertices[0] = vertices[6] = -ts.anchor.x;
|
||||
vertices[1] = vertices[3] = -ts.anchor.y;
|
||||
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
|
||||
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
|
||||
quad.upload();
|
||||
var tex = ts._texture;
|
||||
var lt = ts.tileTransform.localTransform;
|
||||
var uv = ts.uvTransform;
|
||||
var mapCoord = uv.mapCoord;
|
||||
var uClampFrame = uv.uClampFrame;
|
||||
var uClampOffset = uv.uClampOffset;
|
||||
var w = tex.width;
|
||||
var h = tex.height;
|
||||
var W = _width;
|
||||
var H = _height;
|
||||
var tempMat = this._tempMatrix2;
|
||||
tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);
|
||||
tempMat.invert();
|
||||
if (isSimple) {
|
||||
tempMat.append(mapCoord);
|
||||
}
|
||||
else {
|
||||
shader.uniforms.uMapCoord = mapCoord.toArray(true);
|
||||
shader.uniforms.uClampFrame = uClampFrame;
|
||||
shader.uniforms.uClampOffset = uClampOffset;
|
||||
}
|
||||
shader.uniforms.uTransform = tempMat.toArray(true);
|
||||
var color = this._tempColor;
|
||||
var alpha = ts.worldAlpha;
|
||||
PIXI.utils.hex2rgb(ts.tint, color);
|
||||
color[0] *= alpha;
|
||||
color[1] *= alpha;
|
||||
color[2] *= alpha;
|
||||
color[3] = alpha;
|
||||
shader.uniforms.uColor = color;
|
||||
renderer.bindTexture(tex, 0, true);
|
||||
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||
};
|
||||
PictureRenderer.prototype._renderSprite = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
var quad = shader.tempQuad;
|
||||
renderer.bindVao(quad.vao);
|
||||
var uvs = sprite.texture._uvs;
|
||||
var vertices = quad.vertices;
|
||||
var vd = sprite.vertexData;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
quad.vertices[i] = vd[i];
|
||||
}
|
||||
quad.uvs[0] = uvs.x0;
|
||||
quad.uvs[1] = uvs.y0;
|
||||
quad.uvs[2] = uvs.x1;
|
||||
quad.uvs[3] = uvs.y1;
|
||||
quad.uvs[4] = uvs.x2;
|
||||
quad.uvs[5] = uvs.y2;
|
||||
quad.uvs[6] = uvs.x3;
|
||||
quad.uvs[7] = uvs.y3;
|
||||
quad.upload();
|
||||
var frame = sprite.texture.frame;
|
||||
var base = sprite.texture.baseTexture;
|
||||
var clamp = this._tempClamp;
|
||||
var eps = 0.5 / base.resolution;
|
||||
clamp[0] = (frame.x + eps) / base.width;
|
||||
clamp[1] = (frame.y + eps) / base.height;
|
||||
clamp[2] = (frame.x + frame.width - eps) / base.width;
|
||||
clamp[3] = (frame.y + frame.height - eps) / base.height;
|
||||
shader.uniforms.uTextureClamp = clamp;
|
||||
var color = this._tempColor;
|
||||
PIXI.utils.hex2rgb(sprite.tint, color);
|
||||
var alpha = sprite.worldAlpha;
|
||||
color[0] *= alpha;
|
||||
color[1] *= alpha;
|
||||
color[2] *= alpha;
|
||||
color[3] = alpha;
|
||||
shader.uniforms.uColor = color;
|
||||
renderer.bindTexture(base, 0, true);
|
||||
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||
};
|
||||
PictureRenderer.prototype._isSimpleSprite = function (ts) {
|
||||
var renderer = this.renderer;
|
||||
var tex = ts._texture;
|
||||
var baseTex = tex.baseTexture;
|
||||
var isSimple = baseTex.isPowerOfTwo && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;
|
||||
if (isSimple) {
|
||||
if (!baseTex._glTextures[renderer.CONTEXT_UID]) {
|
||||
if (baseTex.wrapMode === PIXI.WRAP_MODES.CLAMP) {
|
||||
baseTex.wrapMode = PIXI.WRAP_MODES.REPEAT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
isSimple = baseTex.wrapMode !== PIXI.WRAP_MODES.CLAMP;
|
||||
}
|
||||
}
|
||||
return isSimple;
|
||||
};
|
||||
return PictureRenderer;
|
||||
}(PIXI.ObjectRenderer));
|
||||
extras.PictureRenderer = PictureRenderer;
|
||||
PIXI.WebGLRenderer.registerPlugin('picture', PictureRenderer);
|
||||
PIXI.CanvasRenderer.registerPlugin('picture', PIXI.CanvasSpriteRenderer);
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var PictureSprite = (function (_super) {
|
||||
__extends(PictureSprite, _super);
|
||||
function PictureSprite(texture) {
|
||||
_super.call(this, texture);
|
||||
this.pluginName = 'picture';
|
||||
}
|
||||
return PictureSprite;
|
||||
}(PIXI.Sprite));
|
||||
extras.PictureSprite = PictureSprite;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var PictureTilingSprite = (function (_super) {
|
||||
__extends(PictureTilingSprite, _super);
|
||||
function PictureTilingSprite(texture) {
|
||||
_super.call(this, texture);
|
||||
this.pluginName = 'picture';
|
||||
}
|
||||
return PictureTilingSprite;
|
||||
}(extras.TilingSprite));
|
||||
extras.PictureTilingSprite = PictureTilingSprite;
|
||||
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
//# sourceMappingURL=pixi-picture.js.map
|
|
@ -1,887 +0,0 @@
|
|||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var CanvasTileRenderer = (function () {
|
||||
function CanvasTileRenderer(renderer) {
|
||||
this.tileAnim = [0, 0];
|
||||
this.dontUseTransform = false;
|
||||
this.renderer = renderer;
|
||||
this.tileAnim = [0, 0];
|
||||
}
|
||||
return CanvasTileRenderer;
|
||||
}());
|
||||
tilemap.CanvasTileRenderer = CanvasTileRenderer;
|
||||
PIXI.CanvasRenderer.registerPlugin('tilemap', CanvasTileRenderer);
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
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 PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var CompositeRectTileLayer = (function (_super) {
|
||||
__extends(CompositeRectTileLayer, _super);
|
||||
function CompositeRectTileLayer(zIndex, bitmaps, useSquare, texPerChild) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);
|
||||
_this.modificationMarker = 0;
|
||||
_this._globalMat = null;
|
||||
_this._tempScale = null;
|
||||
_this.initialize.apply(_this, arguments);
|
||||
return _this;
|
||||
}
|
||||
CompositeRectTileLayer.prototype.updateTransform = function () {
|
||||
_super.prototype.displayObjectUpdateTransform.call(this);
|
||||
};
|
||||
CompositeRectTileLayer.prototype.initialize = function (zIndex, bitmaps, useSquare, texPerChild) {
|
||||
this.z = this.zIndex = zIndex;
|
||||
this.useSquare = useSquare;
|
||||
this.texPerChild = texPerChild || 16;
|
||||
if (bitmaps) {
|
||||
this.setBitmaps(bitmaps);
|
||||
}
|
||||
};
|
||||
CompositeRectTileLayer.prototype.setBitmaps = function (bitmaps) {
|
||||
var texPerChild = this.texPerChild;
|
||||
var len1 = this.children.length;
|
||||
var len2 = Math.ceil(bitmaps.length / texPerChild);
|
||||
var i;
|
||||
for (i = 0; i < len1; i++) {
|
||||
this.children[i].textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);
|
||||
}
|
||||
for (i = len1; i < len2; i++) {
|
||||
this.addChild(new tilemap.RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild)));
|
||||
}
|
||||
};
|
||||
CompositeRectTileLayer.prototype.clear = function () {
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
this.children[i].clear();
|
||||
this.modificationMarker = 0;
|
||||
};
|
||||
CompositeRectTileLayer.prototype.addRect = function (num, u, v, x, y, tileWidth, tileHeight) {
|
||||
if (this.children[num] && this.children[num].textures)
|
||||
this.children[num].addRect(0, u, v, x, y, tileWidth, tileHeight);
|
||||
};
|
||||
CompositeRectTileLayer.prototype.addFrame = function (texture_, x, y, animX, animY) {
|
||||
var texture;
|
||||
var layer = null, ind = 0;
|
||||
var children = this.children;
|
||||
if (typeof texture_ === "number") {
|
||||
var childIndex = texture_ / this.texPerChild >> 0;
|
||||
layer = children[childIndex];
|
||||
if (!layer) {
|
||||
layer = children[0];
|
||||
if (!layer) {
|
||||
return false;
|
||||
}
|
||||
ind = 0;
|
||||
}
|
||||
else {
|
||||
ind = texture_ % this.texPerChild;
|
||||
}
|
||||
texture = layer.textures[ind];
|
||||
}
|
||||
else if (typeof texture_ === "string") {
|
||||
texture = PIXI.Texture.fromImage(texture_);
|
||||
}
|
||||
else {
|
||||
texture = texture_;
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
var tex = child.textures;
|
||||
for (var j = 0; j < tex.length; j++) {
|
||||
if (tex[j].baseTexture == texture.baseTexture) {
|
||||
layer = child;
|
||||
ind = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (layer) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
for (i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if (child.textures.length < this.texPerChild) {
|
||||
layer = child;
|
||||
ind = child.textures.length;
|
||||
child.textures.push(texture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
children.push(layer = new tilemap.RectTileLayer(this.zIndex, texture));
|
||||
ind = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.frame.width, texture.frame.height, animX, animY);
|
||||
return true;
|
||||
};
|
||||
;
|
||||
CompositeRectTileLayer.prototype.renderCanvas = function (renderer) {
|
||||
if (!renderer.plugins.tilemap.dontUseTransform) {
|
||||
var wt = this.worldTransform;
|
||||
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
|
||||
}
|
||||
var layers = this.children;
|
||||
for (var i = 0; i < layers.length; i++)
|
||||
layers[i].renderCanvas(renderer);
|
||||
};
|
||||
;
|
||||
CompositeRectTileLayer.prototype.renderWebGL = function (renderer) {
|
||||
var gl = renderer.gl;
|
||||
var shader = renderer.plugins.tilemap.getShader(this.useSquare);
|
||||
renderer.setObjectRenderer(renderer.plugins.tilemap);
|
||||
renderer.bindShader(shader);
|
||||
this._globalMat = this._globalMat || new PIXI.Matrix();
|
||||
renderer._activeRenderTarget.projectionMatrix.copy(this._globalMat).append(this.worldTransform);
|
||||
shader.uniforms.projectionMatrix = this._globalMat.toArray(true);
|
||||
shader.uniforms.shadowColor = this.shadowColor;
|
||||
if (this.useSquare) {
|
||||
var tempScale = this._tempScale = (this._tempScale || [0, 0]);
|
||||
tempScale[0] = this._globalMat.a >= 0 ? 1 : -1;
|
||||
tempScale[1] = this._globalMat.d < 0 ? 1 : -1;
|
||||
var ps = shader.uniforms.pointScale = tempScale;
|
||||
shader.uniforms.projectionScale = Math.abs(this.worldTransform.a) * renderer.resolution;
|
||||
}
|
||||
var af = shader.uniforms.animationFrame = renderer.plugins.tilemap.tileAnim;
|
||||
var layers = this.children;
|
||||
for (var i = 0; i < layers.length; i++)
|
||||
layers[i].renderWebGL(renderer, this.useSquare);
|
||||
};
|
||||
CompositeRectTileLayer.prototype.isModified = function (anim) {
|
||||
var layers = this.children;
|
||||
if (this.modificationMarker != layers.length) {
|
||||
return true;
|
||||
}
|
||||
for (var i = 0; i < layers.length; i++) {
|
||||
var layer = layers[i];
|
||||
if (layer.modificationMarker != layer.pointsBuf.length ||
|
||||
anim && layer.hasAnim) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
CompositeRectTileLayer.prototype.clearModify = function () {
|
||||
var layers = this.children;
|
||||
this.modificationMarker = layers.length;
|
||||
for (var i = 0; i < layers.length; i++) {
|
||||
var layer = layers[i];
|
||||
layer.modificationMarker = layer.pointsBuf.length;
|
||||
}
|
||||
};
|
||||
return CompositeRectTileLayer;
|
||||
}(PIXI.Container));
|
||||
tilemap.CompositeRectTileLayer = CompositeRectTileLayer;
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var GraphicsLayer = (function (_super) {
|
||||
__extends(GraphicsLayer, _super);
|
||||
function GraphicsLayer(zIndex) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.z = _this.zIndex = zIndex;
|
||||
return _this;
|
||||
}
|
||||
GraphicsLayer.prototype.renderCanvas = function (renderer) {
|
||||
var wt = null;
|
||||
if (renderer.plugins.tilemap.dontUseTransform) {
|
||||
wt = this.transform.worldTransform;
|
||||
this.transform.worldTransform = PIXI.Matrix.IDENTITY;
|
||||
}
|
||||
renderer.plugins.graphics.render(this);
|
||||
if (renderer.plugins.tilemap.dontUseTransform) {
|
||||
this.transform.worldTransform = wt;
|
||||
}
|
||||
renderer.context.globalAlpha = 1.0;
|
||||
};
|
||||
GraphicsLayer.prototype.renderWebGL = function (renderer) {
|
||||
if (!this._webGL[renderer.CONTEXT_UID])
|
||||
this.dirty = true;
|
||||
_super.prototype.renderWebGL.call(this, renderer);
|
||||
};
|
||||
GraphicsLayer.prototype.isModified = function (anim) {
|
||||
return false;
|
||||
};
|
||||
GraphicsLayer.prototype.clearModify = function () {
|
||||
};
|
||||
return GraphicsLayer;
|
||||
}(PIXI.Graphics));
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var RectTileLayer = (function (_super) {
|
||||
__extends(RectTileLayer, _super);
|
||||
function RectTileLayer(zIndex, texture) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.z = 0;
|
||||
_this.zIndex = 0;
|
||||
_this.pointsBuf = [];
|
||||
_this._tempSize = new Float32Array([0, 0]);
|
||||
_this._tempTexSize = 1;
|
||||
_this.modificationMarker = 0;
|
||||
_this.hasAnim = false;
|
||||
_this.vbId = 0;
|
||||
_this.vbBuffer = null;
|
||||
_this.vbArray = null;
|
||||
_this.vbInts = null;
|
||||
_this.initialize(zIndex, texture);
|
||||
return _this;
|
||||
}
|
||||
RectTileLayer.prototype.initialize = function (zIndex, textures) {
|
||||
if (!textures) {
|
||||
textures = [];
|
||||
}
|
||||
else if (!(textures instanceof Array) && textures.baseTexture) {
|
||||
textures = [textures];
|
||||
}
|
||||
this.textures = textures;
|
||||
this.z = this.zIndex = zIndex;
|
||||
this.visible = false;
|
||||
};
|
||||
RectTileLayer.prototype.clear = function () {
|
||||
this.pointsBuf.length = 0;
|
||||
this.modificationMarker = 0;
|
||||
this.hasAnim = false;
|
||||
};
|
||||
RectTileLayer.prototype.renderCanvas = function (renderer) {
|
||||
if (this.textures.length === 0)
|
||||
return;
|
||||
var points = this.pointsBuf;
|
||||
renderer.context.fillStyle = '#000000';
|
||||
for (var i = 0, n = points.length; i < n; i += 9) {
|
||||
var x1 = points[i], y1 = points[i + 1];
|
||||
var x2 = points[i + 2], y2 = points[i + 3];
|
||||
var w = points[i + 4];
|
||||
var h = points[i + 5];
|
||||
x1 += points[i + 6] * renderer.plugins.tilemap.tileAnim[0];
|
||||
y1 += points[i + 7] * renderer.plugins.tilemap.tileAnim[1];
|
||||
var textureId = points[i + 8];
|
||||
if (textureId >= 0 && this.textures[textureId] !== undefined) {
|
||||
renderer.context.drawImage(this.textures[textureId].baseTexture.source, 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;
|
||||
}
|
||||
}
|
||||
};
|
||||
RectTileLayer.prototype.addRect = function (textureId, u, v, x, y, tileWidth, tileHeight, animX, animY) {
|
||||
if (animX === void 0) { animX = 0; }
|
||||
if (animY === void 0) { animY = 0; }
|
||||
var pb = this.pointsBuf;
|
||||
this.hasAnim = this.hasAnim || animX > 0 || animY > 0;
|
||||
if (tileWidth == tileHeight) {
|
||||
pb.push(u);
|
||||
pb.push(v);
|
||||
pb.push(x);
|
||||
pb.push(y);
|
||||
pb.push(tileWidth);
|
||||
pb.push(tileHeight);
|
||||
pb.push(animX | 0);
|
||||
pb.push(animY | 0);
|
||||
pb.push(textureId);
|
||||
}
|
||||
else {
|
||||
var i;
|
||||
if (tileWidth % tileHeight === 0) {
|
||||
for (i = 0; i < tileWidth / tileHeight; i++) {
|
||||
pb.push(u + i * tileHeight);
|
||||
pb.push(v);
|
||||
pb.push(x + i * tileHeight);
|
||||
pb.push(y);
|
||||
pb.push(tileHeight);
|
||||
pb.push(tileHeight);
|
||||
pb.push(animX | 0);
|
||||
pb.push(animY | 0);
|
||||
pb.push(textureId);
|
||||
}
|
||||
}
|
||||
else if (tileHeight % tileWidth === 0) {
|
||||
for (i = 0; i < tileHeight / tileWidth; i++) {
|
||||
pb.push(u);
|
||||
pb.push(v + i * tileWidth);
|
||||
pb.push(x);
|
||||
pb.push(y + i * tileWidth);
|
||||
pb.push(tileWidth);
|
||||
pb.push(tileWidth);
|
||||
pb.push(animX | 0);
|
||||
pb.push(animY | 0);
|
||||
pb.push(textureId);
|
||||
}
|
||||
}
|
||||
else {
|
||||
pb.push(u);
|
||||
pb.push(v);
|
||||
pb.push(x);
|
||||
pb.push(y);
|
||||
pb.push(tileWidth);
|
||||
pb.push(tileHeight);
|
||||
pb.push(animX | 0);
|
||||
pb.push(animY | 0);
|
||||
pb.push(textureId);
|
||||
}
|
||||
}
|
||||
};
|
||||
;
|
||||
RectTileLayer.prototype.renderWebGL = function (renderer, useSquare) {
|
||||
if (useSquare === void 0) { useSquare = false; }
|
||||
var points = this.pointsBuf;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
var rectsCount = points.length / 9;
|
||||
var tile = renderer.plugins.tilemap;
|
||||
var gl = renderer.gl;
|
||||
if (!useSquare) {
|
||||
tile.checkIndexBuffer(rectsCount);
|
||||
}
|
||||
var shader = tile.getShader(useSquare);
|
||||
var textures = this.textures;
|
||||
if (textures.length === 0)
|
||||
return;
|
||||
var len = textures.length;
|
||||
if (this._tempTexSize < shader.maxTextures) {
|
||||
this._tempTexSize = shader.maxTextures;
|
||||
this._tempSize = new Float32Array(2 * shader.maxTextures);
|
||||
}
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (!textures[i] || !textures[i].valid)
|
||||
return;
|
||||
var texture = textures[i].baseTexture;
|
||||
}
|
||||
tile.bindTextures(renderer, shader, textures);
|
||||
var vb = tile.getVb(this.vbId);
|
||||
if (!vb) {
|
||||
vb = tile.createVb(useSquare);
|
||||
this.vbId = vb.id;
|
||||
this.vbBuffer = null;
|
||||
this.modificationMarker = 0;
|
||||
}
|
||||
var vao = vb.vao;
|
||||
renderer.bindVao(vao);
|
||||
var vertexBuf = vb.vb;
|
||||
vertexBuf.bind();
|
||||
var vertices = rectsCount * shader.vertPerQuad;
|
||||
if (vertices === 0)
|
||||
return;
|
||||
if (this.modificationMarker != vertices) {
|
||||
this.modificationMarker = vertices;
|
||||
var vs = shader.stride * vertices;
|
||||
if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {
|
||||
var bk = shader.stride;
|
||||
while (bk < vs) {
|
||||
bk *= 2;
|
||||
}
|
||||
this.vbBuffer = new ArrayBuffer(bk);
|
||||
this.vbArray = new Float32Array(this.vbBuffer);
|
||||
this.vbInts = new Uint32Array(this.vbBuffer);
|
||||
vertexBuf.upload(this.vbBuffer, 0, true);
|
||||
}
|
||||
var arr = this.vbArray, ints = this.vbInts;
|
||||
var sz = 0;
|
||||
var textureId, shiftU, shiftV;
|
||||
if (useSquare) {
|
||||
for (i = 0; i < points.length; i += 9) {
|
||||
textureId = (points[i + 8] >> 2);
|
||||
shiftU = 1024 * (points[i + 8] & 1);
|
||||
shiftV = 1024 * ((points[i + 8] >> 1) & 1);
|
||||
arr[sz++] = points[i + 2];
|
||||
arr[sz++] = points[i + 3];
|
||||
arr[sz++] = points[i + 0] + shiftU;
|
||||
arr[sz++] = points[i + 1] + shiftV;
|
||||
arr[sz++] = points[i + 4];
|
||||
arr[sz++] = points[i + 6];
|
||||
arr[sz++] = points[i + 7];
|
||||
arr[sz++] = textureId;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var tint = -1;
|
||||
for (i = 0; i < points.length; i += 9) {
|
||||
var eps = 0.5;
|
||||
textureId = (points[i + 8] >> 2);
|
||||
shiftU = 1024 * (points[i + 8] & 1);
|
||||
shiftV = 1024 * ((points[i + 8] >> 1) & 1);
|
||||
var x = points[i + 2], y = points[i + 3];
|
||||
var w = points[i + 4], h = points[i + 5];
|
||||
var u = points[i] + shiftU, v = points[i + 1] + shiftV;
|
||||
var animX = points[i + 6], animY = points[i + 7];
|
||||
arr[sz++] = x;
|
||||
arr[sz++] = y;
|
||||
arr[sz++] = u;
|
||||
arr[sz++] = v;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animX;
|
||||
arr[sz++] = animY;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x + w;
|
||||
arr[sz++] = y;
|
||||
arr[sz++] = u + w;
|
||||
arr[sz++] = v;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animX;
|
||||
arr[sz++] = animY;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x + w;
|
||||
arr[sz++] = y + h;
|
||||
arr[sz++] = u + w;
|
||||
arr[sz++] = v + h;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animX;
|
||||
arr[sz++] = animY;
|
||||
arr[sz++] = textureId;
|
||||
arr[sz++] = x;
|
||||
arr[sz++] = y + h;
|
||||
arr[sz++] = u;
|
||||
arr[sz++] = v + h;
|
||||
arr[sz++] = u + eps;
|
||||
arr[sz++] = v + eps;
|
||||
arr[sz++] = u + w - eps;
|
||||
arr[sz++] = v + h - eps;
|
||||
arr[sz++] = animX;
|
||||
arr[sz++] = animY;
|
||||
arr[sz++] = textureId;
|
||||
}
|
||||
}
|
||||
vertexBuf.upload(arr, 0, true);
|
||||
}
|
||||
if (useSquare)
|
||||
gl.drawArrays(gl.POINTS, 0, vertices);
|
||||
else
|
||||
gl.drawElements(gl.TRIANGLES, rectsCount * 6, gl.UNSIGNED_SHORT, 0);
|
||||
};
|
||||
return RectTileLayer;
|
||||
}(PIXI.Container));
|
||||
tilemap.RectTileLayer = RectTileLayer;
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var rectShaderFrag = "varying vec2 vTextureCoord;\nvarying vec4 vFrame;\nvarying float vTextureId;\nuniform vec4 shadowColor;\nuniform sampler2D uSamplers[%count%];\nuniform vec2 uSamplerSize[%count%];\n\nvoid main(void){\n vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);\n float textureId = floor(vTextureId + 0.5);\n\n vec4 color;\n %forloop%\n gl_FragColor = color;\n}";
|
||||
var rectShaderVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aFrame;\nattribute vec2 aAnim;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform vec2 animationFrame;\n\nvarying vec2 vTextureCoord;\nvarying float vTextureId;\nvarying vec4 vFrame;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vec2 anim = aAnim * animationFrame;\n vTextureCoord = aTextureCoord + anim;\n vFrame = aFrame + vec4(anim, anim);\n vTextureId = aTextureId;\n}\n";
|
||||
var TilemapShader = (function (_super) {
|
||||
__extends(TilemapShader, _super);
|
||||
function TilemapShader(gl, maxTextures, shaderVert, shaderFrag) {
|
||||
var _this = _super.call(this, gl, shaderVert, shaderFrag) || this;
|
||||
_this.maxTextures = 0;
|
||||
_this.maxTextures = maxTextures;
|
||||
tilemap.shaderGenerator.fillSamplers(_this, _this.maxTextures);
|
||||
return _this;
|
||||
}
|
||||
return TilemapShader;
|
||||
}(PIXI.Shader));
|
||||
tilemap.TilemapShader = TilemapShader;
|
||||
var RectTileShader = (function (_super) {
|
||||
__extends(RectTileShader, _super);
|
||||
function RectTileShader(gl, maxTextures) {
|
||||
var _this = _super.call(this, gl, maxTextures, rectShaderVert, tilemap.shaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag)) || this;
|
||||
_this.vertSize = 11;
|
||||
_this.vertPerQuad = 4;
|
||||
_this.stride = _this.vertSize * 4;
|
||||
tilemap.shaderGenerator.fillSamplers(_this, _this.maxTextures);
|
||||
return _this;
|
||||
}
|
||||
RectTileShader.prototype.createVao = function (renderer, vb) {
|
||||
var gl = renderer.gl;
|
||||
return renderer.createVao()
|
||||
.addIndex(this.indexBuffer)
|
||||
.addAttribute(vb, this.attributes.aVertexPosition, gl.FLOAT, false, this.stride, 0)
|
||||
.addAttribute(vb, this.attributes.aTextureCoord, gl.FLOAT, false, this.stride, 2 * 4)
|
||||
.addAttribute(vb, this.attributes.aFrame, gl.FLOAT, false, this.stride, 4 * 4)
|
||||
.addAttribute(vb, this.attributes.aAnim, gl.FLOAT, false, this.stride, 8 * 4)
|
||||
.addAttribute(vb, this.attributes.aTextureId, gl.FLOAT, false, this.stride, 10 * 4);
|
||||
};
|
||||
return RectTileShader;
|
||||
}(TilemapShader));
|
||||
tilemap.RectTileShader = RectTileShader;
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var shaderGenerator;
|
||||
(function (shaderGenerator) {
|
||||
function fillSamplers(shader, maxTextures) {
|
||||
var sampleValues = [];
|
||||
for (var i = 0; i < maxTextures; i++) {
|
||||
sampleValues[i] = i;
|
||||
}
|
||||
shader.bind();
|
||||
shader.uniforms.uSamplers = sampleValues;
|
||||
var samplerSize = [];
|
||||
for (i = 0; i < maxTextures; i++) {
|
||||
samplerSize.push(1.0 / 2048);
|
||||
samplerSize.push(1.0 / 2048);
|
||||
}
|
||||
shader.uniforms.uSamplerSize = samplerSize;
|
||||
}
|
||||
shaderGenerator.fillSamplers = fillSamplers;
|
||||
function generateFragmentSrc(maxTextures, fragmentSrc) {
|
||||
return fragmentSrc.replace(/%count%/gi, maxTextures + "")
|
||||
.replace(/%forloop%/gi, this.generateSampleSrc(maxTextures));
|
||||
}
|
||||
shaderGenerator.generateFragmentSrc = generateFragmentSrc;
|
||||
function generateSampleSrc(maxTextures) {
|
||||
var src = '';
|
||||
src += '\n';
|
||||
src += '\n';
|
||||
src += 'if(vTextureId <= -1.0) {';
|
||||
src += '\n\tcolor = shadowColor;';
|
||||
src += '\n}';
|
||||
for (var 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;
|
||||
}
|
||||
shaderGenerator.generateSampleSrc = generateSampleSrc;
|
||||
})(shaderGenerator = tilemap.shaderGenerator || (tilemap.shaderGenerator = {}));
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var squareShaderVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aAnim;\nattribute float aTextureId;\nattribute float aSize;\n\nuniform mat3 projectionMatrix;\nuniform vec2 samplerSize;\nuniform vec2 animationFrame;\nuniform float projectionScale;\n\nvarying vec2 vTextureCoord;\nvarying float vSize;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition + aSize * 0.5, 1.0)).xy, 0.0, 1.0);\n gl_PointSize = aSize * projectionScale;\n vTextureCoord = aTextureCoord + aAnim * animationFrame;\n vTextureId = aTextureId;\n vSize = aSize;\n}\n";
|
||||
var squareShaderFrag = "\nvarying vec2 vTextureCoord;\nvarying float vSize;\nvarying float vTextureId;\n\nuniform vec4 shadowColor;\nuniform sampler2D uSamplers[%count%];\nuniform vec2 uSamplerSize[%count%];\nuniform vec2 pointScale;\n\nvoid main(void){\n float margin = 0.5 / vSize;\n vec2 pointCoord = (gl_PointCoord - 0.5) * pointScale + 0.5;\n vec2 clamped = vec2(clamp(pointCoord.x, margin, 1.0 - margin), clamp(pointCoord.y, margin, 1.0 - margin));\n vec2 textureCoord = pointCoord * vSize + vTextureCoord;\n float textureId = vTextureId;\n vec4 color;\n %forloop%\n gl_FragColor = color;\n}\n\n";
|
||||
var SquareTileShader = (function (_super) {
|
||||
__extends(SquareTileShader, _super);
|
||||
function SquareTileShader(gl, maxTextures) {
|
||||
var _this = _super.call(this, gl, maxTextures, squareShaderVert, tilemap.shaderGenerator.generateFragmentSrc(maxTextures, squareShaderFrag)) || this;
|
||||
_this.vertSize = 8;
|
||||
_this.vertPerQuad = 1;
|
||||
_this.stride = _this.vertSize * 4;
|
||||
_this.maxTextures = maxTextures;
|
||||
tilemap.shaderGenerator.fillSamplers(_this, _this.maxTextures);
|
||||
return _this;
|
||||
}
|
||||
SquareTileShader.prototype.createVao = function (renderer, vb) {
|
||||
var gl = renderer.gl;
|
||||
return renderer.createVao()
|
||||
.addIndex(this.indexBuffer)
|
||||
.addAttribute(vb, this.attributes.aVertexPosition, gl.FLOAT, false, this.stride, 0)
|
||||
.addAttribute(vb, this.attributes.aTextureCoord, gl.FLOAT, false, this.stride, 2 * 4)
|
||||
.addAttribute(vb, this.attributes.aSize, gl.FLOAT, false, this.stride, 4 * 4)
|
||||
.addAttribute(vb, this.attributes.aAnim, gl.FLOAT, false, this.stride, 5 * 4)
|
||||
.addAttribute(vb, this.attributes.aTextureId, gl.FLOAT, false, this.stride, 7 * 4);
|
||||
};
|
||||
;
|
||||
return SquareTileShader;
|
||||
}(tilemap.TilemapShader));
|
||||
tilemap.SquareTileShader = SquareTileShader;
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap) {
|
||||
var glCore = PIXI.glCore;
|
||||
function _hackSubImage(tex, sprite, clearBuffer, clearWidth, clearHeight) {
|
||||
var gl = tex.gl;
|
||||
var baseTex = sprite.texture.baseTexture;
|
||||
if (clearBuffer && clearWidth > 0 && clearHeight > 0) {
|
||||
gl.texSubImage2D(gl.TEXTURE_2D, 0, sprite.position.x, sprite.position.y, clearWidth, clearHeight, tex.format, tex.type, clearBuffer);
|
||||
}
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
|
||||
gl.texSubImage2D(gl.TEXTURE_2D, 0, sprite.position.x, sprite.position.y, tex.format, tex.type, baseTex.source);
|
||||
}
|
||||
var TileRenderer = (function (_super) {
|
||||
__extends(TileRenderer, _super);
|
||||
function TileRenderer(renderer) {
|
||||
var _this = _super.call(this, renderer) || this;
|
||||
_this.vbs = {};
|
||||
_this.indices = new Uint16Array(0);
|
||||
_this.lastTimeCheck = 0;
|
||||
_this.tileAnim = [0, 0];
|
||||
_this.maxTextures = 4;
|
||||
_this.texLoc = [];
|
||||
return _this;
|
||||
}
|
||||
TileRenderer.prototype.onContextChange = function () {
|
||||
var gl = this.renderer.gl;
|
||||
var maxTextures = this.maxTextures;
|
||||
this.rectShader = new tilemap.RectTileShader(gl, maxTextures);
|
||||
this.squareShader = new tilemap.SquareTileShader(gl, maxTextures);
|
||||
this.checkIndexBuffer(2000);
|
||||
this.rectShader.indexBuffer = this.indexBuffer;
|
||||
this.squareShader.indexBuffer = this.indexBuffer;
|
||||
this.vbs = {};
|
||||
this.glTextures = [];
|
||||
this.boundSprites = [];
|
||||
this.initBounds();
|
||||
};
|
||||
TileRenderer.prototype.initBounds = function () {
|
||||
var gl = this.renderer.gl;
|
||||
var tempCanvas = document.createElement('canvas');
|
||||
tempCanvas.width = 2048;
|
||||
tempCanvas.height = 2048;
|
||||
for (var i = 0; i < this.maxTextures; i++) {
|
||||
var rt = PIXI.RenderTexture.create(2048, 2048);
|
||||
rt.baseTexture.premultipliedAlpha = true;
|
||||
rt.baseTexture.scaleMode = TileRenderer.SCALE_MODE;
|
||||
rt.baseTexture.wrapMode = PIXI.WRAP_MODES.CLAMP;
|
||||
this.renderer.textureManager.updateTexture(rt);
|
||||
this.glTextures.push(rt);
|
||||
var bs = [];
|
||||
for (var j = 0; j < 4; j++) {
|
||||
var spr = new PIXI.Sprite();
|
||||
spr.position.x = 1024 * (j & 1);
|
||||
spr.position.y = 1024 * (j >> 1);
|
||||
bs.push(spr);
|
||||
}
|
||||
this.boundSprites.push(bs);
|
||||
}
|
||||
};
|
||||
TileRenderer.prototype.bindTextures = function (renderer, shader, textures) {
|
||||
var bounds = this.boundSprites;
|
||||
var glts = this.glTextures;
|
||||
var len = textures.length;
|
||||
var maxTextures = this.maxTextures;
|
||||
if (len > 4 * maxTextures) {
|
||||
return;
|
||||
}
|
||||
var doClear = TileRenderer.DO_CLEAR;
|
||||
if (doClear && !this._clearBuffer) {
|
||||
this._clearBuffer = new Uint8Array(1024 * 1024 * 4);
|
||||
}
|
||||
var i;
|
||||
for (i = 0; i < len; i++) {
|
||||
var texture = textures[i];
|
||||
if (!texture || !textures[i].valid)
|
||||
continue;
|
||||
var bs = bounds[i >> 2][i & 3];
|
||||
if (!bs.texture ||
|
||||
bs.texture.baseTexture !== texture.baseTexture) {
|
||||
bs.texture = texture;
|
||||
var glt = glts[i >> 2];
|
||||
renderer.bindTexture(glt, 0, true);
|
||||
if (doClear) {
|
||||
_hackSubImage(glt.baseTexture._glTextures[renderer.CONTEXT_UID], bs, this._clearBuffer, 1024, 1024);
|
||||
}
|
||||
else {
|
||||
_hackSubImage(glt.baseTexture._glTextures[renderer.CONTEXT_UID], bs);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.texLoc.length = 0;
|
||||
for (i = 0; i < maxTextures; i++) {
|
||||
this.texLoc.push(renderer.bindTexture(glts[i], i, true));
|
||||
}
|
||||
shader.uniforms.uSamplers = this.texLoc;
|
||||
};
|
||||
TileRenderer.prototype.checkLeaks = function () {
|
||||
var now = Date.now();
|
||||
var old = now - 10000;
|
||||
if (this.lastTimeCheck < old ||
|
||||
this.lastTimeCheck > now) {
|
||||
this.lastTimeCheck = now;
|
||||
var vbs = this.vbs;
|
||||
for (var key in vbs) {
|
||||
if (vbs[key].lastTimeAccess < old) {
|
||||
this.removeVb(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
;
|
||||
TileRenderer.prototype.start = function () {
|
||||
this.renderer.state.setBlendMode(PIXI.BLEND_MODES.NORMAL);
|
||||
};
|
||||
TileRenderer.prototype.getVb = function (id) {
|
||||
this.checkLeaks();
|
||||
var vb = this.vbs[id];
|
||||
if (vb) {
|
||||
vb.lastTimeAccess = Date.now();
|
||||
return vb;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
TileRenderer.prototype.createVb = function (useSquare) {
|
||||
var id = ++TileRenderer.vbAutoincrement;
|
||||
var shader = this.getShader(useSquare);
|
||||
var gl = this.renderer.gl;
|
||||
var vb = PIXI.glCore.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);
|
||||
var stuff = {
|
||||
id: id,
|
||||
vb: vb,
|
||||
vao: shader.createVao(this.renderer, vb),
|
||||
lastTimeAccess: Date.now(),
|
||||
useSquare: useSquare,
|
||||
shader: shader
|
||||
};
|
||||
this.vbs[id] = stuff;
|
||||
return stuff;
|
||||
};
|
||||
TileRenderer.prototype.removeVb = function (id) {
|
||||
if (this.vbs[id]) {
|
||||
this.vbs[id].vb.destroy();
|
||||
this.vbs[id].vao.destroy();
|
||||
delete this.vbs[id];
|
||||
}
|
||||
};
|
||||
TileRenderer.prototype.checkIndexBuffer = function (size) {
|
||||
var totalIndices = size * 6;
|
||||
var indices = this.indices;
|
||||
if (totalIndices <= indices.length) {
|
||||
return;
|
||||
}
|
||||
var len = indices.length || totalIndices;
|
||||
while (len < totalIndices) {
|
||||
len <<= 1;
|
||||
}
|
||||
indices = new Uint16Array(len);
|
||||
this.indices = indices;
|
||||
for (var i = 0, j = 0; i + 5 < indices.length; i += 6, j += 4) {
|
||||
indices[i + 0] = j + 0;
|
||||
indices[i + 1] = j + 1;
|
||||
indices[i + 2] = j + 2;
|
||||
indices[i + 3] = j + 0;
|
||||
indices[i + 4] = j + 2;
|
||||
indices[i + 5] = j + 3;
|
||||
}
|
||||
if (this.indexBuffer) {
|
||||
this.indexBuffer.upload(indices);
|
||||
}
|
||||
else {
|
||||
var gl = this.renderer.gl;
|
||||
this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);
|
||||
}
|
||||
};
|
||||
TileRenderer.prototype.getShader = function (useSquare) {
|
||||
return useSquare ? this.squareShader : this.rectShader;
|
||||
};
|
||||
TileRenderer.prototype.destroy = function () {
|
||||
_super.prototype.destroy.call(this);
|
||||
this.rectShader.destroy();
|
||||
this.squareShader.destroy();
|
||||
this.rectShader = null;
|
||||
this.squareShader = null;
|
||||
};
|
||||
;
|
||||
return TileRenderer;
|
||||
}(PIXI.ObjectRenderer));
|
||||
TileRenderer.vbAutoincrement = 0;
|
||||
TileRenderer.SCALE_MODE = PIXI.SCALE_MODES.LINEAR;
|
||||
TileRenderer.DO_CLEAR = false;
|
||||
tilemap.TileRenderer = TileRenderer;
|
||||
PIXI.WebGLRenderer.registerPlugin('tilemap', TileRenderer);
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var tilemap;
|
||||
(function (tilemap_1) {
|
||||
var ZLayer = (function (_super) {
|
||||
__extends(ZLayer, _super);
|
||||
function ZLayer(tilemap, zIndex) {
|
||||
var _this = _super.call(this) || this;
|
||||
_this._lastAnimationFrame = -1;
|
||||
_this.tilemap = tilemap;
|
||||
_this.z = zIndex;
|
||||
return _this;
|
||||
}
|
||||
ZLayer.prototype.clear = function () {
|
||||
var layers = this.children;
|
||||
for (var i = 0; i < layers.length; i++)
|
||||
layers[i].clear();
|
||||
this._previousLayers = 0;
|
||||
};
|
||||
ZLayer.prototype.cacheIfDirty = function () {
|
||||
var tilemap = this.tilemap;
|
||||
var layers = this.children;
|
||||
var modified = this._previousLayers != layers.length;
|
||||
this._previousLayers = layers.length;
|
||||
var buf = this.canvasBuffer;
|
||||
var tempRender = this._tempRender;
|
||||
if (!buf) {
|
||||
buf = this.canvasBuffer = document.createElement('canvas');
|
||||
tempRender = this._tempRender = new PIXI.CanvasRenderer(100, 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;
|
||||
}
|
||||
var 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;
|
||||
}
|
||||
};
|
||||
;
|
||||
ZLayer.prototype.renderCanvas = function (renderer) {
|
||||
this.cacheIfDirty();
|
||||
var wt = this.layerTransform;
|
||||
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
|
||||
var tilemap = this.tilemap;
|
||||
renderer.context.drawImage(this.canvasBuffer, 0, 0);
|
||||
};
|
||||
;
|
||||
return ZLayer;
|
||||
}(PIXI.Container));
|
||||
tilemap_1.ZLayer = ZLayer;
|
||||
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
|
||||
})(PIXI || (PIXI = {}));
|
||||
//# sourceMappingURL=pixi-tilemap.js.map
|
41929
www.rus/js/libs/pixi.js
41929
www.rus/js/libs/pixi.js
File diff suppressed because it is too large
Load diff
6
www.rus/js/libs/trmix.min.js
vendored
6
www.rus/js/libs/trmix.min.js
vendored
|
@ -1,6 +0,0 @@
|
|||
/* 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);}());
|
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
|||
//=============================================================================
|
||||
// main.js
|
||||
//=============================================================================
|
||||
|
||||
PluginManager.setup($plugins);
|
||||
|
||||
window.onload = function() {
|
||||
SceneManager.run(Scene_Boot);
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc ------------------------------------------------------------
|
||||
* @author Yanfly Engine Plugins
|
||||
*/
|
||||
//=============================================================================
|
|
@ -1,100 +0,0 @@
|
|||
/*=============================================================================
|
||||
* 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;
|
||||
}
|
||||
};
|
|
@ -1,708 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
};
|
|
@ -1,772 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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();
|
||||
};
|
|
@ -1,35 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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) }
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,250 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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.glCore.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 {
|
||||
|
||||
// }
|
||||
// };
|
|
@ -1,250 +0,0 @@
|
|||
/*=============================================================================
|
||||
* 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;
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
@ -1,496 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
};
|
File diff suppressed because it is too large
Load diff
|
@ -1,402 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,447 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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();
|
||||
};
|
|
@ -1,266 +0,0 @@
|
|||
/*:
|
||||
* @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);
|
||||
})();
|
|
@ -1,358 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
}
|
||||
};
|
|
@ -1,154 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
};
|
|
@ -1,366 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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)
|
||||
|
||||
// }
|
|
@ -1,665 +0,0 @@
|
|||
// ╒══════════════════════════════════════════════════════════════════════════════════╕
|
||||
// █▐▐ 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 █████████████████████████████████████▐▐
|
|
@ -1,96 +0,0 @@
|
|||
"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);
|
||||
};
|
|
@ -1,348 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,318 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
};
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -1,28 +0,0 @@
|
|||
/*:
|
||||
* @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);
|
|
@ -1,182 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
// };
|
|
@ -1,38 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
};
|
||||
|
||||
})()
|
|
@ -1,278 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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;
|
||||
ONSControls.initialize();
|
||||
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') || TouchInput.isTriggered()) {
|
||||
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;
|
||||
}
|
||||
};
|
||||
})();
|
|
@ -1,264 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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;
|
||||
};
|
||||
})();
|
|
@ -1,568 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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;
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,271 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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);
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,193 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
|
@ -1,578 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,468 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,374 +0,0 @@
|
|||
/*:
|
||||
-------------------------------------------------------------------------
|
||||
@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);
|
|
@ -1,32 +0,0 @@
|
|||
/*:
|
||||
* @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);
|
||||
}
|
||||
};
|
|
@ -1,178 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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();
|
||||
};
|
|
@ -1,355 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
};
|
|
@ -1,638 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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;
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
/*=============================================================================
|
||||
* 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;
|
||||
};
|
|
@ -1,125 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
};
|
||||
}
|
||||
})();
|
File diff suppressed because one or more lines are too long
|
@ -1,438 +0,0 @@
|
|||
//=============================================================================
|
||||
// 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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,494 +0,0 @@
|
|||
//=============================================================================
|
||||
// Olivia Engine - Skip Cutscene - for RPG Maker MV version 1.6.1
|
||||
// Olivia_SkipCutscene.js
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc <SkipCutscene> for RPG Maker MV version 1.6.1.
|
||||
* @author Fallen Angel Olivia
|
||||
*
|
||||
* @help
|
||||
* This is a RPG Maker MV plugin that provides the functionality to skip ahead
|
||||
* in a cutscene. This is a quality of life addition for players that may have
|
||||
* played a certain scene already and would like to skip ahead. The player would
|
||||
* hold the cancel button (X on the keyboard or Right Click on the mouse) if the
|
||||
* ability to skip the cutscene is available. By holding it until the skip gauge
|
||||
* is full, the scene skips forward to the next available section.
|
||||
*
|
||||
*
|
||||
*
|
||||
* -----------------
|
||||
* Plugin Parameters
|
||||
* -----------------
|
||||
*
|
||||
* Hold Duration: Duration in frames to hold Cancel button to skip a cutscene
|
||||
*
|
||||
* Filling Speed: Speed used while filling up the skip gauge
|
||||
*
|
||||
* Emptying Speed: Speed used while emptying out the skip gauge
|
||||
*
|
||||
* Skip Text: Text displayed for the skip gauge. You can use text codes here.
|
||||
*
|
||||
* Gauge Colors: Gauge colors used for the gradients. These use hex color codes.
|
||||
*
|
||||
* Gauge Position: X and Y positions for where the gauge would appear. You can
|
||||
* use 'auto' to have the plugin automatically calculate it for you, or you can
|
||||
* use JS code to determine the position yourself. Exact numbers are also fine.
|
||||
*
|
||||
* Fade Speed: How fast the skip gauge would fade out.
|
||||
*
|
||||
*
|
||||
*
|
||||
* ------------------------
|
||||
* Instructions: Label Tags
|
||||
* ------------------------
|
||||
*
|
||||
* Not all scenes are skippable from the start. They need to be set up in a
|
||||
* certain way for it to properly work. The setup involves Labels and require a
|
||||
* specific naming convention for the labels to allow skipping cutscenes.
|
||||
*
|
||||
* Label Tags:
|
||||
*
|
||||
* <Enable Skip>
|
||||
* - Once the scene has passed a label named <Enable Skip> the player will be
|
||||
* able to hold down the Cancel Button (X on the keyboard or Right Click on the
|
||||
* mouse) and skip forward to the next available <Skip Target> Label.
|
||||
*
|
||||
* <Disable Skip>
|
||||
* - If the scene has passed a label named <Disable Skip> then skipping the
|
||||
* cutscene will no longer become available for the player.
|
||||
*
|
||||
* <Skip Target>
|
||||
* - If the player decides to skip forward, then the screen will fade out. After
|
||||
* that, the scene will skip to the next available <Skip Target> label. You will
|
||||
* have to manually fade the screen back in afterwards.
|
||||
*
|
||||
* These labels cannot be used in tandem with parallel events. Parallel events
|
||||
* cannot have cutscene skipping capability.
|
||||
*
|
||||
*
|
||||
*
|
||||
* --------
|
||||
* Examples
|
||||
* --------
|
||||
*
|
||||
* I highly recommend that you take a look at the sample project that could be
|
||||
* downloaded with this plugin on how to use it. It will teach you many core
|
||||
* basics on how to properly create your cutscene events to be usable with the
|
||||
* Skip Cutscene function.
|
||||
*
|
||||
*
|
||||
*
|
||||
* -------------------
|
||||
* 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 Hold Duration
|
||||
* @type number
|
||||
* @min 1
|
||||
* @desc Duration in frames to hold Cancel button to skip a cutscene
|
||||
* @default 180
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Filling Speed
|
||||
* @type number
|
||||
* @min 1
|
||||
* @desc Speed used while filling up the skip gauge
|
||||
* @default 1
|
||||
*
|
||||
* @param Emptying Speed
|
||||
* @type number
|
||||
* @min 1
|
||||
* @desc Speed used while emptying out the skip gauge
|
||||
* @default 4
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Skip Text
|
||||
* @desc Text displayed for the skip gauge. You can use text codes here.
|
||||
* @default Hold \c[27]X\c[0] to skip cutscene
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Gauge Color 1
|
||||
* @desc Gauge color used for the left half of the gauge gradient
|
||||
* This is a hex color code
|
||||
* @default #8781bd
|
||||
*
|
||||
* @param Gauge Color 2
|
||||
* @desc Gauge color used for the right half of the gauge gradient
|
||||
* This is a hex color code
|
||||
* @default #bd8cbf
|
||||
*
|
||||
* @param Gauge Position X
|
||||
* @desc X position for the gauge.
|
||||
* Use 'auto' if you want the plugin to automatically calculate the position X. Otherwise, it will use code to calculate the position.
|
||||
* @default auto
|
||||
*
|
||||
* @param Gauge Position Y
|
||||
* @desc Y position for the gauge.
|
||||
* Use 'auto' if you want the plugin to automatically calculate the position Y. Otherwise, it will use code to calculate the position.
|
||||
* @default auto
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @param Fade Speed
|
||||
* @type number
|
||||
* @min 1
|
||||
* @desc How fast you wish for the skip gauge to fade out
|
||||
* @default 24
|
||||
*
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported.Olivia_SkipCutscene = true;
|
||||
|
||||
var Olivia = Olivia || {};
|
||||
|
||||
var parameters = $plugins.filter(function(p) { return p.description.contains('<SkipCutscene>') })[0].parameters;
|
||||
|
||||
Olivia.SkipCutscene = {
|
||||
holdDuration: Number(parameters['Hold Duration']),
|
||||
|
||||
increaseSpeed: Number(parameters['Filling Speed']),
|
||||
decreaseSpeed: Number(parameters['Emptying Speed']),
|
||||
|
||||
message: String(parameters['Skip Text']),
|
||||
|
||||
gaugeColor1: String(parameters['Gauge Color 1']),
|
||||
gaugeColor2: String(parameters['Gauge Color 2']),
|
||||
gaugePositionX: String(parameters['Gauge Position X']),
|
||||
gaugePositionY: String(parameters['Gauge Position Y']),
|
||||
|
||||
fadeSpeed: Number(parameters['Fade Speed']),
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Game_Interpreter
|
||||
//
|
||||
// The interpreter for running event commands.
|
||||
|
||||
Olivia.SkipCutscene.___Game_Interpreter_setup___ = Game_Interpreter.prototype.setup;
|
||||
Game_Interpreter.prototype.setup = function(list, eventId) {
|
||||
if (!$gameParty.inBattle() && this._depth === 0) {
|
||||
if (!!eventId && !!$gameMap.event(eventId) && $gameMap.event(eventId)._trigger !== 4) {
|
||||
$gameTemp._canSkipCutscene = false;
|
||||
$gameTemp._skippingCutscene = false;
|
||||
SceneManager._scene._skipCutsceneDuration = 0;
|
||||
}
|
||||
}
|
||||
Olivia.SkipCutscene.___Game_Interpreter_setup___.call(this, list, eventId);
|
||||
};
|
||||
|
||||
Olivia.SkipCutscene.___Game_Interpreter_terminate___ = Game_Interpreter.prototype.terminate;
|
||||
Game_Interpreter.prototype.terminate = function() {
|
||||
if (!$gameParty.inBattle() && this._depth === 0) {
|
||||
if (!!this._eventId && !!$gameMap.event(this._eventId) && $gameMap.event(this._eventId)._trigger !== 4) {
|
||||
$gameTemp._canSkipCutscene = undefined;
|
||||
$gameTemp._skippingCutscene = undefined;
|
||||
SceneManager._scene._skipCutsceneDuration = 0;
|
||||
}
|
||||
}
|
||||
Olivia.SkipCutscene.___Game_Interpreter_terminate___.call(this);
|
||||
};
|
||||
|
||||
Olivia.SkipCutscene.___Game_Interpreter_command118___ = Game_Interpreter.prototype.command118;
|
||||
Game_Interpreter.prototype.command118 = function() {
|
||||
if (this._params[0].match(/<Enable Skip>/i)) {
|
||||
$gameTemp._canSkipCutscene = true;
|
||||
$gameTemp._skippingCutscene = false;
|
||||
} else if (this._params[0].match(/<Disable Skip>/i)) {
|
||||
$gameTemp._canSkipCutscene = false;
|
||||
$gameTemp._skippingCutscene = false;
|
||||
} else if (this._params[0].match(/<Skip Target>/i)) {
|
||||
$gameTemp._canSkipCutscene = false;
|
||||
$gameTemp._skippingCutscene = false;
|
||||
}
|
||||
return Olivia.SkipCutscene.___Game_Interpreter_command118___.call(this);
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.processSkipCutscene = function() {
|
||||
var interpreter = this.getLatestInterpreter();
|
||||
if (!!interpreter._list) {
|
||||
for (var i = interpreter._index; i < interpreter._list.length; i++) {
|
||||
var command = interpreter._list[i];
|
||||
if (command.code === 118 && command.parameters[0].match(/<Skip Target>/i)) {
|
||||
interpreter.stopSkipCutscene(interpreter, i, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (interpreter === this) {
|
||||
interpreter.stopSkipCutscene(interpreter, this._list.length - 1, false);
|
||||
} else {
|
||||
interpreter.terminate();
|
||||
this.processSkipCutscene();
|
||||
}
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.getLatestInterpreter = function() {
|
||||
var interpreter = this;
|
||||
while (!!interpreter._childInterpreter && !!interpreter._childInterpreter._list) {
|
||||
interpreter = interpreter._childInterpreter;
|
||||
}
|
||||
return interpreter;
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.stopSkipCutscene = function(interpreter, targetLine, foundTarget) {
|
||||
interpreter._waitMode = '';
|
||||
interpreter.wait(interpreter.fadeSpeed());
|
||||
$gameScreen.startFadeOut(interpreter.fadeSpeed());
|
||||
if (interpreter === this) {
|
||||
$gameTemp._canSkipCutscene = false;
|
||||
$gameTemp._skippingCutscene = true;
|
||||
}
|
||||
SceneManager._scene._skipCutsceneDuration = 0;
|
||||
interpreter.jumpTo(targetLine);
|
||||
if (!foundTarget) {
|
||||
$gameScreen.startFadeIn(interpreter.fadeSpeed());
|
||||
if ($gameTemp.isPlaytest()) {
|
||||
alert('You do not have a <Skip Target> Label Tag for this event!\nAdd the <Skip Target> Label to your event to make Skip Cutscene work properly.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_Message
|
||||
//
|
||||
// The window for displaying text messages.
|
||||
|
||||
Olivia.SkipCutscene.___Scene_Map_updateMainMultiply___ = Scene_Map.prototype.updateMainMultiply;
|
||||
Scene_Map.prototype.updateMainMultiply = function() {
|
||||
Olivia.SkipCutscene.___Scene_Map_updateMainMultiply___.call(this);
|
||||
if (!!$gameTemp._canSkipCutscene) {
|
||||
this.updateSkipCutscene();
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Map.prototype.isSkipCutscene = function() {
|
||||
return ($gameMap.isEventRunning() && !SceneManager.isSceneChanging() && Input.isLongPressed('cancel'));
|
||||
};
|
||||
|
||||
Scene_Map.prototype.updateSkipCutscene = function() {
|
||||
this._skipCutsceneDuration = this._skipCutsceneDuration || 0;
|
||||
if (this.isSkipCutscene()) {
|
||||
this._skipCutsceneDuration += Olivia.SkipCutscene.increaseSpeed;
|
||||
if (this._skipCutsceneDuration >= Olivia.SkipCutscene.holdDuration) {
|
||||
this.processSkipCutscene();
|
||||
}
|
||||
} else {
|
||||
this._skipCutsceneDuration = Math.max(0, this._skipCutsceneDuration - Olivia.SkipCutscene.decreaseSpeed);
|
||||
}
|
||||
};
|
||||
|
||||
Scene_Map.prototype.processSkipCutscene = function() {
|
||||
// Switch check to see if skip cutscene was processed.
|
||||
$gameSwitches.setValue(40, true);
|
||||
$gameMap._interpreter.processSkipCutscene();
|
||||
};
|
||||
|
||||
Olivia.SkipCutscene.___Scene_Map_createAllWindows___ = Scene_Map.prototype.createAllWindows;
|
||||
Scene_Map.prototype.createAllWindows = function() {
|
||||
Olivia.SkipCutscene.___Scene_Map_createAllWindows___.call(this);
|
||||
this._skipCutsceneWindow = new Window_SkipCutscene();
|
||||
this.addChild(this._skipCutsceneWindow);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_Selectable
|
||||
//
|
||||
// The window for displaying text messages.
|
||||
|
||||
Olivia.SkipCutscene.___Window_Selectable_isOkTriggered___ = Window_Selectable.prototype.isOkTriggered;
|
||||
Window_Selectable.prototype.isOkTriggered = function() {
|
||||
if (!!$gameTemp._skippingCutscene) {
|
||||
return true;
|
||||
} else {
|
||||
return Olivia.SkipCutscene.___Window_Selectable_isOkTriggered___.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_Message
|
||||
//
|
||||
// The window for displaying text messages.
|
||||
|
||||
Olivia.SkipCutscene.___Window_Message_isTriggered___ = Window_Message.prototype.isTriggered;
|
||||
Window_Message.prototype.isTriggered = function() {
|
||||
if (!!$gameTemp._skippingCutscene) {
|
||||
return true;
|
||||
} else if (!!$gameTemp._canSkipCutscene && Input.isRepeated('cancel')) {
|
||||
return false;
|
||||
} else {
|
||||
return Olivia.SkipCutscene.___Window_Message_isTriggered___.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_ChoiceList
|
||||
//
|
||||
// The window used for the event command [Show Choices].
|
||||
|
||||
Olivia.SkipCutscene.___Window_ChoiceList_isOkTriggered___ = Window_ChoiceList.prototype.isOkTriggered;
|
||||
Window_ChoiceList.prototype.isOkTriggered = function() {
|
||||
if (!!$gameTemp._skippingCutscene) {
|
||||
return true;
|
||||
} else {
|
||||
return Olivia.SkipCutscene.___Window_ChoiceList_isOkTriggered___.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_NumberInput
|
||||
//
|
||||
// The window used for the event command [Input Number].
|
||||
|
||||
Olivia.SkipCutscene.___Window_NumberInput_isOkTriggered___ = Window_NumberInput.prototype.isOkTriggered;
|
||||
Window_NumberInput.prototype.isOkTriggered = function() {
|
||||
if (!!$gameTemp._skippingCutscene) {
|
||||
return true;
|
||||
} else {
|
||||
return Olivia.SkipCutscene.___Window_NumberInput_isOkTriggered___.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_SkipCutscene
|
||||
//
|
||||
// The window for displaying the description of the selected item.
|
||||
|
||||
function Window_SkipCutscene() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_SkipCutscene.prototype = Object.create(Window_Base.prototype);
|
||||
Window_SkipCutscene.prototype.constructor = Window_SkipCutscene;
|
||||
|
||||
Window_SkipCutscene.prototype.initialize = function() {
|
||||
var width = Graphics.boxWidth;
|
||||
var height = this.fittingHeight(1);
|
||||
Window_Base.prototype.initialize.call(this, this.textPadding() * 4, 0, width, height);
|
||||
if (Olivia.SkipCutscene.gaugePositionY === 'auto') {
|
||||
this.y = Graphics.boxHeight - 240;
|
||||
} else {
|
||||
this.y = eval(Olivia.SkipCutscene.gaugePositionY);
|
||||
}
|
||||
this.opacity = 0;
|
||||
this.contentsOpacity = 0;
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.standardPadding = function() {
|
||||
return 0;
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.textWidthEx = function(text) {
|
||||
return this.drawTextEx(text, 0, this.contents.height);
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.createChildSprite = function() {
|
||||
var width = this.textWidthEx(Olivia.SkipCutscene.message);
|
||||
width += this.textPadding() * 4;
|
||||
var height = this.lineHeight();
|
||||
this._gaugeSpriteRate = new Sprite();
|
||||
this._gaugeSpriteRate.bitmap = new Bitmap(width - 2, height - 2);
|
||||
var color1 = Olivia.SkipCutscene.gaugeColor1;
|
||||
var color2 = Olivia.SkipCutscene.gaugeColor2;
|
||||
this._gaugeSpriteRate.bitmap.gradientFillRect(0, 0, width - 2, height - 2, color1, color2);
|
||||
this._gaugeSpriteRate.x = 1;
|
||||
this._gaugeSpriteRate.y = 1;
|
||||
this.addChildToBack(this._gaugeSpriteRate);
|
||||
this._gaugeSpriteBack = new Sprite();
|
||||
this._gaugeSpriteBack.bitmap = new Bitmap(width, height);
|
||||
this._gaugeSpriteBack.bitmap.fillRect(0, 0, width, height, this.gaugeBackColor());
|
||||
this.addChildToBack(this._gaugeSpriteBack);
|
||||
if (Olivia.SkipCutscene.gaugePositionX === 'auto') {
|
||||
this.x = Math.round((Graphics.boxWidth - width) / 2);
|
||||
} else {
|
||||
this.x = eval(Olivia.SkipCutscene.gaugePositionX);
|
||||
}
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.refresh = function() {
|
||||
this.drawTextEx(Olivia.SkipCutscene.message, this.textPadding() * 2, 0);
|
||||
this.createChildSprite();
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.update = function() {
|
||||
Window_Base.prototype.update.call(this);
|
||||
this.updateOpacity();
|
||||
if (!!this._gaugeSpriteRate) {
|
||||
this.updateGaugeSprites();
|
||||
}
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.updateOpacity = function() {
|
||||
if (!!$gameTemp._canSkipCutscene && !!SceneManager._scene._skipCutsceneDuration) {
|
||||
var change = Olivia.SkipCutscene.fadeSpeed;
|
||||
} else {
|
||||
var change = -1 * Olivia.SkipCutscene.fadeSpeed;
|
||||
}
|
||||
this.contentsOpacity += change;
|
||||
};
|
||||
|
||||
Window_SkipCutscene.prototype.updateGaugeSprites = function() {
|
||||
this._gaugeSpriteRate.opacity = this.contentsOpacity;
|
||||
this._gaugeSpriteBack.opacity = this.contentsOpacity;
|
||||
if (!!$gameTemp._skippingCutscene) {
|
||||
var rate = 1.0;
|
||||
} else {
|
||||
var rate = SceneManager._scene._skipCutsceneDuration / Olivia.SkipCutscene.holdDuration;
|
||||
}
|
||||
var width = rate * this._gaugeSpriteRate.bitmap.width;
|
||||
this._gaugeSpriteRate.setFrame(0, 0, width, this._gaugeSpriteRate.height);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,707 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Omori Bestiary
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_OmoriBestiary = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.OmoriBestiary = _TDS_.OmoriBestiary || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Bestiary for Omori.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Party
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the party. Information such as gold and items is
|
||||
// included.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.OmoriBestiary.Game_Party_initialize = Game_Party.prototype.initialize;
|
||||
//=============================================================================
|
||||
// * Object Initialize
|
||||
//=============================================================================
|
||||
Game_Party.prototype.initialize = function() {
|
||||
// Run Original Function
|
||||
_TDS_.OmoriBestiary.Game_Party_initialize.call(this);
|
||||
// Create List of Defeated Enemies
|
||||
this._defeatedEnemies = [];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Defeated Enemy
|
||||
//=============================================================================
|
||||
Game_Party.prototype.addDefeatedEnemy = function(id) {
|
||||
// Of Defeated Enemies array does not contain ID
|
||||
if (!this._defeatedEnemies.contains(id)) {
|
||||
// Add ID to defeated enemies array
|
||||
this._defeatedEnemies.push(id);
|
||||
};
|
||||
let allEnemies = Object.keys(LanguageManager.getTextData('Bestiary', 'Information')).map(Number);
|
||||
if(allEnemies.every(enemyId => this._defeatedEnemies.contains(enemyId))) {
|
||||
$gameSystem.unlockAchievement("FOES_FILED"); // Unlock complete bestiary achievement;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Enemy
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for an enemy.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.OmoriBestiary.Game_Enemy_die = Game_Enemy.prototype.die;
|
||||
_TDS_.OmoriBestiary.Game_Enemy_appear = Game_Enemy.prototype.appear;
|
||||
_TDS_.OmoriBestiary.Game_Enemy_onBattleStart = Game_Enemy.prototype.onBattleStart
|
||||
//=============================================================================
|
||||
// * Die
|
||||
//=============================================================================
|
||||
Game_Enemy.prototype.die = function() {
|
||||
// Run Original Fucntion
|
||||
_TDS_.OmoriBestiary.Game_Enemy_die.call(this);
|
||||
// Add Defeated Enemy
|
||||
$gameParty.addDefeatedEnemy(this.baseId());
|
||||
};
|
||||
//=============================================================================
|
||||
// * Appear
|
||||
//=============================================================================
|
||||
Game_Enemy.prototype.appear = function() {
|
||||
// Run Original Function
|
||||
_TDS_.OmoriBestiary.Game_Enemy_appear.call(this);
|
||||
// Add Defeated Enemy
|
||||
$gameParty.addDefeatedEnemy(this.baseId());
|
||||
};
|
||||
//=============================================================================
|
||||
// * On battle start processing
|
||||
//=============================================================================
|
||||
Game_Enemy.prototype.onBattleStart = function() {
|
||||
// Run Original Function
|
||||
_TDS_.OmoriBestiary.Game_Enemy_onBattleStart.call(this);
|
||||
// If enemy has appeared
|
||||
if (this.isAppeared()) {
|
||||
// Add Defeated Enemy
|
||||
$gameParty.addDefeatedEnemy(this.baseId());
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_OmoriBestiary
|
||||
//-----------------------------------------------------------------------------
|
||||
// This scene is used to show the bestiary.
|
||||
//=============================================================================
|
||||
function Scene_OmoriBestiary() { this.initialize.apply(this, arguments);}
|
||||
Scene_OmoriBestiary.prototype = Object.create(Scene_BaseEX.prototype);
|
||||
Scene_OmoriBestiary.prototype.constructor = Scene_OmoriBestiary;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.initialize = function() {
|
||||
// Set Image reservation id
|
||||
this._imageReservationId = 'bestiary';
|
||||
// Create Enemy Object
|
||||
this._enemy = new Game_Enemy(1, 0, 0);
|
||||
// Super Call
|
||||
Scene_BaseEX.prototype.initialize.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Lists
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.initAtlastLists = function() {
|
||||
// Super Call
|
||||
Scene_BaseEX.prototype.initAtlastLists.call(this);
|
||||
|
||||
// // Go Through List of Entries
|
||||
// for (let [id, obj] of Object.entries(LanguageManager.getTextData('Bestiary', 'Information'))) {
|
||||
// // Reserve Battleback
|
||||
// ImageManager.reserveBattleback1(obj.background.name, 0, this._imageReservationId);
|
||||
// // Get Filename
|
||||
// var name = $dataEnemies[Number(id)].sideviewBattler[0];
|
||||
// // If name
|
||||
// if (name) { ImageManager.reserveSvActor(name, 0, this._imageReservationId); };
|
||||
// }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.start = function() {
|
||||
// Super Call
|
||||
Scene_BaseEX.prototype.start.call(this);
|
||||
// Start Fade in
|
||||
this.startFadeIn(this.slowFadeSpeed(), false);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.create = function() {
|
||||
// Super Call
|
||||
Scene_BaseEX.prototype.create.call(this);
|
||||
|
||||
this.createEnemyWindow();
|
||||
this.createEnemyNameWindow();
|
||||
this.createEnemyListWindow();
|
||||
|
||||
// Create Enemy Text Window
|
||||
this._enemyTextWindow = new Window_OmoBestiaryEnemyText();
|
||||
this._enemyTextWindow.y = Graphics.height - this._enemyTextWindow.height
|
||||
this._enemyTextWindow.x = Graphics.width - this._enemyTextWindow.width;
|
||||
this._enemyTextWindow.visible = false;
|
||||
this.addChild(this._enemyTextWindow)
|
||||
|
||||
this.onListChangeUpdate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Enemy Window
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.createEnemyWindow = function() {
|
||||
// Create Enemy Window
|
||||
this._enemyWindow = new Window_OmoBestiaryEnemy(this._enemy);
|
||||
this.addChild(this._enemyWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Enemy Name Window
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.createEnemyNameWindow = function() {
|
||||
// Create Enemy Name Window
|
||||
this._enemyNameWindow = new Window_OmoBestiaryEnemyName();
|
||||
this._enemyNameWindow.x = Graphics.width - this._enemyNameWindow.width;
|
||||
this.addChild(this._enemyNameWindow)
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Enemy List Window
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.createEnemyListWindow = function() {
|
||||
// Create Enemy List Window
|
||||
this._enemyListWindow = new Window_OmoBestiaryEnemyList();
|
||||
this._enemyListWindow.x = Graphics.width - this._enemyListWindow.width;
|
||||
this._enemyListWindow.y = Graphics.height - this._enemyListWindow.height;
|
||||
this._enemyListWindow.setHandler('ok', this.onEnemyListOk.bind(this))
|
||||
this._enemyListWindow.setHandler('cancel', this.popScene.bind(this))
|
||||
this._enemyListWindow._onCursorChangeFunct = this.onListChangeUpdate.bind(this);
|
||||
this.addChild(this._enemyListWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.update = function() {
|
||||
// Super Call
|
||||
Scene_BaseEX.prototype.update.call(this);
|
||||
|
||||
// If Enemy Text Window is visible
|
||||
if (this._enemyTextWindow.visible) {
|
||||
if (Input.isTriggered('cancel')) {
|
||||
SoundManager.playCancel();
|
||||
this._enemyListWindow._onCursorChangeFunct = undefined;
|
||||
this._enemyListWindow.activate();
|
||||
this._enemyTextWindow.visible = false;
|
||||
this._enemyListWindow._onCursorChangeFunct = this.onListChangeUpdate.bind(this);
|
||||
return;
|
||||
}
|
||||
if (Input.isTriggered('left')) {
|
||||
this._enemyListWindow.selectPreviousEnemy();
|
||||
this.onListChangeUpdate();
|
||||
this.onEnemyListOk();
|
||||
};
|
||||
if (Input.isTriggered('right')) {
|
||||
this._enemyListWindow.selectNextEnemy();
|
||||
this.onListChangeUpdate();
|
||||
this.onEnemyListOk()
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * On List Change Update
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.onListChangeUpdate = function() {
|
||||
// Get Enemy ID
|
||||
var enemyId = this._enemyListWindow.enemyId();
|
||||
// Get Enemy Sprite
|
||||
var enemySprite = this._enemyWindow._enemySprite;
|
||||
// If the enemy ID is more than 0
|
||||
if (enemyId > 0) {
|
||||
this._enemyWindow.clearOpacity();
|
||||
enemySprite.removeChildren();
|
||||
// If enemy ID has changed transform
|
||||
this._enemy.transform(enemyId);
|
||||
// Get Data
|
||||
var data = LanguageManager.getTextData('Bestiary', 'Information')[enemyId];
|
||||
// Get Background Data
|
||||
var background = data.background;
|
||||
// Draw Name
|
||||
this._enemyNameWindow.drawName(this._enemyListWindow.enemyName(data));
|
||||
// Set Home Position
|
||||
enemySprite.setHome(data.position.x, data.position.y)
|
||||
// Set Enemy Sprite to visible
|
||||
enemySprite.visible = true;
|
||||
// Start Enemy Sprite Motion
|
||||
enemySprite.startMotion("other");
|
||||
// Update Enemy Sprite
|
||||
enemySprite.update();
|
||||
// Set Background
|
||||
this._enemyWindow.setBackground(background.name, background.x, background.y)
|
||||
} else {
|
||||
// Make Enemy Sprite invisible
|
||||
enemySprite.setHome(-Graphics.width, -Graphics.height)
|
||||
// Draw Name
|
||||
this._enemyNameWindow.drawName(LanguageManager.getTextData('Bestiary', 'EmptyEnemyName'))
|
||||
// Set Background
|
||||
this._enemyWindow.setBackground(null);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * [OK] Enemy List
|
||||
//=============================================================================
|
||||
Scene_OmoriBestiary.prototype.onEnemyListOk = function() {
|
||||
// Get Enemy ID
|
||||
var enemyId = this._enemyListWindow.enemyId();
|
||||
// Get Data
|
||||
var data = LanguageManager.getTextData('Bestiary', 'Information')[enemyId];
|
||||
// Make Enemy Text Window Visible
|
||||
this._enemyTextWindow.visible = true;
|
||||
|
||||
// Get Lines
|
||||
var lines = data.text.split(/[\r\n]/g);
|
||||
// Get Conditional Text
|
||||
var conditionalText = data.conditionalText;
|
||||
// If Conditional Text Exists
|
||||
if (conditionalText) {
|
||||
// Go through conditional text
|
||||
for (var i = 0; i < conditionalText.length; i++) {
|
||||
// Get text Data
|
||||
var textData = conditionalText[i];
|
||||
// Check if all switches are active
|
||||
if (textData.switchIds.every(function(id) { return $gameSwitches.value(id); })){
|
||||
// Get Line Index
|
||||
var lineIndex = textData.line === null ? lines.length : textData.line;
|
||||
// Get Extra Lines
|
||||
var extraLines = textData.text.split(/[\r\n]/g);
|
||||
// Add extra lines to main lines array
|
||||
lines.splice(lineIndex, 0, ...extraLines)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Draw Lines
|
||||
this._enemyTextWindow.drawLines(lines);
|
||||
// Get Character
|
||||
var character = this._enemyTextWindow._enemyCharacter;
|
||||
let sprite = this._enemyTextWindow._characterSprite;
|
||||
// If Character Data Exists
|
||||
if (data.character) {
|
||||
// Set Character Image
|
||||
character.setImage(data.character.name, data.character.index);
|
||||
} else {
|
||||
// Set Character Image to nothing
|
||||
character.setImage('', 0);
|
||||
};
|
||||
// Update Sprite
|
||||
sprite.update()
|
||||
// Update Character
|
||||
this._enemyTextWindow.updateCharacter();
|
||||
this._enemyTextWindow._characterSprite.update();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoBestiaryEnemy
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to show the enemy and the background for it.
|
||||
//=============================================================================
|
||||
function Window_OmoBestiaryEnemy() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoBestiaryEnemy.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoBestiaryEnemy.prototype.constructor = Window_OmoBestiaryEnemy;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.initialize = function(enemy) {
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.width / 2, Graphics.height);
|
||||
// Get Enemy Object
|
||||
this._enemy = enemy
|
||||
// Create Cover Mask
|
||||
this.createCoverMask();
|
||||
// Create Background Sprite
|
||||
this.createBackgroundSprite();
|
||||
// Create Enemy Sprite
|
||||
this.createEnemySprite();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Standard Padding
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.standardPadding = function() { return 5; }
|
||||
Window_OmoBestiaryEnemy.prototype.isUsingCustomCursorRectSprite = function() { return true; }
|
||||
Window_OmoBestiaryEnemy.prototype.customCursorRectYOffset = function() { return -7; }
|
||||
//=============================================================================
|
||||
// * Refresh Arrows
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype._refreshArrows = function() { };
|
||||
//=============================================================================
|
||||
// * Create Cover Mask
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.createCoverMask = function() {
|
||||
// Get Padding
|
||||
var padding = this.standardPadding();
|
||||
// Face Mask
|
||||
this._coverMask = new PIXI.Graphics();
|
||||
this._coverMask.beginFill(0xFFF);
|
||||
this._coverMask.drawRect(padding, padding, this.width - (padding * 2), this.height - (padding * 2));
|
||||
this._coverMask.endFill();
|
||||
this.addChild(this._coverMask)
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background Sprite
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.createBackgroundSprite = function() {
|
||||
// Create Background Sprite
|
||||
this._backgroundSprite = new Sprite(ImageManager.loadBattleback1('battleback_vf_default'));
|
||||
this._backgroundSprite.mask = this._coverMask;
|
||||
this.addChild(this._backgroundSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Enemy Sprite
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.createEnemySprite = function() {
|
||||
// Create Background Sprite
|
||||
this._enemySprite = new Sprite_Enemy(this._enemy);
|
||||
this._enemySprite.mask = this._coverMask;
|
||||
this._enemySprite.createShadowSprite = function() { this._shadowSprite = new Sprite(); }
|
||||
this._enemySprite.getCurrentMotion = function() {
|
||||
let other = this._enemy.getSideviewMotion("other");
|
||||
if(!other) {return this._enemy.getSideviewMotion("walk")}
|
||||
return other;
|
||||
}
|
||||
this.addChild(this._enemySprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Background
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.setBackground = function(name = null, x = 0, y = 0) {
|
||||
// If name
|
||||
if (name) {
|
||||
// Set Background Bitmap
|
||||
this._backgroundSprite.bitmap = ImageManager.loadBattleback1(name)
|
||||
this._backgroundSprite.x = x;
|
||||
this._backgroundSprite.y = y;
|
||||
} else {
|
||||
// Set Background Bitmap to null
|
||||
this._backgroundSprite.bitmap = null;
|
||||
}
|
||||
this._opDelay = 6;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Clear Opacity
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemy.prototype.clearOpacity = function() {
|
||||
this._enemySprite.opacity = 0;
|
||||
this._backgroundSprite.opacity = 0;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// * Update Opacity
|
||||
//=============================================================================
|
||||
|
||||
Window_OmoBestiaryEnemy.prototype.updateBEOpacity = function() {
|
||||
if(this._enemySprite.opacity >= 255 && this._backgroundSprite.opacity >= 255) {return;}
|
||||
this._enemySprite.opacity = Math.min(this._enemySprite.opacity + 8, 255);
|
||||
this._backgroundSprite.opacity = Math.min(this._backgroundSprite.opacity + 8, 255);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// * Main Update Method
|
||||
//=============================================================================
|
||||
|
||||
Window_OmoBestiaryEnemy.prototype.update = function() {
|
||||
Window_Base.prototype.update.call(this);
|
||||
if(--this._opDelay > 0) {return;}
|
||||
this.updateBEOpacity();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoBestiaryEnemyName
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to show the enemy name as a header
|
||||
//=============================================================================
|
||||
function Window_OmoBestiaryEnemyName() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoBestiaryEnemyName.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoBestiaryEnemyName.prototype.constructor = Window_OmoBestiaryEnemyName;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyName.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.width / 2, 48);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Standard Padding
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyName.prototype.standardPadding = function() { return 4; }
|
||||
//=============================================================================
|
||||
// * Draw Name
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyName.prototype.drawName = function(name) {
|
||||
// Clear Contents
|
||||
this.contents.clear()
|
||||
// Draw Name
|
||||
this.contents.drawText(name, 15, -5, this.contents.width - 30, this.contents.height);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoBestiaryEnemyText
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to show the enemy information text.
|
||||
//=============================================================================
|
||||
function Window_OmoBestiaryEnemyText() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoBestiaryEnemyText.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoBestiaryEnemyText.prototype.constructor = Window_OmoBestiaryEnemyText;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.width / 2, Graphics.height - 48);
|
||||
// Create Character
|
||||
this.createCharacter();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Character
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.createCharacter = function() {
|
||||
// Create Character Object
|
||||
this._enemyCharacter = new Game_Character();
|
||||
// Set Character Image Properties
|
||||
this._enemyCharacter.setImage('', 0)
|
||||
this._enemyCharacter.setWalkAnime(true)
|
||||
this._enemyCharacter.setStepAnime(true)
|
||||
// Create Sprite Character
|
||||
this._characterSprite = new Sprite_Character(this._enemyCharacter);
|
||||
this._characterSprite.updatePosition = function() {};
|
||||
this.addChild(this._characterSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Information
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.drawInformation = function(information) {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Get Lines
|
||||
var lines = information.split(/[\r\n]/g);
|
||||
// Go Through Lines
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
// Draw Line
|
||||
this.drawText(lines[i], 0, -10 + (i * 24), this.contents.width, 24);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Information
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.drawLines = function(lines) {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Go Through Lines
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
// Draw Line
|
||||
this.drawText(lines[i], 0, -10 + (i * 28), this.contents.width, 24);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.update = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.update.call(this);
|
||||
// Update Character
|
||||
this.updateCharacter();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Character
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyText.prototype.updateCharacter = function() {
|
||||
// Update Character
|
||||
this._enemyCharacter.update();
|
||||
// Get Sprite
|
||||
var sprite = this._characterSprite;
|
||||
// Set Sprite Position
|
||||
sprite.x = this.width - (sprite._frame.width / 2) - 10;
|
||||
sprite.y = this.height - 10;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoBestiaryEnemyList
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to show a list of enemy names.
|
||||
//=============================================================================
|
||||
function Window_OmoBestiaryEnemyList() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoBestiaryEnemyList.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoBestiaryEnemyList.prototype.constructor = Window_OmoBestiaryEnemyList;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.initialize = function() {
|
||||
// Get Entries for Sorted Bestiary list
|
||||
this._sortedBestiaryList = Object.entries(LanguageManager.getTextData('Bestiary', 'Information'));
|
||||
// Sort list
|
||||
this._sortedBestiaryList.sort(function(a, b) {
|
||||
var indexA = a[1].listIndex === undefined ? Number(a[0]) : a[1].listIndex
|
||||
var indexB = b[1].listIndex === undefined ? Number(b[0]) : b[1].listIndex
|
||||
return indexA - indexB
|
||||
});
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 0, 0);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.windowWidth = function() { return Graphics.width / 2; };
|
||||
Window_OmoBestiaryEnemyList.prototype.windowHeight = function() { return Graphics.height - 48; };
|
||||
Window_OmoBestiaryEnemyList.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectXOffset = function() { return 14; }
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectYOffset = function() { return 0; }
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectTextXOffset = function() { return 30; }
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectTextYOffset = function() { return -7; }
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectTextWidthOffset = function() { return 0; }
|
||||
Window_OmoBestiaryEnemyList.prototype.customCursorRectBitmapName = function() { return 'cursor_menu'; }
|
||||
//=============================================================================
|
||||
// * Get Enemy ID
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.enemyId = function(index = this._index) {
|
||||
return this._list[index].ext;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Select Next Enemy
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.selectNextEnemy = function() {
|
||||
// Get Starting Index
|
||||
var index = (this.index() + 1)
|
||||
if(index >= this.maxItems()) {
|
||||
index = 0;
|
||||
}
|
||||
var selected = false;
|
||||
// Go Through Items
|
||||
for (var i = index; i < this.maxItems(); i++) {
|
||||
// If item has a valid ID
|
||||
if (this._list[i].ext !== 0) {
|
||||
// audio
|
||||
AudioManager.playSe({name: "SE_turn_page", pan: 0, pitch: 100, volume: 90});
|
||||
// Select it
|
||||
this.select(i);
|
||||
selected = true;
|
||||
break;
|
||||
};
|
||||
};
|
||||
if(!!selected) {return;}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Select Previous Enemy
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.selectPreviousEnemy = function() {
|
||||
// Get Starting Index
|
||||
var index = (this.index() - 1) < 0 ? this.maxItems() - 1 : this.index() - 1;
|
||||
// Go Through Items
|
||||
for (var i = index; i >= 0; i--) {
|
||||
// If item has a valid Id
|
||||
if (this._list[i].ext !== 0) {
|
||||
// audio
|
||||
AudioManager.playSe({name: "SE_turn_page", pan: 0, pitch: 100, volume: 90});
|
||||
// Select it
|
||||
this.select(i);
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.makeCommandList = function() {
|
||||
// Get List
|
||||
var list = $gameParty._defeatedEnemies;
|
||||
// Go Through List of Entries
|
||||
for (let [id, obj] of this._sortedBestiaryList) {
|
||||
// Get Index
|
||||
var index = Number(id);
|
||||
// If Defeated Enemy list contains id
|
||||
if (list.contains(index)) {
|
||||
// Add Command
|
||||
this.addCommand(this.enemyName(obj), 'ok', true, index)
|
||||
} else {
|
||||
// Add Empty Command
|
||||
this.addCommand('------------------------------', 'nothing', false, 0)
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Enemy Name
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.enemyName = function(obj) {
|
||||
// If object has conditional names
|
||||
if (obj.conditionalNames) {
|
||||
// Get Names
|
||||
const names = obj.conditionalNames
|
||||
// Go Through Names
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
// Get Data
|
||||
const data = names[i];
|
||||
// Check Switches
|
||||
let switches = data.switches.every(arr => $gameSwitches.value(arr[0]) === arr[1])
|
||||
|
||||
if (switches) {
|
||||
return data.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
// Return default name
|
||||
return obj.name
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Item
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.drawItem = function(index) {
|
||||
var rect = this.itemRectForText(index);
|
||||
var align = this.itemTextAlign();
|
||||
this.resetTextColor();
|
||||
this.changePaintOpacity(true);
|
||||
this.drawText(this.commandName(index), rect.x, rect.y, rect.width - rect.x, align);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh Arrows
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype._refreshArrows = function() {
|
||||
// Run Original Function
|
||||
Window_Command.prototype._refreshArrows.call(this);
|
||||
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);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Call Update Help
|
||||
//=============================================================================
|
||||
Window_OmoBestiaryEnemyList.prototype.callUpdateHelp = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.callUpdateHelp.call(this);
|
||||
// If active
|
||||
if (this.active) {
|
||||
// If On Cursor Change Function Exists
|
||||
if (this._onCursorChangeFunct) { this._onCursorChangeFunct(); };
|
||||
|
||||
};
|
||||
};
|
|
@ -1,290 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Omori BlackLetter Map
|
||||
// Version: 1.5
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_OmoriBlackLetterMap = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.OmoriBlackLetterMap = _TDS_.OmoriBlackLetterMap || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin shows the Omori Black Letter map.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ImageManager.loadSystem('blackletter_bg');
|
||||
// ImageManager.loadSystem('blackLetter_map_atlas');
|
||||
|
||||
//=============================================================================
|
||||
// ** Input
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that handles input data from the keyboard and gamepads.
|
||||
//=============================================================================
|
||||
// * Key Mapper Keys
|
||||
//=============================================================================
|
||||
// Input.keyMapper['81'] = 'q';
|
||||
|
||||
|
||||
|
||||
// //=============================================================================
|
||||
// // ** Scene_Map
|
||||
// //-----------------------------------------------------------------------------
|
||||
// // The scene class of the map screen.
|
||||
// //=============================================================================
|
||||
// // Alias Listing
|
||||
// //=============================================================================
|
||||
// _TDS_.OmoriBlackLetterMap.Scene_Map_updateScene = Scene_Map.prototype.updateScene;
|
||||
// //=============================================================================
|
||||
// // * Update Scene
|
||||
// //=============================================================================
|
||||
// Scene_Map.prototype.updateScene = function() {
|
||||
// // Run Original Function
|
||||
// _TDS_.OmoriBlackLetterMap.Scene_Map_updateScene.call(this);
|
||||
// if (!SceneManager.isSceneChanging()) {
|
||||
// this.updateCallBlackLetterMap();
|
||||
// };
|
||||
// };
|
||||
// //=============================================================================
|
||||
// // * Update Call Black Letter Map
|
||||
// //=============================================================================
|
||||
// Scene_Map.prototype.updateCallBlackLetterMap = function() {
|
||||
// // If Q Is triggered
|
||||
// if (Input.isTriggered('pageup')) {
|
||||
// // If Disable switch is off
|
||||
// if (!$gameSwitches.value(18)) {
|
||||
// // Go to Black Letter Map Scene
|
||||
// SceneManager.push(Scene_OmoriBlackLetterMap);
|
||||
// };
|
||||
// };
|
||||
// };
|
||||
|
||||
_TDS_.OmoriBlackLetterMap.Scene_Map_needsFadeIn = Scene_Map.prototype.needsFadeIn;
|
||||
Scene_Map.prototype.needsFadeIn = function() {
|
||||
return (_TDS_.OmoriBlackLetterMap.Scene_Map_needsFadeIn.call(this) || SceneManager.isPreviousScene(Scene_OmoriBlackLetterMap));
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_OmoriBlackLetterMap
|
||||
//-----------------------------------------------------------------------------
|
||||
// This scene shows the Black Letter map
|
||||
//=============================================================================
|
||||
function Scene_OmoriBlackLetterMap() { this.initialize.apply(this, arguments);}
|
||||
Scene_OmoriBlackLetterMap.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_OmoriBlackLetterMap.prototype.constructor = Scene_OmoriBlackLetterMap;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Scene_OmoriBlackLetterMap.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Lists
|
||||
//=============================================================================
|
||||
Scene_OmoriBlackLetterMap.prototype.initAtlastLists = function() {
|
||||
// Run Original Function
|
||||
Scene_Base.prototype.initAtlastLists.call(this);
|
||||
// Add Required Atlas
|
||||
// this.addRequiredAtlas('blackletter_bg');
|
||||
this.addRequiredAtlas('blackLetter_map_atlas');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_OmoriBlackLetterMap.prototype.create = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.create.call(this);
|
||||
// Create Map Sprite
|
||||
this._mapSprite = new Sprite_OmoBlackLetterMap();
|
||||
this.addChild(this._mapSprite);
|
||||
};
|
||||
|
||||
Scene_OmoriBlackLetterMap.prototype.start = function() {
|
||||
Scene_Base.prototype.start.call(this);
|
||||
this.startFadeIn(this.slowFadeSpeed());
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_OmoriBlackLetterMap.prototype.update = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.update.call(this);
|
||||
// If Cancel or Q is pressed
|
||||
if (Input.isTriggered('cancel') || Input.isTriggered('q')) {
|
||||
// If not busy
|
||||
if (!this.isBusy()) {
|
||||
// Play Cancel Sound
|
||||
// SoundManager.playCancel();
|
||||
// Pop Scene
|
||||
this.popScene();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_OmoBlackLetterMap
|
||||
//-----------------------------------------------------------------------------
|
||||
// This sprite is used to display the black letter map.
|
||||
//=============================================================================
|
||||
function Sprite_OmoBlackLetterMap() { this.initialize.apply(this, arguments);}
|
||||
Sprite_OmoBlackLetterMap.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_OmoBlackLetterMap.prototype.constructor = Sprite_OmoBlackLetterMap;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_OmoBlackLetterMap.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this);
|
||||
// Create Background Sprite
|
||||
this.createBackgroundSprite();
|
||||
// Create Overlay Sprites
|
||||
this.createOverlaySprites();
|
||||
// Create Text Counter Sprite
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background Sprite
|
||||
//=============================================================================
|
||||
Sprite_OmoBlackLetterMap.prototype.createBackgroundSprite = function() {
|
||||
// Create Background Sprite
|
||||
this._backgroundSprite = new Sprite(ImageManager.loadSystem('blackletter_bg'));
|
||||
this.addChild(this._backgroundSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Overlay Sprites
|
||||
//=============================================================================
|
||||
Sprite_OmoBlackLetterMap.prototype.createOverlaySprites = function() {
|
||||
// Create Overlay Bitmap
|
||||
var bitmap = new Bitmap(Graphics.width, Graphics.height);
|
||||
// Get Background Bitmap
|
||||
var bgBitmap = ImageManager.loadAtlas('blackLetter_map_atlas');
|
||||
var bgBitmap50 = ImageManager.loadAtlas('blackLetter_map_50_atlas');
|
||||
// Get Map Data
|
||||
bgBitmap.addLoadListener(() => {
|
||||
bgBitmap50.addLoadListener(() => {
|
||||
var mapData = [
|
||||
{name: 'PYREFLY FOREST', namePos: new Point(80, 195), rect: new Rectangle(0, 0, 193, 139), pos: new Point(111, 103), blackSwitchId: 23, nameSwitchId: 30, blackSwitch50Id: 900 },
|
||||
// {name: 'Forgotten Pier', namePos: new Point(200, 27), rect: new Rectangle(194, 0, 155, 120), pos: new Point(225, 52), blackSwitchId: 21, nameSwitchId: 29 },
|
||||
{name: 'PINWHEEL FOREST', namePos: new Point(440, 240), rect: new Rectangle(350, 0, 99, 107), pos: new Point(471, 128), blackSwitchId: 24, nameSwitchId: 31, blackSwitch50Id: 901 },
|
||||
{name: 'SPROUT MOLE TOWN', namePos: new Point(25, 340), rect: new Rectangle(450, 0, 94, 80), pos: new Point(54, 267), blackSwitchId: 25, nameSwitchId: 32, blackSwitch50Id: 902 },
|
||||
{name: 'VAST FOREST', namePos: new Point(250, 300), rect: new Rectangle(0, 124, 640, 201), pos: new Point(-2, 143), blackSwitchId: 26, nameSwitchId: 33, blackSwitch50Id: 903 },
|
||||
{name: 'DEEP WELL', namePos: new Point(450, 355), rect: new Rectangle(0, 326, 418, 113), pos: new Point(119, 366), blackSwitchId: 27, nameSwitchId: 34, blackSwitch50Id: 904 },
|
||||
{name: 'ORANGE OASIS', namePos: new Point(20, 55), rect: new Rectangle(545, 0, 122, 102), pos: new Point(31, 85), blackSwitchId: 28, nameSwitchId: 35, blackSwitch50Id: 905 },
|
||||
{name: 'OTHERWORLD', namePos: new Point(450, 75), rect: new Rectangle(419, 326, 140, 209), pos: new Point(390, 21), blackSwitchId: 29, nameSwitchId: 36, blackSwitch50Id: 906 },
|
||||
]
|
||||
// Initialize Name Windows Array
|
||||
this._nameWindows = [];
|
||||
// Create Container for Name Windows
|
||||
this._nameWindowsContainer = new Sprite();
|
||||
// Go Through Map Data
|
||||
for (var i = 0; i < mapData.length; i++) {
|
||||
// Get Data
|
||||
var data = mapData[i];
|
||||
// Get Rect & Position
|
||||
var rect = data.rect, pos = data.pos;
|
||||
var test = Math.randomInt(100) > 50;
|
||||
// If Black switch ID is not on
|
||||
/*if (!$gameSwitches.value(data.blackSwitchId)) {
|
||||
if (!$gameSwitches.value(data.blackSwitch50Id)) {
|
||||
// Draw Black onto Bitmap
|
||||
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
|
||||
} else {
|
||||
|
||||
}
|
||||
};*/
|
||||
//if(!!$gameSwitches.value(data.blackSwitchId)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
//else if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
else {
|
||||
if(!$gameSwitches.value(data.blackSwitchId)) {
|
||||
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
|
||||
}
|
||||
}
|
||||
// Get Name Position
|
||||
var namePos = data.namePos;
|
||||
var name = $gameSwitches.value(data.nameSwitchId) ? data.name : "???"
|
||||
// Create Window
|
||||
var win = new Window_OmoBlackLetterMapName(name);
|
||||
// Set Window Position
|
||||
win.x = namePos.x; win.y = namePos.y;
|
||||
this._nameWindows.push(win);
|
||||
this._nameWindowsContainer.addChild(win);
|
||||
};
|
||||
// Create Black Overlay Sprite
|
||||
this._blackOverlay = new Sprite(bitmap);
|
||||
this.addChild(this._blackOverlay)
|
||||
|
||||
// Add Name Window container as a child
|
||||
this.addChild(this._nameWindowsContainer);
|
||||
this.createTextCounterSprite();
|
||||
})
|
||||
})
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Text Counter Sprite
|
||||
//=============================================================================
|
||||
Sprite_OmoBlackLetterMap.prototype.createTextCounterSprite = function() {
|
||||
// Get Background Bitmap
|
||||
var bgBitmap = ImageManager.loadAtlas('blackLetter_map_atlas');
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(200, 40);
|
||||
bitmap.blt(bgBitmap, 450, 81, 39, 37, 5, 10);
|
||||
bitmap.textColor = '#000000';
|
||||
bitmap.outlineColor = 'rgba(255, 255, 255, 1)'
|
||||
bitmap.outlineWidth = 3;
|
||||
bitmap.drawText('%1/%2'.format($gameVariables.value(19), 26), 48, 0, 70, 55);
|
||||
this._textCounterSprite = new Sprite(bitmap);
|
||||
this._textCounterSprite.y = Graphics.height - 50;
|
||||
this.addChild(this._textCounterSprite);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoBlackLetterMapName
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for displaying the name of a map section in the black letter map.
|
||||
//=============================================================================
|
||||
function Window_OmoBlackLetterMapName() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoBlackLetterMapName.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoBlackLetterMapName.prototype.constructor = Window_OmoBlackLetterMapName;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoBlackLetterMapName.prototype.initialize = function(name) {
|
||||
// Set Name
|
||||
this._name = name;
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 0, 0, 300, 38);
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoBlackLetterMapName.prototype.standardPadding = function() { return 4; };
|
||||
Window_OmoBlackLetterMapName.prototype.windowWidth = function() { return Graphics.width; };
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoBlackLetterMapName.prototype.refresh = function() {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Get Text Width
|
||||
var textWidth = this.textWidth(this._name);
|
||||
// Adjust Width
|
||||
this.width = textWidth + (this._name === "???" ? 24 : this.padding*2);
|
||||
this.contents.fontSize = 22;
|
||||
// Draw Name
|
||||
this.drawText(this._name, 0, -7, this.contentsWidth(), 'center');
|
||||
};
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,929 +0,0 @@
|
|||
//=============================================================================
|
||||
// ** Scene_OmoMenuItem
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the item menu.
|
||||
//=============================================================================
|
||||
function Scene_OmoMenuItem() { this.initialize.apply(this, arguments); }
|
||||
Scene_OmoMenuItem.prototype = Object.create(Scene_OmoMenuBase.prototype);
|
||||
Scene_OmoMenuItem.prototype.constructor = Scene_OmoMenuItem;
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.create = function() {
|
||||
// Super Call
|
||||
Scene_OmoMenuBase.prototype.create.call(this);
|
||||
// Create Windows
|
||||
this.createItemConfirmationWindow();
|
||||
this.createItemTrashPromptWindow();
|
||||
this.createHelpWindow();
|
||||
this.createStatusWindows();
|
||||
this.createCategoryWindow();
|
||||
this.createItemListWindow();
|
||||
this.createCommandWindow();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Busy
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.isBusy = function() {
|
||||
if (this.move.isMoving()) { return true; }
|
||||
return Scene_OmoMenuBase.prototype.isBusy.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.start = function() {
|
||||
// Super Call
|
||||
Scene_OmoMenuBase.prototype.start.call(this);
|
||||
this.queue('showWindow', this._itemCategoryWindow, 15)
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemCategoryWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Status Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createStatusWindows = function() {
|
||||
// Super Call
|
||||
Scene_OmoMenuBase.prototype.createStatusWindows.call(this);
|
||||
this._statusWindow._okSoundEnabled = false;
|
||||
this._statusWindow.setHandler('ok', this.onStatusWindowOk.bind(this));
|
||||
this._statusWindow.setHandler('cancel', this.onStatusWindowCancel.bind(this));
|
||||
this._statusWindow.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Help Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createHelpWindow = function() {
|
||||
// Super Call
|
||||
Scene_OmoMenuBase.prototype.createHelpWindow.call(this);
|
||||
// Adjust Help Window
|
||||
this._helpWindow.width = 384
|
||||
this._helpWindow.height = 90
|
||||
this._helpWindow.x = 10;
|
||||
this._helpWindow.y = 64;
|
||||
this._helpWindow._hideY = 64;
|
||||
this._helpWindow._hideHeight = 0;
|
||||
this._helpWindow._showY = 108;
|
||||
this._helpWindow._showHeight = 90;
|
||||
this._helpWindow.createContents();
|
||||
this._helpWindow.height = 0;
|
||||
this._helpWindow._iconRate = 0.75;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Category Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createCategoryWindow = function() {
|
||||
// Create Item Category Window
|
||||
this._itemCategoryWindow = new Window_OmoMenuItemCategory();
|
||||
this._itemCategoryWindow.x = 10 ;
|
||||
this._itemCategoryWindow.y = 20;
|
||||
|
||||
this._itemCategoryWindow._hideY = 20;
|
||||
this._itemCategoryWindow._hideHeight = this._itemCategoryWindow.height;
|
||||
this._itemCategoryWindow._showY = 64;
|
||||
this._itemCategoryWindow._showHeight = this._itemCategoryWindow.height;
|
||||
this._itemCategoryWindow.update();
|
||||
this._itemCategoryWindow.deactivate();
|
||||
this._itemCategoryWindow.setHandler('ok', this.onItemCategoryOk.bind(this));
|
||||
this._itemCategoryWindow.setHandler('cancel', this.onItemCategoryCancel.bind(this));
|
||||
this.addChild(this._itemCategoryWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Item List Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createItemListWindow = function() {
|
||||
// Create Item List Window
|
||||
this._itemListWindow = new Window_OmoMenuItemList();
|
||||
this._itemListWindow.x = 394;
|
||||
this._itemListWindow.y = 0;
|
||||
this._itemListWindow.height = 0;
|
||||
this._itemListWindow.openness = 255;
|
||||
this._itemListWindow._hideY = 0;
|
||||
this._itemListWindow._hideHeight = 0;
|
||||
this._itemListWindow._showY = 64;
|
||||
this._itemListWindow._showHeight = this._itemListWindow.windowHeight();
|
||||
this._itemListWindow.setHandler('ok', this.onItemListOk.bind(this));
|
||||
this._itemListWindow.setHandler('cancel', this.onItemListCancel.bind(this));
|
||||
this._itemListWindow.setHelpWindow(this._helpWindow);
|
||||
this._itemCategoryWindow._itemWindow = this._itemListWindow;
|
||||
this._itemCategoryWindow.callUpdateHelp();
|
||||
this.addChild(this._itemListWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Item Confirmation Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createItemConfirmationWindow = function() {
|
||||
// Create Item Confirmation Window
|
||||
this._itemComfirmationWindow = new Window_OmoMenuItemConfirmation();
|
||||
this._itemComfirmationWindow.x = 10;
|
||||
this._itemComfirmationWindow.y = 198 - this._itemComfirmationWindow.height;
|
||||
this._itemComfirmationWindow._hideY = 198 - this._itemComfirmationWindow.height;
|
||||
this._itemComfirmationWindow._hideHeight = this._itemComfirmationWindow.height;
|
||||
this._itemComfirmationWindow._showY = 198;
|
||||
this._itemComfirmationWindow._showHeight = this._itemComfirmationWindow.height
|
||||
this._itemComfirmationWindow.openness = 255;
|
||||
this._itemComfirmationWindow.visible = false;
|
||||
this._itemComfirmationWindow.setHandler('use', this.onItemConfirmationUse.bind(this));
|
||||
this._itemComfirmationWindow.setHandler('trash', this.onItemConfirmationTrash.bind(this));
|
||||
this._itemComfirmationWindow.setHandler('cancel', this.onItemConfirmationCancel.bind(this));
|
||||
this.addChild(this._itemComfirmationWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Item Trash Prompt Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.createItemTrashPromptWindow = function() {
|
||||
// Create Item Trash Prompt Window
|
||||
this._itemTrashPromptWindow = new Window_OmoMenuItemTrashPromptWindow();
|
||||
this._itemTrashPromptWindow.x = this._itemComfirmationWindow.x + this._itemComfirmationWindow.width;
|
||||
this._itemTrashPromptWindow.y = 198 - this._itemTrashPromptWindow.height;
|
||||
|
||||
this._itemTrashPromptWindow._hideY = 198 - this._itemTrashPromptWindow.height;
|
||||
this._itemTrashPromptWindow._hideHeight = this._itemTrashPromptWindow.height;
|
||||
this._itemTrashPromptWindow._showY = 198;
|
||||
this._itemTrashPromptWindow._showHeight = this._itemTrashPromptWindow.height
|
||||
this._itemTrashPromptWindow.openness = 255;
|
||||
this._itemTrashPromptWindow.visible = false;
|
||||
|
||||
|
||||
this._itemTrashPromptWindow.setHandler('ok', this.onItemTrashPromptOk.bind(this));
|
||||
this._itemTrashPromptWindow.setHandler('cancel', this.onItemTrashPromptCancel.bind(this));
|
||||
this.addChild(this._itemTrashPromptWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.item = function() { return this._itemListWindow.item(); };
|
||||
//=============================================================================
|
||||
// * User
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.user = function() {
|
||||
var members = $gameParty.movableMembers();
|
||||
var bestActor = members[0];
|
||||
var bestPha = 0;
|
||||
for (var i = 0; i < members.length; i++) {
|
||||
if (members[i].pha > bestPha) {
|
||||
bestPha = members[i].pha;
|
||||
bestActor = members[i];
|
||||
};
|
||||
};
|
||||
return bestActor;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Play Sound for Item
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.playSeForItem = function() {
|
||||
SoundManager.playUseItem();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Category - Ok
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemCategoryOk = function() {
|
||||
// this._itemListWindow.open();
|
||||
// this._itemListWindow.activate();
|
||||
// this._itemListWindow.select(0)
|
||||
// this._helpWindow.open();
|
||||
// Show Item & Help Window
|
||||
this.queue(function() {
|
||||
this._itemListWindow.select(0);
|
||||
// Reset Height so when the window is recreated it will have properly sized contents
|
||||
this._itemListWindow.height = this._itemListWindow.windowHeight();
|
||||
this._itemListWindow.resetScroll()
|
||||
this._itemListWindow.refresh();
|
||||
this._itemListWindow.height = 0;
|
||||
this._itemListWindow.updateHelp();
|
||||
this.showWindow(this._helpWindow, 15);
|
||||
this.showWindow(this._itemListWindow, 15)
|
||||
}.bind(this))
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemListWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Category - Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemCategoryCancel = function() {
|
||||
this._statusWindow.deselect();
|
||||
this._statusWindow.deactivate();
|
||||
|
||||
this.queue('hideWindow', this._itemCategoryWindow, 15)
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this.popScene();
|
||||
SceneManager._nextScene._commandWindow = this._commandWindow;
|
||||
SceneManager._nextScene._statusWindow = this._statusWindow;
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item List - Ok
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemListOk = function() {
|
||||
|
||||
this._itemComfirmationWindow.select(0);
|
||||
this._itemComfirmationWindow.setItem(this._itemListWindow.item());
|
||||
this._itemComfirmationWindow.visible = true;
|
||||
this.queue('showWindow', this._itemComfirmationWindow, 15);
|
||||
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemComfirmationWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item List - Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemListCancel = function() {
|
||||
// Wait (For Trash and Confirm windows in case they're moving)
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Item & Help Window
|
||||
this.queue(function() {
|
||||
this._itemTrashPromptWindow.visible = false;
|
||||
this._itemComfirmationWindow.visible = false;
|
||||
this.hideWindow(this._helpWindow, 15);
|
||||
this.hideWindow(this._itemListWindow, 15);
|
||||
}.bind(this))
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
// Activate Item
|
||||
this._itemCategoryWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Confirmation - Use
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemConfirmationUse = function() {
|
||||
// Get Item
|
||||
var item = this.item();
|
||||
let noTarget = !!item.meta["NoTarget"];
|
||||
let BeforeApplyEval = item.meta["BeforeApplyEval"];
|
||||
// If Item is a bestiary
|
||||
if (item.meta.Bestiary) {
|
||||
SceneManager.push(Scene_OmoriBestiary);
|
||||
return;
|
||||
};
|
||||
// If Item is a book
|
||||
if (item.meta.AlbumGroup) {
|
||||
SceneManager.push(Scene_OmoriPhotoAlbum);
|
||||
SceneManager.prepareNextScene($dataItems[item.id], 1);
|
||||
return;
|
||||
};
|
||||
this.queue('hideWindow', this._itemComfirmationWindow, 15);
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemComfirmationWindow.visible = false;
|
||||
// Get Commands Text
|
||||
var text = LanguageManager.getPluginText('itemMenu', 'itemUse').confirm;
|
||||
// Get Text Index
|
||||
var textIndex = item ? item.meta.ItemCommandTextIndex ? Number(item.meta.ItemCommandTextIndex) : 0 : 0;
|
||||
// If Item is for all
|
||||
if(!!BeforeApplyEval) {
|
||||
eval(BeforeApplyEval.trim());
|
||||
}
|
||||
if(!!noTarget) {return this.onStatusWindowOk()}
|
||||
if (this.isItemForAll()) {
|
||||
this._statusWindow.setCursorText(text.all[textIndex]);
|
||||
this._statusWindow.setCursorAll(true);
|
||||
} else {
|
||||
this._statusWindow.setCursorText(text.single[textIndex]);
|
||||
this._statusWindow.setCursorAll(false);
|
||||
};
|
||||
this._statusWindow.select(0);
|
||||
this._statusWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Confirmation - Trash
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemConfirmationTrash = function() {
|
||||
this._itemTrashPromptWindow.select(1);
|
||||
this._itemTrashPromptWindow.visible = true;
|
||||
this.queue('showWindow', this._itemTrashPromptWindow, 15);
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemTrashPromptWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Confirmation - Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemConfirmationCancel = function() {
|
||||
// this._itemComfirmationWindow.close();
|
||||
this._itemListWindow.refresh();
|
||||
// Get Item Count
|
||||
var itemCount = this._itemListWindow.maxItems();
|
||||
// If Item count is more than 0
|
||||
if (itemCount > 0) {
|
||||
this.queue('hideWindow', this._itemComfirmationWindow, 15);
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemComfirmationWindow.visible = false;
|
||||
this._itemListWindow.activate();
|
||||
this._itemListWindow.selectAvailable();
|
||||
}.bind(this))
|
||||
} else {
|
||||
this._itemTrashPromptWindow.close();
|
||||
this._itemComfirmationWindow.close();
|
||||
this._itemListWindow.close();
|
||||
this._itemCategoryWindow.refresh();
|
||||
this._itemCategoryWindow.activate();
|
||||
this._helpWindow.close();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Trash Prompt - Ok
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemTrashPromptOk = function() {
|
||||
// Get Item
|
||||
var item = this.item();
|
||||
// Lose Item
|
||||
this.queue('wait', 10);
|
||||
this.queue(() => AudioManager.playSe({ name: "GEN_multi1", volume: 90, pitch: 100, pan: 0}))
|
||||
this.queue('wait', 20);
|
||||
this.queue(() => {
|
||||
$gameParty.loseItem(item, 1, false);
|
||||
// If there's no items left
|
||||
if ($gameParty.numItems(item) <= 0) {
|
||||
// this._itemTrashPromptWindow.close();
|
||||
// this._itemComfirmationWindow.close();
|
||||
this._itemListWindow.refresh()
|
||||
// Get Item Count
|
||||
var itemCount = this._itemListWindow.maxItems();
|
||||
// If Item count is more than 0
|
||||
if (itemCount > 0) {
|
||||
this.hideWindow(this._itemTrashPromptWindow, 15);
|
||||
this.hideWindow(this._itemComfirmationWindow, 15);
|
||||
this._itemListWindow.activate();
|
||||
this._itemListWindow.selectAvailable()
|
||||
} else {
|
||||
|
||||
this._helpWindow.contents.clear();
|
||||
this._itemCategoryWindow.refresh();
|
||||
|
||||
// Wait for Movement
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Hide Windows
|
||||
this.queue(function() {
|
||||
this.hideWindow(this._itemTrashPromptWindow, 15);
|
||||
this.hideWindow(this._itemComfirmationWindow, 15);
|
||||
}.bind(this))
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Hide Windows
|
||||
this.queue(function() {
|
||||
this._itemTrashPromptWindow.visible = false;
|
||||
this._itemComfirmationWindow.visible = false;
|
||||
this.hideWindow(this._itemListWindow, 15);
|
||||
this.hideWindow(this._helpWindow, 15);
|
||||
}.bind(this));
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemCategoryWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
} else {
|
||||
this.hideWindow(this._itemTrashPromptWindow, 15);
|
||||
this._itemListWindow.refresh();
|
||||
// this._itemTrashPromptWindow.close();
|
||||
this._itemComfirmationWindow.activate();
|
||||
};
|
||||
})
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Trash Prompt - Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onItemTrashPromptCancel = function() {
|
||||
this.queue('hideWindow', this._itemTrashPromptWindow, 15);
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemTrashPromptWindow.visible = false;
|
||||
this._itemComfirmationWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
//=============================================================================
|
||||
// * Status Window - Ok
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onStatusWindowOk = function() {
|
||||
// Get ITem
|
||||
var item = this.item();
|
||||
// If Item Can be used
|
||||
if (this.canUse()) {
|
||||
// Use Item
|
||||
this.useItem();
|
||||
if (item.animationId === 212) {
|
||||
AudioManager.playSe({ name: "BA_Heart_Heal", volume: 90, pitch: 100, pan: 0});
|
||||
} else if (item.animationId === 213) {
|
||||
AudioManager.playSe({ name: "BA_heal_juice", volume: 90, pitch: 100, pan: 0});
|
||||
} else if (item.animationId === 114) {
|
||||
AudioManager.playSe({ name: "BA_Heart_Heal", volume: 90, pitch: 100, pan: 0});
|
||||
}
|
||||
//this.playSeForItem();
|
||||
// Redraw Current Item
|
||||
this._itemListWindow.refresh();
|
||||
// Get Item Count
|
||||
var itemCount = $gameParty.numItems(item);
|
||||
// If Item Count is 0 or less
|
||||
if (itemCount <= 0) {
|
||||
// Refresh Item List Window
|
||||
this._itemListWindow.refresh();
|
||||
// Get Max Item Count
|
||||
var maxCount = this._itemListWindow.maxItems();
|
||||
// If Item count is more than 0
|
||||
if (maxCount > 0) {
|
||||
this._itemListWindow.selectAvailable();
|
||||
this._statusWindow.setCursorAll(false);
|
||||
this._statusWindow.deselect();
|
||||
this._statusWindow.deactivate();
|
||||
this._itemListWindow.refresh();
|
||||
this._itemListWindow.activate();
|
||||
} else {
|
||||
this._statusWindow.setCursorAll(false);
|
||||
this._statusWindow.deselect();
|
||||
this._statusWindow.deactivate();
|
||||
this._helpWindow.contents.clear();
|
||||
this._itemCategoryWindow.refresh();
|
||||
// Wait for Movement
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Hide Windows
|
||||
this.queue(function() {
|
||||
this.hideWindow(this._itemListWindow, 15);
|
||||
this.hideWindow(this._helpWindow, 15);
|
||||
}.bind(this))
|
||||
this.queue('setWaitMode', 'movement');
|
||||
// Show Command Window
|
||||
this.queue(function() {
|
||||
this._itemCategoryWindow.activate();
|
||||
}.bind(this))
|
||||
};
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Play Buzzer Sound
|
||||
SoundManager.playBuzzer();
|
||||
}
|
||||
// Activate Status Window
|
||||
this._statusWindow.activate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Status Window - Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.onStatusWindowCancel = function() {
|
||||
this._statusWindow.setCursorAll(false);
|
||||
this._statusWindow.deselect();
|
||||
this._itemListWindow.activate();
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// * Show Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.showWindow = function(obj, duration, newData) {
|
||||
// Create Movement Data
|
||||
var data = {
|
||||
obj: obj,
|
||||
properties: ['y', 'height'],
|
||||
from: {y: obj.y, height: obj.height},
|
||||
to: { y: obj._showY, height: obj._showHeight},
|
||||
durations: {y: duration, height: duration},
|
||||
easing: Object_Movement.easeOutCirc,
|
||||
};
|
||||
if (newData) { Object.assign(data, newData); };
|
||||
this.move.startMove(data);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Hide Window
|
||||
//=============================================================================
|
||||
Scene_OmoMenuItem.prototype.hideWindow = function(obj, duration, newData) {
|
||||
// Create Movement Data
|
||||
var data = {
|
||||
obj: obj,
|
||||
properties: ['y', 'height'],
|
||||
from: {y: obj.y, height: obj.height},
|
||||
to: { y: obj._hideY, height: obj._hideHeight},
|
||||
durations: {y: duration, height: duration},
|
||||
easing: Object_Movement.easeInCirc,
|
||||
};
|
||||
if (newData) { Object.assign(data, newData); };
|
||||
this.move.startMove(data);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoMenuItemCategory
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selecting item categories in the item menu
|
||||
//=============================================================================
|
||||
function Window_OmoMenuItemCategory() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoMenuItemCategory.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoMenuItemCategory.prototype.constructor = Window_OmoMenuItemCategory;
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemCategory.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoMenuItemCategory.prototype.standardPadding = function() { return 10; }
|
||||
Window_OmoMenuItemCategory.prototype.windowWidth = function() { return 384; }
|
||||
Window_OmoMenuItemCategory.prototype.maxCols = function() { return 3; };
|
||||
Window_OmoMenuItemCategory.prototype.lineHeight = function() { return 24; };
|
||||
Window_OmoMenuItemCategory.prototype.standardFontSize = function() { return LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemCategory").standardFontSize; };
|
||||
Window_Selectable.prototype.customCursorRectYOffset = function() { return 4; }
|
||||
Window_OmoMenuItemCategory.prototype.customCursorRectTextXOffset = function() { return 25; }
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemCategory.prototype.makeCommandList = function() {
|
||||
// Get Commands Text
|
||||
var text = LanguageManager.getPluginText('itemMenu', 'categories')
|
||||
// Add Commands
|
||||
this.addCommand(text[0], 'consumables', $gameParty.hasConsumableItems());
|
||||
this.addCommand(text[1], 'toys', $gameParty.hasToyItems());
|
||||
this.addCommand(text[2], 'important', $gameParty.hasKeyItems());
|
||||
};
|
||||
//=============================================================================
|
||||
// * Item Rect
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemCategory.prototype.itemRect = function(index) {
|
||||
// Get rect
|
||||
var rect = Window_Command.prototype.itemRect.call(this, index);
|
||||
rect.width += 20;
|
||||
rect.y -= 3;
|
||||
// If Index 1 (For Visual centering)
|
||||
if (index === 1) { rect.x += 5 };
|
||||
// Return Rect
|
||||
return rect;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Call Update Help
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemCategory.prototype.callUpdateHelp = function() {
|
||||
// Run Original Function
|
||||
Window_Command.prototype.callUpdateHelp.call(this);
|
||||
if (this.active && this._itemWindow) {
|
||||
// Set Item Window Category
|
||||
this._itemWindow.setCategory(this.currentSymbol());
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoMenuItemList
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selecting equipment for an actor
|
||||
//=============================================================================
|
||||
function Window_OmoMenuItemList() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoMenuItemList.prototype = Object.create(Window_ItemList.prototype);
|
||||
Window_OmoMenuItemList.prototype.constructor = Window_OmoMenuItemList;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_ItemList.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());
|
||||
// Set Category
|
||||
this.setCategory('consumables');
|
||||
this.deselect(0)
|
||||
this.deactivate()
|
||||
this.openness = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoMenuItemList.prototype.standardPadding = function() { return 4;}
|
||||
Window_OmoMenuItemList.prototype.windowWidth = function() { return 383 - 147; }
|
||||
Window_OmoMenuItemList.prototype.windowHeight = function() { return 144 - 10; }
|
||||
Window_OmoMenuItemList.prototype.maxCols = function() { return 1; };
|
||||
Window_OmoMenuItemList.prototype.itemHeight = function() { return 26; };
|
||||
Window_OmoMenuItemList.prototype.itemWidth = function() { return 200; };
|
||||
//Window_OmoMenuItemList.prototype.spacing = function() { return 14; };
|
||||
Window_OmoMenuItemList.prototype.customCursorRectXOffset = function() { return -2; }
|
||||
Window_OmoMenuItemList.prototype.isEnabled = function() { return true; };
|
||||
Window_OmoMenuItemList.prototype.customCursorRectTextXOffset = function() { return 24; }
|
||||
Window_OmoMenuItemList.prototype.contentsWidth = function() { return this.windowWidth() - this.standardPadding() * 2; };
|
||||
Window_OmoMenuItemList.prototype.contentsHeight = function() { return this.windowHeight() - this.standardPadding() * 2; };
|
||||
//=============================================================================
|
||||
// * Set Category
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.setCategory = function(category) {
|
||||
// If Category has changed
|
||||
if (this._category !== category) {
|
||||
this._category = category;
|
||||
this.refresh();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if item should be included
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.includes = function(item) {
|
||||
// If Item Exists and it's an item
|
||||
if (item && DataManager.isItem(item)) {
|
||||
if (item.meta.HideInMenu) { return false; };
|
||||
switch (this._category) {
|
||||
case 'consumables': return DataManager.isConsumableItem(item);
|
||||
case 'toys': return DataManager.isToyItem(item);
|
||||
case 'important': return DataManager.isKeyItem(item);
|
||||
};
|
||||
};
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Item List
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.makeItemList = function() {
|
||||
// Run Original Function
|
||||
Window_ItemList.prototype.makeItemList.call(this);
|
||||
// Sort list
|
||||
this._data.sort(function(a, b) {
|
||||
var indexA = a.meta.ListIndex === undefined ? a.id : Number(a.meta.ListIndex);
|
||||
var indexB = b.meta.ListIndex === undefined ? b.id : Number(b.meta.ListIndex);
|
||||
// console.log(a, indexA);
|
||||
// console.log(b, indexB)
|
||||
return indexA - indexB;
|
||||
});
|
||||
if(this._category === "important") {
|
||||
this._data.sort((a,b) => {
|
||||
let priorityA = !!a.meta["ItemPriority"] ? parseInt(a.meta["ItemPriority"]) : 0;
|
||||
let priorityB = !!b.meta["ItemPriority"] ? parseInt(b.meta["ItemPriority"]) : 0;
|
||||
return priorityB - priorityA;
|
||||
})
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Item Rect
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.itemRect = function(index) {
|
||||
// Get Item Rect
|
||||
var rect = Window_ItemList.prototype.itemRect.call(this, index);
|
||||
// Adjust Rect
|
||||
rect.x += 12;
|
||||
rect.y += 8;
|
||||
// Return rect
|
||||
return rect;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh Arrows
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype._refreshArrows = function() {
|
||||
// Super Call
|
||||
Window_ItemList.prototype._refreshArrows.call(this);
|
||||
var w = this._width;
|
||||
var h = this._height;
|
||||
var p = 24;
|
||||
var q = p/2;
|
||||
this._downArrowSprite.move(w - q, h - q);
|
||||
this._upArrowSprite.move(w - q, q);
|
||||
};
|
||||
|
||||
|
||||
Window_OmoMenuItemList.prototype._updateArrows = function() {
|
||||
Window.prototype._updateArrows.call(this);
|
||||
this._downArrowSprite.visible = this._downArrowSprite.visible && !!this.active;
|
||||
this._upArrowSprite.visible = this._upArrowSprite.visible && !!this.active;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Item
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.clearItem = function(index) {
|
||||
var rect = this.itemRect(index);
|
||||
this.contents.clearRect(rect.x, rect.y, rect.width + 5, rect.height);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Item
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemList.prototype.drawItem = function(index) {
|
||||
// Get Rect
|
||||
var rect = this.itemRectForText(index);
|
||||
// Get Item
|
||||
var item = this._data[index]
|
||||
// If Item
|
||||
if (item) {
|
||||
// Set Font Size
|
||||
this.contents.fontSize = LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemList").drawItem_contents_fontsize;
|
||||
rect.width -= 20;
|
||||
// Draw Text
|
||||
this.contents.drawText(item.name, rect.x, rect.y, rect.width, rect.height);
|
||||
rect.width += 5
|
||||
const loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemList").drawItem_drawText_position;
|
||||
this.contents.drawText('x' + $gameParty.numItems(item), eval(loc_position[0]), eval(loc_position[1]), rect.width, rect.height);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoMenuItemConfirmation
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selection actions to perform for items in the item menu.
|
||||
//=============================================================================
|
||||
function Window_OmoMenuItemConfirmation() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoMenuItemConfirmation.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoMenuItemConfirmation.prototype.constructor = Window_OmoMenuItemConfirmation;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemConfirmation.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 0, 0);
|
||||
this.deactivate();
|
||||
this.openness = 0;
|
||||
// Set Item to null
|
||||
this.setItem(null);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemConfirmation.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoMenuItemConfirmation.prototype.standardPadding = function() { return 5; }
|
||||
Window_OmoMenuItemConfirmation.prototype.windowWidth = function() { return 115; }
|
||||
Window_OmoMenuItemConfirmation.prototype.windowHeight = function() { return 68; }
|
||||
Window_OmoMenuItemConfirmation.prototype.lineHeight = function() { return 24; };
|
||||
Window_OmoMenuItemConfirmation.prototype.standardFontSize = function() { return LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemConfirmation").standardFontSize; };
|
||||
Window_OmoMenuItemConfirmation.prototype.spacing = function() { return 0; };
|
||||
Window_OmoMenuItemConfirmation.prototype.customCursorRectTextXOffset = function() { return 30; }
|
||||
//=============================================================================
|
||||
// * Set Item
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemConfirmation.prototype.setItem = function(item) {
|
||||
// Set Item
|
||||
if (item !== this._item) { this._item = item; this.refresh(); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemConfirmation.prototype.makeCommandList = function() {
|
||||
// Get Item
|
||||
var item = this._item;
|
||||
var enableUse = item ? this.parent.canUse($gameParty.members()) : false;
|
||||
var enableTrash = item ? !DataManager.isKeyItem(item) : false;
|
||||
// Get Commands Text
|
||||
var text = LanguageManager.getPluginText('itemMenu', 'itemUse').commands;
|
||||
// Get Text Index
|
||||
var textIndex = item ? item.meta.ItemCommandTextIndex ? Number(item.meta.ItemCommandTextIndex) : 0 : 0;
|
||||
// Add Commands
|
||||
this.addCommand(text[0][textIndex], 'use', enableUse);
|
||||
this.addCommand(text[1], 'trash', enableTrash);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoMenuItemTrashPromptWindow
|
||||
//-----------------------------------------------------------------------------
|
||||
// This Window is used to show a prompt for trashing items
|
||||
//=============================================================================
|
||||
function Window_OmoMenuItemTrashPromptWindow() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.constructor = Window_OmoMenuItemTrashPromptWindow;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 0, 0);
|
||||
// Prompt Text
|
||||
this._promptText = LanguageManager.getPluginText('itemMenu', 'itemTrash').text;
|
||||
// Refresh Contents
|
||||
this.refresh();
|
||||
this.openness = 0;
|
||||
this.deactivate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.windowHeight = function() { return 84 - 16; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.windowWidth = function() { return 125 + 50; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.maxCols = function() { return 2; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.spacing = function() { return 0; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.standardPadding = function() { return 0; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.itemHeight = function() { return 20; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.itemWidth = function() { return 75 + 10; };
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.standardFontSize = function() { return LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemTrashPromptWindow").standardFontSize; };
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.makeCommandList = function() {
|
||||
// Get Commands Text
|
||||
var text = LanguageManager.getPluginText('itemMenu', 'itemTrash').commands;
|
||||
this.addCommand(text[0], 'yes');
|
||||
this.addCommand(text[1], 'cancel');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.refresh = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.refresh.call(this);
|
||||
this.drawText(this._promptText, 0, 0, this.contents.width, 'center');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Item Rect
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.itemRect = function(index) {
|
||||
var rect = Window_Command.prototype.itemRect.call(this, index);
|
||||
// rect.x += 10;
|
||||
rect.y += this.lineHeight() - 5;
|
||||
return rect;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Item Rect For Text
|
||||
//=============================================================================
|
||||
Window_OmoMenuItemTrashPromptWindow.prototype.itemRectForText = function(index) {
|
||||
var rect = this.itemRect(index);
|
||||
rect.x += eval(LanguageManager.getMessageData("XX_BLUE.Window_OmoMenuItemTrashPromptWindow").itemRectForText_rectx);
|
||||
rect.y -= 10;
|
||||
rect.width -= this.textPadding() * 2;
|
||||
return rect;
|
||||
};
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,902 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Map QTE's
|
||||
// Version: 1.5
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_MapQTE = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.MapQTE = _TDS_.MapQTE || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin add event Quick Time Events.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @param Active QTE Switch ID
|
||||
* @desc ID of the switch to turn ON or OFF when QTE's are active.
|
||||
* @default 1
|
||||
*
|
||||
* @param QTE Result Variable ID
|
||||
* @desc ID of the variable to put QTE results into.
|
||||
* @default 1
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Omori Map QTE");
|
||||
// Initialize Parameters
|
||||
_TDS_.MapQTE.params = {};
|
||||
_TDS_.MapQTE.params.activeQTESwitchID = Number(parameters['Active QTE Switch ID'] || 1);
|
||||
_TDS_.MapQTE.params.QTEResultVariableID = Number(parameters['QTE Result Variable ID'] || 1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//ImageManager.reserveSystem('QTE Arrow', 0, 1);
|
||||
//ImageManager.reserveSystem('QTE_OMORI_ATLAS', 0, 1);
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.MapQTE.Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
|
||||
//=============================================================================
|
||||
// * Update Wait Mode
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.updateWaitMode = function() {
|
||||
// If Input Mode is for wait
|
||||
if (this._waitMode === 'QTE') {
|
||||
// If Input has been pressed
|
||||
if (!$gameSwitches.value(_TDS_.MapQTE.params.activeQTESwitchID)) { return false; }
|
||||
return true;
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.MapQTE.Game_Interpreter_updateWaitMode.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start Smash QTE
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.startSmashQTE = function(segments, time, width) {
|
||||
// Turn ON QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, true);
|
||||
// Get Window
|
||||
var win = SceneManager._scene._QTEWindowSmash;
|
||||
// If Window Exists
|
||||
if (win) {
|
||||
win.open();
|
||||
win.activate();
|
||||
win.setup(segments, time, width)
|
||||
};
|
||||
this.setWaitMode('QTE');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start Stop the Arrow QTE
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.startStopTheArrowQTE = function(direction, delay, x, y) {
|
||||
// Turn ON QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, true);
|
||||
// Get Window
|
||||
var win = SceneManager._scene._QTEWindowStopTheArrow;
|
||||
// If Window Exists
|
||||
if (win) {
|
||||
win.open();
|
||||
win.activate();
|
||||
win.setup(direction, delay)
|
||||
if (x !== undefined) { win.x = x; };
|
||||
if (y !== undefined) { win.y = y; };
|
||||
};
|
||||
this.setWaitMode('QTE');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Start Hit the Mark QTE
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.startHitTheMarkQTE = function(speed, index, x, y) {
|
||||
// Turn ON QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, true);
|
||||
// Get Window
|
||||
var win = SceneManager._scene._QTEWindowHitTheMark;
|
||||
// If Window Exists
|
||||
if (win) {
|
||||
if (index === undefined) { index = Math.randomInt(12); };
|
||||
win.open();
|
||||
win.activate();
|
||||
win.setup(speed, index);
|
||||
if (x !== undefined) { win.x = x; };
|
||||
if (y !== undefined) { win.y = y; };
|
||||
};
|
||||
this.setWaitMode('QTE');
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The scene class of the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.MapQTE.Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
|
||||
//=============================================================================
|
||||
// * Create Display Objects
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.createDisplayObjects = function() {
|
||||
// Run Original Function
|
||||
_TDS_.MapQTE.Scene_Map_createDisplayObjects.call(this);
|
||||
// Create QTE Windows
|
||||
this.createQTEWindows();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create QTE Windows
|
||||
//=============================================================================
|
||||
Scene_Map.prototype.createQTEWindows = function() {
|
||||
// Create Smash QTE Window
|
||||
this._QTEWindowSmash = new Window_OmoriMapQTESmash();
|
||||
this.addChild(this._QTEWindowSmash);
|
||||
// Create Stop the Arrow QTE window
|
||||
this._QTEWindowStopTheArrow = new Window_OmoriStopTheArrow();
|
||||
this.addChild(this._QTEWindowStopTheArrow);
|
||||
// // Create Hit The Mark QTE Window
|
||||
this._QTEWindowHitTheMark = new Window_OmoriHitTheMark();
|
||||
this.addChild(this._QTEWindowHitTheMark)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriMapQTESmash
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to display the Smash QTE.
|
||||
//=============================================================================
|
||||
function Window_OmoriMapQTESmash() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriMapQTESmash.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoriMapQTESmash.prototype.constructor = Window_OmoriMapQTESmash;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.initialize = function() {
|
||||
|
||||
// Completed Segments
|
||||
this._segment = 0;
|
||||
// Press Count
|
||||
this._pressCount = 0;
|
||||
// Press Timer
|
||||
this._timer = 300;
|
||||
// Max Timer
|
||||
this._maxTimer = 300;
|
||||
// Segment Presses
|
||||
this._segmentPresses = [5];
|
||||
// Alt State & Alt Delay
|
||||
this._altState = 0; this._altDelay = 0;
|
||||
// Close Delay
|
||||
this._closeDelay = 30;
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 14, 14, this.windowWidth(), this.windowHeight());
|
||||
|
||||
// Create Bar Sprite
|
||||
this.createBarSprite();
|
||||
// Create Parallax BAckground
|
||||
this.createParallaxBack();
|
||||
|
||||
this.deactivate();
|
||||
this.openness = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.standardPadding = function() { return 0; };
|
||||
Window_OmoriMapQTESmash.prototype.windowWidth = function() { return 300; };
|
||||
Window_OmoriMapQTESmash.prototype.windowHeight = function() { return 42 + 5; };
|
||||
//=============================================================================
|
||||
// * Define Openness
|
||||
//=============================================================================
|
||||
Object.defineProperty(Window_OmoriMapQTESmash.prototype, 'openness', {
|
||||
get: function() { return this._openness; },
|
||||
set: function(value) {
|
||||
// Super Call
|
||||
Object.getOwnPropertyDescriptor(Window.prototype, 'openness').set.call(this, value);
|
||||
// If Background Exists
|
||||
if (this._smashBarSprite) {
|
||||
var scale = this._openness / 255;
|
||||
this._smashBarSprite.scale.y = scale
|
||||
this._smashBarSprite.y = 5 + (this.height / 2 * (1 - this._openness / 255));
|
||||
|
||||
this._parallaxBack.y = 4 + (this.height / 2 * (1 - this._openness / 255));
|
||||
this._parallaxBack.scale.y = scale
|
||||
|
||||
this._timeBarSprite.y = (this.height - 7) + (this.height / 2 * (1 - this._openness / 255));
|
||||
this._timeBarSprite.scale.y = scale;
|
||||
};
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
//=============================================================================
|
||||
// * Create Bar Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.createParallaxBack = function() {
|
||||
this._parallaxBack = new TilingSprite();
|
||||
this._parallaxBack.bitmap = ImageManager.loadSystem('QTE Smash Background');
|
||||
this._parallaxBack.move(5, 5, this.width - 10, 32);
|
||||
this._parallaxBack.opacity = 180
|
||||
this.addChildToBack(this._parallaxBack);
|
||||
}
|
||||
//=============================================================================
|
||||
// * Create Bar Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.createBarSprite = function() {
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(this.width - 8, this.height - 37);
|
||||
bitmap.fillAll('rgba(255, 0, 0, 1)');
|
||||
// Create Bar Sprite
|
||||
this._smashBarSprite = new Sprite(bitmap);
|
||||
this._smashBarSprite.width = 0
|
||||
this._smashBarSprite.opacity = 180
|
||||
this._smashBarSprite.x = 5;
|
||||
this._smashBarSprite.y = 5;
|
||||
this.addChildToBack(this._smashBarSprite);
|
||||
|
||||
// Create Time Bar Sprite
|
||||
this._timeBarSprite = new Sprite();
|
||||
this._timeBarSprite.x = 5;
|
||||
this._timeBarSprite.y = this.height - 7;
|
||||
this.addChild(this._timeBarSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.setup = function(segments = [5], time = 10, width = 400) {
|
||||
// Set Values
|
||||
this._segment = 0;
|
||||
this._pressCount = 0;
|
||||
this._timer = time
|
||||
this._maxTimer = time;
|
||||
this._segmentPresses = segments.clone();
|
||||
this._closeDelay = 61;
|
||||
// Alt State & Alt Delay
|
||||
this._altState = 0; this._altDelay = 0;
|
||||
// Reset Blend Color
|
||||
this._smashBarSprite.setBlendColor([0, 0, 0, 0]);
|
||||
// Refresh Contents
|
||||
this.refresh();
|
||||
// Update Smash Bar
|
||||
this.updateSmashBar();
|
||||
// Update Timer Bar
|
||||
this.updateTimeBar();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.refresh = function() {
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(this.width - 10, this.height - 15);
|
||||
bitmap.fillAll('rgba(255, 0, 0, 1)');
|
||||
// Create Bar Sprite
|
||||
this._smashBarSprite.bitmap = bitmap;
|
||||
// Recreate Contents
|
||||
this.createContents();
|
||||
// Create Time Bar Bitmap
|
||||
bitmap = new Bitmap(this.width - 10, 2);
|
||||
bitmap.fillAll('rgba(255, 255, 0, 1)');
|
||||
this._timeBarSprite.bitmap = bitmap;
|
||||
|
||||
var segments = this._segmentPresses.length;
|
||||
this._segmentWidth = this.width / segments;
|
||||
|
||||
this.contents.fillRect(4, this.height - 11, this.width - 8, 2, 'rgba(0, 0, 0, 1)');
|
||||
this.contents.fillRect(4, this.height - 10, this.width - 8, 2, 'rgba(255, 255, 255, 1)');
|
||||
|
||||
// console.log( this._segmentWidth )
|
||||
for (var i = 1; i < segments; i++) {
|
||||
var x = i * this._segmentWidth;
|
||||
this.contents.fillRect(x - 1, 4, 3, this.height - 14, 'rgba(0, 0, 0, 1)');
|
||||
this.contents.fillRect(x, 4, 1, this.height - 14, 'rgba(255, 255, 255, 1)');
|
||||
};
|
||||
|
||||
this.x = (Graphics.width - this.width) / 2;
|
||||
this.y = (Graphics.height - this.height) / 2;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Finish Processing
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.finish = function() {
|
||||
// Turn ON QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, false);
|
||||
// Set Achieved Segment
|
||||
$gameVariables.setValue(_TDS_.MapQTE.params.QTEResultVariableID, this._segment);
|
||||
// Close & Deactivate
|
||||
this.close(); this.deactivate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Are Smash Keys Being Triggered
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.isSmashTriggered = function() {
|
||||
return Input.isTriggered('ok');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.update = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.update.call(this);
|
||||
// If not open or active
|
||||
if (!this.isOpen() || !this.active) { return; };
|
||||
// Get Background Speed Rate
|
||||
var rate = this._segment / (Math.max(this._segmentPresses.length-1,1));
|
||||
// Get Speed
|
||||
var speed = Math.max(rate * 5, 1.5);
|
||||
// Move Parallax Back
|
||||
this._parallaxBack.origin.x -= speed;
|
||||
// If Timer is 0 or less
|
||||
if (this._timer <= 0) {
|
||||
// Finish
|
||||
this.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._timer > 0) { this._timer--; this.updateTimeBar(); };
|
||||
if (this._segment < this._segmentPresses.length) {
|
||||
|
||||
if (this.isSmashTriggered()) {
|
||||
// Increase Press Count
|
||||
this._pressCount++;
|
||||
|
||||
if (this._pressCount >= this._segmentPresses[this._segment]) {
|
||||
this._segment++;
|
||||
this._pressCount = 0;
|
||||
this.updateSmashBar();
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// Decrease alt delay
|
||||
this._altDelay--;
|
||||
if (this._altDelay <= 0) {
|
||||
if (this._altState === 0) {
|
||||
this._smashBarSprite.setBlendColor([255, 255, 255, 255])
|
||||
} else {
|
||||
this._smashBarSprite.setBlendColor([0, 0, 0, 0]);
|
||||
};
|
||||
this._altState = (this._altState + 1) % 2
|
||||
this._altDelay = 10;
|
||||
};
|
||||
// Decrease Close Delay
|
||||
if (this._closeDelay > 0) { this._closeDelay--; }
|
||||
// If Timer is 0 or less or close delay is 0 or less
|
||||
if (this._timer <= 0 || this._closeDelay <= 0) { this.finish() }
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Smash Bar
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.updateSmashBar = function() {
|
||||
// Get Original Width
|
||||
var width = this._segment * (this._segmentWidth );
|
||||
this._smashBarSprite.width = width - 3;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Time Bar
|
||||
//=============================================================================
|
||||
Window_OmoriMapQTESmash.prototype.updateTimeBar = function() {
|
||||
// Get Original Width
|
||||
var width = this._timeBarSprite.bitmap.width;
|
||||
var rate = this._timer / this._maxTimer;
|
||||
// Set Timer Width
|
||||
this._timeBarSprite.width = rate * width;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriStopTheArrow
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to display the stop the arrow QTE.
|
||||
//=============================================================================
|
||||
function Window_OmoriStopTheArrow() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriStopTheArrow.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoriStopTheArrow.prototype.constructor = Window_OmoriStopTheArrow;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.initialize = function(index) {
|
||||
this._arrowIndex = 0;
|
||||
this._arrowDelay = 10;
|
||||
this._arrowDelayCount = 0;
|
||||
// Arrow Direction (0: Right, 1: Left)
|
||||
this._arrowDirection = 0;
|
||||
// Facing Direction
|
||||
this._facingDirection = 'up';
|
||||
// Set Container Y
|
||||
this._containerY = 0;
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 14, 200, this.windowWidth(), this.windowHeight());
|
||||
ImageManager.loadSystem('QTE Arrow')
|
||||
// Create Background Sprite
|
||||
this.createBackgroundSprite();
|
||||
this.createArrowSprites();
|
||||
// Center Window
|
||||
this.x = (Graphics.width - this.width) / 2;
|
||||
this.y = (Graphics.height - this.height) / 2;
|
||||
// Close
|
||||
this.openness = 0;
|
||||
this.deactivate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.standardPadding = function() { return 0; };
|
||||
Window_OmoriStopTheArrow.prototype.windowWidth = function() { return 96; };
|
||||
Window_OmoriStopTheArrow.prototype.windowHeight = function() { return 83; };
|
||||
//=============================================================================
|
||||
// * Define Openness
|
||||
//=============================================================================
|
||||
Object.defineProperty(Window_OmoriStopTheArrow.prototype, 'openness', {
|
||||
get: function() { return this._openness; },
|
||||
set: function(value) {
|
||||
// Super Call
|
||||
Object.getOwnPropertyDescriptor(Window.prototype, 'openness').set.call(this, value);
|
||||
// If Background Exists
|
||||
if (this._arrowContainer) {
|
||||
var scale = this._openness / 255;
|
||||
if (['up', 'down'].contains(this._facingDirection)) {
|
||||
this._arrowContainer.scale.x = 1;
|
||||
this._arrowContainer.scale.y = scale;
|
||||
} else {
|
||||
this._arrowContainer.scale.x = scale;
|
||||
this._arrowContainer.scale.y = 1;
|
||||
}
|
||||
};
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
//=============================================================================
|
||||
// * Create Background Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.createBackgroundSprite = function() {
|
||||
// Create Arrow Container
|
||||
this._arrowContainer = new Sprite();
|
||||
// this._arrowContainer.bitmap.fillAll('rgba(255, 0, 0, 1)');
|
||||
this._arrowContainer.pivot.x = 43;
|
||||
this._arrowContainer.pivot.y = 36.5;
|
||||
this._arrowContainer.x = this.width / 2;
|
||||
this._arrowContainer.y = this.height / 2;
|
||||
this.addChildToBack(this._arrowContainer);
|
||||
|
||||
// Create Background Sprite
|
||||
// this._backgroundSprite = new Sprite(ImageManager.loadSystem('QTE Arrow'));
|
||||
this._backgroundSprite = new Sprite(ImageManager.loadSystem('QTE Arrow'));
|
||||
this._backgroundSprite.bitmap.addLoadListener(() => {this._backgroundSprite.setFrame(0, 0, 86,this._backgroundSprite.height)})
|
||||
|
||||
// this._backgroundSprite.opacity = 120;
|
||||
// this._backgroundSprite.pivot.x = 43;
|
||||
// this._backgroundSprite.pivot.y = 36.5;
|
||||
// this._backgroundSprite.rotation = Math.PI / 16;
|
||||
// this._backgroundSprite.x = this.width / 2;
|
||||
// this._backgroundSprite.y = this.height / 2;
|
||||
this._arrowContainer.addChild(this._backgroundSprite);
|
||||
// this._backgroundSprite.rotation = (0 * 90) * Math.PI / 180
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Arrow Sprites
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.createArrowSprites = function() {
|
||||
// Initialize Arrow Sprites Array
|
||||
this._arrowSprites = [];
|
||||
var bit = ImageManager.loadSystem('QTE Arrow');
|
||||
// Create Sprites
|
||||
bit.addLoadListener(() => {
|
||||
for (var i = 0; i < 3; i++) {
|
||||
var sprite = new Sprite(ImageManager.loadSystem('QTE Arrow'));
|
||||
this._arrowSprites[i] = sprite;
|
||||
this._arrowContainer.addChild(sprite);
|
||||
};
|
||||
|
||||
var sprite = this._arrowSprites[0];
|
||||
sprite.setFrame(86, 0, 39, sprite.bitmap.height);
|
||||
sprite.x = 7 - 5; sprite.y = 17 - 5;
|
||||
|
||||
|
||||
sprite = this._arrowSprites[1];
|
||||
sprite.setFrame(125, 0, 36, sprite.bitmap.height);
|
||||
sprite.x = 35 - 5; sprite.y = 12 - 5;
|
||||
|
||||
sprite = this._arrowSprites[2];
|
||||
sprite.setFrame(163, 0, 36, sprite.bitmap.height);
|
||||
sprite.x = 63 - 5; sprite.y = 17 - 5;
|
||||
|
||||
// Update Arrows Visibility
|
||||
this.updateArrowsVisibility();
|
||||
})
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.setup = function(direction = 'up', delay = 10) {
|
||||
// Direction Switch Case
|
||||
switch (direction.toLowerCase()) {
|
||||
case 'up':
|
||||
this._arrowContainer.rotation = (0 * 90) * Math.PI / 180
|
||||
this.width = 96; this.height = 83;
|
||||
break;
|
||||
case 'left':
|
||||
this._arrowContainer.rotation = (3 * 90) * Math.PI / 180
|
||||
this.width = 96 - 14; this.height = 83 + 12;
|
||||
break;
|
||||
case 'right':
|
||||
this._arrowContainer.rotation = (1 * 90) * Math.PI / 180
|
||||
this.width = 96 - 14; this.height = 83 + 12;
|
||||
break;
|
||||
case 'down':
|
||||
this.width = 96; this.height = 83;
|
||||
this._arrowContainer.rotation = (2 * 90) * Math.PI / 180
|
||||
break;
|
||||
};
|
||||
// Set Facing Direction
|
||||
this._facingDirection = direction;
|
||||
// Reset Delay
|
||||
this._arrowIndex = Math.randomInt(this._arrowSprites.length);
|
||||
this._arrowDelay = delay;
|
||||
this._arrowDelayCount = 0;
|
||||
// Set Arrow Direction
|
||||
this._arrowDirection = 0;
|
||||
// Center Background Sprite
|
||||
this._arrowContainer.x = this.width / 2;
|
||||
this._arrowContainer.y = this.height / 2;
|
||||
// Update Arrow Visibility
|
||||
this.updateArrowsVisibility();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.update = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.update.call(this);
|
||||
|
||||
// if (Input.isTriggered('control')) {
|
||||
|
||||
// if (this.isOpen()) { this.close(); };
|
||||
// if (this.isClosed()) { this.open();};
|
||||
// };
|
||||
|
||||
// var directions = ['up', 'down', 'left', 'right'];
|
||||
|
||||
// for (var i = 0; i < directions.length; i++) {
|
||||
// // Get Direction
|
||||
// var direction = directions[i];
|
||||
// if (Input.isTriggered(direction)) {
|
||||
// this.setup(directions[i])
|
||||
// break;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// If Open & Active
|
||||
if (this.active && this.isOpen()) {
|
||||
// If OK Input
|
||||
if (Input.isTriggered('ok')) {
|
||||
this.finish();
|
||||
return
|
||||
};
|
||||
// Increase Arrow Delay Count
|
||||
this._arrowDelayCount++;
|
||||
// If Arrow Delay Count is equal or more than arrow delay
|
||||
if (this._arrowDelayCount >= this._arrowDelay) {
|
||||
// Reset Arrow Delay Count
|
||||
this._arrowDelayCount = 0;
|
||||
// If Arrow Direction is 0
|
||||
if (this._arrowDirection === 0) {
|
||||
// If Arrow has reached the other side
|
||||
if (this._arrowIndex >= this._arrowSprites.length-1) {
|
||||
// Reduce Index
|
||||
this._arrowIndex--;
|
||||
AudioManager.playSe({name: "sys_cursor1", pan: 0, pitch: 100, volume: 90});
|
||||
// Set Arrow Direction
|
||||
this._arrowDirection = 1;
|
||||
} else {
|
||||
// Increase Index
|
||||
AudioManager.playSe({name: "SYS_cursor", pan: 0, pitch: 100, volume: 90});
|
||||
this._arrowIndex++;
|
||||
};
|
||||
} else {
|
||||
if (this._arrowIndex <= 0) {
|
||||
// Increase Index
|
||||
AudioManager.playSe({name: "sys_cursor1", pan: 0, pitch: 100, volume: 90});
|
||||
this._arrowIndex++;
|
||||
|
||||
// Set Arrow Direction
|
||||
this._arrowDirection = 0;
|
||||
} else {
|
||||
AudioManager.playSe({name: "SYS_cursor", pan: 0, pitch: 100, volume: 90});
|
||||
// Reduce Index
|
||||
this._arrowIndex--;
|
||||
};
|
||||
}
|
||||
this.updateArrowsVisibility();
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Visibility of Arrows
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.updateArrowsVisibility = function() {
|
||||
for (var i = 0; i < this._arrowSprites.length; i++) {
|
||||
this._arrowSprites[i].visible = (this._arrowIndex === i);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Finish Processing
|
||||
//=============================================================================
|
||||
Window_OmoriStopTheArrow.prototype.finish = function() {
|
||||
// Turn ON QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, false);
|
||||
// Set Achieved Segment
|
||||
$gameVariables.setValue(_TDS_.MapQTE.params.QTEResultVariableID, this._arrowIndex);
|
||||
// Close & Deactivate
|
||||
this.close(); this.deactivate();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriHitTheMark
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window is used to display the hit the mark QTE.
|
||||
//=============================================================================
|
||||
function Window_OmoriHitTheMark() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriHitTheMark.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoriHitTheMark.prototype.constructor = Window_OmoriHitTheMark;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.initialize = function() {
|
||||
// Pointer Move Speed
|
||||
this._speed = 3;
|
||||
// Movement Direction
|
||||
this._direction = 0;
|
||||
// Set Target Index
|
||||
this._targetIndex = 0;
|
||||
// Set Target Width
|
||||
this._targetWidth = 3 + (this._speed * 2);
|
||||
// Target X
|
||||
this._targetX = 0;
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 14, 0, this.windowWidth(), this.windowHeight());
|
||||
|
||||
// Create Background Sprite
|
||||
this.createBackgroundSprite();
|
||||
// Create Pointer
|
||||
this.createPointer();
|
||||
// Center Window
|
||||
this.x = (Graphics.width - this.width) / 2;
|
||||
this.y = (Graphics.height - this.height) / 2;
|
||||
// Refresh Contents
|
||||
this.refresh();
|
||||
|
||||
this.deactivate();
|
||||
this.openness = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.standardPadding = function() { return 0; };
|
||||
Window_OmoriHitTheMark.prototype.windowWidth = function() { return 216; };
|
||||
Window_OmoriHitTheMark.prototype.windowHeight = function() { return 66; };
|
||||
//=============================================================================
|
||||
// * Define Openness
|
||||
//=============================================================================
|
||||
Object.defineProperty(Window_OmoriHitTheMark.prototype, 'openness', {
|
||||
get: function() { return this._openness; },
|
||||
set: function(value) {
|
||||
// Super Call
|
||||
Object.getOwnPropertyDescriptor(Window.prototype, 'openness').set.call(this, value);
|
||||
// If Background Sprite Exists
|
||||
if (this._backgroundSprite) {
|
||||
var scale = this._openness / 255;
|
||||
this._backgroundSprite.scale.y = scale;
|
||||
};
|
||||
// If Background Exists
|
||||
if (this._smashBarSprite) {
|
||||
var scale = this._openness / 255;
|
||||
this._smashBarSprite.scale.y = scale
|
||||
this._smashBarSprite.y = 5 + (this.height / 2 * (1 - this._openness / 255));
|
||||
|
||||
this._parallaxBack.y = 4 + (this.height / 2 * (1 - this._openness / 255));
|
||||
this._parallaxBack.scale.y = scale
|
||||
|
||||
this._timeBarSprite.y = (this.height - 7) + (this.height / 2 * (1 - this._openness / 255));
|
||||
this._timeBarSprite.scale.y = scale;
|
||||
};
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
//=============================================================================
|
||||
// * Create Background Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.createBackgroundSprite = function() {
|
||||
// Create Background Sprite
|
||||
this._backgroundSprite = new Sprite(ImageManager.loadSystem('QTE_OMORI_ATLAS'));
|
||||
this._backgroundSprite.bitmap.addLoadListener(() => {
|
||||
this._backgroundSprite.setFrame(0, 0, 206, 56);
|
||||
this._backgroundSprite.x = 5;
|
||||
this._backgroundSprite.y = 33;
|
||||
this._backgroundSprite.anchor.y = 0.5;
|
||||
})
|
||||
this.addChildToBack(this._backgroundSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Pointer Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.createPointer = function() {
|
||||
// // Create Pointer Bitmap
|
||||
// var bitmap = new Bitmap(12, 6);
|
||||
// for (var i = 0; i < 6; i++) {
|
||||
// var x = i
|
||||
// var y = bitmap.height - i;
|
||||
// var w = bitmap.width - (i * 2)
|
||||
// bitmap.fillRect(x, y, w, 1, 'rgba(255, 255, 255, 1)');
|
||||
// };
|
||||
// // Create Pointer
|
||||
// this._pointer = new Sprite(bitmap);
|
||||
// this._pointer.x = 32
|
||||
// this._pointer.anchor.set(0.5, 0.5)
|
||||
// this._pointer.y = this.height - 8;
|
||||
// this._pointer.visible = false;
|
||||
// this.addChild(this._pointer);
|
||||
|
||||
// Create Pointer
|
||||
this._pointer = new Sprite(ImageManager.loadSystem('ACSArrows'));
|
||||
this._pointer.setFrame(3 * 32, 0, 32, 29);
|
||||
this._pointer.x = 32
|
||||
this._pointer.anchor.set(0.5, 0.5)
|
||||
this._pointer.y = this.height + 5;
|
||||
this._pointer.visible = false;
|
||||
this.addChild(this._pointer);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.setup = function(speed, index) {
|
||||
// Pointer Move Speed
|
||||
this._speed = speed;
|
||||
// Movement Direction
|
||||
this._direction = 0;
|
||||
// Set Target Index Randomly
|
||||
this._targetIndex = index;
|
||||
// Set Stop Flag to false
|
||||
this._stop = false;
|
||||
// Redraw Contents
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.refresh = function() {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Get Bitmap
|
||||
var bitmap = ImageManager.loadSystem('QTE_OMORI_ATLAS');
|
||||
// console.log(lineSpaceWidth)
|
||||
var index = this._targetIndex;
|
||||
// Get X Position
|
||||
var x = 11 + (index * 17) - index;
|
||||
// Set Paint Opacity
|
||||
this.contents.paintOpacity = 160;
|
||||
|
||||
bitmap.addLoadListener(() => {
|
||||
switch (this._speed) {
|
||||
case 2:
|
||||
// Set Target Width
|
||||
this._targetWidth = 9;
|
||||
// Adjust X Position by speed
|
||||
x -= 4;
|
||||
// Transfer Bitmap to window
|
||||
this.contents.blt(bitmap, 209, 0, this._targetWidth, bitmap.height, x, 0);
|
||||
break;
|
||||
case 4:
|
||||
// Adjust X Position by speed
|
||||
x -= 7;
|
||||
// Set Target Width
|
||||
this._targetWidth = 15;
|
||||
// Transfer Bitmap to window
|
||||
this.contents.blt(bitmap, 225, 0, this._targetWidth, bitmap.height, x, 0);
|
||||
break;
|
||||
};
|
||||
this.contents.paintOpacity = 255;
|
||||
})
|
||||
|
||||
// Set Target X
|
||||
this._targetX = x;
|
||||
// Set Paint Opacity
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Finish Processing
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.finish = function() {
|
||||
var padding = 4;
|
||||
var startX = this._targetX - padding;
|
||||
var endX = this._targetX + this._targetWidth + padding;
|
||||
// Check if in Area
|
||||
var inArea = (startX < this._pointer.x && this._pointer.x < endX);
|
||||
// Turn Off QTE Switch
|
||||
$gameSwitches.setValue(_TDS_.MapQTE.params.activeQTESwitchID, false);
|
||||
// Set Achieved Segment
|
||||
$gameVariables.setValue(_TDS_.MapQTE.params.QTEResultVariableID, inArea ? 1 : 0);
|
||||
// Close & Deactivate
|
||||
this.close(); this.deactivate();
|
||||
// Set Visibility to true
|
||||
this._pointer.visible = false;
|
||||
}
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_OmoriHitTheMark.prototype.update = function() {
|
||||
// Super Call
|
||||
Window_Base.prototype.update.call(this);
|
||||
// Return if Stopped
|
||||
if (this._stop || !this.active) { return }
|
||||
// Set Visibility to true
|
||||
this._pointer.visible = true;
|
||||
// If Ok Triggered
|
||||
if (Input.isTriggered('ok')) {
|
||||
// Set stop flag to true
|
||||
this._stop = true;
|
||||
// Finish
|
||||
this.finish();
|
||||
return
|
||||
};
|
||||
|
||||
|
||||
// Get Speed
|
||||
var speed = this._speed;
|
||||
// Get Left & Right Borders
|
||||
var left = 11;
|
||||
var right = this.width - 11;
|
||||
|
||||
// If Direction is 0 (Left)
|
||||
if (this._direction === 0) {
|
||||
if (this._pointer.x <= left ) {
|
||||
this._direction = 1;
|
||||
} else {
|
||||
this._pointer.x = Math.max(this._pointer.x - speed, left);
|
||||
};
|
||||
} else {
|
||||
if (this._pointer.x >= right) {
|
||||
this._direction = 0;
|
||||
} else {
|
||||
this._pointer.x = Math.min(this._pointer.x + speed, right);
|
||||
};
|
||||
};
|
||||
};
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,745 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Omori Quest Menu
|
||||
// Version: 1.3
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {}; Imported.TDS_QuestMenu = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {}; _TDS_.QuestMenu = _TDS_.QuestMenu || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Quest Menu for OMORI.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @param Opening Message
|
||||
* @desc The Message to show when the quest menu is called.
|
||||
* @default ""
|
||||
*
|
||||
*
|
||||
* @param World Variable ID
|
||||
* @desc ID of the variable used to track the current world.
|
||||
* @default 1
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* * Script Calls
|
||||
* ============================================================================
|
||||
*
|
||||
* Use this script call to call the quest menu.
|
||||
*
|
||||
* this.callQuestMenu();
|
||||
*
|
||||
*
|
||||
*
|
||||
* Use this script call to add a quest.
|
||||
*
|
||||
* this.addQuest(ID);
|
||||
*
|
||||
* ID
|
||||
* ^ Id of the quest.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* this.addQuest('Quest4');
|
||||
*
|
||||
*
|
||||
*
|
||||
* Use this script call to remove a quest.
|
||||
*
|
||||
* this.removeQuest(ID);
|
||||
*
|
||||
* ID
|
||||
* ^ Id of the quest.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* this.removeQuest('Quest4');
|
||||
*
|
||||
*
|
||||
*
|
||||
* Use this script call to set the complete state of a quest.
|
||||
*
|
||||
* this.setQuestCompleteState(ID, STATE);
|
||||
*
|
||||
* ID
|
||||
* ^ Id of the quest.
|
||||
*
|
||||
* STATE
|
||||
* ^ State of the quest. (true/false) (Optiona: Defaults to true)
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* this.setQuestCompleteState('Quest1');
|
||||
*
|
||||
* this.setQuestCompleteState('Quest4', true);
|
||||
*
|
||||
* this.setQuestCompleteState('Quest5', false);
|
||||
*
|
||||
*
|
||||
* Use this script call to set a quest's message index.
|
||||
*
|
||||
* this.setQuestMessageIndex(ID, INDEX);
|
||||
*
|
||||
* ID
|
||||
* ^ Id of the quest.
|
||||
*
|
||||
* INDEX
|
||||
* ^ Index value.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* this.setQuestMessageIndex('Quest4', 1);
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Omori Quest Menu");
|
||||
// Initialize Parameters
|
||||
_TDS_.QuestMenu.params = {};
|
||||
_TDS_.QuestMenu.params.worldVariableID = Number(parameters['World Variable ID'] || 1);
|
||||
_TDS_.QuestMenu.params.openingMessage = String(parameters['Opening Message'] || '');
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the party. Information such as gold and items is
|
||||
// included.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.QuestMenu.DataManager_loadDatabase = DataManager.loadDatabase;
|
||||
//=============================================================================
|
||||
// * Load Database
|
||||
//=============================================================================
|
||||
DataManager.loadDatabase = function () {
|
||||
// Run Original Function
|
||||
_TDS_.QuestMenu.DataManager_loadDatabase.call(this);
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var yaml = require('./js/libs/js-yaml-master')
|
||||
// Load Quests
|
||||
window['$dataQuests'] = jsyaml.load(fs.readFileSync('data/Quests.yaml', 'utf8'));
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Party
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the party. Information such as gold and items is
|
||||
// included.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.QuestMenu.Game_Party_initialize = Game_Party.prototype.initialize;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Party.prototype.initialize = function () {
|
||||
// Run Original Function
|
||||
_TDS_.QuestMenu.Game_Party_initialize.call(this);
|
||||
// Initialize Quest List
|
||||
this._questList = [];
|
||||
// Quest Stand By Message
|
||||
this._questStandByMessage = null;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Stand By Message
|
||||
//=============================================================================
|
||||
Game_Party.prototype.setQuestStandByMessage = function (message) {
|
||||
this._questStandByMessage = message;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Quest
|
||||
//=============================================================================
|
||||
Game_Party.prototype.addQuest = function (id, data = {}) {
|
||||
// If You don't have quest already
|
||||
if (!this.hasQuest(id, false)) {
|
||||
// Get World
|
||||
var world = $dataQuests.quests[id].world;
|
||||
// Create Quest Object
|
||||
var quest = { id: id, messageIndex: 0, world: world, complete: false };
|
||||
// Assign Data to Quest
|
||||
Object.assign(quest, data);
|
||||
// Add Quest to Quest List
|
||||
this._questList.push(quest)
|
||||
// Return Added Quest
|
||||
return quest;
|
||||
};
|
||||
// Return False
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Quest
|
||||
//=============================================================================
|
||||
Game_Party.prototype.removeQuest = function (id) {
|
||||
// Get List of Quests to remove
|
||||
var list = this._questList.filter(function (quest) { return quest.id === id; })
|
||||
// Go Through List
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
// Get Index of Quest to remove
|
||||
var index = this._questList.indexOf(list[i]);
|
||||
// Remove Quest
|
||||
if (index >= 0) { this._questList.splice(index, 1); };
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if you have quest already
|
||||
//=============================================================================
|
||||
Game_Party.prototype.hasQuest = function (id, completed = true) {
|
||||
return this._questList.some(function (quest) { return quest.id === id });
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Completed Quest List
|
||||
//=============================================================================
|
||||
Game_Party.prototype.completedQuestList = function (world = 0) {
|
||||
return this._questList.filter(function (quest) { return quest.complete && quest.world === world; });
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Incomplete Quest List
|
||||
//=============================================================================
|
||||
Game_Party.prototype.incompleteQuestList = function (world = 0) {
|
||||
return this._questList.filter(function (quest) { return !quest.complete && quest.world === world; });
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Quest Complete State
|
||||
//=============================================================================
|
||||
Game_Party.prototype.setQuestCompleteState = function (id, state = true) {
|
||||
for (var i = 0; i < this._questList.length; i++) {
|
||||
var quest = this._questList[i];
|
||||
if (quest.id === id) { quest.complete = state; };
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Quest Message Index
|
||||
//=============================================================================
|
||||
Game_Party.prototype.setQuestMessageIndex = function (id, index) {
|
||||
// Get Quest
|
||||
var quest = this._questList.find(function (q) { return q.id === id; });
|
||||
// Set Quest Message Index
|
||||
if (quest) { quest.messageIndex = index; };
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Call Quest Menu
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.callQuestMenu = function () {
|
||||
SceneManager.push(Scene_OmoriQuest);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Quest
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.addQuest = function (id, data) {
|
||||
$gameParty.addQuest(id, data);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Quest
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.removeQuest = function (id) {
|
||||
$gameParty.removeQuest(id);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Quest Complete State
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setQuestCompleteState = function (id, state) {
|
||||
$gameParty.setQuestCompleteState(id, state);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Quest Message Index
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setQuestMessageIndex = function (id, index) {
|
||||
$gameParty.setQuestMessageIndex(id, index);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_OmoriQuest
|
||||
//-----------------------------------------------------------------------------
|
||||
// Base Class for Omori Menu Scenes
|
||||
//=============================================================================
|
||||
function Scene_OmoriQuest() { this.initialize.apply(this, arguments); }
|
||||
Scene_OmoriQuest.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_OmoriQuest.prototype.constructor = Scene_OmoriQuest;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.initialize = function () {
|
||||
// Super Call
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
// Update Window Cursors Flag
|
||||
this._updateWindowCursors = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.create = function () {
|
||||
// Super Call
|
||||
Scene_Base.prototype.create.call(this);
|
||||
// Create Background
|
||||
this.createBackground();
|
||||
// Create Quest Windows
|
||||
this.createQuestWindows();
|
||||
// Create Message Window
|
||||
this.createMessageWindow();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.start = function () {
|
||||
// Super Call
|
||||
Scene_Base.prototype.start.call(this);
|
||||
// If there's an opening message
|
||||
if (_TDS_.QuestMenu.params.openingMessage.length > 0) {
|
||||
// Set Starting Message
|
||||
$gameMessage.showLanguageMessage(_TDS_.QuestMenu.params.openingMessage);
|
||||
};
|
||||
// Set Update Wait Cursors Flag to true
|
||||
this._updateWindowCursors = true;
|
||||
this._questListWindow.updateCustomCursorRectSprite();
|
||||
this._questTypesWindows.updateCustomCursorRectSprite();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.createBackground = function () {
|
||||
this._backgroundSprite = new Sprite();
|
||||
this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
|
||||
this.addChild(this._backgroundSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Quest Windows
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.createQuestWindows = function () {
|
||||
// Create Quest Header Window
|
||||
this._questHeaderWindow = new Window_OmoriQuestHeader()
|
||||
this.addChild(this._questHeaderWindow);
|
||||
// Create Quest Types Window
|
||||
this._questTypesWindows = new Window_OmoriQuestTypes();
|
||||
this._questTypesWindows.y = this._questHeaderWindow.y + this._questHeaderWindow.height + 2;
|
||||
this._questTypesWindows.setHandler('ok', this.onQuestTypesOk.bind(this));
|
||||
this._questTypesWindows.setHandler('cancel', this.popScene.bind(this));
|
||||
this.addChild(this._questTypesWindows);
|
||||
// Create Quest List Window
|
||||
this._questListWindow = new Window_OmoriQuestList();
|
||||
this._questListWindow.x = this._questTypesWindows.x + this._questTypesWindows.width + 2;
|
||||
this._questListWindow.y = this._questTypesWindows.y;
|
||||
this._questListWindow.setHandler('ok', this.onQuestListOk.bind(this));
|
||||
this._questListWindow.setHandler('cancel', this.onQuestListCancel.bind(this));
|
||||
this.addChild(this._questListWindow);
|
||||
|
||||
// Set Quest List Window
|
||||
this._questTypesWindows._questlistWindow = this._questListWindow;
|
||||
this._questTypesWindows.callUpdateHelp();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Message Window
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.createMessageWindow = function () {
|
||||
this._messageWindow = new Window_OmoriQuestMessage();
|
||||
this.addChild(this._messageWindow);
|
||||
this._messageWindow.subWindows().forEach(function (window) {
|
||||
this.addChild(window);
|
||||
}, this);
|
||||
// Add Facebox Window Container as a Child
|
||||
this.addChild(this._messageWindow._faceBoxWindowContainer);
|
||||
};
|
||||
//=============================================================================
|
||||
// * [OK] Quest Type
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.onQuestTypesOk = function () {
|
||||
this._questListWindow.select(0);
|
||||
this._questListWindow.activate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * [OK] Quest List
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.onQuestListOk = function () {
|
||||
this._questListWindow.activate();
|
||||
this._messageWindow._setStandbyMessage = true;
|
||||
// Get Messages
|
||||
var messages = this._questListWindow.selectedQuestMessages();
|
||||
$gameMessage.showLanguageMessage(messages[0]);
|
||||
// Clear Message List
|
||||
this._messageWindow.clearMessageList();
|
||||
for (var i = 1; i < messages.length; i++) {
|
||||
this._messageWindow.addMessage(messages[i]);
|
||||
};
|
||||
// Set Update Wait Cursors Flag to true
|
||||
this._updateWindowCursors = true;
|
||||
this._questListWindow.updateCustomCursorRectSprite();
|
||||
this._questTypesWindows.updateCustomCursorRectSprite();
|
||||
};
|
||||
//=============================================================================
|
||||
// * [Cancel] Quest List
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.onQuestListCancel = function () {
|
||||
// Activate Quest Types Window
|
||||
this._questTypesWindows.activate();
|
||||
this._questListWindow.deselect();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_OmoriQuest.prototype.update = function () {
|
||||
// Super Call
|
||||
Scene_Base.prototype.update.call(this);
|
||||
|
||||
if (this._updateWindowCursors && !$gameMessage.isBusy()) {
|
||||
this._updateWindowCursors = false;
|
||||
this._questListWindow.updateCustomCursorRectSprite();
|
||||
this._questTypesWindows.updateCustomCursorRectSprite();
|
||||
};
|
||||
// if (Input.isTriggered('control')) {
|
||||
// }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriQuestHeader
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window displays the quest list header.
|
||||
//=============================================================================
|
||||
function Window_OmoriQuestHeader() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriQuestHeader.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoriQuestHeader.prototype.constructor = Window_OmoriQuestHeader;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriQuestHeader.prototype.initialize = function () {
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 12, 12, this.windowWidth(), this.windowHeight());
|
||||
// // Close Window
|
||||
// this.openness = 0;
|
||||
// Draw Contents
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriQuestHeader.prototype.standardPadding = function () { return 0; };
|
||||
Window_OmoriQuestHeader.prototype.windowWidth = function () { return 164; };
|
||||
Window_OmoriQuestHeader.prototype.windowHeight = function () { return 44; };
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoriQuestHeader.prototype.refresh = function () {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Draw Header
|
||||
this.contents.drawText(LanguageManager.getPluginText('questMenu', 'header'), 0, -6, this.contents.width, this.contents.height, 'center');
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriQuestTypes
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window displays quest types (Completed, Incomplete).
|
||||
//=============================================================================
|
||||
function Window_OmoriQuestTypes() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriQuestTypes.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoriQuestTypes.prototype.constructor = Window_OmoriQuestTypes;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.initialize = function () {
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 12, 0);
|
||||
this.activate();
|
||||
this.select(0);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.isUsingCustomCursorRectSprite = function () { return true; };
|
||||
Window_OmoriQuestTypes.prototype.windowWidth = function () { return 184; };
|
||||
Window_OmoriQuestTypes.prototype.windowHeight = function () { return 81; };
|
||||
Window_OmoriQuestTypes.prototype.standardPadding = function () { return 8; };
|
||||
Window_OmoriQuestTypes.prototype.customCursorRectTextXOffset = function () { return 35; };
|
||||
Window_OmoriQuestTypes.prototype.customCursorRectXOffset = function () { return 10; };
|
||||
Window_OmoriQuestTypes.prototype.lineHeight = function () { return 28; };
|
||||
Window_OmoriQuestTypes.prototype.standardFontSize = function () { return 24; };
|
||||
//=============================================================================
|
||||
// * Get Current World
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.currentWorld = function () {
|
||||
return $gameVariables.value(_TDS_.QuestMenu.params.worldVariableID);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.makeCommandList = function () {
|
||||
var world = this.currentWorld();
|
||||
let questStates = LanguageManager.getPluginText('questMenu', 'questStates');
|
||||
this.addCommand(questStates[0], 'incomplete', $gameParty.incompleteQuestList(world).length > 0);
|
||||
this.addCommand(questStates[1], 'complete', $gameParty.completedQuestList(world).length > 0);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Item
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.drawItem = function (index) {
|
||||
// Get Item Rect
|
||||
var rect = this.itemRectForText(index);
|
||||
var align = this.itemTextAlign();
|
||||
this.resetTextColor();
|
||||
// Set Text Color
|
||||
this.changeTextColor(index === 1 ? 'rgba(0, 161, 4, 1)' : 'rgba(228, 50, 14, 1)');
|
||||
this.changePaintOpacity(this.isCommandEnabled(index));
|
||||
this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Call Update Help
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.callUpdateHelp = function () {
|
||||
// Run Original Function
|
||||
Window_Command.prototype.callUpdateHelp.call(this);
|
||||
// if Quest List Window Exists
|
||||
if (this._questlistWindow) {
|
||||
var world = this.currentWorld();
|
||||
// Get List
|
||||
var list = this.index() === 0 ? $gameParty.incompleteQuestList(world) : $gameParty.completedQuestList(world);
|
||||
// Set Quest List
|
||||
this._questlistWindow.setQuestList(list);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Cursor Move
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.processCursorMove = function () {
|
||||
// If a message is displaying
|
||||
if ($gameMessage.isBusy()) { return; };
|
||||
// Run Original Function
|
||||
Window_Command.prototype.processCursorMove.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Handling
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.processHandling = function () {
|
||||
// If a message is displaying
|
||||
if ($gameMessage.isBusy()) { return; };
|
||||
// Run Original Function
|
||||
Window_Command.prototype.processHandling.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Custom Cursor Rect Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriQuestTypes.prototype.updateCustomCursorRectSprite = function (sprite, index) {
|
||||
// Set Sprite
|
||||
sprite = this._customCursorRectSprite;
|
||||
// If Custom Rect Sprite Exists
|
||||
if (sprite && $gameMessage.isBusy()) {
|
||||
// Set Sprite Tone Color
|
||||
sprite.setColorTone([-80, -80, -80, 255]);
|
||||
// Set Sprite active flag
|
||||
sprite._active = false;
|
||||
return;
|
||||
};
|
||||
// Run Original Function
|
||||
Window_Command.prototype.updateCustomCursorRectSprite.call(this, sprite, index);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriQuestList
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window displays the list of available and completed quests
|
||||
//=============================================================================
|
||||
function Window_OmoriQuestList() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriQuestList.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoriQuestList.prototype.constructor = Window_OmoriQuestList;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.initialize = function () {
|
||||
// Quest List
|
||||
this._questList = [];
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 12, 0);
|
||||
// this.openness = 0;
|
||||
this.deactivate();
|
||||
this.deselect();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.isUsingCustomCursorRectSprite = function () { return true; };
|
||||
Window_OmoriQuestList.prototype.windowWidth = function () { return 360 };
|
||||
Window_OmoriQuestList.prototype.windowHeight = function () { return 177; };
|
||||
Window_OmoriQuestList.prototype.standardPadding = function () { return 8; };
|
||||
Window_OmoriQuestList.prototype.customCursorRectTextXOffset = function () { return 35; };
|
||||
Window_OmoriQuestList.prototype.lineHeight = function () { return 25; };
|
||||
Window_OmoriQuestList.prototype.standardFontSize = function () { return 24; };
|
||||
//=============================================================================
|
||||
// * Set Quest List
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.setQuestList = function (list) {
|
||||
// Set List
|
||||
this._questList = list;
|
||||
// Refresh
|
||||
this.refresh();
|
||||
// Reset Scroll
|
||||
this.resetScroll();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Selected Quest Messages
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.selectedQuestMessages = function (index = this._index) {
|
||||
// Get Quest
|
||||
var quest = this._questList[index];
|
||||
// Return Quest
|
||||
return $dataQuests.quests[quest.id].text[quest.messageIndex];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.makeCommandList = function () {
|
||||
// Get Language
|
||||
var language = LanguageManager._language;
|
||||
// Go Through Quest List
|
||||
for (var i = 0; i < this._questList.length; i++) {
|
||||
// Get Quest
|
||||
var quest = this._questList[i];
|
||||
// Get Data
|
||||
const loc = LanguageManager.getMessageData("XX_BLUE.Quest_Names")[quest.id]
|
||||
var data = $dataQuests.quests[quest.id];
|
||||
const questname = !loc ? data.name[language] : loc
|
||||
this.addCommand(questname, 'quest', true, quest)
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Draw Item
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.drawItem = function (index) {
|
||||
// Run Original Function
|
||||
Window_Command.prototype.drawItem.call(this, index);
|
||||
// Get Item Rect
|
||||
var rect = this.itemRect(index);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh Arrows
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype._refreshArrows = function () {
|
||||
// Super Call
|
||||
Window_Command.prototype._refreshArrows.call(this);
|
||||
var w = this._width;
|
||||
var h = this._height;
|
||||
var p = 24;
|
||||
var q = (p / 2) + 5;
|
||||
this._downArrowSprite.move(w - q, h - q);
|
||||
this._upArrowSprite.move(w - q, q);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Cursor Move
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.processCursorMove = function () {
|
||||
// If a message is displaying
|
||||
if ($gameMessage.isBusy()) { return; };
|
||||
// Run Original Function
|
||||
Window_Command.prototype.processCursorMove.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Handling
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.processHandling = function () {
|
||||
// If a message is displaying
|
||||
if ($gameMessage.isBusy()) { return; };
|
||||
// Run Original Function
|
||||
Window_Command.prototype.processHandling.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Custom Cursor Rect Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriQuestList.prototype.updateCustomCursorRectSprite = function (sprite, index) {
|
||||
// Set Sprite
|
||||
sprite = this._customCursorRectSprite;
|
||||
// If Custom Rect Sprite Exists
|
||||
if (sprite && $gameMessage.isBusy()) {
|
||||
// Set Sprite Tone Color
|
||||
sprite.setColorTone([-80, -80, -80, 255]);
|
||||
// Set Sprite active flag
|
||||
sprite._active = false;
|
||||
return;
|
||||
};
|
||||
// Run Original Function
|
||||
Window_Command.prototype.updateCustomCursorRectSprite.call(this, sprite, index);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriQuestMessage
|
||||
//-----------------------------------------------------------------------------
|
||||
// This window displays quest message dialogue.
|
||||
//=============================================================================
|
||||
function Window_OmoriQuestMessage() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriQuestMessage.prototype = Object.create(Window_Message.prototype);
|
||||
Window_OmoriQuestMessage.prototype.constructor = Window_OmoriQuestMessage;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Window_OmoriQuestMessage.prototype.initialize = function () {
|
||||
// Clear Message List
|
||||
this.clearMessageList();
|
||||
// Set Standby Message Flag
|
||||
this._setStandbyMessage = false;
|
||||
// Super Call
|
||||
Window_Message.prototype.initialize.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Message List
|
||||
//=============================================================================
|
||||
Window_OmoriQuestMessage.prototype.clearMessageList = function () {
|
||||
this._messageList = [];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Message List
|
||||
//=============================================================================
|
||||
Window_OmoriQuestMessage.prototype.addMessage = function (message) {
|
||||
this._messageList.push(message);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Stand By Message
|
||||
//=============================================================================
|
||||
Window_OmoriQuestMessage.prototype.setStandByMessage = function () { this._setStandbyMessage = true; }
|
||||
//=============================================================================
|
||||
// * Terminate Message
|
||||
//=============================================================================
|
||||
Window_OmoriQuestMessage.prototype.terminateMessage = function () {
|
||||
// Clear Game Message
|
||||
$gameMessage.clear();
|
||||
// If Message List Length is more than 0
|
||||
if (this._messageList.length > 0) {
|
||||
// Get Message
|
||||
var message = this._messageList.shift();
|
||||
// Show Language Message
|
||||
$gameMessage.showLanguageMessage(message);
|
||||
return;
|
||||
};
|
||||
// If set Standy Message Flag is true
|
||||
if (this._setStandbyMessage) {
|
||||
// If Stand By Message for Quests Exist
|
||||
if ($gameParty._questStandByMessage) {
|
||||
// Set Quest Standby Message
|
||||
$gameMessage.showLanguageMessage($gameParty._questStandByMessage);
|
||||
}
|
||||
// Set Standby Message to false
|
||||
this._setStandbyMessage = false;
|
||||
};
|
||||
};
|
|
@ -1,791 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Message Save & Load
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_OmoriSaveLoad = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.OmoriSaveLoad = _TDS_.OmoriSaveLoad || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @author TDS
|
||||
* @plugindesc
|
||||
* Combo Skills port from ACE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
Game_Actor.prototype.faceSaveLoad = function() {
|
||||
var actor = this.actor();
|
||||
// When changing these the .png should not be required.
|
||||
switch (actor.id) {
|
||||
case 1: // Omori
|
||||
return "01_OMORI_BATTLE";
|
||||
case 2: // Aubrey
|
||||
return "02_AUBREY_BATTLE";
|
||||
case 3: // Kel
|
||||
return "03_KEL_BATTLE";
|
||||
case 4: // Hero
|
||||
return "04_HERO_BATTLE";
|
||||
case 8: // Omori
|
||||
return "01_FA_OMORI_BATTLE";
|
||||
case 9: // Aubrey
|
||||
return "02_FA_AUBREY_BATTLE";
|
||||
case 10: // Kel
|
||||
return "03_FA_KEL_BATTLE";
|
||||
case 11: // Hero
|
||||
return "04_FA_HERO_BATTLE";
|
||||
default:
|
||||
return "default_face_image_here"; // if ther is one?
|
||||
}
|
||||
};
|
||||
|
||||
Game_Actor.prototype.faceSaveLoadIndex = function() {
|
||||
var actor = this.actor();
|
||||
// When changing these the .png should not be required.
|
||||
switch (actor.id) {
|
||||
case 1: // Omori
|
||||
return 0;
|
||||
case 2: // Aubrey
|
||||
return 0;
|
||||
case 3: // Kel
|
||||
return 0;
|
||||
case 4: // Hero
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** DataManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages the database and game objects.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.OmoriSaveLoad.DataManager_makeSavefileInfo = DataManager.makeSavefileInfo;
|
||||
//=============================================================================
|
||||
// * Make Save File Information
|
||||
//=============================================================================
|
||||
DataManager.makeSavefileInfo = function() {
|
||||
// Get Original Info
|
||||
var info = _TDS_.OmoriSaveLoad.DataManager_makeSavefileInfo.call(this);
|
||||
// Get Leader
|
||||
var actor = $gameParty.leader();
|
||||
info.actorData = {name: actor.name(), level: actor.level, faceName: actor.faceSaveLoad(), faceIndex: actor.faceSaveLoadIndex()};
|
||||
info.chapter = $gameVariables.value(23);
|
||||
info.location = $gameMap.displayName();
|
||||
// Return Info
|
||||
return info;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Call Save Menu
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.callSaveMenu = function(save = true, load = true) {
|
||||
// Call Save Menu
|
||||
SceneManager.push(Scene_OmoriFile);
|
||||
SceneManager._nextScene.setup(save, load);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Scene_OmoriFile
|
||||
//-----------------------------------------------------------------------------
|
||||
// This scene is used to handle saving & loading.
|
||||
//=============================================================================
|
||||
function Scene_OmoriFile() { this.initialize.apply(this, arguments); }
|
||||
Scene_OmoriFile.prototype = Object.create(Scene_Base.prototype);
|
||||
Scene_OmoriFile.prototype.constructor = Scene_OmoriFile;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.initialize = function() {
|
||||
this._imageReservationId = 'file';
|
||||
// Super Call
|
||||
Scene_Base.prototype.initialize.call(this);
|
||||
// Save Index
|
||||
this._saveIndex = -1;
|
||||
// If Can Select Flag is true
|
||||
this._canSelect = false;
|
||||
// Set Load Success Flag
|
||||
this._loadSuccess = false;
|
||||
// Set Save & Load Flags
|
||||
this._canSave = true; this._canLoad = true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Lists
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.initAtlastLists = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.initAtlastLists.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Reserved Bitmaps
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.loadReservedBitmaps = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.loadReservedBitmaps.call(this);
|
||||
// Go through save files
|
||||
for (var i = 1; i < 5; i++) {
|
||||
// Get Save Info
|
||||
const info = DataManager.loadSavefileInfo(i);
|
||||
// If Information Exists
|
||||
if (info) {
|
||||
// Get Actor Data
|
||||
const actor = info.actorData;
|
||||
// Reserve Face Image
|
||||
ImageManager.reserveFace(actor.faceName, actor.faceIndex, this._imageReservationId);
|
||||
};
|
||||
}
|
||||
|
||||
ImageManager.reserveSystem('faceset_states', 0, this._imageReservationId);
|
||||
ImageManager.reserveParallax('polaroidBG_BS_sky', 0, this._imageReservationId);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Terminate
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.setup = function(save, load) {
|
||||
// Set Save & Load Flags
|
||||
this._canSave = save; this._canLoad = load;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Terminate
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.terminate = function() {
|
||||
Scene_Base.prototype.terminate.call(this);
|
||||
if (this._loadSuccess) {
|
||||
$gameSystem.onAfterLoad();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.create = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.create.call(this);
|
||||
// Create Background
|
||||
this.createBackground();
|
||||
this.createCommandWindow();
|
||||
this.createfileWindows();
|
||||
// Create Prompt Window
|
||||
this.createPromptWindow();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.createBackground = function() {
|
||||
// Create Background Sprite
|
||||
this._backgroundSprite = new TilingSprite();
|
||||
this._backgroundSprite.bitmap = ImageManager.loadParallax('SAVE_MENU_BG');
|
||||
this._backgroundSprite.move(0, 0, Graphics.width, Graphics.height);
|
||||
this.addChild(this._backgroundSprite);
|
||||
|
||||
// let centerWidth = 42
|
||||
// let bitmap = new Bitmap(Graphics.width, Graphics.height);
|
||||
// bitmap.fillRect(0, 0, centerWidth, bitmap.height, 'rgba(255, 0, 0, 1)');
|
||||
// bitmap.fillRect(bitmap.width - centerWidth, 0, centerWidth, bitmap.height, 'rgba(255, 0, 0, 1)');
|
||||
|
||||
// this._centerSprite = new Sprite(bitmap);
|
||||
// this.addChild(this._centerSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Command Window
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.createCommandWindow = function() {
|
||||
// Create Command Window
|
||||
this._commandWindow = new Window_OmoriFileCommand();
|
||||
this._commandWindow.setupFile(this._canSave, this._canLoad);
|
||||
this._commandWindow.setHandler('ok', this.onCommandWindowOk.bind(this));
|
||||
this._commandWindow.setHandler('cancel', this.onCommandWindowCancel.bind(this));
|
||||
this.addChild(this._commandWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create File Windows
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.createfileWindows = function() {
|
||||
// Initialize File Windows Array
|
||||
this._fileWindows = [];
|
||||
|
||||
let sx = this._commandWindow.x + this._commandWindow.width + 1;
|
||||
// Iterate 3 times
|
||||
for (var i = 0; i < 6; i++) {
|
||||
// Create Window
|
||||
var win = new Window_OmoriFileInformation(i);
|
||||
win.x = sx;
|
||||
win.y = 28 + (i * (win.height + 1))
|
||||
// Set Window
|
||||
this._fileWindows[i] = win;
|
||||
this.addChild(win);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Prompt Window
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.createPromptWindow = function() {
|
||||
// Create Prompt Window
|
||||
this._promptWindow = new Window_OmoriFilePrompt();
|
||||
// Set Handlers
|
||||
this._promptWindow.setHandler('ok', this.onPromptWindowOk.bind(this));
|
||||
this._promptWindow.setHandler('cancel', this.onPromptWindowCancel.bind(this));
|
||||
this._promptWindow.close();
|
||||
this._promptWindow.openness = 0;
|
||||
this._promptWindow.deactivate();
|
||||
this.addChild(this._promptWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.update = function() {
|
||||
// Super Call
|
||||
Scene_Base.prototype.update.call(this);
|
||||
// Update Background
|
||||
this.updateBackground();
|
||||
// Update Select Input
|
||||
if (this._canSelect) { this.updateSelectInput(); };
|
||||
|
||||
// if (Input.isTriggered('control')) {
|
||||
|
||||
// // this.onSavefileOk();
|
||||
|
||||
// for (var i = 0; i < this._fileWindows.length; i++) {
|
||||
// // Set Window
|
||||
// this._fileWindows[i].refresh();
|
||||
// };
|
||||
|
||||
// };
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Save File ID
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.savefileId = function() { return this._saveIndex + 1; };
|
||||
//=============================================================================
|
||||
// * Check if out of bounds
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.isOutOfBounds = function() {
|
||||
let index = this._saveIndex;
|
||||
let win = this._fileWindows[index];
|
||||
if(win.y + win.height > Graphics.boxHeight) {return -28}
|
||||
if(index === 0) {
|
||||
if(win.y < 28) {return 28}
|
||||
}
|
||||
if(win.y < 0) {return 28}
|
||||
return 0;
|
||||
}
|
||||
//=============================================================================
|
||||
// * Update Save Index Cursor
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.updateSaveIndexCursor = function() {
|
||||
// Go Through File Windows
|
||||
for (var i = 0; i < this._fileWindows.length; i++) {
|
||||
// Get Window
|
||||
var win = this._fileWindows[i];
|
||||
// Set Selected STate
|
||||
this._saveIndex === i ? win.select() : win.deselect();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Background
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.updateBackground = function() {
|
||||
this._backgroundSprite.origin.y += 1;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Select Background
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.updateSelectInput = function() {
|
||||
// If Ok
|
||||
if (Input.isTriggered('ok')) {
|
||||
// Call On Select Input Ok
|
||||
this.onSelectInputOk();
|
||||
return;
|
||||
};
|
||||
|
||||
// If Cancel
|
||||
if (Input.isTriggered('cancel')) {
|
||||
// Play Cancel Sound
|
||||
SoundManager.playCancel();
|
||||
// On Select Input Cancel
|
||||
this.onSelectInputCancel();
|
||||
return;
|
||||
};
|
||||
|
||||
// If Input Is repeated Up
|
||||
if (Input.isRepeated('up')) {
|
||||
// Play Cursor
|
||||
SoundManager.playCursor();
|
||||
// If Save index is 0
|
||||
if (this._saveIndex === 0) {
|
||||
// Set Save Index at the end
|
||||
this._saveIndex = this._fileWindows.length-1;
|
||||
} else {
|
||||
// Decrease Save Index
|
||||
this._saveIndex = (this._saveIndex - 1) % this._fileWindows.length;
|
||||
}
|
||||
// Update Save Index Cursor
|
||||
this.updateSaveIndexCursor();
|
||||
return;
|
||||
};
|
||||
// If Input Is repeated Down
|
||||
if (Input.isRepeated('down')) {
|
||||
// Play Cursor
|
||||
SoundManager.playCursor();
|
||||
// Increase Save Index
|
||||
this._saveIndex = (this._saveIndex + 1) % this._fileWindows.length;
|
||||
// Update Save Index Cursor
|
||||
this.updateSaveIndexCursor();
|
||||
return;
|
||||
};
|
||||
this.updatePlacement();
|
||||
};
|
||||
|
||||
Scene_OmoriFile.prototype.updatePlacement = function() {
|
||||
if(this._saveIndex < 0) {return;}
|
||||
let bounds = this.isOutOfBounds();
|
||||
if(!bounds) {return;}
|
||||
for(let win of this._fileWindows) {
|
||||
win.y += bounds;
|
||||
}
|
||||
}
|
||||
//=============================================================================
|
||||
// * On Command Window Ok
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onCommandWindowOk = function() {
|
||||
// Set Can select Flag to true
|
||||
this._canSelect = true;
|
||||
// Set Save Index to 0
|
||||
let latestFile = !!this._canSave ? DataManager.lastAccessedSavefileId() : DataManager.latestSavefileId();
|
||||
let maxSavefiles = 6;
|
||||
this._saveIndex = (latestFile - 1) % maxSavefiles;
|
||||
// Update Save Index Cursor
|
||||
this.updateSaveIndexCursor();
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Command Window Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onCommandWindowCancel = function() {
|
||||
// If Previous scene is title screen
|
||||
var isTitleScreen = SceneManager.isPreviousScene(Scene_OmoriTitleScreen);
|
||||
// Pop Scene
|
||||
this.popScene();
|
||||
// If Previous scene is tile scene
|
||||
if (isTitleScreen) {
|
||||
// Prepare Title Scene
|
||||
SceneManager._nextScene.prepare(1);
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Select Input Ok
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onSelectInputOk = function() {
|
||||
// Get Index
|
||||
var index = this._commandWindow.index();
|
||||
// Get Save File ID
|
||||
var saveFileid = this.savefileId();
|
||||
// If Save
|
||||
if (index === 0) {
|
||||
// If File Exists
|
||||
if (StorageManager.exists(saveFileid)) {
|
||||
// Show Prompt Window
|
||||
this.showPromptWindow(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").overwrite_file);
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = false;
|
||||
} else {
|
||||
// Save The Game
|
||||
this.saveGame();
|
||||
};
|
||||
} else {
|
||||
// If File Exists
|
||||
if (StorageManager.exists(saveFileid)) {
|
||||
// Show Prompt Window
|
||||
this.showPromptWindow(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").load_file);
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = false;
|
||||
} else {
|
||||
// Play Buzzer Sound
|
||||
SoundManager.playBuzzer();
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Select Input Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onSelectInputCancel = function() {
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = false;
|
||||
// Set Save Index to -1
|
||||
this._saveIndex = -1;
|
||||
// Update Save Index Cursor
|
||||
this.updateSaveIndexCursor();
|
||||
// Activate Command Window
|
||||
this._commandWindow.activate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Prompt Window
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.showPromptWindow = function(text) {
|
||||
// Set Prompt Window Text
|
||||
this._promptWindow.setPromptText(text);
|
||||
// Show Prompt Window
|
||||
this._promptWindow.open();
|
||||
this._promptWindow.select(1);
|
||||
this._promptWindow.activate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Prompt Window Ok
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onPromptWindowOk = function() {
|
||||
// Get Index
|
||||
var index = this._commandWindow.index();
|
||||
// If Save
|
||||
if (index === 0) {
|
||||
// Save The Game
|
||||
this.saveGame();
|
||||
// Close Prompt Window
|
||||
this._promptWindow.close();
|
||||
this._promptWindow.deactivate();
|
||||
// Set Can select Flag to true
|
||||
this._canSelect = true;
|
||||
} else {
|
||||
// Load Game
|
||||
this.loadGame();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Prompt Window Cancel
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.onPromptWindowCancel = function() {
|
||||
// Close Prompt Window
|
||||
this._promptWindow.close();
|
||||
this._promptWindow.deactivate();
|
||||
// Set Can select Flag to true
|
||||
this._canSelect = true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Save Game
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.saveGame = function() {
|
||||
// On Before Save
|
||||
$gameSystem.onBeforeSave();
|
||||
// Get Save File ID
|
||||
var saveFileid = this.savefileId();
|
||||
// Get File Window
|
||||
var fileWindow = this._fileWindows[this._saveIndex];
|
||||
// Save Game
|
||||
if (DataManager.saveGame(saveFileid)) {
|
||||
SoundManager.playSave();
|
||||
StorageManager.cleanBackup(saveFileid);
|
||||
fileWindow.refresh();
|
||||
} else {
|
||||
SoundManager.playBuzzer();
|
||||
};
|
||||
// Deactivate Prompt Window
|
||||
this._promptWindow.deactivate();
|
||||
this._promptWindow.close();
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = true;
|
||||
// Update Save Index Cursor
|
||||
this.updateSaveIndexCursor();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Game
|
||||
//=============================================================================
|
||||
Scene_OmoriFile.prototype.loadGame = function() {
|
||||
if (DataManager.loadGame(this.savefileId())) {
|
||||
|
||||
SoundManager.playLoad();
|
||||
this.fadeOutAll();
|
||||
// Reload Map if Updated
|
||||
if ($gameSystem.versionId() !== $dataSystem.versionId) {
|
||||
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
|
||||
$gamePlayer.requestMapReload();
|
||||
};
|
||||
SceneManager.goto(Scene_Map);
|
||||
this._loadSuccess = true;
|
||||
// Close Prompt Window
|
||||
this._promptWindow.close();
|
||||
this._promptWindow.deactivate();
|
||||
} else {
|
||||
// Play Buzzer
|
||||
SoundManager.playBuzzer();
|
||||
// Close Prompt Window
|
||||
this._promptWindow.close();
|
||||
this._promptWindow.deactivate();
|
||||
// Set Can select Flag to true
|
||||
this._canSelect = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriFileInformation
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for showing picture items for sorting
|
||||
//=============================================================================
|
||||
function Window_OmoriFileInformation() { this.initialize.apply(this, arguments); };
|
||||
Window_OmoriFileInformation.prototype = Object.create(Window_Base.prototype);
|
||||
Window_OmoriFileInformation.prototype.constructor = Window_OmoriFileInformation;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.initialize = function(index) {
|
||||
// Set Index
|
||||
this._index = index;
|
||||
// Super Call
|
||||
Window_Base.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());
|
||||
// Create Cursor Sprite
|
||||
this.createCursorSprite();
|
||||
// Refresh
|
||||
this.refresh();
|
||||
// Deselect
|
||||
this.deselect();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.standardPadding = function() { return 4}
|
||||
Window_OmoriFileInformation.prototype.windowWidth = function () { return 382 + 54; };
|
||||
Window_OmoriFileInformation.prototype.windowHeight = function() { return 142; }
|
||||
//=============================================================================
|
||||
// * Create Cursor Sprite
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.createCursorSprite = function() {
|
||||
// Create Cursor Sprite
|
||||
this._cursorSprite = new Sprite_WindowCustomCursor();
|
||||
this._cursorSprite.x = 10//-32;
|
||||
this._cursorSprite.y = 20;
|
||||
this.addChild(this._cursorSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Select
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.select = function() {
|
||||
this._cursorSprite.visible = true;
|
||||
this.contentsOpacity = 255;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Deselect
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.deselect = function() {
|
||||
this._cursorSprite.visible = false;
|
||||
this.contentsOpacity = 100;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoriFileInformation.prototype.refresh = function() {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Get Color
|
||||
var color = 'rgba(255, 255, 255, 1)';
|
||||
// Get ID
|
||||
var id = this._index + 1;
|
||||
var valid = DataManager.isThisGameFile(id);
|
||||
var info = DataManager.loadSavefileInfo(id);
|
||||
|
||||
// Draw Lines
|
||||
this.contents.fillRect(0, 29, this.contents.width, 3, color);
|
||||
for (var i = 0; i < 3; i++) {
|
||||
var y = 55 + (i * 25)
|
||||
this.contents.fillRect(113, y, this.contents.width - 117, 1, color);
|
||||
};
|
||||
|
||||
|
||||
// Draw File
|
||||
this.contents.fontSize = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").refresh_contents_fontsize;
|
||||
let loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").file_position
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").file.format(id), loc_position[0], loc_position[1], 100, this.contents.fontSize);
|
||||
// If Valid
|
||||
if (valid) {
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").refresh_drawText_position;
|
||||
let chap = LanguageManager.getMessageData("XX_BLUE.Chapter_Names")[info.chapter]
|
||||
if(!chap) {
|
||||
chap = info.chapter
|
||||
}
|
||||
this.contents.drawText(chap, loc_position[0], loc_position[1], this.contents.width, this.contents.fontSize);
|
||||
this.contents.fontSize = 28;
|
||||
|
||||
let backBitmap = ImageManager.loadSystem('faceset_states');
|
||||
let width = backBitmap.width / 4;
|
||||
let height = backBitmap.height / 5;
|
||||
// this.contents.blt(backBitmap, 0, 0, width, height, 0, 34, width + 10, height);
|
||||
this.contents.blt(backBitmap, 0, 0, width, height, 1, 33);
|
||||
// Get Actor
|
||||
var actor = info.actorData
|
||||
// Draw Actor Face
|
||||
let bit = ImageManager.loadFace(actor.faceName);
|
||||
bit.addLoadListener(() => this.drawFace(actor.faceName, actor.faceIndex, -2, this.contents.height - Window_Base._faceHeight + 7, Window_Base._faceWidth, height - 2));
|
||||
// Draw Actor Name
|
||||
this.contents.fontSize = 24;
|
||||
this.contents.drawText(actor.name, 118, 30, 100, 24);
|
||||
// Draw Level
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").level_position;
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").level, loc_position[0], loc_position[1], 100, 24);
|
||||
this.contents.drawText(actor.level, loc_position[0], loc_position[1], 70, 24, 'right');
|
||||
// Draw Total PlayTime
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").playtime_position;
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").playtime, 118, 55, 200, 24);
|
||||
this.contents.drawText(info.playtime, loc_position[0], loc_position[1], 100, 24);
|
||||
// Draw Location
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").location, 118, 80, 200, 24);
|
||||
this.contents.drawText(info.location, 205, 80, 210, 24, 'right');
|
||||
};
|
||||
|
||||
// Draw Border
|
||||
this.contents.fillRect(102, 32, 3, 102, 'rgba(255, 255, 255, 1)')
|
||||
this.contents.fillRect(0, 29, 108, 3, 'rgba(255, 255, 255, 1)')
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriFileCommand
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selecting a command on the menu screen.
|
||||
//=============================================================================
|
||||
function Window_OmoriFileCommand() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriFileCommand.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoriFileCommand.prototype.constructor = Window_OmoriFileCommand;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoriFileCommand.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 42, 28);
|
||||
// Setup File
|
||||
this.setupFile(true, true);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriFileCommand.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoriFileCommand.prototype.lineHeight = function () { return 24; };
|
||||
Window_OmoriFileCommand.prototype.windowWidth = function () { return 119; };
|
||||
Window_OmoriFileCommand.prototype.windowHeight = function () { return 64; };
|
||||
Window_OmoriFileCommand.prototype.standardPadding = function () { return 4; };
|
||||
Window_OmoriFileCommand.prototype.numVisibleRows = function () { return 2; };
|
||||
Window_OmoriFileCommand.prototype.maxCols = function () { return 1; };
|
||||
Window_OmoriFileCommand.prototype.customCursorRectYOffset = function() { return 5; }
|
||||
Window_OmoriFileCommand.prototype.customCursorRectTextXOffset = function() { return 40; }
|
||||
//=============================================================================
|
||||
// * Setup File
|
||||
//=============================================================================
|
||||
Window_OmoriFileCommand.prototype.setupFile = function (save, load) {
|
||||
// Set Save & Load Flags
|
||||
this._canSave = save; this._canLoad = load;
|
||||
if(!!this._canSave) {this.select(0);}
|
||||
else if(!!this._canLoad) {this.select(1)}
|
||||
// Refresh
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoriFileCommand.prototype.makeCommandList = function () {
|
||||
const loc = LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load")
|
||||
this.addCommand(loc.save_command, 'save', this._canSave);
|
||||
this.addCommand(loc.load_command, 'load', this._canLoad);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_OmoriFilePrompt
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for selecting a command on the menu screen.
|
||||
//=============================================================================
|
||||
function Window_OmoriFilePrompt() { this.initialize.apply(this, arguments); }
|
||||
Window_OmoriFilePrompt.prototype = Object.create(Window_Command.prototype);
|
||||
Window_OmoriFilePrompt.prototype.constructor = Window_OmoriFilePrompt;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Window_Command.prototype.initialize.call(this, 0, 0);
|
||||
// Center Window
|
||||
this.x = (Graphics.width - this.width) / 2;
|
||||
this.y = (Graphics.height - this.height) / 2;
|
||||
// Create Cover Sprite
|
||||
this.createCoverSprite();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Background
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.createCoverSprite = function() {
|
||||
var bitmap = new Bitmap(Graphics.width, Graphics.height);
|
||||
bitmap.fillAll('rgba(0, 0, 0, 0.5)')
|
||||
this._coverSprite = new Sprite(bitmap);
|
||||
this._coverSprite.x = -this.x;
|
||||
this._coverSprite.y = -this.y;
|
||||
this.addChildAt(this._coverSprite, 0);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Openness
|
||||
//=============================================================================
|
||||
Object.defineProperty(Window.prototype, 'openness', {
|
||||
get: function() { return this._openness; },
|
||||
set: function(value) {
|
||||
if (this._openness !== value) {
|
||||
this._openness = value.clamp(0, 255);
|
||||
this._windowSpriteContainer.scale.y = this._openness / 255;
|
||||
this._windowSpriteContainer.y = this.height / 2 * (1 - this._openness / 255);
|
||||
|
||||
if (this._coverSprite) { this._coverSprite.opacity = this._openness; };
|
||||
}
|
||||
},
|
||||
configurable: true
|
||||
});
|
||||
//=============================================================================
|
||||
// * Settings
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.isUsingCustomCursorRectSprite = function() { return true; };
|
||||
Window_OmoriFilePrompt.prototype.lineHeight = function () { return 22; };
|
||||
Window_OmoriFilePrompt.prototype.windowWidth = function () { return 220; };
|
||||
Window_OmoriFilePrompt.prototype.windowHeight = function () { return 70 + 20; };
|
||||
Window_OmoriFilePrompt.prototype.standardPadding = function () { return 4; };
|
||||
Window_OmoriFilePrompt.prototype.numVisibleRows = function () { return 2; };
|
||||
Window_OmoriFilePrompt.prototype.maxCols = function () { return 1; };
|
||||
Window_OmoriFilePrompt.prototype.customCursorRectXOffset = function() { return 50; }
|
||||
Window_OmoriFilePrompt.prototype.customCursorRectYOffset = function() { return 33; }
|
||||
Window_OmoriFilePrompt.prototype.customCursorRectTextXOffset = function() { return 80; }
|
||||
Window_OmoriFilePrompt.prototype.customCursorRectTextYOffset = function() { return 28; }
|
||||
//=============================================================================
|
||||
// * Setup File
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.setPromptText = function (text) {
|
||||
// Set Prompt Text
|
||||
this._promptText = text;
|
||||
// Refresh Contents
|
||||
this.refresh();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Command List
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.makeCommandList = function () {
|
||||
this.addCommand(LanguageManager.getMessageData("XX_SYSTEM.message_10").text, 'ok');
|
||||
this.addCommand(LanguageManager.getMessageData("XX_SYSTEM.message_11").text, 'cancel');
|
||||
};
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Window_OmoriFilePrompt.prototype.refresh = function () {
|
||||
// Super Call
|
||||
Window_Command.prototype.refresh.call(this);
|
||||
this.contents.drawText(this._promptText, 0, 0, this.contents.width, 24, 'center');
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,869 +0,0 @@
|
|||
// OMORI patch mod for more russian language support such as changing UI
|
||||
// positions and sizes, translating hardcorded texts, and russian layout of
|
||||
// virtual keyboard (OMORI 1.0.8).
|
||||
// Patched & bundled by hat_kid. For OMORI RUS mod. https://vk.com/omori_ru
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Title Screen
|
||||
// ============================================================================
|
||||
|
||||
Scene_OmoriTitleScreen.prototype.createTitleCommands = function() {
|
||||
// Initialize Title Comands
|
||||
this._titleCommands = [];
|
||||
// Text Array
|
||||
var textList = LanguageManager.getMessageData("XX_BLUE.Omori_Title_Screen").commands
|
||||
// Get Center X Position
|
||||
var centerX = 20;
|
||||
// Go Through Text Array
|
||||
var previous_width = 0;
|
||||
for (var i = 0; i < textList.length; i++) {
|
||||
// Get Text
|
||||
var text = textList[i];
|
||||
// Create Window
|
||||
var win = new Window_OmoTitleScreenBox(text);
|
||||
// Set Wnidow Position
|
||||
win.x = centerX + previous_width;
|
||||
previous_width += win.width + 15;
|
||||
win.y = Graphics.height //(Graphics.height - win.height) - 22
|
||||
// Select Window
|
||||
if (i === this._commandIndex) { win.select(0)}
|
||||
// Add window to title Commands
|
||||
this._titleCommands[i] = win;
|
||||
this.addChild(win)
|
||||
};
|
||||
// Set Continue text
|
||||
this._titleCommands[1].setText(textList[1], this._canContinue);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Main Menu
|
||||
// ============================================================================
|
||||
// Line: 261, Original item spacing: 12
|
||||
Window_MenuCommand.prototype.spacing = function () { return -4; };
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Main Menu - Scene Skill
|
||||
// ============================================================================
|
||||
// Line: 773, Original window width: 115
|
||||
Window_OmoMenuSkillEquipControl.prototype.windowWidth = function () { return 190; };
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Main Menu - Scene Item
|
||||
// ============================================================================
|
||||
// Line: 829, Original window width: 115
|
||||
Window_OmoMenuItemConfirmation.prototype.windowWidth = function() { return 170; };
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Save & Load
|
||||
// ============================================================================
|
||||
|
||||
Window_OmoriFileInformation.prototype.refresh = function() {
|
||||
// Clear Contents
|
||||
this.contents.clear();
|
||||
// Get Color
|
||||
var color = 'rgba(255, 255, 255, 1)';
|
||||
// Get ID
|
||||
var id = this._index + 1;
|
||||
var valid = DataManager.isThisGameFile(id);
|
||||
var info = DataManager.loadSavefileInfo(id);
|
||||
|
||||
// Draw Lines
|
||||
this.contents.fillRect(0, 29, this.contents.width, 3, color);
|
||||
for (var i = 0; i < 3; i++) {
|
||||
var y = 55 + (i * 25)
|
||||
this.contents.fillRect(113, y, this.contents.width - 117, 1, color);
|
||||
};
|
||||
|
||||
// Draw File
|
||||
this.contents.fontSize = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").refresh_contents_fontsize;
|
||||
let loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").file_position
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").file.format(id), loc_position[0], loc_position[1], 100, this.contents.fontSize);
|
||||
// If Valid
|
||||
if (valid) {
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").refresh_drawText_position;
|
||||
let chap = LanguageManager.getMessageData("XX_BLUE.Chapter_Names")[info.chapter]
|
||||
if(!chap) {
|
||||
chap = info.chapter
|
||||
}
|
||||
this.contents.drawText(chap, loc_position[0] + 14, loc_position[1], this.contents.width, this.contents.fontSize);
|
||||
this.contents.fontSize = 28;
|
||||
|
||||
let backBitmap = ImageManager.loadSystem('faceset_states');
|
||||
let width = backBitmap.width / 4;
|
||||
let height = backBitmap.height / 5;
|
||||
// this.contents.blt(backBitmap, 0, 0, width, height, 0, 34, width + 10, height);
|
||||
this.contents.blt(backBitmap, 0, 0, width, height, 1, 33);
|
||||
// Get Actor
|
||||
var actor = info.actorData
|
||||
// Draw Actor Face
|
||||
let bit = ImageManager.loadFace(actor.faceName);
|
||||
bit.addLoadListener(() => this.drawFace(actor.faceName, actor.faceIndex, -2, this.contents.height - Window_Base._faceHeight + 7, Window_Base._faceWidth, height - 2));
|
||||
// Draw Actor Name
|
||||
this.contents.fontSize = 24;
|
||||
this.contents.drawText(actor.name, 118, 30, 100, 24);
|
||||
// Draw Level
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").level_position;
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").level, loc_position[0] - 25, loc_position[1], 100, 24);
|
||||
this.contents.drawText(actor.level, loc_position[0], loc_position[1], 70, 24, 'right');
|
||||
// Draw Total PlayTime
|
||||
loc_position = LanguageManager.getMessageData("XX_BLUE.Window_OmoriFileInformation").playtime_position;
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").playtime, 118, 55, 200, 24);
|
||||
this.contents.drawText(info.playtime, loc_position[0], loc_position[1], 100, 24);
|
||||
// Draw Location
|
||||
this.contents.drawText(LanguageManager.getMessageData("XX_BLUE.Omori_Save_Load").location, 118, 80, 200, 24);
|
||||
this.contents.drawText(info.location, 205, 80, 210, 24, 'right');
|
||||
};
|
||||
|
||||
// Draw Border
|
||||
this.contents.fillRect(102, 32, 3, 102, 'rgba(255, 255, 255, 1)')
|
||||
this.contents.fillRect(0, 29, 108, 3, 'rgba(255, 255, 255, 1)')
|
||||
};
|
||||
|
||||
// For compatibility with 1.0.7 and lower versions.
|
||||
Scene_OmoriFile.prototype.onSelectInputOk = function() {
|
||||
// Get Index
|
||||
var index = this._commandWindow.index();
|
||||
// Get Save File ID
|
||||
var saveFileid = this.savefileId();
|
||||
// If Save
|
||||
if (index === 0) {
|
||||
// If File Exists
|
||||
if (StorageManager.exists(saveFileid)) {
|
||||
// Show Prompt Window
|
||||
this.showPromptWindow('Переписать этот файл?');
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = false;
|
||||
} else {
|
||||
// Save The Game
|
||||
this.saveGame();
|
||||
};
|
||||
} else {
|
||||
// If File Exists
|
||||
if (StorageManager.exists(saveFileid)) {
|
||||
// Show Prompt Window
|
||||
this.showPromptWindow('Загрузить файл?');
|
||||
// Set Can select Flag to false
|
||||
this._canSelect = false;
|
||||
} else {
|
||||
// Play Buzzer Sound
|
||||
SoundManager.playBuzzer();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Window_OmoriFileCommand.prototype.makeCommandList = function () {
|
||||
this.addCommand("СОХРАНИТЬ", 'save', this._canSave);
|
||||
this.addCommand("ЗАГРУЗИТЬ", 'load', this._canLoad);
|
||||
};
|
||||
|
||||
Window_OmoriFilePrompt.prototype.makeCommandList = function () {
|
||||
this.addCommand("ДА", 'ok');
|
||||
this.addCommand("НЕТ", 'cancel');
|
||||
};
|
||||
|
||||
Window_OmoriFileCommand.prototype.initialize = function() {
|
||||
// Original window X position: 42
|
||||
Window_Command.prototype.initialize.call(this, 20, 28);
|
||||
this.setupFile(true, true);
|
||||
};
|
||||
|
||||
// Line: 677, Original window width: 119
|
||||
Window_OmoriFileCommand.prototype.windowWidth = function () { return 160; };
|
||||
|
||||
// Line: 683, Original cursor rect X-offset: 40
|
||||
Window_OmoriFileCommand.prototype.customCursorRectTextXOffset = function() { return 35; };
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori BlackLetterMap
|
||||
// ============================================================================
|
||||
|
||||
Sprite_OmoBlackLetterMap.prototype.createOverlaySprites = function() {
|
||||
// Create Overlay Bitmap
|
||||
var bitmap = new Bitmap(Graphics.width, Graphics.height);
|
||||
// Get Background Bitmap
|
||||
var bgBitmap = ImageManager.loadAtlas('blackLetter_map_atlas');
|
||||
var bgBitmap50 = ImageManager.loadAtlas('blackLetter_map_50_atlas');
|
||||
// Get Map Data
|
||||
bgBitmap.addLoadListener(() => {
|
||||
bgBitmap50.addLoadListener(() => {
|
||||
var mapData = [
|
||||
{name: 'ЛЕС СВЕТЛЯЧКОВ', namePos: new Point(80, 195), rect: new Rectangle(0, 0, 193, 139), pos: new Point(111, 103), blackSwitchId: 23, nameSwitchId: 30, blackSwitch50Id: 900 },
|
||||
// {name: 'Forgotten Pier', namePos: new Point(200, 27), rect: new Rectangle(194, 0, 155, 120), pos: new Point(225, 52), blackSwitchId: 21, nameSwitchId: 29 },
|
||||
{name: 'ЛЕС ВЕРТУШЕК', namePos: new Point(440, 240), rect: new Rectangle(350, 0, 99, 107), pos: new Point(471, 128), blackSwitchId: 24, nameSwitchId: 31, blackSwitch50Id: 901 },
|
||||
{name: 'ДЕРЕВНЯ РОСТОКРОТОВ', namePos: new Point(25, 340), rect: new Rectangle(450, 0, 94, 80), pos: new Point(54, 267), blackSwitchId: 25, nameSwitchId: 32, blackSwitch50Id: 902 },
|
||||
{name: 'БЕСКРАЙНИЙ ЛЕС', namePos: new Point(250, 300), rect: new Rectangle(0, 124, 640, 201), pos: new Point(-2, 143), blackSwitchId: 26, nameSwitchId: 33, blackSwitch50Id: 903 },
|
||||
{name: 'ГЛУБОКИЙ КОЛОДЕЦ', namePos: new Point(450, 355), rect: new Rectangle(0, 326, 418, 113), pos: new Point(119, 366), blackSwitchId: 27, nameSwitchId: 34, blackSwitch50Id: 904 },
|
||||
{name: 'АПЕЛЬСИНОВЫЙ ОАЗИС', namePos: new Point(20, 55), rect: new Rectangle(545, 0, 122, 102), pos: new Point(31, 85), blackSwitchId: 28, nameSwitchId: 35, blackSwitch50Id: 905 },
|
||||
{name: 'ВНЕЗЕМЕЛЬЕ', namePos: new Point(450, 75), rect: new Rectangle(419, 326, 140, 209), pos: new Point(390, 21), blackSwitchId: 29, nameSwitchId: 36, blackSwitch50Id: 906 },
|
||||
]
|
||||
// Initialize Name Windows Array
|
||||
this._nameWindows = [];
|
||||
// Create Container for Name Windows
|
||||
this._nameWindowsContainer = new Sprite();
|
||||
// Go Through Map Data
|
||||
for (var i = 0; i < mapData.length; i++) {
|
||||
// Get Data
|
||||
var data = mapData[i];
|
||||
// Get Rect & Position
|
||||
var rect = data.rect, pos = data.pos;
|
||||
var test = Math.randomInt(100) > 50;
|
||||
// If Black switch ID is not on
|
||||
/*if (!$gameSwitches.value(data.blackSwitchId)) {
|
||||
if (!$gameSwitches.value(data.blackSwitch50Id)) {
|
||||
// Draw Black onto Bitmap
|
||||
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
|
||||
} else {
|
||||
|
||||
}
|
||||
};*/
|
||||
//if(!!$gameSwitches.value(data.blackSwitchId)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
//else if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
|
||||
else {
|
||||
if(!$gameSwitches.value(data.blackSwitchId)) {
|
||||
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
|
||||
}
|
||||
}
|
||||
// Get Name Position
|
||||
var namePos = data.namePos;
|
||||
var name = $gameSwitches.value(data.nameSwitchId) ? data.name : "???"
|
||||
// Create Window
|
||||
var win = new Window_OmoBlackLetterMapName(name);
|
||||
// Set Window Position
|
||||
win.x = namePos.x; win.y = namePos.y;
|
||||
this._nameWindows.push(win);
|
||||
this._nameWindowsContainer.addChild(win);
|
||||
};
|
||||
// Create Black Overlay Sprite
|
||||
this._blackOverlay = new Sprite(bitmap);
|
||||
this.addChild(this._blackOverlay)
|
||||
|
||||
// Add Name Window container as a child
|
||||
this.addChild(this._nameWindowsContainer);
|
||||
this.createTextCounterSprite();
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: YIN_OmoriFixes
|
||||
// ============================================================================
|
||||
|
||||
Game_System = class extends Game_System {
|
||||
initialize() {
|
||||
super.initialize();
|
||||
this._badWords = [ // Bad words should be all lowercase!
|
||||
// Bad Words
|
||||
"спид","анал","анус","зад","жопа","попа","яйца","шары","чурка","козёл","сюка","сучка","сука",
|
||||
"минет","грудь","стояк","сиська","бум","груди","головка","рак","сиси","клит","клитор","кокаин","член",
|
||||
"коитус","комми","презик","презерватив","кам","кумер","хуила","дерьмо","промежность","конча","пизда","чёрт","ебырь",
|
||||
"ёбырь","пенис","дилдо","дилф","дилфа","нарк","тупой","сучий","enema","стояк","эскимо","блядун","бля","блять",
|
||||
"гей","гомик","голубой","гук","гипси","сиськи","долбоёб","героин","герпес","вич","шлюха","дыра","гомо","honk",
|
||||
"ссань","хорни","херня","идиот","инцест","хер","яп","выдроч","еврей","киска","конча","хуец","качок",
|
||||
"клоун","тварь","шмара","киллер","убийца","кинк","ккк","алкаш","koon","жигало","нахуй","нахер","kunt",
|
||||
"лесбиянка","лесбо","лоли","лсд","смазка","линч","мамка","мет","милфа","милф","molest","мама","mong","придурок",
|
||||
"muff","дегенерат","ебанат","нацист","маньяк","муслим","наци","негра","негро","н1г","черножопый","нег","сосок",
|
||||
"ниггер","чёрный","черный","говнюк","гнида","орал","чернокожий","оргии","оргия","узкоглазый","казах","узбек","паки",
|
||||
"трусы","трусики","п3нис","п3н1с","чл3н","извр","извра","ебан","ёбаный","моча","прыщ","м0ча","плейбой","pocha",
|
||||
"пидрила","пидор","поляк","порн","кака","порно","пи3да","пи3д4","дрочила","пися","писька","пидарас","педераст","квир",
|
||||
"quim","расист","ебанько","пендос","изнасилование","насильник","ректум","простата","краснокожий","даун","патау","reject",
|
||||
"отсталый","ссака","пиздец","корень","срака","русский","срань","шизик","писос","шиз","сволочь","screw","scrotum",
|
||||
"scrub","семя","секс","похуй","срал","срёт","кусок","пердёж","пердак","раб","славянин","потаскуха","пердун","содомит","сопля",
|
||||
"содом","пика","хуйня","сперма","яйцо","трах","стриптиз","стрип","яичко","суицид","сифилис","тампон","недоумок",
|
||||
"сись","террорист","хуй","дурак","целка","титя","туалет","tramp","транс","транни","троян","паскуда","высер","twink",
|
||||
"урина","матка","вагина","вагинальный","вибратор","девственник","рвота","вульва","wank","weenie","пипи","влажный",
|
||||
"whigger","виски","белый","урод","стукач","друг","willy","мудак","шзнх","втф","чмо","xtc","ххх","янки",
|
||||
"yid","zigabo","фембой","фэмбой","хуе","ебло","ебли","еблан","еба","е6ло","е6ли","е6лан","е6а","нефор","фашист",
|
||||
"залуп","уёб","уё6","уеб","уе6","струя","взъебщик","взъебка","взъеб","взьеб","какиш","кукиш","сасун","сосун",
|
||||
"сосня","сося","соснут","посос","подсос","мудень","автограф","ебл","ёбл","е6л","ё6л","ёбар","ебар","ё6ар","е6ар",
|
||||
"агрегат","акробат","кринж","хуель","хуёль","ёбаной","ебаной","армячок","афедрон","пассив","актив","девка",
|
||||
"дефка","деффка","дефффка","деввка","девввка","беспиздая","бздение","бзднул","бздёж","бзданул","бздеть","бздея",
|
||||
"бздун","бздык","бздюх","биатлон","бикса","шмара","блуд","блядво","блядство","блядеха","блядина","блядище",
|
||||
"блядки","блядо","блядов","говно","гавно","залупа","давалка","петух","мудила","рукоблуд","ссанина","очко",
|
||||
"ебланище","влагалище","пёрдун","туз","малафья","пилотка","манда","путана","педрила","шалава","мошонка","елда",
|
||||
"раунд","бляди","пизд","блядьмо","блядюга","блядюра","блядюш","блядюшка","бляха","бордель","сперм","буденовка",
|
||||
"будёновка","буден","будён","хуеверт","хуёверт","хуевёрт","хуёвёрт","коксак","глори","холл","хол","буль",
|
||||
"бульда","бульза","буфер","капот","вакхан","бункер","вафлист","вдуть","хуеглот","хуёглот","хуйка","вендетта",
|
||||
"вендета","версаль","вжоп","вздроч","вагин","защеку","за щеку","педек","вислозад","вислозадый","висюлька","всос",
|
||||
"сасный","вманде","манде","манду","вмандить","мудозвон","мандошка","вмандошить","мандош","выебат","мандоха",
|
||||
"мандюрить","мандюря","мандяка","мандя","мандяха","мудоха","пиздит","пиздошка","пиздушка","пиздошки","ляха",
|
||||
"гурукакашек","аппендикс","апендикс","апндкс","пиздюк","пиздрон","впиздувсё","пиздярить","пиздяр","пиздяка",
|
||||
"уретра","ректал","суходроч","эрот","этти","бака","косоёб","косоеб","сосоеб","сосоёб","унитаз","пасс","акт",
|
||||
"конеёб","коноеб","коноёб","котоёб","котоеб","неегр","нееегр","неееегр","неегры","нееегры","охуярок","укурок",
|
||||
"хуяка","хуякать","хуякивание","обхуярный","хуярить","бамбамбам","бамбам","бамбамба","детей","дитей","дура",
|
||||
"вебкам","выебон","глист","кишка","пиздякаться","гончар","кончар","минетчик","минетить","кунилингусить",
|
||||
"ссаный","санный","ссанный","саньё","ссаньё","ссанье","санье","обсер","обсёр","срундель","сруль","хуёво","хуево",
|
||||
"трахарь","голый","одетый","харя","хач","говёный","говённый","говеный","говенный","говнец","гавёный","гавённый",
|
||||
"гавеный","гавенный","гавнец","генерал","глиномес","глотать","говниться","гавниться","говняц","гавняц","писичк",
|
||||
"сисичк","попочк","говнодав","говножуй","говноёб","говномер","говномес","говносерка","говнякаться","голожоп",
|
||||
"страпон","дилдос","анальныйвыдроч","девство","додик","додек","додроч","джигит","дешовка","дешевка","дилда",
|
||||
"доебон","дойка","дойки","долданьё","долданье","долдарь","долдать","писюн","писюнчик","усрал","усрался","охуеть",
|
||||
"ахуеть","нихуя","ебанатик","ебатория","ебариш","ебаришко","смекта","виагра","ебена","еби","какаха","ебёнтъ",
|
||||
"ебентъ","ебистос","ёбкая","еблематика","еблематик","еблом","ёбнутый","ебота","ебня","еботина","еботня","ёбс",
|
||||
"ебс","ебун","ебти","ебукентий","ебур","жирнозадый","жопища","жопенция","жопень","жопоёб","жопник","жопочка",
|
||||
"журло","журня","заглот","заглотик","бомж","заеб","заёба","заеба","заёб","заебать","пердеж","запор","засеря",
|
||||
"засос","засирать","затруха","херотень","хуетень","захуень","злоебучий","уёбище","уебище","факю","фак ю","фак-ю",
|
||||
"фак_ю","импотент","инвалид","хуесос","лох",
|
||||
|
||||
// Names
|
||||
"обри","бэзил","банди","ленин","гектор","хиро","гитлер","крутозуб","цзинь","кел","ким чен","маленький","мари",
|
||||
"базиль","осама","плутон","полли","путин","потрошитель","рококо","сталин","трамп","зодиак","тесак","мюнхен",
|
||||
"сваста","свастик","свастон","зиг","хаиль","поттхаст","гимлер","геббельс","геринг","гиммлер","гебельс",
|
||||
"геббльс","гебльс","гибельс","гиббльс","гибльс","герринг","чубайс","чвк","редан","рёдан","вангер","раден",
|
||||
"солдат","воен","войн","хохлы","хохол","русня","свин","рейх","скотина","монашка","манашка","крым","украина",
|
||||
"либераха","либераст","либираст","америка","россия","цыган","цацка","циган","монеточка","фем-бой","фем_бой",
|
||||
"фем бой","фэм-бой","фэм_бой","фэм бой","суси","сусси","трансфем","трансфэм","траснмаск","лгбт","квиры","квирка",
|
||||
"транси","дуров","рунет","копро","стрелок","зоофил","некро","педо","борат","барат","брат","сестра","мскр","пупс",
|
||||
"пушкин","лермонтов","багиль","багель","бэгель","бабиль","бэбиль","бобиль","фуфел","мамонт","попк","иисус",
|
||||
"христос","господ","свят","библия","мать","отец","отчим","баба","дед","дядя","тётя","тетя","папа","дочка","сын",
|
||||
"кун","калл","кал","трансформ","негодяй","простофиля","срунгель","голубок","гонорея","сосок","сосочек","гузно",
|
||||
"гузноеб","грызло","гузноёб","гузнотёр","гузнотер","спиногрыз","даваха","дама","колхоз","сексист","феминист",
|
||||
"анархист","пацифист","нудист","тупой","военком","тусы","панцу","бомб","ирак","убил","ядерка","меф","мефедрон",
|
||||
"мефедр","батюшк","батя","дохлый","дристун","конопля","поллюция","полюция","полиция","фурри","фури","эбало",
|
||||
"ебало","заэбало","муж","жена","дети","мандавошка","миллиция","милиция","какать","какаш","дрыщ",
|
||||
// Foreign Language Bad Words
|
||||
"курва","puta","куколд","mierda","pendejo","нигга","нибба","трап","perra","faggot","dilldoe","blacky","pniss",
|
||||
"байден","омори",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Window_OmoriInputLetters.prototype.onNameOk = function() {
|
||||
// Get Text
|
||||
var text = this._nameWindow.name();
|
||||
// If Text Length is more than 0
|
||||
if (text.length > 0) {
|
||||
if(text.toLowerCase() === "омокэт") {
|
||||
$gameSystem.unlockAchievement("YOU_THINK_YOU_RE_CLEVER_HUH")
|
||||
}
|
||||
if (new RegExp($gameSystem._badWords.join("|")).test(text.toLowerCase())) { // YIN - Bad words check
|
||||
this.playBuzzerSound();
|
||||
return;
|
||||
}
|
||||
this.deactivate();
|
||||
this.close();
|
||||
this._nameWindow.close();
|
||||
if (_TDS_.NameInput.params.nameVariableID > 0) {
|
||||
$gameVariables.setValue(_TDS_.NameInput.params.nameVariableID, text);
|
||||
};
|
||||
} else {
|
||||
this.playBuzzerSound();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// OMORI RUS mod specific: Bad ending movie cover switcher.
|
||||
// Switches between Russian cover and original cover of My Time by Bo En.
|
||||
// ============================================================================
|
||||
|
||||
(function() {
|
||||
var _ConfigManager_makeData = ConfigManager.makeData;
|
||||
ConfigManager.makeData = function() {
|
||||
var config = _ConfigManager_makeData.apply(this, arguments);
|
||||
config.rusCoverInBadEnding = this.rusCoverInBadEnding;
|
||||
return config;
|
||||
};
|
||||
|
||||
var _ConfigManager_applyData = ConfigManager.applyData;
|
||||
ConfigManager.applyData = function(config) {
|
||||
_ConfigManager_applyData.apply(this, arguments);
|
||||
if (config['rusCoverInBadEnding'] === undefined)
|
||||
this.rusCoverInBadEnding = true;
|
||||
else
|
||||
this.rusCoverInBadEnding = this.readFlag(config, 'rusCoverInBadEnding');
|
||||
};
|
||||
|
||||
Window_OmoMenuOptionsGeneral.prototype.processOptionCommand = function() {
|
||||
// Get Index
|
||||
var index = this.index();
|
||||
// Get Data
|
||||
var data = this._optionsList[index];
|
||||
// Switch Case Index
|
||||
switch (index) {
|
||||
case 0: // Screen Resolution
|
||||
// Set Width & Height
|
||||
Yanfly.Param.ScreenWidth = 640 * (data.index + 1);
|
||||
Yanfly.Param.ScreenHeight = 480 * (data.index + 1) ;
|
||||
SceneManager._screenWidth = Yanfly.Param.ScreenWidth;
|
||||
SceneManager._screenHeight = Yanfly.Param.ScreenHeight;
|
||||
// SceneManager._boxWidth = Yanfly.Param.ScreenWidth;
|
||||
// SceneManager._boxHeight = Yanfly.Param.ScreenHeight
|
||||
Yanfly.updateResolution();
|
||||
Yanfly.moveToCenter();
|
||||
//window.moveTo(x, y);
|
||||
// Set Config Manager Screen Resolution
|
||||
ConfigManager.screenResolution = data.index;
|
||||
break;
|
||||
case 1: // Fullscreen
|
||||
// Set data Index
|
||||
//data.index === 0 ? Graphics._requestFullScreen() : Graphics._cancelFullScreen();
|
||||
// Set config manager Full screen state
|
||||
ConfigManager.fullScreen = data.index === 0 ? true : false;
|
||||
this._processDelay = 20;
|
||||
//Input.update();
|
||||
break;
|
||||
case 2:
|
||||
ConfigManager.gamepadTips = data.index === 0 ? false : true;
|
||||
if(SceneManager._scene instanceof Scene_OmoriTitleScreen) {
|
||||
SceneManager._scene.refreshCommandHints(); // Refresh command title hints;
|
||||
}
|
||||
break;
|
||||
case 3: ConfigManager.textSkip = data.index === 0 ? true : false; break;
|
||||
//case 3: ConfigManager.battleAnimations = data.index === 0 ? true : false ;break;
|
||||
//case 4: ConfigManager.battleAnimationSpeed = data.index ;break;
|
||||
case 4: ConfigManager.battleLogSpeed = data.index; ;break;
|
||||
case 5: ConfigManager.alwaysDash = data.index === 0 ? true : false ;break;
|
||||
|
||||
// OMORI RUS mod specific:
|
||||
case 6: ConfigManager.rusCoverInBadEnding = data.index === 0 ? true : false; break;
|
||||
};
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: GTP_OmoriFixes
|
||||
// ============================================================================
|
||||
|
||||
Gamefall.OmoriFixes = Gamefall.OmoriFixes || {};
|
||||
|
||||
(function($) {
|
||||
|
||||
Yanfly.BEC.BattleManager_processTurn = function() {
|
||||
var subject = this._subject;
|
||||
var action = subject.currentAction();
|
||||
if (action) {
|
||||
action.prepare();
|
||||
if (action.isValid()) {
|
||||
this.startAction();
|
||||
}
|
||||
else {
|
||||
//===================================
|
||||
// Addon for checking JUICE
|
||||
if(DataManager.isSkill(action.item())) {
|
||||
if(subject.mp < action.item().mpCost) {
|
||||
this._logWindow.push("addText", subject.name().toUpperCase() + " не хватает СОКА!");
|
||||
this._logWindow.push("wait");
|
||||
}
|
||||
}
|
||||
//===================================
|
||||
}
|
||||
subject.removeCurrentAction();
|
||||
} else {
|
||||
subject.onAllActionsEnd();
|
||||
this.refreshStatus();
|
||||
this._logWindow.displayAutoAffectedStatus(subject);
|
||||
this._logWindow.displayCurrentState(subject);
|
||||
this._logWindow.displayRegeneration(subject);
|
||||
this._subject = this.getNextSubject();
|
||||
}
|
||||
}
|
||||
|
||||
$.Print_Something_Txt = function() {
|
||||
const path = require("path");
|
||||
const fs = require("fs")
|
||||
const os = require("os");
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
var deskDir = `${base}/`;
|
||||
NativeFunctions.writeExternalFileUTF8(deskDir + `___для_${$gameActors.actor(8).name()}___.txt`, `............. ... ............................... ..... ............. ..... ..
|
||||
........... . .. . . .. ... . .. .. ... . ..
|
||||
........... .. . . . OOZZZZZO . .. ... ... . .. ...
|
||||
........... .. .OZZZZZZZZZZZZZO, . . .. .. . .
|
||||
............. .. . . . ZZZZZZZZZZZZZZZZZZZZO.... ... ... ... ... ... ... ..
|
||||
............. ... ... ?ZZZZZZZZZZZZZZZZZZZZZZZMMZO...... ........ .........
|
||||
.................... MZZZZZZZZZZZZZZZZZZZZZZZZZZZMZZZ .........................
|
||||
..... . .........MMMZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ........................
|
||||
. . ....... OZZMMZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ$......................
|
||||
. . .......ZZZOMMMMMMMMMZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ....................
|
||||
. . . ......NZZMNMMMMMMMMMMNNZZMMMNMOMMOM8ZZZZZZZZZZZZZZI...................
|
||||
. . . ......OMZZZMMMMMMMMMMMMMZZZMMMMMMZZMZZZZZZZZZZZZZZZZ...................
|
||||
.. ... .. ....MZZZOMMMMMMMMMMMMMMZNMMMMMMMZMMZZZZZZZZZZZZZZZZZ, ................
|
||||
.............MMZMZZZZMMMMZMMMMMMMMMMZZMMMMMZZZZZZZZMZZMOZZZMMZZ~................
|
||||
.. . ..=MMZMMMZMZZMZOMMMMMMMMMMMMMMMMZZZZZZZZZZZZMOZMMMMZZZ................
|
||||
............MOMZNOOOMMMMZZDONMMMMMMMMMMMOOZZMDZOZOMOZZNNNMMMMMMOZ~..............
|
||||
. . . .ZMMMZZZZMZZZMMMDMMMMMMMMMMMMMMZZZZZMDOZMZOMMMZMOMZMZZZZ .............
|
||||
. .. . MZMMZZZMZZZOZOZZZMOMMMMMMMMMZZZMMMMZZ8MMMMMMZZMZZMZMMZZZZ.............
|
||||
..........ZMZZOZOZZZMZZMZZDONMMMMMMMMM.,OMMMZZMMMMMMMMMMMMMMMMMMMZZ ............
|
||||
. . ZMOMZOMOMMMMZZMMZDOMOOMMMOMM=.. ,MMMMMMMMMMMZMMMZMMMMMMMMZI............
|
||||
.. ... ZOMMMMMMMMMMMMZOZMDO8ZMMOMMMZ.....MMMMMMMMMMMMMMMMMMMMMMMMOZ............
|
||||
........ZZMMZMMMMMMZZMMZZMMMMZMMMMMM,. ...IMMMMMMMMMMMMMMMMMMMMMMMMZ$...........
|
||||
.......8ZZMMMMMMMOMMZZMMZZZZZMMMMMM7.......IMMMMMMMMMMMMMMMMMMMMMMMOZ...........
|
||||
. .... O8DMMDDDZZMMOODOZZZDZDDDZMD~.........MMMMMMMMMMMMMMMMMMMMMMMMD...........
|
||||
. ..MMZOMMMOMZZMMZZMMZZOZZMMMZMZ:.........,MMMMMMMMMMMMMMMMMMMMMMMMO .........
|
||||
..... MNZZZZZMMZZMOZZZZZZZDZZZZMZM. .........OMMMMMMMMMMMMMMMMMMMMMMOM .........
|
||||
......MNZZZZZZZZZ8NZZZZNZZ8ZZZNM8~. .........~MMMMMMMM8M8ZMMMMMMMMMMM8 .........
|
||||
.....MMNZZZZZZZZMZMOMMONOMMZOMZZ..............~MMMMMMZMOMMZMMZMZOMMMMMZ.........
|
||||
....IMMMDDZZZZDZDDMZDMMMMMNDDMOZ...............=MMDDZMDZ8DOZZZZZZZDMDMM ........
|
||||
....MMMZZMZZZZMMMMMMMMMOMZMMMZM:.............. =ZMMMZMZZZZZZZZZZZZZMZZM:........
|
||||
....MMMMOZMMZMMZZMMMMMMMMMMMMOZ.................IMMMMMOZZZZZZZZZZZZZZZZM........
|
||||
...MMMNOON8MMNMMMMMMMMMMMMMMMM...................ZMZO88ZNZZZZZZZZZZZZNMN8.......
|
||||
...MMZMNZZMMMMMMMMMMMMMMMMMMMM. ................,+MZZMMMZMOZZMOZZZZOZZZZO.......
|
||||
...MMZMNOMMMMMMMMMMMMMMMMMMMMZ. ..................MMZMZMZZMMMZMOZZDZZZZZM.......
|
||||
.. MMMMMMMMMMMMMMMMMMMMMMMMMM. ...................MMMMMMMMMMMMMMMZDZZZZZZ+......
|
||||
..MMMMMMMMMMMMMMMMMMMMMMMMMMM................... .=MMMMMMMMMMMMMMODMMMZZZO .....
|
||||
..MMMMMMMMMMMMMMMMMMMMMMMMMMN. ...... ~+..........,MMOZMMZMMMMMMMMMMNMOZZZ,.....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMN. ...,ZNУ.ТЕБЯM,...... MMMMMMOZMMMMMMMMMMMMZMO.....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMD, ...NMЧТО-ТОNNM.......MZMMMMZMMMMMMMMMMMMMMMM.....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMD ....MMMMЗАMMMMM,......M8MDMMNMMMMMMMMMMMMMMMM.....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMD.....MMMТВОЕЙMMM .... .ZZMZOMMMMMMMMMMMMMMMMMM.....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMM.....:MMСПИНОЙM.......MZOMOMZMOMMMMMMMMMMMMMMM.....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMMI......=?MMMM.........MMMZMMMOZMZMMMMMMMMMMZZZ.....
|
||||
.,MMMMMMMMMMMMMMMMMMMMMMMMMMMM.....................MMMMMMMMMZZMOMMMMMMMMMMO.....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMMM....................+MMMMMMMMMDZMD8MDDMMMMMMD.....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMMM.................. .MMMMMMMMMMZMMMMMDMNMMMMZZ.....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMMM.................. .MMMMMMMMMMMMMMMMMMOMMMZZZM....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMMM, .... ............ZMMMMMMMMMMMMMMMMMMMMMMMZMM....
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ,.................MMMMMMMMMMMMMMMMMDMMMMMZOMM....
|
||||
.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.................ZMMMMMMMMMMMMMMMMMMMMMMMMMOM....
|
||||
. MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...............:MMMMMMMMMMMMMMMMMMMMMMMMMZZZ....
|
||||
..MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...............+MMMMMMMMMMMMMMMMMMMMMMMMZZZZ....
|
||||
..MMMMMMMMMMMMMOMMZMMMMMMMMMMMMM .............=MMMMMMMMMMMMMMMMMMMMMMMMMZZZZ....
|
||||
..MMMMMMMMMMMMMMZZMMMMMMMMMMMMMMZ,.......... OMMMMMMMMMMMMMMMMMMMMMMZMMZZZZZ....
|
||||
.. MMMMMMMMMMMMOOZMMMMMMMMMMMMMMMZ: .........MMMMMMMMMMMMMMMMMMMMMMMOMMMZZZZI...
|
||||
.. MMNMM8MMNODZZO8MMMMMMMMMMMMMMMMZ:........MMMMMMMMMM8MMMMMMMMMNMM88ZM8ZZZZ+...
|
||||
.. MMMZ8MZZZMZZZZMMMMMMMMMMMMMMMMMMZ.......IMMMMMMMMMMMMMMMMMMMOMMDMZZZZZZZZZ...
|
||||
..MMMMMMM$OOZZZZOMMMMMMMMMMMMMMMMMMM.... .OMMMMMMMMMMMMMMMMMMMMMMZZOZZZZZZZZZ...
|
||||
..MMMMZNOZZZZZZZZMZZMMMMMMMMMMMMMMMM=. ..=MMMMMMMMMMMMMMMMMMNMZZZMZZZZZMMZZZZ...
|
||||
..MMMMM8ZZZZZZZZMMMMMMMMMMMMMMMMMMMMMM .IMMMMMMMMMMMMMMMZMMMMMMZZMDMZOZMZZZZZ...
|
||||
..MMMMMNNNZZZZZN8ZDMMMMMMMMMMMMMMMMMMM..MMMMMMMMMMMMMMMM8MMDMNZMMNMM88ZZZZZZZ...
|
||||
..MMMMMMMMZZZZZZMZMMMMMMMMMMMMMMMMMMMMZZMMMMMMMMMMMMMMMMMZZMMMOMMMMMZMMZZZZZZ ..
|
||||
..MMMMMMMZZMZZZMZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOMMMMMMMMMMZMZZZZ ..
|
||||
...MMMMMMMZMOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMMMMMMDMMOOMMMMZZ ..
|
||||
...MMMMMZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMZMZZ ..
|
||||
...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMMMMMMMMMMMMMMMMMMMMMMMZZ ..
|
||||
...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...
|
||||
...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMMMMMMMMMMMMMMMMMMMMMM...
|
||||
...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ..
|
||||
....MMMMMMMMMMMMMMMOZOMMMMMMOMZZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...
|
||||
....MMMMMMMMMMMZMMMMMMMMMMMMMMZMMMMMMMMMMMMMMMMMMMMMMMMMMZMMMMMMMMMMMMMMMMMMM...
|
||||
....MMMMMMMMMMMMMMMMMMMZZZDZOMZZMZZZZZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...
|
||||
....MMMMMMMMMMMMMMMMMMMMMMMMNOZZZZZZZZZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...
|
||||
....MMMMMMMMMMMMMMMMMMMMMMMZMOZZZZZZZZZZMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM7...
|
||||
....MMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZZZZZOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM7...
|
||||
....DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZZZMMMMMNZZZMMMMMMMMMMMMMMMMMMMMMMMMZ....
|
||||
....DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZZZZZMMM8MZZZZZZMMMMMMMMMMMMMMMMMMMMZ....
|
||||
.... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZZZZDMMMZZZZZZMMMMMMMMMMZMOMMMMMMMM....
|
||||
.....MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZZZMMMMMZZZZZMMMMMMMMMMMMMOMMMMMMM....
|
||||
.... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZZZZMZ8ONOZZZZMMMMMMMMMMMMMMOMMMMMM....
|
||||
.....MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZZMZZOZZZZZZM=...,MMMMMMMMMMMMMMM....
|
||||
..... MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ8ZOZZZZZZ. .....MMMMMMMOMMMMMMM....
|
||||
......MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZMMOZZZZZZZM .......MZOMMMMMMMMMMM....
|
||||
......MMMMMMMMMMM. ..... MMMMMMMMMMMMMMMMMMMMZZZZZZZZ..........MMMMMMMMMMMMM....
|
||||
......MMMZMMMMMM..........MMMMMMMMMMMMMMMMMMMMZZZZZZM..........NMMMMMMMMMMMM....
|
||||
......MMZMZMMMM=...... . ..MMMMMMMMMMMMMMMMMMDODZMMM.. .. ......MMMMMMMMMMMM. ..
|
||||
......MMZ$ZMMMM............MMMMMMMMMMMMMMMMMMNMMONM,............NMMMMMMMMMMO....
|
||||
.......MMOMZZOM,...... ....+MMMMMMMMMMMMMMMMMMMNMNM ............ MMMMMMMMM8Z....
|
||||
.......MZZZOZMO....... .....MMMMMMMMMMMMZMMMMMMMMMM..............MMMMMMMMMMM....
|
||||
.......MZOZZZZ .............MMMMMMMMMMMMMMZZMMMMMM.... ...........MMMMMMMMNO....
|
||||
.......NZMZZOM .............MMMMMMMMMMMMMMMMMMMMMM................MMMMMMMZO+....
|
||||
.......ZZZMZZZ ... . .... MMMMMMMMMMMMMMMMMMMMM .... ......... .7MMMMMMOM+....
|
||||
.......MMZMZZN..............:MMMMMMMMMMMMMMMMMMMM,................ MMMMMOMN?....
|
||||
.......MMOOMM................MMMMMMMMMMMMMMMMMMMM .................MMMMMMZM+....
|
||||
........OMZMM ........ ..... MMMMMMMMMMMMMMMMMMMM ..................MMMMMZN+....
|
||||
........MMMMM...............:MMMMMMMMMMMMMMMMMMM. ..................MMMMMMM+....
|
||||
........MMMMM............... MMMMMMMMMMMMMMMMMMM. .... .............:MMMMMM+....
|
||||
........MMMMM... ..... . ....MMMMMMMMMMMMMMMMMMM. .... ......... ... MMMMMM ....
|
||||
........NMMM ................MMMMMMMMMMMMMMMMMM....... ..............MMMMMO.....
|
||||
.........MZO ......... . ....MMMMMMMMMMMMMMMMMM . ............. . .. MMMMMO.....
|
||||
........,O8M.......... ......MMMMMMMMMMMMMMMMMM ..................... MMMM:.....
|
||||
.........ZMM................ MMMMMMMMMMMMMMZM8M.......................$MMM .....
|
||||
........ MM... ............. MMMMMMMMMMMMMMMZNM.. ................... MMZ......
|
||||
........ MM..... ..... .... .MMMMMMMMMMMMMMMMMM.. .... ......... .. . .MMM .....
|
||||
........ MM .......... ......MMMMMMMMMMMMMMMMM?.. .... .............. . MM .....
|
||||
........ 8M........... . .. .MMMMMMMMMMMMMMMMM. . .... .. ......... . ..M. .. ..
|
||||
........ ZM... ..............MMMMMMMMMMMMMMMMM .. ................... ..M ......
|
||||
.........Z ........... .... .NMMMMMMMMMMMMMMMM... ... ..... ..... ... .........
|
||||
.......... ........... ...... MMMMMMMMMMMMMMMM... ................... ..........
|
||||
............................. MMMMMMMMMMMMMMMM... ................... ..........
|
||||
............................. MMMMMMMMMMMMMMM+... ................... ..........
|
||||
............................. MMMMMMMMMMMMMMM...................................
|
||||
...................... .. ... MMMMMMMMMMMMMMM.... .... ......... .... .... .....
|
||||
............................. MMMMMMMMMMMMMMM.... .... ......... .... .... .....
|
||||
............................. MMMMMMMMMMMMMM:.... ................... ..........
|
||||
............................. MMMMMMMMMMMMMM..... ................... ..........
|
||||
............................. MMMMMMMMMMMMMM..... ................... ..........
|
||||
...................... ...... MMMMMMMMMMMMMM .... .............. .... ..........
|
||||
..................... ....... MMMMMMMMMMMMZ .... .... ......... .... .... .....
|
||||
............................. MMMMOMMMMMMOM ..... ................... ..........
|
||||
..............................MMMMOMMMMMZMM. .... .... ......... .... .... .....
|
||||
..............................MMMMD8DD8OZZZ ..... .... .............. .... .....
|
||||
...............................MMMOZMMZZZZZ...... .... .............. .... .....
|
||||
...............................MMMMMZMZZZZZ ....................................
|
||||
..... ... ............ ....... MMZZMZZZZZZZ .... .... ......... .... .... .....
|
||||
..............................$MZZZOOZZZZZZ...... ................... ..........
|
||||
...................... ....... ZZZOZZZZZZZ....... .... .............. .... .....
|
||||
........ .....................MZZOZZZZZZZ....... ................... ..........
|
||||
...................... ........MZOOZZZZZZZ....... ................... ..........
|
||||
..................... ........MM88ZOZNZZZ ...... .... .............. .... .....
|
||||
.. . ... .....................MMMZMMMMZZZO...... ................... ..........
|
||||
...............................MMMMOMMZ$ZM.. .... .... ......... .... .... .....
|
||||
...............................MMM8ZNMDMMD......................................
|
||||
.. ... . ............ .........MMMMMMMMMO . .... .... ......... .... .... .....
|
||||
................................MMMMMMMZ8M......................................
|
||||
..................... ........ MMNMMMMZM. ...... .... .............. .... .....
|
||||
...................... .. ......MMMMMMMMZ. . .... .... ......... .... .... .....
|
||||
................................MMMDMMMMD ......................................
|
||||
................................MMMZMMOMM........ ............ ...... ..........
|
||||
...................... .. ...... MOOMZMM . . .... .... ......... .... .... .....
|
||||
...................... .... .....MMMMMMM.. ...... ................... ..........
|
||||
.................................MMMMZMM......... ................... ..........
|
||||
.................................MMMMZM ......... ................... ..........
|
||||
.................................MMMZOM ......... ................... ..........
|
||||
.................................MMMOMM ... .... .... ......... .... .... .....
|
||||
...................... .. . .....MNZZZ$... ...... ............ ...... ..........
|
||||
................................ MMMMZ:.........................................
|
||||
..................... ..... ... MMMZM... ... ... ............... ... ..........
|
||||
...................... ..........,MMMM.... ...... ................... ..........
|
||||
...................... .......... MMZM.... ...... ................... ..........
|
||||
..................... ..... ... ..MMM ... .. .... .............. .... ..........
|
||||
..................................MMM ........... ................... ..........
|
||||
........................... ......MMM....... .... .... ......... .... .... .....
|
||||
..................................MMM............ ................... ..........
|
||||
...................... .. ... ... MM ..... . .... .... ......... .... .... .....
|
||||
..................... .... ... ..MM .... ...... .... .............. .... .....
|
||||
..................................DM............. ................... ..........
|
||||
....... . .........................=............. ................... ..........
|
||||
...................................+............. ................... ..........
|
||||
......... ........... ........ .... .... . .... .... ......... .... .... .....
|
||||
................................................................................
|
||||
.. .. . . ............ ........ .... ..... ...... .... .............. .... .....
|
||||
`)
|
||||
}
|
||||
|
||||
$.parseNoEffectEmotion = function(tname, em) {
|
||||
if(em.toLowerCase().contains("afraid")) {
|
||||
return target.name() + " не может ИСПУГАТЬСЯ сильнее!\r\n";
|
||||
}
|
||||
let finalString = `${tname} не может стать ${em}`;
|
||||
if(finalString.length >= 40) {
|
||||
let voinIndex = 0;
|
||||
for(let i = 40; i >= 0; i--) {
|
||||
if(finalString[i] === " ") {
|
||||
voinIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
finalString = [finalString.slice(0, voinIndex).trim(), "\r\n", finalString.slice(voinIndex).trimLeft()].join('')
|
||||
}
|
||||
return finalString;
|
||||
}
|
||||
|
||||
$.parseNoStateChange = function(tname,stat,hl) {
|
||||
let noStateChangeText = `${stat} ${tname} не может`
|
||||
let second = `стать ${hl}`; // TARGET NAME - STAT - HIGHER/LOWER
|
||||
let complete = `${noStateChangeText} ${second}`;
|
||||
if(complete.length < 40) {
|
||||
BattleManager.addText(complete, 16)
|
||||
}
|
||||
else {
|
||||
BattleManager.addText(noStateChangeText, 1)
|
||||
BattleManager.addText(second, 16)
|
||||
}
|
||||
}
|
||||
|
||||
Yanfly.BEC.Window_BattleLog_displayAddedStates = function(target) {
|
||||
target.result().addedStateObjects().forEach(function(state) {
|
||||
var stateMsg = target.isActor() ? state.message1 : state.message2;
|
||||
if (state.id === target.deathStateId()) {
|
||||
this.push('performCollapse', target);
|
||||
}
|
||||
if(state.id === target.deathStateId() && target.isActor()) {
|
||||
if([1,8,9,10,11].contains(target.actorId())) {
|
||||
stateMsg = " теряет сознание!";
|
||||
}
|
||||
}
|
||||
if (stateMsg) {
|
||||
this.push('popBaseLine');
|
||||
this.push('pushBaseLine');
|
||||
this.push('addText', target.name() + stateMsg);
|
||||
this.push('waitForEffect');
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
})(Gamefall.OmoriFixes);
|
||||
|
||||
Gamefall.JPWordWrap = Gamefall.JPWordWrap || {};
|
||||
|
||||
(function($) {
|
||||
|
||||
function isTextInCurrentLanguage (text) {
|
||||
const lang = LanguageManager.defaultLanguage()
|
||||
switch(lang) {
|
||||
default:
|
||||
//let englishOnly = /^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?☆ ]*$/;
|
||||
//if(!englishOnly.test(text)) {return false}
|
||||
let russianOnly = /^[а-яА-Я0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?☆ ]*$/;
|
||||
if(!russianOnly.test(text)) {return false}
|
||||
break;
|
||||
case "jp":
|
||||
let japaneseOnly = /^[\u3000-\u303F|\u3040-\u309F|\u30A0-\u30FF|\uFF00-\uFFEF|\u4E00-\u9FAF|\u2605-\u2606|\u2190-\u2195|\u203B|0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?☆ ]*$/g;
|
||||
if(!japaneseOnly.test(text)) {return false}
|
||||
break
|
||||
case "kr":
|
||||
let koreanOnly = /(^[\u3131-\u314e|\u314f-\u3163|\uac00-\ud7a3|0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?☆ ]*$)/g
|
||||
if(!koreanOnly.test(text)) {return false}
|
||||
case "sc":
|
||||
let scOnly = /^([\u4e00-\u9eff|\u3000-\u303F|0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?☆ ])*$/
|
||||
if(!scOnly.test(text)) {return false}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
DataManager.actorNamesPerLanguage = [
|
||||
["ОМОРИ", "OMORI", "オモリ", "오모리", "OMORI"],
|
||||
["ОБРИ", "AUBREY", "オーブリー", "오브리", "奥布里"],
|
||||
["КЕЛ", "KEL", "ケル", "켈", "凯"],
|
||||
["ХИРО", "HERO", "ヒロ", "히로", "英雄"]
|
||||
];
|
||||
|
||||
DataManager.chapterNamesPerLanguage = [
|
||||
["???", "???", "???", "???", "???"],
|
||||
["ДЕНЬ ПЕРЕЕЗДА", "MOVING DAY", "引越しの日", "이삿날", "搬家当天"],
|
||||
["ОСТАЛОСЬ ОДИН ДЕНЬ...", "ONE DAY LEFT...", "あと1日……", "이삿날까지 하루 남음...", "还有一天……"],
|
||||
["ОСТАЛОСЬ ДВА ДНЯ...", "TWO DAYS LEFT...", "あと2日……", "이삿날까지 이틀 남음...", "还有两天……"],
|
||||
["ОСТАЛОСЬ ТРИ ДНЯ...", "THREE DAYS LEFT...", "あと3日……", "이삿날까지 사흘 남음...", "还有三天……"],
|
||||
["ПРОЛОГ", "PROLOGUE", "プロローグ", "서장", "序章"]
|
||||
];
|
||||
|
||||
DataManager.locationNamesPerLanguage = [
|
||||
["УЛИЦА","OUTSIDE","家の外","바깥","外面"],
|
||||
["МАМИНА КОМНАТА","MOM'S ROOM","お母さんの部屋","엄마의 방","妈妈的房间"],
|
||||
["ДОМ БЭЗИЛА","BASIL'S HOUSE","バジルの家","바질의 집","贝瑟尔家"],
|
||||
["ПАРК ГОРИЗОНТА","FARAWAY PARK","ハルバル公園","패러웨이 공원","遥远公园"],
|
||||
["ТАЙНОЕ ОЗЕРО","SECRET LAKE","秘密の湖","비밀 호수","秘密湖泊"],
|
||||
["ЛЕСНАЯ ПЛОЩАДКА","FOREST PLAYGROUND","森の遊び場","숲 놀이터","森林游乐场"],
|
||||
["БЕСКРАЙНИЙ ЛЕС","VAST FOREST","ヒロビロ森","광대한 숲","辽阔森林"],
|
||||
["ЛЕС ВЕРТУШЕК","PINWHEEL FOREST","カザグルマ森","바람개비 숲","风车森林"],
|
||||
["АПЕЛЬСИНОВЫЙ ОАЗИС","ORANGE OASIS","オレンジオアシス","오렌지 오아시스","橙子绿"],
|
||||
["ГОРОДОК ДОЖДЯ","RAIN TOWN","アメフリの町","비의 마을","落雨镇"],
|
||||
["ВНЕЗЕМЕЛЬЕ","OTHERWORLD","イセカイ","별세계","异世界"],
|
||||
["ЗАМЁРЗШЕЕ ОЗЕРО","FROZEN LAKE","ヒエビエ湖","얼어붙은 호수","结冰湖"],
|
||||
["ГОРА СНЕЖНЫЙ ШАР","SNOWGLOBE MOUNTAIN","スノードームマウンテン","스노우블로브 산","雪花球山"],
|
||||
["СВАЛКА","JUNKYARD","廃品投棄場","쓰레기장","垃圾场"],
|
||||
["ЛЕС СВЕТЛЯЧКОВ","PYREFLY FOREST","ヒバナ森","반딧불더미 숲","焚火虫森林"],
|
||||
["ПОТЕРЯННЫЙ ЛЕС","LOST FOREST","サイゴノ楽園","잃어버린 숲","迷失森林"],
|
||||
["ДЕРЕВНЯ РОСТОКРОТОВ","SPROUT MOLE VILLAGE","ナエモグ村","두더지 새싹 마을","树苗鼹鼠村"],
|
||||
["ЗАМОК ДУШЕЧКИ","SWEETHEART'S CASTLE","スイートハート城","스위트하트의 성","甜心城堡"],
|
||||
["ПОСЛЕДНИЙ ШАНС","LAST RESORT","サイゴノ楽園","최후의 도피처","最后度假村"],
|
||||
["ПОДВОДНОЕ ШОССЕ","UNDERWATER HIGHWAY","水中高速道路","수중 고속도로","水下高架"],
|
||||
["ГЛУБОЧАЙШИЙ КОЛОДЕЦ","DEEPER WELL","シンエン井戸","더 깊은 우물","深井深处"],
|
||||
["ХАМФРИ","HUMPHREY","ハンフリー","험프리","汉弗莱"],
|
||||
["КАСКАД БОССОВ","BOSS RUSH","ボスラッシュ","보스 러시","头目反击战"],
|
||||
["БЕЗДНА","THE ABYSS","ナラク","심연","深渊"],
|
||||
["ЧЁРНОЕ ПРОСТРАНСТВО","BLACK SPACE","ブラックスペース","검은 공간","黑色空间"],
|
||||
["ПОЛЯНКА БЭЗИЛА","BASIL'S MEADOW","バジルの草原","바질의 꽃밭","贝瑟尔的草地"],
|
||||
["ПОТЕРЯННАЯ БИБЛИОТЕКА","LOST LIBRARY","失われし図書館","잃어버린 도서관","失落图书馆"],
|
||||
["ШТАБ ЭКОКУЛЬТИСТОВ","RECYCULTIST'S HQ","リサイカルト本部","재활용교도의 본부","回收教徒总部"],
|
||||
["ХЛЕБЕСА","BREAVEN","パンクチュアリ","빵천국","面包天堂"],
|
||||
["ЗА КУЛИСАМИ","BACKSTAGE","バックステージ","무대 뒤편","后台"],
|
||||
["ДОРОГА ВОСПОМИНАНИЙ","MEMORY LANE","思い出の道","추억의 뒤안길","回忆小道"],
|
||||
["СПАЛЬНЯ СОСЕДЕЙ","NEIGHBOR'S BEDROOM","オトナリベッドルーム","이웃의 침실","邻居的卧室"]
|
||||
];
|
||||
|
||||
// For compatibility with 1.0.7 and lower versions.
|
||||
if (typeof DataManager.convertNameToLanguage == 'undefined') {
|
||||
DataManager.convertNameToLanguage = function(type, name) {
|
||||
let myLanguageIndex = ['en', 'jp', 'kr', 'sc'].indexOf(LanguageManager.defaultLanguage());
|
||||
if (myLanguageIndex != -1) {
|
||||
let namesPerLanguage = type === 'actor'? this.actorNamesPerLanguage : type === "chapter" ? this.chapterNamesPerLanguage : this.locationNamesPerLanguage;
|
||||
for (let entryNum = 0; entryNum < namesPerLanguage.length; entryNum++) {
|
||||
for (let languageID = 0; languageID < namesPerLanguage[entryNum].length; languageID++) {
|
||||
if (languageID == myLanguageIndex) continue;
|
||||
if (name == namesPerLanguage[entryNum][languageID]) { // Name from other language detected
|
||||
return namesPerLanguage[entryNum][myLanguageIndex];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
DataManager = class extends DataManager {
|
||||
static loadSavefileInfo(savefileId) {
|
||||
var globalInfo = this.loadGlobalInfo();
|
||||
if (globalInfo && globalInfo[savefileId]) {
|
||||
globalInfo[savefileId].actorData.name = this.convertNameToLanguage('actor', globalInfo[savefileId].actorData.name);
|
||||
if(!isTextInCurrentLanguage(globalInfo[savefileId].actorData.name)) {
|
||||
const lang = LanguageManager.defaultLanguage();
|
||||
globalInfo[savefileId].actorData.name = LanguageManager._data[lang]["text"]["XX_BLUE"]["Omori_Name_Input"]["defaultname"] // Assuming this is Sunny as all the other characters that could save
|
||||
// are defined inside actorNamesPerLanguage array.
|
||||
}
|
||||
globalInfo[savefileId].chapter = this.convertNameToLanguage('chapter', globalInfo[savefileId].chapter);
|
||||
globalInfo[savefileId].location = this.convertNameToLanguage('location', globalInfo[savefileId].location)
|
||||
};
|
||||
return (globalInfo && globalInfo[savefileId]) ? globalInfo[savefileId] : null;
|
||||
}
|
||||
}
|
||||
|
||||
Game_Actor = class extends Game_Actor {
|
||||
name() {
|
||||
if (this._actorId !== 8) { return super.name() } // NOT SUNNY
|
||||
const lang = LanguageManager.defaultLanguage();
|
||||
const defaultName = LanguageManager._data[lang]["text"]["XX_BLUE"]["Omori_Name_Input"]["defaultname"];
|
||||
let name = this._name;
|
||||
if (!isTextInCurrentLanguage(name)) { name = defaultName }
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
})(Gamefall.JPWordWrap)
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: Omori Name Input
|
||||
// ============================================================================
|
||||
|
||||
// VirtualKeyboard not exists in 1.0.7 and lower versions.
|
||||
if (typeof VirtualKeyboard !== 'undefined') {
|
||||
VirtualKeyboard.EN = {
|
||||
default: [
|
||||
"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}",
|
||||
"й ц у к е н г ш щ з х ъ \\",
|
||||
"{lock} ф ы в а п р о л д ж э",
|
||||
"я ч с м и т ь б ю . {confirm} {space}"
|
||||
],
|
||||
shift: [
|
||||
"~ ! @ # $ % ^ & * ( ) _ + {bksp}",
|
||||
"Й Ц У К Е Н Г Ш Щ З Х Ъ |",
|
||||
"{lock} Ф Ы В А П Р О Л Д Ж Э",
|
||||
"Я Ч С М И Т Ь Б Ю ? {confirm} {space}"
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Patches for plugin: YIN - Minigame - PizzaDelivery
|
||||
// ============================================================================
|
||||
|
||||
Game_Interpreter.prototype.initPizzaDelivery = function () {
|
||||
ImageManager.loadPicture("PIZZA-Background");
|
||||
//ImageManager.loadAtlas("MN_PizzaItems"); // obsolete
|
||||
// Because we have multiple atlases instead of one,
|
||||
// we should preload all of those:
|
||||
ImageManager.loadAtlas("MN_PizzaItems_1");
|
||||
ImageManager.loadAtlas("MN_PizzaItems_2");
|
||||
ImageManager.loadAtlas("MN_PizzaItems_3");
|
||||
|
||||
$gameSystem._chosenHouses = [];
|
||||
$gameSystem._checkedHouses = [];
|
||||
|
||||
var _pizzaHouse1 = this.generateHouse(1);
|
||||
var _pizzaHouse2 = this.generateHouse(2);
|
||||
var _pizzaHouse3 = this.generateHouse(3);
|
||||
|
||||
this._pizzaHouse1 = _pizzaHouse1;
|
||||
this._pizzaHouse2 = _pizzaHouse2;
|
||||
this._pizzaHouse3 = _pizzaHouse3;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
//=============================================================================
|
||||
// Region Randomize
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Places an event on specificied region randomly.
|
||||
*
|
||||
*
|
||||
* 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]);
|
||||
};
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
//=============================================================================
|
||||
// RotatePictureEx.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Rotate picture with specified angle and frame
|
||||
* @author Sasuke KANNAZUKI
|
||||
*
|
||||
* @help Plugin Command:
|
||||
* RotatePictureEx <pictureId> <angle> <frame> <waitFlag>
|
||||
* where <pictureId> must be the number of picture id.
|
||||
* <angle> must be the number to rotate angle. when positive value,
|
||||
* it rotates clockwise. when negative value, it rotates reverse.
|
||||
* <frame> must be the natural number that frame to rotate.
|
||||
* <waitFlag> must be 0 or 1. when it is 1, wait until rotate is finished.
|
||||
*
|
||||
* for any parameter, you can set variable ID for following notation:
|
||||
* V20 # the value of game variable #20.
|
||||
*
|
||||
* ex:
|
||||
* RotatePictureEx 1 720 60 1 # rotate picture #1 720 degree in 60 frames
|
||||
* and wait until rotation finished.
|
||||
* RotatePictureEx V10 720 V20 0 # rotate picutre whose number is the value of
|
||||
* game variable #10, rotate 720 frames in the frames of the value of
|
||||
* game variable #20
|
||||
*
|
||||
* note:
|
||||
* - command is invalid when the picture is not displayed.
|
||||
* - if you execute command when older rotation is not finished,
|
||||
* older rotation is cancelled.
|
||||
* - if you execute command when the picture is rolling by event command,
|
||||
* temporary stop event rolling and execute command instead.
|
||||
* - You can rotate picture with moving and/or changing tint,
|
||||
* by operating event command and plugin command simultaneously.
|
||||
*
|
||||
* Copyright:this plugin is released under MIT license.
|
||||
* http://opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
/*:ja
|
||||
* @plugindesc ピクチャを指定した角度とフレーム数で回転させます
|
||||
* @author 神無月サスケ
|
||||
*
|
||||
* @help プラグインコマンド:
|
||||
* RotatePictureEx <pictureId> <angle> <frame> <waitFlag>
|
||||
* <pictureId> は、ピクチャIDにしてください。
|
||||
* <angle>は回転させたい角度(一周=360)にしてください。
|
||||
* 正の値なら時計回り、負の値なら反時計回りになります。
|
||||
* <frame>は回転にかかるフレーム数(1以上)にしてください(1秒=60フレーム)
|
||||
* 0か負の値を指定した場合、回転は行われません。
|
||||
* <waitFlag>が 1 なら回転が終わるまでウェイトします。0 ならウェイトしません。
|
||||
*
|
||||
* 各パラメータで、以下の書式で数字の代わりに変数IDを指定することが出来ます。
|
||||
* V20 # 変数20番の値
|
||||
*
|
||||
* 例:
|
||||
* RotatePictureEx 1 720 60 1 # 60フレームかけて720度回転させます。回転中は
|
||||
* ウェイトします。
|
||||
* RotatePictureEx V10 720 V20 0 # 変数10番の値のIDのピクチャを、
|
||||
* 変数20番の値のフレーム数で、720度回転させます。
|
||||
*
|
||||
* 注意:
|
||||
* - ピクチャが表示されていない時はプラグインコマンドは無効です。
|
||||
* - プラグインコマンドでの回転が終わらないうちに新たにプラグインコマンドで
|
||||
* 同じピクチャを回転させた場合、前の回転はキャンセルされます。
|
||||
* - イベントコマンドで回転させているピクチャにプラグインコマンドを実行した
|
||||
* 場合、イベントコマンドの回転を一旦休止して、こちらの回転を優先させます。
|
||||
* - 連続して「ピクチャの色調変更」や「ピクチャの移動」を実行することで、
|
||||
* 回転とそれらの操作を同時に行うことも可能です。
|
||||
*
|
||||
* このプラグインは MIT ライセンスで配布されます。
|
||||
* ご自由にお使いください。
|
||||
* http://opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
//
|
||||
// process plugin commands
|
||||
//
|
||||
function argToNumber(arg) {
|
||||
var reg = (/^V([0-9]+)/i).exec(arg);
|
||||
if(reg){
|
||||
return $gameVariables.value(Number(reg[1])) || 0;
|
||||
} else {
|
||||
return Number(arg) || 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 === 'RotatePictureEx') {
|
||||
var pictureId = argToNumber(args[0]);
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
var angle = argToNumber(args[1]);
|
||||
var frame = argToNumber(args[2]);
|
||||
var needsWait = !!argToNumber(args[3]);
|
||||
if (angle !== 0 && frame > 0 && picture) {
|
||||
picture.setRotationWithFrame(angle, frame);
|
||||
if (needsWait) {
|
||||
$gameMap._interpreter.wait(frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// setting 'rotation with frame' mode.
|
||||
//
|
||||
var _Game_Picture_initRotation = Game_Picture.prototype.initRotation;
|
||||
Game_Picture.prototype.initRotation = function() {
|
||||
_Game_Picture_initRotation.call(this);
|
||||
this.resetRotationWithFrame();
|
||||
};
|
||||
|
||||
Game_Picture.prototype.resetRotationWithFrame = function() {
|
||||
this._maxFrame = 0;
|
||||
this._frame = 0;
|
||||
this._maxAngle = 0;
|
||||
};
|
||||
|
||||
Game_Picture.prototype.setRotationWithFrame = function(angle, frame) {
|
||||
this._maxFrame = frame;
|
||||
this._frame = 0;
|
||||
this._maxAngle = angle;
|
||||
};
|
||||
|
||||
Game_Picture.prototype.isFrameSetMode = function() {
|
||||
this._maxFrame = this._maxFrame || 0;
|
||||
return this._maxFrame > 0;
|
||||
};
|
||||
|
||||
//
|
||||
// find current angle
|
||||
//
|
||||
var _Game_Picture_updateRotation = Game_Picture.prototype.updateRotation;
|
||||
Game_Picture.prototype.updateRotation = function() {
|
||||
if (this.isFrameSetMode()) {
|
||||
if (++this._frame === this._maxFrame) {
|
||||
this._angle += this._maxAngle;
|
||||
this.resetRotationWithFrame();
|
||||
}
|
||||
return;
|
||||
}
|
||||
_Game_Picture_updateRotation.call(this);
|
||||
};
|
||||
|
||||
var _Game_Picture_angle = Game_Picture.prototype.angle;
|
||||
Game_Picture.prototype.angle = function() {
|
||||
if (this.isFrameSetMode()) {
|
||||
var currenAngle = this._maxAngle * (this._frame / this._maxFrame);
|
||||
return _Game_Picture_angle.call(this) + currenAngle;
|
||||
}
|
||||
return _Game_Picture_angle.call(this);
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,236 +0,0 @@
|
|||
/*:
|
||||
* @plugindesc Adds more options for waiting in your events.
|
||||
* @author SumRndmDde
|
||||
*
|
||||
* @param SE Wait Buffer
|
||||
* @desc This is a guarenteed amount of waiting frames that occur when checking for SE to end.
|
||||
* @default 4
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* Wait Options
|
||||
* Version 1.01
|
||||
* SumRndmDde
|
||||
*
|
||||
*
|
||||
* This is a plugin that adds more options for waiting during events.
|
||||
*
|
||||
*
|
||||
* ==========================================================================
|
||||
* Plugin Commands
|
||||
* ==========================================================================
|
||||
*
|
||||
* How to wait for a specific amount of time:
|
||||
*
|
||||
*
|
||||
* Wait [number] Frames
|
||||
*
|
||||
* Allows you to wait for a certain amount of frames.
|
||||
*
|
||||
*
|
||||
* Wait [number] Seconds
|
||||
*
|
||||
* Allows you to wait for a certain amount of seconds.
|
||||
*
|
||||
*
|
||||
* Wait [number] Minutes
|
||||
*
|
||||
* Allows you to wait for a certain amount of minutes.
|
||||
*
|
||||
*
|
||||
* ==========================================================================
|
||||
*
|
||||
*
|
||||
* Wait for Route
|
||||
*
|
||||
* Waits for all movement routes to complete.
|
||||
*
|
||||
*
|
||||
* Wait for Animation
|
||||
*
|
||||
* Waits for all animations to complete.
|
||||
*
|
||||
*
|
||||
* Wait for Balloon
|
||||
*
|
||||
* Waits for all balloon animations to complete.
|
||||
*
|
||||
*
|
||||
* Wait for Message
|
||||
*
|
||||
* Waits for all messages to complete (best for parallel processes).
|
||||
*
|
||||
*
|
||||
* Wait for Transfer
|
||||
*
|
||||
* Waits for map transfer to complete
|
||||
*
|
||||
*
|
||||
* Wait for Scroll
|
||||
*
|
||||
* Waits for scrolling to complete.
|
||||
*
|
||||
*
|
||||
* Wait for Gather
|
||||
*
|
||||
* Waits for all followers to gather.
|
||||
*
|
||||
*
|
||||
* Wait for Action
|
||||
*
|
||||
* Waits for battle action to complete.
|
||||
*
|
||||
*
|
||||
* Wait for Video
|
||||
*
|
||||
* Waits for all videos to complete playing.
|
||||
*
|
||||
*
|
||||
* Wait for Image
|
||||
*
|
||||
* Waits for images to load.
|
||||
*
|
||||
*
|
||||
* Wait for SE
|
||||
*
|
||||
* Waits for all sound effects to stop playing.
|
||||
*
|
||||
*
|
||||
* Wait for ME
|
||||
*
|
||||
* Waits for all music effects to stop playing.
|
||||
*
|
||||
*
|
||||
* ==========================================================================
|
||||
*
|
||||
*
|
||||
* Cancel Wait
|
||||
*
|
||||
* Cancels all waiting.
|
||||
*
|
||||
*
|
||||
* ==========================================================================
|
||||
* How to Make Custom Waiting Conditions
|
||||
* ==========================================================================
|
||||
*
|
||||
* Wait for Condition [condition]
|
||||
*
|
||||
* Waits for a custom coindition.
|
||||
*
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Wait for Condition $gameVariable.value(3) > 5
|
||||
*
|
||||
* This will wait until Variable 3 is greater than 5.
|
||||
*
|
||||
*
|
||||
* ==========================================================================
|
||||
* End of Help File
|
||||
* ==========================================================================
|
||||
*
|
||||
* Welcome to the bottom of the Help file.
|
||||
*
|
||||
*
|
||||
* Thanks for reading!
|
||||
* If you have questions, or if you enjoyed this Plugin, please check
|
||||
* out my YouTube channel!
|
||||
*
|
||||
* https://www.youtube.com/c/SumRndmDde
|
||||
*
|
||||
*
|
||||
* Until next time,
|
||||
* ~ SumRndmDde
|
||||
*
|
||||
*/
|
||||
|
||||
var SRD = SRD || {};
|
||||
SRD.WaitOptions = SRD.WaitOptions || {};
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported["SumRndmDde Wait Options"] = 1.01;
|
||||
|
||||
(function(_) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var params = PluginManager.parameters('SRD_WaitOptions');
|
||||
|
||||
_.seWait = parseInt(params['SE Wait Buffer']);
|
||||
|
||||
var _Game_Interpreter_clear = Game_Interpreter.prototype.clear;
|
||||
Game_Interpreter.prototype.clear = function() {
|
||||
_Game_Interpreter_clear.apply(this, arguments);
|
||||
this._waitConditions = [];
|
||||
};
|
||||
|
||||
var _Game_Interpreter_updateWaitMode = Game_Interpreter.prototype.updateWaitMode;
|
||||
Game_Interpreter.prototype.updateWaitMode = function() {
|
||||
if(this._waitMode === 'se') {
|
||||
if(AudioManager._seBuffers.length === 0) {
|
||||
this._waitMode = '';
|
||||
} else {
|
||||
var playing = false;
|
||||
for(var i = 0; i < AudioManager._seBuffers.length; i++) {
|
||||
if(AudioManager._seBuffers[i].isPlaying()) {
|
||||
playing = true;
|
||||
}
|
||||
}
|
||||
if(playing) return true;
|
||||
}
|
||||
} else if(this._waitMode === 'me') {
|
||||
if(AudioManager._meBuffer) {
|
||||
return true;
|
||||
} else {
|
||||
this._waitMode = '';
|
||||
}
|
||||
}
|
||||
var waiting = _Game_Interpreter_updateWaitMode.apply(this, arguments);
|
||||
for(var i = 0; i < this._waitConditions.length; i++) {
|
||||
if(!eval(this._waitConditions[i])) {
|
||||
waiting = true;
|
||||
if(!this._waitMode) this._waitMode = 'condition';
|
||||
break;
|
||||
} else {
|
||||
this._waitConditions.pop(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
return waiting;
|
||||
};
|
||||
|
||||
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
_Game_Interpreter_pluginCommand.apply(this, arguments);
|
||||
if(command.trim().toLowerCase() === 'wait') {
|
||||
if(args[0].trim().toLowerCase() === 'for') {
|
||||
if(args[1].trim().toLowerCase() === 'condition') {
|
||||
var condition = '';
|
||||
for(var i = 2; i < args.length; i++) {
|
||||
condition += args[i] + ' ';
|
||||
}
|
||||
this._waitConditions.push(condition);
|
||||
} else {
|
||||
this.setWaitMode(args[1].trim().toLowerCase());
|
||||
if(this._waitMode === 'se') {
|
||||
this.wait(_.seWait);
|
||||
}
|
||||
}
|
||||
} else if(args[0].match(/(\d+)/i)) {
|
||||
var value = parseInt(RegExp.$1);
|
||||
if(args[1].trim().toLowerCase() === 'frames') {
|
||||
this.wait(value);
|
||||
} else if(args[1].trim().toLowerCase() === 'seconds') {
|
||||
this.wait(value * 60);
|
||||
} else if(args[1].trim().toLowerCase() === 'minutes') {
|
||||
this.wait(value * 60 * 60);
|
||||
}
|
||||
}
|
||||
} else if(command.trim().toLowerCase() === 'cancel' && args[0].trim().toLowerCase() === 'wait') {
|
||||
this.setWaitMode('');
|
||||
this.wait(0);
|
||||
}
|
||||
};
|
||||
|
||||
})(SRD.WaitOptions);
|
|
@ -1,105 +0,0 @@
|
|||
//=============================================================================
|
||||
// Simple Event Fade
|
||||
// SimpleEventFade.js
|
||||
// Version: 1.1
|
||||
// Author: Kuoushi
|
||||
//=============================================================================
|
||||
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc v1.1 Makes fading events in or out easier.
|
||||
* @author Kuoushi
|
||||
*
|
||||
* @param Default Fade Time
|
||||
* @desc The default number of frames to fade an event in or out. (1 - 255)
|
||||
* @default 30
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* Introduction
|
||||
* ============================================================================
|
||||
*
|
||||
* This plugin is meant to make events fading in or out a much simpler process
|
||||
* than having to set the opacity over and over. Not sure if anyone else has
|
||||
* that issue or not, (or if it's actually fixable in engine), but I made a
|
||||
* plugin to help simplify the process.
|
||||
*
|
||||
* In the move route of the event you want to fade, add a script call where
|
||||
* you want the fade to occur. The script call would be one of the following:
|
||||
*
|
||||
* this.fadeIn(x)
|
||||
* this.fadeOut(x)
|
||||
*
|
||||
* x is the number of frames you want the fade to last. If you just want to use
|
||||
* the default in the plugin parameters then you can just say this.fadeIn() for
|
||||
* even further convenience. The fade will start on whatever your character's
|
||||
* current opacity is set at.
|
||||
*
|
||||
* ============================================================================
|
||||
* Changelog
|
||||
* ============================================================================
|
||||
*
|
||||
* 1.1 Fixed possible bug where we didn't move the moveroute index back
|
||||
* after splicing in the new fade commands. Also added in a new fadeTo
|
||||
* command that'll allow you to fade to a specific opacity instead of
|
||||
* just in or out.
|
||||
* 1.01 Fixed the issue which required the call to be at the end of the
|
||||
* route list. Now it can be called in any location in a movement route.
|
||||
* 1.00 Plugin with basic functionality created.
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
(function() {
|
||||
|
||||
var Parameters = PluginManager.parameters('SimpleEventFade');
|
||||
var DefaultFadeTime = Number(Parameters['Default Fade Time']);
|
||||
|
||||
Game_CharacterBase.prototype.fadeOut = function(numFrames) {
|
||||
this.fadeTo(0,numFrames);
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.fadeIn = function(numFrames) {
|
||||
this.fadeTo(255,numFrames);
|
||||
};
|
||||
|
||||
Game_CharacterBase.prototype.fadeTo = function(fadeOpac, numFrames) {
|
||||
var time = DefaultFadeTime;
|
||||
if(numFrames)
|
||||
time = numFrames;
|
||||
|
||||
var route = {};
|
||||
route.list = [];
|
||||
var waitObj = {};
|
||||
waitObj.code = Game_Character.ROUTE_WAIT;
|
||||
waitObj.parameters = [1];
|
||||
|
||||
var step = (fadeOpac - this._opacity) / time;
|
||||
|
||||
if(step < 0)
|
||||
step = Math.ceil(Math.abs(step)) * -1;
|
||||
else
|
||||
step = Math.ceil(step);
|
||||
|
||||
for(var i = this._opacity; i != fadeOpac; i += step) {
|
||||
var command = new Object();
|
||||
command.code = Game_Character.ROUTE_CHANGE_OPACITY;
|
||||
command.parameters = [i];
|
||||
route.list.push(command);
|
||||
route.list.push(waitObj);
|
||||
if(i != fadeOpac) {
|
||||
if((step > 0 && (i + step) > fadeOpac) || (step < 0 && (i + step) < fadeOpac)) {
|
||||
var last = new Object();
|
||||
last.code = Game_Character.ROUTE_CHANGE_OPACITY;
|
||||
last.parameters = [fadeOpac];
|
||||
route.list.push(last);
|
||||
i = fadeOpac - step;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
route.list = this._moveRoute.list.slice(0,this._moveRouteIndex).concat(route.list).concat(this._moveRoute.list.slice(this._moveRouteIndex+1));
|
||||
this._moveRoute.list = route.list;
|
||||
this._moveRouteIndex--;
|
||||
};
|
||||
})();
|
|
@ -1,243 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Sketchbook
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_SketchBook = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.SketchBook = _TDS_.SketchBook || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Sketchbook scene.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
// Use Strict
|
||||
"use strict";
|
||||
//=============================================================================
|
||||
// ** Scene_Sketchbook
|
||||
//-----------------------------------------------------------------------------
|
||||
// Scene for handling sketchbook processing.
|
||||
//=============================================================================
|
||||
function Scene_Sketchbook() { this.initialize.apply(this, arguments); };
|
||||
Scene_Sketchbook.prototype = Object.create(Scene_MenuBase.prototype);
|
||||
Scene_Sketchbook.prototype.constructor = Scene_Sketchbook;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.initialize = function() {
|
||||
// Album Settings
|
||||
this._page = 0;
|
||||
this._maxPages = $gameVariables.value(42);
|
||||
this._sketchBookName = $gameVariables.value(43);
|
||||
// Get Size
|
||||
var size = $gameVariables.value(41);
|
||||
this._width = size[0];
|
||||
this._height = size[1];
|
||||
// Super Call
|
||||
Scene_MenuBase.prototype.initialize.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Atlas Lists
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.initAtlastLists = function() {
|
||||
// Run Original Function
|
||||
Scene_MenuBase.prototype.initAtlastLists.call(this);
|
||||
// Get Bitmap Name
|
||||
var bitmapName = this._sketchBookName + this._page;
|
||||
// Get Atlas Path
|
||||
var atlasPath = 'img/pictures/' + bitmapName + '.png';
|
||||
// Get Atlas Name
|
||||
var atlasName = AtlasManager.getImageAtlasName(atlasPath);
|
||||
// If Atlas name exists
|
||||
if (atlasName) { this.addRequiredAtlas(atlasName); }
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.create = function() {
|
||||
// Super Call
|
||||
Scene_MenuBase.prototype.create.call(this);
|
||||
// Create Objects
|
||||
this.createSketchWindow();
|
||||
this.createSketchBookSprite();
|
||||
this.createCursorSprites();
|
||||
this.onPageChange();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Sketch Window
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.createSketchWindow = function() {
|
||||
// Create Back Window
|
||||
this._backWindow = new Window_Base(0, 0, this._width, this._height);
|
||||
this._backWindow.x = (Graphics.width - this._backWindow.width) / 2;
|
||||
this._backWindow.y = (Graphics.height - this._backWindow.height) / 2;
|
||||
this.addChild(this._backWindow);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create SketchBook Sprite
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.createSketchBookSprite = function() {
|
||||
this._sketchBookSprite = new Sprite();
|
||||
this._sketchBookSprite.x = this._backWindow.x + 10;
|
||||
this._sketchBookSprite.y = this._backWindow.y + 10;
|
||||
this.addChild(this._sketchBookSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Cursor Sprites
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.createCursorSprites = function() {
|
||||
// Get Cursor Bitmap
|
||||
var bitmap = ImageManager.loadSystem("ACSArrows");
|
||||
|
||||
this._leftCursorSprite = new Sprite(bitmap);
|
||||
this._leftCursorSprite.anchor.set(0.5, 0.5);
|
||||
this._leftCursorSprite.setFrame(64, 0, 32, 29);
|
||||
this._leftCursorSprite.x = this._backWindow.x - 10;
|
||||
this._leftCursorSprite.y = this._backWindow.y + (this._backWindow.height / 2)
|
||||
this.addChild(this._leftCursorSprite);
|
||||
|
||||
this._rightCursorSprite = new Sprite(bitmap);
|
||||
this._rightCursorSprite.anchor.set(0.5, 0.5);
|
||||
this._rightCursorSprite.setFrame(32, 0, 32, 29);
|
||||
this._rightCursorSprite.x = this._backWindow.x + this._backWindow.width + 10;
|
||||
this._rightCursorSprite.y = this._backWindow.y + (this._backWindow.height / 2)
|
||||
this.addChild(this._rightCursorSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.update = function() {
|
||||
// Super call
|
||||
Scene_MenuBase.prototype.update.call(this);
|
||||
// Update Cursor Animation
|
||||
this._leftCursorSprite.anchor.x = 0.5 - (Math.sin(Graphics.frameCount * 0.2) * 0.1);
|
||||
this._rightCursorSprite.anchor.x = 0.5 + (Math.sin(Graphics.frameCount * 0.2) * 0.1);
|
||||
|
||||
if (Input.isRepeated('left')) {
|
||||
if (this._page > 0) {
|
||||
// Play Cursor sound
|
||||
SoundManager.playCursor();
|
||||
// Reduce Page
|
||||
this._page--;
|
||||
// On Page Change
|
||||
this.onPageChange();
|
||||
};
|
||||
return
|
||||
}
|
||||
|
||||
if (Input.isRepeated('right')) {
|
||||
if (this._page < this._maxPages) {
|
||||
// Play Cursor sound
|
||||
SoundManager.playCursor();
|
||||
// Increase Page
|
||||
this._page++;
|
||||
// On Page Change
|
||||
this.onPageChange();
|
||||
};
|
||||
return
|
||||
}
|
||||
|
||||
if (Input.isTriggered('menu')) {
|
||||
this.popScene();
|
||||
return
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * On Page Change
|
||||
//=============================================================================
|
||||
Scene_Sketchbook.prototype.onPageChange = function() {
|
||||
// Update Cursor Visibility
|
||||
this._leftCursorSprite.visible = this._page > 0;
|
||||
this._rightCursorSprite.visible = this._page < this._maxPages;
|
||||
// Set Sketcbook Sprite Bitmap
|
||||
this._sketchBookSprite.bitmap = ImageManager.loadPicture(this._sketchBookName + this._page)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// //=============================================================================
|
||||
// /*:
|
||||
// * @plugindesc
|
||||
// * Sketchbook menu
|
||||
// *
|
||||
// * @author rhyme
|
||||
// */
|
||||
|
||||
// //-----------------------------------------------------------------------------
|
||||
// // Scene_Sketchbook
|
||||
// //-----------------------------------------------------------------------------
|
||||
// function Scene_Sketchbook() {
|
||||
// this.initialize.apply(this, arguments);
|
||||
// }
|
||||
|
||||
// Scene_Sketchbook.prototype = Object.create(Scene_MenuBase.prototype);
|
||||
// Scene_Sketchbook.prototype.constructor = Scene_Sketchbook;
|
||||
|
||||
// // Initialize
|
||||
// //-----------------------------------------------------------------------------
|
||||
// Scene_Sketchbook.prototype.initialize = function() {
|
||||
// Scene_MenuBase.prototype.initialize.call(this);
|
||||
// };
|
||||
|
||||
// Scene_Sketchbook.prototype.create = function() {
|
||||
// Scene_MenuBase.prototype.create.call(this);
|
||||
// this.createSketchWindow();
|
||||
// this.createSprites();
|
||||
// };
|
||||
|
||||
// Scene_Sketchbook.prototype.createSketchWindow = function() {
|
||||
// this._sketchWindow = new Window_Sketchbook();
|
||||
// this.addWindow(this._sketchWindow);
|
||||
// };
|
||||
|
||||
// Scene_Sketchbook.prototype.createSprites = function() {
|
||||
// var cursorImage = ImageManager.loadSystem("ACSArrows", 0);
|
||||
// this._spriteForeground = new Sprite();
|
||||
// this._spriteForeground.setFrame(0, 0, Graphics.width, Graphics.height);
|
||||
// this._spriteCursorLeft = new Sprite(cursorImage);
|
||||
// this._spriteCursorLeft.setFrame(32, 0, 32, 29);
|
||||
// this._spriteCursorLeft.x = Math.min(this._sketchWindow.x + this._sketchWindow.width - 16, Graphics.width - 36);
|
||||
// this._spriteCursorLeft.y = (Graphics.height / 2) - 15;
|
||||
// this._spriteCursorRight = new Sprite(cursorImage);
|
||||
// this._spriteCursorRight.setFrame(64, 0, 32, 29);
|
||||
// this._spriteCursorRight.x = Math.max(this._sketchWindow.x - 16, 36);
|
||||
// this._spriteCursorRight.y = (Graphics.height / 2) - 15;
|
||||
// this.addChild(this._spriteForeground);
|
||||
// this._spriteForeground.addChild(this._spriteCursorLeft);
|
||||
// this._spriteForeground.addChild(this._spriteCursorRight);
|
||||
// this._customCursorAngle = 0;
|
||||
// };
|
||||
|
||||
// // Update
|
||||
// //-----------------------------------------------------------------------------
|
||||
// Scene_Sketchbook.prototype.update = function() {
|
||||
// Scene_MenuBase.prototype.update.call(this);
|
||||
// this._customCursorAngle = ((this._customCursorAngle + 0.15) % 50);
|
||||
// this._spriteCursorLeft.anchor.x = 0.5 - 0.1 * Math.sin(this._customCursorAngle);
|
||||
// this._spriteCursorRight.anchor.x = 0.5 + 0.1 * Math.sin(this._customCursorAngle);
|
||||
// if (this._sketchWindow.page() == 0) {
|
||||
// this._spriteCursorRight.visible = false;
|
||||
// } else {
|
||||
// this._spriteCursorRight.visible = true;
|
||||
// }
|
||||
// if (this._sketchWindow.page() == $gameVariables.value(10)) {
|
||||
// this._spriteCursorLeft.visible = false;
|
||||
// } else {
|
||||
// this._spriteCursorLeft.visible = true;
|
||||
// }
|
||||
// if (Input.isTriggered('left')) {
|
||||
// this._sketchWindow.prevPage();
|
||||
// }
|
||||
// if (Input.isTriggered('right')) {
|
||||
// this._sketchWindow.nextPage();
|
||||
// }
|
||||
// if (Input.isTriggered('menu')) {
|
||||
// this.popScene();
|
||||
// }
|
|
@ -1,37 +0,0 @@
|
|||
// //=============================================================================
|
||||
// // * Increase Game FPS
|
||||
// //=============================================================================
|
||||
// var _faster_ = Scene_Map_updateMainMultiply = Scene_Map.prototype.updateMainMultiply;
|
||||
// Scene_Map.prototype.updateMainMultiply = function() {
|
||||
// _faster_.call(this);
|
||||
// this.updateMain();
|
||||
// };
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Key Item Culling (Force to 1)
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.keyItemCull = function() {
|
||||
// List of Items to cull
|
||||
var list = [850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875];
|
||||
// Set Quantity of Items in list to 1
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
// Get Item Id
|
||||
var id = list[i];
|
||||
// If Item Exists
|
||||
if ($gameParty._items[id]) { $gameParty._items[id] = 1; };
|
||||
};
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Hide Event Markers
|
||||
//=============================================================================
|
||||
var Archeia = Archeia || {};
|
||||
Archeia.Game_CharacterBase_isTransparent = Game_CharacterBase.prototype.isTransparent;
|
||||
Game_CharacterBase.prototype.isTransparent = function() {
|
||||
if (this.characterName() === 'DEV_TEST') return true;
|
||||
return Archeia.Game_CharacterBase_isTransparent.call(this);;
|
||||
};
|
|
@ -1,897 +0,0 @@
|
|||
var Imported = Imported || {};
|
||||
Imported.TDDP_AnimationCurves = "1.0.3";
|
||||
|
||||
/*:
|
||||
@author Tor Damian Design / Galenmereth
|
||||
@plugindesc 1.0.3b Apply animation curves (easing functions) to Move Picture commands using simple Plugin Commands
|
||||
@help
|
||||
How it works
|
||||
------------------------------------------------------------------------------
|
||||
This plugin allows you to set animation curves (so-called easing functions)
|
||||
to be used with Move Picture and Tint Picture events.
|
||||
|
||||
Demo mode
|
||||
------------------------------------------------------------------------------
|
||||
When playtesting your game, you can hit the demo key (default F11) to show
|
||||
a visual representation of all the supported animation curves and their names.
|
||||
|
||||
If you hover over these with your mouse an animation plays, showing how the
|
||||
curve affects a red ball's Y axis movement
|
||||
|
||||
General use
|
||||
------------------------------------------------------------------------------
|
||||
The Plugin Commands must be placed *before* the Move Picture or Tint Picture
|
||||
events that they are to affect. They do not have to be placed within the same
|
||||
event window, however, so you can put them in Common Events if you wish.
|
||||
|
||||
Once a Move Picture or Tint Picture event is fired off, the curves you
|
||||
specified using the Plugin Commands are reset to use MV's default until you
|
||||
add new Plugin Command entries.
|
||||
|
||||
Use the following Plugin Command syntax:
|
||||
AnimationCurve <CurveFunction> <Property(optional)>
|
||||
|
||||
Example:
|
||||
AnimationCurve QuadOut x
|
||||
|
||||
See the bottom of this help text for all available animation curves.
|
||||
|
||||
# Set curve for all properties
|
||||
If you omit the property at the end in the Plugin Command (the x in the above
|
||||
example), then the plugin will use the animation curve for all properties: x,
|
||||
y, scaleX, scaleY, and opacity.
|
||||
|
||||
# Linear is the default fallback
|
||||
When you do include a property, but have not added any Plugin Command entry
|
||||
without a property, then all other properties are animated using linear
|
||||
interpolation, which is MV's default.
|
||||
|
||||
# Different curves for different properties
|
||||
This can be done by adding multiple Plugin Commands with an animation curve
|
||||
for individual properties.
|
||||
|
||||
For example:
|
||||
AnimationCurve ElasticInOut x
|
||||
AnimationCurve QuadOut y
|
||||
AnimationCurve CubicInOut opacity
|
||||
|
||||
If the above three PluginCommands are placed before a Move Picture event, then
|
||||
the x, y and opacity properties are animated with their respective curves,
|
||||
whilst the remainder (scaleX, scaleY) are animated with the default linear
|
||||
interpolation.
|
||||
|
||||
Move Picture specific properties
|
||||
------------------------------------------------------------------------------
|
||||
The following properties are available for Move Picture events:
|
||||
|
||||
x, y, scaleX, scaleY, and opacity
|
||||
|
||||
scaleX corresponds to the "Width" property in the Move Picture event window,
|
||||
and scaleY corresponds to the "Height" property.
|
||||
|
||||
Tint Picture specific properties
|
||||
------------------------------------------------------------------------------
|
||||
The following properties are available for Tint Picture events:
|
||||
|
||||
red, green, blue, gray
|
||||
|
||||
These correspond with the color sliders in the Tint Picture event window.
|
||||
|
||||
Supported animation curve functions
|
||||
------------------------------------------------------------------------------
|
||||
QuadIn QuadOut QuadInOut
|
||||
CubicIn CubicOut CubicInOut
|
||||
QuartIn QuartOut QuartInOut
|
||||
QuintIn QuintOut QuintInOut
|
||||
SineIn SineOut SineInOut
|
||||
ExpoIn ExpoOut ExpoInOut
|
||||
CircIn CircOut CircInOut
|
||||
ElasticIn ElasticOut ElasticInOut
|
||||
BackIn BackOut BackInOut
|
||||
BounceIn BounceOut BounceInOut
|
||||
|
||||
Linear (MV default)
|
||||
|
||||
Key codes
|
||||
------------------------------------------------------------------------------
|
||||
Visit this URL for a complete overview:
|
||||
https://keycode.info/
|
||||
|
||||
Some common key codes:
|
||||
F10: 121
|
||||
F11: 122 (default)
|
||||
F12: 123
|
||||
|
||||
License
|
||||
------------------------------------------------------------------------------
|
||||
In short: Completely free, including for commercial use. Please consider
|
||||
donating for further development of plugins and other material if you find
|
||||
this plugin useful. See https://mvplugins.tordamian.com
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Tor Damian Design
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@param Demo hotkey
|
||||
@desc Key code for the hotkey used to display ingame curve demo overlay. See help for codes. Default 122 = F11 key
|
||||
@type number
|
||||
@default 122
|
||||
|
||||
@param Plugin Command key
|
||||
@desc The plugin's "key" to use in Plugin Commands. You can customize this if you want to type less, or have a conflict
|
||||
@type string
|
||||
@default AnimationCurve
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback EasingFunction
|
||||
* @param {number} t The current time
|
||||
* @param {number} b The beginning value
|
||||
* @param {number} c The change in value (target value - beginning value)
|
||||
* @param {number} d Duration
|
||||
*/
|
||||
|
||||
/**
|
||||
* Wrapper object for all globally available properties of this plugin
|
||||
* @namespace
|
||||
*/
|
||||
var TDDP_AnimationCurves = {
|
||||
/**
|
||||
* @property {Object} easingFunctions The available easing functions. Can be extended
|
||||
*/
|
||||
easingFunctions: {
|
||||
// Easing unctions below from open source reference by McGinley Smith
|
||||
// https://github.com/danro/jquery-easing/blob/master/jquery.easing.js
|
||||
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuadIn: function(t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuadOut: function(t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuadInOut: function(t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CubicIn: function(t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CubicOut: function(t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CubicInOut: function(t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuartIn: function(t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuartOut: function(t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuartInOut: function(t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuintIn: function(t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuintOut: function(t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
QuintInOut: function(t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
SineIn: function(t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
SineOut: function(t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
SineInOut: function(t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ExpoIn: function(t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ExpoOut: function(t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ExpoInOut: function(t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CircIn: function(t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CircOut: function(t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
CircInOut: function(t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ElasticIn: function(t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ElasticOut: function(t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
ElasticInOut: function(t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BackIn: function(t, b, c, d) {
|
||||
var s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BackOut: function(t, b, c, d) {
|
||||
var s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BackInOut: function(t, b, c, d) {
|
||||
var s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BounceIn: function(t, b, c, d) {
|
||||
return c - TDDP_AnimationCurves.easingFunctions.BounceOut(d-t, 0, c, d) + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BounceOut: function(t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
BounceInOut: function(t, b, c, d) {
|
||||
if (t < d/2) return TDDP_AnimationCurves.easingFunctions.BounceIn(t*2, 0, c, d) * .5 + b;
|
||||
return TDDP_AnimationCurves.easingFunctions.BounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
},
|
||||
/**
|
||||
* @type {EasingFunction}
|
||||
*/
|
||||
Linear: function(t, b, c, d) {
|
||||
return c * (t/d) + b;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @type {Object} The easingFunctions to use for the next call to Move Picture, if any
|
||||
*/
|
||||
nextEasingFunctions: undefined,
|
||||
|
||||
/**
|
||||
* @property {Function} origin Store of the original overwritten methods
|
||||
* @returns {object}
|
||||
*/
|
||||
origin: undefined,
|
||||
|
||||
/**
|
||||
* @function setEasingFunction
|
||||
* @param {EasingFunction} easingFunction The animation easingFunction function to use. @see TDDP_AnimationCurves.easingFunctions
|
||||
* @param {string} [property='general'] The property to tie the animation curve to
|
||||
*/
|
||||
setEasingFunction: function(easingFunction, property) {},
|
||||
|
||||
/**
|
||||
* Toggle showing demo and testing overlay ingame
|
||||
* @function demo
|
||||
*/
|
||||
demo: function() {}
|
||||
};
|
||||
|
||||
(function($) {
|
||||
//=============================================================================
|
||||
// Setting up plugin parameters
|
||||
//=============================================================================
|
||||
var parameters = $plugins.filter(function(p){return p.name == "TDDP_AnimationCurves"})[0].parameters;
|
||||
var demoHotkey = Number(parameters['Demo hotkey']);
|
||||
var pluginCommand = String(parameters['Plugin Command key']);
|
||||
|
||||
//=============================================================================
|
||||
// Publicly accessible methods and variables (within namespace)
|
||||
//=============================================================================
|
||||
/**
|
||||
* The easing function to use for the next Move Picture or MoveTint event
|
||||
* @const {{Object.<string, EasingFunction>}}
|
||||
* @example
|
||||
* nextEasingFunctions['x'] => EasingFunction
|
||||
*/
|
||||
var nextEasingFunctions = undefined;
|
||||
$.nextEasingFunctions = function() { return nextEasingFunctions }
|
||||
|
||||
/**
|
||||
* Store of original overwritten methods
|
||||
* @const {Object}
|
||||
*/
|
||||
var origin = {};
|
||||
$.origin = function() { return origin };
|
||||
|
||||
/**
|
||||
* @function setEasingFunction
|
||||
* @param {EasingFunction|string} easingFunction The animation easingFunction to use. @see TDDP_AnimationCurves.easingFunctions
|
||||
* @param {string} [property='general'] The property to tie the animation curve to
|
||||
*/
|
||||
function setEasingFunction(easingFunction, property) {
|
||||
if (typeof easingFunction == 'string') {
|
||||
_validateEasingFunction(easingFunction);
|
||||
|
||||
easingFunction = $.easingFunctions[easingFunction];
|
||||
}
|
||||
|
||||
var property = property || 'general';
|
||||
|
||||
_validateEasingProperty(property);
|
||||
|
||||
_pushEasingFunction(property, easingFunction);
|
||||
};
|
||||
$.setEasingFunction = setEasingFunction;
|
||||
|
||||
/**
|
||||
* @const {PIXI.Application}
|
||||
*/
|
||||
var demoSurface = undefined;
|
||||
|
||||
/**
|
||||
* Toggle the ingame demo overlay
|
||||
*/
|
||||
function demo() {
|
||||
if (demoSurface) {
|
||||
document.body.removeChild(demoSurface.view);
|
||||
demoSurface = undefined;
|
||||
return;
|
||||
}
|
||||
_drawDemo();
|
||||
}
|
||||
$.demo = demo;
|
||||
|
||||
//=============================================================================
|
||||
// Private internal functions
|
||||
//=============================================================================
|
||||
/**
|
||||
* Validate an easing function. Throws an error if it doesn't match any
|
||||
* key found. @see TDDP_AnimationCurves.easingFunctions
|
||||
* @param {EasingFunction} easingFunction
|
||||
*/
|
||||
function _validateEasingFunction(easingFunction) {
|
||||
var valid = Object.keys($.easingFunctions).find(function(value){
|
||||
return value == easingFunction;
|
||||
}) !== undefined;
|
||||
|
||||
if (!valid) throw new Error('TDDP_AnimationCurves | Invalid animation curve argument: "' + easingFunction + '". See plugin help for valid options.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Whitelist of supported properties, to catch splelling ellols
|
||||
* @type {string[]}
|
||||
*/
|
||||
var _propertyWhitelist = [
|
||||
'general',
|
||||
'x',
|
||||
'y',
|
||||
'scaleX',
|
||||
'scaleY',
|
||||
'opacity',
|
||||
'red',
|
||||
'blue',
|
||||
'green',
|
||||
'gray'
|
||||
]
|
||||
/**
|
||||
* Validate an easing property using the _propertyWhitelist
|
||||
* @param {string} easingProperty Property to validate
|
||||
*/
|
||||
function _validateEasingProperty(easingProperty) {
|
||||
var valid = _propertyWhitelist.indexOf(easingProperty) >= 0
|
||||
|
||||
if (!valid) throw new Error('TDDP_AnimationCurves | Invalid target property: "' + easingProperty + '". See plugin help for valid options.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle Plugin Command.
|
||||
* Expects the following structure:
|
||||
* args[0] = QuadOut - @see TDDP_AnimationCurves.easingFunctions
|
||||
* args[1] = x, y, scaleX, scaleY, opacity - Default is 'general', meaning all
|
||||
* @param {string[]} args
|
||||
*/
|
||||
function _handleCommand(args) {
|
||||
var easingFunction = args[0];
|
||||
|
||||
if (easingFunction) {
|
||||
setEasingFunction(easingFunction, args[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {string} property
|
||||
* @param {EasingFunction} easingFunction
|
||||
*/
|
||||
function _pushEasingFunction(property, easingFunction) {
|
||||
nextEasingFunctions = nextEasingFunctions || {};
|
||||
nextEasingFunctions[property] = easingFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* @callback EasingFunctionFactory
|
||||
* @param {string} property The property to apply curve to
|
||||
* @param {number} t Current time variable to pass on to EasingFunction
|
||||
* @param {number} b Beginning value to pass on to EasingFunction
|
||||
* @param {number} c The change in value to pass on to EasingFunction
|
||||
* @param {number} d Duration to pass on to EasingFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Object.<string, EasingFunction>} easingFuncs The map of EasingFunctions
|
||||
* @param {string} property
|
||||
* @param {number} t Current time variable to pass on to EasingFunction
|
||||
* @param {number} b Beginning value to pass on to EasingFunction
|
||||
* @param {number} c The change in value to pass on to EasingFunction
|
||||
* @param {number} d Duration to pass on to EasingFunction
|
||||
*/
|
||||
function _easingFunctionsFactory(easingFuncs, property, t, b, c, d) {
|
||||
var easingFunction = undefined;
|
||||
|
||||
if (easingFuncs[property]) {
|
||||
easingFunction = easingFuncs[property];
|
||||
}
|
||||
else if (easingFuncs['general']) {
|
||||
easingFunction = easingFuncs['general'];
|
||||
}
|
||||
else {
|
||||
// Fall back to default 'Linear' EasingFunction if there's no general function defined. Linear is equal to MV's default.
|
||||
easingFunction = $.easingFunctions['Linear'];
|
||||
}
|
||||
|
||||
return easingFunction(t, b, c, d);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluck the list of EasingFunctions, removing the list and wrapping them. @see _easingFunctionsFactory
|
||||
* Resets nextEasingFunctions to undefined
|
||||
* @return {(EasingFunctionFactory|undefined)}
|
||||
*/
|
||||
function _pluckEasingFunctions() {
|
||||
if (nextEasingFunctions) {
|
||||
var easingFunctions = _easingFunctionsFactory.bind(this, nextEasingFunctions);
|
||||
|
||||
nextEasingFunctions = undefined;
|
||||
|
||||
return easingFunctions;
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @callback ExecutableAnimFunction
|
||||
* @param {number} time Current time
|
||||
* @param {number} totalDuration
|
||||
*/
|
||||
|
||||
/**
|
||||
* Update movement of a Game_Picture instance using wrapped animation curve functions
|
||||
* **this** is a *Game_Picture* instance
|
||||
* @param {number} totalDuration
|
||||
* @param {ExecutableAnimFunction[]} executableMoveFunctions
|
||||
*/
|
||||
var _updateMoveCurves = function(totalDuration, executableMoveFunctions) {
|
||||
if (this._duration < 0) return;
|
||||
|
||||
var time = totalDuration - this._duration;
|
||||
|
||||
executableMoveFunctions.forEach(function(func) {
|
||||
func(time, totalDuration);
|
||||
})
|
||||
|
||||
this._duration--;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the tone of a Game_Picture instance using animation curve functions
|
||||
* **this** is a *Game_Picture* instance
|
||||
* @param {number} totalDuration
|
||||
* @param {ExecutableAnimFunction[]} executableTintFunctions
|
||||
*/
|
||||
var _updateToneCurves = function(totalDuration, executableTintFunctions) {
|
||||
if (this._toneDuration < 0) return;
|
||||
|
||||
var time = totalDuration - this._toneDuration;
|
||||
|
||||
executableTintFunctions.forEach(function(func) {
|
||||
func(time, totalDuration);
|
||||
})
|
||||
|
||||
this._toneDuration--;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Game_Interpreter - register plugin command
|
||||
//=============================================================================
|
||||
origin.Game_Interpreter = {};
|
||||
origin.Game_Interpreter.pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
|
||||
/**
|
||||
* @param {string} command
|
||||
* @param {string[]} args
|
||||
*/
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
origin.Game_Interpreter.pluginCommand.call(this, command, args);
|
||||
|
||||
if (command === pluginCommand) _handleCommand(args);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Game_Picture - extend methods
|
||||
//=============================================================================
|
||||
origin.Game_Picture = {};
|
||||
|
||||
/**
|
||||
* List of overwritten or extended methods
|
||||
*/
|
||||
origin.Game_Picture.move = Game_Picture.prototype.move;
|
||||
origin.Game_Picture.tint = Game_Picture.prototype.tint;
|
||||
|
||||
/**
|
||||
* @param {number} originMode The picture ID origin - 0 = upper left, 1 = center
|
||||
* @param {number} targetX
|
||||
* @param {number} targetY
|
||||
* @param {number} targetScaleX
|
||||
* @param {number} targetScaleY
|
||||
* @param {number} targetOpacity
|
||||
* @param {number} blendMode
|
||||
* @param {number} duration In frames
|
||||
*/
|
||||
Game_Picture.prototype.move = function(originMode, targetX, targetY, targetScaleX, targetScaleY, targetOpacity, blendMode, duration) {
|
||||
origin.Game_Picture.move.call(this, originMode, targetX, targetY, targetScaleX, targetScaleY, targetOpacity, blendMode, duration);
|
||||
|
||||
var easingFunctions = _pluckEasingFunctions();
|
||||
|
||||
/** @type {ExecutableAnimFunction[]} */
|
||||
var executableMoveFunctions = [];
|
||||
|
||||
// Preconfiguring these anonymous functions means we avoid doing unnecessary if/else checks during each update steps.
|
||||
// This improves performance at the cost of an arguably negligible memory footprint.
|
||||
|
||||
if (targetX != this._x) executableMoveFunctions.push(function(x, time, totalDuration) {
|
||||
this._x = easingFunctions('x', time, x, targetX - x, totalDuration);
|
||||
}.bind(this, this._x))
|
||||
|
||||
if (targetY != this._y) executableMoveFunctions.push(function(y, time, totalDuration) {
|
||||
this._y = easingFunctions('y', time, y, targetY - y, totalDuration);
|
||||
}.bind(this, this._y))
|
||||
|
||||
if (targetScaleX != this._scaleX) executableMoveFunctions.push(function(scaleX, time, totalDuration) {
|
||||
this._scaleX = easingFunctions('scaleX', time, scaleX, targetScaleX - scaleX, totalDuration);
|
||||
}.bind(this, this._scaleX))
|
||||
|
||||
if (targetScaleY != this._scaleY) executableMoveFunctions.push(function(scaleY, time, totalDuration) {
|
||||
this._scaleY = easingFunctions('scaleX', time, scaleY, targetScaleY - scaleY, totalDuration);
|
||||
}.bind(this, this._scaleY))
|
||||
|
||||
if (targetOpacity != this._opacity) executableMoveFunctions.push(function(opacity, time, totalDuration) {
|
||||
this._opacity = easingFunctions('opacity', time, opacity, targetOpacity - opacity, totalDuration);
|
||||
}.bind(this, this._opacity))
|
||||
|
||||
if (easingFunctions) {
|
||||
this.updateMove = _updateMoveCurves.bind(this, duration, executableMoveFunctions);
|
||||
}
|
||||
else {
|
||||
this.updateMove = Game_Picture.prototype.updateMove.bind(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @const {string[]}
|
||||
*/
|
||||
var toneKeys = ['red', 'green', 'blue', 'gray']
|
||||
|
||||
/**
|
||||
* @param {number[]} tone
|
||||
* @param {number} duration
|
||||
*/
|
||||
Game_Picture.prototype.tint = function(tone, duration) {
|
||||
origin.Game_Picture.tint.call(this, tone, duration);
|
||||
|
||||
var easingFunctions = _pluckEasingFunctions();
|
||||
|
||||
/** @type {ExecutableAnimFunction[]} */
|
||||
var executableTintFunctions = [];
|
||||
|
||||
// As with Game_Picture.prototype.move, we preconfigure executable functions here for greater performance
|
||||
tone.forEach(function(toneTarget, index) {
|
||||
var toneKey = toneKeys[index];
|
||||
var toneOrigin = this._tone[index];
|
||||
|
||||
if (toneTarget != this._tone[index]) {
|
||||
executableTintFunctions.push(function(time, totalDuration) {
|
||||
this._tone[index] = easingFunctions(toneKey, time, toneOrigin, toneTarget - toneOrigin, totalDuration);
|
||||
}.bind(this))
|
||||
}
|
||||
}.bind(this))
|
||||
|
||||
if (easingFunctions) {
|
||||
this.updateTone = _updateToneCurves.bind(this, duration, executableTintFunctions);
|
||||
}
|
||||
else {
|
||||
this.updateTone = Game_Picture.prototype.updateTone.bind(this);
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Demo drawing method and key listener
|
||||
//=============================================================================
|
||||
/**
|
||||
* Draws an ingame demo overlay to preview the animation curves
|
||||
* This is a big function but it's only relevant during development. I'll
|
||||
* likely compress it in the future.
|
||||
*/
|
||||
function _drawDemo() {
|
||||
var screenWidth = window.innerWidth;
|
||||
var screenHeight = window.innerHeight;
|
||||
var surface = new PIXI.Application({
|
||||
width: screenWidth,
|
||||
height: screenHeight,
|
||||
autoResize: true,
|
||||
resolution: devicePixelRatio,
|
||||
transparent: true
|
||||
});
|
||||
|
||||
demoSurface = surface;
|
||||
|
||||
surface.view.style.overflow = 'hidden';
|
||||
surface.view.style.position = 'absolute';
|
||||
surface.view.style.top = 0;
|
||||
surface.view.style.left = 0;
|
||||
surface.view.style['z-index'] = 999;
|
||||
|
||||
document.body.appendChild(surface.view);
|
||||
|
||||
var container = new PIXI.Container();
|
||||
|
||||
surface.stage.addChild(container);
|
||||
|
||||
var bg = new PIXI.Graphics()
|
||||
.beginFill(0x333333, 0.8)
|
||||
.drawRect(0, 0, screenWidth, screenHeight)
|
||||
.endFill();
|
||||
|
||||
container.addChild(bg);
|
||||
|
||||
var easingFunctions = Object.keys($.easingFunctions);
|
||||
easingFunctions.pop() // Remove Linear
|
||||
|
||||
var total = easingFunctions.length;
|
||||
var perRow = 5;
|
||||
var rows = Math.ceil(total / perRow);
|
||||
var margin = 10;
|
||||
var width = (screenWidth - (margin * perRow)) / perRow;
|
||||
var height = (screenHeight - (margin * rows)) / rows;
|
||||
|
||||
easingFunctions.forEach(function(name, index) {
|
||||
var easingFunction = $.easingFunctions[name];
|
||||
var col = index % perRow;
|
||||
var row = Math.floor(index / perRow);
|
||||
var x = col * (width + margin);
|
||||
var y = row * (height + margin);
|
||||
|
||||
var sprite = new PIXI.Sprite()
|
||||
.setTransform(x, y);
|
||||
sprite.interactive = true;
|
||||
sprite.buttonMode = true;
|
||||
|
||||
var graph = new PIXI.Graphics()
|
||||
.beginFill(0xcdcdcd)
|
||||
.drawRect(0, 0, width, height)
|
||||
.endFill();
|
||||
|
||||
var innerPadding = 15;
|
||||
|
||||
graph
|
||||
.lineStyle(3, 0x999999)
|
||||
.moveTo(innerPadding, height - innerPadding);
|
||||
|
||||
var graphResolution = width + height / 100;
|
||||
for (var i = 0; i < graphResolution; i++) {
|
||||
var cx = $.easingFunctions.Linear(i, innerPadding, width - (innerPadding * 2), graphResolution);
|
||||
var cy = easingFunction(i, height - innerPadding, -(height - (innerPadding * 2)), graphResolution);
|
||||
graph.lineTo(cx, cy);
|
||||
}
|
||||
|
||||
sprite.addChild(graph);
|
||||
|
||||
var text = new PIXI.Text(name, {
|
||||
fontFamily: 'Helvetica',
|
||||
fontSize: 24,
|
||||
fill: 0xffffff,
|
||||
align: 'center',
|
||||
dropShadow: true,
|
||||
dropShadowBlur: 6,
|
||||
dropShadowDistance: 2,
|
||||
dropShadowAlpha: 0.5
|
||||
})
|
||||
text.setTransform((width - text.width) / 2, (height - text.height) / 2);
|
||||
text.alpha = 0.85;
|
||||
|
||||
sprite.addChild(text);
|
||||
|
||||
var ball1 = new PIXI.Graphics()
|
||||
.beginFill(0x08080ff, 0.8)
|
||||
.drawCircle(0, 0, 5)
|
||||
.endFill()
|
||||
.setTransform(innerPadding, height - innerPadding);
|
||||
|
||||
sprite.addChild(ball1);
|
||||
|
||||
var ball2 = new PIXI.Graphics()
|
||||
.beginFill(0xee3333, 0.8)
|
||||
.drawCircle(0, 0, 5)
|
||||
.endFill()
|
||||
.setTransform(innerPadding, height - innerPadding);
|
||||
|
||||
sprite.addChild(ball2);
|
||||
|
||||
sprite.on('pointerover', function() {
|
||||
var time = 0;
|
||||
var duration = 90;
|
||||
var animator = function() {
|
||||
if (time >= duration) surface.ticker.remove(animator);
|
||||
var bx = $.easingFunctions.Linear(time, innerPadding, width - (innerPadding * 2), duration);
|
||||
var by = easingFunction(time, height - innerPadding, -(height - (innerPadding * 2)), duration);
|
||||
|
||||
ball1.setTransform(bx, by);
|
||||
|
||||
bx = easingFunction(time, innerPadding, width - (innerPadding * 2), duration);
|
||||
by = height - innerPadding;
|
||||
|
||||
ball2.setTransform(bx, by);
|
||||
|
||||
time++;
|
||||
}
|
||||
surface.ticker.add(animator);
|
||||
})
|
||||
|
||||
container.addChild(sprite);
|
||||
})
|
||||
}
|
||||
/**
|
||||
* Enable demo hotkey if game is in test mode
|
||||
*/
|
||||
if (Utils.isOptionValid('test')) {
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode == demoHotkey) { demo() }
|
||||
})
|
||||
}
|
||||
|
||||
})(TDDP_AnimationCurves);
|
|
@ -1,327 +0,0 @@
|
|||
var Imported = Imported || {};
|
||||
Imported.TDDP_MovePictureEx = "1.0.1";
|
||||
|
||||
/*:
|
||||
@author Tor Damian Design / Galenmereth
|
||||
@plugindesc 1.0.1 Plugin Command to use variables and relative values with Move Picture
|
||||
@help
|
||||
How it works
|
||||
------------------------------------------------------------------------------
|
||||
This plugin allows you to use variables for the values of Move Picture events,
|
||||
as well as enabling you to omit properties (like x, opacity, and width) that
|
||||
you do not want to change. It also allows you to use relative modifiers "+"
|
||||
and "-" in your values, so you can for example make a picture move 100 pixels
|
||||
from where it currently is, without having to keep track.
|
||||
|
||||
Integration with TDDP_AnimationCurves.
|
||||
|
||||
General usage
|
||||
------------------------------------------------------------------------------
|
||||
The Move Picture plugin command looks like this:
|
||||
|
||||
MovePicture <id> <property:value>
|
||||
|
||||
The id of the picture must come first. After that, the properties themselves
|
||||
can be entered in any order you wish. Here's an example:
|
||||
|
||||
MovePicture 1 x:100 opacity:125 blendMode:Multiply duration:10
|
||||
|
||||
Any omitted properties default to their current values.
|
||||
Values can also be relative, for example:
|
||||
|
||||
MovePicture 1 x:+150
|
||||
|
||||
This would move the picture 150 pixels to the right of where it currently is.
|
||||
Likewise, negative values are supported as well:
|
||||
|
||||
MovePicture 99 y:-100 opacity:+25 width:-50
|
||||
|
||||
You can also use variables as values. This is done by simply typing a "v" and
|
||||
the variable id, like so:
|
||||
|
||||
MovePicture 1 x:v1 y:v2
|
||||
|
||||
Blend Mode, Origin and Wait
|
||||
------------------------------------------------------------------------------
|
||||
For these properties, you do not have to use numbers as values. Instead, you
|
||||
can use words as in the editor.
|
||||
|
||||
Property | Possible values
|
||||
- - - - - -|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Blend Mode | "normal", "additive", "multiply", "screen"
|
||||
Origin | "top_left", "center"
|
||||
Wait | true, false
|
||||
|
||||
Wait can also be written without ":<value>", as simply "wait". This makes it
|
||||
true. Example:
|
||||
|
||||
MovePicture 1 y:500 wait
|
||||
|
||||
The alues will be lower-cased internally, so feel free to write them however
|
||||
you want.
|
||||
|
||||
List of properties
|
||||
------------------------------------------------------------------------------
|
||||
Property in editor | Property name / shorthand | Default value if omitted
|
||||
- - - - - - - - - -|- - - - - - - - - - - - - -|- - - - - - - - - - - - - - -
|
||||
Origin | origin / or | Current value
|
||||
X | x | Current value
|
||||
Y | y | Current value
|
||||
Width | width / w / scaleX | Current value
|
||||
Height | height / h / scaleY | Current value
|
||||
Blend Mode | blendMode / b | Current value
|
||||
Opacity | opacity / op | Current value
|
||||
Wait | wait | False
|
||||
Duration | duration / d | 60
|
||||
- - - - - - - - - -|- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Curve | curve / c | Linear
|
||||
|
||||
Shorthands are shorter property names you can use if you find typing the whole
|
||||
property name cumbersome.
|
||||
|
||||
NOTE: The "curve" property requires TDDP_AnimationCurves plugin.
|
||||
|
||||
TDDP_AnimationCurves integration
|
||||
------------------------------------------------------------------------------
|
||||
If you have the TDDP_AnimationCurves plugins installed, this plugin's
|
||||
MovePicture Plugin Command works with it just like the built-in Move Picture
|
||||
event command does.
|
||||
|
||||
You can also use the animation curves functions with this plugin directly
|
||||
instead of having to make a separate Plugin Command entry in advance for it.
|
||||
Simply type curve:<CurveFunction> and it'll work, like so:
|
||||
|
||||
MovePicture 1 curve:QuadInOut x: 200 y:100
|
||||
|
||||
However, if you want to have different curve for different properties, you'll
|
||||
need separate Plugin Commands using TDDP_AnimationCurves' Plugin Command. This
|
||||
is to avoid this plugin's Plugin Commands becoming very long and cumbersome to
|
||||
read.
|
||||
|
||||
You can download TDDP_AnimationCurves here:
|
||||
https://forums.rpgmakerweb.com/index.php?threads/animation-curves.108388/
|
||||
|
||||
Changelog
|
||||
------------------------------------------------------------------------------
|
||||
Date | Version | Description
|
||||
- - - - - -|- - - - -|- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
03/05/2019 | 1.0.1 | Fix issue with unscoped origin var causing crashes with
|
||||
| | my other plugins.
|
||||
|
||||
License
|
||||
------------------------------------------------------------------------------
|
||||
In short: Completely free, including for commercial use. Please consider
|
||||
donating for further development of plugins and other material if you find
|
||||
this plugin useful. See https://mvplugins.tordamian.com
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Tor Damian Design
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@param movePictureCommand
|
||||
@text Move Picture command key
|
||||
@desc If you want to use a shorter Plugin Command key for, set it here. Default is "MovePicture"
|
||||
@type string
|
||||
@default MovePicture
|
||||
*/
|
||||
|
||||
var TDDP_MovePictureEx = {};
|
||||
(function($) {
|
||||
"use strict";
|
||||
//=============================================================================
|
||||
// Setting up plugin parameters
|
||||
//=============================================================================
|
||||
var parameters = PluginManager.parameters("TDDP_MovePictureEx");
|
||||
//=============================================================================
|
||||
// Set up general variables
|
||||
//=============================================================================
|
||||
var origin = {};
|
||||
//=============================================================================
|
||||
// Game_Interpreter - register plugin command
|
||||
//=============================================================================
|
||||
origin.Game_Interpreter = {};
|
||||
origin.Game_Interpreter.prototype_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
|
||||
/**
|
||||
* @param {string} command
|
||||
* @param {string[]} args
|
||||
*/
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
origin.Game_Interpreter.prototype_pluginCommand.call(this, command, args);
|
||||
|
||||
if (command === parameters.movePictureCommand) _handleCommand(this, _movePicture, args);
|
||||
}
|
||||
//=============================================================================
|
||||
// Private methods
|
||||
//=============================================================================
|
||||
var _relativeProperties = ['x', 'y', 'scaleX', 'scaleY', 'opacity'];
|
||||
|
||||
/**
|
||||
* @typedef {Object} MovePictureParams
|
||||
* @property {number} id The Picture ID
|
||||
* @property {number} x
|
||||
* @property {number} y
|
||||
* @property {number} opacity
|
||||
* @property {number} scaleX
|
||||
* @property {number} scaleY
|
||||
* @property {number} blendMode
|
||||
* @property {number} origin
|
||||
* @property {Boolean} wait
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback CommandHandler
|
||||
* @param {Game_Interpreter} interpreter
|
||||
* @param {MovePictureParams} p
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Game_Interpreter} interpreter
|
||||
* @param {CommandHandler} callback
|
||||
* @param {string[]} args
|
||||
*/
|
||||
function _handleCommand(interpreter, callback, args) {
|
||||
var id = args.shift();
|
||||
if (id[0] == "v") {
|
||||
id = $gameVariables.value(Number(id.slice(1)));
|
||||
}
|
||||
else {
|
||||
id = Number(id);
|
||||
}
|
||||
|
||||
var picture = $gameScreen.picture(id);
|
||||
|
||||
// Picture not added, ignore command
|
||||
if (!picture) return;
|
||||
|
||||
var params = {
|
||||
id: id
|
||||
};
|
||||
|
||||
args.forEach(function(str) {
|
||||
var param = _parseCommandParam(str);
|
||||
|
||||
if (param) {
|
||||
if (param.value[0] == "v") param.value = $gameVariables.value(Number(param.value.slice(1)));
|
||||
params[param.key] = param.value;
|
||||
}
|
||||
});
|
||||
|
||||
// Check alternative syntax before considering curve animations
|
||||
params.scaleX = params.w || params.width || params.scaleX;
|
||||
params.scaleY = params.h || params.height || params.scaleY;
|
||||
params.opacity = params.op || params.opacity;
|
||||
params.curve = params.c || params.curve;
|
||||
|
||||
if (params.curve && Imported.TDDP_AnimationCurves) {
|
||||
TDDP_AnimationCurves.setEasingFunction(params.curve, 'general');
|
||||
}
|
||||
|
||||
// Fallback to alternative syntax or defaults if undefined
|
||||
params.x = params.x || picture.x();
|
||||
params.y = params.y || picture.y();
|
||||
params.scaleX = params.scaleX || picture.scaleX();
|
||||
params.scaleY = params.scaleY || picture.scaleY();
|
||||
params.opacity = params.opacity || picture.opacity();
|
||||
params.duration = Number(params.d || params.duration || 60);
|
||||
params.wait = params.wait || false;
|
||||
params.origin = params.or || params.origin || picture.origin();
|
||||
params.blendMode = params.b || params.blendMode || picture.blendMode();
|
||||
|
||||
// Resolve relative property values
|
||||
_relativeProperties.forEach(function(prop) {
|
||||
if (params[prop][0] == '+') return params[prop] = picture[prop]() + Number(params[prop].slice(1));
|
||||
if (params[prop][0] == '-') return params[prop] = picture[prop]() - Number(params[prop].slice(1));
|
||||
params[prop] = Number(params[prop]);
|
||||
})
|
||||
|
||||
// Convert blend mode to integer value if string
|
||||
if (typeof params.blendMode == "string") params.blendMode = _convertBlendModeString(params.blendMode);
|
||||
|
||||
// Convert origin to integer value if string
|
||||
if (typeof params.origin == "string") params.origin = _convertOriginString(params.origin);
|
||||
|
||||
callback(interpreter, params);
|
||||
}
|
||||
|
||||
var _blendModes = ["normal", "additive", "multiply", "screen"];
|
||||
/**
|
||||
*
|
||||
* @param {string} str String to convert
|
||||
*/
|
||||
function _convertBlendModeString(str) {
|
||||
return _blendModes.indexOf(str.toLowerCase()) || 0;
|
||||
}
|
||||
|
||||
var _originIndices = ["upper_left", "center"]
|
||||
/**
|
||||
*
|
||||
* @param {string} str String to convert
|
||||
*/
|
||||
function _convertOriginString(str) {
|
||||
return _originIndices.indexOf(str.toLowerCase()) || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Game_Interpreter} interpreter
|
||||
* @param {MovePictureParams} p
|
||||
*/
|
||||
function _movePicture(interpreter, p) {
|
||||
$gameScreen.movePicture(p.id, p.origin, p.x, p.y, p.scaleX,
|
||||
p.scaleY, p.opacity, p.blendMode, p.duration);
|
||||
|
||||
if (p.wait) {
|
||||
interpreter.wait(p.duration);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CommandParam type
|
||||
* @typedef {Object} CommandParam
|
||||
* @param {string} key
|
||||
* @param {any} value
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {RegExp} _pluginCommandParseRegExp
|
||||
*/
|
||||
var _pluginCommandParseRegExp = /([A-zA-Z]+):(\S+)/;
|
||||
|
||||
/**
|
||||
* Parse Plugin Command arguments
|
||||
* @param {string} str String to parse
|
||||
* @return {(CommandParam|undefined)}
|
||||
*/
|
||||
function _parseCommandParam(str) {
|
||||
if (str == "wait") return {key: "wait", value: true};
|
||||
if (str.length > 0) var parsed = _pluginCommandParseRegExp.exec(str);
|
||||
|
||||
if (parsed && parsed[1]) {
|
||||
return {
|
||||
key: parsed[1],
|
||||
value: parsed[2]
|
||||
}
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
})(TDDP_MovePictureEx);
|
|
@ -1,116 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDDP_NoFastForward
|
||||
// Version: 2.1.0
|
||||
//=============================================================================
|
||||
var Imported = Imported || {};
|
||||
Imported.TDDP_NoFastForward = "2.1.0";
|
||||
/*:
|
||||
* @plugindesc 2.1.0 Disables the ability to fast forward move routes and/or text. id:TDDP_NoFastForward
|
||||
* @author Tor Damian Design / Galenmereth
|
||||
*
|
||||
* @param Disable for Move Routes
|
||||
* @desc If set to true this will disable fast-forwarding for Move Routes globally. Default is false.
|
||||
* @default false
|
||||
*
|
||||
* @param Disable for Show Text
|
||||
* @desc If set to true this will disable fast-forwarding for Show Text globally. Default is false.
|
||||
* @default false
|
||||
*
|
||||
* @help =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
|
||||
* Information
|
||||
* =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
|
||||
* For updates and easy to use documentation, please go to the plugin's website:
|
||||
* http://mvplugins.tordamian.com/?p=376
|
||||
*
|
||||
* There you can also download a PDF of the documentation for offline use, and
|
||||
* having the documentation in one cleanly presented place means you can always
|
||||
* be sure it's the most recent available.
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* Terms & Conditions
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* This plugin is free for both non-commercial and commercial use. Please see
|
||||
* http://mvplugins.tordamian.com/terms-of-use for the full terms of use.
|
||||
*/
|
||||
TDDP_NoFastForward = {};
|
||||
(function($) {
|
||||
//=============================================================================
|
||||
// Setting up parameters and internal funcs. All bound to TDDP_NoFastForward object
|
||||
//=============================================================================
|
||||
$._parameters = $plugins.filter(function(p){return p.description.contains("id:TDDP_NoFastForward")})[0].parameters;
|
||||
$._disableGlobalMoveRouteFF = Boolean($._parameters['Disable for Move Routes'] === 'true' || false);
|
||||
$._disableGlobalTextFF = Boolean($._parameters['Disable for Show Text'] === 'true' || false);
|
||||
/**
|
||||
* Disable text Fast Forwarding
|
||||
* @method disableTextFF
|
||||
*/
|
||||
$.disableTextFF = function() {
|
||||
this._textFfDisabled = true;
|
||||
}
|
||||
/**
|
||||
* Enable text Fast Forwarding
|
||||
* @method enableTextFF
|
||||
*/
|
||||
$.enableTextFF = function() {
|
||||
this._textFfDisabled = false;
|
||||
}
|
||||
$.disableNextTextFF = function() {
|
||||
this._nextTextFfDisabled = true;
|
||||
}
|
||||
$.resetDisableNextTextFF = function() {
|
||||
this._nextTextFfDisabled = false;
|
||||
}
|
||||
/**
|
||||
* Get if text Fast Forwarding is disabled
|
||||
* @method isTextFfDisabled
|
||||
*/
|
||||
$.isTextFfDisabled = function() {
|
||||
if (this._nextTextFfDisabled || this._textFfDisabled || this._disableGlobalTextFF) return true;
|
||||
return false;
|
||||
}
|
||||
//=============================================================================
|
||||
// Game_Interpreter - register plugin commands
|
||||
//=============================================================================
|
||||
/**
|
||||
* @CHANGED Adding DisableTextFF command
|
||||
*/
|
||||
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function(command, args) {
|
||||
_Game_Interpreter_pluginCommand.call(this, command, args)
|
||||
command = command.toUpperCase();
|
||||
if (command === 'ENABLETEXTFF') $.enableTextFF();
|
||||
if (command === 'DISABLETEXTFF') $.disableTextFF();
|
||||
if (command === 'DISABLENEXTTEXTFF') $.disableNextTextFF();
|
||||
};
|
||||
//=============================================================================
|
||||
// Scene_Map
|
||||
//=============================================================================
|
||||
/**
|
||||
* @CHANGED Adding support for disabling move route fast forward
|
||||
*/
|
||||
Scene_Map_prototype_isFastForward = Scene_Map.prototype.isFastForward;
|
||||
Scene_Map.prototype.isFastForward = function() {
|
||||
if ($._disableGlobalMoveRouteFF) return false;
|
||||
return Scene_Map_prototype_isFastForward.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// Window_Message
|
||||
//=============================================================================
|
||||
/**
|
||||
* @CHANGED Extending to run resetDisableNextTextFF()
|
||||
*/
|
||||
Window_Message_prototype_onEndOfText = Window_Message.prototype.onEndOfText;
|
||||
Window_Message.prototype.onEndOfText = function() {
|
||||
$.resetDisableNextTextFF(); // Re-enable local text FF
|
||||
Window_Message_prototype_onEndOfText.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* @CHANGED Supports disabling text fast forward
|
||||
*/
|
||||
var Window_Message_prototype_updateShowFast = Window_Message.prototype.updateShowFast;
|
||||
Window_Message.prototype.updateShowFast = function() {
|
||||
//if ($.isTextFfDisabled()) return false;
|
||||
if(!ConfigManager.textSkip) {return false;}
|
||||
return Window_Message_prototype_updateShowFast.call(this);
|
||||
};
|
||||
})(TDDP_NoFastForward);
|
|
@ -1,567 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Footprints
|
||||
// Version: 1.6
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_Footprints = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.Footprints = _TDS_.Footprints || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Adds footprints for characters.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
(function($) {
|
||||
// Use Strict
|
||||
"use strict";
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** SceneManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages scene transitions.
|
||||
//=============================================================================
|
||||
// * Add Footprint
|
||||
//=============================================================================
|
||||
SceneManager.addFootprint = function(footprint) {
|
||||
// If on Scene Map
|
||||
if (SceneManager._scene.constructor === Scene_Map) {
|
||||
// Add Footprint object to map
|
||||
$gameMap.addFootprint(footprint);
|
||||
// Get Container
|
||||
let container = SceneManager._scene._spriteset._footprintsContainer;
|
||||
// Add Footprint to container
|
||||
container.addFootprint(footprint);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_CharacterBase
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Character. It handles basic information, such as
|
||||
// coordinates and images, shared by all characters.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
|
||||
$.Game_CharacterBase_moveStraight = Game_CharacterBase.prototype.moveStraight;
|
||||
//=============================================================================
|
||||
// * Initialize Members
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.initMembers = function() {
|
||||
// Run Original Function
|
||||
$.Game_CharacterBase_initMembers.call(this);
|
||||
// Set Disable Footprints flag
|
||||
this._disableFootprints = true;
|
||||
// Initialize Footprint position
|
||||
this._footprintPos = new Point();
|
||||
// Set Last Direction
|
||||
this._lastDirection = this._direction;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Character can create footprints
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.canCreateFootprints = function() {
|
||||
return !this._disableFootprints;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Move Straight
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.moveStraight = function(d) {
|
||||
// Get Old Values
|
||||
let oldX = this._realX, oldY = this._realY, oldDir = d;
|
||||
// Set Last Direction
|
||||
this._lastDirection = this._direction;
|
||||
// Run Original Function
|
||||
$.Game_CharacterBase_moveStraight.call(this, d);
|
||||
// If position has changed
|
||||
if (!!this.isMoving()) {
|
||||
// Set Footprint Position
|
||||
if(typeof this._footprintPos === "undefined") {
|
||||
this._footprintPos = new Point();
|
||||
}
|
||||
this._footprintPos.set(oldX, oldY);
|
||||
// Process Footprint Movement
|
||||
this.footprintMovement();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Footprint Movement
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.footprintMovement = function() {
|
||||
// If Can Create Footprints
|
||||
if (this.canCreateFootprints()) {
|
||||
// Generate Footprint
|
||||
let footprint = this.genererateFootprint();
|
||||
if(!footprint) {return;}
|
||||
// Add Footprint
|
||||
SceneManager.addFootprint(footprint);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Name of Character Footprints Graphic
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.footprintGraphicsName = function() {
|
||||
return 'footprints_turn';
|
||||
}
|
||||
//=============================================================================
|
||||
// * Generate Footprint Object
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.genererateFootprint = function() {
|
||||
if($gameMap.regionId(this._footprintPos.x, this._footprintPos.y) !== 28) {return null;}
|
||||
// Create Footprint Object
|
||||
let footprint = new Game_Footprint();
|
||||
footprint._graphicsName = this.footprintGraphicsName();
|
||||
footprint._frame = this.pattern();
|
||||
footprint._direction = this._direction;
|
||||
footprint._lastDirection = this._lastDirection;
|
||||
footprint.setPosition(this._footprintPos.x, this._footprintPos.y);
|
||||
// Return Footprint
|
||||
return footprint;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Player
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the player. It contains event starting
|
||||
// determinants and map scrolling functions.
|
||||
//=============================================================================
|
||||
// * Determine if Character can create footprints
|
||||
//=============================================================================
|
||||
Game_Player.prototype.canCreateFootprints = function() {
|
||||
if ($gameSwitches.value(881)) { return false; };
|
||||
if (this.regionId() !== 28) { return false; };
|
||||
return true;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Name of Character Footprints Graphic
|
||||
//=============================================================================
|
||||
Game_Player.prototype.footprintGraphicsName = function() {
|
||||
if ($gameSwitches.value(84)) { return 'bloody_footprints'}
|
||||
return 'footprints_turn';
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Follower
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a follower. A follower is an allied character,
|
||||
// other than the front character, displayed in the party.
|
||||
//=============================================================================
|
||||
// * Determine if Character can create footprints
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.canCreateFootprints = function() {
|
||||
return false
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a map. It contains scrolling and passage
|
||||
// determination functions.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Game_Map_initialize = Game_Map.prototype.initialize;
|
||||
$.Game_Map_setup = Game_Map.prototype.setup;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Map.prototype.initialize = function() {
|
||||
// Run Original Function
|
||||
$.Game_Map_initialize.call(this);
|
||||
// Initialize Footprints
|
||||
this.initFootprints();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Game_Map.prototype.setup = function(mapId) {
|
||||
// Run Original Function
|
||||
$.Game_Map_setup.call(this, mapId);
|
||||
// Initialize Footprints
|
||||
this.initFootprints();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Footprints
|
||||
//=============================================================================
|
||||
Game_Map.prototype.initFootprints = function() {
|
||||
// Initialize Footprints Array
|
||||
this._footprints = [];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Footprints
|
||||
//=============================================================================
|
||||
Game_Map.prototype.footprints = function() { return this._footprints; };
|
||||
//=============================================================================
|
||||
// * Add Footprints
|
||||
//=============================================================================
|
||||
Game_Map.prototype.addFootprint = function(footprint) {
|
||||
// If Footprint exist add it to array
|
||||
if (footprint) { this._footprints.push(footprint); };
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Footprints
|
||||
//=============================================================================
|
||||
Game_Map.prototype.removeFootprint = function(footprint) {
|
||||
// Get Fooprint Index
|
||||
var index = this._footprints.indexOf(footprint);
|
||||
// If Index is more than 0
|
||||
if (index >= 0) {
|
||||
footprint.remove();
|
||||
this._footprints.splice(index, 1);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Footprint
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for footprints and other stepping effects.
|
||||
//=============================================================================
|
||||
function Game_Footprint() { this.initialize.apply(this, arguments); }
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.initialize = function() {
|
||||
// Set X & Y Coordinates
|
||||
this._x = 0; this._y = 0;
|
||||
// Rows and Colums
|
||||
this._rows = 4;
|
||||
this._columns = 3;
|
||||
// Graphics Properties
|
||||
this._graphicsName = 'footprints_turn';
|
||||
this._index = 0;
|
||||
this._frame = 0;
|
||||
this._direction = 0;
|
||||
// Duration
|
||||
this._duration = 60;
|
||||
// Set Opacity
|
||||
this._opacity = 255;
|
||||
// Fading Speed
|
||||
this._fadeSpeed = 20;
|
||||
// Removed Flag
|
||||
this._removed = false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if finished
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.isFinished = function() {
|
||||
if (this._opacity <= 0) { return true;}
|
||||
if (this._removed) { return true; }
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Position
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.setPosition = function(x, y) { this._x = x, this._y = y};
|
||||
//=============================================================================
|
||||
// * Remove
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.remove = function() { this._removed = true; };
|
||||
//=============================================================================
|
||||
// * Setup Graphics
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.setupGraphics = function(name, rows = 4, columns = 4) {
|
||||
// Set Graphics Properties
|
||||
this._graphicsName = name;
|
||||
this._rows = rows;
|
||||
this._columns = columns;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Game_Footprint.prototype.update = function() {
|
||||
// Decrease Duration
|
||||
if (this._duration > 0 ) {
|
||||
// Reduce duration
|
||||
this._duration--;
|
||||
} else {
|
||||
// Reduce Opacity by fade speed
|
||||
this._opacity -= this._fadeSpeed;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Spriteset_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The set of sprites on the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Spriteset_Map_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;
|
||||
//=============================================================================
|
||||
// * Create Screen Sprites
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createLowerLayer = function() {
|
||||
// Run Original Function
|
||||
$.Spriteset_Map_createLowerLayer.call(this);
|
||||
// Create Footprints Layer
|
||||
this.createFootprintsLayer();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Footprints Layer
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createFootprintsLayer = function() {
|
||||
// Create Footprints Layer
|
||||
this._footprintsContainer = new Footprints_Container();
|
||||
this._footprintsContainer.z = 3;
|
||||
this._tilemap.addChild(this._footprintsContainer);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Footprints Container
|
||||
//-----------------------------------------------------------------------------
|
||||
// Container for Footprints.
|
||||
//=============================================================================
|
||||
function Footprints_Container() { this.initialize.apply(this, arguments); }
|
||||
Footprints_Container.prototype = Object.create(PIXI.Container.prototype);
|
||||
Footprints_Container.prototype.constructor = Footprints_Container;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Footprints_Container.prototype.initialize = function() {
|
||||
// Super Call
|
||||
PIXI.Container.call(this);
|
||||
// Set Width & Height
|
||||
this._width = Graphics.width;
|
||||
this._height = Graphics.height;
|
||||
// Origin Position
|
||||
this.origin = new Point();
|
||||
// Initialize Sprites Array
|
||||
this._sprites = [];
|
||||
// Get Footprints
|
||||
let footprints = $gameMap.footprints();
|
||||
// Go through Footprint Objects
|
||||
for (let i = 0; i < footprints.length; i++) {
|
||||
// Get Footprint
|
||||
let footprint = footprints[i];
|
||||
// If footprint is not finished
|
||||
if (!footprint.isFinished()) {
|
||||
// Create Footprint
|
||||
this.addFootprint(footprint)
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Footprint
|
||||
//=============================================================================
|
||||
Footprints_Container.prototype.addFootprint = function(footprint) {
|
||||
// Create Footprint Sprite
|
||||
var sprite = new Sprite_Footprint(footprint);
|
||||
// Add new Footprint Sprite
|
||||
this._sprites.push(sprite);
|
||||
// Add child
|
||||
this.addChild(sprite);
|
||||
// Return created sprite
|
||||
return sprite;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Footprint
|
||||
//=============================================================================
|
||||
Footprints_Container.prototype.removeFootprint = function(sprite) {
|
||||
// Get Sprite Index
|
||||
let index = this._sprites.indexOf(sprite);
|
||||
// If Index is more than 0
|
||||
if (index >= 0) {
|
||||
// Remove footprint object from map
|
||||
$gameMap.removeFootprint(sprite._footprint);
|
||||
this._sprites.splice(index, 1);
|
||||
this.removeChild(sprite);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Footprints_Container.prototype.update = function() {
|
||||
// Go through sprites
|
||||
/*this._sprites.forEach( function(sprite) {
|
||||
// Update Sprite Position
|
||||
sprite.x = sprite.screenX() - this.origin.x;
|
||||
sprite.y = sprite.screenY() - this.origin.y;
|
||||
// Update Sprite
|
||||
sprite.update();
|
||||
// If Sprite is Finished remove it
|
||||
if (sprite.isFinished()) { this.removeFootprint(sprite); };
|
||||
}, this);*/
|
||||
if(this._sprites.length <= 0) {return;}
|
||||
for(let sprite of this._sprites) {
|
||||
sprite.x = sprite.screenX() - this.origin.x;
|
||||
sprite.y = sprite.screenY() - this.origin.y;
|
||||
sprite.update();
|
||||
if(!!sprite.isFinished()) {this.removeFootprint(sprite)}
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// * Remove all footprints
|
||||
//=============================================================================
|
||||
|
||||
Footprints_Container.prototype.removeAll = function() {
|
||||
if(this._sprites.length <= 0) {return;}
|
||||
for(let sprite of this._sprites) {
|
||||
this.removeFootprint(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Footprint
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sprite for displaying footprints
|
||||
//=============================================================================
|
||||
function Sprite_Footprint() { this.initialize.apply(this, arguments);}
|
||||
Sprite_Footprint.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_Footprint.prototype.constructor = Sprite_Footprint;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.initialize = function(footprint) {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this);
|
||||
// Set Footprint Object
|
||||
this._footprint = footprint;
|
||||
// Setup Bitmap
|
||||
this.bitmap = ImageManager.loadCharacter(footprint._graphicsName);
|
||||
// Set Finished Flag
|
||||
this._finished = false;
|
||||
this._mapPos = new Point(footprint._x, footprint._y);
|
||||
// Set Opacity
|
||||
this.opacity = footprint._opacity;
|
||||
this.bitmap.addLoadListener(() => {
|
||||
this.setupBitmap(footprint);
|
||||
})
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Finished
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.isFinished = function() { return this._finished; };
|
||||
//=============================================================================
|
||||
// * Screen X Position
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.screenX = function() {
|
||||
const scrolledX = $gameMap.adjustX(this._mapPos.x);
|
||||
const tw = $gameMap.tileWidth();
|
||||
return Math.round(scrolledX * tw);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Screen Y Position
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.screenY = function() {
|
||||
const scrolledY = $gameMap.adjustY(this._mapPos.y);
|
||||
const th = $gameMap.tileHeight();
|
||||
return Math.round(scrolledY * th) ;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup Bitmap
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.setupBitmap = function(footprint = this._footprint) {
|
||||
// Get Bitmap
|
||||
let lastDirection = footprint._lastDirection;
|
||||
let direction = footprint._direction
|
||||
let dIndex = (direction / 2) - 1;
|
||||
|
||||
let width = this.bitmap.width / (footprint._columns + 2);
|
||||
let height = this.bitmap.height / footprint._rows;
|
||||
|
||||
let sy = dIndex * height;
|
||||
let sx = (footprint._frame % 3) * width;
|
||||
// If Direction does not match last direction
|
||||
if (direction !== lastDirection) {
|
||||
// Set Index
|
||||
let index = 0;
|
||||
// Set Skip Flag
|
||||
let skip = false;
|
||||
switch (lastDirection) {
|
||||
case 2:
|
||||
switch (direction) {
|
||||
case 4: index = 1 ;break;
|
||||
case 6: index = 0 ;break;
|
||||
case 2:
|
||||
case 8: skip = true ;break;
|
||||
};
|
||||
break;
|
||||
case 4:
|
||||
switch (direction) {
|
||||
case 2: index = 0 ;break;
|
||||
case 8: index = 1 ;break;
|
||||
case 4:
|
||||
case 6: skip = true ;break;
|
||||
};
|
||||
break;
|
||||
case 6:
|
||||
switch (direction) {
|
||||
case 2: index = 0 ;break;
|
||||
case 8: index = 1 ;break;
|
||||
case 4:
|
||||
case 6: skip = true ;break;
|
||||
};
|
||||
break;
|
||||
case 8:
|
||||
switch (direction) {
|
||||
case 4: index = 1 ;break;
|
||||
case 6: index = 0 ;break;
|
||||
case 2:
|
||||
case 8: skip = true ;break;
|
||||
};
|
||||
}
|
||||
// If not skipping
|
||||
if (!skip) {
|
||||
sx = (footprint._columns * width) + (index * width);
|
||||
sy = ((lastDirection / 2) - 1) * height;
|
||||
};
|
||||
};
|
||||
// Set Frame
|
||||
this.setFrame(sx, sy, width, height);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_Footprint.prototype.update = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.update.call(this);
|
||||
// If it has footprint object
|
||||
if (this._footprint) {
|
||||
// Update Footprint
|
||||
this._footprint.update();
|
||||
// Set Opacity
|
||||
this.opacity = this._footprint._opacity;
|
||||
// If footprint is finished
|
||||
if (this._footprint.isFinished()) {
|
||||
// Set Finished flag to true
|
||||
this._finished = true;
|
||||
}
|
||||
} else {
|
||||
// Set Finished flag to true
|
||||
this._finished = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
})(_TDS_.Footprints);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,557 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Map Fog
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_MapFog = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.MapFog = _TDS_.MapFog || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Adds fog sprites to map.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
(function($) {
|
||||
// Use Strict
|
||||
"use strict";
|
||||
|
||||
//=============================================================================
|
||||
// ** ImageManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that loads images, creates bitmap objects and retains them.
|
||||
//=============================================================================
|
||||
// * Load Overlay Image
|
||||
//=============================================================================
|
||||
ImageManager.loadOverlay = function(filename, hue) {
|
||||
return this.loadBitmap('img/overlays/', filename, hue, true);
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Generate Map Fog
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.generateMapFog = function() { return new Game_MapFog(); };
|
||||
//=============================================================================
|
||||
// * Create Map Fog
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.createMapFog = function(id, fog) {
|
||||
// Get Container
|
||||
let container = SceneManager._scene._spriteset._mapFogContainer;
|
||||
// Add Map Fog
|
||||
$gameMap.addMapFog('fog1', fog);
|
||||
if (container) { container.addFog(id); };
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a map. It contains scrolling and passage
|
||||
// determination functions.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Game_Map_initialize = Game_Map.prototype.initialize;
|
||||
$.Game_Map_setup = Game_Map.prototype.setup;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_Map.prototype.initialize = function() {
|
||||
// Run Original Function
|
||||
$.Game_Map_initialize.call(this);
|
||||
// Initialize Map Fog
|
||||
this.clearMapFogs();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Map Fogs
|
||||
//=============================================================================
|
||||
Game_Map.prototype.clearMapFogs = function() {
|
||||
if (this._mapFogs) { delete this._mapFogs; };
|
||||
// Initialize Map Fogs Object
|
||||
this._mapFogs = {}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Map Fog
|
||||
//=============================================================================
|
||||
Game_Map.prototype.getMapFog = function(name) { return this._mapFogs[name]; };
|
||||
//=============================================================================
|
||||
// * Add Map Fog
|
||||
//=============================================================================
|
||||
Game_Map.prototype.addMapFog = function(name, fog) { this._mapFogs[name] = fog; };
|
||||
//=============================================================================
|
||||
// * Remove Map Fog
|
||||
//=============================================================================
|
||||
Game_Map.prototype.removeMapFog = function(name) { delete this._mapFogs[name]; };
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_MapFog
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for Map Fog.
|
||||
//=============================================================================
|
||||
function Game_MapFog() { this.initialize.apply(this, arguments); }
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Game_MapFog.prototype.initialize = function(id) {
|
||||
this._id = id;
|
||||
this.name = '';
|
||||
this.opacity = 255;
|
||||
this.blendMode = 0;
|
||||
this.scaleX = 1;
|
||||
this.scaleY = 1;
|
||||
this.moveX = 0;
|
||||
this.moveY = 0;
|
||||
this.width = Graphics.width;
|
||||
this.height = Graphics.height;
|
||||
this.mapBind = true;
|
||||
this.visible = true;
|
||||
this.deactivateOnInvisible = true;
|
||||
this.active = true;
|
||||
this.priority = 0;
|
||||
this.origin = new Point();
|
||||
this.move = new Point();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show
|
||||
//=============================================================================
|
||||
Game_MapFog.prototype.show = function() {
|
||||
this.visible = true;
|
||||
this.active = true;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Spriteset_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The set of sprites on the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Spriteset_Map_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;
|
||||
//=============================================================================
|
||||
// * Create Lower Layer
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createLowerLayer = function() {
|
||||
// Run Original Function
|
||||
$.Spriteset_Map_createLowerLayer.call(this);
|
||||
// Create Map Fog Container
|
||||
this.createMapFogContainer();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Map Fog Container
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createMapFogContainer = function() {
|
||||
// Create Map Fog Container
|
||||
this._mapFogContainer = new Sprite_MapFogContainer();
|
||||
this.addChild(this._mapFogContainer);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** MapFog Container
|
||||
//-----------------------------------------------------------------------------
|
||||
// Container for Map Fog.
|
||||
//=============================================================================
|
||||
function Sprite_MapFogContainer() { this.initialize.apply(this, arguments); }
|
||||
Sprite_MapFogContainer.prototype = Object.create(PIXI.Container.prototype);
|
||||
Sprite_MapFogContainer.prototype.constructor = Sprite_MapFogContainer;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Sprite_MapFogContainer.prototype.initialize = function() {
|
||||
// Super Call
|
||||
PIXI.Container.call(this);
|
||||
|
||||
// Initialize Sprites Array
|
||||
this._sprites = []
|
||||
// Get Map Fogs
|
||||
let mapFogs = Object.entries($gameMap._mapFogs)
|
||||
// Sort Map Fogs
|
||||
mapFogs = mapFogs.sort(function(a, b) {
|
||||
return a[1].priority - b[1].priority;
|
||||
});
|
||||
|
||||
// Add Map Fog
|
||||
for (let i = 0; i < mapFogs.length; i++) { this.addFog(mapFogs[i][0]); };
|
||||
|
||||
// this.addFog('titties');
|
||||
// this.addFog('fog2');
|
||||
// // Set Width & Height
|
||||
// this._width = Graphics.width;
|
||||
// this._height = Graphics.height;
|
||||
// // Origin Position
|
||||
// this.origin = new Point();
|
||||
// // Initialize Sprites Array
|
||||
// this._sprites = [];
|
||||
// // Get MapFog
|
||||
// let MapFog = $gameMap.MapFog();
|
||||
// // Go through Footprint Objects
|
||||
// for (let i = 0; i < MapFog.length; i++) {
|
||||
// // Get Footprint
|
||||
// let footprint = MapFog[i];
|
||||
// // If footprint is not finished
|
||||
// if (!footprint.isFinished()) {
|
||||
// // Create Footprint
|
||||
// this.addFootprint(footprint)
|
||||
// };
|
||||
// };
|
||||
|
||||
// this._fogSprite = new Sprite_MapFog();
|
||||
// this.addChild(this._fogSprite)
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Fog
|
||||
//=============================================================================
|
||||
Sprite_MapFogContainer.prototype.addFog = function(id) {
|
||||
// Check for ID duplicates
|
||||
let idCheck = this._sprites.some(function(sprite) { return sprite._id === id });
|
||||
// If ID check then return
|
||||
if (idCheck) { return; };
|
||||
// Get Map fog data
|
||||
let data = $gameMap.getMapFog(id);
|
||||
// If Data Exists
|
||||
if (data) {
|
||||
let sprite = new Sprite_MapFog(id);
|
||||
this._sprites.push(sprite);
|
||||
this.addChild(sprite);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Remove Fog
|
||||
//=============================================================================
|
||||
Sprite_MapFogContainer.prototype.removeFog = function(fog) {
|
||||
// Get Sprite Index
|
||||
let index = this._sprites.indexOf(fog);
|
||||
// If Index is more than 0
|
||||
if (index >= 0) {
|
||||
this._sprites.splice(index, 1);
|
||||
this.removeChild(fog);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_MapFogContainer.prototype.update = function() {
|
||||
// Go through sprites
|
||||
this._sprites.forEach( function(sprite) {
|
||||
// Update Sprite
|
||||
sprite.update();
|
||||
}, this);
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_MapFog
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sprite for displaying Map Fog.
|
||||
//=============================================================================
|
||||
function Sprite_MapFog() { this.initialize.apply(this, arguments);}
|
||||
Sprite_MapFog.prototype = Object.create(TilingSprite.prototype);
|
||||
Sprite_MapFog.prototype.constructor = Sprite_MapFog;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_MapFog.prototype.initialize = function(id) {
|
||||
// Super Call
|
||||
TilingSprite.prototype.initialize.call(this);
|
||||
// Set ID
|
||||
this._id = id;
|
||||
// Set Bitmap name
|
||||
this._bitmapName = '';
|
||||
// Update
|
||||
this.update();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_MapFog.prototype.update = function() {
|
||||
// Super Call
|
||||
TilingSprite.prototype.update.call(this);
|
||||
// Get Data
|
||||
let data = $gameMap.getMapFog(this._id);
|
||||
// If Data Exists
|
||||
if (data && data.active) {
|
||||
// If Bitmap name has changed
|
||||
if (this._bitmapName !== data.name) {
|
||||
// Set bitmap
|
||||
this.bitmap = ImageManager.loadOverlay(data.name);
|
||||
this.move(0, 0, data.width, data.height);
|
||||
this._bitmapName = data.name;
|
||||
};
|
||||
// Apply Data
|
||||
this.opacity = data.opacity;
|
||||
this.blendMode = data.blendMode;
|
||||
this.scale.x = data.scaleX;
|
||||
this.scale.y = data.scaleY;
|
||||
this.visible = data.visible;
|
||||
// Deactivate if not visible
|
||||
if (!data.visible && data.deactivateOnInvisible) { data.active = false; };
|
||||
// If Bitmap width is more than 0
|
||||
if (this.bitmap.width > 0) {
|
||||
// Set Base Origin Position
|
||||
data.origin.x = (data.origin.x + data.move.x) % this.bitmap.width;
|
||||
data.origin.y = (data.origin.y + data.move.y) % this.bitmap.height;
|
||||
// Set Origin
|
||||
this.origin.x = data.origin.x;
|
||||
this.origin.y = data.origin.y;
|
||||
// If Fog should be boudn to map
|
||||
if (data.mapBind) {
|
||||
this.origin.x += ($gameMap.displayX() * $gameMap.tileWidth())
|
||||
this.origin.y += ($gameMap.displayY() * $gameMap.tileHeight());
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// Remove From parent
|
||||
this.parent.removeFog(this);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
})(_TDS_.MapFog);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
//=============================================================================
|
||||
// ** SceneManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages scene transitions.
|
||||
//=============================================================================
|
||||
// * Add Footprint
|
||||
//=============================================================================
|
||||
SceneManager.addFootprint = function(footprint) {
|
||||
// If on Scene Map
|
||||
if (SceneManager._scene.constructor === Scene_Map) {
|
||||
// Add Footprint object to map
|
||||
$gameMap.addFootprint(footprint);
|
||||
// Get Container
|
||||
let container = SceneManager._scene._spriteset._MapFogContainer;
|
||||
// Add Footprint to container
|
||||
container.addFootprint(footprint);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_CharacterBase
|
||||
//-----------------------------------------------------------------------------
|
||||
// The superclass of Game_Character. It handles basic information, such as
|
||||
// coordinates and images, shared by all characters.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
|
||||
$.Game_CharacterBase_moveStraight = Game_CharacterBase.prototype.moveStraight;
|
||||
//=============================================================================
|
||||
// * Initialize Members
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.initMembers = function() {
|
||||
// Run Original Function
|
||||
$.Game_CharacterBase_initMembers.call(this);
|
||||
// Set Disable MapFog flag
|
||||
this._disableMapFog = true;
|
||||
// Initialize Footprint position
|
||||
this._footprintPos = new Point();
|
||||
// Set Last Direction
|
||||
this._lastDirection = this._direction;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Character can create MapFog
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.canCreateMapFog = function() {
|
||||
return this._disableMapFog;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Move Straight
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.moveStraight = function(d) {
|
||||
// Get Old Values
|
||||
let oldX = this._x, oldY = this._y, oldDir = d;
|
||||
// Set Last Direction
|
||||
this._lastDirection = this._direction;
|
||||
// Run Original Function
|
||||
$.Game_CharacterBase_moveStraight.call(this, d);
|
||||
// If position has changed
|
||||
if (oldX !== this._x || oldY !== this._y || oldDir !== this._direction) {
|
||||
// Set Footprint Position
|
||||
this._footprintPos.set(oldX, oldY);
|
||||
// Process Footprint Movement
|
||||
this.footprintMovement();
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Footprint Movement
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.footprintMovement = function() {
|
||||
// If Can Create MapFog
|
||||
if (this.canCreateMapFog()) {
|
||||
// Add Footprint
|
||||
SceneManager.addFootprint(this.genererateFootprint());
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Generate Footprint Object
|
||||
//=============================================================================
|
||||
Game_CharacterBase.prototype.genererateFootprint = function() {
|
||||
// Create Footprint Object
|
||||
let footprint = new Game_MapFog();
|
||||
footprint._frame = this.pattern();
|
||||
footprint._direction = this._direction;
|
||||
footprint._lastDirection = this._lastDirection;
|
||||
footprint.setPosition(this._footprintPos.x, this._footprintPos.y);
|
||||
// Return Footprint
|
||||
return footprint;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Follower
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a follower. A follower is an allied character,
|
||||
// other than the front character, displayed in the party.
|
||||
//=============================================================================
|
||||
// * Determine if Character can create MapFog
|
||||
//=============================================================================
|
||||
Game_Follower.prototype.canCreateMapFog = function() {
|
||||
return false
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Spriteset_Map
|
||||
//-----------------------------------------------------------------------------
|
||||
// The set of sprites on the map screen.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
$.Spriteset_Map_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;
|
||||
$.Spriteset_Map_update = Spriteset_Map.prototype.update;
|
||||
//=============================================================================
|
||||
// * Create Screen Sprites
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createLowerLayer = function() {
|
||||
// Run Original Function
|
||||
$.Spriteset_Map_createLowerLayer.call(this);
|
||||
// Create MapFog Layer
|
||||
this.createMapFogLayer();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.update = function() {
|
||||
// Set MapFog Layer
|
||||
this._MapFogContainer.origin.x = $gameMap.displayX() * $gameMap.tileWidth();
|
||||
this._MapFogContainer.origin.y = $gameMap.displayY() * $gameMap.tileHeight();
|
||||
// Run Original Function
|
||||
$.Spriteset_Map_update.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create MapFog Layer
|
||||
//=============================================================================
|
||||
Spriteset_Map.prototype.createMapFogLayer = function() {
|
||||
// Create MapFog Layer
|
||||
this._MapFogContainer = new Sprite_MapFogContainer();
|
||||
this._MapFogContainer.z = 3;
|
||||
this._tilemap.addChild(this._MapFogContainer);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
|
@ -1,163 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Parallax Pictures
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_ParallaxPictures = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.ParallaxPictures = _TDS_.ParallaxPictures || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Adds the ability to set parallax effects to pictures
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// * Set Picture as Parallax
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.changeParallaxPictureSpeed = function(pictureId, xSpeed, ySpeed) {
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(pictureId);
|
||||
// If Picture Exists
|
||||
if (picture) {
|
||||
// Set Picture X & Y Speeds
|
||||
picture._parallaxRect.x = xSpeed == undefined ? picture._parallaxRect.x : xSpeed;
|
||||
picture._parallaxRect.y = ySpeed == undefined ? picture._parallaxRect.y : ySpeed;
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture as Parallax
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.setPictureAsParallax = function(width, height, xSpeed = 0, ySpeed = 0) {
|
||||
// If Next Event Code is 231
|
||||
if (this.nextEventCode() === 231) {
|
||||
// Increase Index
|
||||
this._index++;
|
||||
// Get Command
|
||||
var command = this.currentCommand();
|
||||
// Set Parameters and Indentation
|
||||
this._params = command.parameters;
|
||||
this._indent = command.indent;
|
||||
// Run Show Picture Command
|
||||
this.command231();
|
||||
// Get Picture
|
||||
var picture = $gameScreen.picture(this._params[0])
|
||||
// Setup Parallax
|
||||
picture.setupParallax(xSpeed, ySpeed, width, height);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ParallaxPictures.Game_Picture_initBasic = Game_Picture.prototype.initBasic;
|
||||
//=============================================================================
|
||||
// * Initialize Basic Values
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.initBasic = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ParallaxPictures.Game_Picture_initBasic.call(this);
|
||||
// Clear Parallax
|
||||
this.clearParallax();
|
||||
};
|
||||
//=============================================================================
|
||||
// * If Picture is Parallax
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.isParallax = function() { return this._useParallax; };
|
||||
//=============================================================================
|
||||
// * Set Parallax
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.setupParallax = function(x, y, width, height) {
|
||||
// Set Parallax flag to true
|
||||
this._useParallax = true;
|
||||
// Set Parallax X & Y Speeds
|
||||
this._parallaxRect.x = x; this._parallaxRect.y = y;
|
||||
// Set Width & Height
|
||||
this._parallaxRect.width = width; this._parallaxRect.height = height;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Picture as Parallax
|
||||
//=============================================================================
|
||||
Game_Picture.prototype.clearParallax = function() {
|
||||
// Set Use Parallax Flag to false
|
||||
this._useParallax = false;
|
||||
// Set Parallax Speeds
|
||||
this._parallaxRect = new Rectangle(0, 0, 0, 0)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Picture
|
||||
//-----------------------------------------------------------------------------
|
||||
// The sprite for displaying a picture.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.ParallaxPictures.Sprite_Picture_refresh = Sprite_Picture.prototype._refresh
|
||||
_TDS_.ParallaxPictures.Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;
|
||||
//=============================================================================
|
||||
// * Refresh
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype._refresh = function() {
|
||||
// Get Picture
|
||||
var picture = this.picture();
|
||||
// If Picture exists
|
||||
if (picture) {
|
||||
// If Picture is Parallax
|
||||
if (picture.isParallax()) {
|
||||
// If Parallax Sprite does not Exists
|
||||
if (!this._parallaxSprite) {
|
||||
// Create Parallax Sprite
|
||||
this._parallaxSprite = new TilingSprite();
|
||||
this.addChild(this._parallaxSprite);
|
||||
};
|
||||
// Set Parallax Sprite Bitmap
|
||||
this._parallaxSprite.bitmap = this.bitmap;
|
||||
// Get Parallax Rectangle
|
||||
var rect = picture._parallaxRect;
|
||||
// Move Parallax Sprite
|
||||
this._parallaxSprite.move(this.x, this.y, rect.width, rect.height)
|
||||
// Remove Bitmap
|
||||
this.bitmap = null;
|
||||
} else {
|
||||
// If Parallax Sprite Exists
|
||||
if (this._parallaxSprite) { this.removeChild(this._parallaxSprite); };
|
||||
};
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.ParallaxPictures.Sprite_Picture_refresh.call(this);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Other
|
||||
//=============================================================================
|
||||
Sprite_Picture.prototype.updateOther = function() {
|
||||
// Run Original Function
|
||||
_TDS_.ParallaxPictures.Sprite_Picture_updateOther.call(this);
|
||||
// If There is a Parallax Sprite
|
||||
if (this._parallaxSprite) {
|
||||
// Get Picture
|
||||
var picture = this.picture();
|
||||
var rect = picture._parallaxRect;
|
||||
this._parallaxSprite.origin.x += rect.x;
|
||||
this._parallaxSprite.origin.y += rect.y;
|
||||
};
|
||||
};
|
|
@ -1,330 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Particles
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_Particles = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.Particles = _TDS_.Particles || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Particle system.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_Particle
|
||||
//-----------------------------------------------------------------------------
|
||||
// This sprite class is used to draw and process particle sprites.
|
||||
//=============================================================================
|
||||
function Sprite_Particle() { this.initialize.apply(this, arguments); };
|
||||
Sprite_Particle.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_Particle.prototype.constructor = Sprite_Particle;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_Particle.prototype.initialize = function(bitmap) {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this, bitmap);
|
||||
// Phase Index
|
||||
this._phaseIndex = 0;
|
||||
// Phases
|
||||
this._phases = []
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup
|
||||
//=============================================================================
|
||||
Sprite_Particle.prototype.setup = function(phases) {
|
||||
// Clone Phases
|
||||
this._phases = phases.clone();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Finished
|
||||
//=============================================================================
|
||||
Sprite_Particle.prototype.isFinished = function() { return this._phaseIndex >= this._phases.length; };
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_Particle.prototype.update = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.update.call(this);
|
||||
// Get Current Phase
|
||||
var phase = this._phases[this._phaseIndex];
|
||||
// If Phase Exists
|
||||
if (phase) {
|
||||
// Update Phase
|
||||
this.updatePhase(phase);
|
||||
// If Phase is Finished
|
||||
if (phase.duration <= 0) {
|
||||
// Increase Phase Index
|
||||
this._phaseIndex++
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_Particle.prototype.updatePhase = function(phase) {
|
||||
// Decrease Phase Duration
|
||||
phase.duration--
|
||||
// If Phase as a Function
|
||||
if (phase.functStart) { phase.functStart.call(this, phase); };
|
||||
this.x += phase.x;
|
||||
this.y += phase.y;
|
||||
this.rotation += phase.rotation * (Math.PI / 360);
|
||||
this.opacity += phase.opacity;
|
||||
this.scale.x += phase.scaleX;
|
||||
this.scale.y += phase.scaleY;
|
||||
// If Phase as a Function
|
||||
if (phase.functEnd) { phase.functEnd.call(this, phase); };
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Sprite_BattleFaceStatusEmitter
|
||||
//-----------------------------------------------------------------------------
|
||||
// This sprite is used to display battle face status particles.
|
||||
//=============================================================================
|
||||
function Sprite_BattleFaceStatusEmitter() { this.initialize.apply(this, arguments); };
|
||||
Sprite_BattleFaceStatusEmitter.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_BattleFaceStatusEmitter.prototype.constructor = Sprite_BattleFaceStatusEmitter;
|
||||
//=============================================================================
|
||||
// * Initialize Object
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.initialize = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.initialize.call(this);
|
||||
// Clear Values
|
||||
this.clear();
|
||||
// Deactivate
|
||||
this.deactivate();
|
||||
|
||||
|
||||
|
||||
// this.setupGenerator('suns')
|
||||
// this.activate();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Activate & Deactivate
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.activate = function() { this._active = true;};
|
||||
Sprite_BattleFaceStatusEmitter.prototype.deactivate = function() { this._active = false;};
|
||||
//=============================================================================
|
||||
// * Clear
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.clear = function() {
|
||||
// Set Intensity (How many sprites to spawn each time)
|
||||
this._intensity = 1;
|
||||
this._intensityVariance = 0;
|
||||
// Set Generation Type
|
||||
this._generateFunct = null;
|
||||
// Set Spawn Timer
|
||||
this._spawnTimer = 0;
|
||||
this._spawnTimerVariance = 0;
|
||||
this._spawnTimerCount = this._spawnTimer;
|
||||
// Set Child Limit
|
||||
this._childLimit = 0;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup generator
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.setupGenerator = function(type, settings = {}) {
|
||||
// Clear
|
||||
this.clear();
|
||||
// Switch Type Case
|
||||
switch (type.toLowerCase()) {
|
||||
case 'angrytest':
|
||||
this._intensity = 1;
|
||||
this._intensityVariance = 0;
|
||||
// Set Generation Type
|
||||
this._generateFunct = this.generateAngry;
|
||||
// Set Spawn Timer
|
||||
this._spawnTimer = 10;
|
||||
this._spawnTimerVariance = 0;
|
||||
this._spawnTimerCount = this._spawnTimer;
|
||||
// Set Child Limit
|
||||
this._childLimit = 20;
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Generate Angry
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.generateAngry = function() {
|
||||
// Get Bitmap
|
||||
var bitmap = ImageManager.loadPicture('StatusParticles');
|
||||
// Create Sprite
|
||||
var sprite = new Sprite_Particle(bitmap);
|
||||
sprite.anchor.set(0.5, 0.5)
|
||||
sprite.x = (Math.round(Math.random()) * 2 - 1) * Math.randomInt(45)
|
||||
sprite.y = 0
|
||||
sprite.setFrame(30, 30, 30, 31)
|
||||
sprite.opacity = 0;
|
||||
sprite.scale.set(0, 0);
|
||||
this.addChild(sprite);
|
||||
|
||||
|
||||
// Set Unique Sprite Values
|
||||
sprite._baseX = sprite.x;
|
||||
sprite._angryOffset = Math.randomInt(5)
|
||||
sprite._angrySpeed = 1.5 + (Math.randomInt(100) / 100);
|
||||
|
||||
// Create Shake Function
|
||||
var shakeFunct = function() {
|
||||
// Shake Sprite X value
|
||||
this.x = sprite._baseX + (Math.sin((Graphics.frameCount + sprite._angryOffset) * sprite._angrySpeed) * 3);
|
||||
};
|
||||
// Initialize Phase
|
||||
var phases = [];
|
||||
// Set Phase Values
|
||||
var xSpeed = 0;
|
||||
var ySpeed = -(1 + Math.randomInt(1));
|
||||
var rotation = 0
|
||||
|
||||
// Appear Phase
|
||||
var phase = {duration: 10, x: xSpeed, y: ySpeed, rotation: rotation, opacity: 26, scaleX: 0.1, scaleY: 0.1}
|
||||
phase.functEnd = shakeFunct;
|
||||
phases.push(phase);
|
||||
|
||||
// Main Phase (Move up)
|
||||
var phase = {duration: 30, x: xSpeed, y: ySpeed * 2, rotation: rotation, opacity: 0, scaleX: 0, scaleY: 0}
|
||||
phase.functEnd = shakeFunct;
|
||||
phases.push(phase);
|
||||
|
||||
// Disappear Phase (Explode rotating)
|
||||
var phase = {duration: 10, x: xSpeed, y: ySpeed, rotation: 30, opacity: -26, scaleX: 0.1, scaleY: 0.1}
|
||||
phase.functEnd = shakeFunct;
|
||||
phases.push(phase);
|
||||
// Setup Particle Phases
|
||||
sprite.setup(phases)
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.update = function() {
|
||||
// Super Call
|
||||
Sprite.prototype.update.call(this);
|
||||
// If Children Exists
|
||||
if (this.children.length > 0) {
|
||||
// Go Through Children
|
||||
this.children.forEach(function(particle) {
|
||||
// Remove Child if Finished
|
||||
if (particle.isFinished()) { this.removeChild(particle); };
|
||||
}, this);
|
||||
};
|
||||
// If Active
|
||||
if (this._active) {
|
||||
// If Children Length exceeds child limit
|
||||
if (this.children.length >= this._childLimit) { return; }
|
||||
|
||||
// If Spawn Timer is not null
|
||||
if (this._spawnTimerCount !== null) {
|
||||
// Reduce Spawn Timer Count
|
||||
this._spawnTimerCount--;
|
||||
// If Timer is 0 or less
|
||||
if (this._spawnTimerCount <= 0) {
|
||||
// Set Spawn Timer Count
|
||||
this._spawnTimerCount = this._spawnTimer + Math.randomInt(this._spawnTimerVariance);
|
||||
} else {
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
// Call Generation Function
|
||||
if (this._generateFunct) {
|
||||
// Generate Amount of Sprites
|
||||
for (var i = 0; i < this._intensity + Math.randomInt(this._intensityVariance); i++) {
|
||||
// Run Generation Function
|
||||
this._generateFunct();
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// * Generate
|
||||
//=============================================================================
|
||||
Sprite_BattleFaceStatusEmitter.prototype.generate = function() {
|
||||
|
||||
var bitmap = ImageManager.loadPicture('StatusParticles');
|
||||
|
||||
var sprite = new Sprite_Particle(bitmap);
|
||||
sprite.anchor.set(0.5, 0.5)
|
||||
sprite.x = (Math.round(Math.random()) * 2 - 1) * Math.randomInt(50)
|
||||
sprite.y = Math.randomInt(5);
|
||||
sprite.setFrame(30, 30, 30, 31)
|
||||
sprite.opacity = 0;
|
||||
sprite.scale.set(0, 0);
|
||||
this.addChild(sprite);
|
||||
|
||||
// sprite.opacity = 0;
|
||||
// sprite.scale.x = sprite.scale.y = 0;
|
||||
// sprite.blendMode = Math.random() > 0.5 ? Graphics.BLEND_ADD : 0;
|
||||
// sprite.setBlendColor([219, 10, 91, 100]);
|
||||
|
||||
|
||||
|
||||
var phases = [];
|
||||
|
||||
sprite._sadSpeed = Math.randomInt(10) / 100
|
||||
|
||||
var shakeFunct = function() {
|
||||
|
||||
this.x = sprite._baseX + (Math.sin(Graphics.frameCount * sprite._sadSpeed) * 3);
|
||||
// this.x = this._baseX + (Math.round(Math.random()) * 2 - 1) * Math.randomInt(3)
|
||||
}
|
||||
|
||||
|
||||
var xSpeed = 0;
|
||||
var ySpeed = 0//- (1 + Math.randomInt(1))
|
||||
|
||||
sprite.x = (Math.round(Math.random()) * 2 - 1) * Math.randomInt(30)
|
||||
sprite.y = -80;
|
||||
sprite.y += Math.randomInt(10)
|
||||
sprite.setFrame(90, 30, 30, 31)
|
||||
|
||||
sprite._baseX = sprite.x;
|
||||
|
||||
// Appear Phase
|
||||
var phase = {duration: 10, x: xSpeed, y: ySpeed, rotation: 0, opacity: 26, scaleX: 0.1, scaleY: 0.1}
|
||||
phase.functEnd = shakeFunct;
|
||||
phases.push(phase);
|
||||
|
||||
var phase = {duration: 60, x: xSpeed, y: ySpeed, rotation: 0, opacity: 0, scaleX: 0, scaleY: 0}
|
||||
phase.functEnd = shakeFunct;
|
||||
phases.push(phase);
|
||||
|
||||
|
||||
var phase = {duration: 10, x: xSpeed, y: ySpeed, rotation: 10 + Math.randomInt(10), opacity: -26, scaleX: -0.1, scaleY: -0.1}
|
||||
phase.functEnd = shakeFunct;
|
||||
|
||||
phases.push(phase);
|
||||
|
||||
|
||||
// Setup Particle Phases
|
||||
sprite.setup(phases)
|
||||
};
|
||||
|
|
@ -1,715 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Text Effects
|
||||
// Version: 1.0
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {} ; Imported.TDS_TextEffects = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {} ; _TDS_.TextEffects = _TDS_.TextEffects || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* Text Effects.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
* @param Effects
|
||||
*
|
||||
* @param SINV
|
||||
* @text Vertical Sinusoidal
|
||||
* @parent Effects
|
||||
* @type struct<SINVEffect>[]
|
||||
* @default []
|
||||
* @desc Vertical Sinusoidal wave effect. (Moves up and down in a wave)
|
||||
*
|
||||
* @param SINH
|
||||
* @text Horizontal Sinusoidal
|
||||
* @parent Effects
|
||||
* @type struct<SINHEffect>[]
|
||||
* @default []
|
||||
* @desc Horizontal Sinusoidal wave effect. (Moves left and right in a wave)
|
||||
*
|
||||
* @param SHAKE
|
||||
* @text Shake
|
||||
* @parent Effects
|
||||
* @type struct<SHAKEEffect>[]
|
||||
* @default []
|
||||
* @desc Makes the text shake based on power set.
|
||||
*
|
||||
* @param RAINBOW
|
||||
* @text Rainbow
|
||||
* @parent Effects
|
||||
* @type struct<RAINBOWEffect>[]
|
||||
* @default []
|
||||
* @desc Cycles through colors to create a rainbow effect on the text.
|
||||
*/
|
||||
|
||||
//=============================================================================
|
||||
// * Parameter Structures
|
||||
//=============================================================================
|
||||
/*~struct~SINVEffect:
|
||||
* @param spacing
|
||||
* @text Spacing
|
||||
* @type number
|
||||
* @default 1
|
||||
* @desc Separation value of the wave.
|
||||
*
|
||||
* @param speed
|
||||
* @text Speed
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 0.50
|
||||
* @desc Movement speed of the wave.
|
||||
*
|
||||
* @param amplitude
|
||||
* @type Amplitude
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 0.15
|
||||
* @desc Amount of space to move vertically up and down.
|
||||
*
|
||||
*/
|
||||
/*~struct~SINHEffect:
|
||||
* @param spacing
|
||||
* @text Spacing
|
||||
* @type number
|
||||
* @default 1
|
||||
* @desc Separation value of the wave.
|
||||
*
|
||||
* @param speed
|
||||
* @text Speed
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 0.50
|
||||
* @desc Movement speed of the wave.
|
||||
*
|
||||
* @param amplitude
|
||||
* @type Amplitude
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 0.15
|
||||
* @desc Amount of space to move vertically up and down.
|
||||
*
|
||||
* @param anchor
|
||||
* @type Anchor
|
||||
* @type boolean
|
||||
* @default false
|
||||
* @desc Use anchor point instead of X coordinate.
|
||||
*
|
||||
*/
|
||||
/*~struct~SHAKEEffect:
|
||||
* @param powerX
|
||||
* @text Power X
|
||||
* @type number
|
||||
* @default 3
|
||||
* @desc X-Axis shaking power.
|
||||
*
|
||||
* @param powerY
|
||||
* @text Power Y
|
||||
* @type number
|
||||
* @default 3
|
||||
* @desc Y-Axis shaking power.
|
||||
*
|
||||
* @param timing
|
||||
* @text Timing
|
||||
* @type number
|
||||
* @default 1
|
||||
* @desc Amount of time to wait in frames between each movement.
|
||||
*
|
||||
*/
|
||||
/*~struct~RAINBOWEffect:
|
||||
* @param speed
|
||||
* @type Speed
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 0.30
|
||||
* @desc Cycle speed for the rainbow
|
||||
*
|
||||
* @param amplitude
|
||||
* @text Amplitude
|
||||
* @type number
|
||||
* @default 128
|
||||
* @desc Amount of opacity to apply to rainbow cycles.
|
||||
*
|
||||
* @param center
|
||||
* @text Center
|
||||
* @type number
|
||||
* @default 128
|
||||
* @desc Opacity color from which amplitude will move to and from.
|
||||
*
|
||||
* @param redPhase
|
||||
* @text Red Phase
|
||||
* @type number
|
||||
* @default 2
|
||||
* @desc Red color phase. Used for color application in the cycle.
|
||||
*
|
||||
* @param greenPhase
|
||||
* @text Green Phase
|
||||
* @type number
|
||||
* @default 4
|
||||
* @desc Green color phase. Used for color application in the cycle.
|
||||
*
|
||||
* @param bluePhase
|
||||
* @text Blue Phase
|
||||
* @type number
|
||||
* @default 6
|
||||
* @desc Blue color phase. Used for color application in the cycle.
|
||||
*
|
||||
* @param opacity
|
||||
* @text Opacity
|
||||
* @type number
|
||||
* @default 255
|
||||
* @desc Base opacity of the rainbow color.
|
||||
*
|
||||
* @param useWaveOpacity
|
||||
* @text Use Wave Opacity
|
||||
* @type boolean
|
||||
* @default false
|
||||
* @desc If true it applies a wave effect to the opacity of the rainbow.
|
||||
*/
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("TDS Text Effects");
|
||||
// Initialize After Battle Commmon Event Parameters
|
||||
_TDS_.TextEffects.params = {};
|
||||
_TDS_.TextEffects.letterEffects = {}
|
||||
|
||||
// List of Letter Effects
|
||||
var letterEffects = ['SINV', 'SINH', 'SHAKE', 'RAINBOW']
|
||||
// Go through letter effects
|
||||
for (var i = 0; i < letterEffects.length; i++) {
|
||||
// Get Letter Effect Name
|
||||
var name = letterEffects[i];
|
||||
// Get Data List
|
||||
var dataList = JSON.parse(parameters[name]);
|
||||
// Initialize Letter Effects List
|
||||
var list = _TDS_.TextEffects.letterEffects[name] = [];
|
||||
// Go Through Data list
|
||||
for (var i2 = 0; i2 < dataList.length; i2++) {
|
||||
// Get Data
|
||||
var data = JSON.parse(dataList[i2])
|
||||
// Parse data
|
||||
Object.keys(data).map(function(key, index) { data[key] = JSON.parse(data[key])});
|
||||
// Set Data name
|
||||
data.name = name
|
||||
// Add data to list
|
||||
list.push(data);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Bitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
// The basic object that represents an image.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.TextEffects.Bitmap_initialize = Bitmap.prototype.initialize;
|
||||
_TDS_.TextEffects.Bitmap_drawText = Bitmap.prototype.drawText;
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
Bitmap.prototype.initialize = function(width, height) {
|
||||
// Text Drawing Block flag
|
||||
this._blockTextDrawing = false;
|
||||
// Run Original Function
|
||||
_TDS_.TextEffects.Bitmap_initialize.call(this, width, height);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Block or Unblock text drawing
|
||||
//=============================================================================
|
||||
Bitmap.prototype.blockTextDrawing = function() { this._blockTextDrawing = true; }
|
||||
Bitmap.prototype.unblockTextDrawing = function() { this._blockTextDrawing = false; }
|
||||
//=============================================================================
|
||||
// * Draw Text
|
||||
//=============================================================================
|
||||
Bitmap.prototype.drawText = function(text, x, y, maxWidth, lineHeight, align) {
|
||||
// If Block Text Drawing
|
||||
if (this._blockTextDrawing) { return; }
|
||||
// Run Original Function
|
||||
_TDS_.TextEffects.Bitmap_drawText.call(this, text, x, y, maxWidth, lineHeight, align);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_Base
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the party. Information such as gold and items is
|
||||
// included.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.TextEffects.Window_Base__createAllParts = Window_Base.prototype._createAllParts;
|
||||
_TDS_.TextEffects.Window_Base_initialize = Window_Base.prototype.initialize;
|
||||
_TDS_.TextEffects.Window_Base_update = Window_Base.prototype.update
|
||||
_TDS_.TextEffects.Window_Base_processEscapeCharacter = Window_Base.prototype.processEscapeCharacter
|
||||
_TDS_.TextEffects.Window_Base_processNormalCharacter = Window_Base.prototype.processNormalCharacter;
|
||||
//=============================================================================
|
||||
// * Object Initialize
|
||||
//=============================================================================
|
||||
Window_Base.prototype.initialize = function(x, y, width, height) {
|
||||
// Initialize Letter Effects
|
||||
this.initLetterEffects();
|
||||
// Super Call
|
||||
_TDS_.TextEffects.Window_Base_initialize.call(this, x, y, width, height);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create All Parts
|
||||
//=============================================================================
|
||||
Window_Base.prototype._createAllParts = function() {
|
||||
// Super Call
|
||||
_TDS_.TextEffects.Window_Base__createAllParts.call(this);
|
||||
// Create Letter container
|
||||
this.createLetterEffectContainer();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Normal Character
|
||||
//=============================================================================
|
||||
Window_Base.prototype.processNormalCharacter = function(textState) {
|
||||
// If Character is not empty
|
||||
if (this.canCreateLetterEffectSprite()) {
|
||||
// Create Letter Effect Sprite
|
||||
this.createLetterEffectSprite(textState);
|
||||
// Block Text Drawing
|
||||
this.contents.blockTextDrawing();
|
||||
};
|
||||
// // Block Text Drawing
|
||||
// this.contents.unblockTextDrawing();
|
||||
|
||||
|
||||
// Super Call
|
||||
_TDS_.TextEffects.Window_Base_processNormalCharacter.call(this, textState);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Process Escape Character
|
||||
//=============================================================================
|
||||
Window_Base.prototype.processEscapeCharacter = function(code, textState) {
|
||||
// If Not ignoring letter effec escape codes
|
||||
if (!this.isIgnoringLetterEffectEscapeCodes()) {
|
||||
switch (code) {
|
||||
case 'LETAG': // Tag effects
|
||||
// Set Letter Effect Tag
|
||||
this._letterEffectTag = this.obtainEscapeParam(textState);
|
||||
break
|
||||
case 'LESTP': // Stop all tagged
|
||||
// Get Tag
|
||||
var tag = this.obtainEscapeParam(textState);
|
||||
// Go Through Letter Effects
|
||||
for (var i = 0; i < this._letterEffects.length; i++) {
|
||||
// Get Letter Effect
|
||||
var effect = this._letterEffects[i];
|
||||
// If the effect has a matching tag
|
||||
if (effect.tag === tag) {
|
||||
// Deactivate Effect
|
||||
effect.active = false
|
||||
};
|
||||
};
|
||||
break
|
||||
case 'LESYNCH':
|
||||
// Set Letter Effect Synch index
|
||||
this._letterEffectSynchIndex = this.obtainEscapeParam(textState);
|
||||
break
|
||||
case 'LETMR': // Set Timer
|
||||
// Get Time
|
||||
var time = this.obtainEscapeParam(textState);
|
||||
// If Time is 0
|
||||
if (time === 0) {
|
||||
// Set timer to null
|
||||
this._letterEffectTimer = null;
|
||||
} else {
|
||||
// Set Letter Effect timer time
|
||||
this._letterEffectTimer = time;
|
||||
};
|
||||
break
|
||||
case 'LECLEAR': // Clear All Letter Effects
|
||||
// Go Through Letter Effects
|
||||
for (var i = 0; i < this._letterEffects.length; i++) {
|
||||
// Get Letter Effect
|
||||
var effect = this._letterEffects[i];
|
||||
// If the effect has no end index
|
||||
if (effect.endIndex === Infinity) {
|
||||
// Set Letter Effect End Index
|
||||
effect.endIndex = textState.index;
|
||||
};
|
||||
};
|
||||
// Increase Text State Index (Accounts for needed space)
|
||||
textState.index++
|
||||
break;
|
||||
case 'SINV':
|
||||
// Setup Letter Effect
|
||||
this.setupLetterEffect(code, this.obtainEscapeParam(textState), textState);
|
||||
break;
|
||||
case 'SINH':
|
||||
// Setup Letter Effect
|
||||
this.setupLetterEffect(code, this.obtainEscapeParam(textState), textState);
|
||||
break;
|
||||
case 'QUAKE':
|
||||
// Setup Letter Effect
|
||||
this.setupLetterEffect('SHAKE', this.obtainEscapeParam(textState), textState);
|
||||
break;
|
||||
case 'RAINBOW':
|
||||
// Setup Letter Effect
|
||||
this.setupLetterEffect(code, this.obtainEscapeParam(textState), textState);
|
||||
break;
|
||||
};
|
||||
};
|
||||
// Run Original Function
|
||||
_TDS_.TextEffects.Window_Base_processEscapeCharacter.call(this, code, textState);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Frame Update
|
||||
//=============================================================================
|
||||
Window_Base.prototype.update = function() {
|
||||
// Run Original Function
|
||||
_TDS_.TextEffects.Window_Base_update.call(this);
|
||||
// Update Letter Effects
|
||||
this.updateLetterEffects();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Initialize Letter Effects
|
||||
//=============================================================================
|
||||
Window_Base.prototype.initLetterEffects = function() {
|
||||
// Clear Letter Effect Sprites
|
||||
this.clearLetterEffectSprites();
|
||||
// Initialize Letter Efffect Sprites
|
||||
this._letterEffectSprites = [];
|
||||
// Array of Letter Effects
|
||||
this._letterEffects = []
|
||||
// Array of Finished Letter Effects
|
||||
this._finishedLetterEffects = [];
|
||||
// Letter Effects Active flag
|
||||
this._letterEffectsActive = false;
|
||||
// Set Letter Effect Tag
|
||||
this._letterEffectTag = 0;
|
||||
// Set Letter Effect Timer to null
|
||||
this._letterEffectTimer = null;
|
||||
// Synch Next Letter Effect Sprite
|
||||
this._synchNextLetterEffectSprite = false;
|
||||
// Letter Effect Synch Index
|
||||
this._letterEffectSynchIndex = null;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Letter Container
|
||||
//=============================================================================
|
||||
Window_Base.prototype.createLetterEffectContainer = function() {
|
||||
// Create Letter container sprite
|
||||
this._letterEffectContainerSprite = new Sprite();
|
||||
this.addChild(this._letterEffectContainerSprite);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Letter Effect Sprite can be created
|
||||
//=============================================================================
|
||||
Window_Base.prototype.canCreateLetterEffectSprite = function() {
|
||||
if (this._checkWordWrapMode) { return false; }
|
||||
if (this._letterEffectsActive) { return true; }
|
||||
return false
|
||||
};
|
||||
//=============================================================================
|
||||
// * Determine if Letter Effect Effect Escape Codes should be ignored
|
||||
//=============================================================================
|
||||
Window_Base.prototype.isIgnoringLetterEffectEscapeCodes = function() {
|
||||
if (this._checkWordWrapMode) { return true; }
|
||||
return false
|
||||
};
|
||||
//=============================================================================
|
||||
// * Clear Letter Effect Sprites
|
||||
//=============================================================================
|
||||
Window_Base.prototype.clearLetterEffectSprites = function() {
|
||||
// If Letter Effect Sprites Exist
|
||||
if (this._letterEffectSprites) {
|
||||
// Go through Letter Effect Sprites
|
||||
for (var i = 0; i < this._letterEffectSprites.length; i++) {
|
||||
// Remove Child From container
|
||||
this._letterEffectContainerSprite.removeChild(this._letterEffectSprites[i]);
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Setup Letter Effect
|
||||
//=============================================================================
|
||||
Window_Base.prototype.setupLetterEffect = function(code, index, textState) {
|
||||
// If Index is 0 (Stop)
|
||||
if (index === 0) {
|
||||
// Set Letter Effect End Index
|
||||
this.setLetterEffectEndIndex(code, textState);
|
||||
} else {
|
||||
// Add Letter Effect
|
||||
this.addLetterEffect(this.getLetterEffectBase(code, index-1, textState));
|
||||
};
|
||||
// If there are Letter Effects
|
||||
if (this._letterEffects.length > 0) {
|
||||
// Check Effect Active State
|
||||
var active = this._letterEffects.some(function(effect) {
|
||||
return textState.index < effect.endIndex;
|
||||
}, this);
|
||||
// Set Letter Effects Active Flag
|
||||
this._letterEffectsActive = active;
|
||||
// Bock or Unlock Text drawing
|
||||
active ? this.contents.blockTextDrawing() : this.contents.unblockTextDrawing()
|
||||
};
|
||||
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Letter Effect
|
||||
//=============================================================================
|
||||
Window_Base.prototype.getLetterEffectBase = function(name, index, textState) {
|
||||
// Create Effect
|
||||
var effect = Object.assign({active: true, tag: this._letterEffectTag, startIndex: textState.index, endIndex: Infinity}, _TDS_.TextEffects.letterEffects[name][index])
|
||||
// Set Timer
|
||||
if (this._letterEffectTimer !== null) { effect.timer = 60; };
|
||||
// Return Effect
|
||||
return effect
|
||||
};
|
||||
//=============================================================================
|
||||
// * Add Letter Effect
|
||||
//=============================================================================
|
||||
Window_Base.prototype.addLetterEffect = function(effect) {
|
||||
// Add Letter Effec to Array
|
||||
this._letterEffects.push(effect);
|
||||
// Return effect
|
||||
return effect;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Set Letter Effect End Index
|
||||
//=============================================================================
|
||||
Window_Base.prototype.setLetterEffectEndIndex = function(name, textState) {
|
||||
// Go Through Letter Effects
|
||||
for (var i = 0; i < this._letterEffects.length; i++) {
|
||||
// Get Letter Effect
|
||||
var lEffect = this._letterEffects[i];
|
||||
// If It's a
|
||||
if (lEffect.name === name && lEffect.endIndex === Infinity) {
|
||||
// Set Letter Effect End Index
|
||||
lEffect.endIndex = textState.index;
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Create Letter Effect Sprite
|
||||
//=============================================================================
|
||||
Window_Base.prototype.createLetterEffectSprite = function(textState) {
|
||||
// Get Character
|
||||
var c = textState.text[textState.index];
|
||||
// Get Character width
|
||||
var w = Math.round(this.textWidth(c));
|
||||
// If Character Is empty
|
||||
if (c === ' ') { return; }
|
||||
// Create Bitmap
|
||||
var bitmap = new Bitmap(w, textState.height + 10);
|
||||
// Copy Bitmap Settings
|
||||
bitmap.fontFace = this.contents.fontFace;
|
||||
bitmap.fontSize = this.contents.fontSize;
|
||||
bitmap.textColor = this.contents.textColor;
|
||||
|
||||
// bitmap.fillAll('rgba(255, 0, 0, 0.5)')
|
||||
// Draw Character
|
||||
bitmap.drawText(c, 0, 0, bitmap.width, bitmap.height, 'center');
|
||||
// Create Sprite
|
||||
var sprite = new Sprite(bitmap)
|
||||
|
||||
var padding = this.standardPadding();
|
||||
sprite.x = textState.x + padding;
|
||||
sprite.y = textState.y + padding - 5;
|
||||
|
||||
|
||||
// sprite.x = Math.floor(textState.x + padding + (w / 2));
|
||||
// sprite.y = textState.y + padding + (textState.height / 2) + 5;
|
||||
// sprite.x += 250;
|
||||
// sprite.y += 30
|
||||
// sprite.anchor.set(0.5, 0.5)
|
||||
// sprite.pivot.set(sprite.width / 2, (sprite.height / 2) + 5 )
|
||||
|
||||
// sprite.scale.x += 0.1
|
||||
|
||||
// sprite.pivot.set(0, 0);
|
||||
// sprite.anchor.set(0.5, 0.5)
|
||||
// sprite.scale.y += 0.1
|
||||
// sprite.rotation = 0 + (Math.sin((Graphics.frameCount + (index * 1)) * 0.1) * 1)
|
||||
|
||||
|
||||
// Set Effect Data
|
||||
sprite._effectData = {origin: new Point(sprite.x, sprite.y), offset: new Point(), index: textState.index, position: this._letterEffectSprites.length, tag: this._letterEffectTag }
|
||||
// Add Sprite to Letter Sprites Array
|
||||
this._letterEffectSprites.push(sprite);
|
||||
// Add Sprite as Child to container
|
||||
this._letterEffectContainerSprite.addChild(sprite)
|
||||
// If Letter Effect Synch index is not null
|
||||
if (this._letterEffectSynchIndex !== null) {
|
||||
// Go Through Letter Effects
|
||||
for (var i = 0; i < this._letterEffects.length; i++) {
|
||||
// Get Letter Effect
|
||||
var effect = this._letterEffects[i];
|
||||
// If the effect has a matching tag
|
||||
if (effect.tag === this._letterEffectSynchIndex) {
|
||||
// Set Effect Synch Sprite
|
||||
effect.synchSprite = sprite;
|
||||
};
|
||||
};
|
||||
// Set Letter Effect synch index to null
|
||||
this._letterEffectSynchIndex = null;
|
||||
}
|
||||
};
|
||||
//=============================================================================
|
||||
// * Update Letter Effects
|
||||
//=============================================================================
|
||||
Window_Base.prototype.updateLetterEffects = function() {
|
||||
// Set Letter Effects Container Sprite Visibility
|
||||
this._letterEffectContainerSprite.visible = this.isOpen();
|
||||
// Get Letter Sprites
|
||||
var letterSprites = this._letterEffectSprites;
|
||||
// If Letter Effects Exist
|
||||
if (letterSprites.length > 0) {
|
||||
// Go through Letter Effects
|
||||
for (var i = 0; i < this._letterEffects.length; i++) {
|
||||
// Get Effect
|
||||
var effect = this._letterEffects[i];
|
||||
// Get Synch Sprite
|
||||
var synchSprite = effect.synchSprite;
|
||||
// Go through Letter Sprites
|
||||
for (var i2 = 0; i2 < this._letterEffectSprites.length; i2++) {
|
||||
// Get Sprite
|
||||
var sprite = this._letterEffectSprites[i2];
|
||||
// If Synch Sprite Exists
|
||||
if (synchSprite) {
|
||||
// If Sprite matches synch sprite
|
||||
if (sprite === synchSprite) {
|
||||
// Apply Letter Effect to Sprite
|
||||
this.applyLetterEffectToSprite(effect, sprite);
|
||||
} else {
|
||||
// Get Effect Data
|
||||
var synchEffectData = synchSprite._effectData;
|
||||
var effectData = sprite._effectData;
|
||||
// If Effect Data Matches Effect Tag
|
||||
if (effectData.tag === effect.tag) {
|
||||
// Set Sprite Anchor
|
||||
sprite.anchor.set(synchSprite.anchor.x, synchSprite.anchor.y)
|
||||
// Set Sprite Position
|
||||
sprite.x = effectData.origin.x + synchEffectData.offset.x
|
||||
sprite.y = effectData.origin.y + synchEffectData.offset.y
|
||||
|
||||
sprite.rotation = synchSprite.rotation;
|
||||
|
||||
sprite.setBlendColor(synchSprite._blendColor)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Apply Letter Effect to Sprite
|
||||
this.applyLetterEffectToSprite(effect, sprite);
|
||||
};
|
||||
};
|
||||
// If Effect has a timer
|
||||
if (effect.timer && effect.endIndex !== Infinity) {
|
||||
// Decrease Effect Timer
|
||||
effect.timer--;
|
||||
// If Effect timer is 0 or less
|
||||
if (effect.timer <= 0) { effect.active = false; };
|
||||
};
|
||||
// Add Effect to Finished Letter Effects array if not active
|
||||
if (!effect.active) { this._finishedLetterEffects.push(effect) }
|
||||
};
|
||||
|
||||
// If Finished Letter Effects has members
|
||||
if (this._finishedLetterEffects.length > 0) {
|
||||
// Get removed Indexes
|
||||
var removedIndexes = []
|
||||
// Go through finished effects
|
||||
for (var i = 0; i < this._finishedLetterEffects.length; i++) {
|
||||
// Get Effect
|
||||
var effect = this._finishedLetterEffects[i];
|
||||
// Get Index of Effect
|
||||
var index = this._letterEffects.indexOf(effect);
|
||||
// Remove Effect
|
||||
if (index >= 0) { this._letterEffects.splice(index, 1); }
|
||||
// Add indexes to removed indexes array
|
||||
removedIndexes.push([effect.startIndex, effect.endIndex])
|
||||
};
|
||||
// Go through Letter Sprites
|
||||
for (var i = 0; i < this._letterEffectSprites.length; i++) {
|
||||
// Get Sprite
|
||||
var sprite = this._letterEffectSprites[i]
|
||||
// Get Sprite Effect Data
|
||||
var effectData = sprite._effectData;
|
||||
// Reset Sprite Position
|
||||
sprite.x = effectData.origin.x
|
||||
sprite.y = effectData.origin.y
|
||||
sprite.setBlendColor([0, 0, 0, 0])
|
||||
};
|
||||
// Clear Finished Letter Effects Array
|
||||
this._finishedLetterEffects = []
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Apply Letter Effect to Sprite
|
||||
//=============================================================================
|
||||
Window_Base.prototype.applyLetterEffectToSprite = function(effect, sprite) {
|
||||
// Get Sprite Effect Data
|
||||
var effectData = sprite._effectData;
|
||||
// Get Index
|
||||
var index = effectData.index;
|
||||
// Check if Effect should run
|
||||
if (!effect.active) { return }
|
||||
if (index < effect.startIndex || index >= effect.endIndex) { return; }
|
||||
// Switch Case Effect name
|
||||
switch (effect.name) {
|
||||
case 'test':
|
||||
break;
|
||||
case 'SINH':
|
||||
// Set Effect Anchor
|
||||
if (effect.anchor) {
|
||||
// Set Anchor Position
|
||||
sprite.anchor.y = 0 + (Math.sin((Graphics.frameCount + (index * effect.spacing)) * effect.speed) * effect.amplitude)
|
||||
} else {
|
||||
effectData.offset.x = Math.round((Math.sin((Graphics.frameCount + (index * effect.spacing)) * effect.speed) * effect.amplitude))
|
||||
sprite.x = effectData.origin.x + effectData.offset.x;
|
||||
}
|
||||
break;
|
||||
case 'SINV':
|
||||
sprite.anchor.y = 0 + (Math.sin((Graphics.frameCount + (index * effect.spacing)) * effect.speed) * effect.amplitude)
|
||||
break
|
||||
case 'SHAKE':
|
||||
// If Frame Count matches timing
|
||||
if (Graphics.frameCount % effect.timing === 0) {
|
||||
// Set X & Y Offsets
|
||||
if (effect.powerX > 0) { effectData.offset.x = (Math.max(Math.randomInt(effect.powerX), 1) * (Math.randomInt(100) > 50 ? -1 : 1)) };
|
||||
if (effect.powerY > 0) { effectData.offset.y = (Math.max(Math.randomInt(effect.powerY), 1) * (Math.randomInt(100) > 50 ? -1 : 1)) };
|
||||
// Set Sprite Position
|
||||
sprite.x = effectData.origin.x + effectData.offset.x;
|
||||
sprite.y = effectData.origin.y + effectData.offset.y;
|
||||
};
|
||||
break
|
||||
case 'RAINBOW':
|
||||
var frame = Graphics.frameCount + index;
|
||||
var red = Math.sin(effect.speed * frame + effect.redPhase) * effect.amplitude + effect.center
|
||||
var green = Math.sin(effect.speed * frame + effect.greenPhase) * effect.amplitude + effect.center
|
||||
var blue = Math.sin(effect.speed * frame + effect.bluePhase) * effect.amplitude + effect.center
|
||||
var alpha = effect.useWaveOpacity ? Math.sin(effect.speed * frame) * effect.amplitude + effect.center : effect.opacity;
|
||||
// Set Sprite Color
|
||||
sprite.setBlendColor([red, green, blue, alpha])
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** Window_Message
|
||||
//-----------------------------------------------------------------------------
|
||||
// The window for displaying text messages.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.TextEffects.Window_Message_startMessage = Window_Message.prototype.startMessage;
|
||||
//=============================================================================
|
||||
// * Start Message
|
||||
//=============================================================================
|
||||
Window_Message.prototype.startMessage = function() {
|
||||
// Initialize Letter Effects
|
||||
this.initLetterEffects();
|
||||
// Run Original Function
|
||||
_TDS_.TextEffects.Window_Message_startMessage.call(this);
|
||||
};
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
|
||||
(function ($) {
|
||||
const Alias_getTextData = $.getTextData;
|
||||
$.getTextData = function (file, name, language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
if (!this._data[language].text[file][name])
|
||||
return data = {
|
||||
faceset: "",
|
||||
faceindex: 0,
|
||||
background: 0,
|
||||
position: 2,
|
||||
text: "This message doesn't exist " + file + ' ' + name + ' ' + language
|
||||
};
|
||||
|
||||
// Return Text Data
|
||||
return Alias_getTextData.call(this, file, name, language);
|
||||
};
|
||||
})(LanguageManager);
|
||||
|
||||
|
|
@ -1,595 +0,0 @@
|
|||
//=============================================================================
|
||||
// TDS Language Processor
|
||||
// Version: 1.5
|
||||
//=============================================================================
|
||||
// Add to Imported List
|
||||
var Imported = Imported || {}; Imported.TDS_TextLanguageProcessor = true;
|
||||
// Initialize Alias Object
|
||||
var _TDS_ = _TDS_ || {}; _TDS_.TextLanguageProcessor = _TDS_.TextLanguageProcessor || {};
|
||||
//=============================================================================
|
||||
/*:
|
||||
* @plugindesc
|
||||
* This plugin allows you to use YAML files for multiple language purposes.
|
||||
*
|
||||
* @author TDS
|
||||
*
|
||||
*
|
||||
* @param Default Language
|
||||
* @desc Default language of the game.
|
||||
* @default en
|
||||
*
|
||||
* @help
|
||||
* ============================================================================
|
||||
* * Script calls
|
||||
* ============================================================================
|
||||
*
|
||||
* To manually set the current language use the following in a
|
||||
* script call:
|
||||
*
|
||||
* LanguageManager.setLanguage(LANGUAGE, SAVE);
|
||||
*
|
||||
* LANGUAGE
|
||||
* ^ Language name string.
|
||||
*
|
||||
* SAVE
|
||||
* ^ true/false. If true it will save the language in the config
|
||||
* file so it remembers it when the game is closed and reopened.
|
||||
* (Optional. Defaults to True)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* LanguageManager.setLanguage('jp', false);
|
||||
*
|
||||
* LanguageManager.setLanguage('en');
|
||||
*
|
||||
*/
|
||||
//=============================================================================
|
||||
// Node.js path
|
||||
var path = require('path');
|
||||
// Get Parameters
|
||||
var parameters = PluginManager.parameters("Text_Language_Processor");
|
||||
// Initialize Parameters
|
||||
_TDS_.TextLanguageProcessor.params = {};
|
||||
_TDS_.TextLanguageProcessor.params.defaultLanguage = String(parameters['Default Language'] || 'en');
|
||||
|
||||
//=============================================================================
|
||||
// ** LanguageManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// Static class used for handling Language Text Processing.
|
||||
//=============================================================================
|
||||
function LanguageManager() { throw new Error('This is a static class'); };
|
||||
//=============================================================================
|
||||
// * Object Initialization
|
||||
//=============================================================================
|
||||
LanguageManager.initialize = function () {
|
||||
// Current Language
|
||||
this._language = this.defaultLanguage();
|
||||
// Language Data Object
|
||||
this._data = {};
|
||||
// Load All Language Files
|
||||
this.loadAllLanguageFiles();
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Default Language
|
||||
//=============================================================================
|
||||
LanguageManager.defaultLanguage = function () { return _TDS_.TextLanguageProcessor.params.defaultLanguage; };
|
||||
//=============================================================================
|
||||
// * Get System Text
|
||||
//=============================================================================
|
||||
LanguageManager.setLanguage = function (language, save) {
|
||||
// Set Default save State
|
||||
if (save === undefined) { save = true; };
|
||||
// Set Language
|
||||
LanguageManager._language = language;
|
||||
// If Save Flag
|
||||
if (save) { ConfigManager.save(); };
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Language Data
|
||||
//=============================================================================
|
||||
LanguageManager.languageData = function (language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
// Return Language Data
|
||||
return this._data[language];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get System Text
|
||||
//=============================================================================
|
||||
LanguageManager.getSystemText = function (type, name, language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
// Get Data
|
||||
var data = this._data[language].text.System;
|
||||
// If Data Exists
|
||||
if (data) { return data.terms[type][name]; };
|
||||
// Return Error
|
||||
return "- ERROR -";
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Plugin Text
|
||||
//=============================================================================
|
||||
LanguageManager.getPluginText = function (type, name, language = this._language) {
|
||||
// Get Data
|
||||
var data = this._data[language].text.System
|
||||
// If Data Exists
|
||||
if (data) { return data.plugins[type][name]; };
|
||||
// Return Error
|
||||
return " - ERROR -";
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Input Keys Table
|
||||
//=============================================================================
|
||||
LanguageManager.getInputKeysTable = function () {
|
||||
// Get Data
|
||||
var data = this.languageData().text.System;
|
||||
// Return Input Keys Table
|
||||
return data.inputKeysTable ? data.inputKeysTable : [];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Input Keys Table
|
||||
//=============================================================================
|
||||
LanguageManager.getInputName = function (type, input, language = this._language) {
|
||||
// Get Data
|
||||
var data = this.languageData().text.System;
|
||||
// If Data Exists
|
||||
if (data) { return data.InputNames[type][input]; };
|
||||
// Return Error
|
||||
return " - ERROR -";
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Text Data
|
||||
//=============================================================================
|
||||
LanguageManager.getTextData = function (file, name, language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
// Return Text Data
|
||||
return this._data[language].text[file][name];
|
||||
};
|
||||
//=============================================================================
|
||||
// * Get Message Data
|
||||
//=============================================================================
|
||||
LanguageManager.getMessageData = function (code, language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
// Get Commands
|
||||
var cmd = code.split('.');
|
||||
// Get Data
|
||||
var data = this.getTextData(cmd[0], cmd[1], language);
|
||||
// Return Data
|
||||
return data;
|
||||
};
|
||||
LanguageManager.getDatabaseText = function (code, language) {
|
||||
// Set Default Language
|
||||
if (language === undefined) { language = this._language; }
|
||||
// Get Data
|
||||
var data = this._data[language].text.Database;
|
||||
// If Data Exists
|
||||
if (data) { return data[code]; };
|
||||
// Return Error
|
||||
return "- ERROR -";
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load Language Files
|
||||
//=============================================================================
|
||||
LanguageManager.loadLanguageFiles = function (language) {
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
// Get Folder
|
||||
var folder = '/Languages/' + language + '/';
|
||||
// Get FilePath
|
||||
var filePath = base + folder;
|
||||
// Get Directory List
|
||||
var dirList = fs.readdirSync(filePath);
|
||||
// Initialize Language Data
|
||||
this._data[language] = { text: {} };
|
||||
// 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 Format is yaml
|
||||
if (format === '.yaml') {
|
||||
// Get Language File Data
|
||||
var data = jsyaml.load(fs.readFileSync(filePath + '/' + filename + format, 'utf8'));
|
||||
// Set Language Text Data
|
||||
this._data[language].text[filename] = data;
|
||||
continue;
|
||||
};
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Load All Language Files
|
||||
//=============================================================================
|
||||
LanguageManager.loadAllLanguageFiles = function () {
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var base = path.dirname(process.mainModule.filename);
|
||||
// Get Folder
|
||||
var folder = '/Languages/';
|
||||
// Get FilePath
|
||||
var filePath = base + folder;
|
||||
// Get Directory List
|
||||
var dirList = fs.readdirSync(filePath);
|
||||
// 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);
|
||||
// Get Stat
|
||||
var stat = fs.statSync(filePath + filename)
|
||||
//If it's a directory
|
||||
if (stat.isDirectory()) {
|
||||
// Load Language Files
|
||||
console.log(this.loadLanguageFiles);
|
||||
console.log(this.loadLanguageFiles(directory));
|
||||
};
|
||||
};
|
||||
};
|
||||
// Initialize Language Manager
|
||||
//LanguageManager.initialize();
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// ** ConfigManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that manages the configuration data.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
//_TDS_.TextLanguageProcessor.ConfigManager_makeData = ConfigManager.makeData;
|
||||
//_TDS_.TextLanguageProcessor.ConfigManager_applyData = ConfigManager.applyData;
|
||||
//=============================================================================
|
||||
// * Make Data
|
||||
//=============================================================================
|
||||
/*ConfigManager.makeData = function() {
|
||||
// Get Original Config Object
|
||||
var config = _TDS_.TextLanguageProcessor.ConfigManager_makeData.call(this);
|
||||
// Set Language
|
||||
config.language = LanguageManager._language;
|
||||
// Return config object
|
||||
return config;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Apply Data
|
||||
//=============================================================================
|
||||
ConfigManager.applyData = function(config) {
|
||||
// Run Original Function
|
||||
_TDS_.TextLanguageProcessor.ConfigManager_applyData.call(this, config);
|
||||
// Set Language
|
||||
this.language = LanguageManager._language = config.language || LanguageManager.defaultLanguage();
|
||||
};*/
|
||||
|
||||
//=============================================================================
|
||||
// ** TextManager
|
||||
//-----------------------------------------------------------------------------
|
||||
// The static class that handles terms and messages.
|
||||
//=============================================================================
|
||||
// * Get System Text
|
||||
//=============================================================================
|
||||
TextManager.basic = function (basicId) { return LanguageManager.getSystemText('basic', basicId); };
|
||||
TextManager.param = function (paramId) { return LanguageManager.getSystemText('param', paramId); };
|
||||
TextManager.command = function (commandId) { return LanguageManager.getSystemText('command', commandId); };
|
||||
TextManager.message = function (messageId) { return LanguageManager.getSystemText('message', messageId); };
|
||||
TextManager.database = function (databaseId) { return LanguageManager.getDatabaseText(databaseId); };
|
||||
|
||||
//=============================================================================
|
||||
// * Get Scene Text
|
||||
//=============================================================================
|
||||
TextManager.basic = function (basicId) { return LanguageManager.getSystemText('basic', basicId); };
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Message
|
||||
//-----------------------------------------------------------------------------
|
||||
// The game object class for the state of the message window that displays text
|
||||
// or selections, etc.
|
||||
//=============================================================================
|
||||
// * Show Language Message
|
||||
//=============================================================================
|
||||
Game_Message.prototype.showLanguageMessage = function (code) {
|
||||
// Get Message Data
|
||||
var data = LanguageManager.getMessageData(code);
|
||||
var faceset = data.faceset || "";
|
||||
var faceindex = data.faceindex || 0;
|
||||
var background = data.background || 0;
|
||||
var positionType = data.position === undefined ? 2 : data.position;
|
||||
// Get Extra Faces
|
||||
var extraFaces = data.extraFaces;
|
||||
// If Data has Extra Faces
|
||||
if (extraFaces) {
|
||||
// Go Through Extra Fraces
|
||||
for (var i = 0; i < extraFaces.length; i++) {
|
||||
// Get Face Data
|
||||
var face = extraFaces[i];
|
||||
// Set Extra Face
|
||||
this.setExtraFace(i, face.faceset, face.faceindex, this.makeFaceBackgroundColor(face.faceBackgroundColor, face.faceset, face.faceindex));
|
||||
};
|
||||
};
|
||||
// Set Message Properties
|
||||
this.setFaceImage(faceset, faceindex);
|
||||
this.setBackground(background);
|
||||
this.setPositionType(positionType);
|
||||
this._faceBackgroundColor = this.makeFaceBackgroundColor(data.faceBackgroundColor, faceset, faceindex);
|
||||
if (Imported && Imported.YEP_MessageCore) {
|
||||
this.addText(data.text);
|
||||
} else {
|
||||
this.add(data.text);
|
||||
};
|
||||
};
|
||||
//=============================================================================
|
||||
// * Make Face Background Color
|
||||
//=============================================================================
|
||||
Game_Message.prototype.makeFaceBackgroundColor = function (color, name, index) {
|
||||
// If Color Exists
|
||||
if (color) {
|
||||
if (color.match(/^rgba/)) { return color; }
|
||||
if (color.match(/^#/)) { return color; }
|
||||
};
|
||||
// If Color Is for FaceName or Color is undefined
|
||||
if (name && color === 'FaceName' || color === undefined) {
|
||||
// Switch Case Name
|
||||
switch (name) {
|
||||
case '04_HERO_OW':
|
||||
return '#52b9fc';
|
||||
break;
|
||||
};
|
||||
};
|
||||
// Return null (Clear Background)
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
Game_Message.prototype.setLanguageLabels = function (labels) {
|
||||
if (!this._choiceLabels) this._choiceLabels = [];
|
||||
this._choiceLabels = labels;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ** Game_Interpreter
|
||||
//-----------------------------------------------------------------------------
|
||||
// The interpreter for running event commands.
|
||||
//=============================================================================
|
||||
// Alias Listing
|
||||
//=============================================================================
|
||||
_TDS_.TextLanguageProcessor.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
|
||||
//=============================================================================
|
||||
// * Plugin Command
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
// Command Switch Case
|
||||
switch (command) {
|
||||
case 'ShowMessage':
|
||||
// Show Language Message
|
||||
this.commandShowLanguageMessage(args[0]);
|
||||
break;
|
||||
case 'ChangeLanguage':
|
||||
// Set Language
|
||||
LanguageManager._language = args[0];
|
||||
break;
|
||||
case 'AddChoice':
|
||||
this.addLanguageChoice(args[0], args[1]);
|
||||
break;
|
||||
case 'ShowChoices':
|
||||
this.commandShowLanguageChoices(args[0]);
|
||||
break;
|
||||
};
|
||||
// Return Original Function
|
||||
return _TDS_.TextLanguageProcessor.Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Language Message
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.commandShowLanguageMessage = function (code) {
|
||||
if (!$gameMessage.isBusy()) {
|
||||
// Show Language Message
|
||||
$gameMessage.showLanguageMessage(code);
|
||||
// Next Event Code Switch Case
|
||||
switch (this.nextEventCode()) {
|
||||
case 102:
|
||||
// Show Choices
|
||||
this._index++;
|
||||
this.setupChoices(this.currentCommand().parameters);
|
||||
break;
|
||||
case 103:
|
||||
// Input Number
|
||||
this._index++;
|
||||
this.setupNumInput(this.currentCommand().parameters);
|
||||
break;
|
||||
case 104:
|
||||
// Select Item
|
||||
this._index++;
|
||||
this.setupItemChoice(this.currentCommand().parameters);
|
||||
break;
|
||||
case 356:
|
||||
var nextCommand = this._list[this._index + 1];
|
||||
var parameters = nextCommand.parameters;
|
||||
var pluginCommand = parameters[0].split(' ')[0];
|
||||
var cancelType = parameters[0].split(' ')[1];
|
||||
if (pluginCommand && pluginCommand === "ShowChoices") {
|
||||
this._index++;
|
||||
this.setupLanguageChoices(cancelType);
|
||||
}
|
||||
break;
|
||||
};
|
||||
// this._index++;
|
||||
this.setWaitMode('message');
|
||||
}
|
||||
return false;
|
||||
};
|
||||
//=============================================================================
|
||||
// * Show Choice
|
||||
//=============================================================================
|
||||
Game_Interpreter.prototype.addLanguageChoice = function (code, label) {
|
||||
if (!this._choices) this._choices = [];
|
||||
if (!this._choiceLabels) this._choiceLabels = [];
|
||||
var data = LanguageManager.getMessageData(code);
|
||||
this._choices.push(data.text);
|
||||
this._choiceLabels.push(label);
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.commandShowLanguageChoices = function (cancelType) {
|
||||
if (!$gameMessage.isBusy()) {
|
||||
this.setupLanguageChoices(parseInt(cancelType));
|
||||
this._index++;
|
||||
this.setWaitMode('message');
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.commandLanguageJumpTo = function (label) {
|
||||
for (var i = 0; i < this._list.length; i++) {
|
||||
var command = this._list[i];
|
||||
if (command.code === 118 && command.parameters[0] === label) {
|
||||
this.jumpTo(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.setupLanguageChoices = function (cancel) {
|
||||
var choices = this._choices.clone();
|
||||
var cancelType = cancel;
|
||||
var defaultType = 0;
|
||||
var positionType = 2;
|
||||
var background = 0;
|
||||
if (cancelType >= choices.length) {
|
||||
cancelType = -2;
|
||||
}
|
||||
$gameMessage.setChoices(choices, defaultType, cancelType);
|
||||
$gameMessage.setChoiceBackground(background);
|
||||
$gameMessage.setChoicePositionType(positionType);
|
||||
$gameMessage.setLanguageLabels(this._choiceLabels.clone());
|
||||
$gameMessage.setChoiceCallback(function (n) {
|
||||
if (n >= 0) {
|
||||
this.commandLanguageJumpTo($gameMessage._choiceLabels[n]);
|
||||
} else {
|
||||
this._branch[this._indent] = n;
|
||||
}
|
||||
}.bind(this));
|
||||
this._choices = [];
|
||||
this._choiceLabels = [];
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Window_Base_drawTextEx = Window_Base.prototype.drawTextEx;
|
||||
Window_Base.prototype.drawTextEx = function (text, x, y) {
|
||||
if (!text) _TDS_.TextLanguageProcessor.Window_Base_drawTextEx.call(this, text, x, y);
|
||||
var regex = /\{(.*?)\}/;
|
||||
var result;
|
||||
while ((result = regex.exec(text)) !== null) {
|
||||
var dbString = TextManager.database(result[1]);
|
||||
text = text.replace(result[0], dbString);
|
||||
}
|
||||
return _TDS_.TextLanguageProcessor.Window_Base_drawTextEx.call(this, text, x, y);
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Window_Base_drawActorName = Window_Base.prototype.drawActorName;
|
||||
Window_Base.prototype.drawActorName = function (actor, x, y, width) {
|
||||
if (!actor || !actor.name()) return _TDS_.TextLanguageProcessor.Window_Base_drawActorName.call(this, actor, x, y, width);
|
||||
width = width || 168;
|
||||
this.changeTextColor(this.hpColor(actor));
|
||||
|
||||
var regex = /\{(.*?)\}/;
|
||||
var result;
|
||||
var text = actor.name();
|
||||
while ((result = regex.exec(text)) !== null) {
|
||||
var dbString = TextManager.database(result[1]);
|
||||
text = text.replace(result[0], dbString);
|
||||
}
|
||||
|
||||
this.drawText(text, x, y, width);
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Window_Base_drawActorClass = Window_Base.prototype.drawActorClass;
|
||||
Window_Base.prototype.drawActorClass = function (actor, x, y, width) {
|
||||
if (!actor || !actor.currentClass().name) return _TDS_.TextLanguageProcessor.Window_Base_drawActorClass.call(this, actor, x, y, width);
|
||||
width = width || 168;
|
||||
this.resetTextColor();
|
||||
|
||||
var regex = /\{(.*?)\}/;
|
||||
var result;
|
||||
var text = actor.currentClass().name;
|
||||
while ((result = regex.exec(text)) !== null) {
|
||||
var dbString = TextManager.database(result[1]);
|
||||
text = text.replace(result[0], dbString);
|
||||
}
|
||||
|
||||
this.drawText(text, x, y, width);
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Window_Base_drawActorNickname = Window_Base.prototype.drawActorNickname;
|
||||
Window_Base.prototype.drawActorNickname = function (actor, x, y, width) {
|
||||
if (!actor || !actor.nickname()) return _TDS_.Window_Base_drawActorNickname.call(this, actor, x, y, width);
|
||||
width = width || 270;
|
||||
this.resetTextColor();
|
||||
|
||||
var regex = /\{(.*?)\}/;
|
||||
var result;
|
||||
var text = actor.nickname();
|
||||
while ((result = regex.exec(text)) !== null) {
|
||||
var dbString = TextManager.database(result[1]);
|
||||
text = text.replace(result[0], dbString);
|
||||
}
|
||||
|
||||
this.drawText(text, x, y, width);
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Window_Base_drawItemName = Window_Base.prototype.drawItemName;
|
||||
Window_Base.prototype.drawItemName = function (item, x, y, width) {
|
||||
if (!item || !item.name) return _TDS_.TextLanguageProcessor.Window_Base_drawItemName.call(this, item, x, y, width);
|
||||
width = width || 312;
|
||||
if (item) {
|
||||
var iconBoxWidth = Window_Base._iconWidth + 4;
|
||||
this.resetTextColor();
|
||||
this.drawIcon(item.iconIndex, x + 2, y + 2);
|
||||
|
||||
var regex = /\{(.*?)\}/;
|
||||
var result;
|
||||
var text = item.name;
|
||||
while ((result = regex.exec(text)) !== null) {
|
||||
var dbString = TextManager.database(result[1]);
|
||||
text = text.replace(result[0], dbString);
|
||||
}
|
||||
this.drawText(text, x + iconBoxWidth, y, width - iconBoxWidth);
|
||||
}
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Game_Interpreter_requestImages = Game_Interpreter.prototype.requestImages;
|
||||
Game_Interpreter.prototype.requestImages = function (list, commonList) {
|
||||
if (!list) return;
|
||||
|
||||
list.forEach(function (command) {
|
||||
var params = command.parameters;
|
||||
switch (command.code) {
|
||||
case 231:
|
||||
var image = params[1].replace("_" + LanguageManager.defaultLanguage(), "_" + LanguageManager._language);
|
||||
ImageManager.requestPicture(image);
|
||||
break;
|
||||
}
|
||||
});
|
||||
_TDS_.TextLanguageProcessor.Game_Interpreter_requestImages.call(this, list, commonList);
|
||||
};
|
||||
|
||||
_TDS_.TextLanguageProcessor.Game_Interpreter_command231 = Game_Interpreter.prototype.command231;
|
||||
Game_Interpreter.prototype.command231 = function () {
|
||||
var x, y;
|
||||
if (this._params[3] === 0) { // Direct designation
|
||||
x = this._params[4];
|
||||
y = this._params[5];
|
||||
} else { // Designation with variables
|
||||
x = $gameVariables.value(this._params[4]);
|
||||
y = $gameVariables.value(this._params[5]);
|
||||
}
|
||||
var image = this._params[1].replace("_" + LanguageManager.defaultLanguage(), "_" + LanguageManager._language);
|
||||
$gameScreen.showPicture(this._params[0], image, this._params[2],
|
||||
x, y, this._params[6], this._params[7], this._params[8], this._params[9]);
|
||||
return true;
|
||||
};
|
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